@daytona/sdk 0.0.0-dev

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 (169) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +180 -0
  3. package/cjs/CodeInterpreter.d.ts +95 -0
  4. package/cjs/CodeInterpreter.js +297 -0
  5. package/cjs/CodeInterpreter.js.map +1 -0
  6. package/cjs/ComputerUse.d.ts +539 -0
  7. package/cjs/ComputerUse.js +808 -0
  8. package/cjs/ComputerUse.js.map +1 -0
  9. package/cjs/Daytona.d.ts +357 -0
  10. package/cjs/Daytona.js +534 -0
  11. package/cjs/Daytona.js.map +1 -0
  12. package/cjs/FileSystem.d.ts +453 -0
  13. package/cjs/FileSystem.js +575 -0
  14. package/cjs/FileSystem.js.map +1 -0
  15. package/cjs/Git.d.ts +203 -0
  16. package/cjs/Git.js +326 -0
  17. package/cjs/Git.js.map +1 -0
  18. package/cjs/Image.d.ts +265 -0
  19. package/cjs/Image.js +586 -0
  20. package/cjs/Image.js.map +1 -0
  21. package/cjs/LspServer.d.ts +172 -0
  22. package/cjs/LspServer.js +259 -0
  23. package/cjs/LspServer.js.map +1 -0
  24. package/cjs/ObjectStorage.d.ts +79 -0
  25. package/cjs/ObjectStorage.js +199 -0
  26. package/cjs/ObjectStorage.js.map +1 -0
  27. package/cjs/Process.d.ts +490 -0
  28. package/cjs/Process.js +647 -0
  29. package/cjs/Process.js.map +1 -0
  30. package/cjs/PtyHandle.d.ts +155 -0
  31. package/cjs/PtyHandle.js +416 -0
  32. package/cjs/PtyHandle.js.map +1 -0
  33. package/cjs/README.md +180 -0
  34. package/cjs/Sandbox.d.ts +476 -0
  35. package/cjs/Sandbox.js +905 -0
  36. package/cjs/Sandbox.js.map +1 -0
  37. package/cjs/Snapshot.d.ts +140 -0
  38. package/cjs/Snapshot.js +248 -0
  39. package/cjs/Snapshot.js.map +1 -0
  40. package/cjs/Volume.d.ts +84 -0
  41. package/cjs/Volume.js +119 -0
  42. package/cjs/Volume.js.map +1 -0
  43. package/cjs/errors/DaytonaError.d.ts +171 -0
  44. package/cjs/errors/DaytonaError.js +258 -0
  45. package/cjs/errors/DaytonaError.js.map +1 -0
  46. package/cjs/index.d.ts +22 -0
  47. package/cjs/index.js +49 -0
  48. package/cjs/index.js.map +1 -0
  49. package/cjs/package.json +3 -0
  50. package/cjs/types/Charts.d.ts +38 -0
  51. package/cjs/types/Charts.js +37 -0
  52. package/cjs/types/Charts.js.map +1 -0
  53. package/cjs/types/CodeInterpreter.d.ts +77 -0
  54. package/cjs/types/CodeInterpreter.js +7 -0
  55. package/cjs/types/CodeInterpreter.js.map +1 -0
  56. package/cjs/types/ExecuteResponse.d.ts +26 -0
  57. package/cjs/types/ExecuteResponse.js +7 -0
  58. package/cjs/types/ExecuteResponse.js.map +1 -0
  59. package/cjs/types/Pty.d.ts +48 -0
  60. package/cjs/types/Pty.js +7 -0
  61. package/cjs/types/Pty.js.map +1 -0
  62. package/cjs/utils/Binary.d.ts +38 -0
  63. package/cjs/utils/Binary.js +174 -0
  64. package/cjs/utils/Binary.js.map +1 -0
  65. package/cjs/utils/FileTransfer.d.ts +39 -0
  66. package/cjs/utils/FileTransfer.js +521 -0
  67. package/cjs/utils/FileTransfer.js.map +1 -0
  68. package/cjs/utils/Import.d.ts +40 -0
  69. package/cjs/utils/Import.js +155 -0
  70. package/cjs/utils/Import.js.map +1 -0
  71. package/cjs/utils/Multipart.d.ts +29 -0
  72. package/cjs/utils/Multipart.js +115 -0
  73. package/cjs/utils/Multipart.js.map +1 -0
  74. package/cjs/utils/Runtime.d.ts +44 -0
  75. package/cjs/utils/Runtime.js +95 -0
  76. package/cjs/utils/Runtime.js.map +1 -0
  77. package/cjs/utils/Stream.d.ts +20 -0
  78. package/cjs/utils/Stream.js +364 -0
  79. package/cjs/utils/Stream.js.map +1 -0
  80. package/cjs/utils/WebSocket.d.ts +10 -0
  81. package/cjs/utils/WebSocket.js +26 -0
  82. package/cjs/utils/WebSocket.js.map +1 -0
  83. package/cjs/utils/otel.decorator.d.ts +83 -0
  84. package/cjs/utils/otel.decorator.js +141 -0
  85. package/cjs/utils/otel.decorator.js.map +1 -0
  86. package/esm/CodeInterpreter.d.ts +95 -0
  87. package/esm/CodeInterpreter.js +292 -0
  88. package/esm/CodeInterpreter.js.map +1 -0
  89. package/esm/ComputerUse.d.ts +539 -0
  90. package/esm/ComputerUse.js +799 -0
  91. package/esm/ComputerUse.js.map +1 -0
  92. package/esm/Daytona.d.ts +357 -0
  93. package/esm/Daytona.js +530 -0
  94. package/esm/Daytona.js.map +1 -0
  95. package/esm/FileSystem.d.ts +453 -0
  96. package/esm/FileSystem.js +571 -0
  97. package/esm/FileSystem.js.map +1 -0
  98. package/esm/Git.d.ts +203 -0
  99. package/esm/Git.js +322 -0
  100. package/esm/Git.js.map +1 -0
  101. package/esm/Image.d.ts +265 -0
  102. package/esm/Image.js +581 -0
  103. package/esm/Image.js.map +1 -0
  104. package/esm/LspServer.d.ts +172 -0
  105. package/esm/LspServer.js +255 -0
  106. package/esm/LspServer.js.map +1 -0
  107. package/esm/ObjectStorage.d.ts +79 -0
  108. package/esm/ObjectStorage.js +195 -0
  109. package/esm/ObjectStorage.js.map +1 -0
  110. package/esm/Process.d.ts +490 -0
  111. package/esm/Process.js +642 -0
  112. package/esm/Process.js.map +1 -0
  113. package/esm/PtyHandle.d.ts +155 -0
  114. package/esm/PtyHandle.js +412 -0
  115. package/esm/PtyHandle.js.map +1 -0
  116. package/esm/README.md +180 -0
  117. package/esm/Sandbox.d.ts +476 -0
  118. package/esm/Sandbox.js +901 -0
  119. package/esm/Sandbox.js.map +1 -0
  120. package/esm/Snapshot.d.ts +140 -0
  121. package/esm/Snapshot.js +244 -0
  122. package/esm/Snapshot.js.map +1 -0
  123. package/esm/Volume.d.ts +84 -0
  124. package/esm/Volume.js +115 -0
  125. package/esm/Volume.js.map +1 -0
  126. package/esm/errors/DaytonaError.d.ts +171 -0
  127. package/esm/errors/DaytonaError.js +243 -0
  128. package/esm/errors/DaytonaError.js.map +1 -0
  129. package/esm/index.d.ts +22 -0
  130. package/esm/index.js +21 -0
  131. package/esm/index.js.map +1 -0
  132. package/esm/package.json +3 -0
  133. package/esm/types/Charts.d.ts +38 -0
  134. package/esm/types/Charts.js +33 -0
  135. package/esm/types/Charts.js.map +1 -0
  136. package/esm/types/CodeInterpreter.d.ts +77 -0
  137. package/esm/types/CodeInterpreter.js +6 -0
  138. package/esm/types/CodeInterpreter.js.map +1 -0
  139. package/esm/types/ExecuteResponse.d.ts +26 -0
  140. package/esm/types/ExecuteResponse.js +6 -0
  141. package/esm/types/ExecuteResponse.js.map +1 -0
  142. package/esm/types/Pty.d.ts +48 -0
  143. package/esm/types/Pty.js +6 -0
  144. package/esm/types/Pty.js.map +1 -0
  145. package/esm/utils/Binary.d.ts +38 -0
  146. package/esm/utils/Binary.js +163 -0
  147. package/esm/utils/Binary.js.map +1 -0
  148. package/esm/utils/FileTransfer.d.ts +39 -0
  149. package/esm/utils/FileTransfer.js +512 -0
  150. package/esm/utils/FileTransfer.js.map +1 -0
  151. package/esm/utils/Import.d.ts +40 -0
  152. package/esm/utils/Import.js +119 -0
  153. package/esm/utils/Import.js.map +1 -0
  154. package/esm/utils/Multipart.d.ts +29 -0
  155. package/esm/utils/Multipart.js +109 -0
  156. package/esm/utils/Multipart.js.map +1 -0
  157. package/esm/utils/Runtime.d.ts +44 -0
  158. package/esm/utils/Runtime.js +89 -0
  159. package/esm/utils/Runtime.js.map +1 -0
  160. package/esm/utils/Stream.d.ts +20 -0
  161. package/esm/utils/Stream.js +360 -0
  162. package/esm/utils/Stream.js.map +1 -0
  163. package/esm/utils/WebSocket.d.ts +10 -0
  164. package/esm/utils/WebSocket.js +22 -0
  165. package/esm/utils/WebSocket.js.map +1 -0
  166. package/esm/utils/otel.decorator.d.ts +83 -0
  167. package/esm/utils/otel.decorator.js +136 -0
  168. package/esm/utils/otel.decorator.js.map +1 -0
  169. package/package.json +96 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeInterpreter.js","sourceRoot":"","sources":["../../../../../../libs/sdk-typescript/src/types/CodeInterpreter.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
@@ -0,0 +1,26 @@
1
+ import type { Chart } from './Charts';
2
+ /**
3
+ * Artifacts from the command execution.
4
+ *
5
+ * @interface
6
+ * @property stdout - Standard output from the command, same as `result` in `ExecuteResponse`
7
+ * @property charts - List of chart metadata from matplotlib
8
+ */
9
+ export interface ExecutionArtifacts {
10
+ stdout: string;
11
+ charts?: Chart[];
12
+ }
13
+ /**
14
+ * Response from the command execution.
15
+ *
16
+ * @interface
17
+ * @property exitCode - The exit code from the command execution
18
+ * @property result - The output from the command execution
19
+ * @property artifacts - Artifacts from the command execution
20
+ */
21
+ export interface ExecuteResponse {
22
+ exitCode: number;
23
+ result: string;
24
+ artifacts?: ExecutionArtifacts;
25
+ }
26
+ //# sourceMappingURL=ExecuteResponse.d.ts.map
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright 2025 Daytona Platforms Inc.
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=ExecuteResponse.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExecuteResponse.js","sourceRoot":"","sources":["../../../../../../libs/sdk-typescript/src/types/ExecuteResponse.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Options for creating a PTY session
3
+ */
4
+ export interface PtyCreateOptions {
5
+ /**
6
+ * The unique identifier for the PTY session
7
+ */
8
+ id: string;
9
+ /**
10
+ * Starting directory for the PTY session, defaults to the sandbox's working directory
11
+ */
12
+ cwd?: string;
13
+ /**
14
+ * Environment variables for the PTY session
15
+ */
16
+ envs?: Record<string, string>;
17
+ /**
18
+ * Number of terminal columns
19
+ */
20
+ cols?: number;
21
+ /**
22
+ * Number of terminal rows
23
+ */
24
+ rows?: number;
25
+ }
26
+ /**
27
+ * Options for connecting to a PTY session
28
+ */
29
+ export interface PtyConnectOptions {
30
+ /**
31
+ * Callback to handle PTY output data
32
+ */
33
+ onData: (data: Uint8Array) => void | Promise<void>;
34
+ }
35
+ /**
36
+ * PTY session result on exit
37
+ */
38
+ export interface PtyResult {
39
+ /**
40
+ * Exit code when the PTY process ends
41
+ */
42
+ exitCode?: number;
43
+ /**
44
+ * Error message if the PTY failed
45
+ */
46
+ error?: string;
47
+ }
48
+ //# sourceMappingURL=Pty.d.ts.map
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright 2025 Daytona Platforms Inc.
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=Pty.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pty.js","sourceRoot":"","sources":["../../../../../../libs/sdk-typescript/src/types/Pty.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Converts various data types to Uint8Array
3
+ */
4
+ export declare function toUint8Array(data: string | ArrayBuffer | ArrayBufferView): Uint8Array;
5
+ /**
6
+ * Concatenates multiple Uint8Array chunks into a single Uint8Array
7
+ */
8
+ export declare function concatUint8Arrays(parts: Uint8Array[]): Uint8Array;
9
+ /**
10
+ * Converts Uint8Array to Buffer (uses polyfill in non-Node environments)
11
+ */
12
+ export declare function toBuffer(data: Uint8Array): Buffer;
13
+ /**
14
+ * Decodes Uint8Array to UTF-8 string
15
+ */
16
+ export declare function utf8Decode(data: Uint8Array): string;
17
+ /**
18
+ * Finds all occurrences of a pattern in a byte buffer
19
+ */
20
+ export declare function findAllBytes(buffer: Uint8Array, pattern: Uint8Array): number[];
21
+ /**
22
+ * Finds the first occurrence of a pattern in a byte buffer within a range
23
+ */
24
+ export declare function findBytesInRange(buffer: Uint8Array, start: number, end: number, pattern: Uint8Array): number;
25
+ /**
26
+ * Checks if a sequence starts at a given position in a byte buffer
27
+ * Returns the position after the sequence if found, -1 otherwise
28
+ */
29
+ export declare function indexAfterSequence(buffer: Uint8Array, start: number, sequence: Uint8Array): number;
30
+ /**
31
+ * Collects all bytes from various stream types into a single Uint8Array
32
+ */
33
+ export declare function collectStreamBytes(stream: any): Promise<Uint8Array>;
34
+ /**
35
+ * Checks if value is a File object (browser environment)
36
+ */
37
+ export declare function isFile(value: any): boolean;
38
+ //# sourceMappingURL=Binary.d.ts.map
@@ -0,0 +1,174 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright 2025 Daytona Platforms Inc.
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.toUint8Array = toUint8Array;
8
+ exports.concatUint8Arrays = concatUint8Arrays;
9
+ exports.toBuffer = toBuffer;
10
+ exports.utf8Decode = utf8Decode;
11
+ exports.findAllBytes = findAllBytes;
12
+ exports.findBytesInRange = findBytesInRange;
13
+ exports.indexAfterSequence = indexAfterSequence;
14
+ exports.collectStreamBytes = collectStreamBytes;
15
+ exports.isFile = isFile;
16
+ const DaytonaError_1 = require("../errors/DaytonaError");
17
+ const Import_1 = require("./Import");
18
+ let _BufferCtor = null;
19
+ function getBufferCtor() {
20
+ if (!_BufferCtor)
21
+ _BufferCtor = (0, Import_1.dynamicRequire)('buffer', '"Buffer" is not supported: ').Buffer;
22
+ return _BufferCtor;
23
+ }
24
+ /**
25
+ * Converts various data types to Uint8Array
26
+ */
27
+ function toUint8Array(data) {
28
+ if (typeof data === 'string') {
29
+ return new TextEncoder().encode(data);
30
+ }
31
+ if (data instanceof ArrayBuffer) {
32
+ return new Uint8Array(data);
33
+ }
34
+ if (ArrayBuffer.isView(data)) {
35
+ return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
36
+ }
37
+ throw new DaytonaError_1.DaytonaError('Unsupported data type for byte conversion.');
38
+ }
39
+ /**
40
+ * Concatenates multiple Uint8Array chunks into a single Uint8Array
41
+ */
42
+ function concatUint8Arrays(parts) {
43
+ const size = parts.reduce((sum, part) => sum + part.byteLength, 0);
44
+ const result = new Uint8Array(size);
45
+ let offset = 0;
46
+ for (const part of parts) {
47
+ result.set(part, offset);
48
+ offset += part.byteLength;
49
+ }
50
+ return result;
51
+ }
52
+ /**
53
+ * Converts Uint8Array to Buffer (uses polyfill in non-Node environments)
54
+ */
55
+ function toBuffer(data) {
56
+ return getBufferCtor().from(data);
57
+ }
58
+ /**
59
+ * Decodes Uint8Array to UTF-8 string
60
+ */
61
+ function utf8Decode(data) {
62
+ return new TextDecoder('utf-8').decode(data);
63
+ }
64
+ /**
65
+ * Finds all occurrences of a pattern in a byte buffer
66
+ */
67
+ function findAllBytes(buffer, pattern) {
68
+ const results = [];
69
+ let i = 0;
70
+ while (i <= buffer.length - pattern.length) {
71
+ let match = true;
72
+ for (let j = 0; j < pattern.length; j++) {
73
+ if (buffer[i + j] !== pattern[j]) {
74
+ match = false;
75
+ break;
76
+ }
77
+ }
78
+ if (match) {
79
+ results.push(i);
80
+ i += pattern.length;
81
+ }
82
+ else {
83
+ i++;
84
+ }
85
+ }
86
+ return results;
87
+ }
88
+ /**
89
+ * Finds the first occurrence of a pattern in a byte buffer within a range
90
+ */
91
+ function findBytesInRange(buffer, start, end, pattern) {
92
+ let i = start;
93
+ while (i <= end - pattern.length) {
94
+ let match = true;
95
+ for (let j = 0; j < pattern.length; j++) {
96
+ if (buffer[i + j] !== pattern[j]) {
97
+ match = false;
98
+ break;
99
+ }
100
+ }
101
+ if (match)
102
+ return i;
103
+ i++;
104
+ }
105
+ return -1;
106
+ }
107
+ /**
108
+ * Checks if a sequence starts at a given position in a byte buffer
109
+ * Returns the position after the sequence if found, -1 otherwise
110
+ */
111
+ function indexAfterSequence(buffer, start, sequence) {
112
+ for (let j = 0; j < sequence.length; j++) {
113
+ if (buffer[start + j] !== sequence[j])
114
+ return -1;
115
+ }
116
+ return start + sequence.length;
117
+ }
118
+ /**
119
+ * Collects all bytes from various stream types into a single Uint8Array
120
+ */
121
+ async function collectStreamBytes(stream) {
122
+ if (!stream)
123
+ return new Uint8Array(0);
124
+ // ReadableStream (WHATWG)
125
+ if (typeof stream.getReader === 'function') {
126
+ const reader = stream.getReader();
127
+ const chunks = [];
128
+ try {
129
+ while (true) {
130
+ const { done, value } = await reader.read();
131
+ if (done)
132
+ break;
133
+ if (value?.byteLength) {
134
+ chunks.push(value);
135
+ }
136
+ }
137
+ }
138
+ finally {
139
+ await reader.cancel();
140
+ }
141
+ return concatUint8Arrays(chunks);
142
+ }
143
+ // AsyncIterable
144
+ if (stream?.[Symbol.asyncIterator]) {
145
+ const chunks = [];
146
+ for await (const chunk of stream) {
147
+ chunks.push(toUint8Array(chunk));
148
+ }
149
+ return concatUint8Arrays(chunks);
150
+ }
151
+ // Direct data types
152
+ if (typeof stream === 'string' || stream instanceof ArrayBuffer || ArrayBuffer.isView(stream)) {
153
+ return toUint8Array(stream);
154
+ }
155
+ // Blob
156
+ if (typeof Blob !== 'undefined' && stream instanceof Blob) {
157
+ const arrayBuffer = await stream.arrayBuffer();
158
+ return new Uint8Array(arrayBuffer);
159
+ }
160
+ // Response
161
+ if (typeof Response !== 'undefined' && stream instanceof Response) {
162
+ const arrayBuffer = await stream.arrayBuffer();
163
+ return new Uint8Array(arrayBuffer);
164
+ }
165
+ throw new DaytonaError_1.DaytonaError('Unsupported stream type for byte collection.');
166
+ }
167
+ /**
168
+ * Checks if value is a File object (browser environment)
169
+ */
170
+ function isFile(value) {
171
+ const FileConstructor = globalThis.File;
172
+ return typeof FileConstructor !== 'undefined' && value instanceof FileConstructor;
173
+ }
174
+ //# sourceMappingURL=Binary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Binary.js","sourceRoot":"","sources":["../../../../../../libs/sdk-typescript/src/utils/Binary.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAcH,oCAWC;AAKD,8CASC;AAKD,4BAEC;AAKD,gCAEC;AAKD,oCAmBC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AC/B,MAAM,eAAe,GAAI,UAAkB,CAAC,IAAI,CAAA;IAChD,OAAO,OAAO,eAAe,KAAK,WAAW,IAAI,KAAK,YAAY,eAAe,CAAA;AACnF,CAAC"}
@@ -0,0 +1,39 @@
1
+ import type { Readable } from 'stream';
2
+ import { DaytonaError } from '../errors/DaytonaError';
3
+ import type { DownloadMetadata, UploadProgress, UploadSource } from '../FileSystem';
4
+ /**
5
+ * Safely aborts a stream
6
+ */
7
+ export declare function abortStream(stream: any): void;
8
+ /**
9
+ * Normalizes response data to extract the actual stream
10
+ */
11
+ export declare function normalizeResponseStream(responseData: any): any;
12
+ /**
13
+ * Processes multipart response using busboy (Node.js path).
14
+ *
15
+ * Once the file stream has been handed off via `onFileStream`, errors from the
16
+ * busboy stream are the consumer's concern — they arrive via the file stream's
17
+ * own 'error' event. The inner Promise resolves cleanly in that case to avoid
18
+ * surfacing late teardown errors (busboy's `_final`, premature pipe close)
19
+ * after the caller has already started consuming the file.
20
+ */
21
+ export declare function processDownloadFilesResponseWithBusboy(stream: any, headers: Record<string, string>, metadataMap: Map<string, DownloadMetadata>, onFileStream?: (source: string, fileStream: any, totalBytes?: number) => void): Promise<void>;
22
+ export declare function processDownloadFilesResponseWithBuffered(stream: any, headers: Record<string, string>, metadataMap: Map<string, DownloadMetadata>): Promise<void>;
23
+ /** Construct the cancellation error thrown when an upload is aborted. */
24
+ export declare function createAbortError(remotePath: string): DaytonaError;
25
+ /**
26
+ * Coerces every accepted upload source shape into a Node ``Readable`` so the
27
+ * downstream multipart writer has a uniform input type. Web ``ReadableStream``
28
+ * is bridged via ``Readable.fromWeb``; in-memory bytes via ``Readable.from``;
29
+ * local paths via ``fs.createReadStream``; existing ``Readable`` is passed
30
+ * through unchanged.
31
+ */
32
+ export declare function coerceUploadSource(source: UploadSource): Promise<Readable>;
33
+ /**
34
+ * Wraps an upload source in a pass-through that counts bytes and invokes
35
+ * ``onProgress`` per chunk. When ``onProgress`` is omitted the source is
36
+ * returned unchanged so there is zero overhead in the no-progress path.
37
+ */
38
+ export declare function wrapWithUploadProgress(source: Readable, onProgress: ((progress: UploadProgress) => void) | undefined, signal?: AbortSignal): Readable;
39
+ //# sourceMappingURL=FileTransfer.d.ts.map