Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / protobufjs / node_modules / @types / node / assert.d.ts
1 declare module 'assert' {
2     function assert(value: any, message?: string | Error): asserts value;
3     namespace assert {
4         class AssertionError implements Error {
5             name: string;
6             message: string;
7             actual: any;
8             expected: any;
9             operator: string;
10             generatedMessage: boolean;
11             code: 'ERR_ASSERTION';
12
13             constructor(options?: {
14                 message?: string;
15                 actual?: any;
16                 expected?: any;
17                 operator?: string;
18                 // tslint:disable-next-line:ban-types
19                 stackStartFn?: Function;
20             });
21         }
22
23         type AssertPredicate = RegExp | (new () => object) | ((thrown: any) => boolean) | object | Error;
24
25         function fail(message?: string | Error): never;
26         /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
27         function fail(
28             actual: any,
29             expected: any,
30             message?: string | Error,
31             operator?: string,
32             // tslint:disable-next-line:ban-types
33             stackStartFn?: Function,
34         ): never;
35         function ok(value: any, message?: string | Error): asserts value;
36         /** @deprecated since v9.9.0 - use strictEqual() instead. */
37         function equal(actual: any, expected: any, message?: string | Error): void;
38         /** @deprecated since v9.9.0 - use notStrictEqual() instead. */
39         function notEqual(actual: any, expected: any, message?: string | Error): void;
40         /** @deprecated since v9.9.0 - use deepStrictEqual() instead. */
41         function deepEqual(actual: any, expected: any, message?: string | Error): void;
42         /** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */
43         function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
44         function strictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
45         function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
46         function deepStrictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
47         function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
48
49         function throws(block: () => any, message?: string | Error): void;
50         function throws(block: () => any, error: AssertPredicate, message?: string | Error): void;
51         function doesNotThrow(block: () => any, message?: string | Error): void;
52         function doesNotThrow(block: () => any, error: AssertPredicate, message?: string | Error): void;
53
54         function ifError(value: any): asserts value is null | undefined;
55
56         function rejects(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
57         function rejects(
58             block: (() => Promise<any>) | Promise<any>,
59             error: AssertPredicate,
60             message?: string | Error,
61         ): Promise<void>;
62         function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
63         function doesNotReject(
64             block: (() => Promise<any>) | Promise<any>,
65             error: AssertPredicate,
66             message?: string | Error,
67         ): Promise<void>;
68
69         function match(value: string, regExp: RegExp, message?: string | Error): void;
70         function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
71
72         const strict: Omit<
73             typeof assert,
74             | 'equal'
75             | 'notEqual'
76             | 'deepEqual'
77             | 'notDeepEqual'
78             | 'ok'
79             | 'strictEqual'
80             | 'deepStrictEqual'
81             | 'ifError'
82             | 'strict'
83         > & {
84             (value: any, message?: string | Error): asserts value;
85             equal: typeof strictEqual;
86             notEqual: typeof notStrictEqual;
87             deepEqual: typeof deepStrictEqual;
88             notDeepEqual: typeof notDeepStrictEqual;
89
90             // Mapped types and assertion functions are incompatible?
91             // TS2775: Assertions require every name in the call target
92             // to be declared with an explicit type annotation.
93             ok: typeof ok;
94             strictEqual: typeof strictEqual;
95             deepStrictEqual: typeof deepStrictEqual;
96             ifError: typeof ifError;
97             strict: typeof strict;
98         };
99     }
100
101     export = assert;
102 }