UNPKG

stnl

Version:

A simple, opinionated schema library built for performance

19 lines (18 loc) 803 B
import type { AnySchema } from "./type.ts"; declare let injectDep: (str: string) => string; export declare const _compileLimits: (schema: AnySchema, input: string, startIndex: number) => string; export declare const _compileObject: (schema: AnySchema, input: string) => string; export declare const _compileToFn: (schema: AnySchema) => string; export declare const _compile: (schema: AnySchema, input: string) => string; /** * Get the compiled JSON assertion code of a schema * @param schema */ export declare const code: (schema: AnySchema, input: string, injectDependency: typeof injectDep) => string; declare let; /** * Get the compiled JSON assertion function of a schema * @param schema */ export declare const compile: <T extends AnySchema>(schema: T) => ((o: any) => o is T["~type"]); export {};