UNPKG

@toreda/strong-types

Version:

Better TypeScript code in fewer lines.

17 lines (16 loc) 813 B
import { Rules } from '../rules'; import { Strong } from '../strong'; /** * Create Strong object using provided arguments. Should generally be called * by helper functions or factories which create the desired type and pass in * type rules consistently. * @param fallback Value returned when type's current `value` is null. * @param initial (Optional) Initial value for type. When not provided, type's * initial value is `fallback` instead. When reset is called, value * is automatically set to initial if it was provided, or fallback if not. * @param rules Automatic type validation rules applied to any value used with `set`. * @returns * * @category Core */ export declare function strongMake<ValueT>(fallback: ValueT, initial?: ValueT | null, rules?: Rules<ValueT>): Strong<ValueT>;