ivanseidel / ivanseidel/node-draftlog

Typescript compatibility

Open
#7 7 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.2k
Forks
33
PR merge metrics
No merged PRs in 30d

Description

Because this module extends functionality of Console, the following is required to avoid typescript complaining about missing "draft" function:

```ts
interface Console {
draft: (a) => (b) => {}
}
```

I think to support this from the module level, we can use the [global declaration](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#global-augmentation) feature

```ts
declare global {
interface Console {
draft: (a) => (b) => {}
}
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the module-level Console extension described in the issue and inspect how the package exposes its JavaScript entry point and declarations. Verify that TypeScript consumers can use Console.draft without a local interface augmentation, and confirm the package's existing checks or build output if available.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, typescript
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 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.