1 | import { execute as graphqlExecute, GraphQLSchema, subscribe as graphqlSubscribe } from 'graphql';
|
2 | import { ServerOptions } from 'graphql-ws';
|
3 | import { ServerOptions as SubscriptionTransportWsServerOptions } from 'subscriptions-transport-ws';
|
4 | export type GraphQLWsSubscriptionsConfig = Partial<Pick<ServerOptions, 'connectionInitWaitTimeout' | 'onConnect' | 'onDisconnect' | 'onClose' | 'onSubscribe' | 'onNext'>> & {
|
5 | path?: string;
|
6 | };
|
7 | export type GraphQLSubscriptionTransportWsConfig = Partial<Pick<SubscriptionTransportWsServerOptions, 'onConnect' | 'onDisconnect' | 'onOperation' | 'keepAlive'>> & {
|
8 | path?: string;
|
9 | };
|
10 | export type SubscriptionConfig = {
|
11 | 'graphql-ws'?: GraphQLWsSubscriptionsConfig | boolean;
|
12 | 'subscriptions-transport-ws'?: GraphQLSubscriptionTransportWsConfig | boolean;
|
13 | };
|
14 | export interface GqlSubscriptionServiceOptions extends SubscriptionConfig {
|
15 | schema: GraphQLSchema;
|
16 | execute?: typeof graphqlExecute;
|
17 | subscribe?: typeof graphqlSubscribe;
|
18 | path?: string;
|
19 | context?: ServerOptions['context'];
|
20 | }
|
21 | export declare class GqlSubscriptionService {
|
22 | private readonly options;
|
23 | private readonly httpServer;
|
24 | private readonly wss;
|
25 | private readonly subTransWs;
|
26 | private wsGqlDisposable;
|
27 | private subServer;
|
28 | constructor(options: GqlSubscriptionServiceOptions, httpServer: any);
|
29 | private initialize;
|
30 | stop(): Promise<void>;
|
31 | }
|
32 | //# sourceMappingURL=gql-subscription.service.d.ts.map |
\ | No newline at end of file |