post-type
v1.0.0
Published
Runtime typing in for TypeScript
Downloads
3
Readme
RTType
Runtime typing in for TypeScript
Usage
import {Type} from "rttype"
const strNumArr = new Type(["string","number"]);
type StrNumArr = Type.From<typeof strNumArr> // (string|number)[]
type StrNumArr = (string|number)[]
Interfaces
const myInterface = new Type({
name : "string",
age : "number",
friends : [{name: "string", age: "number"}],
})
type MyInterface = Type.From<typeof myInterface>
type MyInterface = {
name: string;
age: number;
friends: {
name: string;
age: number;
}[];
}