Skip to content

fetch typings: support global agumentation #18118

@mfulton26

Description

@mfulton26

Some types are currently defined using class but, from what I can tell, TypeScript classes cannot be globally augmented (see How can I augment a globally declared class?).

e.g.

declare class Response implements Body {

I'd like to see Headers, Request, Response and any other applicable types follow the same pattern as many built-in type definitions:

  • interface {{Type}} { … }
  • interface {{Type}}Constructor { … }
  • var {{Type}}: {{Type}}Constructor;

e.g.

  • interface Map { … }
  • interface MapConstructor { … }
  • var Map: MapConstructor;

This will allow declaration merging for adding missing types or even defining custom ones.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions