@aim-packages/subtitle 0.0.9 → 0.0.11

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.d.ts CHANGED
@@ -66,6 +66,19 @@ declare interface AimSegments {
66
66
 
67
67
  declare function assToAimSegments(text: string): Promise<AimSegments[]>;
68
68
 
69
+ declare function chunkArrayStrings(strings: string[], characterLimit: number): string[];
70
+
71
+ declare function chunkSegmentStringsWithIndex(segments: AimSegments[], characterLimit: number): {
72
+ segmentsResult: AimSegments[][];
73
+ stringResult: string[];
74
+ indexStringResult: string[];
75
+ indexResult: number[];
76
+ };
77
+
78
+ declare function consolidateSegments(items: Segments[], option: {
79
+ maxDistance: number;
80
+ }): Segments[] | undefined;
81
+
69
82
  /**
70
83
  * 匹配中文、日文、韩文字符的正则表达式
71
84
  *
@@ -263,6 +276,11 @@ declare interface RepeatCheckOption {
263
276
 
264
277
  declare type RequiredByKey<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
265
278
 
279
+ declare type Segments = {
280
+ start: number;
281
+ end: number;
282
+ };
283
+
266
284
  declare function splitToSentences(text: string, languageCode?: LanguageCode): string[];
267
285
 
268
286
  declare function srtToAimSegments(text: string): Promise<AimSegments[]>;
@@ -348,7 +366,10 @@ export declare namespace utils {
348
366
  formatTime,
349
367
  convertToSeconds,
350
368
  containsCJKCharacters,
351
- languageCodeToName
369
+ languageCodeToName,
370
+ chunkArrayStrings,
371
+ chunkSegmentStringsWithIndex,
372
+ consolidateSegments
352
373
  }
353
374
  }
354
375