shellfie-cli 2.0.2 → 2.0.4
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/README.md +26 -8
- package/dist/cli.js +0 -0
- package/package.json +2 -2
- package/dist/animator.d.ts +0 -8
- package/dist/animator.d.ts.map +0 -1
- package/dist/animator.js +0 -210
- package/dist/animator.js.map +0 -1
- package/dist/dvd-executor-v2.d.ts +0 -76
- package/dist/dvd-executor-v2.d.ts.map +0 -1
- package/dist/dvd-executor-v2.js +0 -258
- package/dist/dvd-executor-v2.js.map +0 -1
- package/dist/dvd-executor.d.ts +0 -144
- package/dist/dvd-executor.d.ts.map +0 -1
- package/dist/dvd-executor.js +0 -669
- package/dist/dvd-executor.js.map +0 -1
- package/dist/dvd-parser.d.ts +0 -96
- package/dist/dvd-parser.d.ts.map +0 -1
- package/dist/dvd-parser.js +0 -279
- package/dist/dvd-parser.js.map +0 -1
- package/dist/dvd.d.ts +0 -31
- package/dist/dvd.d.ts.map +0 -1
- package/dist/dvd.js +0 -154
- package/dist/dvd.js.map +0 -1
- package/dist/frame-animator.d.ts +0 -21
- package/dist/frame-animator.d.ts.map +0 -1
- package/dist/frame-animator.js +0 -254
- package/dist/frame-animator.js.map +0 -1
- package/dist/frame-capture.d.ts +0 -16
- package/dist/frame-capture.d.ts.map +0 -1
- package/dist/frame-capture.js +0 -162
- package/dist/frame-capture.js.map +0 -1
- package/dist/svg-animator-v2.d.ts +0 -23
- package/dist/svg-animator-v2.d.ts.map +0 -1
- package/dist/svg-animator-v2.js +0 -134
- package/dist/svg-animator-v2.js.map +0 -1
- package/dist/svg-animator.d.ts +0 -23
- package/dist/svg-animator.d.ts.map +0 -1
- package/dist/svg-animator.js +0 -134
- package/dist/svg-animator.js.map +0 -1
- package/dist/terminal-renderer.d.ts +0 -34
- package/dist/terminal-renderer.d.ts.map +0 -1
- package/dist/terminal-renderer.js +0 -229
- package/dist/terminal-renderer.js.map +0 -1
package/README.md
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Transform your terminal output into beautiful SVG screenshots, directly from the command line.
|
|
4
4
|
|
|
5
5
|
```sh
|
|
6
|
-
npm test | npx shellfie
|
|
6
|
+
npm test | npx shellfie
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-

|
|
9
|
+

|
|
10
10
|
|
|
11
11
|
✅ **Zero friction** - Pipe any command output and get an SVG instantly.
|
|
12
12
|
✅ **Beautiful defaults** - macOS-style terminal window with syntax highlighting.
|
|
@@ -16,6 +16,20 @@ npm test | npx shellfie -i "npm test" -o tests.svg
|
|
|
16
16
|
|
|
17
17
|
## Installation
|
|
18
18
|
|
|
19
|
+
### Homebrew (macOS/Linux)
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
brew install tool3/tap/shellfie
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Shell script (macOS/Linux)
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
curl -fsSL https://raw.githubusercontent.com/tool3/shellfie-cli/master/scripts/install.sh | bash
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### npm
|
|
32
|
+
|
|
19
33
|
```sh
|
|
20
34
|
# Use directly with npx (no install needed)
|
|
21
35
|
npx shellfie-cli --help
|
|
@@ -27,6 +41,10 @@ npm install -g shellfie-cli
|
|
|
27
41
|
npm install shellfie-cli --save-dev
|
|
28
42
|
```
|
|
29
43
|
|
|
44
|
+
### Download binary
|
|
45
|
+
|
|
46
|
+
Pre-built binaries for macOS, Linux, and Windows are available on the [Releases](https://github.com/tool3/shellfie-cli/releases) page.
|
|
47
|
+
|
|
30
48
|
## Quick Start
|
|
31
49
|
|
|
32
50
|
### Pipe command output
|
|
@@ -46,7 +64,7 @@ ls -la --color=always | shellfie --theme nord
|
|
|
46
64
|
lolcat --help | shellfie -o lolcat
|
|
47
65
|
```
|
|
48
66
|
|
|
49
|
-

|
|
67
|
+

|
|
50
68
|
|
|
51
69
|
### Read from a file
|
|
52
70
|
|
|
@@ -138,35 +156,35 @@ shellfie --list-templates
|
|
|
138
156
|
```sh
|
|
139
157
|
npm test 2>&1 | shellfie --theme dracula --title "Unit Tests" -o tests.svg
|
|
140
158
|
```
|
|
141
|
-

|
|
159
|
+

|
|
142
160
|
|
|
143
161
|
### Git log with minimal template
|
|
144
162
|
|
|
145
163
|
```sh
|
|
146
164
|
git log --oneline --graph --color=always | shellfie -t minimal --theme githubDark -o git-log.svg
|
|
147
165
|
```
|
|
148
|
-

|
|
166
|
+

|
|
149
167
|
|
|
150
168
|
### Custom padding and font size
|
|
151
169
|
|
|
152
170
|
```sh
|
|
153
171
|
cat script.sh | shellfie --padding "20,30" --font-size 30 -o script.svg
|
|
154
172
|
```
|
|
155
|
-

|
|
173
|
+

|
|
156
174
|
|
|
157
175
|
### Embed font for sharing
|
|
158
176
|
|
|
159
177
|
```sh
|
|
160
178
|
ls -l | lolcat -f | shellfie --embed-font -o portable.svg
|
|
161
179
|
```
|
|
162
|
-

|
|
180
|
+

|
|
163
181
|
|
|
164
182
|
### Add watermark
|
|
165
183
|
|
|
166
184
|
```sh
|
|
167
185
|
ifconfig | grep inet | shellfie --watermark "@$USER" --theme monokai
|
|
168
186
|
```
|
|
169
|
-

|
|
187
|
+

|
|
170
188
|
|
|
171
189
|
### Colored watermark
|
|
172
190
|
|
package/dist/cli.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
package/dist/animator.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { AnimationOptions } from './utils';
|
|
2
|
-
/**
|
|
3
|
-
* Injects animations into a static SVG to create a typing effect.
|
|
4
|
-
* Supports both SMIL and CSS animation methods.
|
|
5
|
-
* Splits tspans into individual characters for true character-by-character animation.
|
|
6
|
-
*/
|
|
7
|
-
export declare function injectAnimations(staticSvg: string, config: AnimationOptions): string;
|
|
8
|
-
//# sourceMappingURL=animator.d.ts.map
|
package/dist/animator.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"animator.d.ts","sourceRoot":"","sources":["../src/animator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAQhD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAcpF"}
|
package/dist/animator.js
DELETED
|
@@ -1,210 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.injectAnimations = injectAnimations;
|
|
4
|
-
/**
|
|
5
|
-
* Injects animations into a static SVG to create a typing effect.
|
|
6
|
-
* Supports both SMIL and CSS animation methods.
|
|
7
|
-
* Splits tspans into individual characters for true character-by-character animation.
|
|
8
|
-
*/
|
|
9
|
-
function injectAnimations(staticSvg, config) {
|
|
10
|
-
if (!config.enabled)
|
|
11
|
-
return staticSvg;
|
|
12
|
-
// First, split all tspans into character-level tspans
|
|
13
|
-
const characterSvg = splitTspansIntoCharacters(staticSvg);
|
|
14
|
-
const spans = parseSvgTextSpans(characterSvg);
|
|
15
|
-
if (spans.length === 0)
|
|
16
|
-
return staticSvg;
|
|
17
|
-
if (config.method === 'smil') {
|
|
18
|
-
return injectSmilAnimations(characterSvg, spans, config);
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
return injectCssAnimations(characterSvg, spans, config);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Splits all tspans into character-level tspans for character-by-character animation.
|
|
26
|
-
*/
|
|
27
|
-
function splitTspansIntoCharacters(svg) {
|
|
28
|
-
const tspanRegex = /<tspan([^>]*)>(.*?)<\/tspan>/gs;
|
|
29
|
-
return svg.replace(tspanRegex, (match, attributes, content) => {
|
|
30
|
-
// Skip truly empty tspans (but NOT spaces - spaces are valid characters!)
|
|
31
|
-
if (!content || content.length === 0) {
|
|
32
|
-
return match;
|
|
33
|
-
}
|
|
34
|
-
// Extract x position from attributes
|
|
35
|
-
const xMatch = attributes.match(/x="([^"]*)"/);
|
|
36
|
-
const baseX = xMatch ? parseFloat(xMatch[1]) : 0;
|
|
37
|
-
// Extract font size from parent text element or use default
|
|
38
|
-
// We'll need to search backwards in the SVG for the font-size
|
|
39
|
-
const fontSizeMatch = svg.match(/font-size="(\d+)"/);
|
|
40
|
-
const fontSize = fontSizeMatch ? parseFloat(fontSizeMatch[1]) : 14;
|
|
41
|
-
// Calculate character width (monospace: ~0.6 * fontSize)
|
|
42
|
-
const charWidth = fontSize * 0.6;
|
|
43
|
-
// Extract text content
|
|
44
|
-
const text = content;
|
|
45
|
-
// Split into individual characters
|
|
46
|
-
const chars = [...text]; // Use spread to handle Unicode correctly
|
|
47
|
-
// Create a tspan for each character with progressive x positions
|
|
48
|
-
const charTspans = chars.map((char, index) => {
|
|
49
|
-
// Calculate x position for this character
|
|
50
|
-
const xPos = baseX + (index * charWidth);
|
|
51
|
-
// Remove x attribute from original attributes (handle both before and after other attrs)
|
|
52
|
-
let attrsWithoutX = attributes.replace(/\s*x="[^"]*"\s*/, ' ').trim();
|
|
53
|
-
// Escape special XML characters
|
|
54
|
-
const escapedChar = char
|
|
55
|
-
.replace(/&/g, '&')
|
|
56
|
-
.replace(/</g, '<')
|
|
57
|
-
.replace(/>/g, '>');
|
|
58
|
-
// CRITICAL: Set initial opacity to 0 so character is hidden until animation starts
|
|
59
|
-
// Always put x first, then other attributes, then opacity
|
|
60
|
-
const finalAttrs = attrsWithoutX ? ` x="${xPos.toFixed(1)}" ${attrsWithoutX} opacity="0"` : ` x="${xPos.toFixed(1)}" opacity="0"`;
|
|
61
|
-
return `<tspan${finalAttrs}>${escapedChar}</tspan>`;
|
|
62
|
-
}).join('');
|
|
63
|
-
return charTspans;
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Parses SVG string to find all <tspan> elements.
|
|
68
|
-
*/
|
|
69
|
-
function parseSvgTextSpans(svg) {
|
|
70
|
-
const tspanRegex = /<tspan[^>]*>.*?<\/tspan>/gs;
|
|
71
|
-
const matches = [...svg.matchAll(tspanRegex)];
|
|
72
|
-
return matches.map((m) => ({
|
|
73
|
-
element: m[0],
|
|
74
|
-
startIndex: m.index,
|
|
75
|
-
endIndex: m.index + m[0].length,
|
|
76
|
-
}));
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Injects SMIL <animate> elements into each tspan for progressive reveal.
|
|
80
|
-
*/
|
|
81
|
-
function injectSmilAnimations(svg, spans, config) {
|
|
82
|
-
let animatedSvg = svg;
|
|
83
|
-
let offset = 0;
|
|
84
|
-
// Calculate total animation duration for looping
|
|
85
|
-
const lastCharDelay = calculateDelay(spans.length - 1, config);
|
|
86
|
-
const fadeDuration = 0.1;
|
|
87
|
-
const totalDuration = lastCharDelay + fadeDuration;
|
|
88
|
-
spans.forEach((span, index) => {
|
|
89
|
-
const delay = calculateDelay(index, config);
|
|
90
|
-
const animatedSpan = addSmilAnimation(span.element, delay, fadeDuration, config.loop, totalDuration);
|
|
91
|
-
const diff = animatedSpan.length - span.element.length;
|
|
92
|
-
const start = span.startIndex + offset;
|
|
93
|
-
const end = span.endIndex + offset;
|
|
94
|
-
animatedSvg = animatedSvg.substring(0, start) + animatedSpan + animatedSvg.substring(end);
|
|
95
|
-
offset += diff;
|
|
96
|
-
});
|
|
97
|
-
return animatedSvg;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Adds SMIL animation to a tspan element.
|
|
101
|
-
*/
|
|
102
|
-
function addSmilAnimation(tspanElement, delay, duration, loop, totalDuration) {
|
|
103
|
-
// Check if tspan is self-closing or has content
|
|
104
|
-
const isSelfClosing = tspanElement.endsWith('/>');
|
|
105
|
-
if (isSelfClosing) {
|
|
106
|
-
// For self-closing tspans, convert to open/close format and add animation
|
|
107
|
-
const openTag = tspanElement.replace('/>', '>');
|
|
108
|
-
const animateTag = createSmilAnimateTag(delay, duration, loop, totalDuration);
|
|
109
|
-
return openTag + animateTag + '</tspan>';
|
|
110
|
-
}
|
|
111
|
-
// For regular tspans, insert animation before closing tag
|
|
112
|
-
const animateTag = createSmilAnimateTag(delay, duration, loop, totalDuration);
|
|
113
|
-
return tspanElement.replace('</tspan>', animateTag + '</tspan>');
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Creates a SMIL <animate> tag.
|
|
117
|
-
* For looping: creates a sequence that fades in, stays visible, then resets and repeats.
|
|
118
|
-
* For non-looping: fades in and stays visible with fill="freeze".
|
|
119
|
-
*/
|
|
120
|
-
function createSmilAnimateTag(delay, duration, loop, totalDuration) {
|
|
121
|
-
if (loop) {
|
|
122
|
-
// For looping: each character fades in at its delay time, stays visible, then all reset at once
|
|
123
|
-
// Use begin with delay to start each character's animation at the right time
|
|
124
|
-
// The animation itself is: fade in (0->1) over duration, then reset to 0 at end of total cycle
|
|
125
|
-
const pauseDuration = totalDuration + 0.5; // Add 0.5s pause between loops
|
|
126
|
-
return `<animate attributeName="opacity" values="0;1;1;0" keyTimes="0;${(duration / pauseDuration).toFixed(3)};${((pauseDuration - 0.01) / pauseDuration).toFixed(3)};1" begin="${delay.toFixed(3)}s" dur="${pauseDuration.toFixed(3)}s" repeatCount="indefinite"/>`;
|
|
127
|
-
}
|
|
128
|
-
else {
|
|
129
|
-
// For non-looping: use fill="freeze" to keep final state
|
|
130
|
-
return `<animate attributeName="opacity" from="0" to="1" begin="${delay.toFixed(3)}s" dur="${duration.toFixed(3)}s" fill="freeze"/>`;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Injects CSS animations by adding a stylesheet and classes to each tspan.
|
|
135
|
-
*/
|
|
136
|
-
function injectCssAnimations(svg, spans, config) {
|
|
137
|
-
const stylesheet = generateCssStylesheet(spans.length, config);
|
|
138
|
-
// Find the <defs> section or create one
|
|
139
|
-
let animatedSvg = svg;
|
|
140
|
-
const defsMatch = svg.match(/<defs>[\s\S]*?<\/defs>/);
|
|
141
|
-
if (defsMatch) {
|
|
142
|
-
// Insert stylesheet inside existing <defs>
|
|
143
|
-
animatedSvg = svg.replace('</defs>', ` <style>${stylesheet}</style>\n </defs>`);
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
// Create new <defs> section after opening <svg> tag
|
|
147
|
-
const svgOpenMatch = svg.match(/<svg[^>]*>/);
|
|
148
|
-
if (svgOpenMatch) {
|
|
149
|
-
const insertPos = svgOpenMatch.index + svgOpenMatch[0].length;
|
|
150
|
-
animatedSvg = svg.substring(0, insertPos) +
|
|
151
|
-
`\n <defs>\n <style>${stylesheet}</style>\n </defs>` +
|
|
152
|
-
svg.substring(insertPos);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
// Add classes to tspans
|
|
156
|
-
let offset = animatedSvg.length - svg.length; // Account for added stylesheet
|
|
157
|
-
spans.forEach((span, index) => {
|
|
158
|
-
const className = `anim-char-${index}`;
|
|
159
|
-
const modifiedSpan = addClassToTspan(span.element, className);
|
|
160
|
-
const diff = modifiedSpan.length - span.element.length;
|
|
161
|
-
const start = span.startIndex + offset;
|
|
162
|
-
const end = span.endIndex + offset;
|
|
163
|
-
animatedSvg = animatedSvg.substring(0, start) + modifiedSpan + animatedSvg.substring(end);
|
|
164
|
-
offset += diff;
|
|
165
|
-
});
|
|
166
|
-
return animatedSvg;
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Generates CSS stylesheet for animations.
|
|
170
|
-
*/
|
|
171
|
-
function generateCssStylesheet(spanCount, config) {
|
|
172
|
-
const keyframes = `
|
|
173
|
-
@keyframes fadeIn {
|
|
174
|
-
from { opacity: 0; }
|
|
175
|
-
to { opacity: 1; }
|
|
176
|
-
}
|
|
177
|
-
`;
|
|
178
|
-
const classRules = Array.from({ length: spanCount }, (_, index) => {
|
|
179
|
-
const delay = calculateDelay(index, config);
|
|
180
|
-
const duration = 0.1;
|
|
181
|
-
const fillMode = 'forwards';
|
|
182
|
-
const iteration = config.loop ? 'infinite' : '1';
|
|
183
|
-
return `.anim-char-${index} { opacity: 0; animation: fadeIn ${duration}s ${delay}s ${fillMode}; animation-iteration-count: ${iteration}; }`;
|
|
184
|
-
}).join('\n ');
|
|
185
|
-
return keyframes + '\n ' + classRules;
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Adds a class attribute to a tspan element.
|
|
189
|
-
*/
|
|
190
|
-
function addClassToTspan(tspanElement, className) {
|
|
191
|
-
// Check if tspan already has a class attribute
|
|
192
|
-
const classMatch = tspanElement.match(/class="([^"]*)"/);
|
|
193
|
-
if (classMatch) {
|
|
194
|
-
// Append to existing class
|
|
195
|
-
return tspanElement.replace(/class="([^"]*)"/, `class="$1 ${className}"`);
|
|
196
|
-
}
|
|
197
|
-
else {
|
|
198
|
-
// Add new class attribute before closing >
|
|
199
|
-
return tspanElement.replace(/<tspan([^>]*)>/, `<tspan$1 class="${className}">`);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Calculates the delay for a given character index based on animation config.
|
|
204
|
-
*/
|
|
205
|
-
function calculateDelay(index, config) {
|
|
206
|
-
const baseDelay = (index * config.charDelay) / 1000; // Convert ms to seconds
|
|
207
|
-
const adjustedDelay = baseDelay / config.speed;
|
|
208
|
-
return config.initialDelay + adjustedDelay;
|
|
209
|
-
}
|
|
210
|
-
//# sourceMappingURL=animator.js.map
|
package/dist/animator.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"animator.js","sourceRoot":"","sources":["../src/animator.ts"],"names":[],"mappings":";;AAaA,4CAcC;AAnBD;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,SAAiB,EAAE,MAAwB;IAC1E,IAAI,CAAC,MAAM,CAAC,OAAO;QAAE,OAAO,SAAS,CAAC;IAEtC,sDAAsD;IACtD,MAAM,YAAY,GAAG,yBAAyB,CAAC,SAAS,CAAC,CAAC;IAE1D,MAAM,KAAK,GAAG,iB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2CAA2C;QAC3C,OAAO,YAAY,CAAC,OAAO,CAAC,gBAAgB,EAAE,mBAAmB,SAAS,IAAI,CAAC,CAAC;IAClF,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,KAAa,EAAE,MAAwB;IAC7D,MAAM,SAAS,GAAG,CAAC,KAAK,GAAG,MAAM,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,wBAAwB;IAC7E,MAAM,aAAa,GAAG,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC;IAC/C,OAAO,MAAM,CAAC,YAAY,GAAG,aAAa,CAAC;AAC7C,CAAC"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DVD Command Executor V2
|
|
3
|
-
* Executes real commands with typing effect and cursor
|
|
4
|
-
*/
|
|
5
|
-
import type { DVDScript } from './dvd-parser';
|
|
6
|
-
import { type TerminalState } from './terminal-renderer';
|
|
7
|
-
export interface TerminalFrame {
|
|
8
|
-
timestamp: number;
|
|
9
|
-
svg: string;
|
|
10
|
-
state: TerminalState;
|
|
11
|
-
}
|
|
12
|
-
export interface SimulatorContext {
|
|
13
|
-
lines: string[];
|
|
14
|
-
currentLine: string;
|
|
15
|
-
cursorX: number;
|
|
16
|
-
cursorY: number;
|
|
17
|
-
frames: TerminalFrame[];
|
|
18
|
-
clipboard: string;
|
|
19
|
-
startTime: number;
|
|
20
|
-
width: number;
|
|
21
|
-
height: number;
|
|
22
|
-
fontSize: number;
|
|
23
|
-
title?: string;
|
|
24
|
-
template?: 'macos' | 'windows' | 'minimal';
|
|
25
|
-
}
|
|
26
|
-
export interface DVDExecutorOptions {
|
|
27
|
-
width?: number;
|
|
28
|
-
height?: number;
|
|
29
|
-
fontSize?: number;
|
|
30
|
-
title?: string;
|
|
31
|
-
template?: 'macos' | 'windows' | 'minimal';
|
|
32
|
-
onFrame?: (frame: TerminalFrame) => void;
|
|
33
|
-
onProgress?: (current: number, total: number) => void;
|
|
34
|
-
}
|
|
35
|
-
export declare class DVDExecutorV2 {
|
|
36
|
-
private context;
|
|
37
|
-
private options;
|
|
38
|
-
constructor(options?: DVDExecutorOptions);
|
|
39
|
-
/**
|
|
40
|
-
* Capture current terminal state as a frame
|
|
41
|
-
*/
|
|
42
|
-
private captureFrame;
|
|
43
|
-
/**
|
|
44
|
-
* Execute Type command - simulate typing character by character
|
|
45
|
-
*/
|
|
46
|
-
private executeType;
|
|
47
|
-
/**
|
|
48
|
-
* Execute Enter - run the command and capture output
|
|
49
|
-
*/
|
|
50
|
-
private executeEnter;
|
|
51
|
-
/**
|
|
52
|
-
* Execute arrow keys
|
|
53
|
-
*/
|
|
54
|
-
private executeArrow;
|
|
55
|
-
/**
|
|
56
|
-
* Execute Backspace
|
|
57
|
-
*/
|
|
58
|
-
private executeBackspace;
|
|
59
|
-
/**
|
|
60
|
-
* Execute a single command
|
|
61
|
-
*/
|
|
62
|
-
private executeCommand;
|
|
63
|
-
/**
|
|
64
|
-
* Execute complete DVD script
|
|
65
|
-
*/
|
|
66
|
-
execute(script: DVDScript): Promise<TerminalFrame[]>;
|
|
67
|
-
/**
|
|
68
|
-
* Get all captured frames
|
|
69
|
-
*/
|
|
70
|
-
getFrames(): TerminalFrame[];
|
|
71
|
-
/**
|
|
72
|
-
* Cleanup (no-op for simulation)
|
|
73
|
-
*/
|
|
74
|
-
cleanup(): Promise<void>;
|
|
75
|
-
}
|
|
76
|
-
//# sourceMappingURL=dvd-executor-v2.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dvd-executor-v2.d.ts","sourceRoot":"","sources":["../src/dvd-executor-v2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAA0C,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIjG,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,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