@vunk/plus 1.7.3 → 1.7.5
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/components/broadcasting-markdown/index.mjs +101 -238
- package/components/broadcasting-markdown/src/ctx.d.ts +1 -4
- package/components/broadcasting-markdown/src/howler-speech.vue.d.ts +49 -88
- package/components/broadcasting-markdown/src/index.vue.d.ts +44 -103
- package/components/broadcasting-markdown/src/types.d.ts +1 -1
- package/components/broadcasting-markdown/src/use.d.ts +6 -8
- package/components/bubble-templates/index.css +4 -0
- package/components/bubble-templates/index.mjs +7 -11412
- package/components/metahuman-broadcasting/index.mjs +8 -5
- package/components/metahuman-broadcasting/src/index.vue.d.ts +62 -114
- package/components/pixi-frame/src/apng.vue.d.ts +3 -3
- package/components/pixi-frame/src/bitmap.vue.d.ts +5 -5
- package/components/pixi-frame/src/core.vue.d.ts +5 -5
- package/components/pixi-frame/src/index.vue.d.ts +12 -12
- package/components/pixi-frame/src/video.vue.d.ts +3 -3
- package/components/typing-markdown/index.mjs +4 -7
- package/components/vditor/src/ctx.d.ts +1 -1
- package/components/vditor/src/index.vue.d.ts +1 -1
- package/index.css +5 -0
- package/package.json +4 -1
- package/shared/StreamingInferenceService.mjs +4 -1
- package/shared/audioToFrames/index.mjs +2 -5
- package/shared/audioToFrames/src/audio/StreamingFeatureExtractorService.d.ts +20 -4
- package/shared/audioToFrames/src/audio/index.d.ts +0 -2
- package/shared/audioToFrames/src/audio/index.mjs +84 -157
- package/shared/audioToFrames/src/core/constants.d.ts +0 -22
- package/shared/audioToFrames/src/core/index.mjs +16 -2643
- package/shared/audioToFrames/src/core/utils.d.ts +1 -68
- package/shared/audioToFrames/src/inference/StreamingInferenceService.d.ts +43 -0
- package/shared/audioToFrames/src/media/index.d.ts +0 -5
- package/shared/audioToFrames/src/media/index.mjs +180 -610
- package/shared/constants.mjs +1 -12
- package/shared/PredictiveFrameLoader.mjs +0 -367
- package/shared/audioToFrames/src/audio/AudioProcessor.d.ts +0 -25
- package/shared/audioToFrames/src/audio/FeatureExtractorService.d.ts +0 -31
- package/shared/audioToFrames/src/inference/types.d.ts +0 -102
- package/shared/audioToFrames/src/media/ImageBitmapPool.d.ts +0 -63
- package/shared/audioToFrames/src/media/ImageProcessor.d.ts +0 -47
- package/shared/audioToFrames/src/media/PlaybackService.d.ts +0 -56
- package/shared/audioToFrames/src/media/WebGLPlaybackService.d.ts +0 -74
- package/shared/audioToFrames/src/media/WebGLRenderer.d.ts +0 -66
- package/shared/utils.mjs +0 -123
|
@@ -1,56 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file 共享工具函数
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* 提供基础错误处理工具函数
|
|
5
5
|
*
|
|
6
6
|
* @author Zhonghan Li
|
|
7
7
|
*/
|
|
8
|
-
/**
|
|
9
|
-
* 性能计时器类
|
|
10
|
-
* 用于测量代码段的执行时间
|
|
11
|
-
*/
|
|
12
|
-
export declare class PerformanceTimer {
|
|
13
|
-
private timings;
|
|
14
|
-
private startTimes;
|
|
15
|
-
/**
|
|
16
|
-
* 开始计时
|
|
17
|
-
* @param name 计时器名称
|
|
18
|
-
*/
|
|
19
|
-
start(name: string): void;
|
|
20
|
-
/**
|
|
21
|
-
* 结束计时并记录
|
|
22
|
-
* @param name 计时器名称
|
|
23
|
-
* @returns 耗时(毫秒)
|
|
24
|
-
*/
|
|
25
|
-
end(name: string): number;
|
|
26
|
-
/**
|
|
27
|
-
* 获取所有计时结果
|
|
28
|
-
* @returns 计时结果对象
|
|
29
|
-
*/
|
|
30
|
-
getTimings(): Record<string, number>;
|
|
31
|
-
/**
|
|
32
|
-
* 重置所有计时器
|
|
33
|
-
*/
|
|
34
|
-
reset(): void;
|
|
35
|
-
/**
|
|
36
|
-
* 累加计时结果
|
|
37
|
-
* @param name 计时器名称
|
|
38
|
-
* @param value 要累加的值
|
|
39
|
-
*/
|
|
40
|
-
accumulate(name: string, value: number): void;
|
|
41
|
-
/**
|
|
42
|
-
* 合并其他计时器的结果
|
|
43
|
-
* @param other 其他计时器实例
|
|
44
|
-
*/
|
|
45
|
-
merge(other: PerformanceTimer): void;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* 创建性能测量装饰器
|
|
49
|
-
* @param timerName 计时器名称
|
|
50
|
-
* @param timer 计时器实例
|
|
51
|
-
* @returns 装饰器函数
|
|
52
|
-
*/
|
|
53
|
-
export declare function measurePerformance(timerName: string, timer: PerformanceTimer): (_target: any, _propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
|
|
54
8
|
/**
|
|
55
9
|
* 标准化错误对象
|
|
56
10
|
* @param error 原始错误
|
|
@@ -64,30 +18,9 @@ export declare function normalizeError(error: unknown): string;
|
|
|
64
18
|
* @returns 错误处理函数
|
|
65
19
|
*/
|
|
66
20
|
export declare function createErrorHandler(context: string, _fallbackMessage?: string): (error: unknown) => never;
|
|
67
|
-
/**
|
|
68
|
-
* 带重试的异步操作
|
|
69
|
-
* @param operation 要执行的异步操作
|
|
70
|
-
* @param maxRetries 最大重试次数
|
|
71
|
-
* @param delay 重试间隔(毫秒)
|
|
72
|
-
* @returns Promise结果
|
|
73
|
-
*/
|
|
74
|
-
export declare function withRetry<T>(operation: () => Promise<T>, maxRetries?: number, delay?: number): Promise<T>;
|
|
75
|
-
export { debounce, cloneDeep as deepClone, throttle } from 'lodash-es';
|
|
76
21
|
/**
|
|
77
22
|
* 检查值是否为非空
|
|
78
23
|
* @param value 要检查的值
|
|
79
24
|
* @returns 类型守卫结果
|
|
80
25
|
*/
|
|
81
26
|
export declare function isNonNull<T>(value: T | null | undefined): value is T;
|
|
82
|
-
/**
|
|
83
|
-
* 检查值是否为有效数字
|
|
84
|
-
* @param value 要检查的值
|
|
85
|
-
* @returns 类型守卫结果
|
|
86
|
-
*/
|
|
87
|
-
export declare function isValidNumber(value: unknown): value is number;
|
|
88
|
-
/**
|
|
89
|
-
* 检查是否为有效的ArrayBuffer
|
|
90
|
-
* @param value 要检查的值
|
|
91
|
-
* @returns 类型守卫结果
|
|
92
|
-
*/
|
|
93
|
-
export declare function isValidArrayBuffer(value: unknown): value is ArrayBuffer;
|
|
@@ -9,6 +9,49 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type { ChunkFeatureResult } from '../audio/StreamingFeatureExtractorService';
|
|
11
11
|
import type { ImageDataResponse } from '../media/DataLoaderService';
|
|
12
|
+
/**
|
|
13
|
+
* Worker initialization message
|
|
14
|
+
*/
|
|
15
|
+
export interface StreamingWorkerInitMessage {
|
|
16
|
+
type: 'init';
|
|
17
|
+
modelPath: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Main thread message types for worker communication
|
|
21
|
+
*/
|
|
22
|
+
export interface MainThreadFrameMessage {
|
|
23
|
+
type: 'frame';
|
|
24
|
+
payload: {
|
|
25
|
+
frame: ImageBitmap;
|
|
26
|
+
frameIndex: number;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface MainThreadChunkCompleteMessage {
|
|
30
|
+
type: 'chunk_complete';
|
|
31
|
+
payload: {
|
|
32
|
+
chunkIndex: number;
|
|
33
|
+
timings: Record<string, number>;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export interface MainThreadProgressMessage {
|
|
37
|
+
type: 'progress';
|
|
38
|
+
payload: {
|
|
39
|
+
processed: number;
|
|
40
|
+
total: number;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export interface MainThreadAllCompleteMessage {
|
|
44
|
+
type: 'all_complete';
|
|
45
|
+
payload: Record<string, number>;
|
|
46
|
+
}
|
|
47
|
+
export interface MainThreadErrorMessage {
|
|
48
|
+
type: 'error';
|
|
49
|
+
payload: string;
|
|
50
|
+
}
|
|
51
|
+
export interface MainThreadReadyMessage {
|
|
52
|
+
type: 'ready';
|
|
53
|
+
}
|
|
54
|
+
export type MainThreadMessage = MainThreadFrameMessage | MainThreadChunkCompleteMessage | MainThreadProgressMessage | MainThreadAllCompleteMessage | MainThreadErrorMessage | MainThreadReadyMessage;
|
|
12
55
|
/**
|
|
13
56
|
* 单个流式推理chunk的数据结构。
|
|
14
57
|
*/
|
|
@@ -3,9 +3,4 @@
|
|
|
3
3
|
* @author Zhonghan Li
|
|
4
4
|
*/
|
|
5
5
|
export * from './DataLoaderService';
|
|
6
|
-
export * from './ImageBitmapPool';
|
|
7
|
-
export * from './ImageProcessor';
|
|
8
|
-
export * from './PlaybackService';
|
|
9
6
|
export * from './PredictiveFrameLoader';
|
|
10
|
-
export * from './WebGLPlaybackService';
|
|
11
|
-
export * from './WebGLRenderer';
|