/** * Runtime validation schemas and wrappers for the isolation battery's option bags and spec shape. * * @remarks * Follows the repo's eager-validation convention (see the transformers.js STT adapter's * `validation.ts`): `@nhtio/validation` schemas with `.unknown(false)` so typos in an options bag fail * loud at construction time, never silently at first use. This module also installs the public, * validating {@link defineIsolatedService} — re-exported from this battery's `index.ts` barrel — on top * of `types.ts`'s pure {@link resolveIsolatedServiceSpec} primitive. */ import { type EventMap, type IsolatedServiceSpec, type IsolatedServiceSpecInput, type MethodMap, type StreamMap } from "./types"; /** Validator schema for the `{ name, methods?, streams?, events? }` shape `defineIsolatedService` takes. */ export declare const isolatedServiceSpecInputSchema: import("@nhtio/validation").ObjectSchema<{ name: string; methods?: object; streams?: object; events?: object; }>; /** * Validate a spec input against {@link isolatedServiceSpecInputSchema} AND the cross-map name-collision * rule (a name may not appear in more than one of `methods`/`streams`/`events` — methods and streams * both become properties of the same {@link @nhtio/adk/batteries/isolation!IsolatedFacade} object, so a * collision there would silently shadow one implementation with the other). * * @throws {@link @nhtio/adk/batteries/isolation!E_INVALID_ISOLATION_OPTIONS} on any failure. */ export declare const validateIsolatedServiceSpecInput: (input: IsolatedServiceSpecInput) => IsolatedServiceSpecInput; /** * Define an isolated service's spec — validates `input` eagerly (see * {@link validateIsolatedServiceSpecInput}) then resolves it via * {@link @nhtio/adk/batteries/isolation!resolveIsolatedServiceSpec}. This is the public entry point * re-exported as `defineIsolatedService` from this battery's `index.ts` barrel. * * @throws {@link @nhtio/adk/batteries/isolation!E_INVALID_ISOLATION_OPTIONS} when the spec fails * validation (missing/empty `name`, unknown top-level key, or a name collision across * `methods`/`streams`/`events`). */ export declare const defineIsolatedServiceValidated: , S extends StreamMap = Record, E extends EventMap = Record>(input: IsolatedServiceSpecInput) => IsolatedServiceSpec; /** Validator schema for `createIsolatedService`'s options bag. */ export declare const isolatedServiceOptionsSchema: import("@nhtio/validation").ObjectSchema<{ readyTimeoutMs?: number; disposeGraceMs?: number; autoRespawn?: object; encodables?: unknown[]; }>; /** * Validate `createIsolatedService`'s options bag. * * @throws {@link @nhtio/adk/batteries/isolation!E_INVALID_ISOLATION_OPTIONS} on failure. */ export declare const validateIsolatedServiceOptions: (input: T | undefined) => T; /** Validator schema for `serveIsolated`/`serveIsolatedOverPort`'s options bag. */ export declare const serveIsolatedOptionsSchema: import("@nhtio/validation").ObjectSchema<{ encodables?: unknown[]; }>; /** * Validate `serveIsolated`/`serveIsolatedOverPort`'s options bag. * * @throws {@link @nhtio/adk/batteries/isolation!E_INVALID_ISOLATION_OPTIONS} on failure. */ export declare const validateServeIsolatedOptions: (input: T | undefined) => T; /** Validator schema for `spawnIsolated`/`createWorkerTransport`'s options bag — every field {@link * isolatedServiceOptionsSchema} accepts, plus `worker`/`workerOptions`. * * @remarks * Deliberately NOT built via `isolatedServiceOptionsSchema.keys({...})`: `@nhtio/validation`'s `.keys()` * is typed to return `this` (the ORIGINAL object schema's type parameter), so TypeScript rejects a * `worker`/`workerOptions` key that isn't already part of that type param, even though the runtime * behavior of `.keys()` is correct (verified separately — it does properly extend both the allowed-key * set and required-ness at runtime). Declaring a sibling schema that repeats the shared fields (via the * hoisted `autoRespawnSchema`/`encodablesSchema`/`observabilityHooksShape` fragments, so nothing is * duplicated by VALUE) keeps both the runtime schema and its static type in sync without a `.keys()` * type-level workaround. */ export declare const spawnIsolatedOptionsSchema: import("@nhtio/validation").ObjectSchema<{ readyTimeoutMs?: number; disposeGraceMs?: number; autoRespawn?: object; encodables?: unknown[]; worker: string; workerOptions?: object; }>; /** * Validate `spawnIsolated`/`createWorkerTransport`'s options bag. * * @throws {@link @nhtio/adk/batteries/isolation!E_INVALID_ISOLATION_OPTIONS} on failure (missing * `worker`, a `worker` that is neither a string/URL/function, or an unknown top-level key). */ export declare const validateSpawnIsolatedOptions: (input: T) => T;