Files
NapCatQQ/.pnpm-store/v3/files/f2/614b78d79aa4285564d69027ec4b3628281cb4a5207c719a1a316ff1e68128c172af7aa5f3846a0aecf844db728a019d87fef361bfc231021fe863151bd8cd
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

23 lines
1.7 KiB
Plaintext

import { TypeBoxError } from '../../type/error/index.mjs';
import { TSchema } from '../../type/schema/index.mjs';
import { StaticDecode } from '../../type/static/index.mjs';
export declare class ParseError extends TypeBoxError {
constructor(message: string);
}
export type TParseOperation = 'Assert' | 'Cast' | 'Clean' | 'Clone' | 'Convert' | 'Decode' | 'Default' | 'Encode' | ({} & string);
export type TParseFunction = (type: TSchema, references: TSchema[], value: unknown) => unknown;
export declare namespace ParseRegistry {
function Delete(key: string): void;
function Set(key: string, callback: TParseFunction): void;
function Get(key: string): TParseFunction | undefined;
}
export declare const ParseDefault: readonly ["Clone", "Clean", "Default", "Convert", "Assert", "Decode"];
/** Parses a value using the default parse pipeline. Will throws an `AssertError` if invalid. */
export declare function Parse<Type extends TSchema, Output = StaticDecode<Type>, Result extends Output = Output>(schema: Type, references: TSchema[], value: unknown): Result;
/** Parses a value using the default parse pipeline. Will throws an `AssertError` if invalid. */
export declare function Parse<Type extends TSchema, Output = StaticDecode<Type>, Result extends Output = Output>(schema: Type, value: unknown): Result;
/** Parses a value using the specified operations. */
export declare function Parse<Type extends TSchema>(operations: TParseOperation[], schema: Type, references: TSchema[], value: unknown): unknown;
/** Parses a value using the specified operations. */
export declare function Parse<Type extends TSchema>(operations: TParseOperation[], schema: Type, value: unknown): unknown;