import type { Combine, ThunkAsync, Type } from 'ts-gems'; import { ResponsiveMap } from '../../helpers/index.js'; import { OpraSchema } from '../../schema/index.js'; import type { ApiDocument } from '../api-document.js'; import { DataTypeMap } from '../common/data-type-map.js'; import { DocumentElement } from '../common/document-element.js'; import type { EnumType } from '../data-type/enum-type.js'; import { HttpControllerDecoratorFactory } from '../decorators/http-controller.decorator.js'; import { nodeInspectCustom } from '../utils/inspect.util.js'; import type { HttpApi } from './http-api.js'; import type { HttpOperation } from './http-operation.js'; import { HttpParameter } from './http-parameter.js'; /** * @namespace HttpController */ export declare namespace HttpController { interface Metadata extends Pick { name: string; controllers?: (Type | ((parent: any) => any))[]; types?: ThunkAsync[]; operations?: Record; parameters?: HttpParameter.Metadata[]; /** Authoring-only; never exported. See `DocumentElement#docKey`. */ docKey?: string; } interface Options extends Partial> { name?: string; controllers?: (Type | ((parent: any) => any))[]; /** Authoring-only; never exported. See `DocumentElement#docKey`. */ docKey?: string; } interface InitArguments extends Combine<{ instance?: object; ctor?: Type; }, Pick> { } } /** * Type definition for HttpController * @class HttpController */ export interface HttpControllerStatic extends HttpControllerDecoratorFactory { /** * Class constructor of HttpController * @param owner * @param args */ new (owner: HttpApi | HttpController, args: HttpController.InitArguments): HttpController; prototype: HttpController; } /** * Type definition of HttpController prototype * @interface HttpController */ export interface HttpController extends HttpControllerClass { } /** * HttpController */ export declare const HttpController: HttpControllerStatic; /** * * @class HttpController */ declare class HttpControllerClass extends DocumentElement { protected _controllerReverseMap: WeakMap; protected get docKeySegment(): string[]; readonly kind: OpraSchema.HttpController.Kind; readonly name: string; description?: string; /** What this controller's operations belong to unless they say * otherwise — see `HttpOperation#sections`, which is where the * inheritance is actually resolved. */ sections?: string[]; path: string; instance?: any; ctor?: Type; parameters: HttpParameter[]; operations: ResponsiveMap; controllers: ResponsiveMap; types: DataTypeMap; /** * @property isRoot */ get isRoot(): boolean; findController(controller: Type): HttpController | undefined; findController(resourcePath: string): HttpController | undefined; findParameter(paramName: string, location?: OpraSchema.HttpParameterLocation): HttpParameter | undefined; getFullUrl(): string; /** * */ toString(): string; /** * */ toJSON(options?: ApiDocument.ExportOptions): OpraSchema.HttpController; /** * */ protected [nodeInspectCustom](): string; } export {};