UNPKG

3.79 kBTypeScriptView Raw
1import type { ParameterizedString, PolymorphicEvent, Primitive } from '@sentry/types';
2/**
3 * Checks whether given value's type is one of a few Error or Error-like
4 * {@link isError}.
5 *
6 * @param wat A value to be checked.
7 * @returns A boolean representing the result.
8 */
9export declare function isError(wat: unknown): wat is Error;
10/**
11 * Checks whether given value's type is ErrorEvent
12 * {@link isErrorEvent}.
13 *
14 * @param wat A value to be checked.
15 * @returns A boolean representing the result.
16 */
17export declare function isErrorEvent(wat: unknown): boolean;
18/**
19 * Checks whether given value's type is DOMError
20 * {@link isDOMError}.
21 *
22 * @param wat A value to be checked.
23 * @returns A boolean representing the result.
24 */
25export declare function isDOMError(wat: unknown): boolean;
26/**
27 * Checks whether given value's type is DOMException
28 * {@link isDOMException}.
29 *
30 * @param wat A value to be checked.
31 * @returns A boolean representing the result.
32 */
33export declare function isDOMException(wat: unknown): boolean;
34/**
35 * Checks whether given value's type is a string
36 * {@link isString}.
37 *
38 * @param wat A value to be checked.
39 * @returns A boolean representing the result.
40 */
41export declare function isString(wat: unknown): wat is string;
42/**
43 * Checks whether given string is parameterized
44 * {@link isParameterizedString}.
45 *
46 * @param wat A value to be checked.
47 * @returns A boolean representing the result.
48 */
49export declare function isParameterizedString(wat: unknown): wat is ParameterizedString;
50/**
51 * Checks whether given value is a primitive (undefined, null, number, boolean, string, bigint, symbol)
52 * {@link isPrimitive}.
53 *
54 * @param wat A value to be checked.
55 * @returns A boolean representing the result.
56 */
57export declare function isPrimitive(wat: unknown): wat is Primitive;
58/**
59 * Checks whether given value's type is an object literal, or a class instance.
60 * {@link isPlainObject}.
61 *
62 * @param wat A value to be checked.
63 * @returns A boolean representing the result.
64 */
65export declare function isPlainObject(wat: unknown): wat is Record<string, unknown>;
66/**
67 * Checks whether given value's type is an Event instance
68 * {@link isEvent}.
69 *
70 * @param wat A value to be checked.
71 * @returns A boolean representing the result.
72 */
73export declare function isEvent(wat: unknown): wat is PolymorphicEvent;
74/**
75 * Checks whether given value's type is an Element instance
76 * {@link isElement}.
77 *
78 * @param wat A value to be checked.
79 * @returns A boolean representing the result.
80 */
81export declare function isElement(wat: unknown): boolean;
82/**
83 * Checks whether given value's type is an regexp
84 * {@link isRegExp}.
85 *
86 * @param wat A value to be checked.
87 * @returns A boolean representing the result.
88 */
89export declare function isRegExp(wat: unknown): wat is RegExp;
90/**
91 * Checks whether given value has a then function.
92 * @param wat A value to be checked.
93 */
94export declare function isThenable(wat: any): wat is PromiseLike<any>;
95/**
96 * Checks whether given value's type is a SyntheticEvent
97 * {@link isSyntheticEvent}.
98 *
99 * @param wat A value to be checked.
100 * @returns A boolean representing the result.
101 */
102export declare function isSyntheticEvent(wat: unknown): boolean;
103/**
104 * Checks whether given value's type is an instance of provided constructor.
105 * {@link isInstanceOf}.
106 *
107 * @param wat A value to be checked.
108 * @param base A constructor to be used in a check.
109 * @returns A boolean representing the result.
110 */
111export declare function isInstanceOf(wat: any, base: any): boolean;
112/**
113 * Checks whether given value's type is a Vue ViewModel.
114 *
115 * @param wat A value to be checked.
116 * @returns A boolean representing the result.
117 */
118export declare function isVueViewModel(wat: unknown): boolean;
119//# sourceMappingURL=is.d.ts.map
\No newline at end of file