@bendyline/squisq-cli 1.1.5 → 1.1.6

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.
Files changed (41) hide show
  1. package/dist/api.d.ts +45 -14
  2. package/dist/api.js +393 -304
  3. package/dist/api.js.map +1 -1
  4. package/dist/index.d.ts +2 -12
  5. package/dist/index.js +722 -20
  6. package/dist/index.js.map +1 -1
  7. package/package.json +5 -5
  8. package/dist/__tests__/convert.test.d.ts +0 -7
  9. package/dist/__tests__/convert.test.d.ts.map +0 -1
  10. package/dist/__tests__/convert.test.js +0 -127
  11. package/dist/__tests__/convert.test.js.map +0 -1
  12. package/dist/__tests__/html-export.test.d.ts +0 -8
  13. package/dist/__tests__/html-export.test.d.ts.map +0 -1
  14. package/dist/__tests__/html-export.test.js +0 -126
  15. package/dist/__tests__/html-export.test.js.map +0 -1
  16. package/dist/__tests__/readInput.test.d.ts +0 -5
  17. package/dist/__tests__/readInput.test.d.ts.map +0 -1
  18. package/dist/__tests__/readInput.test.js +0 -120
  19. package/dist/__tests__/readInput.test.js.map +0 -1
  20. package/dist/api.d.ts.map +0 -1
  21. package/dist/commands/convert.d.ts +0 -15
  22. package/dist/commands/convert.d.ts.map +0 -1
  23. package/dist/commands/convert.js +0 -264
  24. package/dist/commands/convert.js.map +0 -1
  25. package/dist/commands/video.d.ts +0 -12
  26. package/dist/commands/video.d.ts.map +0 -1
  27. package/dist/commands/video.js +0 -122
  28. package/dist/commands/video.js.map +0 -1
  29. package/dist/index.d.ts.map +0 -1
  30. package/dist/util/detectFfmpeg.d.ts +0 -15
  31. package/dist/util/detectFfmpeg.d.ts.map +0 -1
  32. package/dist/util/detectFfmpeg.js +0 -29
  33. package/dist/util/detectFfmpeg.js.map +0 -1
  34. package/dist/util/nativeEncoder.d.ts +0 -27
  35. package/dist/util/nativeEncoder.d.ts.map +0 -1
  36. package/dist/util/nativeEncoder.js +0 -106
  37. package/dist/util/nativeEncoder.js.map +0 -1
  38. package/dist/util/readInput.d.ts +0 -31
  39. package/dist/util/readInput.d.ts.map +0 -1
  40. package/dist/util/readInput.js +0 -142
  41. 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
- import type { Doc } from '@bendyline/squisq/schemas';
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
- export interface RenderDocToMp4Options {
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
- export interface RenderDocToMp4Result {
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
- export declare function renderDocToMp4(doc: Doc, container: MemoryContentContainer, options: RenderDocToMp4Options): Promise<RenderDocToMp4Result>;
106
+ declare function renderDocToMp4(doc: Doc, container: MemoryContentContainer, options: RenderDocToMp4Options): Promise<RenderDocToMp4Result>;
77
107
  /** A thumbnail size specification. */
78
- export interface ThumbnailSpec {
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
- export interface ExtractThumbnailsOptions {
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
- export declare function extractThumbnails(options: ExtractThumbnailsOptions): Promise<void>;
106
- //# sourceMappingURL=api.d.ts.map
135
+ declare function extractThumbnails(options: ExtractThumbnailsOptions): Promise<void>;
136
+
137
+ export { type ExtractThumbnailsOptions, type ReadInputResult, type RenderDocToMp4Options, type RenderDocToMp4Result, type ThumbnailSpec, extractThumbnails, readInput, renderDocToMp4 };