@putout/types
🐊Putout TS Types
Last updated 5 months ago by coderaiser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @putout/types 
SYNC missed versions from official npm registry.

@putout/types NPM version

Install

npm i @putout/types

TypeScript Support

Every 🐊Putout operator ships TypeScript types written by TDD for types. Write a .d.ts and a test/errors.ts, validate with check-dts.

Quick start

Add test:dts script to .madrun.js then to update package.json run:

madrun --init

Add check-dts to devDependencies with nupdate check-dts -aD. Then you need:

  • lib/<name>.d.ts — export function signatures with types
  • test/errors.ts — call each export with invalid args, mark with // THROWS
redrun test:dts

Example

// test/errors.ts
import {addArgs} from '../lib/add-args.js';

// THROWS Argument of type 'number' is not assignable to parameter of type 'AddArgsOptions'
addArgs(5);

Every // THROWS is a test. check-dts compiles the file and checks the error matches.

License

MIT

Current Tags

  • 1.3.0                                ...           latest (a month ago)

7 Versions

  • 1.3.0                                ...           a month ago
  • 1.2.2                                ...           2 months ago
  • 1.2.1                                ...           2 months ago
  • 1.2.0                                ...           5 months ago
  • 1.1.0                                ...           5 months ago
  • 1.0.1                                ...           5 months ago
  • 1.0.0                                ...           5 months ago
Maintainers (1)
Downloads
Total 17
Today 0
This Week 0
This Month 10
Last Day 0
Last Week 5
Last Month 7
Dependencies (1)
Dev Dependencies (7)

© 2010 - cnpmjs.org x YWFE | Home | YWFE