UNPKG

@yoroi/common

Version:
22 lines 1.65 kB
import { z } from 'zod'; export declare const parseBoolean: (data: unknown) => boolean | undefined; export declare const parseString: (data: unknown) => string | undefined; export declare const parseSafe: (text: any) => unknown; export declare const parseNumber: (data: unknown) => number | undefined; export declare const isBoolean: (data: unknown) => data is boolean; export declare const isString: (data: unknown) => data is string; export declare const isKeyOf: <T extends Record<string, unknown>>(key: unknown, obj: T) => key is keyof T; export declare const getKeys: <T extends Record<string, unknown>>(obj: T) => (keyof T)[]; export declare const isNonNullable: <T>(data: T | null | undefined) => data is T; export declare const isNumber: (data: unknown) => data is number; export declare const isPositiveNumber: (data: unknown) => data is number; export declare const isArrayOfString: (data: unknown) => data is string[]; export declare const isStringOrArrayOfString: (data: unknown) => data is string | string[]; export declare const createTypeGuardFromSchema: <T>(schema: z.ZodType<T>) => (data: unknown) => data is T; export declare const isRecord: (data: unknown) => data is Record<string, unknown>; export declare const isArray: (data: unknown) => data is unknown[]; export declare const urlSchema: z.ZodString; export declare const isUrl: (data: unknown) => data is string; export declare function isArrayOfType<T>(data: unknown, predicate: (data: unknown) => data is T): data is Array<T>; export declare const isStringLiteral: <T extends string>(literals: Readonly<T[]>, value: unknown) => boolean; //# sourceMappingURL=parsers.d.ts.map