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,155 @@
|
|
|
1
|
+
|
|
2
|
+
import * as BigDecimal from "./BigDecimal.ts";
|
|
3
|
+
import * as ByteSize from "./ByteSize.ts";
|
|
4
|
+
import * as DateTime from "./DateTime.ts";
|
|
5
|
+
import * as Duration from "./Duration.ts";
|
|
6
|
+
import * as Effect from "./Effect.ts";
|
|
7
|
+
import * as Option from "./Option.ts";
|
|
8
|
+
import * as Pipeable from "./Pipeable.ts";
|
|
9
|
+
import type * as SchemaAST from "./SchemaAST.ts";
|
|
10
|
+
import * as SchemaGetter from "./SchemaGetter.ts";
|
|
11
|
+
import * as SchemaIssue from "./SchemaIssue.ts";
|
|
12
|
+
|
|
13
|
+
export interface Middleware<in out T, in out E, RDE, RDT, RET, REE> extends Pipeable.Pipeable {
|
|
14
|
+
readonly _tag: "Middleware";
|
|
15
|
+
readonly decode: (effect: Effect.Effect<Option.Option<E>, SchemaIssue.Issue, RDE>, options: SchemaAST.ParseOptions) => Effect.Effect<Option.Option<T>, SchemaIssue.Issue, RDT>;
|
|
16
|
+
readonly encode: (effect: Effect.Effect<Option.Option<T>, SchemaIssue.Issue, RET>, options: SchemaAST.ParseOptions) => Effect.Effect<Option.Option<E>, SchemaIssue.Issue, REE>;
|
|
17
|
+
flip(): Middleware<E, T, RET, REE, RDE, RDT>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export declare const Middleware: new <T, E, RDE, RDT, RET, REE>(decode: (effect: Effect.Effect<Option.Option<E>, SchemaIssue.Issue, RDE>, options: SchemaAST.ParseOptions) => Effect.Effect<Option.Option<T>, SchemaIssue.Issue, RDT>, encode: (effect: Effect.Effect<Option.Option<T>, SchemaIssue.Issue, RET>, options: SchemaAST.ParseOptions) => Effect.Effect<Option.Option<E>, SchemaIssue.Issue, REE>) => Middleware<T, E, RDE, RDT, RET, REE>;
|
|
21
|
+
declare const TypeId = "~effect/SchemaTransformation/Transformation";
|
|
22
|
+
|
|
23
|
+
export interface Transformation<in out T, in out E, RD = never, RE = never> extends Pipeable.Pipeable {
|
|
24
|
+
readonly [TypeId]: typeof TypeId;
|
|
25
|
+
readonly _tag: "Transformation";
|
|
26
|
+
readonly decode: SchemaGetter.Getter<T, E, RD>;
|
|
27
|
+
readonly encode: SchemaGetter.Getter<E, T, RE>;
|
|
28
|
+
flip(): Transformation<E, T, RE, RD>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export declare const Transformation: new <T, E, RD = never, RE = never>(decode: SchemaGetter.Getter<T, E, RD>, encode: SchemaGetter.Getter<E, T, RE>) => Transformation<T, E, RD, RE>;
|
|
32
|
+
|
|
33
|
+
export declare const composeTransformation: {
|
|
34
|
+
|
|
35
|
+
<T, T2, RD2, RE2>(other: Transformation<T2, T, RD2, RE2>): <E, RD, RE>(self: Transformation<T, E, RD, RE>) => Transformation<T2, E, RD | RD2, RE | RE2>;
|
|
36
|
+
|
|
37
|
+
<T, E, RD, RE, T2, RD2, RE2>(self: Transformation<T, E, RD, RE>, other: Transformation<T2, T, RD2, RE2>): Transformation<T2, E, RD | RD2, RE | RE2>;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export declare function isTransformation(u: unknown): u is Transformation<any, any, unknown, unknown>;
|
|
41
|
+
|
|
42
|
+
export declare const makeTransformation: <T, E, RD = never, RE = never>(options: {
|
|
43
|
+
readonly decode: SchemaGetter.Getter<T, E, RD>;
|
|
44
|
+
readonly encode: SchemaGetter.Getter<E, T, RE>;
|
|
45
|
+
}) => Transformation<T, E, RD, RE>;
|
|
46
|
+
|
|
47
|
+
export declare function transformEffect<T, E, RD = never, RE = never>(options: {
|
|
48
|
+
readonly decode: (e: E, options: SchemaAST.ParseOptions) => Effect.Effect<T, SchemaIssue.Issue, RD>;
|
|
49
|
+
readonly encode: (t: T, options: SchemaAST.ParseOptions) => Effect.Effect<E, SchemaIssue.Issue, RE>;
|
|
50
|
+
}): Transformation<T, E, RD, RE>;
|
|
51
|
+
|
|
52
|
+
export declare function transform<T, E>(options: {
|
|
53
|
+
readonly decode: (input: E) => T;
|
|
54
|
+
readonly encode: (input: T) => E;
|
|
55
|
+
}): Transformation<T, E>;
|
|
56
|
+
|
|
57
|
+
export declare function transformOptional<T, E>(options: {
|
|
58
|
+
readonly decode: (input: Option.Option<E>) => Option.Option<T>;
|
|
59
|
+
readonly encode: (input: Option.Option<T>) => Option.Option<E>;
|
|
60
|
+
}): Transformation<T, E>;
|
|
61
|
+
|
|
62
|
+
export declare function trim(): Transformation<string, string>;
|
|
63
|
+
|
|
64
|
+
export declare function snakeToCamel(): Transformation<string, string>;
|
|
65
|
+
|
|
66
|
+
export declare function toLowerCase(): Transformation<string, string>;
|
|
67
|
+
|
|
68
|
+
export declare function toUpperCase(): Transformation<string, string>;
|
|
69
|
+
|
|
70
|
+
export declare function capitalize(): Transformation<string, string>;
|
|
71
|
+
|
|
72
|
+
export declare function uncapitalize(): Transformation<string, string>;
|
|
73
|
+
|
|
74
|
+
export declare function splitKeyValue(options?: {
|
|
75
|
+
readonly separator?: string | undefined;
|
|
76
|
+
readonly keyValueSeparator?: string | undefined;
|
|
77
|
+
readonly trim?: boolean | undefined;
|
|
78
|
+
readonly keepEmptyValues?: boolean | undefined;
|
|
79
|
+
}): Transformation<Record<string, string>, string>;
|
|
80
|
+
|
|
81
|
+
export declare function passthrough<T, E>(options: {
|
|
82
|
+
readonly strict: false;
|
|
83
|
+
}): Transformation<T, E>;
|
|
84
|
+
export declare function passthrough<T>(): Transformation<T, T>;
|
|
85
|
+
|
|
86
|
+
export declare function passthroughSupertype<T extends E, E>(): Transformation<T, E>;
|
|
87
|
+
|
|
88
|
+
export declare function passthroughSubtype<T, E extends T>(): Transformation<T, E>;
|
|
89
|
+
|
|
90
|
+
export declare const numberFromString: Transformation<number, string, never, never>;
|
|
91
|
+
|
|
92
|
+
export declare const bigintFromString: Transformation<bigint, string, never, never>;
|
|
93
|
+
|
|
94
|
+
export declare const dateFromString: Transformation<globalThis.Date, string>;
|
|
95
|
+
|
|
96
|
+
export declare const dateFromMillis: Transformation<globalThis.Date, number>;
|
|
97
|
+
|
|
98
|
+
export declare const durationFromString: Transformation<Duration.Duration, string>;
|
|
99
|
+
|
|
100
|
+
export declare const durationFromNanos: Transformation<Duration.Duration, bigint>;
|
|
101
|
+
|
|
102
|
+
export declare const durationFromMillis: Transformation<Duration.Duration, number>;
|
|
103
|
+
|
|
104
|
+
export declare const byteSizeFromString: Transformation<ByteSize.ByteSize, string>;
|
|
105
|
+
|
|
106
|
+
export declare const byteSizeFromBigInt: Transformation<ByteSize.ByteSize, bigint>;
|
|
107
|
+
|
|
108
|
+
export declare const byteSizeFromNumber: Transformation<ByteSize.ByteSize, number>;
|
|
109
|
+
|
|
110
|
+
export declare function optionFromNullOr<T>(): Transformation<Option.Option<T>, T | null>;
|
|
111
|
+
|
|
112
|
+
export declare function optionFromUndefinedOr<T>(): Transformation<Option.Option<T>, T | undefined>;
|
|
113
|
+
|
|
114
|
+
export declare function optionFromNullishOr<T>(options?: {
|
|
115
|
+
onNoneEncoding: null | undefined;
|
|
116
|
+
}): Transformation<Option.Option<T>, T | null | undefined>;
|
|
117
|
+
|
|
118
|
+
export declare function optionFromOptionalKey<T>(): Transformation<Option.Option<T>, T>;
|
|
119
|
+
|
|
120
|
+
export declare function optionFromOptional<T>(): Transformation<Option.Option<T>, T | undefined>;
|
|
121
|
+
|
|
122
|
+
export declare const urlFromString: Transformation<URL, string>;
|
|
123
|
+
|
|
124
|
+
export declare const bigDecimalFromString: Transformation<BigDecimal.BigDecimal, string>;
|
|
125
|
+
|
|
126
|
+
export declare const uint8ArrayFromBase64String: Transformation<Uint8Array<ArrayBufferLike>, string>;
|
|
127
|
+
|
|
128
|
+
export declare const stringFromBase64String: Transformation<string, string>;
|
|
129
|
+
|
|
130
|
+
export declare const stringFromBase64UrlString: Transformation<string, string>;
|
|
131
|
+
|
|
132
|
+
export declare const stringFromHexString: Transformation<string, string>;
|
|
133
|
+
|
|
134
|
+
export declare const stringFromUriComponent: Transformation<string, string>;
|
|
135
|
+
|
|
136
|
+
export declare function fromJsonString(options?: {
|
|
137
|
+
readonly reviver?: Parameters<typeof JSON.parse>[1] | undefined;
|
|
138
|
+
readonly replacer?: SchemaGetter.JsonReplacer | undefined;
|
|
139
|
+
readonly space?: Parameters<typeof JSON.stringify>[2] | undefined;
|
|
140
|
+
}): Transformation<unknown, string>;
|
|
141
|
+
|
|
142
|
+
export declare const fromFormData: Transformation<unknown, FormData, never, never>;
|
|
143
|
+
|
|
144
|
+
export declare const fromURLSearchParams: Transformation<unknown, URLSearchParams, never, never>;
|
|
145
|
+
|
|
146
|
+
export declare const timeZoneOffsetFromNumber: Transformation<DateTime.TimeZone.Offset, number>;
|
|
147
|
+
|
|
148
|
+
export declare const timeZoneNamedFromString: Transformation<DateTime.TimeZone.Named, string>;
|
|
149
|
+
|
|
150
|
+
export declare const timeZoneFromString: Transformation<DateTime.TimeZone, string>;
|
|
151
|
+
|
|
152
|
+
export declare const dateTimeUtcFromString: Transformation<DateTime.Utc, string>;
|
|
153
|
+
|
|
154
|
+
export declare const dateTimeZonedFromString: Transformation<DateTime.Zoned, string>;
|
|
155
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
|
|
2
|
+
import type * as Context from "./Context.ts";
|
|
3
|
+
import type { Effect } from "./Effect.ts";
|
|
4
|
+
import type { Exit } from "./Exit.ts";
|
|
5
|
+
declare const TypeId = "~effect/Scope";
|
|
6
|
+
declare const CloseableTypeId = "~effect/Scope/Closeable";
|
|
7
|
+
|
|
8
|
+
export interface Scope {
|
|
9
|
+
readonly [TypeId]: typeof TypeId;
|
|
10
|
+
readonly strategy: "sequential" | "parallel";
|
|
11
|
+
readonly parent: Scope | undefined;
|
|
12
|
+
state: State.Open | State.Closed | State.Empty;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface Closeable extends Scope {
|
|
16
|
+
readonly [CloseableTypeId]: typeof CloseableTypeId;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export declare namespace State {
|
|
20
|
+
|
|
21
|
+
type Empty = {
|
|
22
|
+
readonly _tag: "Empty";
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
type Open = {
|
|
26
|
+
readonly _tag: "Open";
|
|
27
|
+
finalizerKey: {} | undefined;
|
|
28
|
+
finalizer: ((exit: Exit<any, any>) => Effect<void>) | undefined;
|
|
29
|
+
finalizers: Map<{}, (exit: Exit<any, any>) => Effect<void>> | undefined;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
type Closed = {
|
|
33
|
+
readonly _tag: "Closed";
|
|
34
|
+
readonly exit: Exit<any, any>;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export declare const Scope: Context.Service<Scope, Scope>;
|
|
39
|
+
|
|
40
|
+
export declare const make: (finalizerStrategy?: "sequential" | "parallel") => Effect<Closeable>;
|
|
41
|
+
|
|
42
|
+
export declare const makeUnsafe: (finalizerStrategy?: "sequential" | "parallel") => Closeable;
|
|
43
|
+
|
|
44
|
+
export declare const provide: {
|
|
45
|
+
|
|
46
|
+
(value: Scope): <A, E, R>(self: Effect<A, E, R>) => Effect<A, E, Exclude<R, Scope>>;
|
|
47
|
+
|
|
48
|
+
<A, E, R>(self: Effect<A, E, R>, value: Scope): Effect<A, E, Exclude<R, Scope>>;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export declare const addFinalizerExit: (scope: Scope, finalizer: (exit: Exit<any, any>) => Effect<unknown>) => Effect<void>;
|
|
52
|
+
|
|
53
|
+
export declare const addFinalizer: (scope: Scope, finalizer: Effect<unknown>) => Effect<void>;
|
|
54
|
+
|
|
55
|
+
export declare const fork: (scope: Scope, finalizerStrategy?: "sequential" | "parallel") => Effect<Closeable>;
|
|
56
|
+
|
|
57
|
+
export declare const forkUnsafe: (scope: Scope, finalizerStrategy?: "sequential" | "parallel") => Closeable;
|
|
58
|
+
|
|
59
|
+
export declare const close: <A, E>(self: Closeable, exit: Exit<A, E>) => Effect<void>;
|
|
60
|
+
|
|
61
|
+
export declare const closeUnsafe: <A, E>(self: Closeable, exit_: Exit<A, E>) => Effect<void, never, never> | undefined;
|
|
62
|
+
|
|
63
|
+
export declare const use: {
|
|
64
|
+
|
|
65
|
+
(scope: Closeable): <A, E, R>(self: Effect<A, E, R>) => Effect<A, E, Exclude<R, Scope>>;
|
|
66
|
+
|
|
67
|
+
<A, E, R>(self: Effect<A, E, R>, scope: Closeable): Effect<A, E, Exclude<R, Scope>>;
|
|
68
|
+
};
|
|
69
|
+
export {};
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import * as Equal from "./Equal.ts";
|
|
2
|
+
import * as Equ from "./Equivalence.ts";
|
|
3
|
+
import { type Inspectable } from "./Inspectable.ts";
|
|
4
|
+
import * as Option from "./Option.ts";
|
|
5
|
+
import * as order from "./Order.ts";
|
|
6
|
+
import { type Pipeable } from "./Pipeable.ts";
|
|
7
|
+
import * as Result from "./Result.ts";
|
|
8
|
+
declare const TypeId = "~effect/SemVer";
|
|
9
|
+
declare const SemVerErrorTypeId = "~effect/SemVer/SemVerError";
|
|
10
|
+
|
|
11
|
+
export interface SemVer extends Pipeable, Equal.Equal, Inspectable {
|
|
12
|
+
readonly [TypeId]: typeof TypeId;
|
|
13
|
+
readonly major: number;
|
|
14
|
+
readonly minor: number;
|
|
15
|
+
readonly patch: number;
|
|
16
|
+
readonly prerelease: ReadonlyArray<string | number>;
|
|
17
|
+
readonly build: ReadonlyArray<string>;
|
|
18
|
+
}
|
|
19
|
+
declare const SemVerError_base: new <A extends Record<string, any> = {}>(args: import("./Types.ts").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("./Cause.ts").YieldableError & {
|
|
20
|
+
readonly _tag: "SemVerError";
|
|
21
|
+
} & Readonly<A>;
|
|
22
|
+
|
|
23
|
+
export declare class SemVerError extends SemVerError_base<{
|
|
24
|
+
readonly message: string;
|
|
25
|
+
readonly input?: string;
|
|
26
|
+
}> {
|
|
27
|
+
readonly [SemVerErrorTypeId]: typeof SemVerErrorTypeId;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export declare const isSemVerError: (u: unknown) => u is SemVerError;
|
|
31
|
+
|
|
32
|
+
export declare const isSemVer: (u: unknown) => u is SemVer;
|
|
33
|
+
|
|
34
|
+
export interface Components {
|
|
35
|
+
readonly major: number;
|
|
36
|
+
readonly minor: number;
|
|
37
|
+
readonly patch: number;
|
|
38
|
+
readonly prerelease?: ReadonlyArray<string | number> | undefined;
|
|
39
|
+
readonly build?: ReadonlyArray<string> | undefined;
|
|
40
|
+
}
|
|
41
|
+
type NumericComponent = "0" | (`${bigint}` & `${"1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"}${string}`);
|
|
42
|
+
|
|
43
|
+
export type VersionString = `${NumericComponent}.${NumericComponent}.${NumericComponent}${"" | `-${string}` | `+${string}`}`;
|
|
44
|
+
|
|
45
|
+
export type Input = SemVer | VersionString | Components;
|
|
46
|
+
|
|
47
|
+
export declare const make: (components: Components) => SemVer;
|
|
48
|
+
|
|
49
|
+
export declare const parse: (input: string) => Result.Result<SemVer, SemVerError>;
|
|
50
|
+
|
|
51
|
+
export declare const parseUnsafe: (input: string) => SemVer;
|
|
52
|
+
|
|
53
|
+
export declare const fromInput: (input: Input) => Result.Result<SemVer, SemVerError>;
|
|
54
|
+
|
|
55
|
+
export declare const fromInputUnsafe: (input: Input) => SemVer;
|
|
56
|
+
|
|
57
|
+
export declare const format: (self: SemVer) => string;
|
|
58
|
+
|
|
59
|
+
export declare const isPrerelease: (self: SemVer) => boolean;
|
|
60
|
+
|
|
61
|
+
export declare const hasBuild: (self: SemVer) => boolean;
|
|
62
|
+
|
|
63
|
+
export declare const isInitialDevelopment: (self: SemVer) => boolean;
|
|
64
|
+
|
|
65
|
+
export declare const Order: order.Order<SemVer>;
|
|
66
|
+
|
|
67
|
+
export declare const Equivalence: Equ.Equivalence<SemVer>;
|
|
68
|
+
|
|
69
|
+
export declare const equals: {
|
|
70
|
+
|
|
71
|
+
(that: SemVer): (self: SemVer) => boolean;
|
|
72
|
+
|
|
73
|
+
(self: SemVer, that: SemVer): boolean;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export declare const isLessThan: {
|
|
77
|
+
|
|
78
|
+
(that: SemVer): (self: SemVer) => boolean;
|
|
79
|
+
|
|
80
|
+
(self: SemVer, that: SemVer): boolean;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export declare const isLessThanOrEqualTo: {
|
|
84
|
+
|
|
85
|
+
(that: SemVer): (self: SemVer) => boolean;
|
|
86
|
+
|
|
87
|
+
(self: SemVer, that: SemVer): boolean;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export declare const isGreaterThan: {
|
|
91
|
+
|
|
92
|
+
(that: SemVer): (self: SemVer) => boolean;
|
|
93
|
+
|
|
94
|
+
(self: SemVer, that: SemVer): boolean;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export declare const isGreaterThanOrEqualTo: {
|
|
98
|
+
|
|
99
|
+
(that: SemVer): (self: SemVer) => boolean;
|
|
100
|
+
|
|
101
|
+
(self: SemVer, that: SemVer): boolean;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export declare const between: {
|
|
105
|
+
|
|
106
|
+
(options: {
|
|
107
|
+
minimum: SemVer;
|
|
108
|
+
maximum: SemVer;
|
|
109
|
+
}): (self: SemVer) => boolean;
|
|
110
|
+
|
|
111
|
+
(self: SemVer, options: {
|
|
112
|
+
minimum: SemVer;
|
|
113
|
+
maximum: SemVer;
|
|
114
|
+
}): boolean;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export declare const min: {
|
|
118
|
+
|
|
119
|
+
(that: SemVer): (self: SemVer) => SemVer;
|
|
120
|
+
|
|
121
|
+
(self: SemVer, that: SemVer): SemVer;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export declare const max: {
|
|
125
|
+
|
|
126
|
+
(that: SemVer): (self: SemVer) => SemVer;
|
|
127
|
+
|
|
128
|
+
(self: SemVer, that: SemVer): SemVer;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
export declare const clamp: {
|
|
132
|
+
|
|
133
|
+
(options: {
|
|
134
|
+
minimum: SemVer;
|
|
135
|
+
maximum: SemVer;
|
|
136
|
+
}): (self: SemVer) => SemVer;
|
|
137
|
+
|
|
138
|
+
(self: SemVer, options: {
|
|
139
|
+
minimum: SemVer;
|
|
140
|
+
maximum: SemVer;
|
|
141
|
+
}): SemVer;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export declare const withPrerelease: {
|
|
145
|
+
|
|
146
|
+
(prerelease: ReadonlyArray<string | number>): (self: SemVer) => SemVer;
|
|
147
|
+
|
|
148
|
+
(self: SemVer, prerelease: ReadonlyArray<string | number>): SemVer;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
export declare const withBuild: {
|
|
152
|
+
|
|
153
|
+
(build: ReadonlyArray<string>): (self: SemVer) => SemVer;
|
|
154
|
+
|
|
155
|
+
(self: SemVer, build: ReadonlyArray<string>): SemVer;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
export declare const release: (self: SemVer) => SemVer;
|
|
159
|
+
|
|
160
|
+
export declare const bumpMajor: (self: SemVer) => SemVer;
|
|
161
|
+
|
|
162
|
+
export declare const bumpMinor: (self: SemVer) => SemVer;
|
|
163
|
+
|
|
164
|
+
export declare const bumpPatch: (self: SemVer) => SemVer;
|
|
165
|
+
|
|
166
|
+
export declare const bumpPremajor: {
|
|
167
|
+
|
|
168
|
+
(identifier?: string): (self: SemVer) => SemVer;
|
|
169
|
+
|
|
170
|
+
(self: SemVer, identifier?: string): SemVer;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
export declare const bumpPreminor: {
|
|
174
|
+
|
|
175
|
+
(identifier?: string): (self: SemVer) => SemVer;
|
|
176
|
+
|
|
177
|
+
(self: SemVer, identifier?: string): SemVer;
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
export declare const bumpPrepatch: {
|
|
181
|
+
|
|
182
|
+
(identifier?: string): (self: SemVer) => SemVer;
|
|
183
|
+
|
|
184
|
+
(self: SemVer, identifier?: string): SemVer;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
export declare const bumpPrerelease: {
|
|
188
|
+
|
|
189
|
+
(identifier?: string): (self: SemVer) => SemVer;
|
|
190
|
+
|
|
191
|
+
(self: SemVer, identifier?: string): SemVer;
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
export type ReleaseType = "major" | "premajor" | "minor" | "preminor" | "patch" | "prepatch" | "prerelease";
|
|
195
|
+
|
|
196
|
+
export declare const bump: {
|
|
197
|
+
|
|
198
|
+
(releaseType: ReleaseType, identifier?: string): (self: SemVer) => SemVer;
|
|
199
|
+
|
|
200
|
+
(self: SemVer, releaseType: ReleaseType, identifier?: string): SemVer;
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
export declare const difference: {
|
|
204
|
+
|
|
205
|
+
(that: SemVer): (self: SemVer) => Option.Option<ReleaseType>;
|
|
206
|
+
|
|
207
|
+
(self: SemVer, that: SemVer): Option.Option<ReleaseType>;
|
|
208
|
+
};
|
|
209
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
|
|
2
|
+
import * as Equal from "./Equal.ts";
|
|
3
|
+
import { type Inspectable } from "./Inspectable.ts";
|
|
4
|
+
import * as Option from "./Option.ts";
|
|
5
|
+
import { type Pipeable } from "./Pipeable.ts";
|
|
6
|
+
import * as Result from "./Result.ts";
|
|
7
|
+
import { type Input as VersionInput, type SemVer, type SemVerError } from "./SemVer.ts";
|
|
8
|
+
declare const TypeId = "~effect/SemVerRange";
|
|
9
|
+
|
|
10
|
+
export interface SemVerRange extends Pipeable, Equal.Equal, Inspectable {
|
|
11
|
+
readonly [TypeId]: typeof TypeId;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface MatchOptions {
|
|
15
|
+
|
|
16
|
+
readonly includePrerelease?: boolean | undefined;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export declare const isSemVerRange: (u: unknown) => u is SemVerRange;
|
|
20
|
+
|
|
21
|
+
export declare const parse: (input: string) => Result.Result<SemVerRange, SemVerError>;
|
|
22
|
+
|
|
23
|
+
export declare const parseUnsafe: (input: string) => SemVerRange;
|
|
24
|
+
|
|
25
|
+
export type Input = SemVerRange | string;
|
|
26
|
+
|
|
27
|
+
export declare const fromInput: (input: Input) => Result.Result<SemVerRange, SemVerError>;
|
|
28
|
+
|
|
29
|
+
export declare const fromInputUnsafe: (input: Input) => SemVerRange;
|
|
30
|
+
|
|
31
|
+
export declare const any: SemVerRange;
|
|
32
|
+
|
|
33
|
+
export declare const exact: (version: VersionInput) => SemVerRange;
|
|
34
|
+
|
|
35
|
+
export declare const greaterThan: (version: VersionInput) => SemVerRange;
|
|
36
|
+
|
|
37
|
+
export declare const greaterThanOrEqualTo: (version: VersionInput) => SemVerRange;
|
|
38
|
+
|
|
39
|
+
export declare const lessThan: (version: VersionInput) => SemVerRange;
|
|
40
|
+
|
|
41
|
+
export declare const lessThanOrEqualTo: (version: VersionInput) => SemVerRange;
|
|
42
|
+
|
|
43
|
+
export declare const caret: (version: VersionInput) => SemVerRange;
|
|
44
|
+
|
|
45
|
+
export declare const tilde: (version: VersionInput) => SemVerRange;
|
|
46
|
+
|
|
47
|
+
export declare const between: (options: {
|
|
48
|
+
readonly minimum: VersionInput;
|
|
49
|
+
readonly maximum: VersionInput;
|
|
50
|
+
}) => SemVerRange;
|
|
51
|
+
|
|
52
|
+
export declare const format: (self: SemVerRange) => string;
|
|
53
|
+
|
|
54
|
+
export declare const matches: {
|
|
55
|
+
|
|
56
|
+
(version: VersionInput, options?: MatchOptions): (self: SemVerRange) => boolean;
|
|
57
|
+
|
|
58
|
+
(self: SemVerRange, version: VersionInput, options?: MatchOptions): boolean;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export declare const maxSatisfying: {
|
|
62
|
+
|
|
63
|
+
(versions: Iterable<VersionInput>, options?: MatchOptions): (self: SemVerRange) => Option.Option<SemVer>;
|
|
64
|
+
|
|
65
|
+
(self: SemVerRange, versions: Iterable<VersionInput>, options?: MatchOptions): Option.Option<SemVer>;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export declare const minSatisfying: {
|
|
69
|
+
|
|
70
|
+
(versions: Iterable<VersionInput>, options?: MatchOptions): (self: SemVerRange) => Option.Option<SemVer>;
|
|
71
|
+
|
|
72
|
+
(self: SemVerRange, versions: Iterable<VersionInput>, options?: MatchOptions): Option.Option<SemVer>;
|
|
73
|
+
};
|
|
74
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
|
|
2
|
+
import type * as Effect from "./Effect.ts";
|
|
3
|
+
import type * as Option from "./Option.ts";
|
|
4
|
+
import type * as Scope from "./Scope.ts";
|
|
5
|
+
|
|
6
|
+
export interface Semaphore {
|
|
7
|
+
|
|
8
|
+
resize(this: Semaphore, permits: number): Effect.Effect<void>;
|
|
9
|
+
|
|
10
|
+
withPermits(this: Semaphore, permits: number): <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
11
|
+
|
|
12
|
+
withPermit<A, E, R>(self: Effect.Effect<A, E, R>): Effect.Effect<A, E, R>;
|
|
13
|
+
|
|
14
|
+
withPermitsIfAvailable(this: Semaphore, permits: number): <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<Option.Option<A>, E, R>;
|
|
15
|
+
|
|
16
|
+
take(this: Semaphore, permits: number): Effect.Effect<number>;
|
|
17
|
+
|
|
18
|
+
takeScoped(this: Semaphore, permits: number): Effect.Effect<void, never, Scope.Scope>;
|
|
19
|
+
|
|
20
|
+
takeIfAvailable(this: Semaphore, permits: number): Effect.Effect<boolean>;
|
|
21
|
+
|
|
22
|
+
release(this: Semaphore, permits: number): Effect.Effect<number>;
|
|
23
|
+
|
|
24
|
+
readonly releaseAll: Effect.Effect<number>;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export declare const makeUnsafe: (permits: number) => Semaphore;
|
|
28
|
+
|
|
29
|
+
export declare const make: (permits: number) => Effect.Effect<Semaphore>;
|
|
30
|
+
|
|
31
|
+
export declare const resize: {
|
|
32
|
+
|
|
33
|
+
(permits: number): (self: Semaphore) => Effect.Effect<void>;
|
|
34
|
+
|
|
35
|
+
(self: Semaphore, permits: number): Effect.Effect<void>;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export declare const withPermits: {
|
|
39
|
+
|
|
40
|
+
(self: Semaphore, permits: number): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
41
|
+
|
|
42
|
+
<A, E, R>(self: Semaphore, permits: number, effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R>;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export declare const withPermit: {
|
|
46
|
+
|
|
47
|
+
(self: Semaphore): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
48
|
+
|
|
49
|
+
<A, E, R>(self: Semaphore, effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R>;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export declare const withPermitsIfAvailable: {
|
|
53
|
+
|
|
54
|
+
(self: Semaphore, permits: number): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<Option.Option<A>, E, R>;
|
|
55
|
+
|
|
56
|
+
<A, E, R>(self: Semaphore, permits: number, effect: Effect.Effect<A, E, R>): Effect.Effect<Option.Option<A>, E, R>;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export declare const take: {
|
|
60
|
+
|
|
61
|
+
(permits: number): (self: Semaphore) => Effect.Effect<number>;
|
|
62
|
+
|
|
63
|
+
(self: Semaphore, permits: number): Effect.Effect<number>;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export declare const takeScoped: {
|
|
67
|
+
|
|
68
|
+
(permits: number): (self: Semaphore) => Effect.Effect<void, never, Scope.Scope>;
|
|
69
|
+
|
|
70
|
+
(self: Semaphore, permits: number): Effect.Effect<void, never, Scope.Scope>;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export declare const takeIfAvailable: {
|
|
74
|
+
|
|
75
|
+
(permits: number): (self: Semaphore) => Effect.Effect<boolean>;
|
|
76
|
+
|
|
77
|
+
(self: Semaphore, permits: number): Effect.Effect<boolean>;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export declare const release: {
|
|
81
|
+
|
|
82
|
+
(permits: number): (self: Semaphore) => Effect.Effect<number>;
|
|
83
|
+
|
|
84
|
+
(self: Semaphore, permits: number): Effect.Effect<number>;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export declare const releaseAll: (self: Semaphore) => Effect.Effect<number>;
|