@putout/types
v1.2.0
Published
šPutout TS Types
Maintainers
Readme
@putout/types 
Install
npm i @putout/typesTypeScript 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 --initAdd check-dts to devDependencies with nupdate check-dts -aD. Then you need:
lib/<name>.d.tsā export function signatures with typestest/errors.tsā call each export with invalid args, mark with// THROWS
redrun test:dtsExample
// 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
