import type { StrictOmit, Type } from 'ts-gems'; import { ResponsiveMap } from '../../helpers/index.js'; import { OpraSchema } from '../../schema/index.js'; import type { ApiDocument } from '../api-document.js'; import { ApiBase } from '../common/api-base.js'; import { HttpController } from './http-controller.js'; import type { HttpOperation } from './http-operation.js'; export declare namespace HttpApi { /** A server/section as *declared*: the schema shape plus an optional, * never-exported `docKey`. Servers especially need one — their `url` is * often environment-dependent, so it makes a poor documentation key. */ interface ServerInit extends OpraSchema.HttpServer { docKey?: string; } interface SectionInit extends OpraSchema.HttpSection { docKey?: string; } interface InitArguments extends ApiBase.InitArguments, StrictOmit { transport: 'http'; servers?: ServerInit[]; sections?: SectionInit[]; } } /** * @class HttpApi */ export declare class HttpApi extends ApiBase { protected _controllerReverseMap: WeakMap; readonly owner: ApiDocument; readonly transport = "http"; controllers: ResponsiveMap; url?: string; servers?: HttpApi.ServerInit[]; sections?: HttpApi.SectionInit[]; constructor(init: HttpApi.InitArguments); findController(controller: Type): HttpController | undefined; findController(resourcePath: string): HttpController | undefined; findOperation(controller: Type, operationName: string): HttpOperation | undefined; findOperation(resourcePath: string, operationName: string): HttpOperation | undefined; protected get docKeySegment(): string; toJSON(options?: ApiDocument.ExportOptions): OpraSchema.HttpApi; /** `servers`/`sections` are plain objects rather than document elements, * so they get their texts through this api's own key plus one container * level. `docKey` is stripped here — it is an authoring aid, not part of * the published schema. */ protected exportPlainList(items: T[] | undefined, container: string, keyOf: (item: T) => string | undefined, options?: ApiDocument.ExportOptions): T[] | undefined; }