UNPKG

1.9 kBTypeScriptView Raw
1export interface MiddlewareOptions {
2 endpoint?: string;
3 subscriptionEndpoint?: string;
4 workspaceName?: string;
5 env?: any;
6 config?: any;
7 settings?: 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 'queryPlan.hideQueryPlanResponse'?: boolean;
21 'editor.fontSize'?: number;
22 'editor.fontFamily'?: string;
23 'request.credentials'?: string;
24 'schema.polling.enable'?: boolean;
25 'schema.polling.endpointFilter'?: string;
26 'schema.polling.interval'?: number;
27}
28export interface EditorColours {
29 property: string;
30 comment: string;
31 punctuation: string;
32 keyword: string;
33 def: string;
34 qualifier: string;
35 attribute: string;
36 number: string;
37 string: string;
38 builtin: string;
39 string2: string;
40 variable: string;
41 meta: string;
42 atom: string;
43 ws: string;
44 selection: string;
45 cursorColor: string;
46 editorBackground: string;
47 resultBackground: string;
48 leftDrawerBackground: string;
49 rightDrawerBackground: string;
50}
51export interface IntrospectionResult {
52 __schema: any;
53}
54export interface RenderPageOptions extends MiddlewareOptions {
55 version?: string;
56 cdnUrl?: string;
57 env?: any;
58 title?: string;
59 faviconUrl?: string | null;
60}
61export interface Tab {
62 endpoint: string;
63 query: string;
64 name?: string;
65 variables?: string;
66 responses?: string[];
67 headers?: {
68 [key: string]: string;
69 };
70}
71export declare function renderPlaygroundPage(options: RenderPageOptions): string;