@gsc-basic/functions 1.0.9 → 1.1.0
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/index.cjs +1 -1
- package/dist/index.d.cts +87 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export { clearInterval as clearWorkerInterval, clearTimeout as clearWorkerTimeout, setInterval as setWorkerInterval, setTimeout as setWorkerTimeout } from 'worker-timers';
|
|
2
|
+
export { SolarDay } from 'tyme4ts';
|
|
3
|
+
|
|
4
|
+
interface DayOptions {
|
|
5
|
+
advance?: number;
|
|
6
|
+
delayed?: number;
|
|
7
|
+
interval?: number;
|
|
8
|
+
immediate?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const getTerm: (options?: DayOptions) => (string | undefined)[];
|
|
11
|
+
declare const getFestival: (options?: DayOptions) => string[];
|
|
12
|
+
declare const setFestivalListener: (name: string, listener: () => void, options?: DayOptions) => () => void;
|
|
13
|
+
declare const setTermListener: (name: string, listener: () => void, options?: DayOptions) => () => void;
|
|
14
|
+
declare const setSpecificDayListener: (date: string, listener: () => void, options?: DayOptions) => () => void;
|
|
15
|
+
|
|
16
|
+
interface HighlightStyle {
|
|
17
|
+
[key: string]: string | number | undefined;
|
|
18
|
+
}
|
|
19
|
+
interface HighlightKeywordOption {
|
|
20
|
+
keyword: string | RegExp;
|
|
21
|
+
color?: string;
|
|
22
|
+
bgColor?: string;
|
|
23
|
+
style?: HighlightStyle;
|
|
24
|
+
tagName?: string;
|
|
25
|
+
caseSensitive?: boolean;
|
|
26
|
+
renderHighlightKeyword?: (content: string) => string;
|
|
27
|
+
}
|
|
28
|
+
type HighlightKeyword = string | HighlightKeywordOption;
|
|
29
|
+
interface HighlightSegment {
|
|
30
|
+
start: number;
|
|
31
|
+
end: number;
|
|
32
|
+
option?: HighlightKeywordOption;
|
|
33
|
+
subString?: string;
|
|
34
|
+
}
|
|
35
|
+
interface HighlightHtmlResult {
|
|
36
|
+
highText: string;
|
|
37
|
+
highList: HighlightSegment[];
|
|
38
|
+
}
|
|
39
|
+
declare const highlightHtml: (content: string, keywords: HighlightKeyword[]) => HighlightHtmlResult;
|
|
40
|
+
|
|
41
|
+
declare const STATUS_ACTIVE: "active";
|
|
42
|
+
declare const STATUS_IDLE: "idle";
|
|
43
|
+
declare const STATUS_HIDDEN: "hidden";
|
|
44
|
+
type ActivityStatus = typeof STATUS_ACTIVE | typeof STATUS_IDLE | typeof STATUS_HIDDEN;
|
|
45
|
+
type EventCallback = (...args: any[]) => void;
|
|
46
|
+
interface IdleInfo {
|
|
47
|
+
isIdle: boolean;
|
|
48
|
+
idleFor: number;
|
|
49
|
+
timeLeft: number;
|
|
50
|
+
timeLeftPer: number;
|
|
51
|
+
}
|
|
52
|
+
declare class Timer {
|
|
53
|
+
private readonly activity;
|
|
54
|
+
private readonly seconds;
|
|
55
|
+
private readonly callback;
|
|
56
|
+
private token?;
|
|
57
|
+
private stopped;
|
|
58
|
+
constructor(activity: IfActivity, seconds: number, callback: () => void);
|
|
59
|
+
start(): void;
|
|
60
|
+
stop(): void;
|
|
61
|
+
resume(): void;
|
|
62
|
+
pause(): void;
|
|
63
|
+
}
|
|
64
|
+
declare class IfActivity {
|
|
65
|
+
private status;
|
|
66
|
+
private timers;
|
|
67
|
+
private idleTime;
|
|
68
|
+
private idleStartedTime;
|
|
69
|
+
private isLegacyModeOn;
|
|
70
|
+
constructor();
|
|
71
|
+
legacyMode(): void;
|
|
72
|
+
startIdleTimer(event?: Event): void;
|
|
73
|
+
trackIdleStatus(): void;
|
|
74
|
+
on(event: string, callback: EventCallback): this;
|
|
75
|
+
off(event: string, callback?: EventCallback): this;
|
|
76
|
+
setIdleDuration(seconds: number): this;
|
|
77
|
+
getIdleDuration(): number;
|
|
78
|
+
getIdleInfo(): IdleInfo;
|
|
79
|
+
idle(callback?: EventCallback): this;
|
|
80
|
+
blur(callback?: EventCallback): this;
|
|
81
|
+
focus(callback?: EventCallback): this;
|
|
82
|
+
wakeUp(callback?: EventCallback): this;
|
|
83
|
+
onEvery(seconds: number, callback: () => void): Timer;
|
|
84
|
+
now(check?: ActivityStatus): boolean;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export { type DayOptions, type HighlightHtmlResult, type HighlightKeyword, type HighlightKeywordOption, IfActivity, getFestival, getTerm, highlightHtml, setFestivalListener, setSpecificDayListener, setTermListener };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export { clearInterval as clearWorkerInterval, clearTimeout as clearWorkerTimeout, setInterval as setWorkerInterval, setTimeout as setWorkerTimeout } from 'worker-timers';
|
|
2
|
+
export { SolarDay } from 'tyme4ts';
|
|
3
|
+
|
|
4
|
+
interface DayOptions {
|
|
5
|
+
advance?: number;
|
|
6
|
+
delayed?: number;
|
|
7
|
+
interval?: number;
|
|
8
|
+
immediate?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const getTerm: (options?: DayOptions) => (string | undefined)[];
|
|
11
|
+
declare const getFestival: (options?: DayOptions) => string[];
|
|
12
|
+
declare const setFestivalListener: (name: string, listener: () => void, options?: DayOptions) => () => void;
|
|
13
|
+
declare const setTermListener: (name: string, listener: () => void, options?: DayOptions) => () => void;
|
|
14
|
+
declare const setSpecificDayListener: (date: string, listener: () => void, options?: DayOptions) => () => void;
|
|
15
|
+
|
|
16
|
+
interface HighlightStyle {
|
|
17
|
+
[key: string]: string | number | undefined;
|
|
18
|
+
}
|
|
19
|
+
interface HighlightKeywordOption {
|
|
20
|
+
keyword: string | RegExp;
|
|
21
|
+
color?: string;
|
|
22
|
+
bgColor?: string;
|
|
23
|
+
style?: HighlightStyle;
|
|
24
|
+
tagName?: string;
|
|
25
|
+
caseSensitive?: boolean;
|
|
26
|
+
renderHighlightKeyword?: (content: string) => string;
|
|
27
|
+
}
|
|
28
|
+
type HighlightKeyword = string | HighlightKeywordOption;
|
|
29
|
+
interface HighlightSegment {
|
|
30
|
+
start: number;
|
|
31
|
+
end: number;
|
|
32
|
+
option?: HighlightKeywordOption;
|
|
33
|
+
subString?: string;
|
|
34
|
+
}
|
|
35
|
+
interface HighlightHtmlResult {
|
|
36
|
+
highText: string;
|
|
37
|
+
highList: HighlightSegment[];
|
|
38
|
+
}
|
|
39
|
+
declare const highlightHtml: (content: string, keywords: HighlightKeyword[]) => HighlightHtmlResult;
|
|
40
|
+
|
|
41
|
+
declare const STATUS_ACTIVE: "active";
|
|
42
|
+
declare const STATUS_IDLE: "idle";
|
|
43
|
+
declare const STATUS_HIDDEN: "hidden";
|
|
44
|
+
type ActivityStatus = typeof STATUS_ACTIVE | typeof STATUS_IDLE | typeof STATUS_HIDDEN;
|
|
45
|
+
type EventCallback = (...args: any[]) => void;
|
|
46
|
+
interface IdleInfo {
|
|
47
|
+
isIdle: boolean;
|
|
48
|
+
idleFor: number;
|
|
49
|
+
timeLeft: number;
|
|
50
|
+
timeLeftPer: number;
|
|
51
|
+
}
|
|
52
|
+
declare class Timer {
|
|
53
|
+
private readonly activity;
|
|
54
|
+
private readonly seconds;
|
|
55
|
+
private readonly callback;
|
|
56
|
+
private token?;
|
|
57
|
+
private stopped;
|
|
58
|
+
constructor(activity: IfActivity, seconds: number, callback: () => void);
|
|
59
|
+
start(): void;
|
|
60
|
+
stop(): void;
|
|
61
|
+
resume(): void;
|
|
62
|
+
pause(): void;
|
|
63
|
+
}
|
|
64
|
+
declare class IfActivity {
|
|
65
|
+
private status;
|
|
66
|
+
private timers;
|
|
67
|
+
private idleTime;
|
|
68
|
+
private idleStartedTime;
|
|
69
|
+
private isLegacyModeOn;
|
|
70
|
+
constructor();
|
|
71
|
+
legacyMode(): void;
|
|
72
|
+
startIdleTimer(event?: Event): void;
|
|
73
|
+
trackIdleStatus(): void;
|
|
74
|
+
on(event: string, callback: EventCallback): this;
|
|
75
|
+
off(event: string, callback?: EventCallback): this;
|
|
76
|
+
setIdleDuration(seconds: number): this;
|
|
77
|
+
getIdleDuration(): number;
|
|
78
|
+
getIdleInfo(): IdleInfo;
|
|
79
|
+
idle(callback?: EventCallback): this;
|
|
80
|
+
blur(callback?: EventCallback): this;
|
|
81
|
+
focus(callback?: EventCallback): this;
|
|
82
|
+
wakeUp(callback?: EventCallback): this;
|
|
83
|
+
onEvery(seconds: number, callback: () => void): Timer;
|
|
84
|
+
now(check?: ActivityStatus): boolean;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export { type DayOptions, type HighlightHtmlResult, type HighlightKeyword, type HighlightKeywordOption, IfActivity, getFestival, getTerm, highlightHtml, setFestivalListener, setSpecificDayListener, setTermListener };
|