import * as storybook_open_service from 'storybook/open-service';
import * as storybook_internal_types from 'storybook/internal/types';
import { NormalizedProjectAnnotations, ProjectAnnotations, ComposedStoryFn, StrictArgTypes as StrictArgTypes$1 } from 'storybook/internal/types';
import { StrictArgTypes } from 'storybook/internal/csf';

/** The Standard Typed interface. This is a base type extended by other specs. */
interface StandardTypedV1<Input = unknown, Output = Input> {
    /** The Standard properties. */
    readonly "~standard": StandardTypedV1.Props<Input, Output>;
}
declare namespace StandardTypedV1 {
    /** The Standard Typed properties interface. */
    interface Props<Input = unknown, Output = Input> {
        /** The version number of the standard. */
        readonly version: 1;
        /** The vendor name of the schema library. */
        readonly vendor: string;
        /** Inferred types associated with the schema. */
        readonly types?: Types<Input, Output> | undefined;
    }
    /** The Standard Typed types interface. */
    interface Types<Input = unknown, Output = Input> {
        /** The input type of the schema. */
        readonly input: Input;
        /** The output type of the schema. */
        readonly output: Output;
    }
    /** Infers the input type of a Standard Typed. */
    type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
    /** Infers the output type of a Standard Typed. */
    type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
}
/** The Standard Schema interface. */
interface StandardSchemaV1<Input = unknown, Output = Input> {
    /** The Standard Schema properties. */
    readonly "~standard": StandardSchemaV1.Props<Input, Output>;
}
declare namespace StandardSchemaV1 {
    /** The Standard Schema properties interface. */
    interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
        /** Validates unknown input values. */
        readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
    }
    /** The result interface of the validate function. */
    type Result<Output> = SuccessResult<Output> | FailureResult;
    /** The result interface if validation succeeds. */
    interface SuccessResult<Output> {
        /** The typed output value. */
        readonly value: Output;
        /** A falsy value for `issues` indicates success. */
        readonly issues?: undefined;
    }
    interface Options {
        /** Explicit support for additional vendor-specific parameters, if needed. */
        readonly libraryOptions?: Record<string, unknown> | undefined;
    }
    /** The result interface if validation fails. */
    interface FailureResult {
        /** The issues of failed validation. */
        readonly issues: ReadonlyArray<Issue>;
    }
    /** The issue interface of the failure output. */
    interface Issue {
        /** The error message of the issue. */
        readonly message: string;
        /** The path of the issue, if any. */
        readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
    }
    /** The path segment interface of the issue. */
    interface PathSegment {
        /** The key representing a path segment. */
        readonly key: PropertyKey;
    }
    /** The Standard types interface. */
    interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {
    }
    /** Infers the input type of a Standard. */
    type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
    /** Infers the output type of a Standard. */
    type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
}

/** File map used by static snapshot building. Each key represents one serialized state snapshot. */
type StaticStore = Record<string, unknown>;
/** Generic Standard Schema constraint used across open-service definitions. */
type AnySchema = StandardSchemaV1<unknown, unknown>;
/** Stable alias for service identifiers across definition, runtime, and registration APIs. */
type ServiceId = string;
/**
 * Constrains a service's state to a plain object — the only shape the architecture supports.
 *
 * This is not an arbitrary restriction; two layers require it:
 *
 * 1. State is wrapped in a `deepSignal` proxy for fine-grained per-field reactivity, and `deepSignal`
 *    throws ("this object can't be observed") on primitives, `null`, and `undefined` — there are no
 *    fields to track on a scalar.
 * 2. Cross-peer sync (`applyStatePatch` in `service-sync.ts`) merges state by walking object keys;
 *    it has no notion of replacing a whole scalar, so the wire protocol only carries keyed objects.
 *
 * Arrays are technically observable by `deepSignal` but are still rejected here: `applyStatePatch`
 * replaces arrays wholesale rather than merging by key, so a *top-level* array state would silently
 * fail to sync between peers. Wrap collections in a field instead (`{ items: [...] }`).
 *
 * Authoring helpers pair this with an `extends object` bound (which rejects primitives, `null`, and
 * `undefined` while still accepting both `interface` and `type` declarations). The naked `TState` in
 * the intersection keeps it transparent to inference; only an array collapses to the branded error.
 */
type ServiceState<TState> = TState & (TState extends readonly unknown[] ? {
    __openServiceStateError: 'Service state must be a plain object, not an array.';
} : unknown);
/** Public schema shape exposed when describing a schema-backed service contract. */
type SchemaDescriptor = AnySchema;
/** Raw caller-facing value type accepted by a schema-backed operation. */
type InferSchemaInput<TSchema extends AnySchema> = StandardSchemaV1.InferInput<TSchema>;
/** Parsed value type produced by a schema after validation. */
type InferSchemaOutput<TSchema extends AnySchema> = StandardSchemaV1.InferOutput<TSchema>;
/**
 * Named schema maps are the core inference surface for inline open-service authoring.
 *
 * `defineService()` infers one input-schema map and one output-schema map per operation family
 * (queries and commands). Keeping those maps separate gives TypeScript a place to correlate the
 * `input` and `output` properties of each inline object before it contextually types sibling
 * callbacks like `handler`, `load`, `staticPath`, and `staticInputs`.
 */
type OperationInputSchemas = Record<string, AnySchema>;
/**
 * Output-schema maps must stay key-aligned with their input-schema map.
 *
 * The authoring helper uses this alias instead of a plain `Record<string, AnySchema>` so each
 * operation key retains its own input/output schema pair during inference.
 */
type MatchingOutputSchemas<TInputSchemas extends OperationInputSchemas> = {
    [TKey in keyof TInputSchemas]: AnySchema;
};
/**
 * Internal utility used to keep handler maps assignable without collapsing everything to `unknown`.
 */
type BivariantCallback<TArgs extends unknown[], TResult> = {
    bivarianceHack(...args: TArgs): TResult;
}['bivarianceHack'];
/** Runtime shape shared by all command collections after they are built. */
type Command = Record<string, (input: unknown) => Promise<unknown>>;
/**
 * Runtime command map derived directly from the inferred command schema maps.
 *
 * Queries only need command-call typing, not the full command definition objects, so this helper
 * keeps query contexts readable while still preserving exact input/output types per command.
 */
type CommandFunctions<TCommandInputSchemas extends OperationInputSchemas, TCommandOutputSchemas extends MatchingOutputSchemas<TCommandInputSchemas>> = {
    [TKey in keyof TCommandInputSchemas]: BivariantCallback<[
        input: InferSchemaInput<TCommandInputSchemas[TKey]>
    ], Promise<InferSchemaOutput<TCommandOutputSchemas[TKey]>>>;
};
/**
 * Coarse lifecycle of a query's `load`, modeled after TanStack Query's `status`.
 *
 * - `pending` — no successful load has completed yet (and none has failed). The query may still
 *   expose `data` (the synchronous "current best" handler result), but nothing has been loaded.
 * - `error` — the most recent attempt (load rejection, or a synchronous handler / validation throw)
 *   failed. `data` keeps the last successful value, if any.
 * - `success` — a load has completed (or the query has no `load`, so there is nothing to load).
 */
type QueryStatus = 'pending' | 'error' | 'success';
/**
 * Whether a `load` is currently running, modeled after TanStack Query's `fetchStatus` — but named
 * with our own `load` vocabulary because open-service "loads" are any slow async work (computation,
 * extraction, I/O), not specifically remote fetching.
 *
 * - `loading` — a `load` is in flight (the first load, or a reactive background re-load).
 * - `idle` — no `load` is currently running.
 */
type LoadStatus = 'loading' | 'idle';
/**
 * The reactive state of a subscribed query: its current `data` plus the lifecycle of its `load`.
 *
 * `data` and `status` are independent. `data` is the synchronous handler result ("current best
 * effort") and holds the last successful value (or `undefined` before the first success / when a
 * handler throws), while `status`/`loadStatus`/`error` describe the asynchronous `load` lifecycle
 * tracked per subscription. A query with no `load` is `success`/`idle` from its first emission.
 *
 * `isLoading` is intentionally "any load in flight" (TanStack's `isFetching`), and
 * `isInitialLoading` is "a load is in flight and there is nothing to show yet"; the names follow our
 * `load` vocabulary rather than TanStack's `fetch`/`load` split. Unlike TanStack Query, a
 * subscription here can attach to a query whose `data` is already cached in service state, so
 * `isInitialLoading` additionally requires `data === undefined` — it never flags over cached data.
 */
type QueryState<TData> = {
    /** Last successfully produced value; `undefined` before the first success. */
    data: TData | undefined;
    /** The failure that produced `status: 'error'`, otherwise `undefined`. */
    error: Error | undefined;
    status: QueryStatus;
    loadStatus: LoadStatus;
    /** `status === 'pending'`. */
    isPending: boolean;
    /** `status === 'success'`. */
    isSuccess: boolean;
    /** `status === 'error'`. */
    isError: boolean;
    /** `loadStatus === 'loading'` — any load in flight, foreground or background. */
    isLoading: boolean;
    /** `isPending && isLoading && data === undefined` — a first load with nothing to show yet. */
    isInitialLoading: boolean;
    /** `isLoading && !isPending` — a background re-load while data is already shown. */
    isRefreshing: boolean;
};
/**
 * Public runtime shape of a query.
 *
 * - `.get(input)` reads synchronously: it validates input, runs the handler against current state,
 *   and returns the validated result. It does **not** fire the query's `load` — it is a pure
 *   "current best effort" read. (Reads of *other* queries from inside a handler or `load` body still
 *   participate in dependency tracking, so `.loaded()` and subscriptions trigger those dependency
 *   loads; a bare consumer `.get()` does not.)
 * - `.loaded(input)` awaits the full load — this query's `load` plus every transitively read
 *   dependency — before resolving with the validated result.
 * - `.subscribe(input, callback)` invokes `callback` synchronously with the current {@link QueryState}
 *   and again whenever tracked state or the load lifecycle changes (deduped on the whole state).
 *   Subscribing is what fires the query's reactive `load`.
 *
 * There is intentionally no bare-call form: a previous `query(input)` that returned synchronously
 * *and* fired the `load` behind the scenes was removed because the implicit background load was
 * confusing. Read with `.get(input)`, await with `.loaded(input)`, observe with `.subscribe(...)`.
 *
 * Queries whose input schema resolves to `undefined` (for example `v.void()`) may be called with
 * zero arguments: `query.get()`, `query.loaded()`.
 */
type InputQuery<TInput, TOutput> = {
    get(input: TInput): TOutput;
    loaded(input: TInput): Promise<TOutput>;
    subscribe(input: TInput, callback: (state: QueryState<TOutput>) => void): () => void;
    subscribe<TSelected>(input: TInput, selector: (value: TOutput) => TSelected, callback: (state: QueryState<TSelected>) => void): () => void;
};
/** Zero-argument overloads merged into {@link Query} when the input schema is void. */
type VoidQuery<TOutput> = {
    get(): TOutput;
    loaded(): Promise<TOutput>;
    subscribe(callback: (state: QueryState<TOutput>) => void): () => void;
    subscribe<TSelected>(selector: (value: TOutput) => TSelected, callback: (state: QueryState<TSelected>) => void): () => void;
};
type Query<TInput, TOutput> = undefined extends TInput ? VoidQuery<TOutput> & InputQuery<TInput, TOutput> : InputQuery<TInput, TOutput>;
/**
 * Runtime query map derived directly from the inferred query schema maps.
 *
 * The query counterpart to {@link CommandFunctions}: it preserves each sibling query's exact
 * input/output types on the read-only `self.queries` handle, so a handler or `load` can call
 * `self.queries.someQuery.get(input)` without manual casts. `defineService` computes this map from
 * the inferred query schema maps and threads it into the handler/load contexts as their `TQueries`;
 * the erased {@link AnyQueryFunctions} bound is used everywhere the concrete map is not known.
 */
type QueryFunctions<TQueryInputSchemas extends OperationInputSchemas, TQueryOutputSchemas extends MatchingOutputSchemas<TQueryInputSchemas>> = {
    [TKey in keyof TQueryInputSchemas]: Query<InferSchemaInput<TQueryInputSchemas[TKey]>, InferSchemaOutput<TQueryOutputSchemas[TKey]>>;
};
/**
 * Permissive bound for a `self.queries` handle.
 *
 * Every {@link Query} — input or void — structurally satisfies {@link InputQuery} (the void
 * overloads are additive), so this is the supertype that any concrete {@link QueryFunctions} map is
 * assignable to. It is the bound (and erased default) for the `TQueries` parameter below, which lets
 * the precise per-service map flow into handler contexts while still erasing cleanly into the
 * structural `AnyQueryDefinition` storage constraint. Using `Query<unknown, unknown>` here instead
 * would wrongly demand the void zero-arg overloads from input queries.
 */
type AnyQueryFunctions = Record<string, InputQuery<unknown, unknown>>;
/**
 * Read-only service handle exposed to query handlers.
 *
 * Query handlers are strict readers: they can read state and call sibling queries, but they cannot
 * mutate state and cannot invoke commands. Mutations belong in commands; load-side preparation
 * belongs in `load`.
 */
type QuerySelf<TState = unknown, TQueries extends AnyQueryFunctions = AnyQueryFunctions> = {
    readonly state: TState;
    queries: TQueries;
};
/**
 * Load handle exposed to `load` functions.
 *
 * `load` may read state and queries, and may invoke declared commands to mutate state. It does
 * not receive `setState` directly — all writes must flow through commands so authors keep one
 * documented mutation surface per service.
 */
type LoadSelf<TState = unknown, TCommandInputSchemas extends OperationInputSchemas = OperationInputSchemas, TCommandOutputSchemas extends MatchingOutputSchemas<TCommandInputSchemas> = MatchingOutputSchemas<TCommandInputSchemas>, TQueries extends AnyQueryFunctions = AnyQueryFunctions> = QuerySelf<TState, TQueries> & {
    commands: CommandFunctions<TCommandInputSchemas, TCommandOutputSchemas>;
};
/**
 * Mutable service handle exposed to command handlers.
 *
 * Commands receive both `setState` for direct state mutation and `commands` so one command can
 * delegate to another within the same service.
 */
type CommandSelf<TState = unknown, TCommandInputSchemas extends OperationInputSchemas = OperationInputSchemas, TCommandOutputSchemas extends MatchingOutputSchemas<TCommandInputSchemas> = MatchingOutputSchemas<TCommandInputSchemas>, TQueries extends AnyQueryFunctions = AnyQueryFunctions> = LoadSelf<TState, TCommandInputSchemas, TCommandOutputSchemas, TQueries> & {
    setState(mutate: (state: TState) => void): void;
};
type ServiceSummary = {
    id: ServiceId;
    description?: string;
    queryNames: string[];
    commandNames: string[];
};
type OperationDescriptor = {
    name: string;
    description?: string;
    input: SchemaDescriptor;
    output: SchemaDescriptor;
    /** Present when the query declares `staticPath` at definition time. */
    staticPath?: true;
};
type ServiceDescriptor = {
    id: ServiceId;
    description?: string;
    queries: Record<string, OperationDescriptor>;
    commands: Record<string, OperationDescriptor>;
};
/** Context passed to query handlers. */
type QueryCtx<TState, TQueries extends AnyQueryFunctions = AnyQueryFunctions> = {
    self: QuerySelf<TState, TQueries>;
    getService: ServiceRegistryApi['getService'];
};
/** Context passed to `load` functions and static-input enumerators. */
type LoadCtx<TState, TCommandInputSchemas extends OperationInputSchemas = OperationInputSchemas, TCommandOutputSchemas extends MatchingOutputSchemas<TCommandInputSchemas> = MatchingOutputSchemas<TCommandInputSchemas>, TQueries extends AnyQueryFunctions = AnyQueryFunctions> = {
    self: LoadSelf<TState, TCommandInputSchemas, TCommandOutputSchemas, TQueries>;
    getService: ServiceRegistryApi['getService'];
};
/** Static input enumerator stored on registered definitions; always receives load context. */
type RegisteredStaticInputs<TState> = BivariantCallback<[
    ctx: LoadCtx<TState>
], unknown[] | Promise<unknown[]>>;
/** Context passed to command handlers. */
type CommandCtx<TState, TCommandInputSchemas extends OperationInputSchemas = OperationInputSchemas, TCommandOutputSchemas extends MatchingOutputSchemas<TCommandInputSchemas> = MatchingOutputSchemas<TCommandInputSchemas>, TQueries extends AnyQueryFunctions = AnyQueryFunctions> = {
    self: CommandSelf<TState, TCommandInputSchemas, TCommandOutputSchemas, TQueries>;
    getService: ServiceRegistryApi['getService'];
};
/**
 * Declarative definition for one query.
 *
 * Queries validate caller input synchronously, run a synchronous read-only handler, and validate
 * the resolved output. The optional `load` hook is fired by subscriptions (reactively) and by
 * `.loaded()` callers (drained to completion), deduped per `(service, query, input)` while one is
 * already in flight — a bare `.get()` read never fires it.
 *
 * Queries that participate in static JSON generation declare `staticPath` at definition time.
 * `staticInputs` may also be declared here when the input list has no runtime dependencies; inputs
 * that need registry or story-index context belong in server registration instead.
 */
type QueryDefinition<TState, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TCommandInputSchemas extends OperationInputSchemas = OperationInputSchemas, TCommandOutputSchemas extends MatchingOutputSchemas<TCommandInputSchemas> = MatchingOutputSchemas<TCommandInputSchemas>, TQueries extends AnyQueryFunctions = AnyQueryFunctions> = {
    description?: string;
    /**
     * When true, hides this query from `describeService()` output. Defaults to false. Does not disable
     * the query at runtime — callers with a service handle can still invoke it.
     */
    internal?: boolean;
    input: TInputSchema;
    output: TOutputSchema;
    /** Logical path for the serialized state snapshot, relative to this service's output folder. */
    staticPath?: BivariantCallback<[input: InferSchemaOutput<TInputSchema>], string>;
    /** Dependency-free static build inputs declared alongside the public contract. */
    staticInputs?: BivariantCallback<[
    ], InferSchemaInput<TInputSchema>[] | Promise<InferSchemaInput<TInputSchema>[]>>;
    handler?: BivariantCallback<[
        input: InferSchemaOutput<TInputSchema>,
        ctx: QueryCtx<TState, TQueries>
    ], InferSchemaInput<TOutputSchema>>;
    load?: BivariantCallback<[
        input: InferSchemaOutput<TInputSchema>,
        ctx: LoadCtx<TState, TCommandInputSchemas, TCommandOutputSchemas, TQueries>
    ], void | Promise<void>>;
};
/**
 * Declarative definition for one command.
 *
 * Commands validate caller input, run against a mutable context, and validate the resolved output.
 */
type CommandDefinition<TState, TInputSchema extends AnySchema, TOutputSchema extends AnySchema, TCommandInputSchemas extends OperationInputSchemas = OperationInputSchemas, TCommandOutputSchemas extends MatchingOutputSchemas<TCommandInputSchemas> = MatchingOutputSchemas<TCommandInputSchemas>, TQueries extends AnyQueryFunctions = AnyQueryFunctions> = {
    description?: string;
    /**
     * When true, hides this command from `describeService()` output. Defaults to false. Does not
     * disable the command at runtime — callers with a service handle can still invoke it.
     */
    internal?: boolean;
    input: TInputSchema;
    output: TOutputSchema;
    handler?: BivariantCallback<[
        input: InferSchemaOutput<TInputSchema>,
        ctx: CommandCtx<TState, TCommandInputSchemas, TCommandOutputSchemas, TQueries>
    ], InferSchemaInput<TOutputSchema> | Promise<InferSchemaInput<TOutputSchema>>>;
};
/** Internal structural constraint used to store any query definition in a record. */
type AnyQueryDefinition<TState> = {
    description?: string;
    internal?: boolean;
    input: AnySchema;
    output: AnySchema;
    staticPath?: BivariantCallback<[input: unknown], string>;
    staticInputs?: RegisteredStaticInputs<TState>;
    handler?: BivariantCallback<[input: unknown, ctx: QueryCtx<TState>], unknown>;
    load?: BivariantCallback<[input: unknown, ctx: LoadCtx<TState>], void | Promise<void>>;
};
/** Internal structural constraint used to store any command definition in a record. */
type AnyCommandDefinition<TState> = {
    description?: string;
    internal?: boolean;
    input: AnySchema;
    output: AnySchema;
    handler?: BivariantCallback<[
        input: unknown,
        ctx: CommandCtx<TState>
    ], unknown | Promise<unknown>>;
};
/** Named query map attached to a service definition. */
type Queries<TState> = Record<string, AnyQueryDefinition<TState>>;
/** Named command map attached to a service definition. */
type Commands<TState> = Record<string, AnyCommandDefinition<TState>>;
/** Top-level description of a service: identity, initial state, queries, and commands. */
type ServiceDefinition<TState, TQueries extends Queries<TState>, TCommands extends Commands<TState>, TId extends ServiceId = ServiceId> = {
    id: TId;
    description?: string;
    /**
     * When true, hides this service from `listServices()` output. Defaults to false. Does not disable
     * the service at runtime — callers can still resolve it through `getService()`.
     */
    internal?: boolean;
    /**
     * Initial state for the service. Must be a plain object (not a primitive, `null`, or array) — see
     * {@link ServiceState} for why. The authoring boundary (`defineService`) enforces this; the runtime
     * type stays `TState` so already-constructed definitions flow through the registry unchanged.
     */
    initialState: TState;
    queries: TQueries;
    commands: TCommands;
};
/** Structural constraint for any service definition stored in the registry. */
type AnyServiceDefinition = ServiceDefinition<unknown, Queries<unknown>, Commands<unknown>>;
/** Runtime service instance derived from a `ServiceDefinition`. */
type ServiceInstance<TState, TQueries extends Queries<TState>, TCommands extends Commands<TState>> = {
    queries: {
        [TKey in keyof TQueries]: TQueries[TKey] extends {
            input: infer TInputSchema extends AnySchema;
            output: infer TOutputSchema extends AnySchema;
        } ? Query<InferSchemaInput<TInputSchema>, InferSchemaOutput<TOutputSchema>> : never;
    };
    commands: {
        [TKey in keyof TCommands]: TCommands[TKey] extends {
            input: infer TInputSchema extends AnySchema;
            output: infer TOutputSchema extends AnySchema;
        } ? (input: InferSchemaInput<TInputSchema>) => Promise<InferSchemaOutput<TOutputSchema>> : never;
    };
};
/** Runtime instance type recovered from one authored service definition. */
type ServiceInstanceOf<TDefinition extends AnyServiceDefinition> = TDefinition extends ServiceDefinition<infer TState, infer TQueries, infer TCommands> ? ServiceInstance<TState, TQueries, TCommands> : never;
interface ServiceRegistryApi {
    listServices(): Promise<ServiceSummary[]>;
    describeService(serviceId: ServiceId): Promise<ServiceDescriptor>;
    getService<TInstance = RuntimeService>(serviceId: ServiceId): TInstance;
}
type RuntimeService = ServiceInstance<unknown, Queries<unknown>, Commands<unknown>> & ServiceRegistryApi;
type ServiceQueryRegistration<TState> = {
    /** Static build inputs that may depend on registry or other server context. */
    staticInputs?: RegisteredStaticInputs<TState>;
};
type ServiceCommandRegistration<TState, TCommand extends AnyCommandDefinition<TState>> = Pick<TCommand, 'handler'>;
type ServiceRegistrationOptions<TState, TQueries extends Queries<TState>, TCommands extends Commands<TState>> = {
    queries?: {
        [TKey in keyof TQueries]?: ServiceQueryRegistration<TState>;
    };
    commands?: {
        [TKey in keyof TCommands]?: ServiceCommandRegistration<TState, TCommands[TKey]>;
    };
};
type ServerServiceRegistration<TState, TQueries extends Queries<TState>, TCommands extends Commands<TState>> = {
    definition: ServiceDefinition<TState, TQueries, TCommands>;
} & ServiceRegistrationOptions<TState, TQueries, TCommands>;

type InvalidInternalOperationName<TName extends string> = {
    __internal_naming_error: `Operation "${TName}" has internal: true but must be prefixed with "_"`;
};
type InvalidUnderscoreWithoutInternal<TName extends string> = {
    __internal_naming_error: `Operation "${TName}" is prefixed with "_" and must set internal: true`;
};
type InternalOperationNaming<TKey> = TKey extends string ? TKey extends `_${string}` ? {
    internal: true;
} | InvalidUnderscoreWithoutInternal<TKey> : {
    internal?: false;
} | InvalidInternalOperationName<TKey> : {};
/**
 * Authoring-side query map derived from separate query input/output schema maps.
 *
 * The second mapped-type intersection is deliberate. During experiments, TypeScript would infer
 * the `input` schema for each inline query, but then lose the corresponding `output` schema before
 * it contextually typed sibling callbacks. Repeating the output map through a keyed `output` view
 * keeps each query key's input and output schemas correlated while handlers, load hooks, and
 * static callbacks are being typed.
 */
type DefinedQueries<TState, TQueryInputSchemas extends OperationInputSchemas, TQueryOutputSchemas extends MatchingOutputSchemas<TQueryInputSchemas>, TCommandInputSchemas extends OperationInputSchemas, TCommandOutputSchemas extends MatchingOutputSchemas<TCommandInputSchemas>> = {
    [TKey in keyof TQueryInputSchemas]: QueryDefinition<TState, TQueryInputSchemas[TKey], TQueryOutputSchemas[TKey], TCommandInputSchemas, TCommandOutputSchemas, QueryFunctions<TQueryInputSchemas, TQueryOutputSchemas>> & InternalOperationNaming<TKey>;
} & {
    [TKey in keyof TQueryOutputSchemas]: {
        output: TQueryOutputSchemas[TKey];
    };
};
/**
 * Authoring-side command map derived from separate command input/output schema maps.
 *
 * Commands do not need access to the command schema maps in their own context, but they still
 * benefit from the same key-correlation trick as queries so TypeScript preserves each inline
 * command object's `output` schema while typing its `handler`.
 */
type DefinedCommands<TState, TCommandInputSchemas extends OperationInputSchemas, TCommandOutputSchemas extends MatchingOutputSchemas<TCommandInputSchemas>, TQueryInputSchemas extends OperationInputSchemas, TQueryOutputSchemas extends MatchingOutputSchemas<TQueryInputSchemas>> = {
    [TKey in keyof TCommandInputSchemas]: CommandDefinition<TState, TCommandInputSchemas[TKey], TCommandOutputSchemas[TKey], TCommandInputSchemas, TCommandOutputSchemas, QueryFunctions<TQueryInputSchemas, TQueryOutputSchemas>> & InternalOperationNaming<TKey>;
} & {
    [TKey in keyof TCommandOutputSchemas]: {
        output: TCommandOutputSchemas[TKey];
    };
};
/**
 * Finalizes a service definition while preserving inline query and command inference.
 *
 * The generic order matters here. We infer the per-operation schema maps first, then derive the
 * concrete query/command definition maps from those schemas. If we instead ask TypeScript to infer
 * the full runtime `ServiceDefinition` maps directly, it widens callback parameters to `unknown`
 * before it has correlated each inline object's `input` and `output` properties.
 */
declare const defineService: <TState extends object, const TQueryInputSchemas extends OperationInputSchemas, const TQueryOutputSchemas extends MatchingOutputSchemas<TQueryInputSchemas>, const TCommandInputSchemas extends OperationInputSchemas, const TCommandOutputSchemas extends MatchingOutputSchemas<TCommandInputSchemas>, const TId extends ServiceId = ServiceId>(def: {
    id: TId;
    description?: string;
    internal?: boolean;
    initialState: ServiceState<TState>;
    queries: DefinedQueries<TState, TQueryInputSchemas, TQueryOutputSchemas, TCommandInputSchemas, TCommandOutputSchemas>;
    commands: DefinedCommands<TState, TCommandInputSchemas, TCommandOutputSchemas, TQueryInputSchemas, TQueryOutputSchemas>;
}) => ServiceDefinition<TState, DefinedQueries<TState, TQueryInputSchemas, TQueryOutputSchemas, TCommandInputSchemas, TCommandOutputSchemas>, DefinedCommands<TState, TCommandInputSchemas, TCommandOutputSchemas, TQueryInputSchemas, TQueryOutputSchemas>, TId>;

/**
 * Builds the synthetic first-render {@link QueryState} for a subscription hook, from a pure
 * `query.get(input)` read.
 *
 * Subscription hooks must return a {@link QueryState} on their very first render, before the
 * subscription's first emission has delivered the real lifecycle (`useSyncExternalStore` reads the
 * snapshot during render; the React 16-compatible preview hooks read it synchronously too). `get()`
 * returns only data (no lifecycle, no load), so we pair it with a `pending`/`loading` status as a
 * placeholder until the subscription delivers the real lifecycle moments later. A throw from
 * `get()` (e.g. input validation) becomes an `error` state — mirroring what the subscription would
 * emit — so the hook never throws during render.
 *
 * Shared by the manager-side `useServiceQuery` and the preview-side docs hooks so their first-render
 * seeds can never drift apart.
 *
 * Only the query's `get` method is needed, so the parameter is narrowed to that shape: `TOutput` then
 * infers purely (and reliably) from `get`'s return type, rather than through the contravariant
 * positions of the full `Query` type — which would widen `TOutput` and break callers that pass a
 * query with a hand-written payload type.
 */
declare function seedQueryState<TInput, TOutput>(query: {
    get(input: TInput): TOutput;
}, input: TInput): QueryState<TOutput>;
declare function seedQueryState<TInput, TOutput, TSelected>(query: {
    get(input: TInput): TOutput;
}, input: TInput, selector: (value: TOutput) => TSelected): QueryState<TSelected>;

//#endregion
//#region src/methods/fallback/fallback.d.ts
/**
* Fallback type.
*/
type Fallback<TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>>> = MaybeDeepReadonly<InferOutput<TSchema>> | ((dataset?: OutputDataset<InferOutput<TSchema>, InferIssue<TSchema>>, config?: Config<InferIssue<TSchema>>) => MaybeDeepReadonly<InferOutput<TSchema>>);
/**
* Schema with fallback type.
*/
type SchemaWithFallback<TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TFallback$1 extends Fallback<TSchema>> = TSchema & {
  /**
  * The fallback value.
  */
  readonly fallback: TFallback$1;
};
//#endregion
//#region src/methods/fallback/fallbackAsync.d.ts
/**
* Fallback async type.
*/
type FallbackAsync<TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>> = MaybeDeepReadonly<InferOutput<TSchema>> | ((dataset?: OutputDataset<InferOutput<TSchema>, InferIssue<TSchema>>, config?: Config<InferIssue<TSchema>>) => MaybePromise<MaybeDeepReadonly<InferOutput<TSchema>>>);
/**
* Schema with fallback async type.
*/
type SchemaWithFallbackAsync<TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TFallback$1 extends FallbackAsync<TSchema>> = Omit<TSchema, "async" | "~standard" | "~run"> & {
  /**
  * The fallback value.
  */
  readonly fallback: TFallback$1;
  /**
  * Whether it's async.
  */
  readonly async: true;
  /**
  * The Standard Schema properties.
  *
  * @internal
  */
  readonly "~standard": StandardProps<InferInput<TSchema>, InferOutput<TSchema>>;
  /**
  * Parses unknown input values.
  *
  * @param dataset The input dataset.
  * @param config The configuration.
  *
  * @returns The output dataset.
  *
  * @internal
  */
  readonly "~run": (dataset: UnknownDataset, config: Config<BaseIssue<unknown>>) => Promise<OutputDataset<InferOutput<TSchema>, InferIssue<TSchema>>>;
};
//#endregion
//#region src/types/metadata.d.ts
/**
* Base metadata interface.
*/
interface BaseMetadata<TInput$1> {
  /**
  * The object kind.
  */
  readonly kind: "metadata";
  /**
  * The metadata type.
  */
  readonly type: string;
  /**
  * The metadata reference.
  */
  readonly reference: (...args: any[]) => BaseMetadata<any>;
  /**
  * The input, output and issue type.
  *
  * @internal
  */
  readonly "~types"?: {
    readonly input: TInput$1;
    readonly output: TInput$1;
    readonly issue: never;
  } | undefined;
}
//#endregion
//#region src/types/dataset.d.ts
/**
* Unknown dataset interface.
*/
interface UnknownDataset {
  /**
  * Whether is's typed.
  */
  typed?: false;
  /**
  * The dataset value.
  */
  value: unknown;
  /**
  * The dataset issues.
  */
  issues?: undefined;
}
/**
* Success dataset interface.
*/
interface SuccessDataset<TValue$1> {
  /**
  * Whether is's typed.
  */
  typed: true;
  /**
  * The dataset value.
  */
  value: TValue$1;
  /**
  * The dataset issues.
  */
  issues?: undefined;
}
/**
* Partial dataset interface.
*/
interface PartialDataset<TValue$1, TIssue extends BaseIssue<unknown>> {
  /**
  * Whether is's typed.
  */
  typed: true;
  /**
  * The dataset value.
  */
  value: TValue$1;
  /**
  * The dataset issues.
  */
  issues: [TIssue, ...TIssue[]];
}
/**
* Failure dataset interface.
*/
interface FailureDataset<TIssue extends BaseIssue<unknown>> {
  /**
  * Whether is's typed.
  */
  typed: false;
  /**
  * The dataset value.
  */
  value: unknown;
  /**
  * The dataset issues.
  */
  issues: [TIssue, ...TIssue[]];
}
/**
* Output dataset type.
*/
type OutputDataset<TValue$1, TIssue extends BaseIssue<unknown>> = SuccessDataset<TValue$1> | PartialDataset<TValue$1, TIssue> | FailureDataset<TIssue>;
//#endregion
//#region src/types/standard.d.ts
/**
* The Standard Schema properties interface.
*/
interface StandardProps<TInput$1, TOutput$1> {
  /**
  * The version number of the standard.
  */
  readonly version: 1;
  /**
  * The vendor name of the schema library.
  */
  readonly vendor: "valibot";
  /**
  * Validates unknown input values.
  */
  readonly validate: (value: unknown) => StandardResult<TOutput$1> | Promise<StandardResult<TOutput$1>>;
  /**
  * Inferred types associated with the schema.
  */
  readonly types?: StandardTypes<TInput$1, TOutput$1> | undefined;
}
/**
* The result interface of the validate function.
*/
type StandardResult<TOutput$1> = StandardSuccessResult<TOutput$1> | StandardFailureResult;
/**
* The result interface if validation succeeds.
*/
interface StandardSuccessResult<TOutput$1> {
  /**
  * The typed output value.
  */
  readonly value: TOutput$1;
  /**
  * The non-existent issues.
  */
  readonly issues?: undefined;
}
/**
* The result interface if validation fails.
*/
interface StandardFailureResult {
  /**
  * The issues of failed validation.
  */
  readonly issues: readonly StandardIssue[];
}
/**
* The issue interface of the failure output.
*/
interface StandardIssue {
  /**
  * The error message of the issue.
  */
  readonly message: string;
  /**
  * The path of the issue, if any.
  */
  readonly path?: readonly (PropertyKey | StandardPathItem)[] | undefined;
}
/**
* The path item interface of the issue.
*/
interface StandardPathItem {
  /**
  * The key of the path item.
  */
  readonly key: PropertyKey;
}
/**
* The Standard Schema types interface.
*/
interface StandardTypes<TInput$1, TOutput$1> {
  /**
  * The input type of the schema.
  */
  readonly input: TInput$1;
  /**
  * The output type of the schema.
  */
  readonly output: TOutput$1;
}
//#endregion
//#region src/types/schema.d.ts
/**
* Base schema interface.
*/
interface BaseSchema<TInput$1, TOutput$1, TIssue extends BaseIssue<unknown>> {
  /**
  * The object kind.
  */
  readonly kind: "schema";
  /**
  * The schema type.
  */
  readonly type: string;
  /**
  * The schema reference.
  */
  readonly reference: (...args: any[]) => BaseSchema<unknown, unknown, BaseIssue<unknown>>;
  /**
  * The expected property.
  */
  readonly expects: string;
  /**
  * Whether it's async.
  */
  readonly async: false;
  /**
  * The Standard Schema properties.
  *
  * @internal
  */
  readonly "~standard": StandardProps<TInput$1, TOutput$1>;
  /**
  * Parses unknown input values.
  *
  * @param dataset The input dataset.
  * @param config The configuration.
  *
  * @returns The output dataset.
  *
  * @internal
  */
  readonly "~run": (dataset: UnknownDataset, config: Config<BaseIssue<unknown>>) => OutputDataset<TOutput$1, TIssue>;
  /**
  * The input, output and issue type.
  *
  * @internal
  */
  readonly "~types"?: {
    readonly input: TInput$1;
    readonly output: TOutput$1;
    readonly issue: TIssue;
  } | undefined;
}
/**
* Base schema async interface.
*/
interface BaseSchemaAsync<TInput$1, TOutput$1, TIssue extends BaseIssue<unknown>> extends Omit<BaseSchema<TInput$1, TOutput$1, TIssue>, "reference" | "async" | "~run"> {
  /**
  * The schema reference.
  */
  readonly reference: (...args: any[]) => BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>;
  /**
  * Whether it's async.
  */
  readonly async: true;
  /**
  * Parses unknown input values.
  *
  * @param dataset The input dataset.
  * @param config The configuration.
  *
  * @returns The output dataset.
  *
  * @internal
  */
  readonly "~run": (dataset: UnknownDataset, config: Config<BaseIssue<unknown>>) => Promise<OutputDataset<TOutput$1, TIssue>>;
}
//#endregion
//#region src/types/transformation.d.ts
/**
* Base transformation interface.
*/
interface BaseTransformation<TInput$1, TOutput$1, TIssue extends BaseIssue<unknown>> {
  /**
  * The object kind.
  */
  readonly kind: "transformation";
  /**
  * The transformation type.
  */
  readonly type: string;
  /**
  * The transformation reference.
  */
  readonly reference: (...args: any[]) => BaseTransformation<any, any, BaseIssue<unknown>>;
  /**
  * Whether it's async.
  */
  readonly async: false;
  /**
  * Transforms known input values.
  *
  * @param dataset The input dataset.
  * @param config The configuration.
  *
  * @returns The output dataset.
  *
  * @internal
  */
  readonly "~run": (dataset: SuccessDataset<TInput$1>, config: Config<BaseIssue<unknown>>) => OutputDataset<TOutput$1, BaseIssue<unknown> | TIssue>;
  /**
  * The input, output and issue type.
  *
  * @internal
  */
  readonly "~types"?: {
    readonly input: TInput$1;
    readonly output: TOutput$1;
    readonly issue: TIssue;
  } | undefined;
}
/**
* Base transformation async interface.
*/
interface BaseTransformationAsync<TInput$1, TOutput$1, TIssue extends BaseIssue<unknown>> extends Omit<BaseTransformation<TInput$1, TOutput$1, TIssue>, "reference" | "async" | "~run"> {
  /**
  * The transformation reference.
  */
  readonly reference: (...args: any[]) => BaseTransformation<any, any, BaseIssue<unknown>> | BaseTransformationAsync<any, any, BaseIssue<unknown>>;
  /**
  * Whether it's async.
  */
  readonly async: true;
  /**
  * Transforms known input values.
  *
  * @param dataset The input dataset.
  * @param config The configuration.
  *
  * @returns The output dataset.
  *
  * @internal
  */
  readonly "~run": (dataset: SuccessDataset<TInput$1>, config: Config<BaseIssue<unknown>>) => Promise<OutputDataset<TOutput$1, BaseIssue<unknown> | TIssue>>;
}
//#endregion
//#region src/types/validation.d.ts
/**
* Base validation interface.
*/
interface BaseValidation<TInput$1, TOutput$1, TIssue extends BaseIssue<unknown>> {
  /**
  * The object kind.
  */
  readonly kind: "validation";
  /**
  * The validation type.
  */
  readonly type: string;
  /**
  * The validation reference.
  */
  readonly reference: (...args: any[]) => BaseValidation<any, any, BaseIssue<unknown>>;
  /**
  * The expected property.
  */
  readonly expects: string | null;
  /**
  * Whether it's async.
  */
  readonly async: false;
  /**
  * Validates known input values.
  *
  * @param dataset The input dataset.
  * @param config The configuration.
  *
  * @returns The output dataset.
  *
  * @internal
  */
  readonly "~run": (dataset: OutputDataset<TInput$1, BaseIssue<unknown>>, config: Config<BaseIssue<unknown>>) => OutputDataset<TOutput$1, BaseIssue<unknown> | TIssue>;
  /**
  * The input, output and issue type.
  *
  * @internal
  */
  readonly "~types"?: {
    readonly input: TInput$1;
    readonly output: TOutput$1;
    readonly issue: TIssue;
  } | undefined;
}
/**
* Base validation async interface.
*/
interface BaseValidationAsync<TInput$1, TOutput$1, TIssue extends BaseIssue<unknown>> extends Omit<BaseValidation<TInput$1, TOutput$1, TIssue>, "reference" | "async" | "~run"> {
  /**
  * The validation reference.
  */
  readonly reference: (...args: any[]) => BaseValidation<any, any, BaseIssue<unknown>> | BaseValidationAsync<any, any, BaseIssue<unknown>>;
  /**
  * Whether it's async.
  */
  readonly async: true;
  /**
  * Validates known input values.
  *
  * @param dataset The input dataset.
  * @param config The configuration.
  *
  * @returns The output dataset.
  *
  * @internal
  */
  readonly "~run": (dataset: OutputDataset<TInput$1, BaseIssue<unknown>>, config: Config<BaseIssue<unknown>>) => Promise<OutputDataset<TOutput$1, BaseIssue<unknown> | TIssue>>;
}
//#endregion
//#region src/types/infer.d.ts
/**
* Infer input type.
*/
type InferInput<TItem$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>> | BaseValidation<any, unknown, BaseIssue<unknown>> | BaseValidationAsync<any, unknown, BaseIssue<unknown>> | BaseTransformation<any, unknown, BaseIssue<unknown>> | BaseTransformationAsync<any, unknown, BaseIssue<unknown>> | BaseMetadata<any>> = NonNullable<TItem$1["~types"]>["input"];
/**
* Infer output type.
*/
type InferOutput<TItem$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>> | BaseValidation<any, unknown, BaseIssue<unknown>> | BaseValidationAsync<any, unknown, BaseIssue<unknown>> | BaseTransformation<any, unknown, BaseIssue<unknown>> | BaseTransformationAsync<any, unknown, BaseIssue<unknown>> | BaseMetadata<any>> = NonNullable<TItem$1["~types"]>["output"];
/**
* Infer issue type.
*/
type InferIssue<TItem$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>> | BaseValidation<any, unknown, BaseIssue<unknown>> | BaseValidationAsync<any, unknown, BaseIssue<unknown>> | BaseTransformation<any, unknown, BaseIssue<unknown>> | BaseTransformationAsync<any, unknown, BaseIssue<unknown>> | BaseMetadata<any>> = NonNullable<TItem$1["~types"]>["issue"];
/**
* Constructs a type that is maybe readonly.
*/
type MaybeReadonly<TValue$1> = TValue$1 | Readonly<TValue$1>;
/**
* Constructs a type that is deeply readonly.
*/
type DeepReadonly<TValue$1> = TValue$1 extends Record<string, unknown> | readonly unknown[] ? { readonly [TKey in keyof TValue$1]: DeepReadonly<TValue$1[TKey]> } : TValue$1;
/**
* Constructs a type that is maybe deeply readonly.
*/
type MaybeDeepReadonly<TValue$1> = TValue$1 | DeepReadonly<TValue$1>;
/**
* Constructs a type that is maybe a promise.
*/
type MaybePromise<TValue$1> = TValue$1 | Promise<TValue$1>;
/**
* Prettifies a type for better readability.
*
* Hint: This type has no effect and is only used so that TypeScript displays
* the final type in the preview instead of the utility types used.
*/
type Prettify<TObject> = { [TKey in keyof TObject]: TObject[TKey] } & {};
/**
* Marks specific keys as optional.
*/
type MarkOptional<TObject, TKeys extends keyof TObject> = { [TKey in keyof TObject]?: unknown } & Omit<TObject, TKeys> & Partial<Pick<TObject, TKeys>>;
//#endregion
//#region src/types/other.d.ts
/**
* Error message type.
*/
type ErrorMessage<TIssue extends BaseIssue<unknown>> = ((issue: TIssue) => string) | string;
/**
* Default type.
*/
type Default<TWrapped$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TInput$1 extends null | undefined> = MaybeDeepReadonly<InferInput<TWrapped$1> | TInput$1> | ((dataset?: UnknownDataset, config?: Config<InferIssue<TWrapped$1>>) => MaybeDeepReadonly<InferInput<TWrapped$1> | TInput$1>) | undefined;
/**
* Default async type.
*/
type DefaultAsync<TWrapped$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TInput$1 extends null | undefined> = MaybeDeepReadonly<InferInput<TWrapped$1> | TInput$1> | ((dataset?: UnknownDataset, config?: Config<InferIssue<TWrapped$1>>) => MaybePromise<MaybeDeepReadonly<InferInput<TWrapped$1> | TInput$1>>) | undefined;
/**
* Default value type.
*/
type DefaultValue<TDefault extends Default<BaseSchema<unknown, unknown, BaseIssue<unknown>>, null | undefined> | DefaultAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, null | undefined>> = TDefault extends DefaultAsync<infer TWrapped extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, infer TInput> ? TDefault extends ((dataset?: UnknownDataset, config?: Config<InferIssue<TWrapped>>) => MaybePromise<MaybeDeepReadonly<InferInput<TWrapped> | TInput>>) ? Awaited<ReturnType<TDefault>> : TDefault : never;
//#endregion
//#region src/types/object.d.ts
/**
* Optional entry schema type.
*/
type OptionalEntrySchema = ExactOptionalSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, unknown> | NullishSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, unknown> | OptionalSchema<BaseSchema<unknown, unknown, BaseIssue<unknown>>, unknown>;
/**
* Optional entry schema async type.
*/
type OptionalEntrySchemaAsync = ExactOptionalSchemaAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, unknown> | NullishSchemaAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, unknown> | OptionalSchemaAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, unknown>;
/**
* Object entries interface.
*/
interface ObjectEntries {
  [key: string]: BaseSchema<unknown, unknown, BaseIssue<unknown>> | SchemaWithFallback<BaseSchema<unknown, unknown, BaseIssue<unknown>>, unknown> | OptionalEntrySchema;
}
/**
* Object entries async interface.
*/
interface ObjectEntriesAsync {
  [key: string]: BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>> | SchemaWithFallback<BaseSchema<unknown, unknown, BaseIssue<unknown>>, unknown> | SchemaWithFallbackAsync<BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, unknown> | OptionalEntrySchema | OptionalEntrySchemaAsync;
}
/**
* Infer entries input type.
*/
type InferEntriesInput<TEntries$1 extends ObjectEntries | ObjectEntriesAsync> = { -readonly [TKey in keyof TEntries$1]: InferInput<TEntries$1[TKey]> };
/**
* Infer entries output type.
*/
type InferEntriesOutput<TEntries$1 extends ObjectEntries | ObjectEntriesAsync> = { -readonly [TKey in keyof TEntries$1]: InferOutput<TEntries$1[TKey]> };
/**
* Optional input keys type.
*/
type OptionalInputKeys<TEntries$1 extends ObjectEntries | ObjectEntriesAsync> = { [TKey in keyof TEntries$1]: TEntries$1[TKey] extends OptionalEntrySchema | OptionalEntrySchemaAsync ? TKey : never }[keyof TEntries$1];
/**
* Optional output keys type.
*/
type OptionalOutputKeys<TEntries$1 extends ObjectEntries | ObjectEntriesAsync> = { [TKey in keyof TEntries$1]: TEntries$1[TKey] extends OptionalEntrySchema | OptionalEntrySchemaAsync ? undefined extends TEntries$1[TKey]["default"] ? TKey : never : never }[keyof TEntries$1];
/**
* Input with question marks type.
*/
type InputWithQuestionMarks<TEntries$1 extends ObjectEntries | ObjectEntriesAsync, TObject extends InferEntriesInput<TEntries$1>> = MarkOptional<TObject, OptionalInputKeys<TEntries$1>>;
/**
* Output with question marks type.
*/
type OutputWithQuestionMarks<TEntries$1 extends ObjectEntries | ObjectEntriesAsync, TObject extends InferEntriesOutput<TEntries$1>> = MarkOptional<TObject, OptionalOutputKeys<TEntries$1>>;
/**
* Readonly output keys type.
*/
type ReadonlyOutputKeys<TEntries$1 extends ObjectEntries | ObjectEntriesAsync> = { [TKey in keyof TEntries$1]: TEntries$1[TKey] extends {
  readonly pipe: readonly unknown[];
} ? ReadonlyAction<any> extends TEntries$1[TKey]["pipe"][number] ? TKey : never : never }[keyof TEntries$1];
/**
* Output with readonly type.
*/
type OutputWithReadonly<TEntries$1 extends ObjectEntries | ObjectEntriesAsync, TObject extends OutputWithQuestionMarks<TEntries$1, InferEntriesOutput<TEntries$1>>> = ReadonlyOutputKeys<TEntries$1> extends never ? TObject : Readonly<TObject> & Pick<TObject, Exclude<keyof TObject, ReadonlyOutputKeys<TEntries$1>>>;
/**
* Infer object input type.
*/
type InferObjectInput<TEntries$1 extends ObjectEntries | ObjectEntriesAsync> = Prettify<InputWithQuestionMarks<TEntries$1, InferEntriesInput<TEntries$1>>>;
/**
* Infer object output type.
*/
type InferObjectOutput<TEntries$1 extends ObjectEntries | ObjectEntriesAsync> = Prettify<OutputWithReadonly<TEntries$1, OutputWithQuestionMarks<TEntries$1, InferEntriesOutput<TEntries$1>>>>;
/**
* Infer object issue type.
*/
type InferObjectIssue<TEntries$1 extends ObjectEntries | ObjectEntriesAsync> = InferIssue<TEntries$1[keyof TEntries$1]>;
//#endregion
//#region src/types/issue.d.ts
/**
* Array path item interface.
*/
interface ArrayPathItem {
  /**
  * The path item type.
  */
  readonly type: "array";
  /**
  * The path item origin.
  */
  readonly origin: "value";
  /**
  * The path item input.
  */
  readonly input: MaybeReadonly<unknown[]>;
  /**
  * The path item key.
  */
  readonly key: number;
  /**
  * The path item value.
  */
  readonly value: unknown;
}
/**
* Map path item interface.
*/
interface MapPathItem {
  /**
  * The path item type.
  */
  readonly type: "map";
  /**
  * The path item origin.
  */
  readonly origin: "key" | "value";
  /**
  * The path item input.
  */
  readonly input: Map<unknown, unknown>;
  /**
  * The path item key.
  */
  readonly key: unknown;
  /**
  * The path item value.
  */
  readonly value: unknown;
}
/**
* Object path item interface.
*/
interface ObjectPathItem {
  /**
  * The path item type.
  */
  readonly type: "object";
  /**
  * The path item origin.
  */
  readonly origin: "key" | "value";
  /**
  * The path item input.
  */
  readonly input: Record<string, unknown>;
  /**
  * The path item key.
  */
  readonly key: string;
  /**
  * The path item value.
  */
  readonly value: unknown;
}
/**
* Set path item interface.
*/
interface SetPathItem {
  /**
  * The path item type.
  */
  readonly type: "set";
  /**
  * The path item origin.
  */
  readonly origin: "value";
  /**
  * The path item input.
  */
  readonly input: Set<unknown>;
  /**
  * The path item key.
  */
  readonly key: null;
  /**
  * The path item key.
  */
  readonly value: unknown;
}
/**
* Unknown path item interface.
*/
interface UnknownPathItem {
  /**
  * The path item type.
  */
  readonly type: "unknown";
  /**
  * The path item origin.
  */
  readonly origin: "key" | "value";
  /**
  * The path item input.
  */
  readonly input: unknown;
  /**
  * The path item key.
  */
  readonly key: unknown;
  /**
  * The path item value.
  */
  readonly value: unknown;
}
/**
* Issue path item type.
*/
type IssuePathItem = ArrayPathItem | MapPathItem | ObjectPathItem | SetPathItem | UnknownPathItem;
/**
* Base issue interface.
*/
interface BaseIssue<TInput$1> extends Config<BaseIssue<TInput$1>> {
  /**
  * The issue kind.
  */
  readonly kind: "schema" | "validation" | "transformation";
  /**
  * The issue type.
  */
  readonly type: string;
  /**
  * The raw input data.
  */
  readonly input: TInput$1;
  /**
  * The expected property.
  */
  readonly expected: string | null;
  /**
  * The received property.
  */
  readonly received: string;
  /**
  * The error message.
  */
  readonly message: string;
  /**
  * The input requirement.
  */
  readonly requirement?: unknown | undefined;
  /**
  * The issue path.
  */
  readonly path?: [IssuePathItem, ...IssuePathItem[]] | undefined;
  /**
  * The sub issues.
  */
  readonly issues?: [BaseIssue<TInput$1>, ...BaseIssue<TInput$1>[]] | undefined;
}
//#endregion
//#region src/types/config.d.ts
/**
* Config interface.
*/
interface Config<TIssue extends BaseIssue<unknown>> {
  /**
  * The selected language.
  */
  readonly lang?: string | undefined;
  /**
  * The error message.
  */
  readonly message?: ErrorMessage<TIssue> | undefined;
  /**
  * Whether it should be aborted early.
  */
  readonly abortEarly?: boolean | undefined;
  /**
  * Whether a pipe should be aborted early.
  */
  readonly abortPipeEarly?: boolean | undefined;
}
//#endregion
//#region src/schemas/array/types.d.ts
/**
* Array issue interface.
*/
interface ArrayIssue extends BaseIssue<unknown> {
  /**
  * The issue kind.
  */
  readonly kind: "schema";
  /**
  * The issue type.
  */
  readonly type: "array";
  /**
  * The expected property.
  */
  readonly expected: "Array";
}
//#endregion
//#region src/schemas/array/array.d.ts
/**
* Array schema interface.
*/
interface ArraySchema<TItem$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TMessage extends ErrorMessage<ArrayIssue> | undefined> extends BaseSchema<InferInput<TItem$1>[], InferOutput<TItem$1>[], ArrayIssue | InferIssue<TItem$1>> {
  /**
  * The schema type.
  */
  readonly type: "array";
  /**
  * The schema reference.
  */
  readonly reference: typeof array;
  /**
  * The expected property.
  */
  readonly expects: "Array";
  /**
  * The array item schema.
  */
  readonly item: TItem$1;
  /**
  * The error message.
  */
  readonly message: TMessage;
}
/**
* Creates an array schema.
*
* @param item The item schema.
*
* @returns An array schema.
*/
declare function array<const TItem$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>>>(item: TItem$1): ArraySchema<TItem$1, undefined>;
/**
* Creates an array schema.
*
* @param item The item schema.
* @param message The error message.
*
* @returns An array schema.
*/
declare function array<const TItem$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, const TMessage extends ErrorMessage<ArrayIssue> | undefined>(item: TItem$1, message: TMessage): ArraySchema<TItem$1, TMessage>;
//#endregion
//#region src/schemas/custom/types.d.ts
/**
* Custom issue interface.
*/
interface CustomIssue extends BaseIssue<unknown> {
  /**
  * The issue kind.
  */
  readonly kind: "schema";
  /**
  * The issue type.
  */
  readonly type: "custom";
  /**
  * The expected property.
  */
  readonly expected: "unknown";
}
//#endregion
//#region src/schemas/custom/custom.d.ts
/**
* Check type.
*/
type Check = (input: unknown) => boolean;
/**
* Custom schema interface.
*/
interface CustomSchema<TInput$1, TMessage extends ErrorMessage<CustomIssue> | undefined> extends BaseSchema<TInput$1, TInput$1, CustomIssue> {
  /**
  * The schema type.
  */
  readonly type: "custom";
  /**
  * The schema reference.
  */
  readonly reference: typeof custom;
  /**
  * The expected property.
  */
  readonly expects: "unknown";
  /**
  * The type check function.
  */
  readonly check: Check;
  /**
  * The error message.
  */
  readonly message: TMessage;
}
/**
* Creates a custom schema.
*
* @param check The type check function.
*
* @returns A custom schema.
*/
declare function custom<TInput$1>(check: Check): CustomSchema<TInput$1, undefined>;
/**
* Creates a custom schema.
*
* @param check The type check function.
* @param message The error message.
*
* @returns A custom schema.
*/
declare function custom<TInput$1, const TMessage extends ErrorMessage<CustomIssue> | undefined = ErrorMessage<CustomIssue> | undefined>(check: Check, message: TMessage): CustomSchema<TInput$1, TMessage>;
//#endregion
//#region src/schemas/exactOptional/exactOptional.d.ts
/**
* Exact optional schema interface.
*/
interface ExactOptionalSchema<TWrapped$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TDefault extends Default<TWrapped$1, never>> extends BaseSchema<InferInput<TWrapped$1>, InferOutput<TWrapped$1>, InferIssue<TWrapped$1>> {
  /**
  * The schema type.
  */
  readonly type: "exact_optional";
  /**
  * The schema reference.
  */
  readonly reference: typeof exactOptional;
  /**
  * The expected property.
  */
  readonly expects: TWrapped$1["expects"];
  /**
  * The wrapped schema.
  */
  readonly wrapped: TWrapped$1;
  /**
  * The default value.
  */
  readonly default: TDefault;
}
/**
* Creates an exact optional schema.
*
* @param wrapped The wrapped schema.
*
* @returns An exact optional schema.
*/
declare function exactOptional<const TWrapped$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>>>(wrapped: TWrapped$1): ExactOptionalSchema<TWrapped$1, undefined>;
/**
* Creates an exact optional schema.
*
* @param wrapped The wrapped schema.
* @param default_ The default value.
*
* @returns An exact optional schema.
*/
declare function exactOptional<const TWrapped$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, const TDefault extends Default<TWrapped$1, never>>(wrapped: TWrapped$1, default_: TDefault): ExactOptionalSchema<TWrapped$1, TDefault>;
//#endregion
//#region src/schemas/exactOptional/exactOptionalAsync.d.ts
/**
* Exact optional schema async interface.
*/
interface ExactOptionalSchemaAsync<TWrapped$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TDefault extends DefaultAsync<TWrapped$1, never>> extends BaseSchemaAsync<InferInput<TWrapped$1>, InferOutput<TWrapped$1>, InferIssue<TWrapped$1>> {
  /**
  * The schema type.
  */
  readonly type: "exact_optional";
  /**
  * The schema reference.
  */
  readonly reference: typeof exactOptional | typeof exactOptionalAsync;
  /**
  * The expected property.
  */
  readonly expects: TWrapped$1["expects"];
  /**
  * The wrapped schema.
  */
  readonly wrapped: TWrapped$1;
  /**
  * The default value.
  */
  readonly default: TDefault;
}
/**
* Creates an exact optional schema.
*
* @param wrapped The wrapped schema.
*
* @returns An exact optional schema.
*/
declare function exactOptionalAsync<const TWrapped$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>>(wrapped: TWrapped$1): ExactOptionalSchemaAsync<TWrapped$1, undefined>;
/**
* Creates an exact optional schema.
*
* @param wrapped The wrapped schema.
* @param default_ The default value.
*
* @returns An exact optional schema.
*/
declare function exactOptionalAsync<const TWrapped$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, const TDefault extends DefaultAsync<TWrapped$1, never>>(wrapped: TWrapped$1, default_: TDefault): ExactOptionalSchemaAsync<TWrapped$1, TDefault>;
//#endregion
//#region src/schemas/looseObject/types.d.ts
/**
* Loose object issue interface.
*/
interface LooseObjectIssue extends BaseIssue<unknown> {
  /**
  * The issue kind.
  */
  readonly kind: "schema";
  /**
  * The issue type.
  */
  readonly type: "loose_object";
  /**
  * The expected property.
  */
  readonly expected: "Object" | `"${string}"`;
}
//#endregion
//#region src/schemas/looseObject/looseObject.d.ts
/**
* Loose object schema interface.
*/
interface LooseObjectSchema<TEntries$1 extends ObjectEntries, TMessage extends ErrorMessage<LooseObjectIssue> | undefined> extends BaseSchema<InferObjectInput<TEntries$1> & {
  [key: string]: unknown;
}, InferObjectOutput<TEntries$1> & {
  [key: string]: unknown;
}, LooseObjectIssue | InferObjectIssue<TEntries$1>> {
  /**
  * The schema type.
  */
  readonly type: "loose_object";
  /**
  * The schema reference.
  */
  readonly reference: typeof looseObject;
  /**
  * The expected property.
  */
  readonly expects: "Object";
  /**
  * The entries schema.
  */
  readonly entries: TEntries$1;
  /**
  * The error message.
  */
  readonly message: TMessage;
}
/**
* Creates a loose object schema.
*
* @param entries The entries schema.
*
* @returns A loose object schema.
*/
declare function looseObject<const TEntries$1 extends ObjectEntries>(entries: TEntries$1): LooseObjectSchema<TEntries$1, undefined>;
/**
* Creates a loose object schema.
*
* @param entries The entries schema.
* @param message The error message.
*
* @returns A loose object schema.
*/
declare function looseObject<const TEntries$1 extends ObjectEntries, const TMessage extends ErrorMessage<LooseObjectIssue> | undefined>(entries: TEntries$1, message: TMessage): LooseObjectSchema<TEntries$1, TMessage>;
//#endregion
//#region src/schemas/nullish/types.d.ts
/**
* Infer nullish output type.
*/
type InferNullishOutput<TWrapped$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TDefault extends DefaultAsync<TWrapped$1, null | undefined>> = undefined extends TDefault ? InferOutput<TWrapped$1> | null | undefined : InferOutput<TWrapped$1> | Extract<DefaultValue<TDefault>, null | undefined>;
//#endregion
//#region src/schemas/nullish/nullish.d.ts
/**
* Nullish schema interface.
*/
interface NullishSchema<TWrapped$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TDefault extends Default<TWrapped$1, null | undefined>> extends BaseSchema<InferInput<TWrapped$1> | null | undefined, InferNullishOutput<TWrapped$1, TDefault>, InferIssue<TWrapped$1>> {
  /**
  * The schema type.
  */
  readonly type: "nullish";
  /**
  * The schema reference.
  */
  readonly reference: typeof nullish;
  /**
  * The expected property.
  */
  readonly expects: `(${TWrapped$1["expects"]} | null | undefined)`;
  /**
  * The wrapped schema.
  */
  readonly wrapped: TWrapped$1;
  /**
  * The default value.
  */
  readonly default: TDefault;
}
/**
* Creates a nullish schema.
*
* @param wrapped The wrapped schema.
*
* @returns A nullish schema.
*/
declare function nullish<const TWrapped$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>>>(wrapped: TWrapped$1): NullishSchema<TWrapped$1, undefined>;
/**
* Creates a nullish schema.
*
* @param wrapped The wrapped schema.
* @param default_ The default value.
*
* @returns A nullish schema.
*/
declare function nullish<const TWrapped$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, const TDefault extends Default<TWrapped$1, null | undefined>>(wrapped: TWrapped$1, default_: TDefault): NullishSchema<TWrapped$1, TDefault>;
//#endregion
//#region src/schemas/nullish/nullishAsync.d.ts
/**
* Nullish schema async interface.
*/
interface NullishSchemaAsync<TWrapped$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TDefault extends DefaultAsync<TWrapped$1, null | undefined>> extends BaseSchemaAsync<InferInput<TWrapped$1> | null | undefined, InferNullishOutput<TWrapped$1, TDefault>, InferIssue<TWrapped$1>> {
  /**
  * The schema type.
  */
  readonly type: "nullish";
  /**
  * The schema reference.
  */
  readonly reference: typeof nullish | typeof nullishAsync;
  /**
  * The expected property.
  */
  readonly expects: `(${TWrapped$1["expects"]} | null | undefined)`;
  /**
  * The wrapped schema.
  */
  readonly wrapped: TWrapped$1;
  /**
  * The default value.
  */
  readonly default: TDefault;
}
/**
* Creates a nullish schema.
*
* @param wrapped The wrapped schema.
*
* @returns A nullish schema.
*/
declare function nullishAsync<const TWrapped$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>>(wrapped: TWrapped$1): NullishSchemaAsync<TWrapped$1, undefined>;
/**
* Creates a nullish schema.
*
* @param wrapped The wrapped schema.
* @param default_ The default value.
*
* @returns A nullish schema.
*/
declare function nullishAsync<const TWrapped$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, const TDefault extends DefaultAsync<TWrapped$1, null | undefined>>(wrapped: TWrapped$1, default_: TDefault): NullishSchemaAsync<TWrapped$1, TDefault>;
//#endregion
//#region src/schemas/object/types.d.ts
/**
* Object issue interface.
*/
interface ObjectIssue extends BaseIssue<unknown> {
  /**
  * The issue kind.
  */
  readonly kind: "schema";
  /**
  * The issue type.
  */
  readonly type: "object";
  /**
  * The expected property.
  */
  readonly expected: "Object" | `"${string}"`;
}
//#endregion
//#region src/schemas/object/object.d.ts
/**
* Object schema interface.
*/
interface ObjectSchema<TEntries$1 extends ObjectEntries, TMessage extends ErrorMessage<ObjectIssue> | undefined> extends BaseSchema<InferObjectInput<TEntries$1>, InferObjectOutput<TEntries$1>, ObjectIssue | InferObjectIssue<TEntries$1>> {
  /**
  * The schema type.
  */
  readonly type: "object";
  /**
  * The schema reference.
  */
  readonly reference: typeof object;
  /**
  * The expected property.
  */
  readonly expects: "Object";
  /**
  * The entries schema.
  */
  readonly entries: TEntries$1;
  /**
  * The error message.
  */
  readonly message: TMessage;
}
/**
* Creates an object schema.
*
* Hint: This schema removes unknown entries. The output will only include the
* entries you specify. To include unknown entries, use `looseObject`. To
* return an issue for unknown entries, use `strictObject`. To include and
* validate unknown entries, use `objectWithRest`.
*
* @param entries The entries schema.
*
* @returns An object schema.
*/
declare function object<const TEntries$1 extends ObjectEntries>(entries: TEntries$1): ObjectSchema<TEntries$1, undefined>;
/**
* Creates an object schema.
*
* Hint: This schema removes unknown entries. The output will only include the
* entries you specify. To include unknown entries, use `looseObject`. To
* return an issue for unknown entries, use `strictObject`. To include and
* validate unknown entries, use `objectWithRest`.
*
* @param entries The entries schema.
* @param message The error message.
*
* @returns An object schema.
*/
declare function object<const TEntries$1 extends ObjectEntries, const TMessage extends ErrorMessage<ObjectIssue> | undefined>(entries: TEntries$1, message: TMessage): ObjectSchema<TEntries$1, TMessage>;
//#endregion
//#region src/schemas/optional/types.d.ts
/**
* Infer optional output type.
*/
type InferOptionalOutput<TWrapped$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TDefault extends DefaultAsync<TWrapped$1, undefined>> = undefined extends TDefault ? InferOutput<TWrapped$1> | undefined : InferOutput<TWrapped$1> | Extract<DefaultValue<TDefault>, undefined>;
//#endregion
//#region src/schemas/optional/optional.d.ts
/**
* Optional schema interface.
*/
interface OptionalSchema<TWrapped$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TDefault extends Default<TWrapped$1, undefined>> extends BaseSchema<InferInput<TWrapped$1> | undefined, InferOptionalOutput<TWrapped$1, TDefault>, InferIssue<TWrapped$1>> {
  /**
  * The schema type.
  */
  readonly type: "optional";
  /**
  * The schema reference.
  */
  readonly reference: typeof optional;
  /**
  * The expected property.
  */
  readonly expects: `(${TWrapped$1["expects"]} | undefined)`;
  /**
  * The wrapped schema.
  */
  readonly wrapped: TWrapped$1;
  /**
  * The default value.
  */
  readonly default: TDefault;
}
/**
* Creates an optional schema.
*
* @param wrapped The wrapped schema.
*
* @returns An optional schema.
*/
declare function optional<const TWrapped$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>>>(wrapped: TWrapped$1): OptionalSchema<TWrapped$1, undefined>;
/**
* Creates an optional schema.
*
* @param wrapped The wrapped schema.
* @param default_ The default value.
*
* @returns An optional schema.
*/
declare function optional<const TWrapped$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, const TDefault extends Default<TWrapped$1, undefined>>(wrapped: TWrapped$1, default_: TDefault): OptionalSchema<TWrapped$1, TDefault>;
//#endregion
//#region src/schemas/optional/optionalAsync.d.ts
/**
* Optional schema async interface.
*/
interface OptionalSchemaAsync<TWrapped$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TDefault extends DefaultAsync<TWrapped$1, undefined>> extends BaseSchemaAsync<InferInput<TWrapped$1> | undefined, InferOptionalOutput<TWrapped$1, TDefault>, InferIssue<TWrapped$1>> {
  /**
  * The schema type.
  */
  readonly type: "optional";
  /**
  * The schema reference.
  */
  readonly reference: typeof optional | typeof optionalAsync;
  /**
  * The expected property.
  */
  readonly expects: `(${TWrapped$1["expects"]} | undefined)`;
  /**
  * The wrapped schema.
  */
  readonly wrapped: TWrapped$1;
  /**
  * The default value.
  */
  readonly default: TDefault;
}
/**
* Creates an optional schema.
*
* @param wrapped The wrapped schema.
*
* @returns An optional schema.
*/
declare function optionalAsync<const TWrapped$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>>(wrapped: TWrapped$1): OptionalSchemaAsync<TWrapped$1, undefined>;
/**
* Creates an optional schema.
*
* @param wrapped The wrapped schema.
* @param default_ The default value.
*
* @returns An optional schema.
*/
declare function optionalAsync<const TWrapped$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, const TDefault extends DefaultAsync<TWrapped$1, undefined>>(wrapped: TWrapped$1, default_: TDefault): OptionalSchemaAsync<TWrapped$1, TDefault>;
//#endregion
//#region src/schemas/record/types.d.ts
/**
* Record issue interface.
*/
interface RecordIssue extends BaseIssue<unknown> {
  /**
  * The issue kind.
  */
  readonly kind: "schema";
  /**
  * The issue type.
  */
  readonly type: "record";
  /**
  * The expected property.
  */
  readonly expected: "Object";
}
/**
* Is literal type.
*/
type IsLiteral<TKey$1 extends string | number | symbol> = string extends TKey$1 ? false : number extends TKey$1 ? false : symbol extends TKey$1 ? false : TKey$1 extends Brand<string | number | symbol> ? false : true;
/**
* Optional keys type.
*/
type OptionalKeys<TObject extends Record<string | number | symbol, unknown>> = { [TKey in keyof TObject]: IsLiteral<TKey> extends true ? TKey : never }[keyof TObject];
/**
* With question marks type.
*
* Hint: We mark an entry as optional if we detect that its key is a literal
* type. The reason for this is that it is not technically possible to detect
* missing literal keys without restricting the key schema to `string`, `enum`
* and `picklist`. However, if `enum` and `picklist` are used, it is better to
* use `object` with `entriesFromList` because it already covers the needed
* functionality. This decision also reduces the bundle size of `record`,
* because it only needs to check the entries of the input and not any missing
* keys.
*/
type WithQuestionMarks<TObject extends Record<string | number | symbol, unknown>> = MarkOptional<TObject, OptionalKeys<TObject>>;
/**
* With readonly type.
*/
type WithReadonly<TValue$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>, TObject extends WithQuestionMarks<Record<string | number | symbol, unknown>>> = TValue$1 extends {
  readonly pipe: readonly unknown[];
} ? ReadonlyAction<any> extends TValue$1["pipe"][number] ? Readonly<TObject> : TObject : TObject;
/**
* Infer record input type.
*/
type InferRecordInput<TKey$1 extends BaseSchema<string, string | number | symbol, BaseIssue<unknown>> | BaseSchemaAsync<string, string | number | symbol, BaseIssue<unknown>>, TValue$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>> = Prettify<WithQuestionMarks<Record<InferInput<TKey$1>, InferInput<TValue$1>>>>;
/**
* Infer record output type.
*/
type InferRecordOutput<TKey$1 extends BaseSchema<string, string | number | symbol, BaseIssue<unknown>> | BaseSchemaAsync<string, string | number | symbol, BaseIssue<unknown>>, TValue$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>> = Prettify<WithReadonly<TValue$1, WithQuestionMarks<Record<InferOutput<TKey$1>, InferOutput<TValue$1>>>>>;
//#endregion
//#region src/schemas/record/record.d.ts
/**
* Record schema interface.
*/
interface RecordSchema<TKey$1 extends BaseSchema<string, string | number | symbol, BaseIssue<unknown>>, TValue$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, TMessage extends ErrorMessage<RecordIssue> | undefined> extends BaseSchema<InferRecordInput<TKey$1, TValue$1>, InferRecordOutput<TKey$1, TValue$1>, RecordIssue | InferIssue<TKey$1> | InferIssue<TValue$1>> {
  /**
  * The schema type.
  */
  readonly type: "record";
  /**
  * The schema reference.
  */
  readonly reference: typeof record;
  /**
  * The expected property.
  */
  readonly expects: "Object";
  /**
  * The record key schema.
  */
  readonly key: TKey$1;
  /**
  * The record value schema.
  */
  readonly value: TValue$1;
  /**
  * The error message.
  */
  readonly message: TMessage;
}
/**
* Creates a record schema.
*
* @param key The key schema.
* @param value The value schema.
*
* @returns A record schema.
*/
declare function record<const TKey$1 extends BaseSchema<string, string | number | symbol, BaseIssue<unknown>>, const TValue$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>>>(key: TKey$1, value: TValue$1): RecordSchema<TKey$1, TValue$1, undefined>;
/**
* Creates a record schema.
*
* @param key The key schema.
* @param value The value schema.
* @param message The error message.
*
* @returns A record schema.
*/
declare function record<const TKey$1 extends BaseSchema<string, string | number | symbol, BaseIssue<unknown>>, const TValue$1 extends BaseSchema<unknown, unknown, BaseIssue<unknown>>, const TMessage extends ErrorMessage<RecordIssue> | undefined>(key: TKey$1, value: TValue$1, message: TMessage): RecordSchema<TKey$1, TValue$1, TMessage>;
//#endregion
//#region src/schemas/string/string.d.ts
/**
* String issue interface.
*/
interface StringIssue extends BaseIssue<unknown> {
  /**
  * The issue kind.
  */
  readonly kind: "schema";
  /**
  * The issue type.
  */
  readonly type: "string";
  /**
  * The expected property.
  */
  readonly expected: "string";
}
/**
* String schema interface.
*/
interface StringSchema<TMessage extends ErrorMessage<StringIssue> | undefined> extends BaseSchema<string, string, StringIssue> {
  /**
  * The schema type.
  */
  readonly type: "string";
  /**
  * The schema reference.
  */
  readonly reference: typeof string;
  /**
  * The expected property.
  */
  readonly expects: "string";
  /**
  * The error message.
  */
  readonly message: TMessage;
}
/**
* Creates a string schema.
*
* @returns A string schema.
*/
declare function string(): StringSchema<undefined>;
/**
* Creates a string schema.
*
* @param message The error message.
*
* @returns A string schema.
*/
declare function string<const TMessage extends ErrorMessage<StringIssue> | undefined>(message: TMessage): StringSchema<TMessage>;
//#endregion
//#region src/schemas/undefined/undefined.d.ts
/**
* Undefined issue interface.
*/
interface UndefinedIssue extends BaseIssue<unknown> {
  /**
  * The issue kind.
  */
  readonly kind: "schema";
  /**
  * The issue type.
  */
  readonly type: "undefined";
  /**
  * The expected property.
  */
  readonly expected: "undefined";
}
/**
* Undefined schema interface.
*/
interface UndefinedSchema<TMessage extends ErrorMessage<UndefinedIssue> | undefined> extends BaseSchema<undefined, undefined, UndefinedIssue> {
  /**
  * The schema type.
  */
  readonly type: "undefined";
  /**
  * The schema reference.
  */
  readonly reference: typeof undefined_;
  /**
  * The expected property.
  */
  readonly expects: "undefined";
  /**
  * The error message.
  */
  readonly message: TMessage;
}
/**
* Creates an undefined schema.
*
* @returns An undefined schema.
*/
declare function undefined_(): UndefinedSchema<undefined>;
/**
* Creates an undefined schema.
*
* @param message The error message.
*
* @returns An undefined schema.
*/
declare function undefined_<const TMessage extends ErrorMessage<UndefinedIssue> | undefined>(message: TMessage): UndefinedSchema<TMessage>;
//#endregion
//#region src/schemas/void/void.d.ts
/**
* Void issue interface.
*/
interface VoidIssue extends BaseIssue<unknown> {
  /**
  * The issue kind.
  */
  readonly kind: "schema";
  /**
  * The issue type.
  */
  readonly type: "void";
  /**
  * The expected property.
  */
  readonly expected: "void";
}
/**
* Void schema interface.
*/
interface VoidSchema<TMessage extends ErrorMessage<VoidIssue> | undefined> extends BaseSchema<void, void, VoidIssue> {
  /**
  * The schema type.
  */
  readonly type: "void";
  /**
  * The schema reference.
  */
  readonly reference: typeof void_;
  /**
  * The expected property.
  */
  readonly expects: "void";
  /**
  * The error message.
  */
  readonly message: TMessage;
}
/**
* Creates a void schema.
*
* @returns A void schema.
*/
declare function void_(): VoidSchema<undefined>;
/**
* Creates a void schema.
*
* @param message The error message.
*
* @returns A void schema.
*/
declare function void_<const TMessage extends ErrorMessage<VoidIssue> | undefined>(message: TMessage): VoidSchema<TMessage>;
//#endregion
//#region src/actions/brand/brand.d.ts
/**
* Brand symbol.
*/
declare const BrandSymbol: unique symbol;
/**
* Brand name type.
*/
type BrandName = string | number | symbol;
/**
* Brand interface.
*/
interface Brand<TName extends BrandName> {
  [BrandSymbol]: { [TValue in TName]: TValue };
}
//#endregion
//#region src/actions/readonly/readonly.d.ts
/**
* Readonly output type.
*/
type ReadonlyOutput<TInput$1> = TInput$1 extends Map<infer TKey, infer TValue> ? ReadonlyMap<TKey, TValue> : TInput$1 extends Set<infer TValue> ? ReadonlySet<TValue> : Readonly<TInput$1>;
/**
* Readonly action interface.
*/
interface ReadonlyAction<TInput$1> extends BaseTransformation<TInput$1, ReadonlyOutput<TInput$1>, never> {
  /**
  * The action type.
  */
  readonly type: "readonly";
  /**
  * The action reference.
  */
  readonly reference: typeof readonly;
}
/**
* Creates a readonly transformation action.
*
* @returns A readonly action.
*/
declare function readonly<TInput$1>(): ReadonlyAction<TInput$1>;

/**
 * Actions represent the type of change to a location value.
 */
declare enum Action {
    /**
     * A POP indicates a change to an arbitrary index in the history stack, such
     * as a back or forward navigation. It does not describe the direction of the
     * navigation, only that the current index changed.
     *
     * Note: This is the default action for newly created history objects.
     */
    Pop = "POP",
    /**
     * A PUSH indicates a new entry being added to the history stack, such as when
     * a link is clicked and a new page loads. When this happens, all subsequent
     * entries in the stack are lost.
     */
    Push = "PUSH",
    /**
     * A REPLACE indicates the entry at the current index in the history stack
     * being replaced by a new one.
     */
    Replace = "REPLACE"
}
/**
 * The pathname, search, and hash values of a URL.
 */
interface Path {
    /**
     * A URL pathname, beginning with a /.
     */
    pathname: string;
    /**
     * A URL search string, beginning with a ?.
     */
    search: string;
    /**
     * A URL fragment identifier, beginning with a #.
     */
    hash: string;
}
/**
 * An entry in a history stack. A location contains information about the
 * URL path, as well as possibly some arbitrary state and a key.
 */
interface Location extends Path {
    /**
     * A value of arbitrary data associated with this location.
     */
    state: any;
    /**
     * A unique string associated with this location. May be used to safely store
     * and retrieve data in some other storage API, like `localStorage`.
     *
     * Note: This value is always "default" on the initial location.
     */
    key: string;
}

/**
 * Map of routeId -> data returned from a loader/action/error
 */
interface RouteData {
    [routeId: string]: any;
}
declare enum ResultType {
    data = "data",
    deferred = "deferred",
    redirect = "redirect",
    error = "error"
}
/**
 * Successful result from a loader or action
 */
interface SuccessResult {
    type: ResultType.data;
    data: any;
    statusCode?: number;
    headers?: Headers;
}
/**
 * Successful defer() result from a loader or action
 */
interface DeferredResult {
    type: ResultType.deferred;
    deferredData: DeferredData;
    statusCode?: number;
    headers?: Headers;
}
/**
 * Redirect result from a loader or action
 */
interface RedirectResult {
    type: ResultType.redirect;
    status: number;
    location: string;
    revalidate: boolean;
    reloadDocument?: boolean;
}
/**
 * Unsuccessful result from a loader or action
 */
interface ErrorResult {
    type: ResultType.error;
    error: any;
    headers?: Headers;
}
/**
 * Result from a loader or action - potentially successful or unsuccessful
 */
type DataResult = SuccessResult | DeferredResult | RedirectResult | ErrorResult;
type LowerCaseFormMethod = "get" | "post" | "put" | "patch" | "delete";
type UpperCaseFormMethod = Uppercase<LowerCaseFormMethod>;
/**
 * Active navigation/fetcher form methods are exposed in lowercase on the
 * RouterState
 */
type FormMethod = LowerCaseFormMethod;
/**
 * In v7, active navigation/fetcher form methods are exposed in uppercase on the
 * RouterState.  This is to align with the normalization done via fetch().
 */
type V7_FormMethod = UpperCaseFormMethod;
type FormEncType = "application/x-www-form-urlencoded" | "multipart/form-data" | "application/json" | "text/plain";
type JsonObject = {
    [Key in string]: JsonValue;
} & {
    [Key in string]?: JsonValue | undefined;
};
type JsonArray = JsonValue[] | readonly JsonValue[];
type JsonPrimitive = string | number | boolean | null;
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
/**
 * @private
 * Internal interface to pass around for action submissions, not intended for
 * external consumption
 */
type Submission = {
    formMethod: FormMethod | V7_FormMethod;
    formAction: string;
    formEncType: FormEncType;
    formData: FormData;
    json: undefined;
    text: undefined;
} | {
    formMethod: FormMethod | V7_FormMethod;
    formAction: string;
    formEncType: FormEncType;
    formData: undefined;
    json: JsonValue;
    text: undefined;
} | {
    formMethod: FormMethod | V7_FormMethod;
    formAction: string;
    formEncType: FormEncType;
    formData: undefined;
    json: undefined;
    text: string;
};
/**
 * @private
 * Arguments passed to route loader/action functions.  Same for now but we keep
 * this as a private implementation detail in case they diverge in the future.
 */
interface DataFunctionArgs {
    request: Request;
    params: Params;
    context?: any;
}
/**
 * Arguments passed to loader functions
 */
interface LoaderFunctionArgs extends DataFunctionArgs {
}
/**
 * Arguments passed to action functions
 */
interface ActionFunctionArgs extends DataFunctionArgs {
}
/**
 * Loaders and actions can return anything except `undefined` (`null` is a
 * valid return value if there is no data to return).  Responses are preferred
 * and will ease any future migration to Remix
 */
type DataFunctionValue = Response | NonNullable<unknown> | null;
/**
 * Route loader function signature
 */
interface LoaderFunction {
    (args: LoaderFunctionArgs): Promise<DataFunctionValue> | DataFunctionValue;
}
/**
 * Route action function signature
 */
interface ActionFunction {
    (args: ActionFunctionArgs): Promise<DataFunctionValue> | DataFunctionValue;
}
/**
 * Route shouldRevalidate function signature.  This runs after any submission
 * (navigation or fetcher), so we flatten the navigation/fetcher submission
 * onto the arguments.  It shouldn't matter whether it came from a navigation
 * or a fetcher, what really matters is the URLs and the formData since loaders
 * have to re-run based on the data models that were potentially mutated.
 */
interface ShouldRevalidateFunction {
    (args: {
        currentUrl: URL;
        currentParams: AgnosticDataRouteMatch["params"];
        nextUrl: URL;
        nextParams: AgnosticDataRouteMatch["params"];
        formMethod?: Submission["formMethod"];
        formAction?: Submission["formAction"];
        formEncType?: Submission["formEncType"];
        text?: Submission["text"];
        formData?: Submission["formData"];
        json?: Submission["json"];
        actionResult?: DataResult;
        defaultShouldRevalidate: boolean;
    }): boolean;
}
/**
 * Keys we cannot change from within a lazy() function. We spread all other keys
 * onto the route. Either they're meaningful to the router, or they'll get
 * ignored.
 */
type ImmutableRouteKey = "lazy" | "caseSensitive" | "path" | "id" | "index" | "children";
type RequireOne<T, Key = keyof T> = Exclude<{
    [K in keyof T]: K extends Key ? Omit<T, K> & Required<Pick<T, K>> : never;
}[keyof T], undefined>;
/**
 * lazy() function to load a route definition, which can add non-matching
 * related properties to a route
 */
interface LazyRouteFunction<R extends AgnosticRouteObject> {
    (): Promise<RequireOne<Omit<R, ImmutableRouteKey>>>;
}
/**
 * Base RouteObject with common props shared by all types of routes
 */
type AgnosticBaseRouteObject = {
    caseSensitive?: boolean;
    path?: string;
    id?: string;
    loader?: LoaderFunction;
    action?: ActionFunction;
    hasErrorBoundary?: boolean;
    shouldRevalidate?: ShouldRevalidateFunction;
    handle?: any;
    lazy?: LazyRouteFunction<AgnosticBaseRouteObject>;
};
/**
 * Index routes must not have children
 */
type AgnosticIndexRouteObject = AgnosticBaseRouteObject & {
    children?: undefined;
    index: true;
};
/**
 * Non-index routes may have children, but cannot have index
 */
type AgnosticNonIndexRouteObject = AgnosticBaseRouteObject & {
    children?: AgnosticRouteObject[];
    index?: false;
};
/**
 * A route object represents a logical route, with (optionally) its child
 * routes organized in a tree-like structure.
 */
type AgnosticRouteObject = AgnosticIndexRouteObject | AgnosticNonIndexRouteObject;
type AgnosticDataIndexRouteObject = AgnosticIndexRouteObject & {
    id: string;
};
type AgnosticDataNonIndexRouteObject = AgnosticNonIndexRouteObject & {
    children?: AgnosticDataRouteObject[];
    id: string;
};
/**
 * A data route object, which is just a RouteObject with a required unique ID
 */
type AgnosticDataRouteObject = AgnosticDataIndexRouteObject | AgnosticDataNonIndexRouteObject;
/**
 * The parameters that were parsed from the URL path.
 */
type Params<Key extends string = string> = {
    readonly [key in Key]: string | undefined;
};
/**
 * A RouteMatch contains info about how a route matched a URL.
 */
interface AgnosticRouteMatch<ParamKey extends string = string, RouteObjectType extends AgnosticRouteObject = AgnosticRouteObject> {
    /**
     * The names and values of dynamic parameters in the URL.
     */
    params: Params<ParamKey>;
    /**
     * The portion of the URL pathname that was matched.
     */
    pathname: string;
    /**
     * The portion of the URL pathname that was matched before child routes.
     */
    pathnameBase: string;
    /**
     * The route object that was used to match.
     */
    route: RouteObjectType;
}
interface AgnosticDataRouteMatch extends AgnosticRouteMatch<string, AgnosticDataRouteObject> {
}
declare class DeferredData {
    private pendingKeysSet;
    private controller;
    private abortPromise;
    private unlistenAbortSignal;
    private subscribers;
    data: Record<string, unknown>;
    init?: ResponseInit;
    deferredKeys: string[];
    constructor(data: Record<string, unknown>, responseInit?: ResponseInit);
    private trackPromise;
    private onSettle;
    private emit;
    subscribe(fn: (aborted: boolean, settledKey?: string) => void): () => boolean;
    cancel(): void;
    resolveData(signal: AbortSignal): Promise<boolean>;
    get done(): boolean;
    get unwrappedData(): {};
    get pendingKeys(): string[];
}

/**
 * State maintained internally by the router.  During a navigation, all states
 * reflect the the "old" location unless otherwise noted.
 */
interface RouterState {
    /**
     * The action of the most recent navigation
     */
    historyAction: Action;
    /**
     * The current location reflected by the router
     */
    location: Location;
    /**
     * The current set of route matches
     */
    matches: AgnosticDataRouteMatch[];
    /**
     * Tracks whether we've completed our initial data load
     */
    initialized: boolean;
    /**
     * Current scroll position we should start at for a new view
     *  - number -> scroll position to restore to
     *  - false -> do not restore scroll at all (used during submissions)
     *  - null -> don't have a saved position, scroll to hash or top of page
     */
    restoreScrollPosition: number | false | null;
    /**
     * Indicate whether this navigation should skip resetting the scroll position
     * if we are unable to restore the scroll position
     */
    preventScrollReset: boolean;
    /**
     * Tracks the state of the current navigation
     */
    navigation: Navigation;
    /**
     * Tracks any in-progress revalidations
     */
    revalidation: RevalidationState;
    /**
     * Data from the loaders for the current matches
     */
    loaderData: RouteData;
    /**
     * Data from the action for the current matches
     */
    actionData: RouteData | null;
    /**
     * Errors caught from loaders for the current matches
     */
    errors: RouteData | null;
    /**
     * Map of current fetchers
     */
    fetchers: Map<string, Fetcher>;
    /**
     * Map of current blockers
     */
    blockers: Map<string, Blocker>;
}
/**
 * Data that can be passed into hydrate a Router from SSR
 */
type HydrationState = Partial<Pick<RouterState, "loaderData" | "actionData" | "errors">>;
/**
 * Potential states for state.navigation
 */
type NavigationStates = {
    Idle: {
        state: "idle";
        location: undefined;
        formMethod: undefined;
        formAction: undefined;
        formEncType: undefined;
        formData: undefined;
        json: undefined;
        text: undefined;
    };
    Loading: {
        state: "loading";
        location: Location;
        formMethod: Submission["formMethod"] | undefined;
        formAction: Submission["formAction"] | undefined;
        formEncType: Submission["formEncType"] | undefined;
        formData: Submission["formData"] | undefined;
        json: Submission["json"] | undefined;
        text: Submission["text"] | undefined;
    };
    Submitting: {
        state: "submitting";
        location: Location;
        formMethod: Submission["formMethod"];
        formAction: Submission["formAction"];
        formEncType: Submission["formEncType"];
        formData: Submission["formData"];
        json: Submission["json"];
        text: Submission["text"];
    };
};
type Navigation = NavigationStates[keyof NavigationStates];
type RevalidationState = "idle" | "loading";
/**
 * Potential states for fetchers
 */
type FetcherStates<TData = any> = {
    Idle: {
        state: "idle";
        formMethod: undefined;
        formAction: undefined;
        formEncType: undefined;
        text: undefined;
        formData: undefined;
        json: undefined;
        data: TData | undefined;
        " _hasFetcherDoneAnything "?: boolean;
    };
    Loading: {
        state: "loading";
        formMethod: Submission["formMethod"] | undefined;
        formAction: Submission["formAction"] | undefined;
        formEncType: Submission["formEncType"] | undefined;
        text: Submission["text"] | undefined;
        formData: Submission["formData"] | undefined;
        json: Submission["json"] | undefined;
        data: TData | undefined;
        " _hasFetcherDoneAnything "?: boolean;
    };
    Submitting: {
        state: "submitting";
        formMethod: Submission["formMethod"];
        formAction: Submission["formAction"];
        formEncType: Submission["formEncType"];
        text: Submission["text"];
        formData: Submission["formData"];
        json: Submission["json"];
        data: TData | undefined;
        " _hasFetcherDoneAnything "?: boolean;
    };
};
type Fetcher<TData = any> = FetcherStates<TData>[keyof FetcherStates<TData>];
interface BlockerBlocked {
    state: "blocked";
    reset(): void;
    proceed(): void;
    location: Location;
}
interface BlockerUnblocked {
    state: "unblocked";
    reset: undefined;
    proceed: undefined;
    location: undefined;
}
interface BlockerProceeding {
    state: "proceeding";
    reset: undefined;
    proceed: undefined;
    location: Location;
}
type Blocker = BlockerUnblocked | BlockerBlocked | BlockerProceeding;

/**
 * NOTE: If you refactor this to split up the modules into separate files,
 * you'll need to update the rollup config for react-router-dom-v5-compat.
 */

declare global {
    var __staticRouterHydrationData: HydrationState | undefined;
}

/** Free-form error attached to a story snippet entry. */
interface StoryDocsError {
    name: string;
    message: string;
}
/** Snippet + metadata for one story under a component. */
interface StoryDoc {
    id: string;
    name: string;
    snippet?: string;
    description?: string;
    summary?: string;
    error?: StoryDocsError;
}
/** Story docs keyed by story id for O(1) lookup and fine-grained open-service subscriptions. */
type StoryDocsById = Record<string, StoryDoc>;
/**
 * Story-docs payload returned by `core/story-docs`'s `storyDocs` query.
 *
 * Carries per-story snippets and descriptions plus file-level import statements. Import snippets
 * do not currently honor the component `@import` JSDoc override tag — see the story-docs service
 * README for details.
 */
interface StoryDocsPayload {
    id: string;
    name: string;
    /** CSF story file import path from the index entry. */
    path: string;
    /** Suggested import statement(s) prepended to story snippets in docs. */
    import?: string;
    stories: StoryDocsById;
    error?: StoryDocsError;
}

declare global {
    var globalProjectAnnotations: NormalizedProjectAnnotations<any>;
    var defaultProjectAnnotations: ProjectAnnotations<any>;
}
type WrappedStoryRef = {
    __pw_type: 'jsx';
    props: Record<string, any>;
} | {
    __pw_type: 'importRef';
};
type UnwrappedJSXStoryRef = {
    __pw_type: 'jsx';
    type: UnwrappedImportStoryRef;
};
type UnwrappedImportStoryRef = ComposedStoryFn;
declare global {
    function __pwUnwrapObject(storyRef: WrappedStoryRef): Promise<UnwrappedJSXStoryRef | UnwrappedImportStoryRef>;
}

type StoryDocsServiceState = {
    /** Extracted story docs keyed by component id. Populated by the `extractStoryDocs` command. */
    components: Record<string, StoryDocsPayload>;
};
/**
 * Definition for the `core/story-docs` open service.
 *
 * Carries per-story snippets, descriptions, and file-level import statements keyed by component
 * id. Component prop docgen lives in `core/docgen`.
 */
declare const storyDocsServiceDef: storybook_open_service.ServiceDefinition<StoryDocsServiceState, {
    readonly storyDocs: storybook_open_service.QueryDefinition<StoryDocsServiceState, ObjectSchema<{
        readonly id: StringSchema<undefined>;
    }, undefined>, OptionalSchema<ObjectSchema<{
        readonly id: StringSchema<undefined>;
        readonly name: StringSchema<undefined>;
        readonly path: StringSchema<undefined>;
        readonly import: OptionalSchema<StringSchema<undefined>, undefined>;
        readonly stories: RecordSchema<StringSchema<undefined>, ObjectSchema<{
            readonly id: StringSchema<undefined>;
            readonly name: StringSchema<undefined>;
            readonly snippet: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
        }, undefined>, undefined>;
        readonly error: OptionalSchema<ObjectSchema<{
            readonly name: StringSchema<undefined>;
            readonly message: StringSchema<undefined>;
        }, undefined>, undefined>;
    }, undefined>, undefined>, {
        readonly extractStoryDocs: ObjectSchema<{
            readonly id: StringSchema<undefined>;
        }, undefined>;
        readonly extractAllStoryDocs: UndefinedSchema<undefined>;
    }, {
        readonly extractStoryDocs: OptionalSchema<ObjectSchema<{
            readonly id: StringSchema<undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly import: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly stories: RecordSchema<StringSchema<undefined>, ObjectSchema<{
                readonly id: StringSchema<undefined>;
                readonly name: StringSchema<undefined>;
                readonly snippet: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
        }, undefined>, undefined>;
        readonly extractAllStoryDocs: VoidSchema<undefined>;
    }, QueryFunctions<{
        readonly storyDocs: ObjectSchema<{
            readonly id: StringSchema<undefined>;
        }, undefined>;
        readonly storyDocsForAllComponents: VoidSchema<undefined>;
    }, {
        readonly storyDocs: OptionalSchema<ObjectSchema<{
            readonly id: StringSchema<undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly import: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly stories: RecordSchema<StringSchema<undefined>, ObjectSchema<{
                readonly id: StringSchema<undefined>;
                readonly name: StringSchema<undefined>;
                readonly snippet: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
        }, undefined>, undefined>;
        readonly storyDocsForAllComponents: RecordSchema<StringSchema<undefined>, ObjectSchema<{
            readonly id: StringSchema<undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly import: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly stories: RecordSchema<StringSchema<undefined>, ObjectSchema<{
                readonly id: StringSchema<undefined>;
                readonly name: StringSchema<undefined>;
                readonly snippet: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
        }, undefined>, undefined>;
    }>> & ({
        internal?: false;
    } | {
        __internal_naming_error: "Operation \"storyDocs\" has internal: true but must be prefixed with \"_\"";
    });
    readonly storyDocsForAllComponents: storybook_open_service.QueryDefinition<StoryDocsServiceState, VoidSchema<undefined>, RecordSchema<StringSchema<undefined>, ObjectSchema<{
        readonly id: StringSchema<undefined>;
        readonly name: StringSchema<undefined>;
        readonly path: StringSchema<undefined>;
        readonly import: OptionalSchema<StringSchema<undefined>, undefined>;
        readonly stories: RecordSchema<StringSchema<undefined>, ObjectSchema<{
            readonly id: StringSchema<undefined>;
            readonly name: StringSchema<undefined>;
            readonly snippet: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
        }, undefined>, undefined>;
        readonly error: OptionalSchema<ObjectSchema<{
            readonly name: StringSchema<undefined>;
            readonly message: StringSchema<undefined>;
        }, undefined>, undefined>;
    }, undefined>, undefined>, {
        readonly extractStoryDocs: ObjectSchema<{
            readonly id: StringSchema<undefined>;
        }, undefined>;
        readonly extractAllStoryDocs: UndefinedSchema<undefined>;
    }, {
        readonly extractStoryDocs: OptionalSchema<ObjectSchema<{
            readonly id: StringSchema<undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly import: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly stories: RecordSchema<StringSchema<undefined>, ObjectSchema<{
                readonly id: StringSchema<undefined>;
                readonly name: StringSchema<undefined>;
                readonly snippet: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
        }, undefined>, undefined>;
        readonly extractAllStoryDocs: VoidSchema<undefined>;
    }, QueryFunctions<{
        readonly storyDocs: ObjectSchema<{
            readonly id: StringSchema<undefined>;
        }, undefined>;
        readonly storyDocsForAllComponents: VoidSchema<undefined>;
    }, {
        readonly storyDocs: OptionalSchema<ObjectSchema<{
            readonly id: StringSchema<undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly import: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly stories: RecordSchema<StringSchema<undefined>, ObjectSchema<{
                readonly id: StringSchema<undefined>;
                readonly name: StringSchema<undefined>;
                readonly snippet: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
        }, undefined>, undefined>;
        readonly storyDocsForAllComponents: RecordSchema<StringSchema<undefined>, ObjectSchema<{
            readonly id: StringSchema<undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly import: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly stories: RecordSchema<StringSchema<undefined>, ObjectSchema<{
                readonly id: StringSchema<undefined>;
                readonly name: StringSchema<undefined>;
                readonly snippet: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
        }, undefined>, undefined>;
    }>> & ({
        internal?: false;
    } | {
        __internal_naming_error: "Operation \"storyDocsForAllComponents\" has internal: true but must be prefixed with \"_\"";
    });
} & {
    readonly storyDocs: {
        output: OptionalSchema<ObjectSchema<{
            readonly id: StringSchema<undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly import: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly stories: RecordSchema<StringSchema<undefined>, ObjectSchema<{
                readonly id: StringSchema<undefined>;
                readonly name: StringSchema<undefined>;
                readonly snippet: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
        }, undefined>, undefined>;
    };
    readonly storyDocsForAllComponents: {
        output: RecordSchema<StringSchema<undefined>, ObjectSchema<{
            readonly id: StringSchema<undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly import: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly stories: RecordSchema<StringSchema<undefined>, ObjectSchema<{
                readonly id: StringSchema<undefined>;
                readonly name: StringSchema<undefined>;
                readonly snippet: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
        }, undefined>, undefined>;
    };
}, {
    readonly extractStoryDocs: storybook_open_service.CommandDefinition<StoryDocsServiceState, ObjectSchema<{
        readonly id: StringSchema<undefined>;
    }, undefined>, OptionalSchema<ObjectSchema<{
        readonly id: StringSchema<undefined>;
        readonly name: StringSchema<undefined>;
        readonly path: StringSchema<undefined>;
        readonly import: OptionalSchema<StringSchema<undefined>, undefined>;
        readonly stories: RecordSchema<StringSchema<undefined>, ObjectSchema<{
            readonly id: StringSchema<undefined>;
            readonly name: StringSchema<undefined>;
            readonly snippet: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
        }, undefined>, undefined>;
        readonly error: OptionalSchema<ObjectSchema<{
            readonly name: StringSchema<undefined>;
            readonly message: StringSchema<undefined>;
        }, undefined>, undefined>;
    }, undefined>, undefined>, {
        readonly extractStoryDocs: ObjectSchema<{
            readonly id: StringSchema<undefined>;
        }, undefined>;
        readonly extractAllStoryDocs: UndefinedSchema<undefined>;
    }, {
        readonly extractStoryDocs: OptionalSchema<ObjectSchema<{
            readonly id: StringSchema<undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly import: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly stories: RecordSchema<StringSchema<undefined>, ObjectSchema<{
                readonly id: StringSchema<undefined>;
                readonly name: StringSchema<undefined>;
                readonly snippet: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
        }, undefined>, undefined>;
        readonly extractAllStoryDocs: VoidSchema<undefined>;
    }, QueryFunctions<{
        readonly storyDocs: ObjectSchema<{
            readonly id: StringSchema<undefined>;
        }, undefined>;
        readonly storyDocsForAllComponents: VoidSchema<undefined>;
    }, {
        readonly storyDocs: OptionalSchema<ObjectSchema<{
            readonly id: StringSchema<undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly import: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly stories: RecordSchema<StringSchema<undefined>, ObjectSchema<{
                readonly id: StringSchema<undefined>;
                readonly name: StringSchema<undefined>;
                readonly snippet: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
        }, undefined>, undefined>;
        readonly storyDocsForAllComponents: RecordSchema<StringSchema<undefined>, ObjectSchema<{
            readonly id: StringSchema<undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly import: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly stories: RecordSchema<StringSchema<undefined>, ObjectSchema<{
                readonly id: StringSchema<undefined>;
                readonly name: StringSchema<undefined>;
                readonly snippet: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
        }, undefined>, undefined>;
    }>> & ({
        internal?: false;
    } | {
        __internal_naming_error: "Operation \"extractStoryDocs\" has internal: true but must be prefixed with \"_\"";
    });
    readonly extractAllStoryDocs: storybook_open_service.CommandDefinition<StoryDocsServiceState, UndefinedSchema<undefined>, VoidSchema<undefined>, {
        readonly extractStoryDocs: ObjectSchema<{
            readonly id: StringSchema<undefined>;
        }, undefined>;
        readonly extractAllStoryDocs: UndefinedSchema<undefined>;
    }, {
        readonly extractStoryDocs: OptionalSchema<ObjectSchema<{
            readonly id: StringSchema<undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly import: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly stories: RecordSchema<StringSchema<undefined>, ObjectSchema<{
                readonly id: StringSchema<undefined>;
                readonly name: StringSchema<undefined>;
                readonly snippet: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
        }, undefined>, undefined>;
        readonly extractAllStoryDocs: VoidSchema<undefined>;
    }, QueryFunctions<{
        readonly storyDocs: ObjectSchema<{
            readonly id: StringSchema<undefined>;
        }, undefined>;
        readonly storyDocsForAllComponents: VoidSchema<undefined>;
    }, {
        readonly storyDocs: OptionalSchema<ObjectSchema<{
            readonly id: StringSchema<undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly import: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly stories: RecordSchema<StringSchema<undefined>, ObjectSchema<{
                readonly id: StringSchema<undefined>;
                readonly name: StringSchema<undefined>;
                readonly snippet: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
        }, undefined>, undefined>;
        readonly storyDocsForAllComponents: RecordSchema<StringSchema<undefined>, ObjectSchema<{
            readonly id: StringSchema<undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly import: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly stories: RecordSchema<StringSchema<undefined>, ObjectSchema<{
                readonly id: StringSchema<undefined>;
                readonly name: StringSchema<undefined>;
                readonly snippet: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
        }, undefined>, undefined>;
    }>> & ({
        internal?: false;
    } | {
        __internal_naming_error: "Operation \"extractAllStoryDocs\" has internal: true but must be prefixed with \"_\"";
    });
} & {
    readonly extractStoryDocs: {
        output: OptionalSchema<ObjectSchema<{
            readonly id: StringSchema<undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly import: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly stories: RecordSchema<StringSchema<undefined>, ObjectSchema<{
                readonly id: StringSchema<undefined>;
                readonly name: StringSchema<undefined>;
                readonly snippet: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
                readonly error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
        }, undefined>, undefined>;
    };
    readonly extractAllStoryDocs: {
        output: VoidSchema<undefined>;
    };
}, "core/story-docs">;
type StoryDocsService = ServiceInstanceOf<typeof storyDocsServiceDef>;

/** Free-form error attached to a payload or subcomponent. */
interface DocgenError {
    name: string;
    message: string;
}
/** Compact JSDoc tag map: tag name → list of tag values (e.g. `@example a` → `{ example: ['a'] }`). */
type DocgenJsDocTags = Record<string, string[]>;
/**
 * Docgen payload returned by `core/docgen`'s `docgen` query.
 *
 * Component-only fields (props, descriptions, subcomponents). Story snippets and file-level
 * imports live in `core/story-docs` when `experimentalDocgenServer` is enabled.
 */
interface DocgenPayload {
    id: string;
    name: string;
    /** CSF story file import path from the index entry (same as component manifest `path`). */
    path: string;
    description?: string;
    summary?: string;
    jsDocTags: DocgenJsDocTags;
    /** Renderer-converted argTypes derived from integration-specific docgen data at write time. */
    argTypes?: StrictArgTypes;
    subcomponents?: Record<string, DocgenSubcomponent>;
    error?: DocgenError;
    [key: string]: unknown;
}
/** Component-level summary + docgen for one subcomponent. */
interface DocgenSubcomponent {
    name: string;
    path: string;
    description?: string;
    summary?: string;
    import?: string;
    jsDocTags: DocgenJsDocTags;
    /** Renderer-converted argTypes derived from integration-specific docgen data at write time. */
    argTypes?: StrictArgTypes;
    error?: DocgenError;
    [key: string]: unknown;
}

type DocgenServiceState = {
    /** Extracted docgen keyed by component id. Populated by the `extractDocgen` command. */
    components: Record<string, DocgenPayload>;
};
/**
 * Definition for the `core/docgen` open service.
 *
 * The service carries only provider-extracted docgen (component name, description, props, JSDoc
 * tags, and the renderer-converted argTypes). Story/meta/project custom argTypes are NOT stored
 * here — consumers layer those in from their own sources (the docs blocks resolve the prepared
 * meta/story locally; the manager Controls panel reads them from the `STORY_PREPARED` channel).
 *
 * The query is a thin synchronous read of `state.components[id]` — it returns undefined when
 * nothing has been extracted yet rather than throwing, matching the open-service convention for
 * sync reads. The real work — story index lookup, provider invocation, error handling — lives in
 * the `extractDocgen` command, whose body is supplied at registration time because it needs to
 * close over the server-only story index and the composed `experimental_docgenProvider` chain.
 * The query's `load` hook calls `extractDocgen`, so `docgen.loaded()` is the awaitable form and
 * surfaces extraction errors. `docgenForAllComponents` delegates to the `extractAllDocgen`
 * command, whose handler is supplied at registration because it needs the story index.
 */
declare const docgenServiceDef: storybook_open_service.ServiceDefinition<DocgenServiceState, {
    readonly docgen: storybook_open_service.QueryDefinition<DocgenServiceState, ObjectSchema<{
        readonly id: StringSchema<undefined>;
    }, undefined>, OptionalSchema<LooseObjectSchema<{
        readonly subcomponents: OptionalSchema<RecordSchema<StringSchema<undefined>, LooseObjectSchema<{
            import: OptionalSchema<StringSchema<undefined>, undefined>;
            name: StringSchema<undefined>;
            path: StringSchema<undefined>;
            description: OptionalSchema<StringSchema<undefined>, undefined>;
            summary: OptionalSchema<StringSchema<undefined>, undefined>;
            jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
            argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
            error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
        }, undefined>, undefined>, undefined>;
        readonly name: StringSchema<undefined>;
        readonly path: StringSchema<undefined>;
        readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
        readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
        readonly jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
        readonly argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
        readonly error: OptionalSchema<ObjectSchema<{
            readonly name: StringSchema<undefined>;
            readonly message: StringSchema<undefined>;
        }, undefined>, undefined>;
        readonly id: StringSchema<undefined>;
    }, undefined>, undefined>, {
        readonly extractDocgen: ObjectSchema<{
            readonly id: StringSchema<undefined>;
        }, undefined>;
        readonly extractAllDocgen: UndefinedSchema<undefined>;
    }, {
        readonly extractDocgen: OptionalSchema<LooseObjectSchema<{
            readonly subcomponents: OptionalSchema<RecordSchema<StringSchema<undefined>, LooseObjectSchema<{
                import: OptionalSchema<StringSchema<undefined>, undefined>;
                name: StringSchema<undefined>;
                path: StringSchema<undefined>;
                description: OptionalSchema<StringSchema<undefined>, undefined>;
                summary: OptionalSchema<StringSchema<undefined>, undefined>;
                jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
                argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
                error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>, undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
            readonly argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
            readonly id: StringSchema<undefined>;
        }, undefined>, undefined>;
        readonly extractAllDocgen: VoidSchema<undefined>;
    }, QueryFunctions<{
        readonly docgen: ObjectSchema<{
            readonly id: StringSchema<undefined>;
        }, undefined>;
        readonly docgenForAllComponents: VoidSchema<undefined>;
    }, {
        readonly docgen: OptionalSchema<LooseObjectSchema<{
            readonly subcomponents: OptionalSchema<RecordSchema<StringSchema<undefined>, LooseObjectSchema<{
                import: OptionalSchema<StringSchema<undefined>, undefined>;
                name: StringSchema<undefined>;
                path: StringSchema<undefined>;
                description: OptionalSchema<StringSchema<undefined>, undefined>;
                summary: OptionalSchema<StringSchema<undefined>, undefined>;
                jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
                argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
                error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>, undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
            readonly argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
            readonly id: StringSchema<undefined>;
        }, undefined>, undefined>;
        readonly docgenForAllComponents: RecordSchema<StringSchema<undefined>, LooseObjectSchema<{
            readonly subcomponents: OptionalSchema<RecordSchema<StringSchema<undefined>, LooseObjectSchema<{
                import: OptionalSchema<StringSchema<undefined>, undefined>;
                name: StringSchema<undefined>;
                path: StringSchema<undefined>;
                description: OptionalSchema<StringSchema<undefined>, undefined>;
                summary: OptionalSchema<StringSchema<undefined>, undefined>;
                jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
                argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
                error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>, undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
            readonly argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
            readonly id: StringSchema<undefined>;
        }, undefined>, undefined>;
    }>> & ({
        internal?: false;
    } | {
        __internal_naming_error: "Operation \"docgen\" has internal: true but must be prefixed with \"_\"";
    });
    readonly docgenForAllComponents: storybook_open_service.QueryDefinition<DocgenServiceState, VoidSchema<undefined>, RecordSchema<StringSchema<undefined>, LooseObjectSchema<{
        readonly subcomponents: OptionalSchema<RecordSchema<StringSchema<undefined>, LooseObjectSchema<{
            import: OptionalSchema<StringSchema<undefined>, undefined>;
            name: StringSchema<undefined>;
            path: StringSchema<undefined>;
            description: OptionalSchema<StringSchema<undefined>, undefined>;
            summary: OptionalSchema<StringSchema<undefined>, undefined>;
            jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
            argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
            error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
        }, undefined>, undefined>, undefined>;
        readonly name: StringSchema<undefined>;
        readonly path: StringSchema<undefined>;
        readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
        readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
        readonly jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
        readonly argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
        readonly error: OptionalSchema<ObjectSchema<{
            readonly name: StringSchema<undefined>;
            readonly message: StringSchema<undefined>;
        }, undefined>, undefined>;
        readonly id: StringSchema<undefined>;
    }, undefined>, undefined>, {
        readonly extractDocgen: ObjectSchema<{
            readonly id: StringSchema<undefined>;
        }, undefined>;
        readonly extractAllDocgen: UndefinedSchema<undefined>;
    }, {
        readonly extractDocgen: OptionalSchema<LooseObjectSchema<{
            readonly subcomponents: OptionalSchema<RecordSchema<StringSchema<undefined>, LooseObjectSchema<{
                import: OptionalSchema<StringSchema<undefined>, undefined>;
                name: StringSchema<undefined>;
                path: StringSchema<undefined>;
                description: OptionalSchema<StringSchema<undefined>, undefined>;
                summary: OptionalSchema<StringSchema<undefined>, undefined>;
                jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
                argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
                error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>, undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
            readonly argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
            readonly id: StringSchema<undefined>;
        }, undefined>, undefined>;
        readonly extractAllDocgen: VoidSchema<undefined>;
    }, QueryFunctions<{
        readonly docgen: ObjectSchema<{
            readonly id: StringSchema<undefined>;
        }, undefined>;
        readonly docgenForAllComponents: VoidSchema<undefined>;
    }, {
        readonly docgen: OptionalSchema<LooseObjectSchema<{
            readonly subcomponents: OptionalSchema<RecordSchema<StringSchema<undefined>, LooseObjectSchema<{
                import: OptionalSchema<StringSchema<undefined>, undefined>;
                name: StringSchema<undefined>;
                path: StringSchema<undefined>;
                description: OptionalSchema<StringSchema<undefined>, undefined>;
                summary: OptionalSchema<StringSchema<undefined>, undefined>;
                jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
                argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
                error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>, undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
            readonly argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
            readonly id: StringSchema<undefined>;
        }, undefined>, undefined>;
        readonly docgenForAllComponents: RecordSchema<StringSchema<undefined>, LooseObjectSchema<{
            readonly subcomponents: OptionalSchema<RecordSchema<StringSchema<undefined>, LooseObjectSchema<{
                import: OptionalSchema<StringSchema<undefined>, undefined>;
                name: StringSchema<undefined>;
                path: StringSchema<undefined>;
                description: OptionalSchema<StringSchema<undefined>, undefined>;
                summary: OptionalSchema<StringSchema<undefined>, undefined>;
                jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
                argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
                error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>, undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
            readonly argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
            readonly id: StringSchema<undefined>;
        }, undefined>, undefined>;
    }>> & ({
        internal?: false;
    } | {
        __internal_naming_error: "Operation \"docgenForAllComponents\" has internal: true but must be prefixed with \"_\"";
    });
} & {
    readonly docgen: {
        output: OptionalSchema<LooseObjectSchema<{
            readonly subcomponents: OptionalSchema<RecordSchema<StringSchema<undefined>, LooseObjectSchema<{
                import: OptionalSchema<StringSchema<undefined>, undefined>;
                name: StringSchema<undefined>;
                path: StringSchema<undefined>;
                description: OptionalSchema<StringSchema<undefined>, undefined>;
                summary: OptionalSchema<StringSchema<undefined>, undefined>;
                jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
                argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
                error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>, undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
            readonly argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
            readonly id: StringSchema<undefined>;
        }, undefined>, undefined>;
    };
    readonly docgenForAllComponents: {
        output: RecordSchema<StringSchema<undefined>, LooseObjectSchema<{
            readonly subcomponents: OptionalSchema<RecordSchema<StringSchema<undefined>, LooseObjectSchema<{
                import: OptionalSchema<StringSchema<undefined>, undefined>;
                name: StringSchema<undefined>;
                path: StringSchema<undefined>;
                description: OptionalSchema<StringSchema<undefined>, undefined>;
                summary: OptionalSchema<StringSchema<undefined>, undefined>;
                jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
                argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
                error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>, undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
            readonly argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
            readonly id: StringSchema<undefined>;
        }, undefined>, undefined>;
    };
}, {
    readonly extractDocgen: storybook_open_service.CommandDefinition<DocgenServiceState, ObjectSchema<{
        readonly id: StringSchema<undefined>;
    }, undefined>, OptionalSchema<LooseObjectSchema<{
        readonly subcomponents: OptionalSchema<RecordSchema<StringSchema<undefined>, LooseObjectSchema<{
            import: OptionalSchema<StringSchema<undefined>, undefined>;
            name: StringSchema<undefined>;
            path: StringSchema<undefined>;
            description: OptionalSchema<StringSchema<undefined>, undefined>;
            summary: OptionalSchema<StringSchema<undefined>, undefined>;
            jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
            argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
            error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
        }, undefined>, undefined>, undefined>;
        readonly name: StringSchema<undefined>;
        readonly path: StringSchema<undefined>;
        readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
        readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
        readonly jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
        readonly argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
        readonly error: OptionalSchema<ObjectSchema<{
            readonly name: StringSchema<undefined>;
            readonly message: StringSchema<undefined>;
        }, undefined>, undefined>;
        readonly id: StringSchema<undefined>;
    }, undefined>, undefined>, {
        readonly extractDocgen: ObjectSchema<{
            readonly id: StringSchema<undefined>;
        }, undefined>;
        readonly extractAllDocgen: UndefinedSchema<undefined>;
    }, {
        readonly extractDocgen: OptionalSchema<LooseObjectSchema<{
            readonly subcomponents: OptionalSchema<RecordSchema<StringSchema<undefined>, LooseObjectSchema<{
                import: OptionalSchema<StringSchema<undefined>, undefined>;
                name: StringSchema<undefined>;
                path: StringSchema<undefined>;
                description: OptionalSchema<StringSchema<undefined>, undefined>;
                summary: OptionalSchema<StringSchema<undefined>, undefined>;
                jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
                argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
                error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>, undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
            readonly argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
            readonly id: StringSchema<undefined>;
        }, undefined>, undefined>;
        readonly extractAllDocgen: VoidSchema<undefined>;
    }, QueryFunctions<{
        readonly docgen: ObjectSchema<{
            readonly id: StringSchema<undefined>;
        }, undefined>;
        readonly docgenForAllComponents: VoidSchema<undefined>;
    }, {
        readonly docgen: OptionalSchema<LooseObjectSchema<{
            readonly subcomponents: OptionalSchema<RecordSchema<StringSchema<undefined>, LooseObjectSchema<{
                import: OptionalSchema<StringSchema<undefined>, undefined>;
                name: StringSchema<undefined>;
                path: StringSchema<undefined>;
                description: OptionalSchema<StringSchema<undefined>, undefined>;
                summary: OptionalSchema<StringSchema<undefined>, undefined>;
                jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
                argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
                error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>, undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
            readonly argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
            readonly id: StringSchema<undefined>;
        }, undefined>, undefined>;
        readonly docgenForAllComponents: RecordSchema<StringSchema<undefined>, LooseObjectSchema<{
            readonly subcomponents: OptionalSchema<RecordSchema<StringSchema<undefined>, LooseObjectSchema<{
                import: OptionalSchema<StringSchema<undefined>, undefined>;
                name: StringSchema<undefined>;
                path: StringSchema<undefined>;
                description: OptionalSchema<StringSchema<undefined>, undefined>;
                summary: OptionalSchema<StringSchema<undefined>, undefined>;
                jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
                argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
                error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>, undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
            readonly argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
            readonly id: StringSchema<undefined>;
        }, undefined>, undefined>;
    }>> & ({
        internal?: false;
    } | {
        __internal_naming_error: "Operation \"extractDocgen\" has internal: true but must be prefixed with \"_\"";
    });
    readonly extractAllDocgen: storybook_open_service.CommandDefinition<DocgenServiceState, UndefinedSchema<undefined>, VoidSchema<undefined>, {
        readonly extractDocgen: ObjectSchema<{
            readonly id: StringSchema<undefined>;
        }, undefined>;
        readonly extractAllDocgen: UndefinedSchema<undefined>;
    }, {
        readonly extractDocgen: OptionalSchema<LooseObjectSchema<{
            readonly subcomponents: OptionalSchema<RecordSchema<StringSchema<undefined>, LooseObjectSchema<{
                import: OptionalSchema<StringSchema<undefined>, undefined>;
                name: StringSchema<undefined>;
                path: StringSchema<undefined>;
                description: OptionalSchema<StringSchema<undefined>, undefined>;
                summary: OptionalSchema<StringSchema<undefined>, undefined>;
                jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
                argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
                error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>, undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
            readonly argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
            readonly id: StringSchema<undefined>;
        }, undefined>, undefined>;
        readonly extractAllDocgen: VoidSchema<undefined>;
    }, QueryFunctions<{
        readonly docgen: ObjectSchema<{
            readonly id: StringSchema<undefined>;
        }, undefined>;
        readonly docgenForAllComponents: VoidSchema<undefined>;
    }, {
        readonly docgen: OptionalSchema<LooseObjectSchema<{
            readonly subcomponents: OptionalSchema<RecordSchema<StringSchema<undefined>, LooseObjectSchema<{
                import: OptionalSchema<StringSchema<undefined>, undefined>;
                name: StringSchema<undefined>;
                path: StringSchema<undefined>;
                description: OptionalSchema<StringSchema<undefined>, undefined>;
                summary: OptionalSchema<StringSchema<undefined>, undefined>;
                jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
                argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
                error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>, undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
            readonly argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
            readonly id: StringSchema<undefined>;
        }, undefined>, undefined>;
        readonly docgenForAllComponents: RecordSchema<StringSchema<undefined>, LooseObjectSchema<{
            readonly subcomponents: OptionalSchema<RecordSchema<StringSchema<undefined>, LooseObjectSchema<{
                import: OptionalSchema<StringSchema<undefined>, undefined>;
                name: StringSchema<undefined>;
                path: StringSchema<undefined>;
                description: OptionalSchema<StringSchema<undefined>, undefined>;
                summary: OptionalSchema<StringSchema<undefined>, undefined>;
                jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
                argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
                error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>, undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
            readonly argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
            readonly id: StringSchema<undefined>;
        }, undefined>, undefined>;
    }>> & ({
        internal?: false;
    } | {
        __internal_naming_error: "Operation \"extractAllDocgen\" has internal: true but must be prefixed with \"_\"";
    });
} & {
    readonly extractDocgen: {
        output: OptionalSchema<LooseObjectSchema<{
            readonly subcomponents: OptionalSchema<RecordSchema<StringSchema<undefined>, LooseObjectSchema<{
                import: OptionalSchema<StringSchema<undefined>, undefined>;
                name: StringSchema<undefined>;
                path: StringSchema<undefined>;
                description: OptionalSchema<StringSchema<undefined>, undefined>;
                summary: OptionalSchema<StringSchema<undefined>, undefined>;
                jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
                argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
                error: OptionalSchema<ObjectSchema<{
                    readonly name: StringSchema<undefined>;
                    readonly message: StringSchema<undefined>;
                }, undefined>, undefined>;
            }, undefined>, undefined>, undefined>;
            readonly name: StringSchema<undefined>;
            readonly path: StringSchema<undefined>;
            readonly description: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly summary: OptionalSchema<StringSchema<undefined>, undefined>;
            readonly jsDocTags: RecordSchema<StringSchema<undefined>, ArraySchema<StringSchema<undefined>, undefined>, undefined>;
            readonly argTypes: OptionalSchema<CustomSchema<StrictArgTypes$1<storybook_internal_types.Args>, undefined>, undefined>;
            readonly error: OptionalSchema<ObjectSchema<{
                readonly name: StringSchema<undefined>;
                readonly message: StringSchema<undefined>;
            }, undefined>, undefined>;
            readonly id: StringSchema<undefined>;
        }, undefined>, undefined>;
    };
    readonly extractAllDocgen: {
        output: VoidSchema<undefined>;
    };
}, "core/docgen">;
type DocgenService = ServiceInstanceOf<typeof docgenServiceDef>;

/** Prepends a CSF file import block to a story snippet for display in docs and the Code panel. */
declare function prependImportToSnippet(importBlock: string | undefined, snippet: string): string;
/** Resolves the story-docs entry for one story from a story-docs payload. */
declare function selectStoryDoc(payload: StoryDocsPayload | undefined, storyId: string): StoryDoc | undefined;
/** Resolves the display snippet for one story from a story-docs payload. */
declare function selectSnippetForStory(payload: StoryDocsPayload | undefined, storyId: string): string | undefined;

export { type AnyServiceDefinition, type Command, type CommandCtx, type CommandDefinition, type CommandSelf, type DocgenPayload, type DocgenService, type LoadCtx, type LoadSelf, type LoadStatus, type OperationDescriptor, type Query, type QueryCtx, type QueryDefinition, type QuerySelf, type QueryState, type QueryStatus, type RuntimeService, type SchemaDescriptor, type ServerServiceRegistration, type ServiceDefinition, type ServiceDescriptor, type ServiceId, type ServiceInstance, type ServiceInstanceOf, type ServiceRegistrationOptions, type ServiceState, type ServiceSummary, type StaticStore, type StoryDocsService, defineService, prependImportToSnippet, seedQueryState, selectSnippetForStory, selectStoryDoc };
