This file contains 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
// ===== PseudoType ========== | |
export type PseudoType<A> = { | |
readonly kind: 'PseudoType' | |
readonly __UNSAFE__TYPE: A //ATTENTION: type trick (at run-time is undefined, but at static-time is A) | |
} | |
export const PseudoType = <A>():PseudoType<A> => ({kind: 'PseudoType', __UNSAFE__TYPE: undefined as unknown as A}) |
This file contains 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
// An idea for arbitrary type-parameters. (see bellow 'InferTArgs') | |
// === Type Class === | |
type TypeClass0<K extends string> = { | |
readonly kind: 'TypeClass' | |
readonly __TypeClassName: K | |
readonly __0: undefined | |
} |
This file contains 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
export const mymessage = `Hi! I'm a text from an online source` as const |
This file contains 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> = { |
This file contains 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 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 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 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 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 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() |