Completed
Push — master ( 6fab34...71c0e6 )
by Dimas
61:57 queued 48:11
created

src/MVC/themes/assets/js/app.d.ts   F

Complexity

Total Complexity 138
Complexity/F 1

Size

Lines of Code 1221
Function Count 138

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 546
dl 0
loc 1221
rs 2
c 0
b 0
f 0
wmc 138
mnd 0
bc 0
fnc 138
bpm 0
cpm 1
noi 0

How to fix   Complexity   

Complexity

Complex classes like src/MVC/themes/assets/js/app.d.ts often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

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