export type Infer = T extends Optional ? Infer : T extends Guard ? U : T extends typeof String ? string : T extends typeof Number ? number : T extends typeof Boolean ? boolean : T extends readonly string[] ? T[number] : T extends readonly [typeof Array, Schema] ? Array> : { -readonly [K in OptionalKeys]?: Infer>; } & { -readonly [K in Exclude | typeof additionalProperties>]: Infer>; }; export type Optional = Record; export type Guard = (x: unknown) => x is T; type OptionalKeys = keyof { [K in keyof T as T[K] extends Optional ? K : never]: 1; }; declare const opt: unique symbol; /** * Symbol that may be placed on a schema object to define how additional properties are handled. * By default, additional properties are not checked. */ export declare const additionalProperties: unique symbol; export type Schema = typeof String | typeof Number | typeof Boolean | readonly string[] | readonly [typeof Array, Schema] | { readonly [k: string]: Schema; [additionalProperties]?: boolean; } | Guard | Optional | Optional | Optional | Optional | Optional | Optional<{ readonly [k: string]: Schema; [additionalProperties]?: boolean; }> | Optional>; /** * Straightforward, fairly dumb, validation helper. * @param schema * @param obj */ export declare function validate(schema: T, obj: unknown): obj is Infer; export declare function optional(x: T): Optional; export declare function isTagString(x: unknown): x is `@${string}`; export {};