forked from schl3ck/ios-scriptable-types
-
Notifications
You must be signed in to change notification settings - Fork 0
/
globals.js
71 lines (69 loc) · 1.76 KB
/
globals.js
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
68
69
70
71
/*
keys of the object should be the name of the global function/variable (only neede for aliases)
value is object like:
{
aliasFor: "someReferenceName"
}
when it is just an alias for "someReferenceName", where that can be e.g. "Alert.addAction" or "importModule"
or
{
description: "a JSDoc description (but without the * at the beginning of every line and without parameters and return type)",
definition: "the TypeScript definition, e.g. function atob(str: string): string",
parameters: [
{
name: "name of the parameter",
type: "type of the parameter",
description: "JSDoc description of the parameter"
},
...
],
returns: {
type: "type of the return value",
description: "JSDoc description of the return value"
}
}
for globals that are no aliases for already defined functions/properties/variables
yes, the types are defined multiple times to ease generation of the definition
"parameters" and "returns" are optional
*/
module.exports = {
log: {
aliasFor: "console.log"
},
logWarning: {
aliasFor: "console.warn"
},
logError: {
aliasFor: "console.error"
},
atob: {
description: "Decodes base64 into a binary string (\"ASCII to binary\")",
definition: "function atob(str: string): string",
parameters: [
{
name: "str",
type: "string",
description: "The string to decode"
}
],
returns: {
type: "string",
description: "The decoded binary string"
}
},
btoa: {
description: "Encodes a binary string as base64 (\"binary to ASCII\")",
definition: "function btoa(str: string): string",
parameters: [
{
name: "str",
type: "string",
description: "The string to encode"
}
],
returns: {
type: "string",
description: "The base64 encoded string"
}
}
};