spana-test 0.19.0 → 0.20.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/README.md +4 -3
- package/dist/agent/index.js +15 -15
- package/dist/api/app.d.ts +1 -0
- package/dist/api/app.d.ts.map +1 -1
- package/dist/api/expect.d.ts +25 -11
- package/dist/api/expect.d.ts.map +1 -1
- package/dist/{app-LGNFQMU7.js → app-ZSRJ3VFR.js} +3 -3
- package/dist/{appium-2PJWZXJI.js → appium-LOAWWZXA.js} +9 -9
- package/dist/build-info-KFFGVWDQ.js +9 -0
- package/dist/build-info.d.ts +5 -0
- package/dist/build-info.d.ts.map +1 -0
- package/dist/build-info.json +4 -0
- package/dist/channels/cdp-client.d.ts +36 -1
- package/dist/channels/cdp-client.d.ts.map +1 -1
- package/dist/channels/dom-channel.d.ts +14 -2
- package/dist/channels/dom-channel.d.ts.map +1 -1
- package/dist/{chunk-7K24Q7V3.js → chunk-26XIUSVS.js} +129 -29
- package/dist/chunk-26XIUSVS.js.map +1 -0
- package/dist/{chunk-E67QUGT3.js → chunk-2SDRH7ST.js} +7 -14
- package/dist/chunk-2SDRH7ST.js.map +1 -0
- package/dist/{chunk-NR4QAM5W.js → chunk-2TK77LXY.js} +18 -16
- package/dist/chunk-2TK77LXY.js.map +1 -0
- package/dist/{chunk-AP5SGSO7.js → chunk-42D5LOGH.js} +8 -8
- package/dist/{chunk-6X2SK2XO.js → chunk-5NZPLX2Y.js} +4 -5
- package/dist/chunk-5NZPLX2Y.js.map +1 -0
- package/dist/{chunk-CQ67PB3R.js → chunk-6GLL6SMP.js} +2 -2
- package/dist/{chunk-44U3F2RY.js → chunk-7GDO4XAI.js} +214 -6
- package/dist/chunk-7GDO4XAI.js.map +1 -0
- package/dist/{chunk-IJWAAODK.js → chunk-7QJY2HJO.js} +2 -2
- package/dist/{chunk-DNWVDGKS.js → chunk-GBV3XDWM.js} +8 -8
- package/dist/{chunk-C7HZJIGQ.js → chunk-HX2PKESI.js} +2 -2
- package/dist/{chunk-NC32K762.js → chunk-QNCTEV2P.js} +14 -14
- package/dist/{chunk-FLPPA2XY.js → chunk-VWOTHDSE.js} +9 -4
- package/dist/chunk-VWOTHDSE.js.map +1 -0
- package/dist/chunk-XLHJCJ4O.js +15 -0
- package/dist/chunk-XLHJCJ4O.js.map +1 -0
- package/dist/{chunk-G4ZUJCEN.js → chunk-XORHAB3R.js} +101 -47
- package/dist/chunk-XORHAB3R.js.map +1 -0
- package/dist/{chunk-C2YM5GNF.js → chunk-XUKBM64A.js} +3 -3
- package/dist/{chunk-FZ7EMXIM.js → chunk-XZQGSUV7.js} +10 -8
- package/dist/chunk-XZQGSUV7.js.map +1 -0
- package/dist/{chunk-3ONT32BO.js → chunk-ZVUIG6A4.js} +30 -24
- package/dist/{chunk-3ONT32BO.js.map → chunk-ZVUIG6A4.js.map} +1 -1
- package/dist/cli.js +16 -15
- package/dist/cli.js.map +1 -1
- package/dist/{config-loader-MX232REU.js → config-loader-IDIKOQ4T.js} +3 -3
- package/dist/{console-OHKVJLW3.js → console-Z7F7X3WY.js} +40 -39
- package/dist/console-Z7F7X3WY.js.map +1 -0
- package/dist/{doctor-command-YTT5SMQW.js → doctor-command-2PSDOREK.js} +7 -7
- package/dist/{driver-X4FWTDNU.js → driver-TNQ6HSID.js} +6 -6
- package/dist/{driver-AN3I4H6O.js → driver-TTJVCWCD.js} +7 -7
- package/dist/drivers/appium/android.d.ts +1 -1
- package/dist/drivers/appium/ios.d.ts +1 -1
- package/dist/drivers/cdp-browser.d.ts +1 -1
- package/dist/drivers/cdp-browser.d.ts.map +1 -1
- package/dist/drivers/device-controls.d.ts +1 -1
- package/dist/drivers/electrobun.d.ts +1 -1
- package/dist/drivers/electron.d.ts +1 -1
- package/dist/drivers/playwright.d.ts +2 -1
- package/dist/drivers/playwright.d.ts.map +1 -1
- package/dist/drivers/raw-driver.d.ts +2 -1
- package/dist/drivers/uiautomator2/driver.d.ts +1 -1
- package/dist/drivers/wasm.d.ts +1 -1
- package/dist/drivers/wda/driver.d.ts +1 -1
- package/dist/{electrobun-OUTYOM5G.js → electrobun-6ZJ6QFVQ.js} +5 -5
- package/dist/errors.d.ts +12 -12
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +49 -45
- package/dist/index.js.map +1 -1
- package/dist/{json-QVHG6I3O.js → json-RNYQ54R7.js} +8 -7
- package/dist/json-RNYQ54R7.js.map +1 -0
- package/dist/{local-UWIYOREU.js → local-E6FJI3QK.js} +5 -5
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/{playwright-KBWUBU5S.js → playwright-LS35WXQ6.js} +6 -6
- package/dist/report/console.d.ts +2 -0
- package/dist/report/console.d.ts.map +1 -1
- package/dist/report/json.d.ts +5 -1
- package/dist/report/json.d.ts.map +1 -1
- package/dist/runtime/local.d.ts.map +1 -1
- package/dist/runtime/web-server.d.ts.map +1 -1
- package/dist/schemas/config.d.ts +39 -484
- package/dist/schemas/config.d.ts.map +1 -1
- package/dist/schemas/device.d.ts +1 -1
- package/dist/schemas/element.d.ts +1 -1
- package/dist/schemas/selector.d.ts +1 -1
- package/dist/{server-CWCMC244.js → server-A6Y6ZMET.js} +2 -2
- package/dist/{server-BS3O4WVU.js → server-D3HOIPQE.js} +16 -16
- package/dist/{session-YWYRRXXR.js → session-2VIEKA6A.js} +16 -16
- package/dist/session-2VIEKA6A.js.map +1 -0
- package/dist/smart/auto-wait.d.ts +1 -1
- package/dist/smart/channel-resolver.d.ts +1 -1
- package/dist/smart/channel-resolver.d.ts.map +1 -1
- package/dist/smart/coordinator.d.ts +6 -2
- package/dist/smart/coordinator.d.ts.map +1 -1
- package/dist/smart/hierarchy-cache.d.ts +1 -1
- package/dist/studio/context.d.ts +1 -1
- package/dist/studio/effect-handler.d.ts +3 -1
- package/dist/{studio-command-XJDGLNAJ.js → studio-command-SPHIXFIW.js} +2 -2
- package/dist/{test-command-3IRGNEPB.js → test-command-OYMJNT23.js} +19 -19
- package/dist/vendor/effect/Array.d.ts +841 -0
- package/dist/vendor/effect/BigDecimal.d.ts +227 -0
- package/dist/vendor/effect/Brand.d.ts +71 -0
- package/dist/vendor/effect/ByteSize.d.ts +218 -0
- package/dist/vendor/effect/Cache.d.ts +104 -0
- package/dist/vendor/effect/Cause.d.ts +242 -0
- package/dist/vendor/effect/Channel.d.ts +1004 -0
- package/dist/vendor/effect/Chunk.d.ts +499 -0
- package/dist/vendor/effect/Clock.d.ts +31 -0
- package/dist/vendor/effect/Combiner.d.ts +23 -0
- package/dist/vendor/effect/Context.d.ts +167 -0
- package/dist/vendor/effect/Cron.d.ts +79 -0
- package/dist/vendor/effect/Data.d.ts +146 -0
- package/dist/vendor/effect/DateTime.d.ts +554 -0
- package/dist/vendor/effect/Deferred.d.ts +135 -0
- package/dist/vendor/effect/Differ.d.ts +8 -0
- package/dist/vendor/effect/Duration.d.ts +270 -0
- package/dist/vendor/effect/Effect.d.ts +2606 -0
- package/dist/vendor/effect/Equal.d.ts +20 -0
- package/dist/vendor/effect/Equivalence.d.ts +55 -0
- package/dist/vendor/effect/ExecutionPlan.d.ts +131 -0
- package/dist/vendor/effect/Exit.d.ts +114 -0
- package/dist/vendor/effect/Fiber.d.ts +90 -0
- package/dist/vendor/effect/FileSystem.d.ts +227 -0
- package/dist/vendor/effect/Filter.d.ts +133 -0
- package/dist/vendor/effect/Formatter.d.ts +13 -0
- package/dist/vendor/effect/Function.d.ts +91 -0
- package/dist/vendor/effect/Graph.d.ts +638 -0
- package/dist/vendor/effect/HKT.d.ts +30 -0
- package/dist/vendor/effect/Hash.d.ts +31 -0
- package/dist/vendor/effect/HashMap.d.ts +225 -0
- package/dist/vendor/effect/HashSet.d.ts +122 -0
- package/dist/vendor/effect/Inspectable.d.ts +25 -0
- package/dist/vendor/effect/JsonPatch.d.ts +26 -0
- package/dist/vendor/effect/JsonSchema.d.ts +43 -0
- package/dist/vendor/effect/LICENSE +21 -0
- package/dist/vendor/effect/Latch.d.ts +48 -0
- package/dist/vendor/effect/Layer.d.ts +273 -0
- package/dist/vendor/effect/LogLevel.d.ts +46 -0
- package/dist/vendor/effect/Logger.d.ts +106 -0
- package/dist/vendor/effect/ManagedRuntime.d.ts +52 -0
- package/dist/vendor/effect/Metric.d.ts +266 -0
- package/dist/vendor/effect/MutableHashMap.d.ts +80 -0
- package/dist/vendor/effect/MutableList.d.ts +52 -0
- package/dist/vendor/effect/MutableRef.d.ts +76 -0
- package/dist/vendor/effect/NonEmptyIterable.d.ts +9 -0
- package/dist/vendor/effect/Optic.d.ts +155 -0
- package/dist/vendor/effect/Option.d.ts +380 -0
- package/dist/vendor/effect/Order.d.ts +110 -0
- package/dist/vendor/effect/Ordering.d.ts +24 -0
- package/dist/vendor/effect/Path.d.ts +44 -0
- package/dist/vendor/effect/Pipeable.d.ts +38 -0
- package/dist/vendor/effect/PlatformError.d.ts +63 -0
- package/dist/vendor/effect/Predicate.d.ts +227 -0
- package/dist/vendor/effect/PrimaryKey.d.ts +11 -0
- package/dist/vendor/effect/PubSub.d.ts +229 -0
- package/dist/vendor/effect/Pull.d.ts +54 -0
- package/dist/vendor/effect/Queue.d.ts +212 -0
- package/dist/vendor/effect/Rational.d.ts +212 -0
- package/dist/vendor/effect/Record.d.ts +247 -0
- package/dist/vendor/effect/Redactable.d.ts +14 -0
- package/dist/vendor/effect/Redacted.d.ts +34 -0
- package/dist/vendor/effect/Reducer.d.ts +13 -0
- package/dist/vendor/effect/References.d.ts +53 -0
- package/dist/vendor/effect/Request.d.ts +106 -0
- package/dist/vendor/effect/RequestResolver.d.ts +159 -0
- package/dist/vendor/effect/Result.d.ts +285 -0
- package/dist/vendor/effect/Schedule.d.ts +172 -0
- package/dist/vendor/effect/Scheduler.d.ts +45 -0
- package/dist/vendor/effect/Schema.d.ts +3205 -0
- package/dist/vendor/effect/SchemaAST.d.ts +356 -0
- package/dist/vendor/effect/SchemaGetter.d.ts +181 -0
- package/dist/vendor/effect/SchemaIssue.d.ts +147 -0
- package/dist/vendor/effect/SchemaParser.d.ts +57 -0
- package/dist/vendor/effect/SchemaRepresentation.d.ts +563 -0
- package/dist/vendor/effect/SchemaTransformation.d.ts +155 -0
- package/dist/vendor/effect/Scope.d.ts +69 -0
- package/dist/vendor/effect/SemVer.d.ts +209 -0
- package/dist/vendor/effect/SemVerRange.d.ts +74 -0
- package/dist/vendor/effect/Semaphore.d.ts +87 -0
- package/dist/vendor/effect/Sink.d.ts +337 -0
- package/dist/vendor/effect/StandardSchema.d.ts +112 -0
- package/dist/vendor/effect/Stream.d.ts +1762 -0
- package/dist/vendor/effect/Struct.d.ts +162 -0
- package/dist/vendor/effect/Take.d.ts +8 -0
- package/dist/vendor/effect/Tracer.d.ts +150 -0
- package/dist/vendor/effect/TxRef.d.ts +40 -0
- package/dist/vendor/effect/Types.d.ts +139 -0
- package/dist/vendor/effect/Unify.d.ts +50 -0
- package/dist/vendor/effect/Utils.d.ts +31 -0
- package/dist/vendor/effect/crypto/Aead.d.ts +72 -0
- package/dist/vendor/effect/crypto/Cipher.d.ts +54 -0
- package/dist/vendor/effect/crypto/CryptoError.d.ts +81 -0
- package/dist/vendor/effect/crypto/Digest.d.ts +32 -0
- package/dist/vendor/effect/crypto/KeyAgreement.d.ts +80 -0
- package/dist/vendor/effect/crypto/KeyFormat.d.ts +82 -0
- package/dist/vendor/effect/crypto/KeyWrap.d.ts +97 -0
- package/dist/vendor/effect/crypto/Mac.d.ts +56 -0
- package/dist/vendor/effect/crypto/SecureRandom.d.ts +63 -0
- package/dist/vendor/effect/crypto/Signature.d.ts +122 -0
- package/dist/vendor/effect/crypto/WebCrypto.d.ts +18 -0
- package/dist/vendor/effect/http/Cookies.d.ts +185 -0
- package/dist/vendor/effect/http/Headers.d.ts +144 -0
- package/dist/vendor/effect/http/UrlParams.d.ts +122 -0
- package/dist/vendor/effect/internal/schemaError.d.ts +3 -0
- package/dist/vendor/effect/net/Dns.d.ts +166 -0
- package/dist/vendor/effect/net/Host.d.ts +80 -0
- package/dist/vendor/effect/net/IpInterface.d.ts +65 -0
- package/dist/vendor/effect/net/IpNetwork.d.ts +89 -0
- package/dist/vendor/effect/net/NetAddress.d.ts +350 -0
- package/dist/vendor/effect/persistence/KeyValueStore.d.ts +138 -0
- package/dist/vendor/effect/persistence/Persistable.d.ts +56 -0
- package/dist/vendor/effect/persistence/Persistence.d.ts +83 -0
- package/dist/vendor/effect/persistence/Redis.d.ts +98 -0
- package/dist/vendor/effect/reactivity/Reactivity.d.ts +59 -0
- package/dist/vendor/effect/sql/SqlClient.d.ts +121 -0
- package/dist/vendor/effect/sql/SqlConnection.d.ts +26 -0
- package/dist/vendor/effect/sql/SqlError.d.ts +186 -0
- package/dist/vendor/effect/sql/Statement.d.ts +225 -0
- package/native/win32-x64/spana_native.dll +0 -0
- package/package.json +4 -3
- package/dist/chunk-44U3F2RY.js.map +0 -1
- package/dist/chunk-6X2SK2XO.js.map +0 -1
- package/dist/chunk-7K24Q7V3.js.map +0 -1
- package/dist/chunk-E67QUGT3.js.map +0 -1
- package/dist/chunk-FLPPA2XY.js.map +0 -1
- package/dist/chunk-FZ7EMXIM.js.map +0 -1
- package/dist/chunk-G4ZUJCEN.js.map +0 -1
- package/dist/chunk-NR4QAM5W.js.map +0 -1
- package/dist/console-OHKVJLW3.js.map +0 -1
- package/dist/json-QVHG6I3O.js.map +0 -1
- /package/dist/{app-LGNFQMU7.js.map → app-ZSRJ3VFR.js.map} +0 -0
- /package/dist/{appium-2PJWZXJI.js.map → appium-LOAWWZXA.js.map} +0 -0
- /package/dist/{config-loader-MX232REU.js.map → build-info-KFFGVWDQ.js.map} +0 -0
- /package/dist/{chunk-AP5SGSO7.js.map → chunk-42D5LOGH.js.map} +0 -0
- /package/dist/{chunk-CQ67PB3R.js.map → chunk-6GLL6SMP.js.map} +0 -0
- /package/dist/{chunk-IJWAAODK.js.map → chunk-7QJY2HJO.js.map} +0 -0
- /package/dist/{chunk-DNWVDGKS.js.map → chunk-GBV3XDWM.js.map} +0 -0
- /package/dist/{chunk-C7HZJIGQ.js.map → chunk-HX2PKESI.js.map} +0 -0
- /package/dist/{chunk-NC32K762.js.map → chunk-QNCTEV2P.js.map} +0 -0
- /package/dist/{chunk-C2YM5GNF.js.map → chunk-XUKBM64A.js.map} +0 -0
- /package/dist/{driver-AN3I4H6O.js.map → config-loader-IDIKOQ4T.js.map} +0 -0
- /package/dist/{doctor-command-YTT5SMQW.js.map → doctor-command-2PSDOREK.js.map} +0 -0
- /package/dist/{driver-X4FWTDNU.js.map → driver-TNQ6HSID.js.map} +0 -0
- /package/dist/{electrobun-OUTYOM5G.js.map → driver-TTJVCWCD.js.map} +0 -0
- /package/dist/{local-UWIYOREU.js.map → electrobun-6ZJ6QFVQ.js.map} +0 -0
- /package/dist/{playwright-KBWUBU5S.js.map → local-E6FJI3QK.js.map} +0 -0
- /package/dist/{server-CWCMC244.js.map → playwright-LS35WXQ6.js.map} +0 -0
- /package/dist/{session-YWYRRXXR.js.map → server-A6Y6ZMET.js.map} +0 -0
- /package/dist/{server-BS3O4WVU.js.map → server-D3HOIPQE.js.map} +0 -0
- /package/dist/{studio-command-XJDGLNAJ.js.map → studio-command-SPHIXFIW.js.map} +0 -0
- /package/dist/{test-command-3IRGNEPB.js.map → test-command-OYMJNT23.js.map} +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
import type { Equivalence } from "./Equivalence.ts";
|
|
3
|
+
import * as Hash from "./Hash.ts";
|
|
4
|
+
|
|
5
|
+
export declare const symbol = "~effect/Equal";
|
|
6
|
+
|
|
7
|
+
export interface Equal extends Hash.Hash {
|
|
8
|
+
[symbol](that: Equal): boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export declare function equals<B>(that: B): <A>(self: A) => boolean;
|
|
12
|
+
export declare function equals<A, B>(self: A, that: B): boolean;
|
|
13
|
+
|
|
14
|
+
export declare const isEqual: (u: unknown) => u is Equal;
|
|
15
|
+
|
|
16
|
+
export declare const asEquivalence: <A>() => Equivalence<A>;
|
|
17
|
+
|
|
18
|
+
export declare const byReference: <T extends object>(obj: T) => T;
|
|
19
|
+
|
|
20
|
+
export declare const byReferenceUnsafe: <T extends object>(obj: T) => T;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { TypeLambda } from "./HKT.ts";
|
|
2
|
+
import * as Reducer from "./Reducer.ts";
|
|
3
|
+
|
|
4
|
+
export type Equivalence<in A> = (self: A, that: A) => boolean;
|
|
5
|
+
|
|
6
|
+
export interface EquivalenceTypeLambda extends TypeLambda {
|
|
7
|
+
readonly type: Equivalence<this["Target"]>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export declare const make: <A>(isEquivalent: (self: A, that: A) => boolean) => Equivalence<A>;
|
|
11
|
+
|
|
12
|
+
export declare const strictEqual: <A>() => Equivalence<A>;
|
|
13
|
+
|
|
14
|
+
export declare const String: Equivalence<string>;
|
|
15
|
+
|
|
16
|
+
export declare const Number: Equivalence<number>;
|
|
17
|
+
|
|
18
|
+
export declare const Boolean: Equivalence<boolean>;
|
|
19
|
+
|
|
20
|
+
export declare const BigInt: Equivalence<bigint>;
|
|
21
|
+
|
|
22
|
+
export declare const combine: {
|
|
23
|
+
|
|
24
|
+
<A>(that: Equivalence<A>): (self: Equivalence<A>) => Equivalence<A>;
|
|
25
|
+
|
|
26
|
+
<A>(self: Equivalence<A>, that: Equivalence<A>): Equivalence<A>;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export declare const combineAll: <A>(collection: Iterable<Equivalence<A>>) => Equivalence<A>;
|
|
30
|
+
|
|
31
|
+
export declare const mapInput: {
|
|
32
|
+
|
|
33
|
+
<B, A>(f: (b: B) => A): (self: Equivalence<A>) => Equivalence<B>;
|
|
34
|
+
|
|
35
|
+
<A, B>(self: Equivalence<A>, f: (b: B) => A): Equivalence<B>;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export declare function Tuple<const Elements extends ReadonlyArray<Equivalence<any>>>(elements: Elements): Equivalence<{
|
|
39
|
+
readonly [I in keyof Elements]: [Elements[I]] extends [Equivalence<infer A>] ? A : never;
|
|
40
|
+
}>;
|
|
41
|
+
|
|
42
|
+
declare function Array_<A>(item: Equivalence<A>): Equivalence<ReadonlyArray<A>>;
|
|
43
|
+
export {
|
|
44
|
+
|
|
45
|
+
Array_ as Array };
|
|
46
|
+
|
|
47
|
+
export declare function Struct<R extends Record<PropertyKey, Equivalence<any>>>(fields: R): Equivalence<{
|
|
48
|
+
readonly [K in keyof R]: [R[K]] extends [Equivalence<infer A>] ? A : never;
|
|
49
|
+
}>;
|
|
50
|
+
|
|
51
|
+
export declare function Record<A>(value: Equivalence<A>): Equivalence<Record<PropertyKey, A>>;
|
|
52
|
+
|
|
53
|
+
export declare function makeReducer<A>(): Reducer.Reducer<Equivalence<A>>;
|
|
54
|
+
|
|
55
|
+
export declare const Date: Equivalence<Date>;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
|
|
2
|
+
import type { NonEmptyReadonlyArray } from "./Array.ts";
|
|
3
|
+
import type * as Cause from "./Cause.ts";
|
|
4
|
+
import * as Context from "./Context.ts";
|
|
5
|
+
import type * as Duration from "./Duration.ts";
|
|
6
|
+
import type * as Effect from "./Effect.ts";
|
|
7
|
+
import * as Layer from "./Layer.ts";
|
|
8
|
+
import type { Pipeable } from "./Pipeable.ts";
|
|
9
|
+
import * as Schedule from "./Schedule.ts";
|
|
10
|
+
|
|
11
|
+
export type TypeId = "~effect/ExecutionPlan";
|
|
12
|
+
|
|
13
|
+
export declare const TypeId: TypeId;
|
|
14
|
+
|
|
15
|
+
export declare const isExecutionPlan: (u: unknown) => u is ExecutionPlan<any>;
|
|
16
|
+
|
|
17
|
+
export interface ExecutionPlan<Config extends {
|
|
18
|
+
provides: any;
|
|
19
|
+
input: any;
|
|
20
|
+
error: any;
|
|
21
|
+
requirements: any;
|
|
22
|
+
}> extends Pipeable {
|
|
23
|
+
readonly [TypeId]: TypeId;
|
|
24
|
+
readonly steps: NonEmptyReadonlyArray<{
|
|
25
|
+
readonly provide: Context.Context<Config["provides"]> | Layer.Layer<Config["provides"], Config["error"], Config["requirements"]>;
|
|
26
|
+
readonly attempts?: number | undefined;
|
|
27
|
+
readonly while?: ((input: Config["input"]) => Effect.Effect<boolean, Config["error"], Config["requirements"]>) | undefined;
|
|
28
|
+
readonly schedule?: Schedule.Schedule<any, Config["input"], Config["error"], Config["requirements"]> | undefined;
|
|
29
|
+
}>;
|
|
30
|
+
|
|
31
|
+
readonly captureRequirements: Effect.Effect<ExecutionPlan<{
|
|
32
|
+
provides: Config["provides"];
|
|
33
|
+
input: Config["input"];
|
|
34
|
+
error: Config["error"];
|
|
35
|
+
requirements: never;
|
|
36
|
+
}>, never, Config["requirements"]>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type ConfigBase = {
|
|
40
|
+
provides: any;
|
|
41
|
+
input: any;
|
|
42
|
+
error: any;
|
|
43
|
+
requirements: any;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export declare const make: <const Steps extends NonEmptyReadonlyArray<make.Step>>(...steps: Steps & { [K in keyof Steps]: make.Step; }) => ExecutionPlan<{
|
|
47
|
+
provides: make.StepProvides<Steps>;
|
|
48
|
+
input: make.StepInput<Steps>;
|
|
49
|
+
error: make.StepError<Steps[number]>;
|
|
50
|
+
requirements: make.StepRequirements<Steps[number]>;
|
|
51
|
+
}>;
|
|
52
|
+
|
|
53
|
+
export declare namespace make {
|
|
54
|
+
|
|
55
|
+
type Step = {
|
|
56
|
+
readonly provide: Context.Context<any> | Context.Context<never> | Layer.Any;
|
|
57
|
+
readonly attempts?: number | undefined;
|
|
58
|
+
readonly while?: ((input: any) => boolean | Effect.Effect<boolean, any, any>) | undefined;
|
|
59
|
+
readonly schedule?: Schedule.Schedule<any, any, any, any> | undefined;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
type StepError<Step> = (Step extends {
|
|
63
|
+
readonly provide: Layer.Layer<infer _A, infer E, infer _R>;
|
|
64
|
+
} ? E : never) | (Step extends {
|
|
65
|
+
readonly while?: (input: any) => infer Result;
|
|
66
|
+
} ? Effect.Error<Result> : never) | (Step extends {
|
|
67
|
+
readonly schedule?: infer S;
|
|
68
|
+
} ? Schedule.Error<S> : never);
|
|
69
|
+
|
|
70
|
+
type StepRequirements<Step> = (Step extends {
|
|
71
|
+
readonly provide: Layer.Layer<infer _A, infer _E, infer R>;
|
|
72
|
+
} ? R : never) | (Step extends {
|
|
73
|
+
readonly while?: (input: any) => infer Result;
|
|
74
|
+
} ? Effect.Services<Result> : never) | (Step extends {
|
|
75
|
+
readonly schedule?: infer S;
|
|
76
|
+
} ? Schedule.Env<S> : never);
|
|
77
|
+
|
|
78
|
+
type StepProvides<Steps extends ReadonlyArray<any>, Out = unknown> = Steps extends readonly [infer Step, ...infer Rest] ? StepProvides<Rest, Out & ((Step extends {
|
|
79
|
+
readonly provide: Context.Context<infer P> | Layer.Layer<infer P, infer _E, infer _R>;
|
|
80
|
+
} ? P : unknown))> : Out;
|
|
81
|
+
|
|
82
|
+
type PlanProvides<Plans extends ReadonlyArray<any>, Out = unknown> = Plans extends readonly [infer Plan, ...infer Rest] ? PlanProvides<Rest, Out & (Plan extends ExecutionPlan<infer T> ? T["provides"] : unknown)> : Out;
|
|
83
|
+
|
|
84
|
+
type StepInput<Steps extends ReadonlyArray<any>, Out = unknown> = Steps extends readonly [infer Step, ...infer Rest] ? StepInput<Rest, Out & ((Step extends {
|
|
85
|
+
readonly while: (input: infer I) => infer _;
|
|
86
|
+
} ? I : unknown) & (Step extends {
|
|
87
|
+
readonly schedule: Schedule.Schedule<infer _O, infer I, infer _E, infer _R>;
|
|
88
|
+
} ? I : unknown))> : Out;
|
|
89
|
+
|
|
90
|
+
type PlanInput<Plans extends ReadonlyArray<any>, Out = unknown> = Plans extends readonly [infer Plan, ...infer Rest] ? PlanInput<Rest, Out & (Plan extends ExecutionPlan<infer T> ? T["input"] : unknown)> : Out;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export declare const merge: <const Plans extends NonEmptyReadonlyArray<ExecutionPlan<any>>>(...plans: Plans) => ExecutionPlan<{
|
|
94
|
+
provides: make.PlanProvides<Plans>;
|
|
95
|
+
input: make.PlanInput<Plans>;
|
|
96
|
+
error: Plans[number] extends ExecutionPlan<infer T> ? T["error"] : never;
|
|
97
|
+
requirements: Plans[number] extends ExecutionPlan<infer T> ? T["requirements"] : never;
|
|
98
|
+
}>;
|
|
99
|
+
|
|
100
|
+
export interface Metadata {
|
|
101
|
+
readonly attempt: number;
|
|
102
|
+
readonly stepIndex: number;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export declare const CurrentMetadata: Context.Reference<Metadata>;
|
|
106
|
+
|
|
107
|
+
export interface AttemptStart {
|
|
108
|
+
readonly _tag: "AttemptStart";
|
|
109
|
+
readonly attempt: number;
|
|
110
|
+
readonly stepAttempt: number;
|
|
111
|
+
readonly stepIndex: number;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface AttemptSuccess {
|
|
115
|
+
readonly _tag: "AttemptSuccess";
|
|
116
|
+
readonly attempt: number;
|
|
117
|
+
readonly stepAttempt: number;
|
|
118
|
+
readonly stepIndex: number;
|
|
119
|
+
readonly duration: Duration.Duration;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface AttemptFailure<E> {
|
|
123
|
+
readonly _tag: "AttemptFailure";
|
|
124
|
+
readonly attempt: number;
|
|
125
|
+
readonly stepAttempt: number;
|
|
126
|
+
readonly stepIndex: number;
|
|
127
|
+
readonly duration: Duration.Duration;
|
|
128
|
+
readonly cause: Cause.Cause<E>;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export type Event<E> = AttemptStart | AttemptSuccess | AttemptFailure<E>;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
|
|
2
|
+
import type * as Cause from "./Cause.ts";
|
|
3
|
+
import type * as Effect from "./Effect.ts";
|
|
4
|
+
import type { Option } from "./Option.ts";
|
|
5
|
+
import type * as Result from "./Result.ts";
|
|
6
|
+
import type { NoInfer } from "./Types.ts";
|
|
7
|
+
declare const TypeId: "~effect/Exit";
|
|
8
|
+
|
|
9
|
+
export type Exit<A, E = never> = Success<A, E> | Failure<A, E>;
|
|
10
|
+
|
|
11
|
+
export declare namespace Exit {
|
|
12
|
+
|
|
13
|
+
interface Proto<out A, out E = never> extends Effect.Effect<A, E> {
|
|
14
|
+
readonly [TypeId]: typeof TypeId;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface Success<out A, out E = never> extends Exit.Proto<A, E> {
|
|
19
|
+
readonly _tag: "Success";
|
|
20
|
+
readonly value: A;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface Failure<out A, out E> extends Exit.Proto<A, E> {
|
|
24
|
+
readonly _tag: "Failure";
|
|
25
|
+
readonly cause: Cause.Cause<E>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export declare const isExit: (u: unknown) => u is Exit<unknown, unknown>;
|
|
29
|
+
|
|
30
|
+
export declare const succeed: <A>(a: A) => Exit<A>;
|
|
31
|
+
|
|
32
|
+
export declare const failCause: <E>(cause: Cause.Cause<E>) => Exit<never, E>;
|
|
33
|
+
|
|
34
|
+
export declare const fail: <E>(e: E) => Exit<never, E>;
|
|
35
|
+
|
|
36
|
+
export declare const die: (defect: unknown) => Exit<never>;
|
|
37
|
+
|
|
38
|
+
export declare const interrupt: (fiberId?: number | undefined) => Exit<never>;
|
|
39
|
+
declare const void_: Exit<void>;
|
|
40
|
+
export {
|
|
41
|
+
|
|
42
|
+
void_ as void };
|
|
43
|
+
|
|
44
|
+
export declare const isSuccess: <A, E>(self: Exit<A, E>) => self is Success<A, E>;
|
|
45
|
+
|
|
46
|
+
export declare const isFailure: <A, E>(self: Exit<A, E>) => self is Failure<A, E>;
|
|
47
|
+
|
|
48
|
+
export declare const hasFails: <A, E>(self: Exit<A, E>) => boolean;
|
|
49
|
+
|
|
50
|
+
export declare const hasDies: <A, E>(self: Exit<A, E>) => boolean;
|
|
51
|
+
|
|
52
|
+
export declare const hasInterrupts: <A, E>(self: Exit<A, E>) => boolean;
|
|
53
|
+
|
|
54
|
+
export declare const filterSuccess: <A, E>(self: Exit<A, E>) => Result.Result<Success<A>, Failure<never, E>>;
|
|
55
|
+
|
|
56
|
+
export declare const filterValue: <A, E>(self: Exit<A, E>) => Result.Result<A, Failure<never, E>>;
|
|
57
|
+
|
|
58
|
+
export declare const filterFailure: <A, E>(self: Exit<A, E>) => Result.Result<Failure<never, E>, Success<A>>;
|
|
59
|
+
|
|
60
|
+
export declare const filterCause: <A, E>(self: Exit<A, E>) => Result.Result<Cause.Cause<E>, Success<A>>;
|
|
61
|
+
|
|
62
|
+
export declare const findError: <A, E>(input: Exit<A, E>) => Result.Result<E, Exit<A, E>>;
|
|
63
|
+
|
|
64
|
+
export declare const findDefect: <A, E>(input: Exit<A, E>) => Result.Result<unknown, Exit<A, E>>;
|
|
65
|
+
|
|
66
|
+
export declare const match: {
|
|
67
|
+
|
|
68
|
+
<A, E, X1, X2>(options: {
|
|
69
|
+
readonly onSuccess: (a: NoInfer<A>) => X1;
|
|
70
|
+
readonly onFailure: (cause: Cause.Cause<NoInfer<E>>) => X2;
|
|
71
|
+
}): (self: Exit<A, E>) => X1 | X2;
|
|
72
|
+
|
|
73
|
+
<A, E, X1, X2>(self: Exit<A, E>, options: {
|
|
74
|
+
readonly onSuccess: (a: A) => X1;
|
|
75
|
+
readonly onFailure: (cause: Cause.Cause<E>) => X2;
|
|
76
|
+
}): X1 | X2;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export declare const map: {
|
|
80
|
+
|
|
81
|
+
<A, B>(f: (a: A) => B): <E>(self: Exit<A, E>) => Exit<B, E>;
|
|
82
|
+
|
|
83
|
+
<A, E, B>(self: Exit<A, E>, f: (a: A) => B): Exit<B, E>;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export declare const mapError: {
|
|
87
|
+
|
|
88
|
+
<E, E2>(f: (a: NoInfer<E>) => E2): <A>(self: Exit<A, E>) => Exit<A, E2>;
|
|
89
|
+
|
|
90
|
+
<A, E, E2>(self: Exit<A, E>, f: (a: NoInfer<E>) => E2): Exit<A, E2>;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export declare const mapBoth: {
|
|
94
|
+
|
|
95
|
+
<E, E2, A, A2>(options: {
|
|
96
|
+
readonly onFailure: (e: E) => E2;
|
|
97
|
+
readonly onSuccess: (a: A) => A2;
|
|
98
|
+
}): (self: Exit<A, E>) => Exit<A2, E2>;
|
|
99
|
+
|
|
100
|
+
<A, E, E2, A2>(self: Exit<A, E>, options: {
|
|
101
|
+
readonly onFailure: (e: E) => E2;
|
|
102
|
+
readonly onSuccess: (a: A) => A2;
|
|
103
|
+
}): Exit<A2, E2>;
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export declare const asVoid: <A, E>(self: Exit<A, E>) => Exit<void, E>;
|
|
107
|
+
|
|
108
|
+
export declare const asVoidAll: <I extends Iterable<Exit<any, any>>>(exits: I) => Exit<void, I extends Iterable<Exit<infer _A, infer _E>> ? _E : never>;
|
|
109
|
+
|
|
110
|
+
export declare const getSuccess: <A, E>(self: Exit<A, E>) => Option<A>;
|
|
111
|
+
|
|
112
|
+
export declare const getCause: <A, E>(self: Exit<A, E>) => Option<Cause.Cause<E>>;
|
|
113
|
+
|
|
114
|
+
export declare const findErrorOption: <A, E>(self: Exit<A, E>) => Option<E>;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
|
|
2
|
+
import type * as Arr from "./Array.ts";
|
|
3
|
+
import type * as Context from "./Context.ts";
|
|
4
|
+
import type { Effect } from "./Effect.ts";
|
|
5
|
+
import type { Exit } from "./Exit.ts";
|
|
6
|
+
import type { LogLevel } from "./LogLevel.ts";
|
|
7
|
+
import type { FiberRuntimeMetricsService } from "./Metric.ts";
|
|
8
|
+
import type { Pipeable } from "./Pipeable.ts";
|
|
9
|
+
import type { StackFrame } from "./References.ts";
|
|
10
|
+
import type { Scheduler, SchedulerDispatcher } from "./Scheduler.ts";
|
|
11
|
+
import type { Scope } from "./Scope.ts";
|
|
12
|
+
import type { AnySpan, Tracer } from "./Tracer.ts";
|
|
13
|
+
import type { Covariant } from "./Types.ts";
|
|
14
|
+
declare const TypeId = "~effect/Fiber";
|
|
15
|
+
|
|
16
|
+
export interface Fiber<out A, out E = never> extends Pipeable {
|
|
17
|
+
readonly [TypeId]: Fiber.Variance<A, E>;
|
|
18
|
+
readonly id: number;
|
|
19
|
+
readonly currentOpCount: number;
|
|
20
|
+
readonly getRef: <A>(ref: Context.Reference<A>) => A;
|
|
21
|
+
readonly context: Context.Context<never>;
|
|
22
|
+
setContext(context: Context.Context<never>): void;
|
|
23
|
+
readonly cache: Fiber.Cache;
|
|
24
|
+
readonly currentDispatcher: SchedulerDispatcher;
|
|
25
|
+
readonly addObserver: (cb: (exit: Exit<A, E>) => void) => () => void;
|
|
26
|
+
|
|
27
|
+
readonly interruptUnsafe: (fiberId?: number | undefined, annotations?: Context.Context<never> | undefined) => void;
|
|
28
|
+
readonly pollUnsafe: () => Exit<A, E> | undefined;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export declare namespace Fiber {
|
|
32
|
+
|
|
33
|
+
interface Variance<out A, out E = never> {
|
|
34
|
+
readonly _A: Covariant<A>;
|
|
35
|
+
readonly _E: Covariant<E>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface Cache {
|
|
39
|
+
readonly scheduler: Scheduler;
|
|
40
|
+
readonly tracer: Tracer | undefined;
|
|
41
|
+
readonly tracerContext: Tracer["context"] | undefined;
|
|
42
|
+
readonly tracerEnabled: boolean;
|
|
43
|
+
readonly span: AnySpan | undefined;
|
|
44
|
+
readonly logLevel: LogLevel;
|
|
45
|
+
readonly minimumLogLevel: LogLevel;
|
|
46
|
+
readonly stackFrame: StackFrame | undefined;
|
|
47
|
+
readonly runtimeMetrics: FiberRuntimeMetricsService | undefined;
|
|
48
|
+
readonly maxOpsBeforeYield: number;
|
|
49
|
+
readonly preventYield: boolean;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
declare const await_: <A, E>(self: Fiber<A, E>) => Effect<Exit<A, E>>;
|
|
53
|
+
export {
|
|
54
|
+
|
|
55
|
+
await_ as await };
|
|
56
|
+
|
|
57
|
+
export declare const awaitAll: <A extends Fiber<any, any>>(self: Iterable<A>) => Effect<Array<Exit<A extends Fiber<infer _A, infer _E> ? _A : never, A extends Fiber<infer _A, infer _E> ? _E : never>>>;
|
|
58
|
+
|
|
59
|
+
export declare const join: <A, E>(self: Fiber<A, E>) => Effect<A, E>;
|
|
60
|
+
|
|
61
|
+
export declare const joinAll: <A extends Iterable<Fiber<any, any>>>(self: A) => Effect<Arr.ReadonlyArray.With<A, A extends Iterable<Fiber<infer _A, infer _E>> ? _A : never>, A extends Iterable<Fiber<infer _A, infer _E>> ? _E : never>;
|
|
62
|
+
|
|
63
|
+
export declare const interrupt: <A, E>(self: Fiber<A, E>) => Effect<void>;
|
|
64
|
+
|
|
65
|
+
export declare const interruptAs: {
|
|
66
|
+
|
|
67
|
+
(fiberId: number | undefined, annotations?: Context.Context<never> | undefined): <A, E>(self: Fiber<A, E>) => Effect<void>;
|
|
68
|
+
|
|
69
|
+
<A, E>(self: Fiber<A, E>, fiberId: number | undefined, annotations?: Context.Context<never> | undefined): Effect<void>;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export declare const interruptAll: <A extends Iterable<Fiber<any, any>>>(fibers: A) => Effect<void>;
|
|
73
|
+
|
|
74
|
+
export declare const interruptAllAs: {
|
|
75
|
+
|
|
76
|
+
(fiberId: number): <A extends Iterable<Fiber<any, any>>>(fibers: A) => Effect<void>;
|
|
77
|
+
|
|
78
|
+
<A extends Iterable<Fiber<any, any>>>(fibers: A, fiberId: number): Effect<void>;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export declare const isFiber: (u: unknown) => u is Fiber<unknown, unknown>;
|
|
82
|
+
|
|
83
|
+
export declare const getCurrent: () => Fiber<any, any> | undefined;
|
|
84
|
+
|
|
85
|
+
export declare const runIn: {
|
|
86
|
+
|
|
87
|
+
(scope: Scope): <A, E>(self: Fiber<A, E>) => Fiber<A, E>;
|
|
88
|
+
|
|
89
|
+
<A, E>(self: Fiber<A, E>, scope: Scope): Fiber<A, E>;
|
|
90
|
+
};
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import * as ByteSize from "./ByteSize.ts";
|
|
2
|
+
import * as Context from "./Context.ts";
|
|
3
|
+
import * as Effect from "./Effect.ts";
|
|
4
|
+
import * as Layer from "./Layer.ts";
|
|
5
|
+
import * as Option from "./Option.ts";
|
|
6
|
+
import { type PlatformError } from "./PlatformError.ts";
|
|
7
|
+
import type { Scope } from "./Scope.ts";
|
|
8
|
+
import * as Sink from "./Sink.ts";
|
|
9
|
+
import * as Stream from "./Stream.ts";
|
|
10
|
+
declare const TypeId = "~effect/FileSystem";
|
|
11
|
+
|
|
12
|
+
export interface FileSystem {
|
|
13
|
+
readonly [TypeId]: typeof TypeId;
|
|
14
|
+
|
|
15
|
+
readonly access: (path: string, options?: {
|
|
16
|
+
readonly ok?: boolean | undefined;
|
|
17
|
+
readonly readable?: boolean | undefined;
|
|
18
|
+
readonly writable?: boolean | undefined;
|
|
19
|
+
}) => Effect.Effect<void, PlatformError>;
|
|
20
|
+
|
|
21
|
+
readonly copy: (fromPath: string, toPath: string, options?: {
|
|
22
|
+
readonly overwrite?: boolean | undefined;
|
|
23
|
+
readonly preserveTimestamps?: boolean | undefined;
|
|
24
|
+
}) => Effect.Effect<void, PlatformError>;
|
|
25
|
+
|
|
26
|
+
readonly copyFile: (fromPath: string, toPath: string) => Effect.Effect<void, PlatformError>;
|
|
27
|
+
|
|
28
|
+
readonly chmod: (path: string, mode: number) => Effect.Effect<void, PlatformError>;
|
|
29
|
+
|
|
30
|
+
readonly chown: (path: string, uid: number, gid: number) => Effect.Effect<void, PlatformError>;
|
|
31
|
+
|
|
32
|
+
readonly glob: (pattern: string, options?: {
|
|
33
|
+
readonly root?: string | undefined;
|
|
34
|
+
readonly exclude?: ReadonlyArray<string> | undefined;
|
|
35
|
+
readonly dot?: boolean | undefined;
|
|
36
|
+
}) => Effect.Effect<Array<string>, PlatformError>;
|
|
37
|
+
|
|
38
|
+
readonly exists: (path: string) => Effect.Effect<boolean, PlatformError>;
|
|
39
|
+
|
|
40
|
+
readonly link: (fromPath: string, toPath: string) => Effect.Effect<void, PlatformError>;
|
|
41
|
+
|
|
42
|
+
readonly lstat: (path: string) => Effect.Effect<File.Info, PlatformError>;
|
|
43
|
+
|
|
44
|
+
readonly makeDirectory: (path: string, options?: {
|
|
45
|
+
readonly recursive?: boolean | undefined;
|
|
46
|
+
readonly mode?: number | undefined;
|
|
47
|
+
}) => Effect.Effect<void, PlatformError>;
|
|
48
|
+
|
|
49
|
+
readonly makeTempDirectory: (options?: {
|
|
50
|
+
readonly directory?: string | undefined;
|
|
51
|
+
readonly prefix?: string | undefined;
|
|
52
|
+
}) => Effect.Effect<string, PlatformError>;
|
|
53
|
+
|
|
54
|
+
readonly makeTempDirectoryScoped: (options?: {
|
|
55
|
+
readonly directory?: string | undefined;
|
|
56
|
+
readonly prefix?: string | undefined;
|
|
57
|
+
}) => Effect.Effect<string, PlatformError, Scope>;
|
|
58
|
+
|
|
59
|
+
readonly makeTempFile: (options?: {
|
|
60
|
+
readonly directory?: string | undefined;
|
|
61
|
+
readonly prefix?: string | undefined;
|
|
62
|
+
readonly suffix?: string | undefined;
|
|
63
|
+
}) => Effect.Effect<string, PlatformError>;
|
|
64
|
+
|
|
65
|
+
readonly makeTempFileScoped: (options?: {
|
|
66
|
+
readonly directory?: string | undefined;
|
|
67
|
+
readonly prefix?: string | undefined;
|
|
68
|
+
readonly suffix?: string | undefined;
|
|
69
|
+
}) => Effect.Effect<string, PlatformError, Scope>;
|
|
70
|
+
|
|
71
|
+
readonly open: (path: string, options?: {
|
|
72
|
+
readonly flag?: OpenFlag | undefined;
|
|
73
|
+
readonly mode?: number | undefined;
|
|
74
|
+
readonly noFollow?: boolean | undefined;
|
|
75
|
+
}) => Effect.Effect<File, PlatformError, Scope>;
|
|
76
|
+
|
|
77
|
+
readonly readDirectory: (path: string, options?: {
|
|
78
|
+
readonly recursive?: boolean | undefined;
|
|
79
|
+
}) => Effect.Effect<Array<string>, PlatformError>;
|
|
80
|
+
|
|
81
|
+
readonly readDirectoryEntries: (path: string) => Effect.Effect<ReadonlyArray<DirectoryEntry>, PlatformError>;
|
|
82
|
+
|
|
83
|
+
readonly readFile: (path: string) => Effect.Effect<Uint8Array, PlatformError>;
|
|
84
|
+
|
|
85
|
+
readonly readFileString: (path: string, encoding?: string) => Effect.Effect<string, PlatformError>;
|
|
86
|
+
|
|
87
|
+
readonly readLink: (path: string) => Effect.Effect<string, PlatformError>;
|
|
88
|
+
|
|
89
|
+
readonly realPath: (path: string) => Effect.Effect<string, PlatformError>;
|
|
90
|
+
|
|
91
|
+
readonly remove: (path: string, options?: {
|
|
92
|
+
|
|
93
|
+
readonly recursive?: boolean | undefined;
|
|
94
|
+
|
|
95
|
+
readonly force?: boolean | undefined;
|
|
96
|
+
}) => Effect.Effect<void, PlatformError>;
|
|
97
|
+
|
|
98
|
+
readonly rename: (oldPath: string, newPath: string) => Effect.Effect<void, PlatformError>;
|
|
99
|
+
|
|
100
|
+
readonly sink: (path: string, options?: {
|
|
101
|
+
readonly flag?: OpenFlag | undefined;
|
|
102
|
+
readonly mode?: number | undefined;
|
|
103
|
+
}) => Sink.Sink<void, Uint8Array, never, PlatformError>;
|
|
104
|
+
|
|
105
|
+
readonly stat: (path: string) => Effect.Effect<File.Info, PlatformError>;
|
|
106
|
+
|
|
107
|
+
readonly stream: (path: string, options?: {
|
|
108
|
+
readonly bytesToRead?: ByteSize.Input | undefined;
|
|
109
|
+
readonly chunkSize?: number | undefined;
|
|
110
|
+
readonly offset?: ByteSize.Input | undefined;
|
|
111
|
+
}) => Stream.Stream<Uint8Array, PlatformError>;
|
|
112
|
+
|
|
113
|
+
readonly symlink: (fromPath: string, toPath: string) => Effect.Effect<void, PlatformError>;
|
|
114
|
+
|
|
115
|
+
readonly truncate: (path: string, length?: number) => Effect.Effect<void, PlatformError>;
|
|
116
|
+
|
|
117
|
+
readonly utimes: (path: string, atime: Date | number, mtime: Date | number) => Effect.Effect<void, PlatformError>;
|
|
118
|
+
|
|
119
|
+
readonly watch: (path: string, options?: WatchOptions) => Stream.Stream<WatchEvent, PlatformError>;
|
|
120
|
+
|
|
121
|
+
readonly writeFile: (path: string, data: Uint8Array, options?: {
|
|
122
|
+
readonly flag?: OpenFlag | undefined;
|
|
123
|
+
readonly mode?: number | undefined;
|
|
124
|
+
}) => Effect.Effect<void, PlatformError>;
|
|
125
|
+
|
|
126
|
+
readonly writeFileString: (path: string, data: string, options?: {
|
|
127
|
+
readonly flag?: OpenFlag | undefined;
|
|
128
|
+
readonly mode?: number | undefined;
|
|
129
|
+
}) => Effect.Effect<void, PlatformError>;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export type OpenFlag = "r" | "r+" | "w" | "wx" | "w+" | "wx+" | "a" | "ax" | "a+" | "ax+";
|
|
133
|
+
|
|
134
|
+
export declare const FileSystem: Context.Service<FileSystem, FileSystem>;
|
|
135
|
+
|
|
136
|
+
export interface DirectoryEntry {
|
|
137
|
+
readonly name: string;
|
|
138
|
+
readonly type: File.Type;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export declare const make: (impl: Omit<FileSystem, typeof TypeId | "exists" | "glob" | "readFileString" | "stream" | "sink" | "writeFileString">) => FileSystem;
|
|
142
|
+
|
|
143
|
+
export declare const makeNoop: (fileSystem: Partial<FileSystem>) => FileSystem;
|
|
144
|
+
|
|
145
|
+
export declare const layerNoop: (fileSystem: Partial<FileSystem>) => Layer.Layer<FileSystem>;
|
|
146
|
+
|
|
147
|
+
export declare const FileTypeId = "~effect/FileSystem/File";
|
|
148
|
+
|
|
149
|
+
export declare const isFile: (u: unknown) => u is File;
|
|
150
|
+
|
|
151
|
+
export interface File {
|
|
152
|
+
readonly [FileTypeId]: typeof FileTypeId;
|
|
153
|
+
|
|
154
|
+
readonly stat: Effect.Effect<File.Info, PlatformError>;
|
|
155
|
+
|
|
156
|
+
readonly seek: (offset: bigint, from: SeekMode) => Effect.Effect<bigint, PlatformError>;
|
|
157
|
+
readonly sync: Effect.Effect<void, PlatformError>;
|
|
158
|
+
|
|
159
|
+
readonly read: (buffer: Uint8Array, options?: File.ReadOptions) => Effect.Effect<number, PlatformError>;
|
|
160
|
+
|
|
161
|
+
readonly readAlloc: (size: number, options?: File.ReadOptions) => Effect.Effect<Option.Option<Uint8Array>, PlatformError>;
|
|
162
|
+
readonly truncate: (length?: number) => Effect.Effect<void, PlatformError>;
|
|
163
|
+
readonly write: (buffer: Uint8Array) => Effect.Effect<number, PlatformError>;
|
|
164
|
+
readonly writeAll: (buffer: Uint8Array) => Effect.Effect<void, PlatformError>;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export declare namespace File {
|
|
168
|
+
|
|
169
|
+
interface ReadOptions {
|
|
170
|
+
readonly position?: bigint | undefined;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
type Type = "File" | "Directory" | "SymbolicLink" | "BlockDevice" | "CharacterDevice" | "FIFO" | "Socket" | "Unknown";
|
|
174
|
+
|
|
175
|
+
interface Info {
|
|
176
|
+
readonly type: Type;
|
|
177
|
+
readonly mtime: Option.Option<Date>;
|
|
178
|
+
readonly atime: Option.Option<Date>;
|
|
179
|
+
readonly birthtime: Option.Option<Date>;
|
|
180
|
+
readonly dev: bigint;
|
|
181
|
+
readonly ino: Option.Option<bigint>;
|
|
182
|
+
readonly mode: number;
|
|
183
|
+
readonly nlink: Option.Option<bigint>;
|
|
184
|
+
readonly uid: Option.Option<number>;
|
|
185
|
+
readonly gid: Option.Option<number>;
|
|
186
|
+
readonly rdev: Option.Option<bigint>;
|
|
187
|
+
readonly size: ByteSize.ByteSize;
|
|
188
|
+
readonly blksize: Option.Option<ByteSize.ByteSize>;
|
|
189
|
+
readonly blocks: Option.Option<bigint>;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export type SeekMode = "start" | "current";
|
|
194
|
+
|
|
195
|
+
export interface WatchOptions {
|
|
196
|
+
|
|
197
|
+
readonly recursive?: boolean | undefined;
|
|
198
|
+
|
|
199
|
+
readonly onReady?: (() => void) | undefined;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export type WatchEvent = WatchEvent.Create | WatchEvent.Update | WatchEvent.Remove;
|
|
203
|
+
|
|
204
|
+
export declare namespace WatchEvent {
|
|
205
|
+
|
|
206
|
+
interface Create {
|
|
207
|
+
readonly _tag: "Create";
|
|
208
|
+
readonly path: string;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
interface Update {
|
|
212
|
+
readonly _tag: "Update";
|
|
213
|
+
readonly path: string;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
interface Remove {
|
|
217
|
+
readonly _tag: "Remove";
|
|
218
|
+
readonly path: string;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
declare const WatchBackend_base: Context.ServiceClass<WatchBackend, "effect/FileSystem/WatchBackend", {
|
|
222
|
+
readonly register: (path: string, stat: File.Info, options?: WatchOptions) => Option.Option<Stream.Stream<WatchEvent, PlatformError>>;
|
|
223
|
+
}>;
|
|
224
|
+
|
|
225
|
+
export declare class WatchBackend extends WatchBackend_base {
|
|
226
|
+
}
|
|
227
|
+
export {};
|