This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "$schema": "http://json-schema.org/draft-07/schema#", | |
| "$id": "http://json-schema.org/draft-07/schema#", | |
| "title": "Core schema meta-schema", | |
| "definitions": { | |
| "schemaArray": { | |
| "type": "array", | |
| "minItems": 1, | |
| "items": { "$ref": "#" } | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ======================================================================= | |
| // Lenses | |
| // ======================================================================= | |
| type Setter<A, B extends keyof A> = Func2<A, A[B], A[B]> | |
| type Getter<A, B extends keyof A> = Func<A, A[B]> | |
| type Property<A, B extends keyof A> = B |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // uses 'flyd' stream micro-library | |
| type Stream = (_: number) => Stream // this life is a simplification | |
| interface Model { | |
| value: number | |
| } | |
| interface Actions { | |
| increment: () => void |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Just a test of Deno | |
| const aTable = { deno: 'Typescript', grupo: 'Typescript', nome: 'Flavio' } | |
| console.log() | |
| console.table(aTable) | |
| console.log() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let seniors = [ | |
| { | |
| "id": 1, | |
| "name": "Jack", | |
| "active": true, | |
| "level": "senior" | |
| }, | |
| { | |
| "id": 2, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { CmppParamType, Milimeter, Space, Speed, Acceleration, MilimeterPerSecond, MilimeterPerSquareSecond, Pulse } from './application-types' | |
| import { mapObjectIndexed } from '@nextrobot/core-utils'; | |
| //import { ParamMemmap } from './memmap-base'; | |
| // drive instance | |
| // core | |
| type AnyEntry = { readonly type: unknown } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Author: Flavio | |
| type __PairList<T> = { | |
| [Key in keyof T]: { | |
| readonly key: Key | |
| readonly value: T[Key] | |
| } | |
| } | |
| type __Pair<T> = __PairList<T>[keyof T] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Here we will put the solution. | |
| // But before let's have a talk bellow. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // study on using typescript as a host language to pre-process CSS | |
| import { Either, Left, Right } from "../monads/either"; | |
| import { Maybe, Just, Nothing } from "../monads/maybe"; | |
| type PX = { | |
| readonly kind: 'px' | |
| readonly value: number | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Code used to answer bellow stackoverflow question: | |
| // https://stackoverflow.com/a/59363875/8233039 | |
| // super class | |
| type _Super<T> = { | |
| readonly prop1: `bar` | |
| readonly propT: T | |
| } | |
| const _super: _Super<string> = { |