import { Value } from '@sinclair/typebox/value'; import type { TSchema } from '@sinclair/typebox'; import type { ValueErrorIterator } from '@sinclair/typebox/errors'; import type { FromSchema, JSONSchema } from 'json-schema-to-ts'; export type SyntaxRegistry = Record; export type PlainJsonSchemaEntry = readonly [K, JSONSchema]; export interface RemotePayload { version: string; syntax: S; schemas: E; } export declare function fetchAndBuildPayload(url: string, fetchFn?: typeof fetch): Promise>; /** Helper: identifies selector-like strings */ type _IsSelector = S extends `${string}selector${string}` | `${string}_selector${string}` ? true : false; /** * `StripSelectorKeys` recursively: * • removes object keys that look like selectors * • removes *string values* that look like selectors (e.g. in string unions) * • filters selector strings out of arrays/tuples */ export type StripSelectorKeys = T extends readonly (infer U)[] ? Exclude, never>[] : T extends object ? { [K in keyof T as K extends string ? _IsSelector extends true ? never : K : K]: StripSelectorKeys; } : T extends string ? (_IsSelector extends true ? never : T) : T; /** * Lightweight structural interface used to cast the heavy inferred client * object, preventing the compiler from expanding the full literal type. */ export interface TypeSafeClient, E extends readonly (readonly [string, any])[]> { version: string; syntax: S; schemas: Record; check(key: K, data: unknown): data is StripSelectorKeys[1]>>; assert(key: K, data: unknown): asserts data is StripSelectorKeys[1]>>; validate(key: K, data: unknown): { value: StripSelectorKeys[1]>>; } | { issues: ValueErrorIterator; }; value: typeof Value; type: (key: K) => StripSelectorKeys[1]>>; } /** * **For Block 2:** Creates a type-safe client. * This definitive version uses a simplified generic signature to prevent compiler errors * with large schema registries. */ export declare function createClient; schemas: readonly (readonly [string, any])[]; }>(payload: T): TypeSafeClient; export {};