declare const SHAPE: { shape$: symbol; v$: string; }; type ShapeOptions = { name?: string; meta?: { active?: boolean; suffix?: string; }; keyexpr?: { active?: boolean; }; valexpr?: { active?: boolean; keymark?: string; }; trials?: number; }; type Context = Record & { err?: ErrDesc[] | boolean; log?: (point: string, state: State) => void; skip?: { depth?: number | number[]; keys?: string[]; }; prefix?: string; suffix?: string; }; type ValType = 'any' | // Any type. 'array' | // An array. 'bigint' | // A BigInt value. 'boolean' | // The values `true` or `false`. 'date' | // A Date instance. 'function' | // A function. 'integer' | // A number with no fractional part. 'instance' | // An instance of a constructed object. 'list' | // A list of types under a given logical rule. 'nan' | // The `NaN` value. 'never' | // No type. 'null' | // The `null` value. 'number' | // A number. 'object' | // A plain object. 'string' | // A string (but *not* the empty string). 'symbol' | // A symbol reference. 'regexp' | // A regular expression. 'check' | // A check function. 'undefined'; type Node = { $: typeof SHAPE; readonly __v?: V; t: ValType; d: number; v: any; f: any; r: boolean; p: boolean; n: number; c: any; k: string[]; e: boolean; u: Record; b: Validate[]; a: Validate[]; m: NodeMeta; z?: string; } & { [name: string]: Builder; }; type NodeMeta = Record; type Builder = (opts?: any, // Builder options. ...vals: any[]) => Node; type Validate = ((val: any, update: Update, state: State) => boolean) & { s?: (n: Node) => string; a?: readonly any[]; n?: string; o?: any; }; type IsAny = 0 extends (1 & T) ? true : false; type Trim = S extends ` ${infer R}` ? Trim : S extends `${infer R} ` ? Trim : S; type KeyName = K extends string ? (Trim extends `"${infer Q}":${infer E}` ? ('' extends Trim ? K : Q) : Trim extends `${infer N}:${infer E}` ? (N extends `${string} ${string}` ? K : '' extends Trim ? K : N) : K) : K; type Produced = IsAny extends true ? R : R extends readonly any[] ? R : R extends object ? (V extends object ? Omit & R : R) : R; declare const BARE: unique symbol; type Bare = { readonly [BARE]: R; }; type Literal = { readonly literal$: L; }; type ShapeResult = IsAny extends true ? any : T extends Literal ? L : T extends Node ? ShapeResult : T extends StringConstructor ? string : T extends NumberConstructor ? number : T extends BooleanConstructor ? boolean : T extends DateConstructor ? Date : T extends ArrayConstructor ? any[] : T extends ObjectConstructor ? any : T extends FunctionConstructor ? Function : T extends SymbolConstructor ? symbol : T extends 'String' | 'string' ? string : T extends 'Number' | 'number' | 'Integer' | 'integer' ? number : T extends 'Boolean' | 'boolean' ? boolean : T extends 'Date' | 'date' ? Date : T extends 'Array' | 'array' ? any[] : T extends 'Object' | 'object' | 'Function' | 'function' | 'Symbol' | 'symbol' ? any : T extends RegExp ? string : T extends Date ? Date : T extends readonly [] ? any[] : T extends readonly [infer E] ? ShapeResult[] : T extends readonly any[] ? { -readonly [K in keyof T]: ShapeResult; } : T extends Bare ? R : T extends (this: any, ...args: any[]) => Node ? any : T extends (...args: any[]) => any ? T : T extends { [key: string]: any; } ? { -readonly [K in keyof T as KeyName]: ShapeResult; } : T extends string ? string : T extends number ? number : T extends boolean ? boolean : T; type Names = N extends string ? N : N extends readonly (infer S)[] ? S : never; type PickResult = { [K in keyof V as KeyName extends Names ? K : never]: V[K]; }; type OmitResult = { [K in keyof V as KeyName extends Names ? never : K]: V[K]; }; type ExtendResult = { [K in keyof V as KeyName extends KeyName ? never : K]: V[K]; } & E; declare class State { match: boolean; terse: boolean; dI: number; nI: number; cI: number; pI: number; sI: number; valType: string; isRoot: boolean; key: string; type: string; stop: boolean; nextSibling: boolean; fromDflt: boolean; ignoreVal: boolean | undefined; curerr: any[]; err: any[]; parents: Node[]; keys: string[]; ancestors: Node[]; path: string[]; node: Node; root: any; val: any; parent: any; nodes: (Node | number)[]; vals: any[]; ctx: any; oval: any; check: Function | undefined; checkargs?: Record; trials: any; lastParent: any; constructor(root: any, top: Node, ctx?: Context, match?: boolean, terse?: boolean); next(): void; updateVal(val: any): void; thawParent(p: any): any; } type Update = { done?: boolean; val?: any; uval?: any; node?: Node; type?: ValType; nI?: number; sI?: number; pI?: number; err?: string | ErrDesc | ErrDesc[]; why?: string; fatal?: boolean; }; type ErrDesc = { key: string; type: string; node: Node; value: any; path: string; pathArr: (string | number)[]; why: string; check: string; args: Record; mark: number; text: string; use: any; }; type StandardSchemaV1Issue = { readonly message: string; readonly path?: ReadonlyArray; }; type StandardSchemaV1PathSegment = { readonly key: PropertyKey; }; type StandardSchemaV1Result = StandardSchemaV1SuccessResult | StandardSchemaV1FailureResult; type StandardSchemaV1SuccessResult = { readonly value: Output; readonly issues?: undefined; }; type StandardSchemaV1FailureResult = { readonly issues: ReadonlyArray; }; type StandardSchemaV1Types = { readonly input: Input; readonly output: Output; }; type StandardSchemaV1Props = { readonly version: 1; readonly vendor: string; readonly validate: (value: unknown) => StandardSchemaV1Result | Promise>; readonly types?: StandardSchemaV1Types; }; type StandardSchemaV1 = { readonly '~standard': StandardSchemaV1Props; }; declare function nodize(shape?: any, depth?: number, meta?: NodeMeta): Node; declare function shapify(intop?: S, inopts?: ShapeOptions): { (root?: V, ctx?: Context): Produced>; valid: (root?: V, ctx?: Context) => root is (V & ShapeResult); match: (root?: any, ctx?: Context) => boolean; error: (root?: any, ctx?: Context) => ErrDesc[]; spec: () => any; node: () => Node; stringify: (...rest: any[]) => string; jsonify: () => any; jsonSchema: () => any; json: () => any; toString: (this: any) => string; shape: { shape$: symbol; v$: string; }; }; declare function expr(spec: { src: string; keymark?: string; val?: any; d?: number; meta?: NodeMeta; ancestors?: Node[]; node?: Node; tokens?: string[]; i?: number; refs?: any; carrier?: any; } | string, current?: any): any; declare function build(v: any, opts?: ShapeOptions, top?: boolean): any; declare function truncate(str?: string, len?: number): string; declare const Required: (this: any, shape?: Node | V) => Node; declare const Open: (this: any, shape?: Node | V) => Node; declare const Optional: (this: any, shape?: Node | V) => Node; declare const Coerce: (this: any, shape?: Node | V) => Node; declare const Email: ((this: any, shape?: Node | V) => Node) & Bare; declare const Url: ((this: any, shape?: Node | V) => Node) & Bare; declare const Uuid: ((this: any, shape?: Node | V) => Node) & Bare; declare const DateTime: ((this: any, shape?: Node | V) => Node) & Bare; declare const Ip: ((this: any, shape?: Node | V) => Node) & Bare; declare const Ipv4: ((this: any, shape?: Node | V) => Node) & Bare; declare const Ipv6: ((this: any, shape?: Node | V) => Node) & Bare; declare const Catch: (this: any, fallback: F, shape?: Node | V) => Node; declare const Transform: (this: any, transform: (val: ShapeResult, state: State) => R, shape?: Node | V) => Node; declare const Describe: (this: any, description: string, shape?: Node | V) => Node; declare const Discriminated: >(this: any, tag: T, branches: B) => Node<{ [K in keyof B]: B[K] & { [P in T]: Literal; }; }[keyof B]>; declare const Pick: (this: any, names: N, shape?: Node | V) => Node>; declare const Omit: (this: any, names: N, shape?: Node | V) => Node>; declare const Partial: (this: any, shape?: Node | V) => Node; declare const Extend: (this: any, extra: E, shape?: Node | V) => Node>; declare const Nullable: (this: any, shape?: Node | V) => Node; declare const Integer: ((this: any, shape?: Node | V) => Node) & Bare; declare const Any: ((this: any, shape?: Node | V) => Node) & Bare; declare const Fault: (this: any, msg: string, shape?: Node | V) => Node; declare const Skip: (this: any, shape?: Node | V) => Node; declare const Ignore: (this: any, shape?: Node | V) => Node; declare const Func: ((this: any, shape?: Node | V) => Node) & Bare; declare const Default: (this: any, dval?: D, shape?: Node | V) => Node; declare const Empty: (this: any, shape?: Node | V) => Node; declare const Never: ((this: any, shape?: Node | V) => Node) & Bare; interface KeyBuilder { (this: any): Node; (this: any, depth: number, join: string): Node; (this: any, depth: number): Node; (this: any, depth: (path: string[], state: State) => R): Node; } declare const Key: KeyBuilder & Bare; declare const All: (this: any, ...inshapes: S) => Node; interface NofBuilder { (this: any, count: 0, ...shapes: S): Node; (this: any, count: number, ...shapes: S): Node; (this: any, count: any, ...shapes: S): Node; } declare const Nof: NofBuilder; declare const When: (this: any, cond: any, then?: any, otherwise?: any) => Node; declare const Contains: (this: any, count: any, inshape: any, spec?: any) => Node; declare const Unique: (this: any, spec?: any) => Node; declare const Exact: (this: any, ...vals: T) => Node>; declare const Before: (this: any, validate: Validate, shape?: Node | V) => Node; declare const After: (this: any, validate: Validate, shape?: Node | V) => Node; declare const Check: (this: any, check: Validate | RegExp | string, shape?: Node | V) => Node; declare const Closed: (this: any, shape?: Node | V) => Node; declare const Define: (this: any, inopts: any, shape?: Node | V) => Node; declare const Refer: (this: any, inopts: any, shape?: Node | V) => Node; declare const Rename: (this: any, inopts: any, shape?: Node | V) => Node; declare const Child: (this: any, child?: C, shape?: Node | V) => Node; declare const Rest: (this: any, child?: C, shape?: Node | V) => Node; type TypeRef = 'Number' | 'String' | 'Boolean' | 'Object' | 'Array' | 'Function' | 'Symbol' | 'Integer' | 'Date' | DateConstructor | StringConstructor | NumberConstructor | BooleanConstructor | ArrayConstructor | ObjectConstructor | FunctionConstructor | SymbolConstructor | Symbol | Record | null | undefined | typeof NaN; declare const Type: (this: any, tref: K, shape?: any) => Node>; declare const Min: (this: any, min: number | string, shape?: Node | V) => Node; declare const Max: (this: any, max: number | string, shape?: Node | V) => Node; declare const Above: (this: any, above: number | string, shape?: Node | V) => Node; declare const Below: (this: any, below: number | string, shape?: Node | V) => Node; declare const Len: (this: any, len: number, shape?: Node | V) => Node; declare function buildize(self?: any, shape?: any): Node; declare function makeErr(state: State, text?: string, why?: string, user?: any): ErrDesc; declare function stringify(src: any, dequote?: boolean, expand?: boolean, ignore?: { key?: (string | RegExp)[]; val?: (string | RegExp)[]; }, replacer?: any): any; declare function jsonSchema(top: Node): any; declare const G$: (node: any) => Node; declare const BuilderMap: { Above: typeof Above; After: typeof After; All: typeof All; Any: ((this: any, shape?: Node | V) => Node) & Bare; Before: typeof Before; Below: typeof Below; Catch: typeof Catch; Check: typeof Check; Child: typeof Child; Closed: typeof Closed; Coerce: typeof Coerce; Contains: typeof Contains; DateTime: ((this: any, shape?: Node | V) => Node) & Bare; Default: typeof Default; Define: typeof Define; Describe: typeof Describe; Discriminated: typeof Discriminated; Email: ((this: any, shape?: Node | V) => Node) & Bare; Empty: typeof Empty; Exact: typeof Exact; Extend: typeof Extend; Fault: typeof Fault; Func: ((this: any, shape?: Node | V) => Node) & Bare; Ignore: typeof Ignore; Integer: ((this: any, shape?: Node | V) => Node) & Bare; Ip: ((this: any, shape?: Node | V) => Node) & Bare; Ipv4: ((this: any, shape?: Node | V) => Node) & Bare; Ipv6: ((this: any, shape?: Node | V) => Node) & Bare; Key: KeyBuilder & Bare; Len: typeof Len; Max: typeof Max; Min: typeof Min; Never: ((this: any, shape?: Node | V) => Node) & Bare; Nof: NofBuilder; Nullable: typeof Nullable; Omit: typeof Omit; Open: typeof Open; Optional: typeof Optional; Partial: typeof Partial; Pick: typeof Pick; Refer: typeof Refer; Rename: typeof Rename; Required: typeof Required; Skip: typeof Skip; Transform: typeof Transform; Rest: typeof Rest; Type: typeof Type; Unique: typeof Unique; Url: ((this: any, shape?: Node | V) => Node) & Bare; Uuid: ((this: any, shape?: Node | V) => Node) & Bare; When: typeof When; }; type JsonSchemaImportOptions = { strict?: boolean; }; declare function fromJsonSchema(schema: any, opts?: JsonSchemaImportOptions): any; type ShapeShape = ReturnType & { valid: (root?: D, ctx?: any) => root is (D & S); match: (root?: any, ctx?: any) => boolean; error: (root?: any, ctx?: Context) => ErrDesc[]; spec: () => any; node: () => Node; jsonSchema: () => any; json: () => any; isShape: (v: any) => boolean; shape: typeof SHAPE; } & StandardSchemaV1; type Shape = typeof shapify & typeof BuilderMap & { G$: typeof G$; buildize: typeof buildize; makeErr: typeof makeErr; stringify: typeof stringify; jsonSchema: typeof jsonSchema; fromJsonSchema: typeof fromJsonSchema; truncate: typeof truncate; nodize: typeof nodize; expr: typeof expr; build: typeof build; MakeArgu: typeof MakeArgu; }; declare const Shape: Shape; declare const GAbove: typeof Above; declare const GAfter: typeof After; declare const GAll: typeof All; declare const GAny: ((this: any, shape?: Node | V) => Node) & Bare; declare const GInteger: ((this: any, shape?: Node | V) => Node) & Bare; declare const GCoerce: typeof Coerce; declare const GCatch: typeof Catch; declare const GDescribe: typeof Describe; declare const GDiscriminated: typeof Discriminated; declare const GPick: typeof Pick; declare const GOmit: typeof Omit; declare const GPartial: typeof Partial; declare const GExtend: typeof Extend; declare const GTransform: typeof Transform; declare const GDateTime: ((this: any, shape?: Node | V) => Node) & Bare; declare const GEmail: ((this: any, shape?: Node | V) => Node) & Bare; declare const GIp: ((this: any, shape?: Node | V) => Node) & Bare; declare const GIpv4: ((this: any, shape?: Node | V) => Node) & Bare; declare const GIpv6: ((this: any, shape?: Node | V) => Node) & Bare; declare const GUrl: ((this: any, shape?: Node | V) => Node) & Bare; declare const GUuid: ((this: any, shape?: Node | V) => Node) & Bare; declare const GNullable: typeof Nullable; declare const GBefore: typeof Before; declare const GBelow: typeof Below; declare const GCheck: typeof Check; declare const GChild: typeof Child; declare const GRest: typeof Rest; declare const GClosed: typeof Closed; declare const GDefault: typeof Default; declare const GDefine: typeof Define; declare const GEmpty: typeof Empty; declare const GExact: typeof Exact; declare const GFault: typeof Fault; declare const GFunc: ((this: any, shape?: Node | V) => Node) & Bare; declare const GIgnore: typeof Ignore; declare const GKey: KeyBuilder & Bare; declare const GLen: typeof Len; declare const GMax: typeof Max; declare const GMin: typeof Min; declare const GNever: ((this: any, shape?: Node | V) => Node) & Bare; declare const GNof: NofBuilder; declare const GWhen: typeof When; declare const GContains: typeof Contains; declare const GUnique: typeof Unique; declare const GOpen: typeof Open; declare const GOptional: typeof Optional; declare const GRefer: typeof Refer; declare const GRename: typeof Rename; declare const GRequired: typeof Required; declare const GSkip: typeof Skip; declare const GType: typeof Type; type args = any[] | IArguments; type Argu = (args: args | string, whence: string | Record, spec?: Record) => (typeof args extends string ? ((args: args) => Record) : Record); declare function MakeArgu(name: string): Argu; export type { Validate, Update, Context, ErrDesc, ShapeOptions, JsonSchemaImportOptions, Builder, Node, State, ShapeShape, StandardSchemaV1, StandardSchemaV1Props, StandardSchemaV1Result, StandardSchemaV1Issue, StandardSchemaV1PathSegment, StandardSchemaV1Types, }; export { Shape, G$, nodize, buildize, makeErr, stringify, truncate, expr, MakeArgu, build, fromJsonSchema, Above, After, All, Any, Before, Below, Catch, Check, Child, Closed, Coerce, DateTime, Default, Define, Describe, Discriminated, Extend, Omit, Partial, Pick, Email, Empty, Exact, Fault, Func, Ignore, Integer, Ip, Ipv4, Ipv6, Key, Len, Max, Min, Never, Nof, Nullable, Open, Optional, Refer, Rename, Required, Skip, Transform, Type, Rest, Url, Uuid, When, Contains, Unique, GAbove, GAfter, GAll, GAny, GBefore, GBelow, GCheck, GChild, GClosed, GCoerce, GCatch, GDescribe, GDiscriminated, GPick, GOmit, GPartial, GExtend, GTransform, GDateTime, GEmail, GIp, GIpv4, GIpv6, GUrl, GUuid, GDefault, GDefine, GEmpty, GExact, GFault, GFunc, GIgnore, GInteger, GKey, GLen, GMax, GMin, GNever, GNof, GNullable, GOpen, GOptional, GRefer, GRename, GRequired, GSkip, GType, GRest, GWhen, GContains, GUnique, };