import { ICancellablePromise, TAbortStrategy } from '@lifaon/observables'; import { IHTTPRoute } from './interfaces'; import { IRouteExecCallbackOptions, IRouteOptions, IRouteResolveCallbackOptions } from '../../core/route/types'; import { IRoute } from '../../core/route/interfaces'; import { IResolvableTreeResolveCallbackNormalizedOptions } from '../../core/resolvable-tree/functions'; /** TYPES */ export type HTTPMethod = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'OPTIONS'; /* RESOLVE */ export interface IHTTPRouteResolveCallbackOptions extends IRouteResolveCallbackOptions { method: HTTPMethod; } export interface IHTTPRouteResolveIncomingCallbackOptions extends Pick, 'path' | 'method'>, IResolvableTreeResolveCallbackNormalizedOptions { } export type IHTTPRouteResolveCallbackNormalizedOptions = IHTTPRouteResolveIncomingCallbackOptions; export type THTTPRouteResolveCallback = (this: IHTTPRoute, options: IHTTPRouteResolveCallbackNormalizedOptions) => ICancellablePromise; /* EXEC */ export interface IHTTPRouteExecCallbackOptions extends IRouteExecCallbackOptions { } export type THTTPRouteExecCallback = (this: IRoute, options: IHTTPRouteExecCallbackOptions) => ICancellablePromise; /* OPTIONS */ export interface IHTTPRouteOptions extends Omit { children?: Iterable; resolve?: THTTPRouteResolveCallback; exec?: THTTPRouteExecCallback; methods?: Iterable; }