import { WebSocketApi, WebSocketStage, WebSocketApiProps } from '@aws-cdk/aws-apigatewayv2-alpha';
import { RemovalPolicy } from 'aws-cdk-lib';
import { Function } from 'aws-cdk-lib/aws-lambda';
import { Construct } from 'constructs';
import { DnaConstruct } from '../core/dna-construct';
export declare enum SocketApiIntegrationType {
    LAMBDA = "LAMBDA"
}
export interface ISocketFunction {
    readonly route: string;
    readonly type?: SocketApiIntegrationType;
    readonly integration: Function;
    readonly returnResponse?: boolean;
}
export interface ISocketApiConfig {
    readonly stage?: string;
    readonly removalPolicy?: RemovalPolicy;
    readonly routes?: ISocketFunction[];
    readonly websocketConfig?: WebSocketApiProps;
}
/**
 * This construct creates an AWS WebSocket API with routes that are handled by AWS Lambda functions.  A WebSocket can only exist when there are one or more valid integrations defined.  If you do not define any integrations the WebSocket API will not be deployed.
 *
 * ## Getting Started
 *
 * The SocketAPI accepts an array of route definitions of type **ISocketFunction**.
 * **Important Note** If you provide no routes to this construct, the construct will not deploy an API gateway.  An endpoint is required for the Websocket API to deploy.
 *
 * ```typescript
 *  import { SocketApi }
 *
 * ```typescript
 *  export interface ISocketFunction {
 *    readonly route: string;
 *    readonly type?: SocketApiIntegrationType;
 *    readonly integration: Function;
 *    readonly returnResponse?: boolean;
 *  }
 * ```
 *
 * To create a WebSocket API you will need to provide a Lambda handler construct to execute your WebSocket API action.  The following example shows how to setup a WebSocket API with a **test** action route which is handled by the **test-func** lambda handler.
 *
 * ```typescript
 *  import { SocketApi } from '@serverless-dna/constructs';
 *  import { Duration, Stack, StackProps } from 'aws-cdk-lib';
 *  import { Runtime } from 'aws-cdk-lib/aws-lambda';
 *  import { NodejsFunction } from 'aws-cdk-lib/aws-lambda-nodejs';
 *  import { Construct } from 'constructs';
 *  import { IntegrationHandlers } from './integrations';
 *
 *  export class ApplicationStack extends Stack {
 *    constructor(scope: Construct, id: string, props?: StackProps) {
 *    super(scope, id, props);
 *
 *    const handler = new NodejsFunction(this, `test-func`, {
 *      entry: `${__dirname}/integrations.ts`,
 *      handler: IntegrationHandlers.noOp,
 *      runtime: Runtime.NODEJS_18_X,
 *      timeout: Duration.seconds(3),
 *    });
 *
 *    new SocketApi(this, 'socket-api', {
 *      routes: [{ route: 'test', integration: handler, returnResponse: true }],
 *      });
 *    }
 *  }
 * ```
 */
export declare class SocketApi extends DnaConstruct {
    /**
     * Stage name for the API gateway
     */
    protected stage: string;
    /**
     * Internal prefix used to name resources according to provided stage and id
     */
    protected namePrefix: string;
    /**
     * Name of the WebSocket API
     */
    protected name: string;
    /**
     * The Web Socket API Construct for reference
     */
    protected socket: WebSocketApi;
    /**
     * WebSocketStage Construct for reference
     */
    protected socketStage: WebSocketStage;
    constructor(scope: Construct, id: string, config?: ISocketApiConfig);
    /**
     * returns the Fully Qualified ARN for the web socket API for use in policy statements.
     * @returns string - the ARN
     */
    arnForExecuteApi(): string;
    /**
     * Create the Web Socket API
     *
     * @param config the `ISocketApiConfig` configuration options
     * @returns WebSocketAPi
     */
    protected createWebSocketApi(config: ISocketApiConfig): WebSocketApi;
    /**
     * Creates the WebSocketStage
     *
     * @param api the API to create the Stage for
     * @returns
     */
    protected createWebSocketStage(api: WebSocketApi): WebSocketStage;
    /**
     * Adds an array of routes to the WebSocket
     *
     * @param routes Array of function routes for the Web Socket API
     */
    protected addRoutes(routes: ISocketFunction[]): void;
    /**
     *
     * @param route
     * @param integrationFunction - optional, will default to locally named default integration function for routes: $connect, $default and $disconnect
     * @param returnResponse - optional, must be true if a response payload is to be returned by the route.  Defaults to false.
     */
    addFunctionRoute(route: string, integrationFunction: Function, returnResponse?: boolean): void;
}
