UNPKG

1.96 kBTypeScriptView Raw
1export interface MiddlewareOptions {
2 endpoint?: string;
3 subscriptionEndpoint?: string;
4 workspaceName?: string;
5 env?: any;
6 config?: any;
7 settings?: Partial<ISettings>;
8 schema?: IntrospectionResult;
9 tabs?: Tab[];
10 codeTheme?: EditorColours;
11}
12export declare type CursorShape = 'line' | 'block' | 'underline';
13export declare type Theme = 'dark' | 'light';
14export interface ISettings {
15 'general.betaUpdates': boolean;
16 'editor.cursorShape': CursorShape;
17 'editor.theme': Theme;
18 'editor.reuseHeaders': boolean;
19 'tracing.hideTracingResponse': boolean;
20 'tracing.tracingSupported': boolean;
21 'editor.fontSize': number;
22 'editor.fontFamily': string;
23 'request.credentials': string;
24 'request.globalHeaders': {
25 [key: string]: string;
26 };
27 'schema.polling.enable': boolean;
28 'schema.polling.endpointFilter': string;
29 'schema.polling.interval': number;
30}
31export interface EditorColours {
32 property: string;
33 comment: string;
34 punctuation: string;
35 keyword: string;
36 def: string;
37 qualifier: string;
38 attribute: string;
39 number: string;
40 string: string;
41 builtin: string;
42 string2: string;
43 variable: string;
44 meta: string;
45 atom: string;
46 ws: string;
47 selection: string;
48 cursorColor: string;
49 editorBackground: string;
50 resultBackground: string;
51 leftDrawerBackground: string;
52 rightDrawerBackground: string;
53}
54export interface IntrospectionResult {
55 __schema: any;
56}
57export interface RenderPageOptions extends MiddlewareOptions {
58 version?: string;
59 cdnUrl?: string;
60 env?: any;
61 title?: string;
62 faviconUrl?: string | null;
63}
64export interface Tab {
65 endpoint: string;
66 query: string;
67 name?: string;
68 variables?: string;
69 responses?: string[];
70 headers?: {
71 [key: string]: string;
72 };
73}
74export declare function renderPlaygroundPage(options: RenderPageOptions): string;