captions.js 0.1.0-alpha → 0.1.2

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.mts CHANGED
@@ -1,3 +1,60 @@
1
+ declare const googleFontsList: readonly ["Roboto", "Open Sans", "Lato", "Montserrat", "Nunito", "Poppins", "Ubuntu", "PT Sans", "Merriweather Sans", "Lobster", "Amatic SC", "Pacifico", "Raleway", "Cinzel", "Quicksand", "Zilla Slab", "Caveat", "Crimson Pro", "Bebas Neue", "Comfortaa", "Satisfy", "Permanent Marker", "Oswald", "Onset", "Bangers", "Kanit", "Work Sans", "Fira Sans", "Anton", "Playfair Display", "Rubik", "Alumni Sans", "Righteous", "Comico", "Excon", "Kalam", "Tanker", "Arsenal", "Balsamiq Sans", "Bona Nova SC"];
2
+
3
+ interface StylePreset {
4
+ id: number;
5
+ captionsSettings: {
6
+ style: {
7
+ font: {
8
+ italic: boolean;
9
+ fontSize: number;
10
+ fontColor: string;
11
+ underline: boolean;
12
+ fontFamily: string;
13
+ fontWeight: string;
14
+ fontCapitalize: boolean;
15
+ fontStrokeColor: string;
16
+ fontStrokeWidth: number;
17
+ shadow?: {
18
+ fontShadowBlur: number;
19
+ fontShadowColor: string;
20
+ fontShadowOffsetX: number;
21
+ fontShadowOffsetY: number;
22
+ };
23
+ };
24
+ name: string;
25
+ backgroundColor: string;
26
+ verticalCoverImg: string;
27
+ aplifiedWordColor: string;
28
+ };
29
+ position: string;
30
+ animation: string;
31
+ linesPerPage: number;
32
+ positionTopOffset?: number;
33
+ };
34
+ layoutSettings: {
35
+ aspectRatio: string;
36
+ aIAutoLayout: string[];
37
+ fitLayoutAspectRatio: string;
38
+ };
39
+ }
40
+ declare const stylePresets: StylePreset[];
41
+
42
+ declare function renderString(canvas: HTMLCanvasElement, text: string, options: {
43
+ preset: StylePreset;
44
+ }): Promise<boolean>;
45
+
46
+ declare const attachToVideo: (videoElement: HTMLVideoElement, container?: HTMLDivElement, options?: any) => {
47
+ detach: () => void;
48
+ update: (newOptions: any) => Promise<void>;
49
+ };
50
+
51
+ interface Caption {
52
+ word: string;
53
+ startTime: number;
54
+ endTime: number;
55
+ highlightColor?: string;
56
+ }
57
+
1
58
  declare function renderCaptions(ctx: CanvasRenderingContext2D, text: string): boolean;
2
59
 
3
- export { renderCaptions };
60
+ export { type Caption, type StylePreset, attachToVideo, googleFontsList, renderCaptions, renderString, stylePresets };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,60 @@
1
+ declare const googleFontsList: readonly ["Roboto", "Open Sans", "Lato", "Montserrat", "Nunito", "Poppins", "Ubuntu", "PT Sans", "Merriweather Sans", "Lobster", "Amatic SC", "Pacifico", "Raleway", "Cinzel", "Quicksand", "Zilla Slab", "Caveat", "Crimson Pro", "Bebas Neue", "Comfortaa", "Satisfy", "Permanent Marker", "Oswald", "Onset", "Bangers", "Kanit", "Work Sans", "Fira Sans", "Anton", "Playfair Display", "Rubik", "Alumni Sans", "Righteous", "Comico", "Excon", "Kalam", "Tanker", "Arsenal", "Balsamiq Sans", "Bona Nova SC"];
2
+
3
+ interface StylePreset {
4
+ id: number;
5
+ captionsSettings: {
6
+ style: {
7
+ font: {
8
+ italic: boolean;
9
+ fontSize: number;
10
+ fontColor: string;
11
+ underline: boolean;
12
+ fontFamily: string;
13
+ fontWeight: string;
14
+ fontCapitalize: boolean;
15
+ fontStrokeColor: string;
16
+ fontStrokeWidth: number;
17
+ shadow?: {
18
+ fontShadowBlur: number;
19
+ fontShadowColor: string;
20
+ fontShadowOffsetX: number;
21
+ fontShadowOffsetY: number;
22
+ };
23
+ };
24
+ name: string;
25
+ backgroundColor: string;
26
+ verticalCoverImg: string;
27
+ aplifiedWordColor: string;
28
+ };
29
+ position: string;
30
+ animation: string;
31
+ linesPerPage: number;
32
+ positionTopOffset?: number;
33
+ };
34
+ layoutSettings: {
35
+ aspectRatio: string;
36
+ aIAutoLayout: string[];
37
+ fitLayoutAspectRatio: string;
38
+ };
39
+ }
40
+ declare const stylePresets: StylePreset[];
41
+
42
+ declare function renderString(canvas: HTMLCanvasElement, text: string, options: {
43
+ preset: StylePreset;
44
+ }): Promise<boolean>;
45
+
46
+ declare const attachToVideo: (videoElement: HTMLVideoElement, container?: HTMLDivElement, options?: any) => {
47
+ detach: () => void;
48
+ update: (newOptions: any) => Promise<void>;
49
+ };
50
+
51
+ interface Caption {
52
+ word: string;
53
+ startTime: number;
54
+ endTime: number;
55
+ highlightColor?: string;
56
+ }
57
+
1
58
  declare function renderCaptions(ctx: CanvasRenderingContext2D, text: string): boolean;
2
59
 
3
- export { renderCaptions };
60
+ export { type Caption, type StylePreset, attachToVideo, googleFontsList, renderCaptions, renderString, stylePresets };