UNPKG

web-signature

Version:

Primitive and fast framework for rendering web interfaces

17 lines (16 loc) 549 B
import prop from "./types/Prop.js"; type TypesMap = { string: string; number: number; boolean: boolean; array: any[]; null: null; }; export default class Prop<T extends keyof TypesMap> implements prop { readonly type: T; readonly required: boolean; readonly validate: (value: string | number | boolean | any[] | null) => boolean; constructor(type: T, required?: boolean, validate?: (value: string | number | boolean | any[] | null) => boolean); isValid(value: TypesMap[keyof TypesMap]): boolean; } export {};