@powerlines/plugin-react 0.1.36 → 0.1.38
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/components/index.d.cts +2 -2
- package/dist/components/index.d.ts +2 -2
- package/dist/components/react-optimized.d.cts +3 -3
- package/dist/components/react-optimized.d.ts +3 -3
- package/dist/{fs-Y3B84fcf.d.cts → fs-ECFlqnPg.d.cts} +132 -179
- package/dist/{fs-Y3B84fcf.d.ts → fs-ECFlqnPg.d.ts} +132 -179
- package/dist/index.d.cts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/{runtime-Bcl8KoqS.d.ts → runtime-DDbKrrxM.d.cts} +57 -52
- package/dist/{runtime-Djft1hbQ.d.cts → runtime-hDetUSX2.d.ts} +57 -52
- package/dist/types/index.d.cts +2 -3
- package/dist/types/index.d.ts +2 -3
- package/dist/types/plugin.d.cts +2 -3
- package/dist/types/plugin.d.ts +2 -3
- package/dist/types/runtime.d.cts +2 -3
- package/dist/types/runtime.d.ts +2 -3
- package/package.json +12 -12
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, __ΩReactOptimizedBuiltinProps } from './react-optimized.cjs';
|
|
2
2
|
import '@alloy-js/core';
|
|
3
3
|
import '@alloy-js/core/jsx-runtime';
|
|
4
|
-
import '../fs-
|
|
4
|
+
import '../fs-ECFlqnPg.cjs';
|
|
5
5
|
import '@stryke/fs/resolve';
|
|
6
|
-
import '
|
|
6
|
+
import '@stryke/types/base';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { ReactOptimizedBuiltin, ReactOptimizedBuiltinProps, __ΩReactOptimizedBuiltinProps } from './react-optimized.js';
|
|
2
2
|
import '@alloy-js/core';
|
|
3
3
|
import '@alloy-js/core/jsx-runtime';
|
|
4
|
-
import '../fs-
|
|
4
|
+
import '../fs-ECFlqnPg.js';
|
|
5
5
|
import '@stryke/fs/resolve';
|
|
6
|
-
import '
|
|
6
|
+
import '@stryke/types/base';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as _alloy_js_core from '@alloy-js/core';
|
|
2
2
|
import { Children as Children$1, SourceFileProps as SourceFileProps$1 } from '@alloy-js/core';
|
|
3
3
|
import { Children } from '@alloy-js/core/jsx-runtime';
|
|
4
|
-
import {
|
|
4
|
+
import { a as StoragePreset } from '../fs-ECFlqnPg.cjs';
|
|
5
5
|
import '@stryke/fs/resolve';
|
|
6
|
-
import '
|
|
6
|
+
import '@stryke/types/base';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* A type that represents the props of a component that can have children.
|
|
@@ -46,7 +46,7 @@ type SourceFileProps = SourceFileProps$1 & ComponentProps & {
|
|
|
46
46
|
*
|
|
47
47
|
* @defaultValue false
|
|
48
48
|
*/
|
|
49
|
-
|
|
49
|
+
preset?: StoragePreset;
|
|
50
50
|
/**
|
|
51
51
|
* The metadata associated with the source file.
|
|
52
52
|
*
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as _alloy_js_core from '@alloy-js/core';
|
|
2
2
|
import { Children as Children$1, SourceFileProps as SourceFileProps$1 } from '@alloy-js/core';
|
|
3
3
|
import { Children } from '@alloy-js/core/jsx-runtime';
|
|
4
|
-
import {
|
|
4
|
+
import { a as StoragePreset } from '../fs-ECFlqnPg.js';
|
|
5
5
|
import '@stryke/fs/resolve';
|
|
6
|
-
import '
|
|
6
|
+
import '@stryke/types/base';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* A type that represents the props of a component that can have children.
|
|
@@ -46,7 +46,7 @@ type SourceFileProps = SourceFileProps$1 & ComponentProps & {
|
|
|
46
46
|
*
|
|
47
47
|
* @defaultValue false
|
|
48
48
|
*/
|
|
49
|
-
|
|
49
|
+
preset?: StoragePreset;
|
|
50
50
|
/**
|
|
51
51
|
* The metadata associated with the source file.
|
|
52
52
|
*
|
|
@@ -1,9 +1,107 @@
|
|
|
1
1
|
import { ResolveOptions as ResolveOptions$1 } from '@stryke/fs/resolve';
|
|
2
|
-
import {
|
|
2
|
+
import { MaybePromise } from '@stryke/types/base';
|
|
3
3
|
|
|
4
|
-
declare
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
declare enum StoragePreset {
|
|
5
|
+
VIRTUAL = "virtual",
|
|
6
|
+
FS = "fs"
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Interface defining the methods and properties for a storage adapter.
|
|
10
|
+
*/
|
|
11
|
+
interface StorageAdapter {
|
|
12
|
+
/**
|
|
13
|
+
* A name identifying the storage adapter type.
|
|
14
|
+
*/
|
|
15
|
+
name: string;
|
|
16
|
+
/**
|
|
17
|
+
* Checks if a key exists in the storage.
|
|
18
|
+
*
|
|
19
|
+
* @param key - The key to check for existence.
|
|
20
|
+
* @returns A promise that resolves to `true` if the key exists, otherwise `false`.
|
|
21
|
+
*/
|
|
22
|
+
exists: (key: string) => Promise<boolean>;
|
|
23
|
+
/**
|
|
24
|
+
* Synchronously checks if a key exists in the storage.
|
|
25
|
+
*
|
|
26
|
+
* @param key - The key to check for existence.
|
|
27
|
+
* @returns Returns `true` if the key exists, otherwise `false`.
|
|
28
|
+
*/
|
|
29
|
+
existsSync: (key: string) => boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Read a value associated with a key from the storage.
|
|
32
|
+
*
|
|
33
|
+
* @param key - The key to read the value for.
|
|
34
|
+
* @returns A promise that resolves to the value if found, otherwise `null`.
|
|
35
|
+
*/
|
|
36
|
+
get: (key: string) => Promise<string | null>;
|
|
37
|
+
/**
|
|
38
|
+
* Synchronously reads the value associated with a key from the storage.
|
|
39
|
+
*
|
|
40
|
+
* @param key - The key to read the value for.
|
|
41
|
+
* @returns The value if found, otherwise `null`.
|
|
42
|
+
*/
|
|
43
|
+
getSync: (key: string) => string | null;
|
|
44
|
+
/**
|
|
45
|
+
* Writes a value to the storage for the given key.
|
|
46
|
+
*
|
|
47
|
+
* @param key - The key to associate the value with.
|
|
48
|
+
* @param value - The value to store.
|
|
49
|
+
*/
|
|
50
|
+
set: (key: string, value: string) => Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Synchronously writes a value to the storage for the given key.
|
|
53
|
+
*
|
|
54
|
+
* @param key - The key to associate the value with.
|
|
55
|
+
* @param value - The value to store.
|
|
56
|
+
*/
|
|
57
|
+
setSync: (key: string, value: string) => void;
|
|
58
|
+
/**
|
|
59
|
+
* Removes a value from the storage.
|
|
60
|
+
*
|
|
61
|
+
* @param key - The key whose value should be removed.
|
|
62
|
+
*/
|
|
63
|
+
remove: (key: string) => Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Synchronously removes a value from the storage.
|
|
66
|
+
*
|
|
67
|
+
* @param key - The key whose value should be removed.
|
|
68
|
+
*/
|
|
69
|
+
removeSync: (key: string) => void;
|
|
70
|
+
/**
|
|
71
|
+
* Remove all entries from the storage that match the provided base path.
|
|
72
|
+
*
|
|
73
|
+
* @param base - The base path or prefix to clear entries from.
|
|
74
|
+
*/
|
|
75
|
+
clear: (base?: string) => Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Synchronously remove all entries from the storage that match the provided base path.
|
|
78
|
+
*
|
|
79
|
+
* @param base - The base path or prefix to clear entries from.
|
|
80
|
+
*/
|
|
81
|
+
clearSync: (base?: string) => void;
|
|
82
|
+
/**
|
|
83
|
+
* Lists all keys under the provided base path.
|
|
84
|
+
*
|
|
85
|
+
* @param base - The base path or prefix to list keys from.
|
|
86
|
+
* @returns A promise resolving to the list of keys.
|
|
87
|
+
*/
|
|
88
|
+
list: (base?: string) => Promise<string[]>;
|
|
89
|
+
/**
|
|
90
|
+
* Synchronously lists all keys under the provided base path.
|
|
91
|
+
*
|
|
92
|
+
* @param base - The base path or prefix to list keys from.
|
|
93
|
+
* @returns The list of keys.
|
|
94
|
+
*/
|
|
95
|
+
listSync: (base?: string) => string[];
|
|
96
|
+
/**
|
|
97
|
+
* Releases any resources held by the storage adapter.
|
|
98
|
+
*/
|
|
99
|
+
dispose: () => MaybePromise<void>;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* A mapping of file paths to storage adapter names and their corresponding {@link StorageAdapter} instances.
|
|
103
|
+
*/
|
|
104
|
+
type StoragePort = Record<string, StorageAdapter>;
|
|
7
105
|
interface VirtualFileMetadata {
|
|
8
106
|
/**
|
|
9
107
|
* The identifier for the file data.
|
|
@@ -23,10 +121,6 @@ interface VirtualFileMetadata {
|
|
|
23
121
|
* - `normal`: Indicates that the file is a standard file without any special role.
|
|
24
122
|
*/
|
|
25
123
|
type: string;
|
|
26
|
-
/**
|
|
27
|
-
* The output mode of the file.
|
|
28
|
-
*/
|
|
29
|
-
mode: string;
|
|
30
124
|
/**
|
|
31
125
|
* Additional metadata associated with the file.
|
|
32
126
|
*/
|
|
@@ -48,16 +142,9 @@ interface VirtualFileData {
|
|
|
48
142
|
* This string represents the purpose/function of the file in the virtual file system. A potential list of variants includes:
|
|
49
143
|
* - `builtin`: Indicates that the file is a built-in module provided by the system.
|
|
50
144
|
* - `entry`: Indicates that the file is an entry point for execution.
|
|
51
|
-
* - `chunk`: Indicates that the file is a code chunk, typically used in code-splitting scenarios.
|
|
52
|
-
* - `prebuilt-chunk`: Indicates that the file is a prebuilt code chunk.
|
|
53
|
-
* - `asset`: Indicates that the file is a static asset, such as an image or stylesheet.
|
|
54
145
|
* - `normal`: Indicates that the file is a standard file without any special role.
|
|
55
146
|
*/
|
|
56
147
|
type?: string;
|
|
57
|
-
/**
|
|
58
|
-
* The output mode of the file.
|
|
59
|
-
*/
|
|
60
|
-
mode?: string;
|
|
61
148
|
/**
|
|
62
149
|
* Additional metadata associated with the file.
|
|
63
150
|
*/
|
|
@@ -73,21 +160,18 @@ interface VirtualFile extends Required<VirtualFileData>, VirtualFileMetadata {
|
|
|
73
160
|
*/
|
|
74
161
|
timestamp: number;
|
|
75
162
|
}
|
|
76
|
-
interface
|
|
77
|
-
mode?: OutputModeType;
|
|
78
|
-
}
|
|
79
|
-
type MakeDirectoryOptions = (Mode | MakeDirectoryOptions$1) & ResolveFSOptions;
|
|
80
|
-
interface PowerlinesWriteFileOptions extends ResolveFSOptions {
|
|
163
|
+
interface WriteOptions {
|
|
81
164
|
/**
|
|
82
165
|
* Should the file skip formatting before being written?
|
|
83
166
|
*
|
|
84
167
|
* @defaultValue false
|
|
85
168
|
*/
|
|
86
169
|
skipFormat?: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Additional metadata for the file.
|
|
172
|
+
*/
|
|
173
|
+
meta?: VirtualFileMetadata;
|
|
87
174
|
}
|
|
88
|
-
type NodeWriteFileOptions = WriteFileOptions$1;
|
|
89
|
-
type WriteFileOptions = NodeWriteFileOptions | PowerlinesWriteFileOptions;
|
|
90
|
-
type WriteFileData = string | NodeJS.ArrayBufferView | VirtualFileData;
|
|
91
175
|
interface ResolveOptions extends ResolveOptions$1 {
|
|
92
176
|
/**
|
|
93
177
|
* If true, the module is being resolved as an entry point.
|
|
@@ -111,14 +195,6 @@ interface ResolveOptions extends ResolveOptions$1 {
|
|
|
111
195
|
skipNodeModulesBundle?: boolean;
|
|
112
196
|
}
|
|
113
197
|
interface VirtualFileSystemInterface {
|
|
114
|
-
/**
|
|
115
|
-
* Patches the File System to include the virtual file system (VFS) contents.
|
|
116
|
-
*/
|
|
117
|
-
[__VFS_PATCH__]: () => void;
|
|
118
|
-
/**
|
|
119
|
-
* Reverts the virtual file system (VFS) to its previous state.
|
|
120
|
-
*/
|
|
121
|
-
[__VFS_REVERT__]: () => void;
|
|
122
198
|
/**
|
|
123
199
|
* The underlying file metadata.
|
|
124
200
|
*/
|
|
@@ -131,208 +207,92 @@ interface VirtualFileSystemInterface {
|
|
|
131
207
|
* A map of module ids to their file paths.
|
|
132
208
|
*/
|
|
133
209
|
paths: Readonly<Record<string, string>>;
|
|
134
|
-
/**
|
|
135
|
-
* Check if a path or id corresponds to a virtual file **(does not actually exists on disk)**.
|
|
136
|
-
*
|
|
137
|
-
* @param pathOrId - The path or id to check.
|
|
138
|
-
* @param importer - The importer path, if any.
|
|
139
|
-
* @param options - Optional parameters for resolving the path.
|
|
140
|
-
* @returns Whether the path or id corresponds to a virtual file **(does not actually exists on disk)**.
|
|
141
|
-
*/
|
|
142
|
-
isVirtual: (pathOrId: string, importer?: string, options?: ResolveOptions) => boolean;
|
|
143
|
-
/**
|
|
144
|
-
* Check if a path or id corresponds to a file written to the file system **(actually exists on disk)**.
|
|
145
|
-
*
|
|
146
|
-
* @param pathOrId - The path or id to check.
|
|
147
|
-
* @param importer - The importer path, if any.
|
|
148
|
-
* @param options - Optional parameters for resolving the path.
|
|
149
|
-
* @returns Whether the path or id corresponds to a file written to the file system **(actually exists on disk)**.
|
|
150
|
-
*/
|
|
151
|
-
isPhysical: (pathOrId: string, importer?: string, options?: ResolveOptions) => boolean;
|
|
152
210
|
/**
|
|
153
211
|
* Checks if a file exists in the virtual file system (VFS).
|
|
154
212
|
*
|
|
155
|
-
* @param path - The path of the file
|
|
213
|
+
* @param path - The path or id of the file.
|
|
156
214
|
* @returns `true` if the file exists, otherwise `false`.
|
|
157
215
|
*/
|
|
158
|
-
|
|
216
|
+
exists: (path: string) => Promise<boolean>;
|
|
159
217
|
/**
|
|
160
|
-
* Checks if a
|
|
218
|
+
* Synchronously Checks if a file exists in the virtual file system (VFS).
|
|
161
219
|
*
|
|
162
|
-
* @param path - The path of the
|
|
163
|
-
* @returns `true` if the
|
|
220
|
+
* @param path - The path or id of the file.
|
|
221
|
+
* @returns `true` if the file exists, otherwise `false`.
|
|
164
222
|
*/
|
|
165
|
-
|
|
223
|
+
existsSync: (path: string) => boolean;
|
|
166
224
|
/**
|
|
167
|
-
* Checks if a file
|
|
225
|
+
* Checks if a file is virtual in the virtual file system (VFS).
|
|
168
226
|
*
|
|
169
|
-
* @param
|
|
170
|
-
* @returns `true` if the file
|
|
227
|
+
* @param path - The path or id of the file.
|
|
228
|
+
* @returns `true` if the file is virtual, otherwise `false`.
|
|
171
229
|
*/
|
|
172
|
-
|
|
230
|
+
isVirtual: (path: string) => boolean;
|
|
173
231
|
/**
|
|
174
232
|
* Gets the metadata of a file in the virtual file system (VFS).
|
|
175
233
|
*
|
|
176
|
-
* @param
|
|
234
|
+
* @param path - The path or id of the file.
|
|
177
235
|
* @returns The metadata of the file if it exists, otherwise undefined.
|
|
178
236
|
*/
|
|
179
|
-
getMetadata: (
|
|
180
|
-
/**
|
|
181
|
-
* Gets the stats of a file in the virtual file system (VFS).
|
|
182
|
-
*
|
|
183
|
-
* @param pathOrId - The path or id of the file.
|
|
184
|
-
* @param options - Optional parameters for getting the stats.
|
|
185
|
-
* @returns The stats of the file if it exists, otherwise undefined.
|
|
186
|
-
*/
|
|
187
|
-
lstat: (pathOrId: string, options?: StatSyncOptions & {
|
|
188
|
-
bigint?: false | undefined;
|
|
189
|
-
throwIfNoEntry: false;
|
|
190
|
-
}) => Promise<Stats>;
|
|
191
|
-
/**
|
|
192
|
-
* Gets the stats of a file in the virtual file system (VFS).
|
|
193
|
-
*
|
|
194
|
-
* @param pathOrId - The path or id of the file.
|
|
195
|
-
* @param options - Optional parameters for getting the stats.
|
|
196
|
-
* @returns The stats of the file if it exists, otherwise undefined.
|
|
197
|
-
*/
|
|
198
|
-
lstatSync: (pathOrId: string, options?: StatSyncOptions & {
|
|
199
|
-
bigint?: false | undefined;
|
|
200
|
-
throwIfNoEntry: false;
|
|
201
|
-
}) => Stats | undefined;
|
|
202
|
-
/**
|
|
203
|
-
* Gets the stats of a file in the virtual file system (VFS).
|
|
204
|
-
*
|
|
205
|
-
* @param pathOrId - The path or id of the file.
|
|
206
|
-
* @returns The stats of the file if it exists, otherwise false.
|
|
207
|
-
*/
|
|
208
|
-
stat: (pathOrId: string, options?: StatSyncOptions & {
|
|
209
|
-
bigint?: false | undefined;
|
|
210
|
-
throwIfNoEntry: false;
|
|
211
|
-
}) => Promise<Stats>;
|
|
212
|
-
/**
|
|
213
|
-
* Gets the stats of a file in the virtual file system (VFS).
|
|
214
|
-
*
|
|
215
|
-
* @param pathOrId - The path or id of the file.
|
|
216
|
-
* @returns The stats of the file if it exists, otherwise false.
|
|
217
|
-
*/
|
|
218
|
-
statSync: (pathOrId: string, options?: StatSyncOptions & {
|
|
219
|
-
bigint?: false | undefined;
|
|
220
|
-
throwIfNoEntry: false;
|
|
221
|
-
}) => Stats | undefined;
|
|
237
|
+
getMetadata: (path: string) => VirtualFileMetadata | undefined;
|
|
222
238
|
/**
|
|
223
239
|
* Lists files in a given path.
|
|
224
240
|
*
|
|
225
241
|
* @param path - The path to list files from.
|
|
226
|
-
* @param options - Options for listing files, such as encoding and recursion.
|
|
227
242
|
* @returns An array of file names in the specified path.
|
|
228
243
|
*/
|
|
229
|
-
|
|
230
|
-
encoding: BufferEncoding | null;
|
|
231
|
-
withFileTypes?: false | undefined;
|
|
232
|
-
recursive?: boolean | undefined;
|
|
233
|
-
} | BufferEncoding) => string[];
|
|
244
|
+
listSync: (path: string) => string[];
|
|
234
245
|
/**
|
|
235
246
|
* Lists files in a given path.
|
|
236
247
|
*
|
|
237
248
|
* @param path - The path to list files from.
|
|
238
|
-
* @param options - Options for listing files, such as encoding and recursion.
|
|
239
249
|
* @returns An array of file names in the specified path.
|
|
240
250
|
*/
|
|
241
|
-
|
|
242
|
-
encoding: BufferEncoding | null;
|
|
243
|
-
withFileTypes?: false | undefined;
|
|
244
|
-
recursive?: boolean | undefined;
|
|
245
|
-
} | BufferEncoding) => Promise<string[]>;
|
|
251
|
+
list: (path: string) => Promise<string[]>;
|
|
246
252
|
/**
|
|
247
253
|
* Removes a file or symbolic link in the virtual file system (VFS).
|
|
248
254
|
*
|
|
249
255
|
* @param path - The path to the file to remove.
|
|
250
256
|
* @returns A promise that resolves when the file is removed.
|
|
251
257
|
*/
|
|
252
|
-
|
|
258
|
+
removeSync: (path: string) => void;
|
|
253
259
|
/**
|
|
254
260
|
* Asynchronously removes a file or symbolic link in the virtual file system (VFS).
|
|
255
261
|
*
|
|
256
262
|
* @param path - The path to the file to remove.
|
|
257
263
|
* @returns A promise that resolves when the file is removed.
|
|
258
264
|
*/
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
* Removes a directory in the virtual file system (VFS).
|
|
262
|
-
*
|
|
263
|
-
* @param path - The path to create the directory at.
|
|
264
|
-
* @param options - Options for creating the directory.
|
|
265
|
-
*/
|
|
266
|
-
rmdirSync: (path: string, options?: RmDirOptions & ResolveFSOptions) => any;
|
|
267
|
-
/**
|
|
268
|
-
* Removes a directory in the virtual file system (VFS).
|
|
269
|
-
*
|
|
270
|
-
* @param path - The path to create the directory at.
|
|
271
|
-
* @param options - Options for creating the directory.
|
|
272
|
-
* @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.
|
|
273
|
-
*/
|
|
274
|
-
rmdir: (path: string, options?: RmDirOptions & ResolveFSOptions) => Promise<void>;
|
|
275
|
-
/**
|
|
276
|
-
* Removes a file or directory in the virtual file system (VFS).
|
|
277
|
-
*
|
|
278
|
-
* @param path - The path to the file or directory to remove.
|
|
279
|
-
* @param options - Options for removing the file or directory.
|
|
280
|
-
* @returns A promise that resolves when the file or directory is removed.
|
|
281
|
-
*/
|
|
282
|
-
rm: (path: string, options?: RmOptions & ResolveFSOptions) => Promise<void>;
|
|
283
|
-
/**
|
|
284
|
-
* Synchronously removes a file or directory in the virtual file system (VFS).
|
|
285
|
-
*
|
|
286
|
-
* @param path - The path to the file or directory to remove.
|
|
287
|
-
* @param options - Options for removing the file or directory.
|
|
288
|
-
*/
|
|
289
|
-
rmSync: (path: string, options?: RmOptions & ResolveFSOptions) => void;
|
|
290
|
-
/**
|
|
291
|
-
* Creates a directory in the virtual file system (VFS).
|
|
292
|
-
*
|
|
293
|
-
* @param path - The path to create the directory at.
|
|
294
|
-
* @param options - Options for creating the directory.
|
|
295
|
-
* @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.
|
|
296
|
-
*/
|
|
297
|
-
mkdirSync: (path: string, options?: MakeDirectoryOptions) => string | undefined;
|
|
298
|
-
/**
|
|
299
|
-
* Creates a directory in the virtual file system (VFS).
|
|
300
|
-
*
|
|
301
|
-
* @param path - The path to create the directory at.
|
|
302
|
-
* @param options - Options for creating the directory.
|
|
303
|
-
* @returns A promise that resolves to the path of the created directory, or undefined if the directory could not be created.
|
|
304
|
-
*/
|
|
305
|
-
mkdir: (path: string, options?: MakeDirectoryOptions) => Promise<string | undefined>;
|
|
265
|
+
remove: (path: string) => Promise<void>;
|
|
306
266
|
/**
|
|
307
267
|
* Reads a file from the virtual file system (VFS).
|
|
308
268
|
*
|
|
309
|
-
* @param
|
|
269
|
+
* @param path - The path or id of the file.
|
|
310
270
|
* @returns The contents of the file if it exists, otherwise undefined.
|
|
311
271
|
*/
|
|
312
|
-
|
|
272
|
+
read: (path: string) => Promise<string | undefined>;
|
|
313
273
|
/**
|
|
314
274
|
* Reads a file from the virtual file system (VFS).
|
|
315
275
|
*
|
|
316
|
-
* @param
|
|
276
|
+
* @param path - The path or id of the file.
|
|
317
277
|
*/
|
|
318
|
-
|
|
278
|
+
readSync: (path: string) => string | undefined;
|
|
319
279
|
/**
|
|
320
280
|
* Writes a file to the virtual file system (VFS).
|
|
321
281
|
*
|
|
322
282
|
* @param path - The path to the file.
|
|
323
283
|
* @param data - The contents of the file.
|
|
324
|
-
* @param options -
|
|
284
|
+
* @param options - Options for writing the file.
|
|
325
285
|
* @returns A promise that resolves when the file is written.
|
|
326
286
|
*/
|
|
327
|
-
|
|
287
|
+
write: (path: string, data: string, options?: WriteOptions) => Promise<void>;
|
|
328
288
|
/**
|
|
329
289
|
* Writes a file to the virtual file system (VFS).
|
|
330
290
|
*
|
|
331
291
|
* @param path - The path to the file.
|
|
332
292
|
* @param data - The contents of the file.
|
|
333
|
-
* @param options -
|
|
293
|
+
* @param options - Options for writing the file.
|
|
334
294
|
*/
|
|
335
|
-
|
|
295
|
+
writeSync: (path: string, data: string, options?: WriteOptions) => void;
|
|
336
296
|
/**
|
|
337
297
|
* Moves a file from one path to another in the virtual file system (VFS).
|
|
338
298
|
*
|
|
@@ -375,13 +335,6 @@ interface VirtualFileSystemInterface {
|
|
|
375
335
|
* @returns An array of file paths matching the provided pattern(s)
|
|
376
336
|
*/
|
|
377
337
|
globSync: (pattern: string | string[]) => string[];
|
|
378
|
-
/**
|
|
379
|
-
* Resolves a path or id to a file path in the virtual file system.
|
|
380
|
-
*
|
|
381
|
-
* @param pathOrId - The path or id of the file to resolve.
|
|
382
|
-
* @returns The resolved path of the file if it exists, otherwise false.
|
|
383
|
-
*/
|
|
384
|
-
realpathSync: (pathOrId: string) => string;
|
|
385
338
|
/**
|
|
386
339
|
* A helper function to resolve modules using the Jiti resolver
|
|
387
340
|
*
|
|
@@ -422,4 +375,4 @@ interface VirtualFileSystemInterface {
|
|
|
422
375
|
dispose: () => Promise<void>;
|
|
423
376
|
}
|
|
424
377
|
|
|
425
|
-
export type
|
|
378
|
+
export { type ResolveOptions as R, type StoragePort as S, type VirtualFileSystemInterface as V, StoragePreset as a, type VirtualFile as b };
|