captions.js 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.
@@ -0,0 +1,3 @@
1
+ declare function renderCaptions(ctx: CanvasRenderingContext2D, text: string): boolean;
2
+
3
+ export { renderCaptions };
@@ -0,0 +1,3 @@
1
+ declare function renderCaptions(ctx: CanvasRenderingContext2D, text: string): boolean;
2
+
3
+ export { renderCaptions };
package/dist/index.js ADDED
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ renderCaptions: () => renderCaptions
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+ function renderCaptions(ctx, text) {
27
+ ctx.font = "24px sans-serif";
28
+ ctx.fillStyle = "#17c499ff";
29
+ ctx.fillText(text, 150, 50);
30
+ return true;
31
+ }
32
+ // Annotate the CommonJS export names for ESM import in node:
33
+ 0 && (module.exports = {
34
+ renderCaptions
35
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,10 @@
1
+ // src/index.ts
2
+ function renderCaptions(ctx, text) {
3
+ ctx.font = "24px sans-serif";
4
+ ctx.fillStyle = "#17c499ff";
5
+ ctx.fillText(text, 150, 50);
6
+ return true;
7
+ }
8
+ export {
9
+ renderCaptions
10
+ };
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "captions.js",
3
+ "private": false,
4
+ "description": "A cross-platform captions engine for client- and server-side video processing — ideal for AI video tools, editors, and streaming apps",
5
+ "version": "0.3.0",
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.mjs",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.js"
13
+ }
14
+ },
15
+ "devDependencies": {
16
+ "tsup": "^8.0.0",
17
+ "typescript": "^5.6.3"
18
+ },
19
+ "scripts": {
20
+ "build": "tsup src/index.ts --format esm,cjs --dts",
21
+ "dev": "tsup src/index.ts --format esm,cjs --dts --watch"
22
+ }
23
+ }
package/src/index.ts ADDED
@@ -0,0 +1,6 @@
1
+ export function renderCaptions(ctx: CanvasRenderingContext2D, text: string) {
2
+ ctx.font = "24px sans-serif";
3
+ ctx.fillStyle = "#17c499ff";
4
+ ctx.fillText(text, 150, 50);
5
+ return true;
6
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "ESNext",
5
+ "declaration": true,
6
+ "outDir": "dist",
7
+ "strict": true
8
+ },
9
+ "include": ["src"]
10
+ }