@bendyline/squisq-cli 1.1.5 → 1.2.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/api.d.ts +45 -14
- package/dist/api.js +482 -301
- package/dist/api.js.map +1 -1
- package/dist/index.d.ts +2 -12
- package/dist/index.js +889 -20
- package/dist/index.js.map +1 -1
- package/package.json +8 -7
- package/dist/__tests__/convert.test.d.ts +0 -7
- package/dist/__tests__/convert.test.d.ts.map +0 -1
- package/dist/__tests__/convert.test.js +0 -127
- package/dist/__tests__/convert.test.js.map +0 -1
- package/dist/__tests__/html-export.test.d.ts +0 -8
- package/dist/__tests__/html-export.test.d.ts.map +0 -1
- package/dist/__tests__/html-export.test.js +0 -126
- package/dist/__tests__/html-export.test.js.map +0 -1
- package/dist/__tests__/readInput.test.d.ts +0 -5
- package/dist/__tests__/readInput.test.d.ts.map +0 -1
- package/dist/__tests__/readInput.test.js +0 -120
- package/dist/__tests__/readInput.test.js.map +0 -1
- package/dist/api.d.ts.map +0 -1
- package/dist/commands/convert.d.ts +0 -15
- package/dist/commands/convert.d.ts.map +0 -1
- package/dist/commands/convert.js +0 -264
- package/dist/commands/convert.js.map +0 -1
- package/dist/commands/video.d.ts +0 -12
- package/dist/commands/video.d.ts.map +0 -1
- package/dist/commands/video.js +0 -122
- package/dist/commands/video.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/util/detectFfmpeg.d.ts +0 -15
- package/dist/util/detectFfmpeg.d.ts.map +0 -1
- package/dist/util/detectFfmpeg.js +0 -29
- package/dist/util/detectFfmpeg.js.map +0 -1
- package/dist/util/nativeEncoder.d.ts +0 -27
- package/dist/util/nativeEncoder.d.ts.map +0 -1
- package/dist/util/nativeEncoder.js +0 -106
- package/dist/util/nativeEncoder.js.map +0 -1
- package/dist/util/readInput.d.ts +0 -31
- package/dist/util/readInput.d.ts.map +0 -1
- package/dist/util/readInput.js +0 -142
- package/dist/util/readInput.js.map +0 -1
package/dist/api.d.ts
CHANGED
|
@@ -1,3 +1,39 @@
|
|
|
1
|
+
import { Doc } from '@bendyline/squisq/schemas';
|
|
2
|
+
import { MemoryContentContainer } from '@bendyline/squisq/storage';
|
|
3
|
+
export { MemoryContentContainer } from '@bendyline/squisq/storage';
|
|
4
|
+
import { VideoQuality, VideoOrientation } from '@bendyline/squisq-video';
|
|
5
|
+
export { VideoOrientation, VideoQuality } from '@bendyline/squisq-video';
|
|
6
|
+
import { MarkdownDocument } from '@bendyline/squisq/markdown';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* readInput
|
|
10
|
+
*
|
|
11
|
+
* Unified input reader for the CLI. Accepts a path to a .md file, .json file
|
|
12
|
+
* (Doc schema), .zip/.dbk container, or a folder and returns a MemoryContentContainer
|
|
13
|
+
* (virtual file system) plus either the parsed MarkdownDocument or a pre-built Doc.
|
|
14
|
+
*
|
|
15
|
+
* When a .json file or a container/folder containing doc.json is provided, the
|
|
16
|
+
* Doc is returned directly and markdownDoc will be null. Callers should check
|
|
17
|
+
* result.doc first; when present, skip markdownToDoc() and use it directly.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
interface ReadInputResult {
|
|
21
|
+
container: MemoryContentContainer;
|
|
22
|
+
/** Parsed markdown document. Null when input is a Doc JSON file. */
|
|
23
|
+
markdownDoc: MarkdownDocument | null;
|
|
24
|
+
/** Pre-built Doc from JSON input. Present when input is .json or contains doc.json. */
|
|
25
|
+
doc?: Doc;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Read input from a file path (markdown, JSON Doc, ZIP/DBK container, or folder)
|
|
29
|
+
* and return a populated ContentContainer + parsed MarkdownDocument or Doc.
|
|
30
|
+
*
|
|
31
|
+
* When the input is a .json file (or a container/folder containing doc.json),
|
|
32
|
+
* the result will have `doc` populated and `markdownDoc` set to null.
|
|
33
|
+
* Otherwise, `markdownDoc` is populated and `doc` is undefined.
|
|
34
|
+
*/
|
|
35
|
+
declare function readInput(inputPath: string): Promise<ReadInputResult>;
|
|
36
|
+
|
|
1
37
|
/**
|
|
2
38
|
* Programmatic Video API
|
|
3
39
|
*
|
|
@@ -18,15 +54,9 @@
|
|
|
18
54
|
* orientation: 'landscape',
|
|
19
55
|
* });
|
|
20
56
|
*/
|
|
21
|
-
|
|
22
|
-
import type { MemoryContentContainer } from '@bendyline/squisq/storage';
|
|
23
|
-
import type { VideoQuality, VideoOrientation } from '@bendyline/squisq-video';
|
|
24
|
-
export type { VideoQuality, VideoOrientation } from '@bendyline/squisq-video';
|
|
25
|
-
export { MemoryContentContainer } from '@bendyline/squisq/storage';
|
|
26
|
-
export { readInput } from './util/readInput.js';
|
|
27
|
-
export type { ReadInputResult } from './util/readInput.js';
|
|
57
|
+
|
|
28
58
|
/** Options for renderDocToMp4. */
|
|
29
|
-
|
|
59
|
+
interface RenderDocToMp4Options {
|
|
30
60
|
/** Output file path for the MP4. */
|
|
31
61
|
outputPath: string;
|
|
32
62
|
/** Frames per second (default: 30). */
|
|
@@ -49,7 +79,7 @@ export interface RenderDocToMp4Options {
|
|
|
49
79
|
onProgress?: (phase: string, percent: number) => void;
|
|
50
80
|
}
|
|
51
81
|
/** Result returned by renderDocToMp4. */
|
|
52
|
-
|
|
82
|
+
interface RenderDocToMp4Result {
|
|
53
83
|
/** Duration of the rendered video in seconds (including pre-roll). */
|
|
54
84
|
duration: number;
|
|
55
85
|
/** Number of frames captured. */
|
|
@@ -73,9 +103,9 @@ export interface RenderDocToMp4Result {
|
|
|
73
103
|
* @param options - Rendering and encoding options
|
|
74
104
|
* @returns Result with duration and frame count
|
|
75
105
|
*/
|
|
76
|
-
|
|
106
|
+
declare function renderDocToMp4(doc: Doc, container: MemoryContentContainer, options: RenderDocToMp4Options): Promise<RenderDocToMp4Result>;
|
|
77
107
|
/** A thumbnail size specification. */
|
|
78
|
-
|
|
108
|
+
interface ThumbnailSpec {
|
|
79
109
|
/** Label for the thumbnail (used in filename: `{slug}-{width}x{height}.jpg`). */
|
|
80
110
|
name: string;
|
|
81
111
|
/** Output width in pixels. */
|
|
@@ -86,7 +116,7 @@ export interface ThumbnailSpec {
|
|
|
86
116
|
filter: string;
|
|
87
117
|
}
|
|
88
118
|
/** Options for extractThumbnails. */
|
|
89
|
-
|
|
119
|
+
interface ExtractThumbnailsOptions {
|
|
90
120
|
/** Path to the source MP4 video. */
|
|
91
121
|
videoPath: string;
|
|
92
122
|
/** Directory to write thumbnails into. */
|
|
@@ -102,5 +132,6 @@ export interface ExtractThumbnailsOptions {
|
|
|
102
132
|
* Extract thumbnail images from the first frame of an MP4 video.
|
|
103
133
|
* Produces JPEG files at each specified size using FFmpeg video filters.
|
|
104
134
|
*/
|
|
105
|
-
|
|
106
|
-
|
|
135
|
+
declare function extractThumbnails(options: ExtractThumbnailsOptions): Promise<void>;
|
|
136
|
+
|
|
137
|
+
export { type ExtractThumbnailsOptions, type ReadInputResult, type RenderDocToMp4Options, type RenderDocToMp4Result, type ThumbnailSpec, extractThumbnails, readInput, renderDocToMp4 };
|