import type { SchemaObject } from '../schemas/v3.2/strict/schema.js'; /** * The dynamic scope, ordered outermost-first. * * Each entry is a schema resource on the current evaluation path. When a `$dynamicRef` is resolved, * the outermost entry that declares a matching `$dynamicAnchor` wins. */ export type DynamicScope = SchemaObject[]; /** Narrow a schema to one that carries a `$dynamicRef`. */ export declare const isDynamicRef: (schema: unknown) => schema is SchemaObject & { $dynamicRef: string; }; export declare const collectDynamicAnchors: (resource: SchemaObject) => Map; /** * Append a schema resource to the dynamic scope when it could hold a `$dynamicAnchor`. * * A schema that carries the binding inline — its own `$dynamicAnchor`, or the `$id`/`$defs` binding * written next to a `$ref` (how `Paginated` is expressed) — enters the scope directly. A bare * `$ref` to a *named* binding resource (e.g. `$ref: '#/components/schemas/PaginatedUserResponse'`) * hides that resource's `$id`/`$defs` behind the ref, so the anchor is invisible here; follow the ref * to reach the resource. Ordinary `$ref`s resolve to a schema without an anchor and are still skipped; * an unresolved `$ref` resolves to `undefined` and is skipped too. * * See https://github.com/scalar/scalar/issues/9883. */ export declare const pushDynamicScope: (scope: DynamicScope, schema: SchemaObject) => DynamicScope; /** * Resolve a `$dynamicRef` fragment against the dynamic scope. * * Scans the scope outermost-first and returns the first resource that declares a `$dynamicAnchor` with * the referenced name. Returns `undefined` when nothing matches, in which case callers should leave the * reference unresolved (the schema renders as it did before, with no regression). */ export declare const resolveDynamicRef: (dynamicRef: string, scope: DynamicScope) => SchemaObject | undefined; //# sourceMappingURL=dynamic-ref.d.ts.map