@aim-packages/subtitle 0.1.1 → 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 +200 -0
- package/dist/index.cjs.js +54 -31
- package/dist/index.d.ts +27 -0
- package/dist/index.es.js +1174 -1037
- 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 {
|
|
@@ -339,6 +361,8 @@ declare function chunkArrayStrings(strings: string[], characterLimit: number): s
|
|
|
339
361
|
reverse?: boolean;
|
|
340
362
|
}
|
|
341
363
|
|
|
364
|
+
declare function outputTxt({ segments1, segments2, speakerData, locale, useIndex, useTimestamp, useParagraph }: OutputTextParams): string;
|
|
365
|
+
|
|
342
366
|
declare function outputVtt({ segments1, segments2, speakerData }: OutputTextParams): string;
|
|
343
367
|
|
|
344
368
|
/**
|
|
@@ -625,6 +649,8 @@ declare function chunkArrayStrings(strings: string[], characterLimit: number): s
|
|
|
625
649
|
outputSrt,
|
|
626
650
|
outputVtt,
|
|
627
651
|
outputLrc,
|
|
652
|
+
outputTxt,
|
|
653
|
+
outputMarkdown,
|
|
628
654
|
outputAss
|
|
629
655
|
}
|
|
630
656
|
}
|
|
@@ -634,6 +660,7 @@ declare function chunkArrayStrings(strings: string[], characterLimit: number): s
|
|
|
634
660
|
padNumber,
|
|
635
661
|
formatTime,
|
|
636
662
|
convertToSeconds,
|
|
663
|
+
cleanTimeDisplay,
|
|
637
664
|
containsCJKCharacters,
|
|
638
665
|
languageCodeToName,
|
|
639
666
|
convertHexColorToAssFormat,
|