UNPKG

2.27 kBTypeScriptView Raw
1/**
2 * Asserts that the type of `expression` is identical to type `T`.
3 *
4 * @param expression - Expression that should be identical to type `T`.
5 */
6export declare const expectType: <T>(expression: T) => void;
7/**
8 * Asserts that the type of `expression` is not identical to type `T`.
9 *
10 * @param expression - Expression that should not be identical to type `T`.
11 */
12export declare const expectNotType: <T>(expression: any) => void;
13/**
14 * Asserts that the type of `expression` is assignable to type `T`.
15 *
16 * @param expression - Expression that should be assignable to type `T`.
17 */
18export declare const expectAssignable: <T>(expression: T) => void;
19/**
20 * Asserts that the type of `expression` is not assignable to type `T`.
21 *
22 * @param expression - Expression that should not be assignable to type `T`.
23 */
24export declare const expectNotAssignable: <T>(expression: any) => void;
25/**
26 * Asserts that `expression` throws an error. Will not ignore syntax errors.
27 *
28 * @param expression - Expression that should throw an error.
29 */
30export declare const expectError: <T = any>(expression: T) => void;
31/**
32 * Asserts that `expression` is marked as `@deprecated`.
33 *
34 * @param expression - Expression that should be marked as `@deprecated`.
35 */
36export declare const expectDeprecated: (expression: any) => void;
37/**
38 * Asserts that `expression` is not marked as `@deprecated`.
39 *
40 * @param expression - Expression that should not be marked as `@deprecated`.
41 */
42export declare const expectNotDeprecated: (expression: any) => void;
43/**
44 * Asserts that the type and return type of `expression` is `never`.
45 *
46 * Useful for checking that all branches are covered.
47 *
48 * @param expression - Expression that should be `never`.
49 */
50export declare const expectNever: (expression: never) => never;
51/**
52 * Prints the type of `expression` as a warning.
53 *
54 * @param expression - Expression whose type should be printed as a warning.
55 */
56export declare const printType: (expression: any) => void;
57/**
58 * Asserts that the documentation comment of `expression` includes string literal type `T`.
59 *
60 * @param expression - Expression whose documentation comment should include string literal type `T`.
61 */
62export declare const expectDocCommentIncludes: <T>(expression: any) => void;