observablehq / observablehq/runtime

type declarations for typescript

Open
#326 2 comments 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
1.1k
Forks
87
Avg merge
2m
Merged PRs (30d)
1

Description

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;
  }
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the runtime's public API alongside the TypeScript example in the issue. Decide whether declarations belong in a .d.ts file here or in DefinitelyTyped, then ensure the exported API is represented and usable by TypeScript consumers.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
developer-experience
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.