UNPKG

@rnaga/wp-node

Version:

👉 **[View Full Documentation at rnaga.github.io/wp-node →](https://rnaga.github.io/wp-node/)**

41 lines • 2.33 kB
import { z } from "zod"; export declare function unionOfLiterals<T extends string | number>(constants: readonly T[]): readonly [z.ZodLiteral<T>, z.ZodLiteral<T>, ...z.ZodLiteral<T>[]]; export declare const undefinedIfEmptyString: (v?: string | null | undefined) => string | undefined; export declare const numberWithDefault: (d: number) => z.ZodUnion<readonly [z.ZodDefault<z.ZodNumber>, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>; export declare const booleanWithDefault: (d: "true" | "false") => z.ZodUnion<readonly [z.ZodPipe<z.ZodBoolean, z.ZodTransform<"true" | "false", boolean>>, z.ZodDefault<z.ZodEnum<{ true: "true"; false: "false"; }>>, z.ZodNumber]>; export declare const number: z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>; export declare const numberArr: z.ZodUnion<readonly [z.ZodArray<z.ZodNumber>, z.ZodPipe<z.ZodString, z.ZodTransform<number[], string>>]>; export declare const stringArr: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>]>; export declare const boolean: z.ZodUnion<readonly [z.ZodBoolean, z.ZodPipe<z.ZodEnum<{ 0: "0"; 1: "1"; true: "true"; false: "false"; }>, z.ZodTransform<boolean, "0" | "1" | "true" | "false">>]>; export declare const path: z.ZodString; export declare const string: z.ZodPipe<z.ZodAny, z.ZodTransform<string, any>>; export declare const stringZeroOrOne: z.ZodUnion<readonly [z.ZodDefault<z.ZodOptional<z.ZodEnum<{ 0: "0"; 1: "1"; }>>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<string, number>>, z.ZodPipe<z.ZodBoolean, z.ZodTransform<"0" | "1", boolean>>]>; export declare const stringMetaTable: z.ZodEnum<{ post: "post"; site: "site"; user: "user"; blog: "blog"; comment: "comment"; term: "term"; }>; export declare const userRef: z.ZodPipe<z.ZodString, z.ZodTransform<string | number, string>>; export declare const blogFlag: z.ZodEnum<{ public: "public"; archived: "archived"; mature: "mature"; spam: "spam"; deleted: "deleted"; }>; export declare const filterRecordByFields: (data: string | Record<string, unknown> | Record<string, unknown>[], fields: string | string[] | undefined) => string | Record<string, any> | Record<string, any>[]; //# sourceMappingURL=helpers.d.ts.map