|
1
|
|
|
/// <reference path="../../../../../libs/js/Object.d.ts" /> |
|
2
|
|
|
/// <reference path="../../../../../libs/js/alert.d.ts" /> |
|
3
|
|
|
/// <reference path="../../../../../libs/js/globals.d.ts" /> |
|
4
|
|
|
/// <reference types="node" /> |
|
5
|
|
|
/// <reference types="react" /> |
|
6
|
|
|
/// <reference types="jquery" /> |
|
7
|
|
|
/// <reference types="requirejs" /> |
|
8
|
|
|
/// <reference types="datatables.net" /> |
|
9
|
|
|
declare function arrayCompare(a1: Array<any>, a2: Array<any>): boolean; |
|
10
|
|
|
/** |
|
11
|
|
|
* in_array PHP equivalent |
|
12
|
|
|
* @param needle string etc |
|
13
|
|
|
* @param haystack |
|
14
|
|
|
*/ |
|
15
|
|
|
declare function inArray(needle: any, haystack: Array<any>): boolean; |
|
16
|
|
|
/** |
|
17
|
|
|
* in_array PHP equivalent |
|
18
|
|
|
* @param needle string etc |
|
19
|
|
|
* @param haystack |
|
20
|
|
|
*/ |
|
21
|
|
|
declare function in_array(needle: any, haystack: Array<any>): boolean; |
|
22
|
|
|
/** |
|
23
|
|
|
* get all keys |
|
24
|
|
|
* @param haystack string etc |
|
25
|
|
|
*/ |
|
26
|
|
|
declare function array_keys(haystack: any): string[]; |
|
27
|
|
|
/** |
|
28
|
|
|
* Shuffles array in place. |
|
29
|
|
|
* @param a items An array containing the items. |
|
30
|
|
|
*/ |
|
31
|
|
|
declare function array_shuffle(a: Array<any>): any[]; |
|
32
|
|
|
declare function array_filter(array: []): never[]; |
|
33
|
|
|
/** |
|
34
|
|
|
* pick random from array |
|
35
|
|
|
* @param {Array<any>} arrays |
|
36
|
|
|
* @param {boolean} unique Unique the arrays |
|
37
|
|
|
*/ |
|
38
|
|
|
declare function array_rand(arrays: any[], unique: any): { |
|
39
|
|
|
index: number; |
|
40
|
|
|
value: any; |
|
41
|
|
|
}; |
|
42
|
|
|
/** |
|
43
|
|
|
* Array unique |
|
44
|
|
|
* @param {Array<any>} arrays |
|
45
|
|
|
*/ |
|
46
|
|
|
declare function array_unique(arrays: any[]): any[]; |
|
47
|
|
|
/** |
|
48
|
|
|
* |
|
49
|
|
|
* @param {Array<any>} arrayName |
|
50
|
|
|
* @param {String|number} key |
|
51
|
|
|
*/ |
|
52
|
|
|
declare function array_unset(arrayName: { |
|
53
|
|
|
[x: string]: any; |
|
54
|
|
|
}, key: any): any[]; |
|
55
|
|
|
/** |
|
56
|
|
|
* CodeMirror loader |
|
57
|
|
|
* @param id |
|
58
|
|
|
* @param mode |
|
59
|
|
|
* @param theme |
|
60
|
|
|
*/ |
|
61
|
|
|
declare function loadCodemirror(element: HTMLTextAreaElement, mode: string | string[], theme: string): any; |
|
62
|
|
|
/** |
|
63
|
|
|
* Cookie Helper |
|
64
|
|
|
* @author Dimas Lanjaka <[email protected]> |
|
65
|
|
|
* @see http://localhost/src/Cookies/helper.php |
|
66
|
|
|
*/ |
|
67
|
|
|
declare class Cookies { |
|
68
|
|
|
/** |
|
69
|
|
|
* Get cookie value by cookie name |
|
70
|
|
|
* @param c_name |
|
71
|
|
|
* @returns null if cookie not exists |
|
72
|
|
|
*/ |
|
73
|
|
|
static get(c_name: string): string | Object | null; |
|
74
|
|
|
/** |
|
75
|
|
|
* Create cookie expiring in days |
|
76
|
|
|
* @param name cookie name |
|
77
|
|
|
* @param value cookie value |
|
78
|
|
|
* @param days days to expire |
|
79
|
|
|
* @param expire_type d = days, m = minutes, s = seconds, default seconds |
|
80
|
|
|
*/ |
|
81
|
|
|
static set(name: string, value: any, expire: number, expire_type: string, path: string | any, callback: any | Function): any; |
|
82
|
|
|
/** |
|
83
|
|
|
* Call function if cookie name not set |
|
84
|
|
|
* @param name |
|
85
|
|
|
* @param value |
|
86
|
|
|
* @param expire Expires number (minutes) |
|
87
|
|
|
* @param callback Function callback to be executed one time |
|
88
|
|
|
*/ |
|
89
|
|
|
static one(name: string, value: any, expire: number, callback: Function): void; |
|
90
|
|
|
/** |
|
91
|
|
|
* decompress cookie |
|
92
|
|
|
* @param str |
|
93
|
|
|
*/ |
|
94
|
|
|
static decompress(str: string): void; |
|
95
|
|
|
/** |
|
96
|
|
|
* compress cookie |
|
97
|
|
|
* @param str |
|
98
|
|
|
*/ |
|
99
|
|
|
static compress(str: string): void; |
|
100
|
|
|
} |
|
101
|
|
|
/** |
|
102
|
|
|
* Get key |
|
103
|
|
|
* @param {string} passphrase |
|
104
|
|
|
* @param {string} salt |
|
105
|
|
|
*/ |
|
106
|
|
|
declare function getKey(passphrase: string, salt: string): CryptoJS.WordArray; |
|
107
|
|
|
/** |
|
108
|
|
|
* Encrypt function |
|
109
|
|
|
* @param {string} passphrase |
|
110
|
|
|
* @param {string} plainText |
|
111
|
|
|
*/ |
|
112
|
|
|
declare function userJSEncrypt(passphrase: string, plainText: string): string; |
|
113
|
|
|
/** |
|
114
|
|
|
* Decrypt function |
|
115
|
|
|
* @param {string} passphrase |
|
116
|
|
|
* @param {string} encryptedText |
|
117
|
|
|
*/ |
|
118
|
|
|
declare function userJSDecrypt(passphrase: string, encryptedText: string): string; |
|
119
|
|
|
/** |
|
120
|
|
|
* Crypto get key |
|
121
|
|
|
* @param {String} passphrase |
|
122
|
|
|
* @param {String} salt |
|
123
|
|
|
*/ |
|
124
|
|
|
declare function CryptoK(passphrase: string, salt: string): CryptoJS.WordArray; |
|
125
|
|
|
/** |
|
126
|
|
|
* Crypto encrypt |
|
127
|
|
|
* @param {String} passphrase |
|
128
|
|
|
* @param {String} plainText |
|
129
|
|
|
* @param {String} salt |
|
130
|
|
|
* @param {String} iv |
|
131
|
|
|
*/ |
|
132
|
|
|
declare function CryptoE(passphrase: string, plainText: string, salt: string, iv: string): string; |
|
133
|
|
|
/** |
|
134
|
|
|
* Crypto decrypt |
|
135
|
|
|
* @param {String} passphrase |
|
136
|
|
|
* @param {String} encryptedText |
|
137
|
|
|
* @param {String} salt |
|
138
|
|
|
* @param {String} iv |
|
139
|
|
|
*/ |
|
140
|
|
|
declare function CryptoD(passphrase: string, encryptedText: string, salt: string, iv: string): string; |
|
141
|
|
|
/** |
|
142
|
|
|
* @todo CryptoJS |
|
143
|
|
|
* @package https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9-1/crypto-js.js |
|
144
|
|
|
*/ |
|
145
|
|
|
declare var salt: string; |
|
146
|
|
|
declare var iv: string; |
|
147
|
|
|
declare var iterations: string; |
|
148
|
|
|
declare function datetime_local(date: any): string; |
|
149
|
|
|
/** |
|
150
|
|
|
* Detect is mobile |
|
151
|
|
|
*/ |
|
152
|
|
|
declare function isMobile(): boolean; |
|
153
|
|
|
declare function get_device(): { |
|
154
|
|
|
screen: any; |
|
155
|
|
|
browser: any; |
|
156
|
|
|
browserVersion: any; |
|
157
|
|
|
browserMajorVersion: any; |
|
158
|
|
|
mobile: any; |
|
159
|
|
|
os: any; |
|
160
|
|
|
osVersion: any; |
|
161
|
|
|
cookies: any; |
|
162
|
|
|
flashVersion: string; |
|
163
|
|
|
}; |
|
164
|
|
|
/** Add one or more listeners to an element |
|
165
|
|
|
* @param element - DOM element to add listeners to |
|
166
|
|
|
* @param eventNames - space separated list of event names, e.g. 'click change' |
|
167
|
|
|
* @param listener - function to attach for each event as a listener |
|
168
|
|
|
*/ |
|
169
|
|
|
declare function setEventListener(element: HTMLElement, eventNames: "click" | "mouseover" | "submit" | "change", listener: EventListenerObject | Function | any): void; |
|
170
|
|
|
/** |
|
171
|
|
|
* @class Generate unique id |
|
172
|
|
|
*/ |
|
173
|
|
|
declare class GeneratorID { |
|
174
|
|
|
private rand; |
|
175
|
|
|
constructor(); |
|
176
|
|
|
/** |
|
177
|
|
|
* Increase new id |
|
178
|
|
|
*/ |
|
179
|
|
|
genId(): number; |
|
180
|
|
|
getId(): string; |
|
181
|
|
|
} |
|
182
|
|
|
/** |
|
183
|
|
|
* @param {createElementOpt} options |
|
184
|
|
|
*/ |
|
185
|
|
|
declare function createElement(options: createElementOpt): HTMLElement | DocumentFragment; |
|
186
|
|
|
declare function createElement(params: createElementOpt): any; |
|
187
|
|
|
declare class html { |
|
188
|
|
|
static create(options: any): any; |
|
189
|
|
|
} |
|
190
|
|
|
declare interface Number { |
|
191
|
|
|
getMS(type: string): number; |
|
192
|
|
|
/** |
|
193
|
|
|
* Get X Hour from date |
|
194
|
|
|
* @return number ms from Date().getTime() |
|
195
|
|
|
* @example |
|
196
|
|
|
* get `1 hour from current Date()` |
|
197
|
|
|
* 1.addHour() |
|
198
|
|
|
* get `1 hour from spesific Date()` |
|
199
|
|
|
* 1.addHour(new Date('2020-06-04 01:10:53')) |
|
200
|
|
|
*/ |
|
201
|
|
|
addHour(source: Date | null): number; |
|
202
|
|
|
/** |
|
203
|
|
|
* add zero leading |
|
204
|
|
|
* @param add |
|
205
|
|
|
* @param target |
|
206
|
|
|
*/ |
|
207
|
|
|
AddZero(add: number, target: string): number; |
|
208
|
|
|
} |
|
209
|
|
|
/** |
|
210
|
|
|
* Object management |
|
211
|
|
|
* @author Dimas Lanjaka <[email protected]> |
|
212
|
|
|
* @todo easy object processing |
|
213
|
|
|
*/ |
|
214
|
|
|
declare type NotFunction<T> = T extends Function ? never : T; |
|
215
|
|
|
/** |
|
216
|
|
|
* @class Timer constructor |
|
217
|
|
|
* @example |
|
218
|
|
|
* const time = new Timer(() => console.log('hi'), 1000); |
|
219
|
|
|
* console.log(time instanceof Timer); // true |
|
220
|
|
|
*/ |
|
221
|
|
|
declare class Timer { |
|
222
|
|
|
private timeId; |
|
223
|
|
|
constructor(callback: Function, time: number); |
|
224
|
|
|
clear(): void; |
|
225
|
|
|
} |
|
226
|
|
|
/** |
|
227
|
|
|
* call_user_func |
|
228
|
|
|
* @param functionName function name |
|
229
|
|
|
*/ |
|
230
|
|
|
declare function ___call(functionName: string, context?: Window, args?: any): void; |
|
231
|
|
|
/** |
|
232
|
|
|
* call_user_func |
|
233
|
|
|
* @param functionName |
|
234
|
|
|
* @param context |
|
235
|
|
|
* @param args |
|
236
|
|
|
*/ |
|
237
|
|
|
declare function call_user_func(functionName: string, context: Window & typeof globalThis, args: any): any; |
|
238
|
|
|
/** |
|
239
|
|
|
* Is Node ? |
|
240
|
|
|
*/ |
|
241
|
|
|
declare function isnode(): boolean; |
|
242
|
|
|
/** |
|
243
|
|
|
* Make function async |
|
244
|
|
|
* @param callback |
|
245
|
|
|
*/ |
|
246
|
|
|
declare function async_this(callback: Function): Promise<any>; |
|
247
|
|
|
/** |
|
248
|
|
|
* call_user_func |
|
249
|
|
|
* @param func function name |
|
250
|
|
|
*/ |
|
251
|
|
|
declare function __call(func: string): void; |
|
252
|
|
|
/** |
|
253
|
|
|
* check empty |
|
254
|
|
|
* @param str |
|
255
|
|
|
*/ |
|
256
|
|
|
declare function empty(str: string | null | undefined | number | boolean): boolean; |
|
257
|
|
|
/** |
|
258
|
|
|
* Get current function name |
|
259
|
|
|
*/ |
|
260
|
|
|
declare function getFuncName(): string; |
|
261
|
|
|
declare function pageid(length: number): string; |
|
262
|
|
|
declare const randstr: (length?: number) => string; |
|
263
|
|
|
/** |
|
264
|
|
|
* check string is json |
|
265
|
|
|
* @param {string} str |
|
266
|
|
|
* @description check validate json |
|
267
|
|
|
*/ |
|
268
|
|
|
declare function isJSON(str: string): boolean; |
|
269
|
|
|
declare var AjaxSchedulerInit: NodeJS.Timer; |
|
270
|
|
|
declare var AjaxSchedulerRequests: Array<any>; |
|
271
|
|
|
declare var AjaxSchedulerRunning: Boolean; |
|
272
|
|
|
/** |
|
273
|
|
|
* AJAX MANAGER |
|
274
|
|
|
* @todo handle ajax request queue |
|
275
|
|
|
* @see https://bit.ly/2Tz0wrf |
|
276
|
|
|
*/ |
|
277
|
|
|
declare class ajaxScheduler { |
|
278
|
|
|
/** |
|
279
|
|
|
* Add ajax to queues |
|
280
|
|
|
* @param opt |
|
281
|
|
|
*/ |
|
282
|
|
|
static add(opt: JQueryAjaxSettings): void; |
|
283
|
|
|
/** |
|
284
|
|
|
* Remove ajax from queues |
|
285
|
|
|
* @param opt |
|
286
|
|
|
*/ |
|
287
|
|
|
static remove(opt: Object): void; |
|
288
|
|
|
/** |
|
289
|
|
|
* Run Ajax Scheduler |
|
290
|
|
|
*/ |
|
291
|
|
|
static run(): boolean; |
|
292
|
|
|
/** |
|
293
|
|
|
* Stop ajax scheduler |
|
294
|
|
|
*/ |
|
295
|
|
|
static stop(): void; |
|
296
|
|
|
} |
|
297
|
|
|
/** |
|
298
|
|
|
* RUN AJAX Scheduler |
|
299
|
|
|
* @param method POST, GET, HEAD, DELETE, OPTIONS, PATCH, PROPATCH |
|
300
|
|
|
* @description ajax request one by one |
|
301
|
|
|
* @todo scheduling any jquery ajax |
|
302
|
|
|
*/ |
|
303
|
|
|
declare function ajaxRun(url: string, method: string, data: object, success: Function, failed: Function, complete: Function): void; |
|
304
|
|
|
declare function ajaxFormSchedule(): void; |
|
305
|
|
|
declare function ajax(): { |
|
306
|
|
|
(): any; |
|
307
|
|
|
x(): any; |
|
308
|
|
|
send(url: any, callback: any, method: any, data: any, async: any): void; |
|
309
|
|
|
get(url: any, data: any, callback: any, async: any): void; |
|
310
|
|
|
post(url: any, data: any, callback: any, async: any): void; |
|
311
|
|
|
}; |
|
312
|
|
|
declare namespace ajax { |
|
313
|
|
|
function x(): any; |
|
314
|
|
|
function send(url: any, callback: any, method: any, data: any, async: any): void; |
|
315
|
|
|
function get(url: any, data: any, callback: any, async: any): void; |
|
316
|
|
|
function post(url: any, data: any, callback: any, async: any): void; |
|
317
|
|
|
} |
|
318
|
|
|
/** |
|
319
|
|
|
* Bootstrap Alert Generator |
|
320
|
|
|
* @example createAlert( |
|
321
|
|
|
"[title] Opps!", |
|
322
|
|
|
"[description] Something went wrong", |
|
323
|
|
|
"[details] Here is a bunch of text about some stuff that happened.", |
|
324
|
|
|
"[mode|bg-color] danger", |
|
325
|
|
|
true, false, |
|
326
|
|
|
{ position: "fixed", bottom: "15px", right: "15px" }); |
|
327
|
|
|
*/ |
|
328
|
|
|
declare function createAlert( |
|
329
|
|
|
/** |
|
330
|
|
|
* Title alert |
|
331
|
|
|
*/ |
|
332
|
|
|
title: string, |
|
333
|
|
|
/** |
|
334
|
|
|
* Summary description |
|
335
|
|
|
*/ |
|
336
|
|
|
summary: string, |
|
337
|
|
|
/** |
|
338
|
|
|
* Another description |
|
339
|
|
|
*/ |
|
340
|
|
|
details: string, |
|
341
|
|
|
/** |
|
342
|
|
|
* basic class bootstrap or you can insert color name |
|
343
|
|
|
*/ |
|
344
|
|
|
severity: "success" | "error" | "warning" | "info" | "danger", |
|
345
|
|
|
/** |
|
346
|
|
|
* can be closed ? |
|
347
|
|
|
*/ |
|
348
|
|
|
dismissible: boolean, |
|
349
|
|
|
/** |
|
350
|
|
|
* auto closed ? |
|
351
|
|
|
*/ |
|
352
|
|
|
autoDismiss: boolean, |
|
353
|
|
|
/** |
|
354
|
|
|
* Fill `CSSProperties` object or insert CSS object string |
|
355
|
|
|
* @example {position: 'fixed', top: '5px', right: '5px'} |
|
356
|
|
|
* @example 'position:fixed;top:10px;left:10px;' |
|
357
|
|
|
*/ |
|
358
|
|
|
options: React.CSSProperties | string): void; |
|
359
|
|
|
/** |
|
360
|
|
|
* Create style css dynamic |
|
361
|
|
|
* @example css = 'h1 { background: red; }' |
|
362
|
|
|
* @example arributes = {id: 'customStyle', media: 'all'} |
|
363
|
|
|
* @param css |
|
364
|
|
|
*/ |
|
365
|
|
|
declare function createStyle(css: string, attributes?: {}): void; |
|
366
|
|
|
/** |
|
367
|
|
|
* Google analystic reporter |
|
368
|
|
|
* @param {String} event_action |
|
369
|
|
|
* @param {string} event_label |
|
370
|
|
|
* @param {string} event_category |
|
371
|
|
|
* @param {string} event_value |
|
372
|
|
|
* @param {Function|any} event_callback |
|
373
|
|
|
*/ |
|
374
|
|
|
declare function analys(event_action: string, event_label: string, event_category: string, event_value: string, event_callback: Function | any): any; |
|
375
|
|
|
declare var gtagID: string; |
|
376
|
|
|
declare var create_gtagscript: HTMLScriptElement; |
|
377
|
|
|
declare var gtag: any; |
|
378
|
|
|
declare function typedKeys<T>(o: T): (keyof T)[]; |
|
379
|
|
|
declare var ORIGIN: any; |
|
380
|
|
|
declare var dimas: { |
|
381
|
|
|
/** |
|
382
|
|
|
* get current url without querystrings |
|
383
|
|
|
*/ |
|
384
|
|
|
url: any; |
|
385
|
|
|
/** |
|
386
|
|
|
* framework captcha |
|
387
|
|
|
*/ |
|
388
|
|
|
captcha: { |
|
389
|
|
|
/** |
|
390
|
|
|
* DO NOT ASSIGN THIS |
|
391
|
|
|
*/ |
|
392
|
|
|
check: NodeJS.Timer; |
|
393
|
|
|
/** |
|
394
|
|
|
* Get current captcha id |
|
395
|
|
|
*/ |
|
396
|
|
|
id: (header_name: string | null) => string; |
|
397
|
|
|
/** |
|
398
|
|
|
* Get current captcha from backend |
|
399
|
|
|
* And process it by jsonpCallback |
|
400
|
|
|
*/ |
|
401
|
|
|
get: (header_name: null | string) => void; |
|
402
|
|
|
callback: (arg?: any) => void; |
|
403
|
|
|
/** |
|
404
|
|
|
* Captcha JSONP callback |
|
405
|
|
|
*/ |
|
406
|
|
|
jspCallback: (res: { |
|
407
|
|
|
captcha: string; |
|
408
|
|
|
}) => void; |
|
409
|
|
|
listener_started: any; |
|
410
|
|
|
/** |
|
411
|
|
|
* Form Captcha listener |
|
412
|
|
|
*/ |
|
413
|
|
|
listen: () => JQuery<Document>; |
|
414
|
|
|
}; |
|
415
|
|
|
/** |
|
416
|
|
|
* Count Array/Object/String length |
|
417
|
|
|
* @param {any[]|string|object} data |
|
418
|
|
|
*/ |
|
419
|
|
|
count(data: any[] | string | object): number; |
|
420
|
|
|
/** |
|
421
|
|
|
* Make async function |
|
422
|
|
|
* @param callback |
|
423
|
|
|
*/ |
|
424
|
|
|
async: (callback: any) => Promise<unknown>; |
|
425
|
|
|
/** |
|
426
|
|
|
* Rupiah currency auto format |
|
427
|
|
|
*/ |
|
428
|
|
|
rp: (angka: number, prefix: string | any) => string; |
|
429
|
|
|
/** |
|
430
|
|
|
* Check if variable is number / numeric |
|
431
|
|
|
* @param {String|Number} v |
|
432
|
|
|
*/ |
|
433
|
|
|
isNumber: (v: string | number) => boolean; |
|
434
|
|
|
/** |
|
435
|
|
|
* strpad / startwith zero [0] |
|
436
|
|
|
* @param {number} val |
|
437
|
|
|
*/ |
|
438
|
|
|
strpad: (val: number) => string | number; |
|
439
|
|
|
/** |
|
440
|
|
|
* Autofill datetime-local value |
|
441
|
|
|
*/ |
|
442
|
|
|
datetimelocal: (v?: string | number) => void; |
|
443
|
|
|
/** |
|
444
|
|
|
* Get cookie |
|
445
|
|
|
* @param string name cookie |
|
446
|
|
|
*/ |
|
447
|
|
|
gc: (name: string) => string; |
|
448
|
|
|
/** |
|
449
|
|
|
* Odd or Even (Ganjil Genap); |
|
450
|
|
|
* @param type odd or even |
|
451
|
|
|
*/ |
|
452
|
|
|
oddoreven: (n: string, type: string) => boolean; |
|
453
|
|
|
/** |
|
454
|
|
|
* Set cookie |
|
455
|
|
|
* @param {String} name |
|
456
|
|
|
* @param {any} value |
|
457
|
|
|
* @param {number} hours |
|
458
|
|
|
*/ |
|
459
|
|
|
sc: (name: string, value: any, hours: number) => void; |
|
460
|
|
|
allcookies: () => { |
|
461
|
|
|
[key: string]: any; |
|
462
|
|
|
}; |
|
463
|
|
|
/** |
|
464
|
|
|
* Remove Cookie |
|
465
|
|
|
*/ |
|
466
|
|
|
rc: (name: string) => void; |
|
467
|
|
|
/** |
|
468
|
|
|
* Get Query name from current url |
|
469
|
|
|
*/ |
|
470
|
|
|
getquery: (variable: any) => string | false; |
|
471
|
|
|
recode: (content: string, passcode: string) => string; |
|
472
|
|
|
/** |
|
473
|
|
|
* Get js file from url |
|
474
|
|
|
* @param {String} url |
|
475
|
|
|
* @param {Function} callback |
|
476
|
|
|
*/ |
|
477
|
|
|
js: (url: string, callback: Function | any) => void; |
|
478
|
|
|
/** |
|
479
|
|
|
* Countdown trigger |
|
480
|
|
|
* @param {JQuery} elm |
|
481
|
|
|
*/ |
|
482
|
|
|
pctdRUN: (elm: JQuery) => any; |
|
483
|
|
|
/** |
|
484
|
|
|
* Progress Countdown |
|
485
|
|
|
* @param {JQuery} elm |
|
486
|
|
|
*/ |
|
487
|
|
|
pctd: (elm: JQuery) => void; |
|
488
|
|
|
/** |
|
489
|
|
|
* Parseurl just like as parse_url at php |
|
490
|
|
|
*/ |
|
491
|
|
|
parseurl: (url: string) => { |
|
492
|
|
|
protocol: string; |
|
493
|
|
|
host: string; |
|
494
|
|
|
hostname: string; |
|
495
|
|
|
port: string; |
|
496
|
|
|
pathname: string; |
|
497
|
|
|
search: string; |
|
498
|
|
|
searchObject: { |
|
499
|
|
|
[key: string]: any; |
|
500
|
|
|
}; |
|
501
|
|
|
hash: string; |
|
502
|
|
|
protohost: string; |
|
503
|
|
|
}; |
|
504
|
|
|
}; |
|
505
|
|
|
/** |
|
506
|
|
|
* Framework object initializer |
|
507
|
|
|
*/ |
|
508
|
|
|
declare function framework(): { |
|
509
|
|
|
/** |
|
510
|
|
|
* get current url without querystrings |
|
511
|
|
|
*/ |
|
512
|
|
|
url: any; |
|
513
|
|
|
/** |
|
514
|
|
|
* framework captcha |
|
515
|
|
|
*/ |
|
516
|
|
|
captcha: { |
|
517
|
|
|
/** |
|
518
|
|
|
* DO NOT ASSIGN THIS |
|
519
|
|
|
*/ |
|
520
|
|
|
check: NodeJS.Timer; |
|
521
|
|
|
/** |
|
522
|
|
|
* Get current captcha id |
|
523
|
|
|
*/ |
|
524
|
|
|
id: (header_name: string) => string; |
|
525
|
|
|
/** |
|
526
|
|
|
* Get current captcha from backend |
|
527
|
|
|
* And process it by jsonpCallback |
|
528
|
|
|
*/ |
|
529
|
|
|
get: (header_name: string) => void; |
|
530
|
|
|
callback: (arg?: any) => void; |
|
531
|
|
|
/** |
|
532
|
|
|
* Captcha JSONP callback |
|
533
|
|
|
*/ |
|
534
|
|
|
jspCallback: (res: { |
|
535
|
|
|
captcha: string; |
|
536
|
|
|
}) => void; |
|
537
|
|
|
listener_started: any; |
|
538
|
|
|
/** |
|
539
|
|
|
* Form Captcha listener |
|
540
|
|
|
*/ |
|
541
|
|
|
listen: () => JQuery<Document>; |
|
542
|
|
|
}; |
|
543
|
|
|
/** |
|
544
|
|
|
* Count Array/Object/String length |
|
545
|
|
|
* @param {any[]|string|object} data |
|
546
|
|
|
*/ |
|
547
|
|
|
count(data: string | object | any[]): number; |
|
548
|
|
|
/** |
|
549
|
|
|
* Make async function |
|
550
|
|
|
* @param callback |
|
551
|
|
|
*/ |
|
552
|
|
|
async: (callback: any) => Promise<unknown>; |
|
553
|
|
|
/** |
|
554
|
|
|
* Rupiah currency auto format |
|
555
|
|
|
*/ |
|
556
|
|
|
rp: (angka: number, prefix: any) => string; |
|
557
|
|
|
/** |
|
558
|
|
|
* Check if variable is number / numeric |
|
559
|
|
|
* @param {String|Number} v |
|
560
|
|
|
*/ |
|
561
|
|
|
isNumber: (v: string | number) => boolean; |
|
562
|
|
|
/** |
|
563
|
|
|
* strpad / startwith zero [0] |
|
564
|
|
|
* @param {number} val |
|
565
|
|
|
*/ |
|
566
|
|
|
strpad: (val: number) => string | number; |
|
567
|
|
|
/** |
|
568
|
|
|
* Autofill datetime-local value |
|
569
|
|
|
*/ |
|
570
|
|
|
datetimelocal: (v?: string | number) => void; |
|
571
|
|
|
/** |
|
572
|
|
|
* Get cookie |
|
573
|
|
|
* @param string name cookie |
|
574
|
|
|
*/ |
|
575
|
|
|
gc: (name: string) => string; |
|
576
|
|
|
/** |
|
577
|
|
|
* Odd or Even (Ganjil Genap); |
|
578
|
|
|
* @param type odd or even |
|
579
|
|
|
*/ |
|
580
|
|
|
oddoreven: (n: string, type: string) => boolean; |
|
581
|
|
|
/** |
|
582
|
|
|
* Set cookie |
|
583
|
|
|
* @param {String} name |
|
584
|
|
|
* @param {any} value |
|
585
|
|
|
* @param {number} hours |
|
586
|
|
|
*/ |
|
587
|
|
|
sc: (name: string, value: any, hours: number) => void; |
|
588
|
|
|
allcookies: () => { |
|
589
|
|
|
[key: string]: any; |
|
590
|
|
|
}; |
|
591
|
|
|
/** |
|
592
|
|
|
* Remove Cookie |
|
593
|
|
|
*/ |
|
594
|
|
|
rc: (name: string) => void; |
|
595
|
|
|
/** |
|
596
|
|
|
* Get Query name from current url |
|
597
|
|
|
*/ |
|
598
|
|
|
getquery: (variable: any) => string | false; |
|
599
|
|
|
recode: (content: string, passcode: string) => string; |
|
600
|
|
|
/** |
|
601
|
|
|
* Get js file from url |
|
602
|
|
|
* @param {String} url |
|
603
|
|
|
* @param {Function} callback |
|
604
|
|
|
*/ |
|
605
|
|
|
js: (url: string, callback: any) => void; |
|
606
|
|
|
/** |
|
607
|
|
|
* Countdown trigger |
|
608
|
|
|
* @param {JQuery} elm |
|
609
|
|
|
*/ |
|
610
|
|
|
pctdRUN: (elm: JQuery<HTMLElement>) => any; |
|
611
|
|
|
/** |
|
612
|
|
|
* Progress Countdown |
|
613
|
|
|
* @param {JQuery} elm |
|
614
|
|
|
*/ |
|
615
|
|
|
pctd: (elm: JQuery<HTMLElement>) => void; |
|
616
|
|
|
/** |
|
617
|
|
|
* Parseurl just like as parse_url at php |
|
618
|
|
|
*/ |
|
619
|
|
|
parseurl: (url: string) => { |
|
620
|
|
|
protocol: string; |
|
621
|
|
|
host: string; |
|
622
|
|
|
hostname: string; |
|
623
|
|
|
port: string; |
|
624
|
|
|
pathname: string; |
|
625
|
|
|
search: string; |
|
626
|
|
|
searchObject: { |
|
627
|
|
|
[key: string]: any; |
|
628
|
|
|
}; |
|
629
|
|
|
hash: string; |
|
630
|
|
|
protohost: string; |
|
631
|
|
|
}; |
|
632
|
|
|
}; |
|
633
|
|
|
declare class app { |
|
634
|
|
|
static base: string; |
|
635
|
|
|
static setbase(path: string): void; |
|
636
|
|
|
static direct(...args: string[]): void; |
|
637
|
|
|
static load(...args: any[]): void; |
|
638
|
|
|
} |
|
639
|
|
|
/** |
|
640
|
|
|
* base64 encoding |
|
641
|
|
|
* @param {string} str string raw |
|
642
|
|
|
*/ |
|
643
|
|
|
declare function base64_encode(str: string): string; |
|
644
|
|
|
/** |
|
645
|
|
|
* base64 decoding |
|
646
|
|
|
* @param {string} str base64 string |
|
647
|
|
|
*/ |
|
648
|
|
|
declare function base64_decode(str: string): string; |
|
649
|
|
|
declare function b64EncodeUnicode(str: any): string; |
|
650
|
|
|
declare function b64DecodeUnicode(str: any): string; |
|
651
|
|
|
declare function randomHex(): string; |
|
652
|
|
|
/** |
|
653
|
|
|
* open in new tab |
|
654
|
|
|
* @param url |
|
655
|
|
|
* @param name |
|
656
|
|
|
*/ |
|
657
|
|
|
declare function openInNewTab(url: string, name: string): void; |
|
658
|
|
|
interface Console { |
|
659
|
|
|
olog: { |
|
660
|
|
|
(...data: any[]): void; |
|
661
|
|
|
(message?: any, ...optionalParams: any[]): void; |
|
662
|
|
|
}; |
|
663
|
|
|
} |
|
664
|
|
|
declare var console_callback: any; |
|
665
|
|
|
/** |
|
666
|
|
|
* Disable debugger |
|
667
|
|
|
*/ |
|
668
|
|
|
declare function bannedebug(): void; |
|
669
|
|
|
/** |
|
670
|
|
|
* Detect debugger using flooding loop |
|
671
|
|
|
*/ |
|
672
|
|
|
declare function debug_detect(): void; |
|
673
|
|
|
/** |
|
674
|
|
|
* restrict debug |
|
675
|
|
|
* @param {Boolean} restrict |
|
676
|
|
|
*/ |
|
677
|
|
|
declare function restrict_mode(restrict: boolean): void; |
|
678
|
|
|
declare var debug_run: any; |
|
679
|
|
|
declare var restrict: boolean; |
|
680
|
|
|
/** |
|
681
|
|
|
* Disqus loader which verifies the existence of `#disqus_thread` on |
|
682
|
|
|
* the web page and then prepares the disqus embed script to hook in |
|
683
|
|
|
* the document |
|
684
|
|
|
* @param disqus_shortname disqus username/shortname |
|
685
|
|
|
*/ |
|
686
|
|
|
declare function load_disqus(disqus_shortname: string): void; |
|
687
|
|
|
declare const distance_already_calculated: string[]; |
|
688
|
|
|
/** |
|
689
|
|
|
* find distance |
|
690
|
|
|
* @param target |
|
691
|
|
|
* @param callback |
|
692
|
|
|
*/ |
|
693
|
|
|
declare function calculateDistance(target: string, callback: (arg0: number) => any): JQuery<Document>; |
|
694
|
|
|
/** |
|
695
|
|
|
* calculate distance mouse x element |
|
696
|
|
|
* @param elem |
|
697
|
|
|
* @param mouseX |
|
698
|
|
|
* @param mouseY |
|
699
|
|
|
*/ |
|
700
|
|
|
declare function calculatorDistance(elem: JQuery, mouseX: number, mouseY: number): number; |
|
701
|
|
|
/** |
|
702
|
|
|
* Encode HTML string to HTML entities |
|
703
|
|
|
* @param {String} str |
|
704
|
|
|
*/ |
|
705
|
|
|
declare function prepEntities(str: string): string; |
|
706
|
|
|
declare var entityMap: { |
|
707
|
|
|
160: string; |
|
708
|
|
|
161: string; |
|
709
|
|
|
162: string; |
|
710
|
|
|
163: string; |
|
711
|
|
|
164: string; |
|
712
|
|
|
165: string; |
|
713
|
|
|
166: string; |
|
714
|
|
|
167: string; |
|
715
|
|
|
168: string; |
|
716
|
|
|
169: string; |
|
717
|
|
|
8364: string; |
|
718
|
|
|
}; |
|
719
|
|
|
/** |
|
720
|
|
|
* php equivalent http_build_query |
|
721
|
|
|
* @param obj |
|
722
|
|
|
*/ |
|
723
|
|
|
declare function http_build_query(obj: Object): string; |
|
724
|
|
|
/** |
|
725
|
|
|
* Check current framework running at localhost |
|
726
|
|
|
*/ |
|
727
|
|
|
declare function is_localhost(): RegExpMatchArray; |
|
728
|
|
|
/** |
|
729
|
|
|
* Is Development Mode |
|
730
|
|
|
*/ |
|
731
|
|
|
declare function is_development(): boolean; |
|
732
|
|
|
/** |
|
733
|
|
|
* Force HTTPS |
|
734
|
|
|
*/ |
|
735
|
|
|
declare function forceSSL(): void; |
|
736
|
|
|
/** |
|
737
|
|
|
* json decode fails return false |
|
738
|
|
|
* @param obj |
|
739
|
|
|
*/ |
|
740
|
|
|
declare function json_decode(obj: string): any; |
|
741
|
|
|
/** |
|
742
|
|
|
* Load script asynchronously |
|
743
|
|
|
* @param urls |
|
744
|
|
|
* @param callback |
|
745
|
|
|
*/ |
|
746
|
|
|
declare function LoadScript(urls: string | string[], callback: null | Function): void; |
|
747
|
|
|
/** |
|
748
|
|
|
* Load CSS async |
|
749
|
|
|
* @param href |
|
750
|
|
|
* @param callback |
|
751
|
|
|
*/ |
|
752
|
|
|
declare function loadCSS(href: string | string[], callback: any): void; |
|
753
|
|
|
declare const guxid: string; |
|
754
|
|
|
/** |
|
755
|
|
|
* Get current unique global page user id |
|
756
|
|
|
*/ |
|
757
|
|
|
declare function guid(): string; |
|
758
|
|
|
/** |
|
759
|
|
|
* Generate UUID v4 |
|
760
|
|
|
*/ |
|
761
|
|
|
declare function uuidv4(): string; |
|
762
|
|
|
declare function setInputFilter(textbox: any, inputFilter: any): void; |
|
763
|
|
|
declare var INPT: NodeListOf<Element>; |
|
764
|
|
|
declare var index: number; |
|
765
|
|
|
declare var element: Element; |
|
766
|
|
|
/** Format Rupiah */ |
|
767
|
|
|
declare var inputrp: JQuery<HTMLElement>; |
|
768
|
|
|
declare class ip { |
|
769
|
|
|
private static status; |
|
770
|
|
|
/** |
|
771
|
|
|
* Checks ip |
|
772
|
|
|
* @returns promises |
|
773
|
|
|
*/ |
|
774
|
|
|
static check(): Promise<void>; |
|
775
|
|
|
/** |
|
776
|
|
|
* Gets ip |
|
777
|
|
|
* @param callback function callback(ip) or null return ip |
|
778
|
|
|
* @returns {String} ip or callback |
|
779
|
|
|
*/ |
|
780
|
|
|
static get(callback: Function | null): string; |
|
781
|
|
|
static ipapi(): JQuery.jqXHR<any>; |
|
782
|
|
|
static l2io(): JQuery.jqXHR<any>; |
|
783
|
|
|
} |
|
784
|
|
|
declare function md5(string: any): string; |
|
785
|
|
|
/** |
|
786
|
|
|
* Get gravatar url by email |
|
787
|
|
|
* @param {string} email |
|
788
|
|
|
*/ |
|
789
|
|
|
declare function gravatar(email: string): string; |
|
790
|
|
|
declare function MD5(string: any): string; |
|
791
|
|
|
interface progressBarTimer { |
|
792
|
|
|
warningThreshold: number; |
|
793
|
|
|
} |
|
794
|
|
|
/** |
|
795
|
|
|
* @see https://github.com/imalliar/jquery.progressBarTimer |
|
796
|
|
|
*/ |
|
797
|
|
|
declare var progressBarTimer: progressBarTimer; |
|
798
|
|
|
interface JQueryStatic { |
|
799
|
|
|
/** |
|
800
|
|
|
* Accepts a string containing a CSS selector which is then used to match a set of elements. |
|
801
|
|
|
* |
|
802
|
|
|
* @param selector A string containing a selector expression |
|
803
|
|
|
* @param context A DOM Element, Document, or jQuery to use as context |
|
804
|
|
|
* @see {@link https://api.jquery.com/jQuery/#jQuery-selector-context} |
|
805
|
|
|
*/ |
|
806
|
|
|
(selector: string, context?: Element | JQuery | string): JQuery; |
|
807
|
|
|
} |
|
808
|
|
|
/** |
|
809
|
|
|
* Hidden reCaptcha v3 object initializer |
|
810
|
|
|
*/ |
|
811
|
|
|
declare function recaptcha(): { |
|
812
|
|
|
/** |
|
813
|
|
|
* @type {Number} counter executions |
|
814
|
|
|
*/ |
|
815
|
|
|
gexec_count: number; |
|
816
|
|
|
key: string; |
|
817
|
|
|
/** |
|
818
|
|
|
* Javascript caller |
|
819
|
|
|
* @param {String} url |
|
820
|
|
|
* @param {Function} callback |
|
821
|
|
|
*/ |
|
822
|
|
|
js: (url: string, callback: Function) => void; |
|
823
|
|
|
/** |
|
824
|
|
|
* Set recaptcha site key |
|
825
|
|
|
* @param {String} key |
|
826
|
|
|
*/ |
|
827
|
|
|
set_key: (key: string) => void; |
|
828
|
|
|
/** |
|
829
|
|
|
* Start recaptcha |
|
830
|
|
|
*/ |
|
831
|
|
|
start: () => void; |
|
832
|
|
|
/** |
|
833
|
|
|
* Initialize Recaptcha by defining jquery |
|
834
|
|
|
*/ |
|
835
|
|
|
init: () => void; |
|
836
|
|
|
retry_count: number; |
|
837
|
|
|
/** |
|
838
|
|
|
* load or refreshing google recaptcha |
|
839
|
|
|
*/ |
|
840
|
|
|
exec: (action: any, retry: any, callback: any) => void; |
|
841
|
|
|
/** |
|
842
|
|
|
* Insert reCaptcha Token |
|
843
|
|
|
* @param {String} token |
|
844
|
|
|
*/ |
|
845
|
|
|
insert: (token: string) => void; |
|
846
|
|
|
/** |
|
847
|
|
|
* Distribute reCaptcha Token |
|
848
|
|
|
* @param {String} token |
|
849
|
|
|
*/ |
|
850
|
|
|
distribute_token: (token: string) => void; |
|
851
|
|
|
/** |
|
852
|
|
|
* Get token recaptcha |
|
853
|
|
|
*/ |
|
854
|
|
|
get: () => string; |
|
855
|
|
|
/** |
|
856
|
|
|
* Button Controller |
|
857
|
|
|
* @param {Boolean} reCaptcha_disable |
|
858
|
|
|
* @param {Function} callback |
|
859
|
|
|
*/ |
|
860
|
|
|
reCaptcha_buttons: (reCaptcha_disable: boolean, callback: Function) => void; |
|
861
|
|
|
}; |
|
862
|
|
|
declare var reCaptcha: { |
|
863
|
|
|
/** |
|
864
|
|
|
* @type {Number} counter executions |
|
865
|
|
|
*/ |
|
866
|
|
|
gexec_count: number; |
|
867
|
|
|
key: string; |
|
868
|
|
|
/** |
|
869
|
|
|
* Javascript caller |
|
870
|
|
|
* @param {String} url |
|
871
|
|
|
* @param {Function} callback |
|
872
|
|
|
*/ |
|
873
|
|
|
js: (url: string, callback: Function) => void; |
|
874
|
|
|
/** |
|
875
|
|
|
* Set recaptcha site key |
|
876
|
|
|
* @param {String} key |
|
877
|
|
|
*/ |
|
878
|
|
|
set_key: (key: string) => void; |
|
879
|
|
|
/** |
|
880
|
|
|
* Start recaptcha |
|
881
|
|
|
*/ |
|
882
|
|
|
start: () => void; |
|
883
|
|
|
/** |
|
884
|
|
|
* Initialize Recaptcha by defining jquery |
|
885
|
|
|
*/ |
|
886
|
|
|
init: () => void; |
|
887
|
|
|
retry_count: number; |
|
888
|
|
|
/** |
|
889
|
|
|
* load or refreshing google recaptcha |
|
890
|
|
|
*/ |
|
891
|
|
|
exec: (action: any, retry: any, callback: any) => void; |
|
892
|
|
|
/** |
|
893
|
|
|
* Insert reCaptcha Token |
|
894
|
|
|
* @param {String} token |
|
895
|
|
|
*/ |
|
896
|
|
|
insert: (token: string) => void; |
|
897
|
|
|
/** |
|
898
|
|
|
* Distribute reCaptcha Token |
|
899
|
|
|
* @param {String} token |
|
900
|
|
|
*/ |
|
901
|
|
|
distribute_token: (token: string) => void; |
|
902
|
|
|
/** |
|
903
|
|
|
* Get token recaptcha |
|
904
|
|
|
*/ |
|
905
|
|
|
get: () => string; |
|
906
|
|
|
/** |
|
907
|
|
|
* Button Controller |
|
908
|
|
|
* @param {Boolean} reCaptcha_disable |
|
909
|
|
|
* @param {Function} callback |
|
910
|
|
|
*/ |
|
911
|
|
|
reCaptcha_buttons: (reCaptcha_disable: boolean, callback: Function) => void; |
|
912
|
|
|
}; |
|
913
|
|
|
declare const requirejs_vendor = "/node_modules"; |
|
914
|
|
|
declare const require_config: RequireConfig; |
|
915
|
|
|
declare const dtpackage: () => string[]; |
|
916
|
|
|
declare var requirejs_ignited: boolean; |
|
917
|
|
|
/** |
|
918
|
|
|
* Load requirejs |
|
919
|
|
|
*/ |
|
920
|
|
|
declare function load_requirejs(): Promise<unknown>; |
|
921
|
|
|
/** |
|
922
|
|
|
* Load Modules From node_modules folder |
|
923
|
|
|
* @param name |
|
924
|
|
|
* @param callback |
|
925
|
|
|
*/ |
|
926
|
|
|
declare function load_module(name: string | string[], callback: Function): void; |
|
927
|
|
|
/** |
|
928
|
|
|
* Datatables loader |
|
929
|
|
|
* @param callback |
|
930
|
|
|
*/ |
|
931
|
|
|
declare function load_datatables(callback: Function): void; |
|
932
|
|
|
declare var datatables_ignited: boolean; |
|
933
|
|
|
/** |
|
934
|
|
|
* Datatables init |
|
935
|
|
|
* @todo disable error warning |
|
936
|
|
|
* @todo add refresh button |
|
937
|
|
|
*/ |
|
938
|
|
|
declare function datatables_init(): Promise<unknown>; |
|
939
|
|
|
declare var optimized_ids: any[]; |
|
940
|
|
|
/** |
|
941
|
|
|
* Optimize Material Datatables |
|
942
|
|
|
* @param id id table |
|
943
|
|
|
* @param callback additional function to optimizer |
|
944
|
|
|
*/ |
|
945
|
|
|
declare function datatables_optimize(id: string, callback?: Function): void; |
|
946
|
|
|
/** |
|
947
|
|
|
* Scroll up after click pagination dt |
|
948
|
|
|
* @param target |
|
949
|
|
|
*/ |
|
950
|
|
|
declare function pagination_up(target: JQuery): void; |
|
951
|
|
|
/** |
|
952
|
|
|
* Optimize Datatables Columns Options |
|
953
|
|
|
* @param data |
|
954
|
|
|
* @param exclude |
|
955
|
|
|
*/ |
|
956
|
|
|
declare function datatables_colums_options(data?: DataTables.ColumnSettings, exclude?: string[]): void; |
|
957
|
|
|
/** |
|
958
|
|
|
* Set all forms to be smart |
|
959
|
|
|
* @todo save input fields into browser for reusable form |
|
960
|
|
|
*/ |
|
961
|
|
|
declare function smartform(): void; |
|
962
|
|
|
/** |
|
963
|
|
|
* Copy to clipboard |
|
964
|
|
|
*/ |
|
965
|
|
|
declare function copyToClipboard(text: string, el: JQuery): void; |
|
966
|
|
|
/** |
|
967
|
|
|
* localStorage helper |
|
968
|
|
|
*/ |
|
969
|
|
|
declare function storage(): { |
|
970
|
|
|
/** |
|
971
|
|
|
* get localstorage by key |
|
972
|
|
|
* @param {String} key |
|
973
|
|
|
*/ |
|
974
|
|
|
get: (key: string) => any; |
|
975
|
|
|
/** |
|
976
|
|
|
* Set localstorage key value |
|
977
|
|
|
* @param {String} key |
|
978
|
|
|
* @param {String|Array|Object} value |
|
979
|
|
|
*/ |
|
980
|
|
|
set: (key: string, value: string | Array | any) => void; |
|
981
|
|
|
/** |
|
982
|
|
|
* Check localstorage key exists |
|
983
|
|
|
* @param {String} key |
|
984
|
|
|
*/ |
|
985
|
|
|
has: (key: string) => boolean; |
|
986
|
|
|
/** |
|
987
|
|
|
* Extend or set localstorage key |
|
988
|
|
|
* @param {String} key |
|
989
|
|
|
* @param {String} value |
|
990
|
|
|
*/ |
|
991
|
|
|
extend: (key: string, value: string) => void; |
|
992
|
|
|
/** |
|
993
|
|
|
* Remove localstorage key |
|
994
|
|
|
* @param {String} key |
|
995
|
|
|
*/ |
|
996
|
|
|
remove: (key: string) => void; |
|
997
|
|
|
}; |
|
998
|
|
|
declare var STORAGE: { |
|
999
|
|
|
/** |
|
1000
|
|
|
* get localstorage by key |
|
1001
|
|
|
* @param {String} key |
|
1002
|
|
|
*/ |
|
1003
|
|
|
get: (key: string) => any; |
|
1004
|
|
|
/** |
|
1005
|
|
|
* Set localstorage key value |
|
1006
|
|
|
* @param {String} key |
|
1007
|
|
|
* @param {String|Array|Object} value |
|
1008
|
|
|
*/ |
|
1009
|
|
|
set: (key: string, value: string | Array | any) => void; |
|
1010
|
|
|
/** |
|
1011
|
|
|
* Check localstorage key exists |
|
1012
|
|
|
* @param {String} key |
|
1013
|
|
|
*/ |
|
1014
|
|
|
has: (key: string) => boolean; |
|
1015
|
|
|
/** |
|
1016
|
|
|
* Extend or set localstorage key |
|
1017
|
|
|
* @param {String} key |
|
1018
|
|
|
* @param {String} value |
|
1019
|
|
|
*/ |
|
1020
|
|
|
extend: (key: string, value: string) => void; |
|
1021
|
|
|
/** |
|
1022
|
|
|
* Remove localstorage key |
|
1023
|
|
|
* @param {String} key |
|
1024
|
|
|
*/ |
|
1025
|
|
|
remove: (key: string) => void; |
|
1026
|
|
|
}; |
|
1027
|
|
|
declare class ctable { |
|
1028
|
|
|
private can_edit; |
|
1029
|
|
|
private instance; |
|
1030
|
|
|
constructor(config?: ctableOpt); |
|
1031
|
|
|
private editable_run; |
|
1032
|
|
|
private editable; |
|
1033
|
|
|
create(id: string, where: string, data: string[]): void; |
|
1034
|
|
|
add(table: string, data: any[]): void; |
|
1035
|
|
|
} |
|
1036
|
|
|
interface ctableOpt { |
|
1037
|
|
|
editable?: boolean; |
|
1038
|
|
|
} |
|
1039
|
|
|
declare function currentUID(): string; |
|
1040
|
|
|
/** |
|
1041
|
|
|
* Get uid saved in browser |
|
1042
|
|
|
*/ |
|
1043
|
|
|
declare function getUID(): string; |
|
1044
|
|
|
/** |
|
1045
|
|
|
* Signing the uid |
|
1046
|
|
|
* @param {String} UID |
|
1047
|
|
|
*/ |
|
1048
|
|
|
declare function sign_uid(UID: string): void; |
|
1049
|
|
|
/** |
|
1050
|
|
|
* Check UID |
|
1051
|
|
|
* @return {string} uid |
|
1052
|
|
|
* @param {Function|any} callback |
|
1053
|
|
|
*/ |
|
1054
|
|
|
declare function checkUID(callback: Function | any): string; |
|
1055
|
|
|
declare function isExpireUID(): boolean; |
|
1056
|
|
|
declare function AddMinutesToDate(date: any, minutes: any): Date; |
|
1057
|
|
|
declare function genUID(): string; |
|
1058
|
|
|
/** |
|
1059
|
|
|
* Save uid |
|
1060
|
|
|
* @param {Object} data |
|
1061
|
|
|
*/ |
|
1062
|
|
|
declare function saveUID(data: any): void; |
|
1063
|
|
|
declare var UIDvalue: string; |
|
1064
|
|
|
declare var UIDcalled: boolean; |
|
1065
|
|
|
/** |
|
1066
|
|
|
* get url parameter by name |
|
1067
|
|
|
* @param name parameter name |
|
1068
|
|
|
* @param url url target, null for current location.href |
|
1069
|
|
|
*/ |
|
1070
|
|
|
declare function getParameterByName(name: string, url: string | null): string; |
|
1071
|
|
|
/** |
|
1072
|
|
|
* User framework |
|
1073
|
|
|
*/ |
|
1074
|
|
|
declare class user { |
|
1075
|
|
|
key: string; |
|
1076
|
|
|
/** |
|
1077
|
|
|
* Get all userdata |
|
1078
|
|
|
*/ |
|
1079
|
|
|
all(): undefined | object | any; |
|
1080
|
|
|
/** |
|
1081
|
|
|
* get userdata |
|
1082
|
|
|
*/ |
|
1083
|
|
|
get(key: string): any; |
|
1084
|
|
|
/** |
|
1085
|
|
|
* fetch userdata |
|
1086
|
|
|
*/ |
|
1087
|
|
|
fetch(callback: Function | null): JQuery.jqXHR<any>; |
|
1088
|
|
|
} |
|
1089
|
|
|
/** |
|
1090
|
|
|
* textarea focus |
|
1091
|
|
|
* @param {String} id |
|
1092
|
|
|
* @param {String} placeholder |
|
1093
|
|
|
*/ |
|
1094
|
|
|
declare function tafocus(id: string, placeholder: string): void; |
|
1095
|
|
|
/** |
|
1096
|
|
|
* format new lines |
|
1097
|
|
|
* @param {String} placeholder |
|
1098
|
|
|
*/ |
|
1099
|
|
|
declare function formatNewLines(placeholder: string): string; |
|
1100
|
|
|
/** |
|
1101
|
|
|
* Count newLines |
|
1102
|
|
|
* @param {String} placeholder |
|
1103
|
|
|
*/ |
|
1104
|
|
|
declare function countNewLines(placeholder: string): string | number; |
|
1105
|
|
|
/** |
|
1106
|
|
|
* find duplicate array |
|
1107
|
|
|
* @param {Array<any>} arr |
|
1108
|
|
|
* @param {Function} callback |
|
1109
|
|
|
*/ |
|
1110
|
|
|
declare function findDups(arr: Array<any>, callback: Function): any; |
|
1111
|
|
|
/** |
|
1112
|
|
|
* Auto Generate ID |
|
1113
|
|
|
* @param {Number} length |
|
1114
|
|
|
*/ |
|
1115
|
|
|
declare function makeid(length: number): string; |
|
1116
|
|
|
/** |
|
1117
|
|
|
* load or refreshing google recaptcha |
|
1118
|
|
|
*/ |
|
1119
|
|
|
declare function gexec(action: any, retry: any, callback: any): void; |
|
1120
|
|
|
/** |
|
1121
|
|
|
* Get token recaptcha |
|
1122
|
|
|
*/ |
|
1123
|
|
|
declare function geToken(): string; |
|
1124
|
|
|
/** |
|
1125
|
|
|
* Javascript caller |
|
1126
|
|
|
* @param {String} url |
|
1127
|
|
|
* @param {Function} callback |
|
1128
|
|
|
*/ |
|
1129
|
|
|
declare function JavaScriptCaller(url: string, callback: Function): void; |
|
1130
|
|
|
/** |
|
1131
|
|
|
* get currency symbol from navigator |
|
1132
|
|
|
*/ |
|
1133
|
|
|
declare function get_currency_symbol(): string; |
|
1134
|
|
|
/** |
|
1135
|
|
|
* Create JSON |
|
1136
|
|
|
* @param {any} jsObj |
|
1137
|
|
|
* @param {boolean} tabs |
|
1138
|
|
|
*/ |
|
1139
|
|
|
declare function createJSON(jsObj: any, tabs: boolean): string; |
|
1140
|
|
|
declare function loadingio(text: any, callback: any, mode: any, ...args: any[]): void; |
|
1141
|
|
|
/** |
|
1142
|
|
|
function target(a) { |
|
1143
|
|
|
alert(a); |
|
1144
|
|
|
} |
|
1145
|
|
|
|
|
1146
|
|
|
var o = { |
|
1147
|
|
|
suffix: " World", |
|
1148
|
|
|
target: function(s) { alert(s + this.suffix); } |
|
1149
|
|
|
}; |
|
1150
|
|
|
|
|
1151
|
|
|
__call("target", "Hello"); |
|
1152
|
|
|
|
|
1153
|
|
|
__call.call(o, "target", "Hello"); |
|
1154
|
|
|
*/ |
|
1155
|
|
|
/** |
|
1156
|
|
|
* parse proxy from string |
|
1157
|
|
|
* @param {string} str |
|
1158
|
|
|
* @return {Array<any>} proxy list filtered |
|
1159
|
|
|
*/ |
|
1160
|
|
|
declare function parse_proxy(str: string): Array<any>; |
|
1161
|
|
|
/** |
|
1162
|
|
|
* Add class if not exists |
|
1163
|
|
|
* @param {Element} element element from DOM |
|
1164
|
|
|
* @param {string} className class name |
|
1165
|
|
|
*/ |
|
1166
|
|
|
declare function toogleClass(element: Element, className: string): boolean; |
|
1167
|
|
|
declare function UNIQUE_ID(): string; |
|
1168
|
|
|
/** |
|
1169
|
|
|
* jQuery pseudo builder |
|
1170
|
|
|
* @param {string} string |
|
1171
|
|
|
*/ |
|
1172
|
|
|
declare function pseudo_builder(string: string): string; |
|
1173
|
|
|
/** |
|
1174
|
|
|
* Loop key value of object |
|
1175
|
|
|
* @param {Object} object |
|
1176
|
|
|
* @param {Function} callback |
|
1177
|
|
|
*/ |
|
1178
|
|
|
declare function foreach(object: any, callback: Function): void; |
|
1179
|
|
|
/** |
|
1180
|
|
|
* Get multiple random element from array |
|
1181
|
|
|
* @param {Array<any>} arr array sources |
|
1182
|
|
|
* @param {Number} n maximum element to be in result |
|
1183
|
|
|
* @param {Function} callback function to process result |
|
1184
|
|
|
*/ |
|
1185
|
|
|
declare function getRandom(arr: Array<any>, n: number, callback: Function): any; |
|
1186
|
|
|
/** |
|
1187
|
|
|
* @todo Auto replace placeholder textarea newLines |
|
1188
|
|
|
*/ |
|
1189
|
|
|
declare var textAreas: HTMLCollectionOf<HTMLTextAreaElement>; |
|
1190
|
|
|
/** Query URL */ |
|
1191
|
|
|
declare function getLocationHash(): void; |
|
1192
|
|
|
/** Progress bar */ |
|
1193
|
|
|
declare var elm: JQuery<HTMLElement>; |
|
1194
|
|
|
/** |
|
1195
|
|
|
* @type {JQuery<HTMLElement>} L |
|
1196
|
|
|
*/ |
|
1197
|
|
|
declare var L: JQuery<HTMLElement>; |
|
1198
|
|
|
/** |
|
1199
|
|
|
* links new tab form submit |
|
1200
|
|
|
*/ |
|
1201
|
|
|
declare var aform: JQuery<HTMLElement>; |
|
1202
|
|
|
declare function socket_start(host: any): void; |
|
1203
|
|
|
declare function socket_server(host: any): EventSource; |
|
1204
|
|
|
declare function socket_stop(): void; |
|
1205
|
|
|
declare function socket_check(): any; |
|
1206
|
|
|
/** |
|
1207
|
|
|
* Simple Websocket javascript |
|
1208
|
|
|
* @todo Live Data |
|
1209
|
|
|
* @description Don't miss data that changes even for a second |
|
1210
|
|
|
* @author Dimas Lanjaka <dimaslanjaka[at]gmail.com |
|
1211
|
|
|
* @see https://www.webmanajemen.com/p/simple-websocket.html Simple Web Socket |
|
1212
|
|
|
*/ |
|
1213
|
|
|
declare var socket: any; |
|
1214
|
|
|
/** |
|
1215
|
|
|
* ZLIB packer |
|
1216
|
|
|
* @see http://localhost/src/ZLIB.php |
|
1217
|
|
|
* @requires pako `npm i pako @types/pako` |
|
1218
|
|
|
*/ |
|
1219
|
|
|
declare class ZLIB { |
|
1220
|
|
|
/** |
|
1221
|
|
|
* Base64 decode from php |
|
1222
|
|
|
* @param {Uint8Array} arr |
|
1223
|
|
|
*/ |
|
1224
|
|
|
static atos(arr: Uint8Array): string; |
|
1225
|
|
|
static decompress(str: any): string; |
|
1226
|
|
|
static compress(str: any): any; |
|
1227
|
|
|
} |
|
1228
|
|
|
|