UNPKG

1.56 kBTypeScriptView Raw
1/// <reference types="node" />
2import { APIGatewayProxyEvent, APIGatewayProxyEventV2, APIGatewayProxyResult, Context as LambdaContext } from 'aws-lambda';
3import { FileUploadOptions, ApolloServerBase, GraphQLOptions } from 'apollo-server-core';
4import { IncomingHttpHeaders } from 'http';
5import { Readable } from 'stream';
6export declare type APIGatewayProxyEventV1OrV2 = APIGatewayProxyEvent | APIGatewayProxyEventV2;
7export interface CreateHandlerOptions<EventT extends APIGatewayProxyEventV1OrV2 = APIGatewayProxyEventV1OrV2> {
8 cors?: {
9 origin?: boolean | string | string[];
10 methods?: string | string[];
11 allowedHeaders?: string | string[];
12 exposedHeaders?: string | string[];
13 credentials?: boolean;
14 maxAge?: number;
15 };
16 uploadsConfig?: FileUploadOptions;
17 onHealthCheck?: (req: EventT) => Promise<any>;
18}
19export declare class FileUploadRequest extends Readable {
20 headers: IncomingHttpHeaders;
21}
22export declare class ApolloServer<EventT extends APIGatewayProxyEventV1OrV2 = APIGatewayProxyEventV1OrV2> extends ApolloServerBase {
23 protected serverlessFramework(): boolean;
24 protected supportsUploads(): boolean;
25 createGraphQLServerOptions(event: EventT, context: LambdaContext): Promise<GraphQLOptions>;
26 createHandler({ cors, onHealthCheck }?: CreateHandlerOptions<EventT>): (event: EventT, context: LambdaContext, callback: import("aws-lambda").Callback<APIGatewayProxyResult> | undefined) => void | Promise<APIGatewayProxyResult>;
27}
28//# sourceMappingURL=ApolloServer.d.ts.map
\No newline at end of file