observablehq / observablehq/runtime
type declarations for typescript
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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