privatenumber / tasuku

✅ タスク — The minimal task visualizer for Node.js
MIT License
1.91k stars 30 forks source link

fix: export type TaskFunction & TaskInnerApi #2

Closed privatenumber closed 3 years ago

privatenumber commented 3 years ago

Closes https://github.com/privatenumber/tasuku/issues/1

This enables using types like:

import task from 'tasuku'

const doSomething: task.TaskFunction = (api) => {
    // ...
}

// alternatively:

function doSomething(api: task.TaskInnerApi) {
    // ...
}

Note, the types are exported as properties of the default export task, because this package is current CJS. I considered adding a ESM/CJS version with a discrepancy in exports, but TS currently doesn't support export maps.

privatenumber commented 3 years ago

:tada: This PR is included in version 1.0.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: