@vnejs/contracts.text 0.1.1
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/const.d.ts +19 -0
- package/dist/const.js +13 -0
- package/dist/events.d.ts +18 -0
- package/dist/events.js +17 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.js +12 -0
- package/dist/module-global-state.d.ts +35 -0
- package/dist/module-global-state.js +1 -0
- package/dist/params.d.ts +19 -0
- package/dist/params.js +12 -0
- package/dist/payloads.d.ts +8 -0
- package/dist/payloads.js +1 -0
- package/dist/settings.d.ts +4 -0
- package/dist/settings.js +3 -0
- package/package.json +36 -0
- package/src/const.ts +18 -0
- package/src/events.ts +26 -0
- package/src/index.ts +68 -0
- package/src/module-global-state.ts +41 -0
- package/src/params.ts +25 -0
- package/src/payloads.ts +9 -0
- package/src/settings.ts +5 -0
- package/tsconfig.json +9 -0
package/dist/const.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const SOURCE: "text";
|
|
2
|
+
export declare const INTERACT_STATES: {
|
|
3
|
+
readonly EMPTY: "empty";
|
|
4
|
+
readonly RENDERING: "rendering";
|
|
5
|
+
readonly SHOWED: "showed";
|
|
6
|
+
readonly NEXT: "next";
|
|
7
|
+
};
|
|
8
|
+
export declare const BIG_TOKENS_VISIBLE_VALUE: 99999999;
|
|
9
|
+
export declare const CONSTANTS: {
|
|
10
|
+
readonly SOURCE: "text";
|
|
11
|
+
readonly INTERACT_STATES: {
|
|
12
|
+
readonly EMPTY: "empty";
|
|
13
|
+
readonly RENDERING: "rendering";
|
|
14
|
+
readonly SHOWED: "showed";
|
|
15
|
+
readonly NEXT: "next";
|
|
16
|
+
};
|
|
17
|
+
readonly BIG_TOKENS_VISIBLE_VALUE: 99999999;
|
|
18
|
+
};
|
|
19
|
+
export type Constants = typeof CONSTANTS;
|
package/dist/const.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const SOURCE = "text";
|
|
2
|
+
export const INTERACT_STATES = {
|
|
3
|
+
EMPTY: "empty",
|
|
4
|
+
RENDERING: "rendering",
|
|
5
|
+
SHOWED: "showed",
|
|
6
|
+
NEXT: "next",
|
|
7
|
+
};
|
|
8
|
+
export const BIG_TOKENS_VISIBLE_VALUE = 99999999;
|
|
9
|
+
export const CONSTANTS = {
|
|
10
|
+
SOURCE,
|
|
11
|
+
INTERACT_STATES,
|
|
12
|
+
BIG_TOKENS_VISIBLE_VALUE,
|
|
13
|
+
};
|
package/dist/events.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const SUBSCRIBE_EVENTS: {
|
|
2
|
+
readonly EMIT: "vne:text:emit";
|
|
3
|
+
readonly EMIT_END: "vne:text:emit_end";
|
|
4
|
+
readonly EMIT_BEFORE: "vne:text:emit_before";
|
|
5
|
+
readonly CICLE: "vne:text:cicle";
|
|
6
|
+
readonly INTERACT: "vne:text:interact";
|
|
7
|
+
readonly CHANGED: "vne:text:changed";
|
|
8
|
+
readonly MEET: "vne:text:meet";
|
|
9
|
+
readonly SPEAKER: "vne:text:speaker";
|
|
10
|
+
readonly SPEAKER_CHANGED: "vne:text:speaker_changed";
|
|
11
|
+
readonly STATE_UPDATE: "vne:text:state_update";
|
|
12
|
+
readonly STATE_CHANGED: "vne:text:state_changed";
|
|
13
|
+
readonly RECALC: "vne:text:recalc";
|
|
14
|
+
readonly REPLACE: "vne:text:replace";
|
|
15
|
+
readonly REPLACE_REG: "vne:text:replace_reg";
|
|
16
|
+
readonly INJECT_REG: "vne:text:inject_reg";
|
|
17
|
+
};
|
|
18
|
+
export type SubscribeEvents = typeof SUBSCRIBE_EVENTS;
|
package/dist/events.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const SUBSCRIBE_EVENTS = {
|
|
2
|
+
EMIT: "vne:text:emit",
|
|
3
|
+
EMIT_END: "vne:text:emit_end",
|
|
4
|
+
EMIT_BEFORE: "vne:text:emit_before",
|
|
5
|
+
CICLE: "vne:text:cicle",
|
|
6
|
+
INTERACT: "vne:text:interact",
|
|
7
|
+
CHANGED: "vne:text:changed",
|
|
8
|
+
MEET: "vne:text:meet",
|
|
9
|
+
SPEAKER: "vne:text:speaker",
|
|
10
|
+
SPEAKER_CHANGED: "vne:text:speaker_changed",
|
|
11
|
+
STATE_UPDATE: "vne:text:state_update",
|
|
12
|
+
STATE_CHANGED: "vne:text:state_changed",
|
|
13
|
+
RECALC: "vne:text:recalc",
|
|
14
|
+
REPLACE: "vne:text:replace",
|
|
15
|
+
REPLACE_REG: "vne:text:replace_reg",
|
|
16
|
+
INJECT_REG: "vne:text:inject_reg",
|
|
17
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import "@vnejs/module";
|
|
2
|
+
import "@vnejs/contracts.core.settings";
|
|
3
|
+
import "@vnejs/shared";
|
|
4
|
+
import { CONSTANTS } from "./const.js";
|
|
5
|
+
import { SUBSCRIBE_EVENTS } from "./events.js";
|
|
6
|
+
import type { ModuleGlobalStateText, ModuleGlobalStateTextMeet, ModuleGlobalStateTextSpeaker, ModuleGlobalStateTextWall } from "./module-global-state.js";
|
|
7
|
+
import { PARAMS } from "./params.js";
|
|
8
|
+
import { SETTINGS_KEYS } from "./settings.js";
|
|
9
|
+
export type { TextEmitPayload } from "./payloads.js";
|
|
10
|
+
export type { ModuleGlobalStateText, ModuleGlobalStateTextMeet, ModuleGlobalStateTextSpeaker, ModuleGlobalStateTextWall, TextItem, TokenizedChar, WallElement, } from "./module-global-state.js";
|
|
11
|
+
export declare const PLUGIN_NAME: "TEXT";
|
|
12
|
+
export type PluginName = typeof PLUGIN_NAME;
|
|
13
|
+
export { CONSTANTS };
|
|
14
|
+
export type { Constants } from "./const.js";
|
|
15
|
+
export { SUBSCRIBE_EVENTS };
|
|
16
|
+
export type { SubscribeEvents } from "./events.js";
|
|
17
|
+
export { PARAMS };
|
|
18
|
+
export type { Params, TextSpeakerInfo, TextSpeakersInfo } from "./params.js";
|
|
19
|
+
export { SETTINGS_KEYS };
|
|
20
|
+
export type { SettingsKeys } from "./settings.js";
|
|
21
|
+
type TextTokenRenderSpeedSettingKey = (typeof SETTINGS_KEYS)["TOKEN_RENDER_SPEED"];
|
|
22
|
+
declare module "@vnejs/module" {
|
|
23
|
+
interface ModuleShared {
|
|
24
|
+
textNoAnimationSources: string[];
|
|
25
|
+
isTextAnimationInProcess: boolean;
|
|
26
|
+
}
|
|
27
|
+
interface ModuleGlobalState {
|
|
28
|
+
text: ModuleGlobalStateText;
|
|
29
|
+
"text.wall": ModuleGlobalStateTextWall;
|
|
30
|
+
"text.meet": ModuleGlobalStateTextMeet;
|
|
31
|
+
"text.speaker": ModuleGlobalStateTextSpeaker;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
declare module "@vnejs/contracts.core.settings" {
|
|
35
|
+
interface ModuleSharedSettings extends Record<TextTokenRenderSpeedSettingKey, number> {
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
declare module "@vnejs/shared" {
|
|
39
|
+
interface VnePluginEventsMap extends Record<typeof PLUGIN_NAME, typeof SUBSCRIBE_EVENTS> {
|
|
40
|
+
}
|
|
41
|
+
interface VnePluginConstantsMap extends Record<typeof PLUGIN_NAME, typeof CONSTANTS> {
|
|
42
|
+
}
|
|
43
|
+
interface VnePluginParamsMap extends Record<typeof PLUGIN_NAME, typeof PARAMS> {
|
|
44
|
+
}
|
|
45
|
+
interface VnePluginSettingsMap extends Record<typeof PLUGIN_NAME, typeof SETTINGS_KEYS> {
|
|
46
|
+
}
|
|
47
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "@vnejs/module";
|
|
2
|
+
import "@vnejs/contracts.core.settings";
|
|
3
|
+
import "@vnejs/shared";
|
|
4
|
+
import { CONSTANTS } from "./const.js";
|
|
5
|
+
import { SUBSCRIBE_EVENTS } from "./events.js";
|
|
6
|
+
import { PARAMS } from "./params.js";
|
|
7
|
+
import { SETTINGS_KEYS } from "./settings.js";
|
|
8
|
+
export const PLUGIN_NAME = "TEXT";
|
|
9
|
+
export { CONSTANTS };
|
|
10
|
+
export { SUBSCRIBE_EVENTS };
|
|
11
|
+
export { PARAMS };
|
|
12
|
+
export { SETTINGS_KEYS };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type TextItem = {
|
|
2
|
+
text: string;
|
|
3
|
+
args: Record<string, unknown>;
|
|
4
|
+
};
|
|
5
|
+
export type TokenizedChar = {
|
|
6
|
+
token: string;
|
|
7
|
+
marks: string[];
|
|
8
|
+
};
|
|
9
|
+
export type ModuleGlobalStateText = {
|
|
10
|
+
tokensVisible: number;
|
|
11
|
+
uid: string;
|
|
12
|
+
texts: TextItem[];
|
|
13
|
+
tokens: TokenizedChar[];
|
|
14
|
+
wall: unknown[];
|
|
15
|
+
speaker: string;
|
|
16
|
+
meet: number;
|
|
17
|
+
};
|
|
18
|
+
export type WallElement = {
|
|
19
|
+
texts: TextItem[];
|
|
20
|
+
tokens: TokenizedChar[];
|
|
21
|
+
uid: string;
|
|
22
|
+
speaker: string;
|
|
23
|
+
meet: number;
|
|
24
|
+
};
|
|
25
|
+
export type ModuleGlobalStateTextWall = {
|
|
26
|
+
wall: WallElement[];
|
|
27
|
+
isStarted: boolean;
|
|
28
|
+
shouldSkip: boolean;
|
|
29
|
+
};
|
|
30
|
+
export type ModuleGlobalStateTextMeet = Record<string, number>;
|
|
31
|
+
export type ModuleGlobalStateTextSpeaker = {
|
|
32
|
+
speaker: string;
|
|
33
|
+
meet: number;
|
|
34
|
+
args: Record<string, unknown>;
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/params.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Widen } from "@vnejs/shared";
|
|
2
|
+
export type TextSpeakerInfo = {
|
|
3
|
+
color?: string;
|
|
4
|
+
opacity?: number;
|
|
5
|
+
speakerColor?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const DEFAULT_TOKEN_RENDER_SPEED: number;
|
|
8
|
+
export declare const TOKEN_RENDER_DELAY: number;
|
|
9
|
+
export declare const DEFAULT_SPEAKER_NAME: "default";
|
|
10
|
+
export type TextSpeakersInfo = Record<string, TextSpeakerInfo | undefined> & Record<typeof DEFAULT_SPEAKER_NAME, {}>;
|
|
11
|
+
declare const PARAMS_DEFAULT: {
|
|
12
|
+
DEFAULT_TOKEN_RENDER_SPEED: number;
|
|
13
|
+
TOKEN_RENDER_DELAY: number;
|
|
14
|
+
DEFAULT_SPEAKER_NAME: "default";
|
|
15
|
+
SPEAKERS_INFO: TextSpeakersInfo;
|
|
16
|
+
};
|
|
17
|
+
export type Params = Widen<typeof PARAMS_DEFAULT>;
|
|
18
|
+
export declare const PARAMS: Params;
|
|
19
|
+
export {};
|
package/dist/params.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const DEFAULT_TOKEN_RENDER_SPEED = 1;
|
|
2
|
+
export const TOKEN_RENDER_DELAY = 16;
|
|
3
|
+
export const DEFAULT_SPEAKER_NAME = "default";
|
|
4
|
+
const PARAMS_DEFAULT = {
|
|
5
|
+
DEFAULT_TOKEN_RENDER_SPEED,
|
|
6
|
+
TOKEN_RENDER_DELAY,
|
|
7
|
+
DEFAULT_SPEAKER_NAME,
|
|
8
|
+
SPEAKERS_INFO: {
|
|
9
|
+
[DEFAULT_SPEAKER_NAME]: {},
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
export const PARAMS = PARAMS_DEFAULT;
|
package/dist/payloads.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/settings.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vnejs/contracts.text",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Contracts for @vnejs/plugins.text",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"require": "./dist/index.js",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"src",
|
|
18
|
+
"tsconfig.json"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "npx @vnejs/monorepo package",
|
|
22
|
+
"publish:major": "npx @vnejs/monorepo publish major --access public",
|
|
23
|
+
"publish:minor": "npx @vnejs/monorepo publish minor --access public",
|
|
24
|
+
"publish:patch": "npx @vnejs/monorepo publish patch --access public"
|
|
25
|
+
},
|
|
26
|
+
"author": "",
|
|
27
|
+
"license": "ISC",
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"@vnejs/module": "~0.1.0",
|
|
30
|
+
"@vnejs/contracts.core.settings": "~0.1.0",
|
|
31
|
+
"@vnejs/shared": "~0.1.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@vnejs/configs.ts-common": "~0.1.0"
|
|
35
|
+
}
|
|
36
|
+
}
|
package/src/const.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const SOURCE = "text" as const;
|
|
2
|
+
|
|
3
|
+
export const INTERACT_STATES = {
|
|
4
|
+
EMPTY: "empty",
|
|
5
|
+
RENDERING: "rendering",
|
|
6
|
+
SHOWED: "showed",
|
|
7
|
+
NEXT: "next",
|
|
8
|
+
} as const;
|
|
9
|
+
|
|
10
|
+
export const BIG_TOKENS_VISIBLE_VALUE = 99999999 as const;
|
|
11
|
+
|
|
12
|
+
export const CONSTANTS = {
|
|
13
|
+
SOURCE,
|
|
14
|
+
INTERACT_STATES,
|
|
15
|
+
BIG_TOKENS_VISIBLE_VALUE,
|
|
16
|
+
} as const;
|
|
17
|
+
|
|
18
|
+
export type Constants = typeof CONSTANTS;
|
package/src/events.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const SUBSCRIBE_EVENTS = {
|
|
2
|
+
EMIT: "vne:text:emit",
|
|
3
|
+
EMIT_END: "vne:text:emit_end",
|
|
4
|
+
EMIT_BEFORE: "vne:text:emit_before",
|
|
5
|
+
|
|
6
|
+
CICLE: "vne:text:cicle",
|
|
7
|
+
INTERACT: "vne:text:interact",
|
|
8
|
+
CHANGED: "vne:text:changed",
|
|
9
|
+
|
|
10
|
+
MEET: "vne:text:meet",
|
|
11
|
+
|
|
12
|
+
SPEAKER: "vne:text:speaker",
|
|
13
|
+
SPEAKER_CHANGED: "vne:text:speaker_changed",
|
|
14
|
+
|
|
15
|
+
STATE_UPDATE: "vne:text:state_update",
|
|
16
|
+
STATE_CHANGED: "vne:text:state_changed",
|
|
17
|
+
|
|
18
|
+
RECALC: "vne:text:recalc",
|
|
19
|
+
|
|
20
|
+
REPLACE: "vne:text:replace",
|
|
21
|
+
REPLACE_REG: "vne:text:replace_reg",
|
|
22
|
+
|
|
23
|
+
INJECT_REG: "vne:text:inject_reg",
|
|
24
|
+
} as const;
|
|
25
|
+
|
|
26
|
+
export type SubscribeEvents = typeof SUBSCRIBE_EVENTS;
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import "@vnejs/module";
|
|
2
|
+
import "@vnejs/contracts.core.settings";
|
|
3
|
+
import "@vnejs/shared";
|
|
4
|
+
|
|
5
|
+
import { CONSTANTS } from "./const.js";
|
|
6
|
+
import { SUBSCRIBE_EVENTS } from "./events.js";
|
|
7
|
+
import type {
|
|
8
|
+
ModuleGlobalStateText,
|
|
9
|
+
ModuleGlobalStateTextMeet,
|
|
10
|
+
ModuleGlobalStateTextSpeaker,
|
|
11
|
+
ModuleGlobalStateTextWall,
|
|
12
|
+
} from "./module-global-state.js";
|
|
13
|
+
import { PARAMS } from "./params.js";
|
|
14
|
+
import { SETTINGS_KEYS } from "./settings.js";
|
|
15
|
+
|
|
16
|
+
export type { TextEmitPayload } from "./payloads.js";
|
|
17
|
+
|
|
18
|
+
export type {
|
|
19
|
+
ModuleGlobalStateText,
|
|
20
|
+
ModuleGlobalStateTextMeet,
|
|
21
|
+
ModuleGlobalStateTextSpeaker,
|
|
22
|
+
ModuleGlobalStateTextWall,
|
|
23
|
+
TextItem,
|
|
24
|
+
TokenizedChar,
|
|
25
|
+
WallElement,
|
|
26
|
+
} from "./module-global-state.js";
|
|
27
|
+
|
|
28
|
+
export const PLUGIN_NAME = "TEXT" as const;
|
|
29
|
+
export type PluginName = typeof PLUGIN_NAME;
|
|
30
|
+
|
|
31
|
+
export { CONSTANTS };
|
|
32
|
+
export type { Constants } from "./const.js";
|
|
33
|
+
export { SUBSCRIBE_EVENTS };
|
|
34
|
+
export type { SubscribeEvents } from "./events.js";
|
|
35
|
+
export { PARAMS };
|
|
36
|
+
export type { Params, TextSpeakerInfo, TextSpeakersInfo } from "./params.js";
|
|
37
|
+
export { SETTINGS_KEYS };
|
|
38
|
+
export type { SettingsKeys } from "./settings.js";
|
|
39
|
+
|
|
40
|
+
type TextTokenRenderSpeedSettingKey = (typeof SETTINGS_KEYS)["TOKEN_RENDER_SPEED"];
|
|
41
|
+
|
|
42
|
+
declare module "@vnejs/module" {
|
|
43
|
+
interface ModuleShared {
|
|
44
|
+
textNoAnimationSources: string[];
|
|
45
|
+
isTextAnimationInProcess: boolean;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
interface ModuleGlobalState {
|
|
49
|
+
text: ModuleGlobalStateText;
|
|
50
|
+
"text.wall": ModuleGlobalStateTextWall;
|
|
51
|
+
"text.meet": ModuleGlobalStateTextMeet;
|
|
52
|
+
"text.speaker": ModuleGlobalStateTextSpeaker;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
declare module "@vnejs/contracts.core.settings" {
|
|
57
|
+
interface ModuleSharedSettings extends Record<TextTokenRenderSpeedSettingKey, number> {}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
declare module "@vnejs/shared" {
|
|
61
|
+
interface VnePluginEventsMap extends Record<typeof PLUGIN_NAME, typeof SUBSCRIBE_EVENTS> {}
|
|
62
|
+
|
|
63
|
+
interface VnePluginConstantsMap extends Record<typeof PLUGIN_NAME, typeof CONSTANTS> {}
|
|
64
|
+
|
|
65
|
+
interface VnePluginParamsMap extends Record<typeof PLUGIN_NAME, typeof PARAMS> {}
|
|
66
|
+
|
|
67
|
+
interface VnePluginSettingsMap extends Record<typeof PLUGIN_NAME, typeof SETTINGS_KEYS> {}
|
|
68
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export type TextItem = {
|
|
2
|
+
text: string;
|
|
3
|
+
args: Record<string, unknown>;
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
export type TokenizedChar = {
|
|
7
|
+
token: string;
|
|
8
|
+
marks: string[];
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type ModuleGlobalStateText = {
|
|
12
|
+
tokensVisible: number;
|
|
13
|
+
uid: string;
|
|
14
|
+
texts: TextItem[];
|
|
15
|
+
tokens: TokenizedChar[];
|
|
16
|
+
wall: unknown[];
|
|
17
|
+
speaker: string;
|
|
18
|
+
meet: number;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type WallElement = {
|
|
22
|
+
texts: TextItem[];
|
|
23
|
+
tokens: TokenizedChar[];
|
|
24
|
+
uid: string;
|
|
25
|
+
speaker: string;
|
|
26
|
+
meet: number;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export type ModuleGlobalStateTextWall = {
|
|
30
|
+
wall: WallElement[];
|
|
31
|
+
isStarted: boolean;
|
|
32
|
+
shouldSkip: boolean;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type ModuleGlobalStateTextMeet = Record<string, number>;
|
|
36
|
+
|
|
37
|
+
export type ModuleGlobalStateTextSpeaker = {
|
|
38
|
+
speaker: string;
|
|
39
|
+
meet: number;
|
|
40
|
+
args: Record<string, unknown>;
|
|
41
|
+
};
|
package/src/params.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Widen } from "@vnejs/shared";
|
|
2
|
+
|
|
3
|
+
export type TextSpeakerInfo = {
|
|
4
|
+
color?: string;
|
|
5
|
+
opacity?: number;
|
|
6
|
+
speakerColor?: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const DEFAULT_TOKEN_RENDER_SPEED = 1 as number;
|
|
10
|
+
export const TOKEN_RENDER_DELAY = 16 as number;
|
|
11
|
+
export const DEFAULT_SPEAKER_NAME = "default" as const;
|
|
12
|
+
|
|
13
|
+
export type TextSpeakersInfo = Record<string, TextSpeakerInfo | undefined> & Record<typeof DEFAULT_SPEAKER_NAME, {}>;
|
|
14
|
+
|
|
15
|
+
const PARAMS_DEFAULT = {
|
|
16
|
+
DEFAULT_TOKEN_RENDER_SPEED,
|
|
17
|
+
TOKEN_RENDER_DELAY,
|
|
18
|
+
DEFAULT_SPEAKER_NAME,
|
|
19
|
+
SPEAKERS_INFO: {
|
|
20
|
+
[DEFAULT_SPEAKER_NAME]: {},
|
|
21
|
+
} as TextSpeakersInfo,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export type Params = Widen<typeof PARAMS_DEFAULT>;
|
|
25
|
+
export const PARAMS: Params = PARAMS_DEFAULT;
|
package/src/payloads.ts
ADDED
package/src/settings.ts
ADDED