import { IResource, IRestApi, MethodOptions, RestApi } from 'aws-cdk-lib/aws-apigateway'; import { IFunction } from 'aws-cdk-lib/aws-lambda'; import { RestApiProps } from 'aws-cdk-lib/aws-apigateway'; import { Stack } from 'aws-cdk-lib'; import { ComposerFn } from './utils/compose'; export type RestApiDomain = Readonly<{ domain: string; basePath: string; }>; export type RestApiInput = Readonly<{ apiName: string; }>; export type RestApiConfiguration = Partial & Readonly<{ domain?: RestApiDomain; usagePlanId?: string; }>; /** Returns a default REST API configuration with CORS allowing all origins and GET requests. */ export declare const withDefaultApiConfiguration: () => RestApiConfiguration; /** * Creates a REST API Gateway with optional custom domain mapping and usage plan attachment. */ export declare const withRestApi: (deps: { defaultConfiguration: RestApiConfiguration; stack: Stack; }) => (input: RestApiInput, configuration?: Partial) => RestApi; export type HttpVerb = 'GET' | 'DELETE' | 'POST' | 'PUT'; /** Enum-like constant for HTTP verb values. */ export declare const HttpVerb: { readonly GET: HttpVerb; readonly DELETE: HttpVerb; readonly POST: HttpVerb; readonly PUT: HttpVerb; }; export type RestConfiguration = Readonly<{ verb: HttpVerb; fn: IFunction; props?: Partial; }>; /** * Adds a Lambda-backed resource and method to a composed REST API. * Nested paths (e.g. `/users/{id}/orders`) are created incrementally and cached to avoid duplicates. */ export declare const withResource: (path: string, configuration: RestConfiguration) => (api: ComposedRestApi) => ComposedRestApi; /** A REST API paired with a resource cache, threaded through composition. */ export type ComposedRestApi = Readonly<{ api: IRestApi; resources: { [key: string]: IResource; }; }>; /** Composes a REST API by piping it through a sequence of `withResource` calls. */ export declare const composeRestApi: (api: IRestApi, ...args: Array>) => ComposedRestApi; //# sourceMappingURL=rest-api.d.ts.map