1 | import { GraphQLScalarType } from "graphql";
|
2 | import { ValidatorOptions } from "class-validator";
|
3 | import { PubSubEngine, PubSubOptions } from "graphql-subscriptions";
|
4 | import { AuthChecker, AuthMode } from "../interfaces";
|
5 | import { Middleware } from "../interfaces/Middleware";
|
6 | import { ContainerType, ContainerGetter, IOCContainer } from "../utils/container";
|
7 | export declare type DateScalarMode = "isoDate" | "timestamp";
|
8 | export interface ScalarsTypeMap {
|
9 | type: Function;
|
10 | scalar: GraphQLScalarType;
|
11 | }
|
12 | export interface BuildContextOptions {
|
13 | dateScalarMode?: DateScalarMode;
|
14 | scalarsMap?: ScalarsTypeMap[];
|
15 | |
16 |
|
17 |
|
18 |
|
19 | validate?: boolean | ValidatorOptions;
|
20 | authChecker?: AuthChecker<any, any>;
|
21 | authMode?: AuthMode;
|
22 | pubSub?: PubSubEngine | PubSubOptions;
|
23 | globalMiddlewares?: Array<Middleware<any>>;
|
24 | container?: ContainerType | ContainerGetter<any>;
|
25 | |
26 |
|
27 |
|
28 | nullableByDefault?: boolean;
|
29 | }
|
30 | export declare abstract class BuildContext {
|
31 | static dateScalarMode: DateScalarMode;
|
32 | static scalarsMaps: ScalarsTypeMap[];
|
33 | static validate: boolean | ValidatorOptions;
|
34 | static authChecker?: AuthChecker<any, any>;
|
35 | static authMode: AuthMode;
|
36 | static pubSub: PubSubEngine;
|
37 | static globalMiddlewares: Array<Middleware<any>>;
|
38 | static container: IOCContainer;
|
39 | static nullableByDefault: boolean;
|
40 | |
41 |
|
42 |
|
43 | static create(options: BuildContextOptions): void;
|
44 | |
45 |
|
46 |
|
47 | static reset(): void;
|
48 | }
|