@effect/platform 0.0.0 → 0.2.0
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/Command.d.ts +251 -0
- package/Command.d.ts.map +1 -0
- package/Command.js +164 -0
- package/Command.js.map +1 -0
- package/CommandExecutor.d.ts +140 -0
- package/CommandExecutor.d.ts.map +1 -0
- package/CommandExecutor.js +40 -0
- package/CommandExecutor.js.map +1 -0
- package/Console.d.ts +114 -12
- package/Console.d.ts.map +1 -1
- package/Console.js +109 -1
- package/Console.js.map +1 -1
- package/Error.d.ts +1 -1
- package/Error.d.ts.map +1 -1
- package/FileSystem.d.ts +246 -47
- package/FileSystem.d.ts.map +1 -1
- package/FileSystem.js +24 -1
- package/FileSystem.js.map +1 -1
- package/Path.d.ts +59 -0
- package/Path.d.ts.map +1 -0
- package/{FileSystem/File.js → Path.js} +14 -24
- package/Path.js.map +1 -0
- package/internal/command.d.ts +2 -0
- package/internal/command.d.ts.map +1 -0
- package/internal/command.js +184 -0
- package/internal/command.js.map +1 -0
- package/internal/commandExecutor.d.ts +2 -0
- package/internal/commandExecutor.d.ts.map +1 -0
- package/internal/commandExecutor.js +55 -0
- package/internal/commandExecutor.js.map +1 -0
- package/internal/console.js +63 -3
- package/internal/console.js.map +1 -1
- package/internal/fileSystem.js +3 -3
- package/internal/fileSystem.js.map +1 -1
- package/internal/path.d.ts +2 -0
- package/internal/path.d.ts.map +1 -0
- package/internal/path.js +97 -0
- package/internal/path.js.map +1 -0
- package/mjs/Command.mjs +139 -0
- package/mjs/Command.mjs.map +1 -0
- package/mjs/CommandExecutor.mjs +27 -0
- package/mjs/CommandExecutor.mjs.map +1 -0
- package/mjs/Console.mjs +90 -0
- package/mjs/Console.mjs.map +1 -1
- package/mjs/FileSystem.mjs +19 -0
- package/mjs/FileSystem.mjs.map +1 -1
- package/mjs/Path.mjs +20 -0
- package/mjs/Path.mjs.map +1 -0
- package/mjs/internal/command.mjs +159 -0
- package/mjs/internal/command.mjs.map +1 -0
- package/mjs/internal/commandExecutor.mjs +42 -0
- package/mjs/internal/commandExecutor.mjs.map +1 -0
- package/mjs/internal/console.mjs +44 -2
- package/mjs/internal/console.mjs.map +1 -1
- package/mjs/internal/fileSystem.mjs +3 -3
- package/mjs/internal/fileSystem.mjs.map +1 -1
- package/mjs/internal/path.mjs +87 -0
- package/mjs/internal/path.mjs.map +1 -0
- package/package.json +5 -4
- package/src/Command.ts +278 -0
- package/src/CommandExecutor.ts +191 -0
- package/src/Console.ts +132 -12
- package/src/Error.ts +1 -1
- package/src/FileSystem.ts +356 -119
- package/src/Path.ts +64 -0
- package/src/internal/command.ts +211 -0
- package/src/internal/commandExecutor.ts +69 -0
- package/src/internal/console.ts +92 -14
- package/src/internal/fileSystem.ts +4 -5
- package/src/internal/path.ts +101 -0
- package/FileSystem/File.d.ts +0 -91
- package/FileSystem/File.d.ts.map +0 -1
- package/FileSystem/File.js.map +0 -1
- package/mjs/FileSystem/File.mjs +0 -28
- package/mjs/FileSystem/File.mjs.map +0 -1
- package/src/FileSystem/File.ts +0 -125
package/FileSystem.d.ts
CHANGED
|
@@ -1,14 +1,157 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @since 1.0.0
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import * as Brand from "@effect/data/Brand";
|
|
5
5
|
import type { Tag } from "@effect/data/Context";
|
|
6
|
+
import type { Option } from "@effect/data/Option";
|
|
6
7
|
import type * as Effect from "@effect/io/Effect";
|
|
7
8
|
import type { Scope } from "@effect/io/Scope";
|
|
8
9
|
import type { PlatformError } from "@effect/platform/Error";
|
|
9
|
-
import type { File } from "@effect/platform/FileSystem/File";
|
|
10
10
|
import type { Sink } from "@effect/stream/Sink";
|
|
11
11
|
import type { Stream } from "@effect/stream/Stream";
|
|
12
|
+
/**
|
|
13
|
+
* @since 1.0.0
|
|
14
|
+
* @category model
|
|
15
|
+
*/
|
|
16
|
+
export interface FileSystem {
|
|
17
|
+
/**
|
|
18
|
+
* Check if a file can be accessed.
|
|
19
|
+
* You can optionally specify the level of access to check for.
|
|
20
|
+
*/
|
|
21
|
+
readonly access: (path: string, options?: AccessFileOptions) => Effect.Effect<never, PlatformError, void>;
|
|
22
|
+
/**
|
|
23
|
+
* Copy a file or directory from `fromPath` to `toPath`.
|
|
24
|
+
*
|
|
25
|
+
* Equivalent to `cp -r`.
|
|
26
|
+
*/
|
|
27
|
+
readonly copy: (fromPath: string, toPath: string, options?: CopyOptions) => Effect.Effect<never, PlatformError, void>;
|
|
28
|
+
/**
|
|
29
|
+
* Copy a file from `fromPath` to `toPath`.
|
|
30
|
+
*/
|
|
31
|
+
readonly copyFile: (fromPath: string, toPath: string) => Effect.Effect<never, PlatformError, void>;
|
|
32
|
+
/**
|
|
33
|
+
* Change the permissions of a file.
|
|
34
|
+
*/
|
|
35
|
+
readonly chmod: (path: string, mode: number) => Effect.Effect<never, PlatformError, void>;
|
|
36
|
+
/**
|
|
37
|
+
* Change the owner and group of a file.
|
|
38
|
+
*/
|
|
39
|
+
readonly chown: (path: string, uid: number, gid: number) => Effect.Effect<never, PlatformError, void>;
|
|
40
|
+
/**
|
|
41
|
+
* Create a hard link from `fromPath` to `toPath`.
|
|
42
|
+
*/
|
|
43
|
+
readonly link: (fromPath: string, toPath: string) => Effect.Effect<never, PlatformError, void>;
|
|
44
|
+
/**
|
|
45
|
+
* Create a directory at `path`. You can optionally specify the mode and
|
|
46
|
+
* whether to recursively create nested directories.
|
|
47
|
+
*/
|
|
48
|
+
readonly makeDirectory: (path: string, options?: MakeDirectoryOptions) => Effect.Effect<never, PlatformError, void>;
|
|
49
|
+
/**
|
|
50
|
+
* Create a temporary directory.
|
|
51
|
+
*
|
|
52
|
+
* By default the directory will be created inside the system's default
|
|
53
|
+
* temporary directory, but you can specify a different location by setting
|
|
54
|
+
* the `directory` option.
|
|
55
|
+
*
|
|
56
|
+
* You can also specify a prefix for the directory name by setting the
|
|
57
|
+
* `prefix` option.
|
|
58
|
+
*/
|
|
59
|
+
readonly makeTempDirectory: (options?: MakeTempDirectoryOptions) => Effect.Effect<never, PlatformError, string>;
|
|
60
|
+
/**
|
|
61
|
+
* Create a temporary directory inside a scope.
|
|
62
|
+
*
|
|
63
|
+
* Functionally equivalent to `makeTempDirectory`, but the directory will be
|
|
64
|
+
* automatically deleted when the scope is closed.
|
|
65
|
+
*/
|
|
66
|
+
readonly makeTempDirectoryScoped: (options?: MakeTempDirectoryOptions) => Effect.Effect<Scope, PlatformError, string>;
|
|
67
|
+
/**
|
|
68
|
+
* Create a temporary file.
|
|
69
|
+
* The directory creation is functionally equivalent to `makeTempDirectory`.
|
|
70
|
+
* The file name will be a randomly generated string.
|
|
71
|
+
*/
|
|
72
|
+
readonly makeTempFile: (options?: MakeTempFileOptions) => Effect.Effect<never, PlatformError, string>;
|
|
73
|
+
/**
|
|
74
|
+
* Create a temporary file inside a scope.
|
|
75
|
+
*
|
|
76
|
+
* Functionally equivalent to `makeTempFile`, but the file will be
|
|
77
|
+
* automatically deleted when the scope is closed.
|
|
78
|
+
*/
|
|
79
|
+
readonly makeTempFileScoped: (options?: MakeTempFileOptions) => Effect.Effect<Scope, PlatformError, string>;
|
|
80
|
+
/**
|
|
81
|
+
* Open a file at `path` with the specified `options`.
|
|
82
|
+
*
|
|
83
|
+
* The file handle will be automatically closed when the scope is closed.
|
|
84
|
+
*/
|
|
85
|
+
readonly open: (path: string, options?: OpenFileOptions) => Effect.Effect<Scope, PlatformError, File>;
|
|
86
|
+
/**
|
|
87
|
+
* List the contents of a directory.
|
|
88
|
+
*
|
|
89
|
+
* You can recursively list the contents of nested directories by setting the
|
|
90
|
+
* `recursive` option.
|
|
91
|
+
*/
|
|
92
|
+
readonly readDirectory: (path: string, options?: ReadDirectoryOptions) => Effect.Effect<never, PlatformError, ReadonlyArray<string>>;
|
|
93
|
+
/**
|
|
94
|
+
* Read the contents of a file.
|
|
95
|
+
*/
|
|
96
|
+
readonly readFile: (path: string) => Effect.Effect<never, PlatformError, Uint8Array>;
|
|
97
|
+
/**
|
|
98
|
+
* Read the destination of a symbolic link.
|
|
99
|
+
*/
|
|
100
|
+
readonly readLink: (path: string) => Effect.Effect<never, PlatformError, string>;
|
|
101
|
+
/**
|
|
102
|
+
* Resolve a path to its canonicalized absolute pathname.
|
|
103
|
+
*/
|
|
104
|
+
readonly realPath: (path: string) => Effect.Effect<never, PlatformError, string>;
|
|
105
|
+
/**
|
|
106
|
+
* Remove a file or directory.
|
|
107
|
+
*
|
|
108
|
+
* By setting the `recursive` option to `true`, you can recursively remove
|
|
109
|
+
* nested directories.
|
|
110
|
+
*/
|
|
111
|
+
readonly remove: (path: string, options?: RemoveOptions) => Effect.Effect<never, PlatformError, void>;
|
|
112
|
+
/**
|
|
113
|
+
* Rename a file or directory.
|
|
114
|
+
*/
|
|
115
|
+
readonly rename: (oldPath: string, newPath: string) => Effect.Effect<never, PlatformError, void>;
|
|
116
|
+
/**
|
|
117
|
+
* Create a writable `Sink` for the specified `path`.
|
|
118
|
+
*/
|
|
119
|
+
readonly sink: (path: string, options?: SinkOptions) => Sink<never, PlatformError, Uint8Array, never, void>;
|
|
120
|
+
/**
|
|
121
|
+
* Get information about a file at `path`.
|
|
122
|
+
*/
|
|
123
|
+
readonly stat: (path: string) => Effect.Effect<never, PlatformError, File.Info>;
|
|
124
|
+
/**
|
|
125
|
+
* Create a readable `Stream` for the specified `path`.
|
|
126
|
+
*
|
|
127
|
+
* Changing the `bufferSize` option will change the internal buffer size of
|
|
128
|
+
* the stream. It defaults to `4`.
|
|
129
|
+
*
|
|
130
|
+
* The `chunkSize` option will change the size of the chunks emitted by the
|
|
131
|
+
* stream. It defaults to 64kb.
|
|
132
|
+
*
|
|
133
|
+
* Changing `offset` and `bytesToRead` will change the offset and the number
|
|
134
|
+
* of bytes to read from the file.
|
|
135
|
+
*/
|
|
136
|
+
readonly stream: (path: string, options?: StreamOptions) => Stream<never, PlatformError, Uint8Array>;
|
|
137
|
+
/**
|
|
138
|
+
* Create a symbolic link from `fromPath` to `toPath`.
|
|
139
|
+
*/
|
|
140
|
+
readonly symlink: (fromPath: string, toPath: string) => Effect.Effect<never, PlatformError, void>;
|
|
141
|
+
/**
|
|
142
|
+
* Truncate a file to a specified length. If the `length` is not specified,
|
|
143
|
+
* the file will be truncated to length `0`.
|
|
144
|
+
*/
|
|
145
|
+
readonly truncate: (path: string, length?: Size) => Effect.Effect<never, PlatformError, void>;
|
|
146
|
+
/**
|
|
147
|
+
* Change the file system timestamps of the file at `path`.
|
|
148
|
+
*/
|
|
149
|
+
readonly utimes: (path: string, atime: Date | number, mtime: Date | number) => Effect.Effect<never, PlatformError, void>;
|
|
150
|
+
/**
|
|
151
|
+
* Write data to a file at `path`.
|
|
152
|
+
*/
|
|
153
|
+
readonly writeFile: (path: string, data: Uint8Array, options?: WriteFileOptions) => Effect.Effect<never, PlatformError, void>;
|
|
154
|
+
}
|
|
12
155
|
/**
|
|
13
156
|
* Represents a size in bytes.
|
|
14
157
|
*
|
|
@@ -25,6 +168,11 @@ export declare const Size: (bytes: number | bigint) => Size;
|
|
|
25
168
|
* @since 1.0.0
|
|
26
169
|
* @category model
|
|
27
170
|
*/
|
|
171
|
+
export type OpenFlag = "r" | "r+" | "w" | "wx" | "w+" | "wx+" | "a" | "ax" | "a+" | "ax+";
|
|
172
|
+
/**
|
|
173
|
+
* @since 1.0.0
|
|
174
|
+
* @category options
|
|
175
|
+
*/
|
|
28
176
|
export interface AccessFileOptions {
|
|
29
177
|
readonly ok?: boolean;
|
|
30
178
|
readonly readable?: boolean;
|
|
@@ -32,7 +180,7 @@ export interface AccessFileOptions {
|
|
|
32
180
|
}
|
|
33
181
|
/**
|
|
34
182
|
* @since 1.0.0
|
|
35
|
-
* @category
|
|
183
|
+
* @category options
|
|
36
184
|
*/
|
|
37
185
|
export interface MakeDirectoryOptions {
|
|
38
186
|
readonly recursive?: boolean;
|
|
@@ -40,7 +188,15 @@ export interface MakeDirectoryOptions {
|
|
|
40
188
|
}
|
|
41
189
|
/**
|
|
42
190
|
* @since 1.0.0
|
|
43
|
-
* @category
|
|
191
|
+
* @category options
|
|
192
|
+
*/
|
|
193
|
+
export interface CopyOptions {
|
|
194
|
+
readonly overwrite?: boolean;
|
|
195
|
+
readonly preserveTimestamps?: boolean;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* @since 1.0.0
|
|
199
|
+
* @category options
|
|
44
200
|
*/
|
|
45
201
|
export interface MakeTempDirectoryOptions {
|
|
46
202
|
readonly directory?: string;
|
|
@@ -48,7 +204,7 @@ export interface MakeTempDirectoryOptions {
|
|
|
48
204
|
}
|
|
49
205
|
/**
|
|
50
206
|
* @since 1.0.0
|
|
51
|
-
* @category
|
|
207
|
+
* @category options
|
|
52
208
|
*/
|
|
53
209
|
export interface MakeTempFileOptions {
|
|
54
210
|
readonly directory?: string;
|
|
@@ -56,12 +212,7 @@ export interface MakeTempFileOptions {
|
|
|
56
212
|
}
|
|
57
213
|
/**
|
|
58
214
|
* @since 1.0.0
|
|
59
|
-
* @category
|
|
60
|
-
*/
|
|
61
|
-
export type OpenFlag = "r" | "r+" | "w" | "wx" | "w+" | "wx+" | "a" | "ax" | "a+" | "ax+";
|
|
62
|
-
/**
|
|
63
|
-
* @since 1.0.0
|
|
64
|
-
* @category model
|
|
215
|
+
* @category options
|
|
65
216
|
*/
|
|
66
217
|
export interface OpenFileOptions {
|
|
67
218
|
readonly flag?: OpenFlag;
|
|
@@ -69,79 +220,127 @@ export interface OpenFileOptions {
|
|
|
69
220
|
}
|
|
70
221
|
/**
|
|
71
222
|
* @since 1.0.0
|
|
72
|
-
* @category
|
|
223
|
+
* @category options
|
|
73
224
|
*/
|
|
74
225
|
export interface ReadDirectoryOptions {
|
|
75
226
|
readonly recursive?: boolean;
|
|
76
227
|
}
|
|
77
228
|
/**
|
|
78
229
|
* @since 1.0.0
|
|
79
|
-
* @category
|
|
230
|
+
* @category options
|
|
80
231
|
*/
|
|
81
232
|
export interface RemoveOptions {
|
|
82
233
|
readonly recursive?: boolean;
|
|
83
234
|
}
|
|
84
235
|
/**
|
|
85
236
|
* @since 1.0.0
|
|
86
|
-
* @category
|
|
237
|
+
* @category options
|
|
87
238
|
*/
|
|
88
239
|
export interface SinkOptions extends OpenFileOptions {
|
|
89
240
|
}
|
|
90
241
|
/**
|
|
91
242
|
* @since 1.0.0
|
|
92
|
-
* @category
|
|
243
|
+
* @category options
|
|
93
244
|
*/
|
|
94
245
|
export interface StreamOptions {
|
|
95
|
-
bufferSize?: number;
|
|
96
|
-
bytesToRead?: Size;
|
|
97
|
-
chunkSize?: Size;
|
|
98
|
-
offset?: Size;
|
|
246
|
+
readonly bufferSize?: number;
|
|
247
|
+
readonly bytesToRead?: Size;
|
|
248
|
+
readonly chunkSize?: Size;
|
|
249
|
+
readonly offset?: Size;
|
|
99
250
|
}
|
|
100
251
|
/**
|
|
101
252
|
* @since 1.0.0
|
|
102
|
-
* @category
|
|
253
|
+
* @category options
|
|
103
254
|
*/
|
|
104
255
|
export interface WriteFileOptions {
|
|
105
256
|
readonly flag?: OpenFlag;
|
|
106
257
|
readonly mode?: number;
|
|
107
258
|
}
|
|
259
|
+
/**
|
|
260
|
+
* @since 1.0.0
|
|
261
|
+
* @category tag
|
|
262
|
+
*/
|
|
263
|
+
export declare const FileSystem: Tag<FileSystem, FileSystem>;
|
|
264
|
+
/**
|
|
265
|
+
* @since 1.0.0
|
|
266
|
+
* @category constructor
|
|
267
|
+
*/
|
|
268
|
+
export declare const make: (impl: Omit<FileSystem, "stream" | "sink">) => FileSystem;
|
|
269
|
+
/**
|
|
270
|
+
* @since 1.0.0
|
|
271
|
+
* @category type id
|
|
272
|
+
*/
|
|
273
|
+
export declare const FileTypeId: unique symbol;
|
|
274
|
+
/**
|
|
275
|
+
* @since 1.0.0
|
|
276
|
+
* @category type id
|
|
277
|
+
*/
|
|
278
|
+
export type FileTypeId = typeof FileTypeId;
|
|
279
|
+
/**
|
|
280
|
+
* @since 1.0.0
|
|
281
|
+
* @category guard
|
|
282
|
+
*/
|
|
283
|
+
export declare const isFile: (u: unknown) => u is File;
|
|
108
284
|
/**
|
|
109
285
|
* @since 1.0.0
|
|
110
286
|
* @category model
|
|
111
287
|
*/
|
|
112
|
-
export interface
|
|
113
|
-
readonly
|
|
114
|
-
readonly
|
|
115
|
-
readonly
|
|
116
|
-
readonly
|
|
117
|
-
readonly
|
|
118
|
-
readonly
|
|
119
|
-
readonly
|
|
120
|
-
readonly
|
|
121
|
-
readonly makeTempFile: (options?: MakeTempFileOptions) => Effect.Effect<Scope, PlatformError, File>;
|
|
122
|
-
readonly open: (path: string, options?: OpenFileOptions) => Effect.Effect<Scope, PlatformError, File>;
|
|
123
|
-
readonly readDirectory: (path: string, options?: ReadDirectoryOptions) => Effect.Effect<never, PlatformError, ReadonlyArray<string>>;
|
|
124
|
-
readonly readFile: (path: string) => Effect.Effect<never, PlatformError, Uint8Array>;
|
|
125
|
-
readonly readLink: (path: string) => Effect.Effect<never, PlatformError, string>;
|
|
126
|
-
readonly realPath: (path: string) => Effect.Effect<never, PlatformError, string>;
|
|
127
|
-
readonly remove: (path: string, options?: RemoveOptions) => Effect.Effect<never, PlatformError, void>;
|
|
128
|
-
readonly rename: (oldPath: string, newPath: string) => Effect.Effect<never, PlatformError, void>;
|
|
129
|
-
readonly sink: (path: string, options?: SinkOptions) => Sink<never, PlatformError, Uint8Array, never, void>;
|
|
130
|
-
readonly stat: (path: string) => Effect.Effect<never, PlatformError, File.Info>;
|
|
131
|
-
readonly stream: (path: string, options?: StreamOptions) => Stream<never, PlatformError, Uint8Array>;
|
|
132
|
-
readonly symlink: (fromPath: string, toPath: string) => Effect.Effect<never, PlatformError, void>;
|
|
133
|
-
readonly truncate: (path: string, length?: Size) => Effect.Effect<never, PlatformError, void>;
|
|
134
|
-
readonly utime: (path: string, atime: Date | number, mtime: Date | number) => Effect.Effect<never, PlatformError, void>;
|
|
135
|
-
readonly writeFile: (path: string, data: Uint8Array, options?: WriteFileOptions) => Effect.Effect<never, PlatformError, void>;
|
|
288
|
+
export interface File {
|
|
289
|
+
readonly [FileTypeId]: (_: never) => unknown;
|
|
290
|
+
readonly fd: File.Descriptor;
|
|
291
|
+
readonly stat: Effect.Effect<never, PlatformError, File.Info>;
|
|
292
|
+
readonly read: (buffer: Uint8Array, options?: FileReadOptions) => Effect.Effect<never, PlatformError, Size>;
|
|
293
|
+
readonly readAlloc: (size: Size, options?: FileReadOptions) => Effect.Effect<never, PlatformError, Option<Uint8Array>>;
|
|
294
|
+
readonly truncate: (length?: Size) => Effect.Effect<never, PlatformError, void>;
|
|
295
|
+
readonly write: (buffer: Uint8Array) => Effect.Effect<never, PlatformError, Size>;
|
|
296
|
+
readonly writeAll: (buffer: Uint8Array) => Effect.Effect<never, PlatformError, void>;
|
|
136
297
|
}
|
|
137
298
|
/**
|
|
138
299
|
* @since 1.0.0
|
|
139
|
-
* @category tag
|
|
140
300
|
*/
|
|
141
|
-
export declare
|
|
301
|
+
export declare namespace File {
|
|
302
|
+
/**
|
|
303
|
+
* @since 1.0.0
|
|
304
|
+
* @category model
|
|
305
|
+
*/
|
|
306
|
+
type Descriptor = Brand.Branded<number, "FileDescriptor">;
|
|
307
|
+
/**
|
|
308
|
+
* @since 1.0.0
|
|
309
|
+
* @category model
|
|
310
|
+
*/
|
|
311
|
+
type Type = "File" | "Directory" | "SymbolicLink" | "BlockDevice" | "CharacterDevice" | "FIFO" | "Socket" | "Unknown";
|
|
312
|
+
/**
|
|
313
|
+
* @since 1.0.0
|
|
314
|
+
* @category model
|
|
315
|
+
*/
|
|
316
|
+
interface Info {
|
|
317
|
+
readonly type: Type;
|
|
318
|
+
readonly mtime: Option<Date>;
|
|
319
|
+
readonly atime: Option<Date>;
|
|
320
|
+
readonly birthtime: Option<Date>;
|
|
321
|
+
readonly dev: number;
|
|
322
|
+
readonly ino: Option<number>;
|
|
323
|
+
readonly mode: number;
|
|
324
|
+
readonly nlink: Option<number>;
|
|
325
|
+
readonly uid: Option<number>;
|
|
326
|
+
readonly gid: Option<number>;
|
|
327
|
+
readonly rdev: Option<number>;
|
|
328
|
+
readonly size: Size;
|
|
329
|
+
readonly blksize: Option<Size>;
|
|
330
|
+
readonly blocks: Option<number>;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
142
333
|
/**
|
|
143
334
|
* @since 1.0.0
|
|
144
335
|
* @category constructor
|
|
145
336
|
*/
|
|
146
|
-
export declare const
|
|
337
|
+
export declare const FileDescriptor: Brand.Brand.Constructor<File.Descriptor>;
|
|
338
|
+
/**
|
|
339
|
+
* @since 1.0.0
|
|
340
|
+
* @category model
|
|
341
|
+
*/
|
|
342
|
+
export interface FileReadOptions {
|
|
343
|
+
readonly offset?: Size;
|
|
344
|
+
readonly length?: Size;
|
|
345
|
+
}
|
|
147
346
|
//# sourceMappingURL=FileSystem.d.ts.map
|
package/FileSystem.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileSystem.d.ts","sourceRoot":"","sources":["./src/FileSystem.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,KAAK,
|
|
1
|
+
{"version":3,"file":"FileSystem.d.ts","sourceRoot":"","sources":["./src/FileSystem.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAA;AAC3C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,KAAK,MAAM,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAE3D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAEnD;;;GAGG;AACH,MAAM,WAAW,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,MAAM,CAAC,MAAM,CAAC,CAAA;KAChC;CACF;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,0CAAmC,CAAA;AAE9D;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,CAAA;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,CAAA;CACvB"}
|
package/FileSystem.js
CHANGED
|
@@ -3,10 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.make = exports.Size = exports.FileSystem = void 0;
|
|
6
|
+
exports.make = exports.isFile = exports.Size = exports.FileTypeId = exports.FileSystem = exports.FileDescriptor = void 0;
|
|
7
|
+
var Brand = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/data/Brand"));
|
|
7
8
|
var internal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/internal/fileSystem"));
|
|
8
9
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
9
10
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
11
|
+
/**
|
|
12
|
+
* @since 1.0.0
|
|
13
|
+
*/
|
|
14
|
+
|
|
10
15
|
/**
|
|
11
16
|
* @since 1.0.0
|
|
12
17
|
* @category constructor
|
|
@@ -24,5 +29,23 @@ const FileSystem = internal.tag;
|
|
|
24
29
|
*/
|
|
25
30
|
exports.FileSystem = FileSystem;
|
|
26
31
|
const make = internal.make;
|
|
32
|
+
/**
|
|
33
|
+
* @since 1.0.0
|
|
34
|
+
* @category type id
|
|
35
|
+
*/
|
|
27
36
|
exports.make = make;
|
|
37
|
+
const FileTypeId = /*#__PURE__*/Symbol.for("@effect/platform/FileSystem/File");
|
|
38
|
+
/**
|
|
39
|
+
* @since 1.0.0
|
|
40
|
+
* @category guard
|
|
41
|
+
*/
|
|
42
|
+
exports.FileTypeId = FileTypeId;
|
|
43
|
+
const isFile = u => typeof u === "object" && u !== null && FileTypeId in u;
|
|
44
|
+
/**
|
|
45
|
+
* @since 1.0.0
|
|
46
|
+
* @category constructor
|
|
47
|
+
*/
|
|
48
|
+
exports.isFile = isFile;
|
|
49
|
+
const FileDescriptor = /*#__PURE__*/Brand.nominal();
|
|
50
|
+
exports.FileDescriptor = FileDescriptor;
|
|
28
51
|
//# sourceMappingURL=FileSystem.js.map
|
package/FileSystem.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileSystem.js","names":["
|
|
1
|
+
{"version":3,"file":"FileSystem.js","names":["Brand","_interopRequireWildcard","require","internal","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","Size","exports","FileSystem","tag","make","FileTypeId","Symbol","for","isFile","u","FileDescriptor","nominal"],"sources":["./src/FileSystem.ts"],"sourcesContent":[null],"mappings":";;;;;;AAGA,IAAAA,KAAA,gBAAAC,uBAAA,eAAAC,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AAAC,OAAA,CAAAD,IAAA,GAAAA,IAAA;AAIO,MAAME,UAAU,GAAgCzB,QAAQ,CAAC0B,GAAG;AAEnE;;;;AAAAF,OAAA,CAAAC,UAAA,GAAAA,UAAA;AAIO,MAAME,IAAI,GAA8D3B,QAAQ,CAAC2B,IAAI;AAE5F;;;;AAAAH,OAAA,CAAAG,IAAA,GAAAA,IAAA;AAIO,MAAMC,UAAU,gBAAkBC,MAAM,CAACC,GAAG,CACjD,kCAAkC,CACnC;AAQD;;;;AAAAN,OAAA,CAAAI,UAAA,GAAAA,UAAA;AAIO,MAAMG,MAAM,GAAIC,CAAU,IAAgB,OAAOA,CAAC,KAAK,QAAQ,IAAIA,CAAC,KAAK,IAAI,IAAIJ,UAAU,IAAII,CAAC;AA2EvG;;;;AAAAR,OAAA,CAAAO,MAAA,GAAAA,MAAA;AAIO,MAAME,cAAc,gBAAGpC,KAAK,CAACqC,OAAO,EAAmB;AAAAV,OAAA,CAAAS,cAAA,GAAAA,cAAA"}
|
package/Path.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 1.0.0
|
|
3
|
+
*/
|
|
4
|
+
import type { Tag } from "@effect/data/Context";
|
|
5
|
+
import type { Effect } from "@effect/io/Effect";
|
|
6
|
+
import type { Layer } from "@effect/io/Layer";
|
|
7
|
+
import type { BadArgument } from "@effect/platform/Error";
|
|
8
|
+
/**
|
|
9
|
+
* @since 1.0.0
|
|
10
|
+
* @category model
|
|
11
|
+
*/
|
|
12
|
+
export interface Path {
|
|
13
|
+
readonly sep: string;
|
|
14
|
+
readonly basename: (path: string, suffix?: string) => string;
|
|
15
|
+
readonly dirname: (path: string) => string;
|
|
16
|
+
readonly extname: (path: string) => string;
|
|
17
|
+
readonly format: (pathObject: Partial<Path.Parsed>) => string;
|
|
18
|
+
readonly fromFileUrl: (url: URL) => Effect<never, BadArgument, string>;
|
|
19
|
+
readonly isAbsolute: (path: string) => boolean;
|
|
20
|
+
readonly join: (...paths: ReadonlyArray<string>) => string;
|
|
21
|
+
readonly normalize: (path: string) => string;
|
|
22
|
+
readonly parse: (path: string) => Path.Parsed;
|
|
23
|
+
readonly relative: (from: string, to: string) => string;
|
|
24
|
+
readonly resolve: (...pathSegments: ReadonlyArray<string>) => string;
|
|
25
|
+
readonly toFileUrl: (path: string) => Effect<never, BadArgument, URL>;
|
|
26
|
+
readonly toNamespacedPath: (path: string) => string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* @since 1.0.0
|
|
30
|
+
*/
|
|
31
|
+
export declare namespace Path {
|
|
32
|
+
/**
|
|
33
|
+
* @since 1.0.0
|
|
34
|
+
* @category model
|
|
35
|
+
*/
|
|
36
|
+
interface Parsed {
|
|
37
|
+
readonly root: string;
|
|
38
|
+
readonly dir: string;
|
|
39
|
+
readonly base: string;
|
|
40
|
+
readonly ext: string;
|
|
41
|
+
readonly name: string;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* @since 1.0.0
|
|
46
|
+
* @category tag
|
|
47
|
+
*/
|
|
48
|
+
export declare const Path: Tag<Path, Path>;
|
|
49
|
+
/**
|
|
50
|
+
* An implementation of the Path interface that can be used in all environments
|
|
51
|
+
* (including browsers).
|
|
52
|
+
*
|
|
53
|
+
* It uses the POSIX standard for paths.
|
|
54
|
+
*
|
|
55
|
+
* @since 1.0.0
|
|
56
|
+
* @category layer
|
|
57
|
+
*/
|
|
58
|
+
export declare const layer: Layer<never, never, Path>;
|
|
59
|
+
//# sourceMappingURL=Path.d.ts.map
|
package/Path.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Path.d.ts","sourceRoot":"","sources":["./src/Path.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OA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AAI,EAAE,MAAM,KAAK,MAAM,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,CAAC,CAAA;IACrE,QAAQ,CAAC,gBAAgB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;CACpD;AAED;;GAEG;AACH,yBAAiB,IAAI,CAAC;IACpB;;;OAGG;IACH,UAAiB,MAAM;QACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;QACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;QACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;QACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;QACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KACtB;CACF;AAED;;;GAGG;AACH,eAAO,MAAM,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,IAAI,CAAiB,CAAA;AAElD;;;;;;;;GAQG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAkB,CAAA"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
var
|
|
6
|
+
exports.layer = exports.Path = void 0;
|
|
7
|
+
var internal = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/internal/path"));
|
|
8
8
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
9
9
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
10
10
|
/**
|
|
@@ -13,29 +13,19 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @since 1.0.0
|
|
16
|
-
* @category
|
|
16
|
+
* @category tag
|
|
17
17
|
*/
|
|
18
|
-
const
|
|
18
|
+
const Path = internal.Path;
|
|
19
19
|
/**
|
|
20
|
+
* An implementation of the Path interface that can be used in all environments
|
|
21
|
+
* (including browsers).
|
|
22
|
+
*
|
|
23
|
+
* It uses the POSIX standard for paths.
|
|
24
|
+
*
|
|
20
25
|
* @since 1.0.0
|
|
21
|
-
* @category
|
|
26
|
+
* @category layer
|
|
22
27
|
*/
|
|
23
|
-
exports.
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
* @category constructor
|
|
28
|
-
*/
|
|
29
|
-
exports.isFile = isFile;
|
|
30
|
-
const make = impl => ({
|
|
31
|
-
[FileTypeId]: FileTypeId,
|
|
32
|
-
...impl
|
|
33
|
-
});
|
|
34
|
-
/**
|
|
35
|
-
* @since 1.0.0
|
|
36
|
-
* @category constructor
|
|
37
|
-
*/
|
|
38
|
-
exports.make = make;
|
|
39
|
-
const Descriptor = /*#__PURE__*/Brand.nominal();
|
|
40
|
-
exports.Descriptor = Descriptor;
|
|
41
|
-
//# sourceMappingURL=File.js.map
|
|
28
|
+
exports.Path = Path;
|
|
29
|
+
const layer = internal.layer;
|
|
30
|
+
exports.layer = layer;
|
|
31
|
+
//# sourceMappingURL=Path.js.map
|
package/Path.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Path.js","names":["internal","_interopRequireWildcard","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","Path","exports","layer"],"sources":["./src/Path.ts"],"sourcesContent":[null],"mappings":";;;;;;AAQA,IAAAA,QAAA,gBAAAC,uBAAA,eAAAC,OAAA;AAA0D,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAA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