-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
47 lines (45 loc) · 1.31 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
declare namespace checkTypes {
interface CheckTypesError {
propertyName: string
expectedType: string
receivedType: string
required: boolean
}
function getType(
element: string | number | boolean | symbol | Array<any> | object
): string
function $required(keys: string[]): string[]
function setVal(
passedObjectOrArray: object | Array<any>,
accessorString: string,
newValue: string | number | boolean | symbol | Array<any> | object,
depth: number
): string | number | boolean | symbol | Array<any> | object
function getVal(
passedObjectOrArray: object | Array<any>,
accessorString: string,
depth: number
): string | number | boolean | symbol | Array<any> | object
function typeToString(type: Function): string
function stringToType(
typeString:
| "String"
| "Array"
| "Object"
| "Number"
| "Boolean"
| "Symbol"
| "Null"
| "Undefined"
): Function
function propsFromString(accessorString: string): string[]
}
declare function checkTypes(
passedItem: string | number | boolean | symbol | any[] | object | null,
passedType: Function | Array<any> | object,
callback?: Function
): [
Array<checkTypes.CheckTypesError> | null,
string | number | boolean | symbol | Array<any> | object | any
]
export = checkTypes