import type { HttpMethod } from '@scalar/helpers/http/http-methods'; import type { AsyncApiInfoObject } from '@scalar/types/asyncapi/3.1'; import type { LiteralUnion } from 'type-fest'; import type { InfoObject } from '../schemas/v3.2/strict/info.js'; import type { OperationObject } from '../schemas/v3.2/strict/operation.js'; import type { SchemaObject } from '../schemas/v3.2/strict/schema.js'; import type { TagObject } from '../schemas/v3.2/strict/tag.js'; /** * An operation method, including document-defined extension methods. * Known methods retain editor completion; the open string branch still requires * consumers to handle unknown methods rather than rely on an exhaustive switch. */ export type OperationMethod = LiteralUnion; export declare const NavigationBaseSchemaDefinition: import("@scalar/typebox").TObject<{ id: import("@scalar/typebox").TString; title: import("@scalar/typebox").TString; }>; type BaseSchema = { /** * The unique identifier for the entry * * Must be unique across the entire navigation structure. */ id: string; /** The user readable title of the entry */ title: string; }; export declare const TraversedDocumentSchemaDefinition: import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{ id: import("@scalar/typebox").TString; title: import("@scalar/typebox").TString; }>, import("@scalar/typebox").TObject<{ type: import("@scalar/typebox").TLiteral<"document">; name: import("@scalar/typebox").TString; children: import("@scalar/typebox").TOptional>>; icon: import("@scalar/typebox").TOptional; }>]>; /** * An entry representing an OpenAPI in the navigation structure. * * Used in the client to represent the root document and its operations or tags. */ export type TraversedDocument = BaseSchema & { type: 'document'; /** Document name */ name: string; /** Child entries under the document */ children?: TraversedEntry[]; icon?: string; }; export declare const TraversedDescriptionSchemaDefinition: import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{ id: import("@scalar/typebox").TString; title: import("@scalar/typebox").TString; }>, import("@scalar/typebox").TObject<{ type: import("@scalar/typebox").TLiteral<"text">; children: import("@scalar/typebox").TOptional>>; }>]>; /** * An entry representing a markdown description in the navigation structure. */ export type TraversedDescription = BaseSchema & { type: 'text'; children?: TraversedEntry[]; }; export declare const TraversedExampleSchemaDefinition: import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{ id: import("@scalar/typebox").TString; title: import("@scalar/typebox").TString; }>, import("@scalar/typebox").TObject<{ type: import("@scalar/typebox").TLiteral<"example">; name: import("@scalar/typebox").TString; }>]>; /** * An entry representing an operation example in the navigation structure. */ export type TraversedExample = BaseSchema & { type: 'example'; name: string; }; export declare const TraversedOperationSchemaDefinition: import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{ id: import("@scalar/typebox").TString; title: import("@scalar/typebox").TString; }>, import("@scalar/typebox").TObject<{ type: import("@scalar/typebox").TLiteral<"operation">; ref: import("@scalar/typebox").TString; method: import("@scalar/typebox").TString; path: import("@scalar/typebox").TString; isDeprecated: import("@scalar/typebox").TOptional; children: import("@scalar/typebox").TOptional>>; }>]>; /** * An entry representing an operation in the navigation structure. */ export type TraversedOperation = BaseSchema & { type: 'operation'; ref: string; method: OperationMethod; path: string; isDeprecated?: boolean; children?: TraversedEntry[]; }; export declare const TraversedAsyncApiOperationSchemaDefinition: import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{ id: import("@scalar/typebox").TString; title: import("@scalar/typebox").TString; }>, import("@scalar/typebox").TObject<{ type: import("@scalar/typebox").TLiteral<"asyncapi-operation">; operationName: import("@scalar/typebox").TString; action: import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"send">, import("@scalar/typebox").TLiteral<"receive">]>; channelName: import("@scalar/typebox").TString; channelAddress: import("@scalar/typebox").TString; children: import("@scalar/typebox").TOptional>>; }>]>; /** * An entry representing an AsyncAPI operation in the navigation structure. */ export type TraversedAsyncApiOperation = BaseSchema & { type: 'asyncapi-operation'; /** Key in `document.operations` */ operationName: string; action: 'send' | 'receive'; /** Resolved channel key in `document.channels` */ channelName: string; /** Channel address for display and routing */ channelAddress: string; /** Messages available on this operation */ children?: TraversedEntry[]; }; export declare const TraversedAsyncApiChannelSchemaDefinition: import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{ id: import("@scalar/typebox").TString; title: import("@scalar/typebox").TString; }>, import("@scalar/typebox").TObject<{ type: import("@scalar/typebox").TLiteral<"asyncapi-channel">; channelName: import("@scalar/typebox").TString; channelAddress: import("@scalar/typebox").TString; children: import("@scalar/typebox").TOptional>>; }>]>; /** * An entry representing an AsyncAPI channel in the navigation structure. */ export type TraversedAsyncApiChannel = BaseSchema & { type: 'asyncapi-channel'; /** Key in `document.channels` */ channelName: string; /** Channel address for display and routing */ channelAddress: string; /** Operations on the channel */ children?: TraversedEntry[]; }; export declare const TraversedAsyncApiMessageSchemaDefinition: import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{ id: import("@scalar/typebox").TString; title: import("@scalar/typebox").TString; }>, import("@scalar/typebox").TObject<{ type: import("@scalar/typebox").TLiteral<"asyncapi-message">; messageName: import("@scalar/typebox").TString; channelName: import("@scalar/typebox").TString; }>]>; /** * An entry representing an AsyncAPI message in the navigation structure. */ export type TraversedAsyncApiMessage = BaseSchema & { type: 'asyncapi-message'; /** Key in `channel.messages` */ messageName: string; /** Parent channel key in `document.channels` */ channelName: string; }; export declare const TraversedSchemaSchemaDefinition: import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{ id: import("@scalar/typebox").TString; title: import("@scalar/typebox").TString; }>, import("@scalar/typebox").TObject<{ type: import("@scalar/typebox").TLiteral<"model">; ref: import("@scalar/typebox").TString; name: import("@scalar/typebox").TString; }>]>; /** * An entry representing a model in the navigation structure. */ export type TraversedSchema = BaseSchema & { type: 'model'; ref: string; name: string; }; export declare const TraversedWebhookSchemaDefinition: import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{ id: import("@scalar/typebox").TString; title: import("@scalar/typebox").TString; }>, import("@scalar/typebox").TObject<{ type: import("@scalar/typebox").TLiteral<"webhook">; ref: import("@scalar/typebox").TString; method: import("@scalar/typebox").TString; name: import("@scalar/typebox").TString; isDeprecated: import("@scalar/typebox").TOptional; }>]>; /** * An entry representing a webhook in the navigation structure. */ export type TraversedWebhook = BaseSchema & { type: 'webhook'; ref: string; method: OperationMethod; name: string; isDeprecated?: boolean; }; export declare const TraversedTagSchemaDefinition: import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{ id: import("@scalar/typebox").TString; title: import("@scalar/typebox").TString; }>, import("@scalar/typebox").TObject<{ type: import("@scalar/typebox").TLiteral<"tag">; name: import("@scalar/typebox").TString; description: import("@scalar/typebox").TOptional; children: import("@scalar/typebox").TOptional>>; isGroup: import("@scalar/typebox").TBoolean; isTagGroup: import("@scalar/typebox").TOptional; isWebhooks: import("@scalar/typebox").TOptional; xKeys: import("@scalar/typebox").TOptional>; }>]>; /** * An entry representing a tag in the navigation structure. * * Used to group operations or webhooks under a common heading. */ export type TraversedTag = BaseSchema & { type: 'tag'; name: string; description?: string; children?: TraversedEntry[]; isGroup: boolean; /** * True only for legacy `x-tagGroups` wrapper entries, which are not real tags and render * without a header of their own. Real OpenAPI 3.2 nested-tag sections keep this unset so the * renderer still shows their summary and description. */ isTagGroup?: boolean; isWebhooks?: boolean; xKeys?: Record; }; export declare const TraversedModelsSchemaDefinition: import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{ id: import("@scalar/typebox").TString; title: import("@scalar/typebox").TString; }>, import("@scalar/typebox").TObject<{ type: import("@scalar/typebox").TLiteral<"models">; name: import("@scalar/typebox").TString; children: import("@scalar/typebox").TOptional>>; }>]>; /** * Top level models navigation entry. */ export type TraversedModels = BaseSchema & { type: 'models'; name: string; children?: TraversedEntry[]; }; export declare const TraversedEntrySchemaDefinition: import("@scalar/typebox").TUnion<[import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{ id: import("@scalar/typebox").TString; title: import("@scalar/typebox").TString; }>, import("@scalar/typebox").TObject<{ type: import("@scalar/typebox").TLiteral<"text">; children: import("@scalar/typebox").TOptional>>; }>]>, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{ id: import("@scalar/typebox").TString; title: import("@scalar/typebox").TString; }>, import("@scalar/typebox").TObject<{ type: import("@scalar/typebox").TLiteral<"operation">; ref: import("@scalar/typebox").TString; method: import("@scalar/typebox").TString; path: import("@scalar/typebox").TString; isDeprecated: import("@scalar/typebox").TOptional; children: import("@scalar/typebox").TOptional>>; }>]>, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{ id: import("@scalar/typebox").TString; title: import("@scalar/typebox").TString; }>, import("@scalar/typebox").TObject<{ type: import("@scalar/typebox").TLiteral<"asyncapi-operation">; operationName: import("@scalar/typebox").TString; action: import("@scalar/typebox").TUnion<[import("@scalar/typebox").TLiteral<"send">, import("@scalar/typebox").TLiteral<"receive">]>; channelName: import("@scalar/typebox").TString; channelAddress: import("@scalar/typebox").TString; children: import("@scalar/typebox").TOptional>>; }>]>, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{ id: import("@scalar/typebox").TString; title: import("@scalar/typebox").TString; }>, import("@scalar/typebox").TObject<{ type: import("@scalar/typebox").TLiteral<"asyncapi-channel">; channelName: import("@scalar/typebox").TString; channelAddress: import("@scalar/typebox").TString; children: import("@scalar/typebox").TOptional>>; }>]>, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{ id: import("@scalar/typebox").TString; title: import("@scalar/typebox").TString; }>, import("@scalar/typebox").TObject<{ type: import("@scalar/typebox").TLiteral<"asyncapi-message">; messageName: import("@scalar/typebox").TString; channelName: import("@scalar/typebox").TString; }>]>, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{ id: import("@scalar/typebox").TString; title: import("@scalar/typebox").TString; }>, import("@scalar/typebox").TObject<{ type: import("@scalar/typebox").TLiteral<"model">; ref: import("@scalar/typebox").TString; name: import("@scalar/typebox").TString; }>]>, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{ id: import("@scalar/typebox").TString; title: import("@scalar/typebox").TString; }>, import("@scalar/typebox").TObject<{ type: import("@scalar/typebox").TLiteral<"tag">; name: import("@scalar/typebox").TString; description: import("@scalar/typebox").TOptional; children: import("@scalar/typebox").TOptional>>; isGroup: import("@scalar/typebox").TBoolean; isTagGroup: import("@scalar/typebox").TOptional; isWebhooks: import("@scalar/typebox").TOptional; xKeys: import("@scalar/typebox").TOptional>; }>]>, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{ id: import("@scalar/typebox").TString; title: import("@scalar/typebox").TString; }>, import("@scalar/typebox").TObject<{ type: import("@scalar/typebox").TLiteral<"webhook">; ref: import("@scalar/typebox").TString; method: import("@scalar/typebox").TString; name: import("@scalar/typebox").TString; isDeprecated: import("@scalar/typebox").TOptional; }>]>, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{ id: import("@scalar/typebox").TString; title: import("@scalar/typebox").TString; }>, import("@scalar/typebox").TObject<{ type: import("@scalar/typebox").TLiteral<"example">; name: import("@scalar/typebox").TString; }>]>, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{ id: import("@scalar/typebox").TString; title: import("@scalar/typebox").TString; }>, import("@scalar/typebox").TObject<{ type: import("@scalar/typebox").TLiteral<"document">; name: import("@scalar/typebox").TString; children: import("@scalar/typebox").TOptional>>; icon: import("@scalar/typebox").TOptional; }>]>, import("@scalar/typebox").TIntersect<[import("@scalar/typebox").TObject<{ id: import("@scalar/typebox").TString; title: import("@scalar/typebox").TString; }>, import("@scalar/typebox").TObject<{ type: import("@scalar/typebox").TLiteral<"models">; name: import("@scalar/typebox").TString; children: import("@scalar/typebox").TOptional>>; }>]>]>; export type TraversedEntry = TraversedDescription | TraversedOperation | TraversedAsyncApiOperation | TraversedAsyncApiChannel | TraversedAsyncApiMessage | TraversedSchema | TraversedTag | TraversedWebhook | TraversedExample | TraversedDocument | TraversedModels; /** * Type helper for when we are storing the parent entry in the entry itself. * The parent is recursively defined to also include its own parent, except for * TraversedDocument which can be a terminal parent without requiring its own parent. */ export type WithParent = Entry & { parent: WithParent | TraversedDocument; }; export type DocumentIdProps = { name: string; info: InfoObject | AsyncApiInfoObject; type: 'document'; }; type DescriptionIdProps = { info: InfoObject | AsyncApiInfoObject; type: 'text'; slug?: string; depth?: number; value: string; parentId: string; }; export type ParentTag = { tag: TagObject; id: string; }; type TagProps = { parentId: string; tag: TagObject; type: 'tag'; /** * Set when this tag has no operations of its own and only nests other tags, * so the renderer can present it as a section rather than a leaf. */ isGroup?: boolean; /** * Set when `tag` is an `x-tagGroups` wrapper entry (not a real OpenAPI tag), * so its ID stays distinct from same-named OpenAPI tags and from other groups. * Native OpenAPI 3.2 nested tags are real tags and keep the regular `tag` prefix. */ isTagGroup?: boolean; }; type OperationProps = { parentId: string; operation: OperationObject; path: string; method: OperationMethod; type: 'operation'; parentTag?: ParentTag; }; type WebhookProps = { parentId: string; webhook?: OperationObject; name: string; method?: OperationMethod; type: 'webhook'; parentTag?: ParentTag; }; type ModelProps = { parentId: string; schema?: SchemaObject; name?: string; type: 'model'; parentTag?: ParentTag; }; type ExampleProps = { parentId: string; name: string; type: 'example'; }; type AsyncApiOperationProps = { parentId: string; operationName: string; type: 'asyncapi-operation'; parentTag?: ParentTag; }; type AsyncApiChannelProps = { parentId: string; channelName: string; type: 'asyncapi-channel'; parentTag?: ParentTag; }; type AsyncApiMessageProps = { parentId: string; messageName: string; channelName: string; type: 'asyncapi-message'; }; export type IdGeneratorProps = DocumentIdProps | DescriptionIdProps | TagProps | OperationProps | AsyncApiOperationProps | AsyncApiChannelProps | AsyncApiMessageProps | WebhookProps | ModelProps | ExampleProps; export type IdGenerator = (props: IdGeneratorProps) => string; export {}; //# sourceMappingURL=navigation.d.ts.map