-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
67 lines (67 loc) · 3.35 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
export declare class AssertionError extends Error {
constructor(message: string, stackStartFn: Function);
}
/**
* Assert that `value` is truthy and throw `AssertionError` if it is not.
* @param value value to test
* @param extraMessageOrFn string to append to the assertion error, or a 0-arg callable that returns such a string
*/
export declare function A(value: unknown, extraMessageOrFn?: string | (() => string)): void;
export declare namespace A {
/**
* Assert that `a` is the same value as `b` (using `Object.is`) and throw `AssertionError` if it is not.
* @param a first value
* @param b second value
* @param extraMessageOrFn string to append to the assertion error, or a 0-arg callable that returns such a string
*/
function is<T>(a: T, b: T, extraMessageOrFn?: string | (() => string)): void;
/**
* Assert that `a` is not the same value as `b` (using `Object.is`) and throw `AssertionError` if it is.
* @param a first value
* @param b second value
* @param extraMessageOrFn string to append to the assertion error, or a 0-arg callable that returns such a string
*/
function nis<T>(a: T, b: T, extraMessageOrFn?: string | (() => string)): void;
/**
* Assert that `a` is equal to `b` (`===`) and throw `AssertionError` if it is not.
* @param a first value
* @param b second value
* @param extraMessageOrFn string to append to the assertion error, or a 0-arg callable that returns such a string
*/
function eq<T>(a: T, b: T, extraMessageOrFn?: string | (() => string)): void;
/**
* Assert that `a` is not equal to `b` (`!==`) and throw `AssertionError` if it is.
* @param a first value
* @param b second value
* @param extraMessageOrFn string to append to the assertion error, or a 0-arg callable that returns such a string
*/
function neq<T>(a: T, b: T, extraMessageOrFn?: string | (() => string)): void;
/**
* Assert that `a` is less than `b` (`<`) and throw `AssertionError` if it is not.
* @param a first value
* @param b second value
* @param extraMessageOrFn string to append to the assertion error, or a 0-arg callable that returns such a string
*/
function lt<T>(a: T, b: T, extraMessageOrFn?: string | (() => string)): void;
/**
* Assert that `a` is less than or equal to `b` (`<=`) and throw `AssertionError` if it is not.
* @param a first value
* @param b second value
* @param extraMessageOrFn string to append to the assertion error, or a 0-arg callable that returns such a string
*/
function lte<T>(a: T, b: T, extraMessageOrFn?: string | (() => string)): void;
/**
* Assert that `a` is greater than `b` (`>`) and throw `AssertionError` if it is not.
* @param a first value
* @param b second value
* @param extraMessageOrFn string to append to the assertion error, or a 0-arg callable that returns such a string
*/
function gt<T>(a: T, b: T, extraMessageOrFn?: string | (() => string)): void;
/**
* Assert that `a` is greater than or equal to `b` (`>=`) and throw `AssertionError` if it is not.
* @param a first value
* @param b second value
* @param extraMessageOrFn string to append to the assertion error, or a 0-arg callable that returns such a string
*/
function gte<T>(a: T, b: T, extraMessageOrFn?: string | (() => string)): void;
}