ExtensionMessage.ts 448 B

123456789
  1. // type that represents json data that is sent from extension to webview, called ExtensionMessage and has 'type' enum which can be 'plusButtonTapped' or 'settingsButtonTapped' or 'hello'
  2. // webview will hold state
  3. export interface ExtensionMessage {
  4. type: "text" | "action" | "state"
  5. text?: string
  6. action?: "plusButtonTapped" | "settingsButtonTapped"
  7. state?: { didOpenOnce: boolean, apiKey?: string, maxRequestsPerTask?: number }
  8. }