render-playground-page.d.ts 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. export 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. }
  12. export declare type CursorShape = 'line' | 'block' | 'underline';
  13. export declare type Theme = 'dark' | 'light';
  14. export 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. }
  28. export 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. }
  51. export interface IntrospectionResult {
  52. __schema: any;
  53. }
  54. export interface RenderPageOptions extends MiddlewareOptions {
  55. version?: string;
  56. cdnUrl?: string;
  57. env?: any;
  58. title?: string;
  59. faviconUrl?: string | null;
  60. }
  61. export 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. }
  71. export declare function renderPlaygroundPage(options: RenderPageOptions): string;