@aim-packages/subtitle 0.2.0 → 0.3.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.js +52 -49
- package/dist/index.d.ts +13 -0
- package/dist/index.es.js +1079 -1041
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -504,6 +504,16 @@ declare function chunkArrayStrings(strings: string[], characterLimit: number): s
|
|
|
504
504
|
result?: R;
|
|
505
505
|
}
|
|
506
506
|
|
|
507
|
+
export declare type ParsedSubtitle = {
|
|
508
|
+
hasMultiLang: boolean;
|
|
509
|
+
firstLanguageMap: Record<string, number>;
|
|
510
|
+
secondLanguageMap: Record<string, number>;
|
|
511
|
+
multiLanguageCount: number;
|
|
512
|
+
firstSegments: AimSegments[];
|
|
513
|
+
secondSegments: AimSegments[];
|
|
514
|
+
segments: AimSegments[];
|
|
515
|
+
};
|
|
516
|
+
|
|
507
517
|
/**
|
|
508
518
|
* Parser parser instance.
|
|
509
519
|
*
|
|
@@ -539,6 +549,7 @@ declare function chunkArrayStrings(strings: string[], characterLimit: number): s
|
|
|
539
549
|
tingwuToAimSegments,
|
|
540
550
|
openaiToAimSegments,
|
|
541
551
|
whisperJsonToAimSegments,
|
|
552
|
+
parseSubtitle,
|
|
542
553
|
create as createWhisperStreamParser,
|
|
543
554
|
create_2 as createTranslateStreamParser,
|
|
544
555
|
create_3 as createSegmentStreamParser
|
|
@@ -565,6 +576,8 @@ declare function chunkArrayStrings(strings: string[], characterLimit: number): s
|
|
|
565
576
|
onEnd?: ParseCallback<E, R>;
|
|
566
577
|
};
|
|
567
578
|
|
|
579
|
+
declare function parseSubtitle(text: string): Promise<ParsedSubtitle | undefined>;
|
|
580
|
+
|
|
568
581
|
export declare type PartialByKey<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
569
582
|
|
|
570
583
|
/**
|