import { type RefinementCtx } from 'zod'; export type Simplify = { [K in keyof T]: T[K]; } & {}; export type Override = Simplify>; export type RequiredKey = Simplify | null : Exclude; }>; export declare const isDefined: (i: T | undefined) => i is T; export declare const preferredOrderCmp: (order: readonly T[]) => (a: T, b: T) => number; export declare function matchesAny(value: null | undefined | T | readonly T[]): (v: unknown) => v is T; /** * Decorator to cache the result of a getter on a class instance. */ export declare const cachedGetter: (target: (this: T) => V, _context: ClassGetterDecoratorContext) => (this: T) => V; export declare function parseB64uJson(input: string): unknown; /** * @example * ```ts * // jwtSchema will only allow base64url chars & "." (dot) * const jwtSchema = z.string().superRefine(jwtCharsRefinement) * ``` */ export declare const jwtCharsRefinement: (data: string, ctx: RefinementCtx) => void; /** * @example * ```ts * type SegmentedString3 = SegmentedString<3> // `${string}.${string}.${string}` * type SegmentedString4 = SegmentedString<4> // `${string}.${string}.${string}.${string}` * ``` * * @note * This utility only provides one way type safety (A SegmentedString<4> can be * assigned to SegmentedString<3> but not vice versa). The purpose of this * utility is to improve DX by avoiding as many potential errors as build time. * DO NOT rely on this to enforce security or data integrity. */ type SegmentedString = Acc['length'] extends C ? `${Acc[0]}` : `${Acc[0]}.${SegmentedString}`; /** * @example * ```ts * const jwtSchema = z.string().superRefine(segmentedStringRefinementFactory(3)) * type Jwt = z.infer // `${string}.${string}.${string}` * ``` */ export declare const segmentedStringRefinementFactory: (count: C, minPartLength?: number) => (data: string, ctx: RefinementCtx) => data is SegmentedString; export declare function isLastOccurrence(v: T, i: number, arr: readonly T[]): boolean; export {}; //# sourceMappingURL=util.d.ts.map