@bendyline/docblocks-cli 2.1.0 → 2.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.ts CHANGED
@@ -1,2 +1,133 @@
1
+ import { MarkdownDocument } from '@bendyline/squisq/markdown';
2
+ import { ContentContainer } from '@bendyline/squisq/storage';
3
+ import * as _bendyline_squisq_cli_api from '@bendyline/squisq-cli/api';
4
+ import { FormatRegistry } from '@bendyline/squisq-cli/api';
5
+ import { VideoQuality, VideoOrientation } from '@bendyline/squisq-video';
1
6
 
2
- export { }
7
+ interface BuildOptions {
8
+ input: string;
9
+ output: string;
10
+ theme?: string;
11
+ /** Programmatic traversal budget; CLI callers use the safe default. */
12
+ maxEntries?: number;
13
+ /** Programmatic directory-depth budget; CLI callers use the safe default. */
14
+ maxDepth?: number;
15
+ /** Maximum bytes in one Markdown input. */
16
+ maxInputBytes?: number;
17
+ /** Maximum aggregate bytes across all Markdown inputs. */
18
+ maxTotalInputBytes?: number;
19
+ /** Maximum bytes in one generated standalone HTML file. */
20
+ maxOutputBytes?: number;
21
+ /** Maximum aggregate bytes across all generated HTML files. */
22
+ maxTotalOutputBytes?: number;
23
+ /** Disable default byte budgets for an explicitly trusted bulk build. */
24
+ allowLargeBuild?: boolean;
25
+ }
26
+ interface BuildResult {
27
+ inputDir: string;
28
+ outputDir: string;
29
+ builtFiles: string[];
30
+ }
31
+ declare function runBuild(opts: BuildOptions): Promise<BuildResult>;
32
+
33
+ /**
34
+ * convert command
35
+ *
36
+ * Reads any input supported by the linked Squisq CLI and exports through its
37
+ * canonical format registry. The historical default set remains DOCX, PPTX,
38
+ * PDF, HTML, and DBK; callers may explicitly request any export-capable
39
+ * registry format.
40
+ *
41
+ * Wraps the same logic as squisq-cli's convert command, reusing the
42
+ * underlying squisq libraries directly.
43
+ */
44
+
45
+ interface ConvertOptions {
46
+ outputDir?: string;
47
+ formats?: string;
48
+ theme?: string;
49
+ transform?: string;
50
+ /**
51
+ * Replace existing destination files. Off by default: the run is refused
52
+ * before any conversion work when a destination already exists.
53
+ */
54
+ allowOverwrite?: boolean;
55
+ /** Cancel reading, transformation, conversion, or publication at a bounded boundary. */
56
+ signal?: AbortSignal;
57
+ /** Programmatic registry override; the CLI defaults to the linked Squisq registry. */
58
+ registry?: FormatRegistry;
59
+ /** Programmatic aggregate input budget; CLI callers use the safe default. */
60
+ maxInputBytes?: number;
61
+ /** Programmatic input-tree budget; CLI callers use the safe default. */
62
+ maxInputEntries?: number;
63
+ /** Programmatic per-output budget; CLI callers use the safe default. */
64
+ maxOutputBytes?: number;
65
+ /** Programmatic aggregate output budget; CLI callers use the safe default. */
66
+ maxTotalOutputBytes?: number;
67
+ }
68
+ interface ConvertResult {
69
+ outputFiles: {
70
+ path: string;
71
+ format: string;
72
+ size: number;
73
+ mimeType: string;
74
+ suggestedFilename: string;
75
+ warnings: string[];
76
+ }[];
77
+ }
78
+ declare function runConvert(inputPath: string, opts: ConvertOptions): Promise<ConvertResult>;
79
+ /**
80
+ * Apply a transform style to a MarkdownDocument.
81
+ */
82
+ declare function applyTransformToMarkdown(markdownDoc: MarkdownDocument, container: ContentContainer, transformStyle: string, themeId?: string): Promise<MarkdownDocument>;
83
+
84
+ declare const VALID_CAPTIONS: readonly ["off", "standard", "social"];
85
+ type CaptionOption = (typeof VALID_CAPTIONS)[number];
86
+ interface VideoOptions {
87
+ output?: string;
88
+ fps?: number;
89
+ quality?: VideoQuality;
90
+ orientation?: VideoOrientation;
91
+ captions?: CaptionOption;
92
+ width?: number;
93
+ height?: number;
94
+ /**
95
+ * Replace an existing MP4. Off by default: the render is refused before any
96
+ * reading, browser capture, or FFmpeg encoding when the target exists.
97
+ */
98
+ allowOverwrite?: boolean;
99
+ /** Cancel input preparation, browser capture, or FFmpeg encoding. */
100
+ signal?: AbortSignal;
101
+ }
102
+ interface VideoResult {
103
+ outputPath: string;
104
+ duration: number;
105
+ frameCount: number;
106
+ }
107
+ type RenderDocToMp4 = typeof _bendyline_squisq_cli_api.renderDocToMp4;
108
+ interface VideoRunDependencies {
109
+ /** Test/programmatic override; production uses the linked Squisq renderer. */
110
+ renderDocToMp4?: RenderDocToMp4;
111
+ }
112
+ /**
113
+ * Core video rendering logic — reusable by both CLI and MCP tools.
114
+ */
115
+ declare function runVideo(inputPath: string, opts: VideoOptions, onProgress?: (phase: string, percent: number) => void, dependencies?: VideoRunDependencies): Promise<VideoResult>;
116
+ /** Reject unsafe dimensions before reading input or launching Playwright/FFmpeg. */
117
+ declare function assertCliVideoRenderBudget(options: Pick<VideoOptions, 'fps' | 'quality' | 'orientation' | 'width' | 'height'>): void;
118
+
119
+ /**
120
+ * parse command — parse a markdown file and print its structure as JSON.
121
+ */
122
+
123
+ interface ParseOptions {
124
+ /** Programmatic input budget; CLI callers use the safe default. */
125
+ readonly maxInputBytes?: number;
126
+ /** Programmatic JSON output budget; CLI callers use the safe default. */
127
+ readonly maxOutputBytes?: number;
128
+ }
129
+ declare function runParse(inputPath: string, options?: ParseOptions): Promise<string>;
130
+
131
+ declare function getPackageVersion(): string;
132
+
133
+ export { type BuildOptions, type BuildResult, type ConvertOptions, type ConvertResult, type ParseOptions, type VideoOptions, type VideoResult, type VideoRunDependencies, applyTransformToMarkdown, assertCliVideoRenderBudget, getPackageVersion, runBuild, runConvert, runParse, runVideo };