Skip to content

type declarations for typescript #326

@benjamine

Description

@benjamine

hi 👋 , was wondering if there are, or you're interested in adding type declarations for typescript.
this could be created as a .d.ts file here, or added to the https://github.com/DefinitelyTyped/DefinitelyTyped repo.

an incipient example of how this would look

declare module '@observablehq/runtime' {
  export class Inspector {
    constructor(element: unknown);

    pending(...args: unknown[]): unknown;

    rejected(...args: unknown[]): unknown;

    fulfilled(...args: unknown[]): unknown;
  }
  export class Runtime {
    constructor();

    module(
      notebook: unknown,
      handler: (name: string) => Inspector | boolean,
    ): void;

    dispose(): void;
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions