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,266 @@
|
|
|
1
|
+
|
|
2
|
+
import * as Context from "./Context.ts";
|
|
3
|
+
import * as Duration from "./Duration.ts";
|
|
4
|
+
import type { Effect } from "./Effect.ts";
|
|
5
|
+
import type { Exit } from "./Exit.ts";
|
|
6
|
+
import * as Layer from "./Layer.ts";
|
|
7
|
+
import type { Pipeable } from "./Pipeable.ts";
|
|
8
|
+
import type { Contravariant, Covariant } from "./Types.ts";
|
|
9
|
+
|
|
10
|
+
export interface Metric<in Input, out State> extends Pipeable {
|
|
11
|
+
readonly [TypeId]: typeof TypeId;
|
|
12
|
+
readonly Input: Contravariant<Input>;
|
|
13
|
+
readonly State: Covariant<State>;
|
|
14
|
+
readonly id: string;
|
|
15
|
+
readonly type: Metric.Type;
|
|
16
|
+
readonly description: string | undefined;
|
|
17
|
+
readonly attributes: Metric.AttributeSet | undefined;
|
|
18
|
+
readonly valueUnsafe: (context: Context.Context<never>) => State;
|
|
19
|
+
readonly updateUnsafe: (input: Input, context: Context.Context<never>) => void;
|
|
20
|
+
readonly modifyUnsafe: (input: Input, context: Context.Context<never>) => void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface Counter<in Input extends number | bigint> extends Metric<Input, CounterState<Input>> {
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface CounterState<in Input extends number | bigint> {
|
|
27
|
+
readonly count: Input extends bigint ? bigint : number;
|
|
28
|
+
readonly incremental: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface Frequency extends Metric<string, FrequencyState> {
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface FrequencyState {
|
|
35
|
+
readonly occurrences: ReadonlyMap<string, number>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface Gauge<in Input extends number | bigint> extends Metric<Input, GaugeState<Input>> {
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface GaugeState<in Input extends number | bigint> {
|
|
42
|
+
readonly value: Input extends bigint ? bigint : number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface Histogram<Input> extends Metric<Input, HistogramState> {
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export interface HistogramState {
|
|
49
|
+
readonly buckets: ReadonlyArray<[number, number]>;
|
|
50
|
+
readonly count: number;
|
|
51
|
+
readonly min: number;
|
|
52
|
+
readonly max: number;
|
|
53
|
+
readonly sum: number;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface Summary<Input> extends Metric<Input, SummaryState> {
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface SummaryState {
|
|
60
|
+
readonly quantiles: ReadonlyArray<readonly [number, number | undefined]>;
|
|
61
|
+
readonly count: number;
|
|
62
|
+
readonly min: number;
|
|
63
|
+
readonly max: number;
|
|
64
|
+
readonly sum: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export declare namespace Metric {
|
|
68
|
+
|
|
69
|
+
type Type = "Counter" | "Frequency" | "Gauge" | "Histogram" | "Summary";
|
|
70
|
+
|
|
71
|
+
type Attributes = AttributeSet | ReadonlyArray<[string, string]>;
|
|
72
|
+
|
|
73
|
+
type AttributeSet = Readonly<Record<string, string>>;
|
|
74
|
+
|
|
75
|
+
type Input<A> = A extends Metric<infer _Input, infer _State> ? _Input : never;
|
|
76
|
+
|
|
77
|
+
type State<A> = A extends Metric<infer _Input, infer _State> ? _State : never;
|
|
78
|
+
|
|
79
|
+
interface Hooks<in Input, out State> {
|
|
80
|
+
readonly get: (context: Context.Context<never>) => State;
|
|
81
|
+
readonly update: (input: Input, context: Context.Context<never>) => void;
|
|
82
|
+
readonly modify: (input: Input, context: Context.Context<never>) => void;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
interface Metadata<in Input, out State> {
|
|
86
|
+
readonly id: string;
|
|
87
|
+
readonly type: Type;
|
|
88
|
+
readonly description: string | undefined;
|
|
89
|
+
readonly attributes: Metric.AttributeSet | undefined;
|
|
90
|
+
readonly hooks: Hooks<Input, State>;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
interface SnapshotProto<T extends Type, State> {
|
|
94
|
+
readonly id: string;
|
|
95
|
+
readonly type: T;
|
|
96
|
+
readonly description: string | undefined;
|
|
97
|
+
readonly attributes: Metric.AttributeSet | undefined;
|
|
98
|
+
readonly state: State;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
type Snapshot = SnapshotProto<"Counter", CounterState<number | bigint>> | SnapshotProto<"Gauge", GaugeState<number | bigint>> | SnapshotProto<"Frequency", FrequencyState> | SnapshotProto<"Histogram", HistogramState> | SnapshotProto<"Summary", SummaryState>;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export declare const CurrentMetricAttributesKey: "effect/Metric/CurrentMetricAttributes";
|
|
105
|
+
|
|
106
|
+
export declare const CurrentMetricAttributes: Context.Reference<Readonly<Record<string, string>>>;
|
|
107
|
+
|
|
108
|
+
export type MetricRegistry = Map<string, Metric.Metadata<any, any>>;
|
|
109
|
+
|
|
110
|
+
export declare const MetricRegistry: Context.Reference<MetricRegistry>;
|
|
111
|
+
declare const TypeId = "~effect/Metric";
|
|
112
|
+
|
|
113
|
+
export declare const isMetric: (u: unknown) => u is Metric<never, unknown>;
|
|
114
|
+
|
|
115
|
+
export declare const counter: {
|
|
116
|
+
|
|
117
|
+
(name: string, options?: {
|
|
118
|
+
readonly description?: string | undefined;
|
|
119
|
+
readonly attributes?: Metric.Attributes | undefined;
|
|
120
|
+
readonly bigint?: false | undefined;
|
|
121
|
+
readonly incremental?: boolean | undefined;
|
|
122
|
+
}): Counter<number>;
|
|
123
|
+
|
|
124
|
+
(name: string, options: {
|
|
125
|
+
readonly description?: string | undefined;
|
|
126
|
+
readonly attributes?: Metric.Attributes | undefined;
|
|
127
|
+
readonly bigint: true;
|
|
128
|
+
readonly incremental?: boolean | undefined;
|
|
129
|
+
}): Counter<bigint>;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export declare const gauge: {
|
|
133
|
+
|
|
134
|
+
(name: string, options?: {
|
|
135
|
+
readonly description?: string | undefined;
|
|
136
|
+
readonly attributes?: Metric.Attributes | undefined;
|
|
137
|
+
readonly bigint?: false | undefined;
|
|
138
|
+
}): Gauge<number>;
|
|
139
|
+
|
|
140
|
+
(name: string, options: {
|
|
141
|
+
readonly description?: string | undefined;
|
|
142
|
+
readonly attributes?: Metric.Attributes | undefined;
|
|
143
|
+
readonly bigint: true;
|
|
144
|
+
}): Gauge<bigint>;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export declare const frequency: (name: string, options?: {
|
|
148
|
+
readonly description?: string | undefined;
|
|
149
|
+
readonly attributes?: Metric.Attributes | undefined;
|
|
150
|
+
readonly preregisteredWords?: ReadonlyArray<string> | undefined;
|
|
151
|
+
}) => Frequency;
|
|
152
|
+
|
|
153
|
+
export declare const histogram: (name: string, options: {
|
|
154
|
+
readonly description?: string | undefined;
|
|
155
|
+
readonly attributes?: Metric.Attributes | undefined;
|
|
156
|
+
readonly boundaries: ReadonlyArray<number>;
|
|
157
|
+
}) => Histogram<number>;
|
|
158
|
+
|
|
159
|
+
export declare const summary: (name: string, options: {
|
|
160
|
+
readonly description?: string | undefined;
|
|
161
|
+
readonly attributes?: Metric.Attributes | undefined;
|
|
162
|
+
readonly maxAge: Duration.Input;
|
|
163
|
+
readonly maxSize: number;
|
|
164
|
+
readonly quantiles: ReadonlyArray<number>;
|
|
165
|
+
}) => Summary<number>;
|
|
166
|
+
|
|
167
|
+
export declare const summaryWithTimestamp: (name: string, options: {
|
|
168
|
+
readonly description?: string | undefined;
|
|
169
|
+
readonly attributes?: Metric.Attributes | undefined;
|
|
170
|
+
readonly maxAge: Duration.Input;
|
|
171
|
+
readonly maxSize: number;
|
|
172
|
+
readonly quantiles: ReadonlyArray<number>;
|
|
173
|
+
}) => Summary<[value: number, timestamp: number]>;
|
|
174
|
+
|
|
175
|
+
export declare const timer: (name: string, options?: {
|
|
176
|
+
readonly description?: string | undefined;
|
|
177
|
+
readonly attributes?: Metric.Attributes | undefined;
|
|
178
|
+
readonly boundaries?: ReadonlyArray<number>;
|
|
179
|
+
}) => Histogram<Duration.Duration>;
|
|
180
|
+
|
|
181
|
+
export declare const value: <Input, State>(self: Metric<Input, State>) => Effect<State>;
|
|
182
|
+
|
|
183
|
+
export declare const modify: {
|
|
184
|
+
|
|
185
|
+
<Input>(input: Input): <State>(self: Metric<Input, State>) => Effect<void>;
|
|
186
|
+
|
|
187
|
+
<Input, State>(self: Metric<Input, State>, input: Input): Effect<void>;
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
export declare const update: {
|
|
191
|
+
|
|
192
|
+
<Input>(input: Input): <State>(self: Metric<Input, State>) => Effect<void>;
|
|
193
|
+
|
|
194
|
+
<Input, State>(self: Metric<Input, State>, input: Input): Effect<void>;
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
export interface Registration {
|
|
198
|
+
readonly remove: () => void;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export declare const remove: <Input, State>(self: Metric<Input, State>) => Effect<void>;
|
|
202
|
+
|
|
203
|
+
export declare const removeUnsafe: <Input, State>(self: Metric<Input, State>, context: Context.Context<never>) => void;
|
|
204
|
+
|
|
205
|
+
export declare const registerUnsafe: <Input, State>(self: Metric<Input, State>, context: Context.Context<never>, hooks: Metric.Hooks<Input, State>) => Registration;
|
|
206
|
+
|
|
207
|
+
export declare const mapInput: {
|
|
208
|
+
|
|
209
|
+
<Input, Input2 extends Input>(f: (input: Input2, context: Context.Context<never>) => Input): <State>(self: Metric<Input, State>) => Metric<Input2, State>;
|
|
210
|
+
|
|
211
|
+
<Input, State, Input2>(self: Metric<Input, State>, f: (input: Input2, context: Context.Context<never>) => Input): Metric<Input2, State>;
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
export declare const withConstantInput: {
|
|
215
|
+
|
|
216
|
+
<Input>(input: Input): <State>(self: Metric<Input, State>) => Metric<unknown, State>;
|
|
217
|
+
|
|
218
|
+
<Input, State>(self: Metric<Input, State>, input: Input): Metric<unknown, State>;
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
export declare const withAttributes: {
|
|
222
|
+
|
|
223
|
+
(attributes: Metric.Attributes): <Input, State>(self: Metric<Input, State>) => Metric<Input, State>;
|
|
224
|
+
|
|
225
|
+
<Input, State>(self: Metric<Input, State>, attributes: Metric.Attributes): Metric<Input, State>;
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
export declare const snapshot: Effect<ReadonlyArray<Metric.Snapshot>>;
|
|
229
|
+
|
|
230
|
+
export declare const dump: Effect<string>;
|
|
231
|
+
|
|
232
|
+
export declare const snapshotUnsafe: (context: Context.Context<never>) => ReadonlyArray<Metric.Snapshot>;
|
|
233
|
+
|
|
234
|
+
export declare const boundariesFromIterable: (iterable: Iterable<number>) => ReadonlyArray<number>;
|
|
235
|
+
|
|
236
|
+
export declare const linearBoundaries: (options: {
|
|
237
|
+
readonly start: number;
|
|
238
|
+
readonly width: number;
|
|
239
|
+
readonly count: number;
|
|
240
|
+
}) => ReadonlyArray<number>;
|
|
241
|
+
|
|
242
|
+
export declare const exponentialBoundaries: (options: {
|
|
243
|
+
readonly start: number;
|
|
244
|
+
readonly factor: number;
|
|
245
|
+
readonly count: number;
|
|
246
|
+
}) => ReadonlyArray<number>;
|
|
247
|
+
|
|
248
|
+
export declare const FiberRuntimeMetricsKey: "effect/Metric/FiberRuntimeMetrics";
|
|
249
|
+
|
|
250
|
+
export interface FiberRuntimeMetricsService {
|
|
251
|
+
readonly recordFiberStart: (context: Context.Context<never>) => void;
|
|
252
|
+
readonly recordFiberEnd: (context: Context.Context<never>, exit: Exit<unknown, unknown>) => void;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export declare const FiberRuntimeMetrics: Context.Reference<FiberRuntimeMetricsService | undefined>;
|
|
256
|
+
|
|
257
|
+
export declare const FiberRuntimeMetricsImpl: FiberRuntimeMetricsService;
|
|
258
|
+
|
|
259
|
+
export declare const enableRuntimeMetricsLayer: Layer.Layer<never, never, never>;
|
|
260
|
+
|
|
261
|
+
export declare const disableRuntimeMetricsLayer: Layer.Layer<never, never, never>;
|
|
262
|
+
|
|
263
|
+
export declare const enableRuntimeMetrics: <A, E, R>(self: Effect<A, E, R>) => Effect<A, E, R>;
|
|
264
|
+
|
|
265
|
+
export declare const disableRuntimeMetrics: <A, E, R>(self: Effect<A, E, R>) => Effect<A, E, R>;
|
|
266
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
|
|
2
|
+
import type { NonEmptyArray } from "./Array.ts";
|
|
3
|
+
import { type Inspectable } from "./Inspectable.ts";
|
|
4
|
+
import * as Option from "./Option.ts";
|
|
5
|
+
import type { Pipeable } from "./Pipeable.ts";
|
|
6
|
+
declare const TypeId = "~effect/MutableHashMap";
|
|
7
|
+
|
|
8
|
+
export interface MutableHashMap<out K, out V> extends Iterable<[K, V]>, Pipeable, Inspectable {
|
|
9
|
+
readonly [TypeId]: typeof TypeId;
|
|
10
|
+
readonly backing: Map<K, V>;
|
|
11
|
+
readonly buckets: Map<number, NonEmptyArray<K>>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export declare const isMutableHashMap: <K, V>(value: unknown) => value is MutableHashMap<K, V>;
|
|
15
|
+
|
|
16
|
+
export declare const empty: <K, V>() => MutableHashMap<K, V>;
|
|
17
|
+
|
|
18
|
+
export declare const make: <Entries extends Array<readonly [any, any]>>(...entries: Entries) => MutableHashMap<Entries[number] extends readonly [infer K, any] ? K : never, Entries[number] extends readonly [any, infer V] ? V : never>;
|
|
19
|
+
|
|
20
|
+
export declare const fromIterable: <K, V>(entries: Iterable<readonly [K, V]>) => MutableHashMap<K, V>;
|
|
21
|
+
|
|
22
|
+
export declare const get: {
|
|
23
|
+
|
|
24
|
+
<K>(key: K): <V>(self: MutableHashMap<K, V>) => Option.Option<V>;
|
|
25
|
+
|
|
26
|
+
<K, V>(self: MutableHashMap<K, V>, key: K): Option.Option<V>;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export declare const keys: <K, V>(self: MutableHashMap<K, V>) => Iterable<K>;
|
|
30
|
+
|
|
31
|
+
export declare const values: <K, V>(self: MutableHashMap<K, V>) => Iterable<V>;
|
|
32
|
+
|
|
33
|
+
export declare const has: {
|
|
34
|
+
|
|
35
|
+
<K>(key: K): <V>(self: MutableHashMap<K, V>) => boolean;
|
|
36
|
+
|
|
37
|
+
<K, V>(self: MutableHashMap<K, V>, key: K): boolean;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export declare const set: {
|
|
41
|
+
|
|
42
|
+
<K, V>(key: K, value: V): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>;
|
|
43
|
+
|
|
44
|
+
<K, V>(self: MutableHashMap<K, V>, key: K, value: V): MutableHashMap<K, V>;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export declare const modify: {
|
|
48
|
+
|
|
49
|
+
<K, V>(key: K, f: (v: V) => V): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>;
|
|
50
|
+
|
|
51
|
+
<K, V>(self: MutableHashMap<K, V>, key: K, f: (v: V) => V): MutableHashMap<K, V>;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export declare const modifyAt: {
|
|
55
|
+
|
|
56
|
+
<K, V>(key: K, f: (value: Option.Option<V>) => Option.Option<V>): (self: MutableHashMap<K, V>) => MutableHashMap<K, V>;
|
|
57
|
+
|
|
58
|
+
<K, V>(self: MutableHashMap<K, V>, key: K, f: (value: Option.Option<V>) => Option.Option<V>): MutableHashMap<K, V>;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export declare const remove: {
|
|
62
|
+
|
|
63
|
+
<K>(key: K): <V>(self: MutableHashMap<K, V>) => MutableHashMap<K, V>;
|
|
64
|
+
|
|
65
|
+
<K, V>(self: MutableHashMap<K, V>, key: K): MutableHashMap<K, V>;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export declare const clear: <K, V>(self: MutableHashMap<K, V>) => MutableHashMap<K, V>;
|
|
69
|
+
|
|
70
|
+
export declare const size: <K, V>(self: MutableHashMap<K, V>) => number;
|
|
71
|
+
|
|
72
|
+
export declare const isEmpty: <K, V>(self: MutableHashMap<K, V>) => boolean;
|
|
73
|
+
|
|
74
|
+
export declare const forEach: {
|
|
75
|
+
|
|
76
|
+
<K, V>(f: (value: V, key: K) => void): (self: MutableHashMap<K, V>) => void;
|
|
77
|
+
|
|
78
|
+
<K, V>(self: MutableHashMap<K, V>, f: (value: V, key: K) => void): void;
|
|
79
|
+
};
|
|
80
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
|
|
2
|
+
export interface MutableList<in out A> {
|
|
3
|
+
head: MutableList.Bucket<A> | undefined;
|
|
4
|
+
tail: MutableList.Bucket<A> | undefined;
|
|
5
|
+
length: number;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export declare namespace MutableList {
|
|
9
|
+
|
|
10
|
+
interface Bucket<A> {
|
|
11
|
+
readonly array: Array<A>;
|
|
12
|
+
mutable: boolean;
|
|
13
|
+
offset: number;
|
|
14
|
+
next: Bucket<A> | undefined;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export declare const Empty: unique symbol;
|
|
19
|
+
|
|
20
|
+
export type Empty = typeof Empty;
|
|
21
|
+
|
|
22
|
+
export declare const make: <A>() => MutableList<A>;
|
|
23
|
+
|
|
24
|
+
export declare const append: <A>(self: MutableList<A>, message: A) => void;
|
|
25
|
+
|
|
26
|
+
export declare const prepend: <A>(self: MutableList<A>, message: A) => void;
|
|
27
|
+
|
|
28
|
+
export declare const prependAll: <A>(self: MutableList<A>, messages: Iterable<A>) => void;
|
|
29
|
+
|
|
30
|
+
export declare const prependAllUnsafe: <A>(self: MutableList<A>, messages: ReadonlyArray<A>, mutable?: boolean) => void;
|
|
31
|
+
|
|
32
|
+
export declare const appendAll: <A>(self: MutableList<A>, messages: Iterable<A>) => number;
|
|
33
|
+
|
|
34
|
+
export declare const appendAllUnsafe: <A>(self: MutableList<A>, messages: ReadonlyArray<A>, mutable?: boolean) => number;
|
|
35
|
+
|
|
36
|
+
export declare const clear: <A>(self: MutableList<A>) => void;
|
|
37
|
+
|
|
38
|
+
export declare const takeN: <A>(self: MutableList<A>, n: number) => Array<A>;
|
|
39
|
+
|
|
40
|
+
export declare const takeNVoid: <A>(self: MutableList<A>, n: number) => void;
|
|
41
|
+
|
|
42
|
+
export declare const takeAll: <A>(self: MutableList<A>) => Array<A>;
|
|
43
|
+
|
|
44
|
+
export declare const take: <A>(self: MutableList<A>) => Empty | A;
|
|
45
|
+
|
|
46
|
+
export declare const toArrayN: <A>(self: MutableList<A>, n: number) => Array<A>;
|
|
47
|
+
|
|
48
|
+
export declare const toArray: <A>(self: MutableList<A>) => Array<A>;
|
|
49
|
+
|
|
50
|
+
export declare const filter: <A>(self: MutableList<A>, f: (value: A, i: number) => boolean) => void;
|
|
51
|
+
|
|
52
|
+
export declare const remove: <A>(self: MutableList<A>, value: A) => void;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { type Inspectable } from "./Inspectable.ts";
|
|
2
|
+
import type { Pipeable } from "./Pipeable.ts";
|
|
3
|
+
declare const TypeId = "~effect/MutableRef";
|
|
4
|
+
|
|
5
|
+
export interface MutableRef<out T> extends Pipeable, Inspectable {
|
|
6
|
+
readonly [TypeId]: typeof TypeId;
|
|
7
|
+
current: T;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export declare const make: <T>(value: T) => MutableRef<T>;
|
|
11
|
+
|
|
12
|
+
export declare const compareAndSet: {
|
|
13
|
+
|
|
14
|
+
<T>(oldValue: T, newValue: T): (self: MutableRef<T>) => boolean;
|
|
15
|
+
|
|
16
|
+
<T>(self: MutableRef<T>, oldValue: T, newValue: T): boolean;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export declare const decrement: (self: MutableRef<number>) => MutableRef<number>;
|
|
20
|
+
|
|
21
|
+
export declare const decrementAndGet: (self: MutableRef<number>) => number;
|
|
22
|
+
|
|
23
|
+
export declare const get: <T>(self: MutableRef<T>) => T;
|
|
24
|
+
|
|
25
|
+
export declare const getAndDecrement: (self: MutableRef<number>) => number;
|
|
26
|
+
|
|
27
|
+
export declare const getAndIncrement: (self: MutableRef<number>) => number;
|
|
28
|
+
|
|
29
|
+
export declare const getAndSet: {
|
|
30
|
+
|
|
31
|
+
<T>(value: T): (self: MutableRef<T>) => T;
|
|
32
|
+
|
|
33
|
+
<T>(self: MutableRef<T>, value: T): T;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export declare const getAndUpdate: {
|
|
37
|
+
|
|
38
|
+
<T>(f: (value: T) => T): (self: MutableRef<T>) => T;
|
|
39
|
+
|
|
40
|
+
<T>(self: MutableRef<T>, f: (value: T) => T): T;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export declare const increment: (self: MutableRef<number>) => MutableRef<number>;
|
|
44
|
+
|
|
45
|
+
export declare const incrementAndGet: (self: MutableRef<number>) => number;
|
|
46
|
+
|
|
47
|
+
export declare const set: {
|
|
48
|
+
|
|
49
|
+
<T>(value: T): (self: MutableRef<T>) => MutableRef<T>;
|
|
50
|
+
|
|
51
|
+
<T>(self: MutableRef<T>, value: T): MutableRef<T>;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export declare const setAndGet: {
|
|
55
|
+
|
|
56
|
+
<T>(value: T): (self: MutableRef<T>) => T;
|
|
57
|
+
|
|
58
|
+
<T>(self: MutableRef<T>, value: T): T;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export declare const update: {
|
|
62
|
+
|
|
63
|
+
<T>(f: (value: T) => T): (self: MutableRef<T>) => MutableRef<T>;
|
|
64
|
+
|
|
65
|
+
<T>(self: MutableRef<T>, f: (value: T) => T): MutableRef<T>;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export declare const updateAndGet: {
|
|
69
|
+
|
|
70
|
+
<T>(f: (value: T) => T): (self: MutableRef<T>) => T;
|
|
71
|
+
|
|
72
|
+
<T>(self: MutableRef<T>, f: (value: T) => T): T;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export declare const toggle: (self: MutableRef<boolean>) => MutableRef<boolean>;
|
|
76
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
export declare const nonEmpty: unique symbol;
|
|
4
|
+
|
|
5
|
+
export interface NonEmptyIterable<out A> extends Iterable<A> {
|
|
6
|
+
readonly [nonEmpty]: A;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export declare const unprepend: <A>(self: NonEmptyIterable<A>) => [firstElement: A, remainingElements: Iterator<A>];
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
|
|
2
|
+
import * as Option from "./Option.ts";
|
|
3
|
+
import * as Result from "./Result.ts";
|
|
4
|
+
import type * as Schema from "./Schema.ts";
|
|
5
|
+
import * as SchemaAST from "./SchemaAST.ts";
|
|
6
|
+
import * as SchemaIssue from "./SchemaIssue.ts";
|
|
7
|
+
import type { IsUnion, NoInfer } from "./Types.ts";
|
|
8
|
+
|
|
9
|
+
export interface Iso<in out S, in out A> extends Lens<S, A>, Prism<S, A> {
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export declare function makeIso<S, A>(get: (s: S) => A, set: (a: A) => S): Iso<S, A>;
|
|
13
|
+
|
|
14
|
+
export interface Lens<in out S, in out A> extends Optional<S, A> {
|
|
15
|
+
readonly get: (s: S) => A;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export declare function makeLens<S, A>(get: (s: S) => A, replace: (a: A, s: S) => S): Lens<S, A>;
|
|
19
|
+
|
|
20
|
+
export interface Prism<in out S, in out A> extends Optional<S, A> {
|
|
21
|
+
readonly set: (a: A) => S;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export declare function makePrism<S, A>(getResult: (s: S) => Result.Result<A, SchemaIssue.Issue>, set: (a: A) => S): Prism<S, A>;
|
|
25
|
+
|
|
26
|
+
export declare function fromChecks<T>(...checks: readonly [SchemaAST.Check<T>, ...Array<SchemaAST.Check<T>>]): Prism<T, T>;
|
|
27
|
+
type ForbidUnion<A, Message extends string> = IsUnion<A> extends true ? [Message] : [];
|
|
28
|
+
|
|
29
|
+
export interface Optional<in out S, in out A> {
|
|
30
|
+
|
|
31
|
+
readonly getResult: (s: S) => Result.Result<A, SchemaIssue.Issue>;
|
|
32
|
+
|
|
33
|
+
readonly replace: (a: A, s: S) => S;
|
|
34
|
+
|
|
35
|
+
readonly replaceResult: (a: A, s: S) => Result.Result<S, SchemaIssue.Issue>;
|
|
36
|
+
|
|
37
|
+
compose<B>(this: Iso<S, A>, that: Iso<A, B>): Iso<S, B>;
|
|
38
|
+
compose<B>(this: Lens<S, A>, that: Lens<A, B>): Lens<S, B>;
|
|
39
|
+
compose<B>(this: Prism<S, A>, that: Prism<A, B>): Prism<S, B>;
|
|
40
|
+
compose<B>(this: Optional<S, A>, that: Optional<A, B>): Optional<S, B>;
|
|
41
|
+
|
|
42
|
+
modify(f: (a: A) => A): (s: S) => S;
|
|
43
|
+
|
|
44
|
+
key<S, A extends object, Key extends keyof A>(this: Lens<S, A>, key: Key, ..._err: ForbidUnion<A, "cannot use `key` on a union type">): Lens<S, A[Key]>;
|
|
45
|
+
key<S, A extends object, Key extends keyof A>(this: Optional<S, A>, key: Key, ..._err: ForbidUnion<A, "cannot use `key` on a union type">): Optional<S, A[Key]>;
|
|
46
|
+
|
|
47
|
+
optionalKey<S, A extends object, Key extends keyof A>(this: Lens<S, A>, key: Key, ..._err: ForbidUnion<A, "cannot use `optionalKey` on a union type">): Lens<S, A[Key] | undefined>;
|
|
48
|
+
optionalKey<S, A extends object, Key extends keyof A>(this: Optional<S, A>, key: Key, ..._err: ForbidUnion<A, "cannot use `optionalKey` on a union type">): Optional<S, A[Key] | undefined>;
|
|
49
|
+
|
|
50
|
+
check<S, A>(this: Prism<S, A>, ...checks: readonly [SchemaAST.Check<A>, ...Array<SchemaAST.Check<A>>]): Prism<S, A>;
|
|
51
|
+
check<S, A>(this: Optional<S, A>, ...checks: readonly [SchemaAST.Check<A>, ...Array<SchemaAST.Check<A>>]): Optional<S, A>;
|
|
52
|
+
|
|
53
|
+
refine<S, A, B extends A>(this: Prism<S, A>, refinement: (a: A) => a is B, annotations?: Schema.Annotations.Filter): Prism<S, B>;
|
|
54
|
+
refine<S, A, B extends A>(this: Optional<S, A>, refinement: (a: A) => a is B, annotations?: Schema.Annotations.Filter): Optional<S, B>;
|
|
55
|
+
|
|
56
|
+
tag<S, A extends {
|
|
57
|
+
readonly _tag: SchemaAST.LiteralValue;
|
|
58
|
+
}, Tag extends A["_tag"]>(this: Prism<S, A>, tag: Tag): Prism<S, Extract<A, {
|
|
59
|
+
readonly _tag: Tag;
|
|
60
|
+
}>>;
|
|
61
|
+
tag<S, A extends {
|
|
62
|
+
readonly _tag: SchemaAST.LiteralValue;
|
|
63
|
+
}, Tag extends A["_tag"]>(this: Optional<S, A>, tag: Tag): Optional<S, Extract<A, {
|
|
64
|
+
readonly _tag: Tag;
|
|
65
|
+
}>>;
|
|
66
|
+
|
|
67
|
+
at<S, A extends object, Key extends keyof A>(this: Optional<S, A>, key: Key, ..._err: ForbidUnion<A, "cannot use `at` on a union type">): Optional<S, A[Key]>;
|
|
68
|
+
|
|
69
|
+
pick<S, A, Keys extends ReadonlyArray<keyof A>>(this: Lens<S, A>, keys: Keys, ..._err: ForbidUnion<A, "cannot use `pick` on a union type">): Lens<S, Pick<A, Keys[number]>>;
|
|
70
|
+
pick<S, A, Keys extends ReadonlyArray<keyof A>>(this: Optional<S, A>, keys: Keys, ..._err: ForbidUnion<A, "cannot use `pick` on a union type">): Optional<S, Pick<A, Keys[number]>>;
|
|
71
|
+
|
|
72
|
+
omit<S, A, Keys extends ReadonlyArray<keyof A>>(this: Lens<S, A>, keys: Keys, ..._err: ForbidUnion<A, "cannot use `omit` on a union type">): Lens<S, Omit<A, Keys[number]>>;
|
|
73
|
+
omit<S, A, Keys extends ReadonlyArray<keyof A>>(this: Optional<S, A>, keys: Keys, ..._err: ForbidUnion<A, "cannot use `omit` on a union type">): Optional<S, Omit<A, Keys[number]>>;
|
|
74
|
+
|
|
75
|
+
notUndefined<S, A>(this: Prism<S, A>): Prism<S, Exclude<A, undefined>>;
|
|
76
|
+
notUndefined<S, A>(this: Optional<S, A>): Optional<S, Exclude<A, undefined>>;
|
|
77
|
+
|
|
78
|
+
forEach<S, A, B>(this: Traversal<S, A>, f: (iso: Iso<A, A>) => Optional<A, B>): Traversal<S, B>;
|
|
79
|
+
|
|
80
|
+
modifyAll<S, A>(this: Traversal<S, A>, f: (a: A) => A): (s: S) => S;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export declare function makeOptional<S, A>(getResult: (s: S) => Result.Result<A, SchemaIssue.Issue>, set: (a: A, s: S) => Result.Result<S, SchemaIssue.Issue>): Optional<S, A>;
|
|
84
|
+
|
|
85
|
+
export interface Traversal<in out S, in out A> extends Optional<S, ReadonlyArray<A>> {
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export declare const get: {
|
|
89
|
+
|
|
90
|
+
<S, A>(optic: Lens<S, A>): (self: NoInfer<S>) => A;
|
|
91
|
+
|
|
92
|
+
<S, A>(self: NoInfer<S>, optic: Lens<S, A>): A;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
export declare const getResult: {
|
|
96
|
+
|
|
97
|
+
<S, A>(optic: Optional<S, A>): (self: NoInfer<S>) => Result.Result<A, SchemaIssue.Issue>;
|
|
98
|
+
|
|
99
|
+
<S, A>(self: NoInfer<S>, optic: Optional<S, A>): Result.Result<A, SchemaIssue.Issue>;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export declare const set: {
|
|
103
|
+
|
|
104
|
+
<S, A>(optic: Prism<S, A>): (self: NoInfer<A>) => S;
|
|
105
|
+
|
|
106
|
+
<S, A>(self: NoInfer<A>, optic: Prism<S, A>): S;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export declare const replace: {
|
|
110
|
+
|
|
111
|
+
<S, A>(optic: Optional<S, A>, value: NoInfer<A>): (self: NoInfer<S>) => S;
|
|
112
|
+
|
|
113
|
+
<S, A>(self: NoInfer<S>, optic: Optional<S, A>, value: NoInfer<A>): S;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export declare const replaceResult: {
|
|
117
|
+
|
|
118
|
+
<S, A>(optic: Optional<S, A>, value: NoInfer<A>): (self: NoInfer<S>) => Result.Result<S, SchemaIssue.Issue>;
|
|
119
|
+
|
|
120
|
+
<S, A>(self: NoInfer<S>, optic: Optional<S, A>, value: NoInfer<A>): Result.Result<S, SchemaIssue.Issue>;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export declare const modify: {
|
|
124
|
+
|
|
125
|
+
<S, A>(optic: Optional<S, A>, f: (value: NoInfer<A>) => NoInfer<A>): (self: NoInfer<S>) => S;
|
|
126
|
+
|
|
127
|
+
<S, A>(self: NoInfer<S>, optic: Optional<S, A>, f: (value: NoInfer<A>) => NoInfer<A>): S;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export declare const getAll: {
|
|
131
|
+
|
|
132
|
+
<S, A>(traversal: Traversal<S, A>): (self: NoInfer<S>) => Array<A>;
|
|
133
|
+
|
|
134
|
+
<S, A>(self: NoInfer<S>, traversal: Traversal<S, A>): Array<A>;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export declare const modifyAll: {
|
|
138
|
+
|
|
139
|
+
<S, A>(traversal: Traversal<S, A>, f: (value: NoInfer<A>) => NoInfer<A>): (self: NoInfer<S>) => S;
|
|
140
|
+
|
|
141
|
+
<S, A>(self: NoInfer<S>, traversal: Traversal<S, A>, f: (value: NoInfer<A>) => NoInfer<A>): S;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export declare function id<S>(): Iso<S, S>;
|
|
145
|
+
|
|
146
|
+
export declare function entries<A>(): Iso<Record<string, A>, ReadonlyArray<readonly [string, A]>>;
|
|
147
|
+
|
|
148
|
+
export declare function some<A>(): Prism<Option.Option<A>, A>;
|
|
149
|
+
|
|
150
|
+
export declare function none<A>(): Prism<Option.Option<A>, undefined>;
|
|
151
|
+
|
|
152
|
+
export declare function success<A, E>(): Prism<Result.Result<A, E>, A>;
|
|
153
|
+
|
|
154
|
+
export declare function failure<A, E>(): Prism<Result.Result<A, E>, E>;
|
|
155
|
+
export {};
|