@aim-packages/subtitle 0.1.2 → 0.1.3
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/README.md +106 -0
- package/dist/index.cjs.js +49 -41
- package/dist/index.d.ts +24 -0
- package/dist/index.es.js +1111 -1052
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -107,6 +107,26 @@ declare function chunkArrayStrings(strings: string[], characterLimit: number): s
|
|
|
107
107
|
indexResult: number[];
|
|
108
108
|
};
|
|
109
109
|
|
|
110
|
+
/**
|
|
111
|
+
* 清理时间显示格式,移除毫秒部分和多余的小时前缀
|
|
112
|
+
*
|
|
113
|
+
* 作用:
|
|
114
|
+
* 1. 移除时间字符串末尾的毫秒部分(支持 .xxx、,xxx 等分隔符)
|
|
115
|
+
* 2. 移除时间字符串开头多余的 "00:" 小时前缀
|
|
116
|
+
* 3. 保持时间格式的简洁性和可读性
|
|
117
|
+
*
|
|
118
|
+
* 示例:
|
|
119
|
+
* 输入:"00:01:30.500" -> 输出:"01:30"
|
|
120
|
+
* 输入:"01:45:20,123" -> 输出:"01:45:20"
|
|
121
|
+
* 输入:"00:00:05.00" -> 输出:"00:05"
|
|
122
|
+
* 输入:"01:30:45,50" -> 输出:"01:30:45"
|
|
123
|
+
*
|
|
124
|
+
* @export
|
|
125
|
+
* @param {string} timeString - 输入的时间字符串
|
|
126
|
+
* @return {string} 清理后的时间字符串
|
|
127
|
+
*/
|
|
128
|
+
declare function cleanTimeDisplay(timeString: string): string;
|
|
129
|
+
|
|
110
130
|
/**
|
|
111
131
|
* 合并字幕片段,优化字幕的时间轴
|
|
112
132
|
*
|
|
@@ -321,6 +341,8 @@ declare function chunkArrayStrings(strings: string[], characterLimit: number): s
|
|
|
321
341
|
|
|
322
342
|
declare function outputLrc({ segments1, segments2, speakerData }: OutputTextParams): string;
|
|
323
343
|
|
|
344
|
+
declare function outputMarkdown({ segments1, segments2, header, isMd, chunkSize, speakerData, locale }: OutputTextParams): string;
|
|
345
|
+
|
|
324
346
|
declare function outputSrt({ segments1, segments2, speakerData }: OutputTextParams): string;
|
|
325
347
|
|
|
326
348
|
export declare interface OutputTextParams {
|
|
@@ -628,6 +650,7 @@ declare function chunkArrayStrings(strings: string[], characterLimit: number): s
|
|
|
628
650
|
outputVtt,
|
|
629
651
|
outputLrc,
|
|
630
652
|
outputTxt,
|
|
653
|
+
outputMarkdown,
|
|
631
654
|
outputAss
|
|
632
655
|
}
|
|
633
656
|
}
|
|
@@ -637,6 +660,7 @@ declare function chunkArrayStrings(strings: string[], characterLimit: number): s
|
|
|
637
660
|
padNumber,
|
|
638
661
|
formatTime,
|
|
639
662
|
convertToSeconds,
|
|
663
|
+
cleanTimeDisplay,
|
|
640
664
|
containsCJKCharacters,
|
|
641
665
|
languageCodeToName,
|
|
642
666
|
convertHexColorToAssFormat,
|