Files
NapCatQQ/.pnpm-store/v3/files/e3/ff8a7c5048ed86337e6062d778d51cc9d05860d6bf0629ec7f938b42e9a0dba465ed47854b90ca38115049134acb7d4227eb784c22cf8c30751c800ec74df2
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

23 lines
1.6 KiB
Plaintext

import { TypeBoxError } from '../../type/error/index';
import { TSchema } from '../../type/schema/index';
import { StaticDecode } from '../../type/static/index';
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;