@d0paminedriven/fs 10.0.0 → 11.0.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.
Files changed (60) hide show
  1. package/dist/docs/index.d.ts +119 -0
  2. package/dist/docs/index.js +1027 -0
  3. package/dist/extract/client.d.ts +54 -0
  4. package/dist/extract/client.js +118 -0
  5. package/dist/extract/index.d.ts +69 -0
  6. package/dist/extract/index.js +622 -0
  7. package/dist/fs/index.d.ts +19 -55
  8. package/dist/fs/index.js +88 -19
  9. package/dist/fs-atomic/index.d.ts +28 -36
  10. package/dist/fs-atomic/index.js +88 -13
  11. package/dist/fs-base/index.d.ts +105 -111
  12. package/dist/fs-base/index.js +188 -12
  13. package/dist/fs-core/index.d.ts +20 -24
  14. package/dist/fs-core/index.js +44 -16
  15. package/dist/fs-fetch/index.d.ts +48 -62
  16. package/dist/fs-fetch/index.js +146 -18
  17. package/dist/fs-size/index.d.ts +16 -28
  18. package/dist/fs-size/index.js +64 -15
  19. package/dist/fs-tmp/index.d.ts +179 -192
  20. package/dist/fs-tmp/index.js +321 -17
  21. package/dist/images/index.d.ts +447 -0
  22. package/dist/images/index.js +899 -0
  23. package/dist/images/workup.d.ts +30 -0
  24. package/dist/images/workup.js +317 -0
  25. package/dist/index.d.ts +20 -22
  26. package/dist/index.js +20 -64
  27. package/dist/ld/index.d.ts +15 -13
  28. package/dist/ld/index.js +56 -6
  29. package/dist/mime/index.d.ts +299 -294
  30. package/dist/mime/index.js +348 -13
  31. package/dist/mixins/index.d.ts +34 -0
  32. package/dist/mixins/index.js +54 -0
  33. package/dist/types/index.d.ts +279 -215
  34. package/dist/types/index.js +11 -6
  35. package/dist/types/stream.d.ts +6 -4
  36. package/dist/types/stream.js +1 -1
  37. package/dist/url/index.d.ts +15 -18
  38. package/dist/url/index.js +21 -8
  39. package/dist/utils/index.d.ts +19 -23
  40. package/dist/utils/index.js +82 -7
  41. package/package.json +33 -13
  42. package/dist/chunk-5CACVZVF.js +0 -386
  43. package/dist/chunk-5H6GE5AO.js +0 -14
  44. package/dist/chunk-7JQ56XIH.js +0 -187
  45. package/dist/chunk-7LOAFIZM.js +0 -77
  46. package/dist/chunk-7QVYU63E.js +0 -7
  47. package/dist/chunk-DNR5ZI2T.js +0 -75
  48. package/dist/chunk-L2QMQOEJ.js +0 -366
  49. package/dist/chunk-NJHN5OE3.js +0 -33
  50. package/dist/chunk-OHKRQJZH.js +0 -82
  51. package/dist/chunk-OT5JEQKW.js +0 -139
  52. package/dist/chunk-PATMSIQK.js +0 -367
  53. package/dist/chunk-PB5A7ZFD.js +0 -79
  54. package/dist/chunk-VDKUXJE7.js +0 -240
  55. package/dist/chunk-Y5QWE4EG.js +0 -1335
  56. package/dist/chunk-YRCJWFZD.js +0 -107
  57. package/dist/image/index.d.ts +0 -182
  58. package/dist/image/index.js +0 -13
  59. package/dist/image/workup.d.ts +0 -40
  60. package/dist/image/workup.js +0 -12
@@ -1,217 +1,200 @@
1
- import * as stream from 'stream';
2
- import stream__default from 'stream';
3
- import { ObjectEncodingOptions } from 'fs';
1
+ import { DocMetadataExtractor } from "../docs/index.js";
2
+ import { ImgMetadataExtractor } from "../images/index.js";
3
+ import { ObjectEncodingOptions } from "fs";
4
+ import * as stream0 from "stream";
5
+ import Stream from "stream";
4
6
 
7
+ //#region src/types/index.d.ts
5
8
  type BufferEncodingUnion = Exclude<CTR<ObjEncodingOptions, "encoding">["encoding"], null>;
6
9
  interface Dict<T> {
7
- [key: string]: T | undefined;
10
+ [key: string]: T | undefined;
8
11
  }
9
12
  interface ProcessEnv extends Dict<string> {
10
- readonly VERCEL_ENV: typeof process.env.VERCEL_ENV;
11
- readonly NODE_ENV: typeof process.env.NODE_ENV;
12
- /**
13
- * Can be used to change the default timezone at runtime
14
- */
15
- TZ?: string;
13
+ readonly VERCEL_ENV: typeof process.env.VERCEL_ENV;
14
+ readonly NODE_ENV: typeof process.env.NODE_ENV;
15
+ /**
16
+ * Can be used to change the default timezone at runtime
17
+ */
18
+ TZ?: string;
16
19
  }
17
20
  interface ProcessEnvOptions {
18
- uid?: number | undefined;
19
- gid?: number | undefined;
20
- cwd?: string | URL | undefined;
21
- env?: ProcessEnv | undefined;
21
+ uid?: number | undefined;
22
+ gid?: number | undefined;
23
+ cwd?: string | URL | undefined;
24
+ env?: ProcessEnv | undefined;
22
25
  }
23
26
  interface CommonOptions extends ProcessEnvOptions {
24
- /**
25
- * @default false
26
- */
27
- windowsHide?: boolean | undefined;
28
- /**
29
- * @default 0
30
- */
31
- timeout?: number | undefined;
27
+ /**
28
+ * @default false
29
+ */
30
+ windowsHide?: boolean | undefined;
31
+ /**
32
+ * @default 0
33
+ */
34
+ timeout?: number | undefined;
32
35
  }
33
36
  type TypedArray = Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | BigUint64Array | BigInt64Array | Float32Array | Float64Array;
34
37
  type Signals = "SIGABRT" | "SIGALRM" | "SIGBUS" | "SIGCHLD" | "SIGCONT" | "SIGFPE" | "SIGHUP" | "SIGILL" | "SIGINT" | "SIGIO" | "SIGIOT" | "SIGKILL" | "SIGPIPE" | "SIGPOLL" | "SIGPROF" | "SIGPWR" | "SIGQUIT" | "SIGSEGV" | "SIGSTKFLT" | "SIGSTOP" | "SIGSYS" | "SIGTERM" | "SIGTRAP" | "SIGTSTP" | "SIGTTIN" | "SIGTTOU" | "SIGUNUSED" | "SIGURG" | "SIGUSR1" | "SIGUSR2" | "SIGVTALRM" | "SIGWINCH" | "SIGXCPU" | "SIGXFSZ" | "SIGBREAK" | "SIGLOST" | "SIGINFO";
35
38
  type ArrayBufferView = DataView | TypedArray;
36
39
  type IOType = "overlapped" | "pipe" | "ignore" | "inherit";
37
- type StdioOptions = IOType | (IOType | "ipc" | stream.Stream | number | null | undefined)[];
40
+ type StdioOptions = IOType | (IOType | "ipc" | stream0.Stream | number | null | undefined)[];
38
41
  interface CommonExecOptions extends CommonOptions {
39
- input?: string | ArrayBufferView | undefined;
40
- /**
41
- * Can be set to 'pipe', 'inherit, or 'ignore', or an array of these strings.
42
- * If passed as an array, the first element is used for `stdin`, the second for
43
- * `stdout`, and the third for `stderr`. A fourth element can be used to
44
- * specify the `stdio` behavior beyond the standard streams.
45
- *
46
- * @default 'pipe'
47
- */
48
- stdio?: StdioOptions | undefined;
49
- killSignal?: Signals | number | undefined;
50
- maxBuffer?: number | undefined;
51
- encoding?: BufferEncoding | "buffer" | null | undefined;
42
+ input?: string | ArrayBufferView | undefined;
43
+ /**
44
+ * Can be set to 'pipe', 'inherit, or 'ignore', or an array of these strings.
45
+ * If passed as an array, the first element is used for `stdin`, the second for
46
+ * `stdout`, and the third for `stderr`. A fourth element can be used to
47
+ * specify the `stdio` behavior beyond the standard streams.
48
+ *
49
+ * @default 'pipe'
50
+ */
51
+ stdio?: StdioOptions | undefined;
52
+ killSignal?: Signals | number | undefined;
53
+ maxBuffer?: number | undefined;
54
+ encoding?: BufferEncoding | "buffer" | null | undefined;
52
55
  }
53
56
  interface ExecSyncOptions extends CommonExecOptions {
54
- shell?: string | undefined;
57
+ shell?: string | undefined;
55
58
  }
56
59
  interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions {
57
- encoding: BufferEncoding;
60
+ encoding: BufferEncoding;
58
61
  }
59
62
  interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions {
60
- encoding?: "buffer" | null | undefined;
61
- }
62
- interface ObjEncodingOptions extends ObjectEncodingOptions {
63
+ encoding?: "buffer" | null | undefined;
63
64
  }
65
+ interface ObjEncodingOptions extends ObjectEncodingOptions {}
64
66
  type OpenMode = string | number;
65
67
  interface Abortable {
66
- /**
67
- * When provided the corresponding `AbortController` can be used to cancel an asynchronous action.
68
- */
69
- signal?: AbortSignal | undefined;
68
+ /**
69
+ * When provided the corresponding `AbortController` can be used to cancel an asynchronous action.
70
+ */
71
+ signal?: AbortSignal | undefined;
70
72
  }
71
73
  type Mode = string | number;
72
74
  interface MkDirOptions {
73
- /**
74
- * Indicates whether parent folders should be created.
75
- * If a folder was created, the path to the first created folder will be returned.
76
- * @default false
77
- */
78
- recursive?: boolean | undefined;
79
- /**
80
- * A file mode. If a string is passed, it is parsed as an octal integer. If not specified
81
- * @default 0o777
82
- */
83
- mode?: Mode | undefined;
75
+ /**
76
+ * Indicates whether parent folders should be created.
77
+ * If a folder was created, the path to the first created folder will be returned.
78
+ * @default false
79
+ */
80
+ recursive?: boolean | undefined;
81
+ /**
82
+ * A file mode. If a string is passed, it is parsed as an octal integer. If not specified
83
+ * @default 0o777
84
+ */
85
+ mode?: Mode | undefined;
84
86
  }
85
87
  type BashEnv = "development" | "production" | "test" | undefined;
86
88
  type WriteStreamProps<T extends string = string> = {
87
- data: WriteableDataType;
88
- cwd: string;
89
- path: T;
89
+ data: WriteableDataType;
90
+ cwd: string;
91
+ path: T;
90
92
  };
91
93
  type WriteStreamOptions = XOR<BufferEncodingUnion, {
92
- encoding?: BufferEncodingUnion;
93
- autoClose?: boolean;
94
- emitClose?: boolean;
95
- start?: number;
96
- highWaterMark?: number;
97
- flush?: boolean;
94
+ encoding?: BufferEncodingUnion;
95
+ autoClose?: boolean;
96
+ emitClose?: boolean;
97
+ start?: number;
98
+ highWaterMark?: number;
99
+ flush?: boolean;
98
100
  }>;
99
101
  type WriteableDataType = string | Buffer | NodeJS.TypedArray | NodeJS.NonSharedDataView;
100
- type WriteFileAsyncDataType = string | NodeJS.ArrayBufferView | Iterable<string | NodeJS.ArrayBufferView> | AsyncIterable<string | NodeJS.ArrayBufferView> | stream__default;
102
+ type WriteFileAsyncDataType = string | NodeJS.ArrayBufferView | Iterable<string | NodeJS.ArrayBufferView> | AsyncIterable<string | NodeJS.ArrayBufferView> | Stream;
101
103
  interface ReadDirOptionsEntity extends ObjEncodingOptions {
102
- withFileTypes?: false | undefined;
103
- recursive?: boolean | undefined;
104
+ withFileTypes?: false | undefined;
105
+ recursive?: boolean | undefined;
104
106
  }
105
- type ReadDirOptions = {
106
- [P in keyof ReadDirOptionsEntity]: ReadDirOptionsEntity[P];
107
- };
107
+ type ReadDirOptions = { [P in keyof ReadDirOptionsEntity]: ReadDirOptionsEntity[P] };
108
108
  type WriteFileAsyncOptions = XOR<ObjEncodingOptions & {
109
+ mode?: Mode | undefined;
110
+ flag?: OpenMode | undefined;
111
+ flush?: boolean | undefined;
112
+ } & Abortable, BufferEncodingUnion> | null;
113
+ type WriteFileAsyncProps<T extends string = string> = {
114
+ path: T;
115
+ data: WriteableDataType;
116
+ options?: (ObjEncodingOptions & {
109
117
  mode?: Mode | undefined;
110
118
  flag?: OpenMode | undefined;
111
119
  flush?: boolean | undefined;
112
- } & Abortable, BufferEncodingUnion> | null;
113
- type WriteFileAsyncProps<T extends string = string> = {
114
- path: T;
115
- data: WriteableDataType;
116
- options?: (ObjEncodingOptions & {
117
- mode?: Mode | undefined;
118
- flag?: OpenMode | undefined;
119
- flush?: boolean | undefined;
120
- } & Abortable) | BufferEncodingUnion | null;
120
+ } & Abortable) | BufferEncodingUnion | null;
121
121
  };
122
122
  type RmOptions = {
123
- /**
124
- * When `true`, exceptions will be ignored if `path` does not exist.
125
- * @default true
126
- */
127
- force?: boolean | undefined;
128
- /**
129
- * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or
130
- * `EPERM` error is encountered, Node.js will retry the operation with a linear
131
- * backoff wait of `retryDelay` ms longer on each try. This option represents the
132
- * number of retries. This option is ignored if the `recursive` option is not
133
- * `true`.
134
- * @default 0
135
- */
136
- maxRetries?: number | undefined;
137
- /**
138
- * If `true`, perform a recursive directory removal. In
139
- * recursive mode, operations are retried on failure.
140
- * @default true
141
- */
142
- recursive?: boolean | undefined;
143
- /**
144
- * The amount of time in milliseconds to wait between retries.
145
- * This option is ignored if the `recursive` option is not `true`.
146
- * @default 100
147
- */
148
- retryDelay?: number | undefined;
123
+ /**
124
+ * When `true`, exceptions will be ignored if `path` does not exist.
125
+ * @default true
126
+ */
127
+ force?: boolean | undefined;
128
+ /**
129
+ * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or
130
+ * `EPERM` error is encountered, Node.js will retry the operation with a linear
131
+ * backoff wait of `retryDelay` ms longer on each try. This option represents the
132
+ * number of retries. This option is ignored if the `recursive` option is not
133
+ * `true`.
134
+ * @default 0
135
+ */
136
+ maxRetries?: number | undefined;
137
+ /**
138
+ * If `true`, perform a recursive directory removal. In
139
+ * recursive mode, operations are retried on failure.
140
+ * @default true
141
+ */
142
+ recursive?: boolean | undefined;
143
+ /**
144
+ * The amount of time in milliseconds to wait between retries.
145
+ * This option is ignored if the `recursive` option is not `true`.
146
+ * @default 100
147
+ */
148
+ retryDelay?: number | undefined;
149
149
  };
150
150
  type NoParamCallback = (err: NodeJS.ErrnoException | null) => void;
151
151
  type ReadDirProps<T extends string> = {
152
- path: T;
153
- options?: ReadDirOptions;
152
+ path: T;
153
+ options?: ReadDirOptions;
154
154
  };
155
155
  type MkDirSyncOptions = Mode | (MkDirOptions & {
156
- recursive?: boolean | undefined;
156
+ recursive?: boolean | undefined;
157
157
  }) | null | undefined;
158
158
  type MkDirSyncProps<T extends string> = {
159
- cwd: string;
160
- path: T;
161
- options?: Mode | (MkDirOptions & {
162
- recursive?: boolean | undefined;
163
- }) | null | undefined;
159
+ cwd: string;
160
+ path: T;
161
+ options?: Mode | (MkDirOptions & {
162
+ recursive?: boolean | undefined;
163
+ }) | null | undefined;
164
164
  };
165
165
  interface ExecuteCommandProps<T extends string> extends ExecSyncOptionsWithBufferEncoding {
166
- command: T;
166
+ command: T;
167
167
  }
168
168
  type ConditionalPromise<T> = T | Promise<T>;
169
169
  type UnwrapPromise<T> = T extends Promise<infer U> | PromiseLike<infer U> ? U : T;
170
170
  type Unenumerate<T> = T extends (infer U)[] | readonly (infer U)[] ? U : T;
171
- type Rm<T, P extends keyof T = keyof T> = {
172
- [S in keyof T as Exclude<S, P>]: T[S];
173
- };
171
+ type Rm<T, P$1 extends keyof T = keyof T> = { [S in keyof T as Exclude<S, P$1>]: T[S] };
174
172
  /**
175
173
  * helper workup for use in XOR type below
176
174
  * makes properties from U optional and undefined in T, and vice versa
177
175
  */
178
- type Without<T, U> = {
179
- [P in Exclude<keyof T, keyof U>]?: never;
180
- };
176
+ type Without<T, U$1> = { [P in Exclude<keyof T, keyof U$1>]?: never };
181
177
  /**
182
178
  * enforces mutual exclusivity of T | U
183
179
  */
184
- type XOR<T, U> = [
185
- T,
186
- U
187
- ] extends [object, object] ? (Without<T, U> & U) | (Without<U, T> & T) : T | U;
180
+ type XOR<T, U$1> = [T, U$1] extends [object, object] ? (Without<T, U$1> & U$1) | (Without<U$1, T> & T) : T | U$1;
188
181
  /**
189
182
  * Conditional to Required
190
183
  */
191
- type CTR<T, K extends keyof OnlyOptional<T> = keyof OnlyOptional<T>> = Rm<T, K> & {
192
- [Q in K]-?: T[Q];
193
- };
184
+ type CTR<T, K$1 extends keyof OnlyOptional<T> = keyof OnlyOptional<T>> = Rm<T, K$1> & { [Q in K$1]-?: T[Q] };
194
185
  /**
195
186
  * Required to Conditional
196
187
  */
197
- type RTC<T, K extends keyof OnlyRequired<T> = keyof OnlyRequired<T>> = Rm<T, K> & {
198
- [Q in K]?: T[Q];
199
- };
200
- type IsExact<T, U> = [T] extends [U] ? [U] extends [T] ? true : false : false;
188
+ type RTC<T, K$1 extends keyof OnlyRequired<T> = keyof OnlyRequired<T>> = Rm<T, K$1> & { [Q in K$1]?: T[Q] };
189
+ type IsExact<T, U$1> = [T] extends [U$1] ? [U$1] extends [T] ? true : false : false;
201
190
  /**
202
191
  * To Conditionally never
203
192
  */
204
- type TCN<T, X extends keyof T = keyof T> = Rm<T, X> & {
205
- [Q in X]?: XOR<T[Q], never>;
206
- };
207
- type ArrFieldReplacer<T extends unknown[] | readonly unknown[], V extends keyof Unenumerate<T>, Q extends boolean = false, P = unknown> = T extends (infer U)[] | readonly (infer U)[] ? V extends keyof U ? Q extends true ? P extends Record<infer Y, infer X> ? (Rm<U, V> & Record<Y, X>)[] : (Rm<U, V> & P)[] : Q extends false ? Rm<U, V>[] : U : T : T;
208
- type IsOptional<T, K extends keyof T> = undefined extends T[K] ? object extends Pick<T, K> ? true : false : false;
209
- type OnlyOptional<T> = {
210
- [K in keyof T as IsOptional<T, K> extends true ? K : never]: T[K];
211
- };
212
- type OnlyRequired<T> = {
213
- [K in keyof T as IsOptional<T, K> extends false ? K : never]: T[K];
214
- };
193
+ type TCN<T, X$1 extends keyof T = keyof T> = Rm<T, X$1> & { [Q in X$1]?: XOR<T[Q], never> };
194
+ type ArrFieldReplacer<T extends unknown[] | readonly unknown[], V extends keyof Unenumerate<T>, Q$1 extends boolean = false, P$1 = unknown> = T extends (infer U)[] | readonly (infer U)[] ? V extends keyof U ? Q$1 extends true ? P$1 extends Record<infer Y, infer X> ? (Rm<U, V> & Record<Y, X>)[] : (Rm<U, V> & P$1)[] : Q$1 extends false ? Rm<U, V>[] : U : T : T;
195
+ type IsOptional<T, K$1 extends keyof T> = undefined extends T[K$1] ? object extends Pick<T, K$1> ? true : false : false;
196
+ type OnlyOptional<T> = { [K in keyof T as IsOptional<T, K> extends true ? K : never]: T[K] };
197
+ type OnlyRequired<T> = { [K in keyof T as IsOptional<T, K> extends false ? K : never]: T[K] };
215
198
  /**
216
199
  * Expect that the thing passed to Expect<T> is true.
217
200
  *
@@ -219,9 +202,7 @@ type OnlyRequired<T> = {
219
202
  * `Expect<false>` will error.
220
203
  */
221
204
  type Expect<T extends true> = T;
222
- type RemoveFields<T, P extends keyof T = keyof T> = {
223
- [S in keyof T as Exclude<S, P>]: T[S];
224
- };
205
+ type RemoveFields<T, P$1 extends keyof T = keyof T> = { [S in keyof T as Exclude<S, P$1>]: T[S] };
225
206
  /**
226
207
  * Checks that X and Y are exactly equal.
227
208
  *
@@ -233,7 +214,7 @@ type RemoveFields<T, P extends keyof T = keyof T> = {
233
214
  * is true. But `Equal<{ a: string; b: string }, { a: string; } & { b: string }>`
234
215
  * is false.
235
216
  */
236
- type Equal<X, Y> = (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y ? 1 : 2 ? true : false;
217
+ type Equal<X$1, Y$1> = (<T>() => T extends X$1 ? 1 : 2) extends (<T>() => (T extends Y$1 ? 1 : 2)) ? true : false;
237
218
  /**
238
219
  * Checks that Y is assignable to X.
239
220
  *
@@ -243,89 +224,172 @@ type Equal<X, Y> = (<T>() => T extends X ? 1 : 2) extends <T>() => T extends Y ?
243
224
  * But `Extends<'a', string>` is false. This is because a string
244
225
  * CANNOT be passed to a function which expects 'a'.
245
226
  */
246
- type Extends<X, Y> = Y extends X ? true : false;
247
- type DX<Y> = {
248
- [P in keyof Y]: Y[P];
249
- };
250
- type DeepPartial<T> = T extends object ? {
251
- [P in keyof T]?: DeepPartial<T[P]>;
252
- } : T;
253
- type DeepPartialFields<T, K extends keyof T> = Omit<T, K> & {
254
- [P in K]?: DeepPartial<T[P]>;
255
- };
256
- type DeepReplace<T, From, To> = T extends From ? To : T extends object ? {
257
- [K in keyof T]: DeepReplace<T[K], From, To>;
258
- } : T;
227
+ type Extends<X$1, Y$1> = Y$1 extends X$1 ? true : false;
228
+ type DX<Y$1> = { [P in keyof Y$1]: Y$1[P] };
229
+ type DeepPartial<T> = T extends object ? { [P in keyof T]?: DeepPartial<T[P]> } : T;
230
+ type DeepPartialFields<T, K$1 extends keyof T> = Omit<T, K$1> & { [P in K$1]?: DeepPartial<T[P]> };
231
+ type DeepReplace<T, From, To> = T extends From ? To : T extends object ? { [K in keyof T]: DeepReplace<T[K], From, To> } : T;
259
232
  type RequireNested<T, Path extends string> = Path extends `${infer K}.${infer Rest}` ? K extends keyof T ? Rm<T, K> & Record<K, RequireNested<Required<T>[K], Rest>> : T : Path extends keyof T ? Rm<T, Path> & Record<Path, Required<T>[Path]> : T;
260
- type ConditionalToRequired<T, Z extends keyof T = keyof T> = Rm<T, Z> & {
261
- [Q in Z]-?: T[Q];
262
- };
263
- type RequiredToConditional<T, X extends keyof T = keyof T> = Rm<T, X> & {
264
- [Q in X]?: T[Q];
265
- };
266
- type FieldToConditionallyNever<T, X extends keyof T = keyof T> = Rm<T, X> & {
267
- [Q in X]?: XOR<T[Q], never>;
268
- };
269
- type ExcludeFieldEnumerable<T, K extends keyof T> = Rm<T, K>;
233
+ type ConditionalToRequired<T, Z extends keyof T = keyof T> = Rm<T, Z> & { [Q in Z]-?: T[Q] };
234
+ type RequiredToConditional<T, X$1 extends keyof T = keyof T> = Rm<T, X$1> & { [Q in X$1]?: T[Q] };
235
+ type FieldToConditionallyNever<T, X$1 extends keyof T = keyof T> = Rm<T, X$1> & { [Q in X$1]?: XOR<T[Q], never> };
236
+ type ExcludeFieldEnumerable<T, K$1 extends keyof T> = Rm<T, K$1>;
270
237
  type ArrayOrReadOnlyArray<T> = T[] | readonly T[];
271
- type Depth<Y extends {
272
- [record: string | symbol | number]: unknown;
273
- }, X extends keyof Y = keyof Y> = {
274
- [H in keyof Y[X]]: Y[X][H][keyof Y[X][H]];
275
- };
238
+ type Depth<Y$1 extends {
239
+ [record: string | symbol | number]: unknown;
240
+ }, X$1 extends keyof Y$1 = keyof Y$1> = { [H in keyof Y$1[X$1]]: Y$1[X$1][H][keyof Y$1[X$1][H]] };
276
241
  type InferDepth<T> = T extends Depth<infer U, infer X> ? U[X] : T;
277
242
  type OmitSrc<T> = T extends `src/${infer U}` ? U : T;
278
243
  type InjectScriptsProps<T> = {
279
- content: {
280
- scripts: {
281
- [record: string]: string;
282
- };
283
- } & {
284
- [record: string]: string | number | boolean | {
285
- [record: string]: string;
286
- };
244
+ content: {
245
+ scripts: {
246
+ [record: string]: string;
287
247
  };
288
- tuplesToInject: T;
248
+ } & {
249
+ [record: string]: string | number | boolean | {
250
+ [record: string]: string;
251
+ };
252
+ };
253
+ tuplesToInject: T;
289
254
  };
290
255
  type ParsedUrlInfo = {
291
- href: string;
292
- protocol: string;
293
- baseUrl: string;
294
- host: string;
295
- pathname: string;
296
- search: string;
297
- hash: string;
256
+ href: string;
257
+ protocol: string;
258
+ baseUrl: string;
259
+ host: string;
260
+ pathname: string;
261
+ search: string;
262
+ hash: string;
298
263
  };
299
264
  declare const unitsObj: {
300
- readonly PB: 5;
301
- readonly TB: 4;
302
- readonly GB: 3;
303
- readonly MB: 2;
304
- readonly KB: 1;
305
- readonly B: 0;
265
+ readonly PB: 5;
266
+ readonly TB: 4;
267
+ readonly GB: 3;
268
+ readonly MB: 2;
269
+ readonly KB: 1;
270
+ readonly B: 0;
306
271
  };
307
272
  type Unit = keyof typeof unitsObj;
308
273
  type SizeOpts = {
309
- decimals?: number;
310
- includeUnits?: boolean;
274
+ decimals?: number;
275
+ includeUnits?: boolean;
311
276
  };
312
277
  interface ImageSpecs {
313
- width: number;
314
- height: number;
315
- format: "apng" | "png" | "jpeg" | "gif" | "bmp" | "webp" | "avif" | "svg" | "ico" | "heic" | "tiff" | "unknown";
316
- frames: number;
317
- animated: boolean;
318
- hasAlpha: boolean | null;
319
- orientation: number | null;
320
- aspectRatio: number;
321
- colorModel: "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck" | "vector" | "lab" | "unknown";
322
- colorSpace: "unknown" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "cmyk" | "lab" | "xyz" | "gray";
323
- iccProfile: string | null;
324
- exifDateTimeOriginal: string | null;
278
+ type: "IMAGE";
279
+ width: number;
280
+ height: number;
281
+ format: "apng" | "png" | "jpeg" | "gif" | "bmp" | "webp" | "avif" | "svg" | "ico" | "heic" | "tiff" | "unknown";
282
+ frames: number;
283
+ animated: boolean;
284
+ hasAlpha: boolean | null;
285
+ orientation: number | null;
286
+ aspectRatio: number;
287
+ colorModel: "rgb" | "rgba" | "grayscale" | "grayscale-alpha" | "indexed" | "cmyk" | "ycbcr" | "ycck" | "vector" | "lab" | "unknown";
288
+ colorSpace: "unknown" | "srgb" | "display_p3" | "adobe_rgb" | "prophoto_rgb" | "rec2020" | "rec709" | "cmyk" | "lab" | "xyz" | "gray";
289
+ iccProfile: string | null;
290
+ exifDateTimeOriginal: string | null;
291
+ metadata?: Record<string, string>;
325
292
  }
326
293
  interface BoxInfo {
327
- pos: number;
328
- size: number;
294
+ pos: number;
295
+ size: number;
329
296
  }
330
-
331
- export { type Abortable, type ArrFieldReplacer, type ArrayBufferView, type ArrayOrReadOnlyArray, type BashEnv, type BoxInfo, type BufferEncodingUnion, type CTR, type CommonExecOptions, type CommonOptions, type ConditionalPromise, type ConditionalToRequired, type DX, type DeepPartial, type DeepPartialFields, type DeepReplace, type Depth, type Dict, type Equal, type ExcludeFieldEnumerable, type ExecSyncOptions, type ExecSyncOptionsWithBufferEncoding, type ExecSyncOptionsWithStringEncoding, type ExecuteCommandProps, type Expect, type Extends, type FieldToConditionallyNever, type IOType, type ImageSpecs, type InferDepth, type InjectScriptsProps, type IsExact, type IsOptional, type MkDirOptions, type MkDirSyncOptions, type MkDirSyncProps, type Mode, type NoParamCallback, type ObjEncodingOptions, type OmitSrc, type OnlyOptional, type OnlyRequired, type OpenMode, type ParsedUrlInfo, type ProcessEnv, type ProcessEnvOptions, type RTC, type ReadDirOptions, type ReadDirOptionsEntity, type ReadDirProps, type RemoveFields, type RequireNested, type RequiredToConditional, type Rm, type RmOptions, type Signals, type SizeOpts, type StdioOptions, type TCN, type TypedArray, type Unenumerate, type Unit, type UnwrapPromise, type Without, type WriteFileAsyncDataType, type WriteFileAsyncOptions, type WriteFileAsyncProps, type WriteStreamOptions, type WriteStreamProps, type WriteableDataType, type XOR, unitsObj };
297
+ interface PdfDocSpecs {
298
+ pdfVersion: string | null;
299
+ isEncrypted: boolean | null;
300
+ isSearchable: boolean | null;
301
+ isLinearized: boolean | null;
302
+ hasForm: boolean | null;
303
+ hasSignatures: boolean | null;
304
+ hasAttachments: boolean | null;
305
+ hasJavaScript: boolean | null;
306
+ permissions: {
307
+ printing: boolean;
308
+ modifying: boolean;
309
+ copying: boolean;
310
+ annotating: boolean;
311
+ } | null;
312
+ }
313
+ interface SpreadSheetDocSpecs {
314
+ sheetCount: number | null;
315
+ sheetNames: string[] | null;
316
+ hasFormulas: boolean | null;
317
+ hasMacros: boolean | null;
318
+ hasPivotTables: boolean | null;
319
+ hasCharts: boolean | null;
320
+ activeSheet: number | null;
321
+ }
322
+ interface PresentationDocSpecs {
323
+ slideCount: number | null;
324
+ hasAnimations: boolean | null;
325
+ hasTransitions: boolean | null;
326
+ hasNotes: boolean | null;
327
+ hasMasterSlides: boolean | null;
328
+ presentationFormat: "standard" | "widescreen" | null;
329
+ }
330
+ interface DocSpecs {
331
+ type: "DOCUMENT";
332
+ format: string | null;
333
+ mimeType: string | null;
334
+ pageCount: number | null;
335
+ wordCount: number | null;
336
+ lineCount: number | null;
337
+ language: string | null;
338
+ encoding: string | null;
339
+ author: string | null;
340
+ subject: string | null;
341
+ keywords: string[] | null;
342
+ pdfVersion: string | null;
343
+ isEncrypted: boolean | null;
344
+ isSearchable: boolean | null;
345
+ isLinearized: boolean | null;
346
+ textPreview: string | null;
347
+ createdDate: string | null;
348
+ modifiedDate: string | null;
349
+ }
350
+ type ZipEntry = {
351
+ name: string;
352
+ compressedSize: number;
353
+ uncompressedSize: number;
354
+ compressionMethod: number;
355
+ localHeaderOffset: number;
356
+ };
357
+ interface ExpandedImgSpecs extends ImageSpecs {
358
+ source?: string;
359
+ fetchedBytes?: number;
360
+ byteSize?: number;
361
+ contentType?: string;
362
+ }
363
+ interface ExpandedDocSpecs extends DocSpecs {
364
+ source?: string;
365
+ fetchedBytes?: number;
366
+ byteSize?: number;
367
+ contentType?: string;
368
+ }
369
+ type Constructor<A extends any[] = any[], I = object> = new (...args: A) => I;
370
+ interface ExtractorOptions {
371
+ img?: ImgMetadataExtractor;
372
+ docs?: DocMetadataExtractor;
373
+ }
374
+ interface ExtractorHardenedOptions extends ExtractorOptions {
375
+ headers?: {
376
+ [key: string]: string;
377
+ };
378
+ /** CORS mode for fetch requests (browser environments). Default: 'cors' */
379
+ corsMode?: RequestMode;
380
+ /** Credentials mode for fetch requests. Default: 'same-origin' */
381
+ credentials?: RequestCredentials;
382
+ /** Given a CF URL, return an origin (S3/R2) URL for the same object. */
383
+ originFallback?: (cfUrl: string) => Promise<string> | string;
384
+ /** Invalidate one CF key (path or full URL OK; implementer can map to key). */
385
+ invalidateCloudFrontKey?: (urlOrKey: string) => Promise<void>;
386
+ /** Quarantine duration for suspect URLs (ms). Default: 6h */
387
+ quarantineTtlMs?: number;
388
+ /** Custom UA string for diagnostics */
389
+ userAgent?: string;
390
+ /** Enable verbose debug logging */
391
+ debug?: boolean;
392
+ }
393
+ //#endregion
394
+ export { Abortable, ArrFieldReplacer, ArrayBufferView, ArrayOrReadOnlyArray, BashEnv, BoxInfo, BufferEncodingUnion, CTR, CommonExecOptions, CommonOptions, ConditionalPromise, ConditionalToRequired, Constructor, DX, DeepPartial, DeepPartialFields, DeepReplace, Depth, Dict, DocSpecs, Equal, ExcludeFieldEnumerable, ExecSyncOptions, ExecSyncOptionsWithBufferEncoding, ExecSyncOptionsWithStringEncoding, ExecuteCommandProps, ExpandedDocSpecs, ExpandedImgSpecs, Expect, Extends, ExtractorHardenedOptions, ExtractorOptions, FieldToConditionallyNever, IOType, ImageSpecs, InferDepth, InjectScriptsProps, IsExact, IsOptional, MkDirOptions, MkDirSyncOptions, MkDirSyncProps, Mode, NoParamCallback, ObjEncodingOptions, OmitSrc, OnlyOptional, OnlyRequired, OpenMode, ParsedUrlInfo, PdfDocSpecs, PresentationDocSpecs, ProcessEnv, ProcessEnvOptions, RTC, ReadDirOptions, ReadDirOptionsEntity, ReadDirProps, RemoveFields, RequireNested, RequiredToConditional, Rm, RmOptions, Signals, SizeOpts, SpreadSheetDocSpecs, StdioOptions, TCN, TypedArray, Unenumerate, Unit, UnwrapPromise, Without, WriteFileAsyncDataType, WriteFileAsyncOptions, WriteFileAsyncProps, WriteStreamOptions, WriteStreamProps, WriteableDataType, XOR, ZipEntry, unitsObj };
395
+ //# sourceMappingURL=index.d.ts.map
@@ -1,8 +1,13 @@
1
- import {
2
- unitsObj
3
- } from "../chunk-5H6GE5AO.js";
4
- import "../chunk-7QVYU63E.js";
5
- export {
6
- unitsObj
1
+ //#region src/types/index.ts
2
+ const unitsObj = {
3
+ PB: 5,
4
+ TB: 4,
5
+ GB: 3,
6
+ MB: 2,
7
+ KB: 1,
8
+ B: 0
7
9
  };
10
+
11
+ //#endregion
12
+ export { unitsObj };
8
13
  //# sourceMappingURL=index.js.map
@@ -1,10 +1,12 @@
1
- import { ReadableStream } from 'stream/web';
2
- import { Readable } from 'node:stream';
1
+ import { Readable } from "node:stream";
2
+ import { ReadableStream } from "stream/web";
3
3
 
4
+ //#region src/types/stream.d.ts
4
5
  type Bin = Buffer | Uint8Array;
5
6
  type WebRS = ReadableStream<Uint8Array>;
6
7
  type AsyncIter = AsyncIterable<Uint8Array>;
7
8
  /** Inputs you actually accept — no `any`, no lies. */
8
9
  type Streamable = string | Bin | WebRS | AsyncIter | Readable;
9
-
10
- export type { AsyncIter, Bin, Streamable, WebRS };
10
+ //#endregion
11
+ export { AsyncIter, Bin, Streamable, WebRS };
12
+ //# sourceMappingURL=stream.d.ts.map
@@ -1 +1 @@
1
- //# sourceMappingURL=stream.js.map
1
+ export { };