omegga 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/plugin.d.ts +12 -4
- package/dist/util/index.d.ts +2 -0
- package/dist/util/index.js +1 -1
- package/dist/util/index.js.map +1 -1
- package/dist/util/time.d.ts +37 -2
- package/dist/util/time.js.map +1 -1
- package/package.json +1 -1
- package/templates/safe-ts/omegga.d.ts +48 -4
package/dist/plugin.d.ts
CHANGED
|
@@ -49,15 +49,19 @@ export declare const _OMEGGA_UTILS_IMPORT: {
|
|
|
49
49
|
time: {
|
|
50
50
|
parseDuration: typeof import("./util/time").parseDuration;
|
|
51
51
|
parseBrickadiaTime: typeof import("./util/time").parseBrickadiaTime;
|
|
52
|
+
debounce: (<T_1 extends (...args: any) => any>(func: T_1, wait: number, options: import("./util/time").DebounceSettingsLeading) => import("./util/time").DebouncedFuncLeading<T_1>) | (<T_2 extends (...args: any) => any>(func: T_2, wait?: number, options?: import("./util/time").DebounceSettings) => import("./util/time").DebouncedFunc<T_2>);
|
|
52
53
|
};
|
|
53
54
|
map: {
|
|
54
55
|
DEFAULT_MAPS: {
|
|
55
56
|
name: string;
|
|
56
57
|
brName: string;
|
|
57
|
-
}[];
|
|
58
|
+
}[];
|
|
58
59
|
brn2n: typeof import("./util/map").brn2n;
|
|
59
60
|
n2brn: typeof import("./util/map").n2brn;
|
|
60
|
-
};
|
|
61
|
+
}; /**
|
|
62
|
+
* Get player's permissions in a map like `{"Bricks.ClearOwn": true, ...}`
|
|
63
|
+
* @return permissions map
|
|
64
|
+
*/
|
|
61
65
|
brick: {
|
|
62
66
|
BRICK_CONSTANTS: {
|
|
63
67
|
rotationTable: number[];
|
|
@@ -89,11 +93,15 @@ export declare const _OMEGGA_UTILS_IMPORT: {
|
|
|
89
93
|
}): Uint8Array;
|
|
90
94
|
utils: any;
|
|
91
95
|
constants: {
|
|
92
|
-
|
|
96
|
+
/**
|
|
93
97
|
* True if the player is the host
|
|
94
98
|
*/
|
|
99
|
+
MAGIC: Uint8Array;
|
|
95
100
|
LATEST_VERSION: number;
|
|
96
|
-
MAX_INT: number;
|
|
101
|
+
MAX_INT: number; /**
|
|
102
|
+
* Clear player's bricks
|
|
103
|
+
* @param quiet clear bricks quietly
|
|
104
|
+
*/
|
|
97
105
|
DEFAULT_UUID: string;
|
|
98
106
|
};
|
|
99
107
|
};
|
package/dist/util/index.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ import { parseDuration, parseBrickadiaTime } from './time';
|
|
|
46
46
|
declare const time: {
|
|
47
47
|
parseDuration: typeof parseDuration;
|
|
48
48
|
parseBrickadiaTime: typeof parseBrickadiaTime;
|
|
49
|
+
debounce: (<T extends (...args: any) => any>(func: T, wait: number, options: import("./time").DebounceSettingsLeading) => import("./time").DebouncedFuncLeading<T>) | (<T_1 extends (...args: any) => any>(func: T_1, wait?: number, options?: import("./time").DebounceSettings) => import("./time").DebouncedFunc<T_1>);
|
|
49
50
|
};
|
|
50
51
|
import { brn2n, n2brn } from './map';
|
|
51
52
|
declare const map: {
|
|
@@ -128,6 +129,7 @@ declare const _default: {
|
|
|
128
129
|
time: {
|
|
129
130
|
parseDuration: typeof parseDuration;
|
|
130
131
|
parseBrickadiaTime: typeof parseBrickadiaTime;
|
|
132
|
+
debounce: (<T_1 extends (...args: any) => any>(func: T_1, wait: number, options: import("./time").DebounceSettingsLeading) => import("./time").DebouncedFuncLeading<T_1>) | (<T_2 extends (...args: any) => any>(func: T_2, wait?: number, options?: import("./time").DebounceSettings) => import("./time").DebouncedFunc<T_2>);
|
|
131
133
|
};
|
|
132
134
|
map: {
|
|
133
135
|
DEFAULT_MAPS: {
|
package/dist/util/index.js
CHANGED
|
@@ -69,7 +69,7 @@ const pattern = { explode: pattern_1.explode };
|
|
|
69
69
|
exports.pattern = pattern;
|
|
70
70
|
// time parsing utils
|
|
71
71
|
const time_1 = require("./time");
|
|
72
|
-
const time = { parseDuration: time_1.parseDuration, parseBrickadiaTime: time_1.parseBrickadiaTime };
|
|
72
|
+
const time = { parseDuration: time_1.parseDuration, parseBrickadiaTime: time_1.parseBrickadiaTime, debounce: time_1.debounce };
|
|
73
73
|
exports.time = time;
|
|
74
74
|
// map parsing utils
|
|
75
75
|
const map_1 = require("./map");
|
package/dist/util/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/util/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2BAA2B;AAC3B,iCAwBgB;AAChB,MAAM,IAAI,GAAG;IACX,MAAM,EAAN,aAAM;IACN,QAAQ,EAAR,eAAQ;IACR,UAAU,EAAV,iBAAU;IACV,IAAI,EAAJ,WAAI;IACJ,SAAS,EAAT,gBAAS;IACT,KAAK,EAAE,YAAS;IAChB,IAAI,EAAJ,WAAI;IACJ,MAAM,EAAN,aAAM;IACN,SAAS,EAAT,gBAAS;IACT,KAAK,EAAL,YAAK;IACL,IAAI,EAAJ,WAAI;IACJ,IAAI,EAAJ,WAAI;IACJ,IAAI,EAAJ,WAAI;IACJ,IAAI,EAAJ,WAAI;IACJ,GAAG,EAAH,UAAG;IACH,KAAK,EAAL,YAAK;IACL,IAAI,EAAJ,WAAI;IACJ,MAAM,EAAN,aAAM;IACN,IAAI,EAAJ,WAAI;IACJ,OAAO,EAAP,cAAO;IACP,KAAK,EAAL,YAAK;IACL,KAAK,EAAL,YAAK;IACL,IAAI,EAAJ,WAAI;CACL,CAAC;AAmFO,oBAAI;AAjFb,oCAAoC;AACpC,mCAA2E;AAC3E,MAAM,KAAK,GAAG,EAAE,GAAG,EAAH,WAAG,EAAE,SAAS,EAAT,iBAAS,EAAE,IAAI,EAAJ,YAAI,EAAE,QAAQ,EAAR,gBAAQ,EAAE,gBAAgB,EAAhB,wBAAgB,EAAE,CAAC;AA+EpD,sBAAK;AA7EpB,aAAa;AACb,iCAA6C;AAC7C,MAAM,IAAI,GAAG,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1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export interface DebouncedFunc<T extends (...args: any[]) => any> {
|
|
2
|
+
/**
|
|
3
|
+
* Call the original function, but applying the debounce rules.
|
|
4
|
+
*
|
|
5
|
+
* If the debounced function can be run immediately, this calls it and returns its return
|
|
6
|
+
* value.
|
|
7
|
+
*
|
|
8
|
+
* Otherwise, it returns the return value of the last invocation, or undefined if the debounced
|
|
9
|
+
* function was not invoked yet.
|
|
10
|
+
*/
|
|
11
|
+
(...args: Parameters<T>): ReturnType<T> | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Throw away any pending invocation of the debounced function.
|
|
14
|
+
*/
|
|
15
|
+
cancel(): void;
|
|
16
|
+
/**
|
|
17
|
+
* If there is a pending invocation of the debounced function, invoke it immediately and return
|
|
18
|
+
* its return value.
|
|
19
|
+
*
|
|
20
|
+
* Otherwise, return the value from the last invocation, or undefined if the debounced function
|
|
21
|
+
* was never invoked.
|
|
22
|
+
*/
|
|
23
|
+
flush(): ReturnType<T> | undefined;
|
|
24
|
+
}
|
|
25
|
+
export interface DebouncedFuncLeading<T extends (...args: any[]) => any> extends DebouncedFunc<T> {
|
|
26
|
+
(...args: Parameters<T>): ReturnType<T>;
|
|
27
|
+
flush(): ReturnType<T>;
|
|
28
|
+
}
|
|
29
|
+
export interface DebounceSettings {
|
|
30
|
+
leading?: boolean | undefined;
|
|
31
|
+
maxWait?: number | undefined;
|
|
32
|
+
trailing?: boolean | undefined;
|
|
33
|
+
}
|
|
34
|
+
export interface DebounceSettingsLeading extends DebounceSettings {
|
|
35
|
+
leading: true;
|
|
36
|
+
}
|
|
37
|
+
export declare const debounce: (<T extends (...args: any) => any>(func: T, wait: number | undefined, options: DebounceSettingsLeading) => DebouncedFuncLeading<T>) | (<T extends (...args: any) => any>(func: T, wait?: number, options?: DebounceSettings) => DebouncedFunc<T>);
|
|
3
38
|
export declare function parseDuration(str: string): number;
|
|
4
39
|
export declare function parseBrickadiaTime(str: string): number;
|
package/dist/util/time.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time.js","sourceRoot":"","sources":["../../src/util/time.ts"],"names":[],"mappings":";;;;;;AAAA,+
|
|
1
|
+
{"version":3,"file":"time.js","sourceRoot":"","sources":["../../src/util/time.ts"],"names":[],"mappings":";;;;;;AAAA,+DAAwC;AAyC3B,QAAA,QAAQ,GAUQ,kBAAS,CAAC;AAEvC,MAAM,eAAe,GAA2B;IAC9C,EAAE,EAAE,CAAC;IACL,CAAC,EAAE,IAAI;IACP,CAAC,EAAE,EAAE,GAAG,IAAI;IACZ,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI;IACjB,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IACtB,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,QAAQ;CACrC,CAAC;AAEF,sDAAsD;AACtD,SAAgB,aAAa,CAAC,GAAW;IACvC,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,+CAA+C;IAC/C,MAAM,MAAM,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAE9B,mBAAmB;IACnB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;QAC1B,+CAA+C;QAC/C,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;QAE7D,wBAAwB;QACxB,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC;YAAE,SAAS;QAE3D,sCAAsC;QACtC,KAAK,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;KACnD;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAnBD,sCAmBC;AAED,yEAAyE;AACzE,SAAgB,kBAAkB,CAAC,GAAW;IAC5C,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACpC,OAAO,IAAI,IAAI,CACb,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAC1D,CAAC,OAAO,EAAE,CAAC;AACd,CAAC;AALD,gDAKC"}
|
package/package.json
CHANGED
|
@@ -414,6 +414,42 @@ declare function hsv(h: number | {
|
|
|
414
414
|
s: number;
|
|
415
415
|
v: number;
|
|
416
416
|
}, s?: number, v?: number): number[];
|
|
417
|
+
export interface DebouncedFunc<T extends (...args: any[]) => any> {
|
|
418
|
+
/**
|
|
419
|
+
* Call the original function, but applying the debounce rules.
|
|
420
|
+
*
|
|
421
|
+
* If the debounced function can be run immediately, this calls it and returns its return
|
|
422
|
+
* value.
|
|
423
|
+
*
|
|
424
|
+
* Otherwise, it returns the return value of the last invocation, or undefined if the debounced
|
|
425
|
+
* function was not invoked yet.
|
|
426
|
+
*/
|
|
427
|
+
(...args: Parameters<T>): ReturnType<T> | undefined;
|
|
428
|
+
/**
|
|
429
|
+
* Throw away any pending invocation of the debounced function.
|
|
430
|
+
*/
|
|
431
|
+
cancel(): void;
|
|
432
|
+
/**
|
|
433
|
+
* If there is a pending invocation of the debounced function, invoke it immediately and return
|
|
434
|
+
* its return value.
|
|
435
|
+
*
|
|
436
|
+
* Otherwise, return the value from the last invocation, or undefined if the debounced function
|
|
437
|
+
* was never invoked.
|
|
438
|
+
*/
|
|
439
|
+
flush(): ReturnType<T> | undefined;
|
|
440
|
+
}
|
|
441
|
+
export interface DebouncedFuncLeading<T extends (...args: any[]) => any> extends DebouncedFunc<T> {
|
|
442
|
+
(...args: Parameters<T>): ReturnType<T>;
|
|
443
|
+
flush(): ReturnType<T>;
|
|
444
|
+
}
|
|
445
|
+
export interface DebounceSettings {
|
|
446
|
+
leading?: boolean | undefined;
|
|
447
|
+
maxWait?: number | undefined;
|
|
448
|
+
trailing?: boolean | undefined;
|
|
449
|
+
}
|
|
450
|
+
export interface DebounceSettingsLeading extends DebounceSettings {
|
|
451
|
+
leading: true;
|
|
452
|
+
}
|
|
417
453
|
declare function parseDuration(str: string): number;
|
|
418
454
|
declare function parseBrickadiaTime(str: string): number;
|
|
419
455
|
declare function brn2n(brName: string): string;
|
|
@@ -493,15 +529,19 @@ export declare const _OMEGGA_UTILS_IMPORT: {
|
|
|
493
529
|
time: {
|
|
494
530
|
parseDuration: typeof parseDuration;
|
|
495
531
|
parseBrickadiaTime: typeof parseBrickadiaTime;
|
|
532
|
+
debounce: (<T_1 extends (...args: any) => any>(func: T_1, wait: number, options: DebounceSettingsLeading) => DebouncedFuncLeading<T_1>) | (<T_2 extends (...args: any) => any>(func: T_2, wait?: number, options?: DebounceSettings) => DebouncedFunc<T_2>);
|
|
496
533
|
};
|
|
497
534
|
map: {
|
|
498
535
|
DEFAULT_MAPS: {
|
|
499
536
|
name: string;
|
|
500
537
|
brName: string;
|
|
501
|
-
}[];
|
|
538
|
+
}[];
|
|
502
539
|
brn2n: typeof brn2n;
|
|
503
540
|
n2brn: typeof n2brn;
|
|
504
|
-
};
|
|
541
|
+
}; /**
|
|
542
|
+
* Get player's permissions in a map like `{"Bricks.ClearOwn": true, ...}`
|
|
543
|
+
* @return permissions map
|
|
544
|
+
*/
|
|
505
545
|
brick: {
|
|
506
546
|
BRICK_CONSTANTS: {
|
|
507
547
|
rotationTable: number[];
|
|
@@ -548,11 +588,15 @@ export declare const _OMEGGA_UTILS_IMPORT: {
|
|
|
548
588
|
}): Uint8Array;
|
|
549
589
|
utils: any;
|
|
550
590
|
constants: {
|
|
551
|
-
|
|
591
|
+
/**
|
|
552
592
|
* True if the player is the host
|
|
553
593
|
*/
|
|
594
|
+
MAGIC: Uint8Array;
|
|
554
595
|
LATEST_VERSION: number;
|
|
555
|
-
MAX_INT: number;
|
|
596
|
+
MAX_INT: number; /**
|
|
597
|
+
* Clear player's bricks
|
|
598
|
+
* @param quiet clear bricks quietly
|
|
599
|
+
*/
|
|
556
600
|
DEFAULT_UUID: string;
|
|
557
601
|
};
|
|
558
602
|
};
|