declare const GUBU: { gubu$: symbol; v$: string; }; type GubuOptions = { name?: string; meta?: { active?: boolean; suffix?: string; }; keyexpr?: { active?: boolean; }; valexpr?: { active?: boolean; keymark?: string; }; }; 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`. 'function' | // A function. '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 GUBU; 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?: any[]; n?: string; }; type ShapeResult = T extends Node ? any : T extends StringConstructor ? string : T extends NumberConstructor ? number : T extends BooleanConstructor ? boolean : T extends ArrayConstructor ? any[] : T extends ObjectConstructor ? any : T extends FunctionConstructor ? Function : T extends SymbolConstructor ? symbol : T extends { [key: string]: any; } ? { [K in keyof T]: ShapeResult; } : T; declare class State { match: 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; checkargs?: Record; constructor(root: any, top: Node, ctx?: Context, match?: boolean); next(): void; updateVal(val: any): void; } 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; why: string; check: string; args: Record; mark: number; text: string; use: any; }; declare class GubuError extends TypeError { gubu: boolean; code: string; gname: string; props: ({ path: string; type: string; value: any; }[]); desc: () => ({ name: string; code: string; err: ErrDesc[]; ctx: any; }); constructor(code: string, gname: string | undefined, err: ErrDesc[], ctx: any); toJSON(): this & { err: any; name: string; message: string; }; } declare function nodize(shape?: any, depth?: number, meta?: NodeMeta): Node; declare function shapify(intop?: S | Node, inopts?: GubuOptions): { (root?: V, ctx?: Context): V & ShapeResult; valid: (root?: V, ctx?: Context) => root is (V & S); match(root?: any, ctx?: Context): boolean; error(root?: any, ctx?: Context): GubuError[]; spec(): any; node(): Node; stringify(...rest: any[]): string; jsonify(): any; toString(this: any): string; gubu: { gubu$: 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; } | string, current?: any): any; declare function build(v: any, opts?: GubuOptions, 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 Any: (this: any, shape?: Node | V) => Node; 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; declare const Default: (this: any, dval?: any, shape?: Node | V) => Node; declare const Empty: (this: any, shape?: Node | V) => Node; declare const Never: (this: any, shape?: Node | V) => Node; declare const Key: (this: any, depth?: number | Function, join?: string) => Node; declare const All: (this: any, ...inshapes: any[]) => Node; declare const Some: (this: any, ...inshapes: any[]) => Node; declare const One: (this: any, ...inshapes: any[]) => Node; declare const Exact: (this: any, ...vals: any[]) => 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?: any, shape?: Node | V) => Node; declare const Rest: (this: any, child?: any, shape?: Node | V) => Node; declare const Type: | null | undefined | typeof NaN>(this: any, tref: V, shape?: any) => (V extends "Number" | NumberConstructor ? number : V extends "Boolean" | BooleanConstructor ? boolean : V extends "String" | StringConstructor ? string : V extends "Array" | ArrayConstructor ? any[] : V extends "Object" | ObjectConstructor ? any : V extends "Function" | FunctionConstructor ? Function : V extends "Symbol" | SymbolConstructor ? Symbol : V extends null ? null : V extends undefined ? undefined : V); 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 const G$: (node: any) => Node; declare const BuilderMap: { Above: (this: any, above: number | string, shape?: Node | V) => Node; After: (this: any, validate: Validate, shape?: Node | V) => Node; All: (this: any, ...inshapes: any[]) => Node; Any: (this: any, shape?: Node | V) => Node; Before: (this: any, validate: Validate, shape?: Node | V) => Node; Below: (this: any, below: number | string, shape?: Node | V) => Node; Check: (this: any, check: Validate | RegExp | string, shape?: Node | V) => Node; Child: (this: any, child?: any, shape?: Node | V) => Node; Closed: (this: any, shape?: Node | V) => Node; Default: (this: any, dval?: any, shape?: Node | V) => Node; Define: (this: any, inopts: any, shape?: Node | V) => Node; Empty: (this: any, shape?: Node | V) => Node; Exact: (this: any, ...vals: any[]) => Node; Fault: (this: any, msg: string, shape?: Node | V) => Node; Func: (this: any, shape?: Node | V) => Node; Ignore: (this: any, shape?: Node | V) => Node; Key: (this: any, depth?: number | Function, join?: string) => Node; Len: (this: any, len: number, shape?: Node | V) => Node; Max: (this: any, max: number | string, shape?: Node | V) => Node; Min: (this: any, min: number | string, shape?: Node | V) => Node; Never: (this: any, shape?: Node | V) => Node; One: (this: any, ...inshapes: any[]) => Node; Open: (this: any, shape?: Node | V) => Node; Optional: (this: any, shape?: Node | V) => Node; Refer: (this: any, inopts: any, shape?: Node | V) => Node; Rename: (this: any, inopts: any, shape?: Node | V) => Node; Required: (this: any, shape?: Node | V) => Node; Skip: (this: any, shape?: Node | V) => Node; Some: (this: any, ...inshapes: any[]) => Node; Rest: (this: any, child?: any, shape?: Node | V) => Node; Type: | null | undefined | typeof NaN>(this: any, tref: V, shape?: any) => (V extends "Number" | NumberConstructor ? number : V extends "Boolean" | BooleanConstructor ? boolean : V extends "String" | StringConstructor ? string : V extends "Array" | ArrayConstructor ? any[] : V extends "Object" | ObjectConstructor ? any : V extends "Function" | FunctionConstructor ? Function : V extends "Symbol" | SymbolConstructor ? Symbol : V extends null ? null : V extends undefined ? undefined : V); }; type GubuShape = ReturnType & { valid: (root?: D, ctx?: any) => root is (D & S); match: (root?: any, ctx?: any) => boolean; error: (root?: any, ctx?: Context) => GubuError[]; spec: () => any; node: () => Node; isShape: (v: any) => boolean; gubu: typeof GUBU; }; type Gubu = typeof shapify & typeof BuilderMap & { G$: typeof G$; buildize: typeof buildize; makeErr: typeof makeErr; stringify: typeof stringify; truncate: typeof truncate; nodize: typeof nodize; expr: typeof expr; build: typeof build; MakeArgu: typeof MakeArgu; }; declare const Gubu: Gubu; declare const GAbove: (this: any, above: number | string, shape?: Node | V) => Node; declare const GAfter: (this: any, validate: Validate, shape?: Node | V) => Node; declare const GAll: (this: any, ...inshapes: any[]) => Node; declare const GAny: (this: any, shape?: Node | V) => Node; declare const GBefore: (this: any, validate: Validate, shape?: Node | V) => Node; declare const GBelow: (this: any, below: number | string, shape?: Node | V) => Node; declare const GCheck: (this: any, check: Validate | RegExp | string, shape?: Node | V) => Node; declare const GChild: (this: any, child?: any, shape?: Node | V) => Node; declare const GRest: (this: any, child?: any, shape?: Node | V) => Node; declare const GClosed: (this: any, shape?: Node | V) => Node; declare const GDefault: (this: any, dval?: any, shape?: Node | V) => Node; declare const GDefine: (this: any, inopts: any, shape?: Node | V) => Node; declare const GEmpty: (this: any, shape?: Node | V) => Node; declare const GExact: (this: any, ...vals: any[]) => Node; declare const GFault: (this: any, msg: string, shape?: Node | V) => Node; declare const GFunc: (this: any, shape?: Node | V) => Node; declare const GIgnore: (this: any, shape?: Node | V) => Node; declare const GKey: (this: any, depth?: number | Function, join?: string) => Node; declare const GLen: (this: any, len: number, shape?: Node | V) => Node; declare const GMax: (this: any, max: number | string, shape?: Node | V) => Node; declare const GMin: (this: any, min: number | string, shape?: Node | V) => Node; declare const GNever: (this: any, shape?: Node | V) => Node; declare const GOne: (this: any, ...inshapes: any[]) => Node; declare const GOpen: (this: any, shape?: Node | V) => Node; declare const GOptional: (this: any, shape?: Node | V) => Node; declare const GRefer: (this: any, inopts: any, shape?: Node | V) => Node; declare const GRename: (this: any, inopts: any, shape?: Node | V) => Node; declare const GRequired: (this: any, shape?: Node | V) => Node; declare const GSkip: (this: any, shape?: Node | V) => Node; declare const GSome: (this: any, ...inshapes: any[]) => Node; declare const GType: | null | undefined | typeof NaN>(this: any, tref: V, shape?: any) => (V extends "Number" | NumberConstructor ? number : V extends "Boolean" | BooleanConstructor ? boolean : V extends "String" | StringConstructor ? string : V extends "Array" | ArrayConstructor ? any[] : V extends "Object" | ObjectConstructor ? any : V extends "Function" | FunctionConstructor ? Function : V extends "Symbol" | SymbolConstructor ? Symbol : V extends null ? null : V extends undefined ? undefined : V); 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, Builder, Node, State, GubuShape, }; export { Gubu, G$, nodize, buildize, makeErr, stringify, truncate, expr, MakeArgu, build, Above, After, All, Any, Before, Below, Check, Child, Closed, Default, Define, Empty, Exact, Fault, Func, Ignore, Key, Len, Max, Min, Never, One, Open, Optional, Refer, Rename, Required, Skip, Some, Type, Rest, GAbove, GAfter, GAll, GAny, GBefore, GBelow, GCheck, GChild, GClosed, GDefault, GDefine, GEmpty, GExact, GFault, GFunc, GIgnore, GKey, GLen, GMax, GMin, GNever, GOne, GOpen, GOptional, GRefer, GRename, GRequired, GSkip, GSome, GType, GRest, };