-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsquircy.js
187 lines (164 loc) · 3.97 KB
/
squircy.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
/**
* This file contains stubs for the squIRCy2 JavaScript runtime.
*
* Copy this file into your configured squIRCy2 scripts directory to enable
* IDE auto-completion for squIRCy2.
*/
/**
* Provides interaction with the IRC module.
*/
var Irc = {
/**
* Joins the given channel.
* @param {string} channel
*/
Join: function(channel) {},
/**
* Parts the given channel.
* @param {string} channel
*/
Part: function(channel) {},
/**
* Messages target with message. Target can be a user or a channel.
* @param {string} target
* @param {string} message
*/
Privmsg: function(target, message) {},
/**
* Get the bot's current nickname.
* @returns {string}
*/
CurrentNick: function() {},
/**
* Change the bot's nickname.
* @param {string} newNick
*/
Nick: function(newNick) {},
/**
* Send a raw command.
* @param {string} raw
*/
Raw: function(raw) {}
};
/**
* Functionality for sending web requests.
*/
var Http = {
/**
* Fetch the given url using a GET HTTP request.
* @param {string} url
* @param {...string} headers
*/
Get: function(url, headers) {},
/**
* Fetch the given url using a POST HTTP request.
* @param {string} url
* @param {string} body
* @param {...string} headers
*/
Post: function(url, body, headers) {},
/**
* Send an HTTP request with the configured options.
* @param {object} options
*/
Send: function(options) {}
};
/**
* Math related functions.
*
* Note that these are aliases to their related built-in method.
*/
var Math = {
/**
* Generates a random number between 0 and 1.
* @returns {number}
*/
Rand: Math.random,
/**
* Rounds the given value to 0 decimal places.
* @param {number}
*/
Round: Math.round,
/**
* Rounds the given value up to 0 decimal places.
* @param {number}
*/
Ceil: Math.ceil,
/**
* Rounds the given value down to 0 decimal places.
* @param {number}
*/
Floor: Math.floor
};
/**
* Application Configuration related.
*/
var Config = {
/**
* Returns the configured Owner Nickname.
* @returns {string}
*/
OwnerNick: function() {},
/**
* Returns the configured Owner Hostname.
* @returns {string}
*/
OwnerHost: function() {}
};
/**
* File related functions.
*
* The File API must be enabled for these to function.
*/
var File = {
/**
* Reads the content of filename.
*
* @param {string} filename The filename, relative to the configured File API root path.
* @returns {string} The contents of the file.
*/
ReadAll: function(filename) {}
};
/**
* Add a handler of the given event type and function name.
* @param {string} eventName
* @param {Function|string} fnName
* @return {string} A reference that may be used later in calls to unbind.
*/
function bind(eventName, fnName) {}
/**
* Removes a handler of the given type and function name.
* @param {string} eventName
* @param {Function|string} fnName
*/
function unbind(eventName, fnName) {}
/**
* Opens a collection object for the given coll name.
* @param {string} coll The name of the collection to open.
* @returns {{FetchAll: FetchAll, Fetch: Fetch, Save: Save, Delete: Delete}}
*/
function use(coll) {
return {
/**
* Fetches all records in the collection.
* @returns {Array}
*/
FetchAll: function() {},
/**
* Fetches a single record in the collection.
* @param {number} id
* @returns {Object}
*/
Fetch: function(id) {},
/**
* Save a record in the collection.
* @param {Object} entity
*/
Save: function(entity) {},
/**
* Delete a given record in the collection.
* @param {number} id
*/
Delete: function(id) {}
}
}