import type { OpenAPIV3 } from 'openapi-types'; import type { Method } from '../../../types/Method.js'; import type { ParseContextType } from '../../../context/parseTypes.js'; import { OasWebhook } from '../../../oas/webhook/Webhook.js'; import type { OasPathItem } from '../../../oas/pathItem/PathItem.js'; import type { StackTrail } from '../../../context/StackTrail.js'; /** * The 3.1 `webhooks` object: a map of webhook NAME → PathItem, identical * in shape to `paths` but keyed by name rather than URL path. Inline * PathItems only — a webhook PathItem `$ref` is a 3.1 edge case not yet * handled (see the arc note §5 Refs). */ export type WebhooksObject = Record; type WebhookInfo = { method: Method; name: string; pathItem: OasPathItem | undefined; }; export type ToWebhookV3Args = { operation: OpenAPIV3.OperationObject; webhookInfo: WebhookInfo; stackTrail: StackTrail; context: ParseContextType; }; /** * Parses a single webhook Operation Object into an {@link OasWebhook}. * * Mirrors `toOperationV3` and reuses the same leaf field parsers * (`toParameterListV3` / `toRequestBodyV3` / `toResponsesV3` / …) — the * inner Operation Object is structurally identical. Only the orchestration * is duplicated (the dialect-shaped glue), and the output is an * `OasWebhook` carrying a `name`, not an `OasOperation` carrying a `path`. */ export declare const toWebhookV3: ({ operation, webhookInfo, stackTrail, context }: ToWebhookV3Args) => OasWebhook; export type ToWebhooksV3Args = { webhooks: WebhooksObject | undefined; stackTrail: StackTrail; context: ParseContextType; }; /** * Flattens the 3.1 `webhooks` map into `OasWebhook[]`, mirroring * `toOperationsV3`'s `paths` → `OasOperation[]` flattening. Returns `[]` * when no `webhooks` object is present (the common 3.0 / no-webhook case). * The stack trail nests `webhooks` → `` → `` so * `OasDocument.removeItem` can locate a webhook by name. */ export declare const toWebhooksV3: ({ webhooks, stackTrail, context }: ToWebhooksV3Args) => OasWebhook[]; export {};