UNPKG

pure-parse

Version:

Strongly typed validation library that decouples type aliases from validation logic

8 lines (7 loc) 1.61 kB
export declare const unionGuardMemo: <T extends readonly [...unknown[]]>(...guards: { [K in keyof T]: import('../guards').Guard<T[K]>; }) => (data: unknown) => data is T[number]; export declare const objectGuardMemo: <T extends Record<string, unknown>>(schema: { [K in keyof T]-?: {} extends Pick<T, K> ? import('../guards').OptionalGuard<T[K]> : import('../guards').Guard<T[K]>; }) => import('../guards').Guard<import('../internals/utility-types').OptionalKeys<T> extends undefined ? T : import('../internals/utility-types').WithOptionalFields<T>>; export declare const objectGuardCompiledMemo: <T extends Record<string, unknown>>(schema: { [K in keyof T]-?: {} extends Pick<T, K> ? import('../guards').OptionalGuard<T[K]> : import('../guards').Guard<T[K]>; }) => import('../guards').Guard<import('../internals/utility-types').OptionalKeys<T> extends undefined ? T : import('../internals/utility-types').WithOptionalFields<T>>; export declare const dictionaryGuardMemo: <Key extends string, Value>(keyGard: import('../guards').Guard<Key>, valueGuard: import('../guards').Guard<Value>) => import('../guards').Guard<string extends Key ? Record<Key, Value> : Partial<Record<Key, Value>>>; export declare const tupleGuardMemo: <T extends readonly [...unknown[]]>(guards: [...{ [K in keyof T]: import('../guards').Guard<T[K]>; }]) => import('../guards').Guard<T>; export declare const arrayGuardMemo: <T>(itemGuard: import('../guards').Guard<T>) => import('../guards').Guard<T[]>; export declare const nonEmptyArrayGuardMemo: <T>(itemGuard: import('../guards').Guard<T>) => import('../guards').Guard<[T, ...T[]]>;