Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript support #14

Closed
alem0lars opened this issue Jan 12, 2018 · 2 comments
Closed

TypeScript support #14

alem0lars opened this issue Jan 12, 2018 · 2 comments

Comments

@alem0lars
Copy link

alem0lars commented Jan 12, 2018

The following are the types to include typescript support in your project:

export type UnhookFunctionType = () => void;
export type HookOpts = { silent: boolean; once: boolean };
export type HookCallback = (str: string, enc: string) => string | boolean;

export function stdout(
  opts: HookOpts | HookCallback,
  cb?: HookCallback
): UnhookFunctionType;

export function stderr(
  opts: HookOpts | HookCallback,
  cb?: HookCallback
): UnhookFunctionType;

They should be added to index.d.ts in order to provide types out-of-the-box.

@SamVerschueren
Copy link

Sorry, it's better to publish them to DefinitelyTyped sindresorhus/ama#439. We don't care in maintaining typedef ourselves.

@sindresorhus
Copy link
Owner

I now accept TypeScript definitions if anyone looking is interested in submitting it here.

See: sindresorhus/ama#439 (comment)

Please follow this guide: https://github.com/sindresorhus/typescript-definition-style-guide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants