figma / plugin-typings

Typings for the Figma Plugin API
MIT License
195 stars 45 forks source link

No typings for fetch() signal parameter #207

Closed alexincore closed 1 year ago

alexincore commented 1 year ago

Interface FetchOptions is missing a signal parameter of type AbortSignal, which is used to provide a timeout for the fetch request https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/timeout

  interface FetchOptions {
    method?: string
    headers?: { [name: string]: string }
    /**
     * @deprecated use headers instead
     */
    headersObject?: { [name: string]: string }
    body?: Uint8Array | string
    credentials?: string
    cache?: string
    redirect?: string
    referrer?: string
    integrity?: string
  }
darknoon commented 1 year ago

Is AbortSignal / cancellation implemented in Figma?

james04321 commented 1 year ago

AbortSignal is not supported in the plugin sandbox, so the typings are correct here.