tsd
- Version 0.31.2
- Published
- 94.9 kB
- 7 dependencies
- MIT license
Install
npm i tsd
yarn add tsd
pnpm add tsd
Overview
Check TypeScript type definitions
Index
Functions
function _default
_default: (options?: Options) => Promise<Diagnostic[]>;
Type check the type definition of the project.
Returns
A promise which resolves the diagnostics of the type definition.
function expectAssignable
expectAssignable: <T>(expression: T) => void;
Asserts that the type of
expression
is assignable to typeT
.Parameter expression
Expression that should be assignable to type
T
.
function expectDeprecated
expectDeprecated: (expression: any) => void;
Asserts that
expression
is marked as@deprecated
.Parameter expression
Expression that should be marked as
@deprecated
.
function expectDocCommentIncludes
expectDocCommentIncludes: <T>(expression: any) => void;
Asserts that the documentation comment of
expression
includes string literal typeT
.Parameter expression
Expression whose documentation comment should include string literal type
T
.
function expectError
expectError: <T = any>(expression: T) => void;
Asserts that
expression
throws an error. Will not ignore syntax errors.Parameter expression
Expression that should throw an error.
function expectNever
expectNever: (expression: never) => never;
Asserts that the type and return type of
expression
isnever
.Useful for checking that all branches are covered.
Parameter expression
Expression that should be
never
.
function expectNotAssignable
expectNotAssignable: <T>(expression: any) => void;
Asserts that the type of
expression
is not assignable to typeT
.Parameter expression
Expression that should not be assignable to type
T
.
function expectNotDeprecated
expectNotDeprecated: (expression: any) => void;
Asserts that
expression
is not marked as@deprecated
.Parameter expression
Expression that should not be marked as
@deprecated
.
function expectNotType
expectNotType: <T>(expression: any) => void;
Asserts that the type of
expression
is not identical to typeT
.Parameter expression
Expression that should not be identical to type
T
.
function expectType
expectType: <T>(expression: T) => void;
Asserts that the type of
expression
is identical to typeT
.Parameter expression
Expression that should be identical to type
T
.
function formatter
formatter: (diagnostics: Diagnostic[], showDiff?: boolean) => string;
Format the TypeScript diagnostics to a human readable output.
Parameter diagnostics
List of TypeScript diagnostics.
Parameter showDiff
Display difference between expected and received types.
Returns
Beautiful diagnostics output
function printType
printType: (expression: any) => void;
Prints the type of
expression
as a warning.Parameter expression
Expression whose type should be printed as a warning.
Package Files (4)
Dependencies (7)
Dev Dependencies (16)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/tsd
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/tsd)
- HTML<a href="https://www.jsdocs.io/package/tsd"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 2088 ms. - Missing or incorrect documentation? Open an issue for this package.