check-dts

Unit tests for .d.ts TypeScript definitions

MIT 40 个版本
安装
npm install check-dts
yarn add check-dts
pnpm add check-dts
bun add check-dts
README

Check TypeScript Definitions

Unit tests for .d.ts TypeScript definitions in your JavaScript open source library.

It is useful for non-TypeScript project, which wants to provide typing support for TypeScript users and autocompletion for IDE and text editors.

It becomes especially useful for complex types with generics, like we have in Nano Stores.

// Negative test: test/index.errors.ts
import lib = require('../')

interface Events {
  set: (a: string, b: number) => void
}
// THROWS Expected 3 arguments, but got 2
lib.on<Events>('set', 2)
// Positive test: test/index.types.ts
import lib = require('../')

interface Events {
  set: (a: string, b: number) => void
}
lib.on<Events>('set', 'prop', 1)
Print Snapshots example

  Check .d.ts is built by Evil Martians, an American design and engineering consultancy for developer tools, AI, and cybersecurity startups.


版本列表
2.0.1 2026-07-30
2.0.0 2026-07-20
1.0.0 2026-03-26
0.9.0 2025-03-30
0.8.2 2024-08-20
0.8.1 2024-08-20
0.8.0 2024-05-21
0.7.2 2023-04-29
0.7.1 2023-03-13
0.7.0 2023-02-04
0.6.7 2022-04-24
0.6.6 2021-12-25
0.6.5 2021-12-06
0.6.4 2021-11-17
0.6.3 2021-10-29
0.6.2 2021-10-22
0.6.1 2021-10-13
0.6.0 2021-10-13
0.5.6 2021-09-21
0.5.5 2021-08-01
0.5.4 2021-07-16
0.5.3 2021-07-11
0.5.2 2021-07-09
0.5.1 2021-07-07
0.5.0 2021-06-26
0.4.4 2021-02-01
0.4.3 2021-02-01
0.4.2 2021-01-31
0.4.1 2020-11-21
0.4.0 2020-11-10
0.3.3 2020-08-21
0.3.2 2020-06-23
0.3.1 2020-06-18
0.3.0 2020-04-09
0.2.0 2020-04-07
0.1.4 2020-03-17
0.1.3 2020-03-14
0.1.2 2020-02-15
0.1.1 2020-02-12
0.1.0 2020-02-11