@aim-packages/subtitle 0.0.11 → 0.0.13
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.js +13 -13
- package/dist/index.d.ts +11 -13
- package/dist/index.es.js +360 -347
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
space?: 0 | 1; // 存在多余空格 (Whether there are extra spaces)
|
|
41
41
|
*
|
|
42
42
|
*/
|
|
43
|
-
declare interface AimSegments {
|
|
43
|
+
export declare interface AimSegments {
|
|
44
44
|
st: string;
|
|
45
45
|
et: string;
|
|
46
46
|
text: string;
|
|
@@ -75,9 +75,10 @@ declare function chunkSegmentStringsWithIndex(segments: AimSegments[], character
|
|
|
75
75
|
indexResult: number[];
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
-
declare function consolidateSegments(items:
|
|
78
|
+
declare function consolidateSegments(items: Segment[], option: {
|
|
79
79
|
maxDistance: number;
|
|
80
|
-
|
|
80
|
+
padding: number;
|
|
81
|
+
}): Segment[] | undefined;
|
|
81
82
|
|
|
82
83
|
/**
|
|
83
84
|
* 匹配中文、日文、韩文字符的正则表达式
|
|
@@ -107,7 +108,7 @@ declare function convertToSeconds(time?: string): number;
|
|
|
107
108
|
* @public
|
|
108
109
|
*/
|
|
109
110
|
declare function create(options?: ParserOptions<AimSegments[], AimSegments[], string> & {
|
|
110
|
-
vad?:
|
|
111
|
+
vad?: Segment[];
|
|
111
112
|
}): Parser<string>;
|
|
112
113
|
|
|
113
114
|
declare function create_2(options?: ParserOptions<RequiredByKey<Partial<AimSegments>, "index">[], Partial<AimSegments>[], string>): Parser<string>;
|
|
@@ -136,7 +137,7 @@ export declare namespace filter {
|
|
|
136
137
|
*/
|
|
137
138
|
declare function formatTime(seconds: number): string;
|
|
138
139
|
|
|
139
|
-
declare type LanguageCode = "auto" | "none" | "zh" | "zh_cn" | "zh_tw" | "yue" | "en" | "ja" | "ko" | "fr" | "es" | "ru" | "de" | "it" | "tr" | "pt" | "vi" | "id" | "th" | "ms" | "ar" | "hi" | "ro" | "ug" | "uz" | "kk" | "az" | "ky" | "fa" | "tg";
|
|
140
|
+
export declare type LanguageCode = "auto" | "none" | "zh" | "zh_cn" | "zh_tw" | "yue" | "en" | "ja" | "ko" | "fr" | "es" | "ru" | "de" | "it" | "tr" | "pt" | "vi" | "id" | "th" | "ms" | "ar" | "hi" | "ro" | "ug" | "uz" | "kk" | "az" | "ky" | "fa" | "tg";
|
|
140
141
|
|
|
141
142
|
/**
|
|
142
143
|
* 将语言代码转换为名称
|
|
@@ -171,7 +172,7 @@ declare interface OpenAIResult {
|
|
|
171
172
|
|
|
172
173
|
declare function openaiToAimSegments(json: OpenAIResult): Promise<AimSegments[]>;
|
|
173
174
|
|
|
174
|
-
declare interface OptimizationOptions {
|
|
175
|
+
export declare interface OptimizationOptions {
|
|
175
176
|
emt: boolean;
|
|
176
177
|
ep: boolean;
|
|
177
178
|
zf: boolean;
|
|
@@ -257,6 +258,8 @@ declare type ParserOptions<S, P, E> = {
|
|
|
257
258
|
onEnd?: ParseCallback<E>;
|
|
258
259
|
};
|
|
259
260
|
|
|
261
|
+
export declare type PartialByKey<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
262
|
+
|
|
260
263
|
declare class RepeatCheck {
|
|
261
264
|
threshold: number;
|
|
262
265
|
hit: number;
|
|
@@ -274,9 +277,9 @@ declare interface RepeatCheckOption {
|
|
|
274
277
|
onHit?: (segment: AimSegments[]) => void;
|
|
275
278
|
}
|
|
276
279
|
|
|
277
|
-
declare type RequiredByKey<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
|
|
280
|
+
export declare type RequiredByKey<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
|
|
278
281
|
|
|
279
|
-
declare type
|
|
282
|
+
export declare type Segment = {
|
|
280
283
|
start: number;
|
|
281
284
|
end: number;
|
|
282
285
|
};
|
|
@@ -373,11 +376,6 @@ export declare namespace utils {
|
|
|
373
376
|
}
|
|
374
377
|
}
|
|
375
378
|
|
|
376
|
-
declare type VADTimeItem = {
|
|
377
|
-
start: number;
|
|
378
|
-
end: number;
|
|
379
|
-
};
|
|
380
|
-
|
|
381
379
|
declare function vttToAimSegments(text: string): Promise<AimSegments[]>;
|
|
382
380
|
|
|
383
381
|
export { }
|