|
1 | 1 | /* eslint-disable @typescript-eslint/ban-types */ |
2 | 2 | import { ConnectionInitMessage, PingMessage, PongMessage } from 'graphql-ws' |
3 | 3 | import { DataMapper } from '@aws/dynamodb-data-mapper' |
4 | | -import { APIGatewayEventRequestContext, APIGatewayProxyEvent } from 'aws-lambda' |
| 4 | +import { APIGatewayEventRequestContext, APIGatewayProxyEvent, Handler } from 'aws-lambda' |
5 | 5 | import { GraphQLResolveInfo, GraphQLSchema } from 'graphql' |
6 | 6 | import { DynamoDB } from 'aws-sdk' |
7 | 7 | import { Subscription } from './model/Subscription' |
8 | 8 | import { Connection } from './model/Connection' |
9 | | -import { publish } from './pubsub/publish' |
10 | | -import { complete } from './pubsub/complete' |
11 | | -import { handleGatewayEvent } from './gateway' |
12 | | -import { handleStateMachineEvent } from './stepFunctionHandler' |
13 | 9 |
|
14 | 10 | export type ServerArgs = { |
15 | 11 | schema: GraphQLSchema |
@@ -51,10 +47,10 @@ export type ServerClosure = { |
51 | 47 | } & Omit<ServerArgs, 'tableNames'> |
52 | 48 |
|
53 | 49 | export interface ServerInstance { |
54 | | - gatewayHandler: ReturnType<typeof handleGatewayEvent> |
55 | | - stateMachineHandler:ReturnType<typeof handleStateMachineEvent> |
56 | | - publish:ReturnType<typeof publish> |
57 | | - complete: ReturnType<typeof complete> |
| 50 | + gatewayHandler: Handler<APIGatewayWebSocketEvent, WebsocketResponse> |
| 51 | + stateMachineHandler: (input: StateFunctionInput) => Promise<StateFunctionInput> |
| 52 | + publish: (event: PubSubEvent) => Promise<void> |
| 53 | + complete: (event: PubSubEvent) => Promise<void> |
58 | 54 | } |
59 | 55 |
|
60 | 56 | export type TableNames = { |
|
0 commit comments