effect 4.0.0-beta.102 → 4.0.0-beta.103
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/dist/Array.d.ts +971 -1037
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +381 -407
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +433 -756
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +200 -325
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +207 -267
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +107 -135
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +146 -188
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Boolean.js +64 -84
- package/dist/Boolean.js.map +1 -1
- package/dist/Brand.js.map +1 -1
- package/dist/Cache.d.ts +405 -254
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +166 -101
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +167 -277
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +122 -176
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +729 -768
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +514 -440
- package/dist/Channel.js.map +1 -1
- package/dist/ChannelSchema.d.ts +1 -1
- package/dist/ChannelSchema.d.ts.map +1 -1
- package/dist/ChannelSchema.js.map +1 -1
- package/dist/Chunk.d.ts +834 -1173
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +326 -439
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +180 -49
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js +96 -31
- package/dist/Clock.js.map +1 -1
- package/dist/Combiner.d.ts +20 -33
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +18 -30
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +225 -173
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +336 -265
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +194 -68
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +115 -80
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Console.d.ts +233 -33
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js +232 -32
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +151 -274
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +171 -214
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +68 -77
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +57 -66
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts +13 -15
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Crypto.js +9 -10
- package/dist/Crypto.js.map +1 -1
- package/dist/Data.d.ts +60 -80
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +16 -23
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +562 -660
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +307 -362
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +253 -256
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +104 -96
- package/dist/Deferred.js.map +1 -1
- package/dist/Duration.d.ts +216 -308
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +132 -186
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +2841 -3247
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +1322 -1546
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.js.map +1 -1
- package/dist/Encoding.d.ts +22 -40
- package/dist/Encoding.d.ts.map +1 -1
- package/dist/Encoding.js +22 -40
- package/dist/Encoding.js.map +1 -1
- package/dist/Equal.d.ts +33 -37
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +29 -21
- package/dist/Equal.js.map +1 -1
- package/dist/Equivalence.d.ts +103 -105
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +77 -79
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +51 -27
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +50 -26
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +13 -55
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +7 -28
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +116 -192
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js +82 -130
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +82 -146
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +48 -87
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +152 -105
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +106 -73
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +213 -168
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +114 -89
- package/dist/FiberMap.js.map +1 -1
- package/dist/FiberSet.d.ts +123 -81
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +85 -59
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +153 -264
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +42 -147
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +61 -33
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +26 -15
- package/dist/Filter.js.map +1 -1
- package/dist/Formatter.d.ts +25 -33
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +48 -49
- package/dist/Formatter.js.map +1 -1
- package/dist/Function.d.ts +76 -145
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +40 -57
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +360 -714
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +168 -297
- package/dist/Graph.js.map +1 -1
- package/dist/HKT.d.ts +12 -6
- package/dist/HKT.d.ts.map +1 -1
- package/dist/Hash.d.ts +47 -83
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +46 -68
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +319 -411
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +122 -166
- package/dist/HashMap.js.map +1 -1
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/HashRing.js +1 -0
- package/dist/HashRing.js.map +1 -1
- package/dist/HashSet.d.ts +177 -284
- package/dist/HashSet.d.ts.map +1 -1
- package/dist/HashSet.js +68 -109
- package/dist/HashSet.js.map +1 -1
- package/dist/Inspectable.d.ts +12 -12
- package/dist/Inspectable.js +8 -8
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +620 -786
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +228 -306
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +11 -13
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +44 -102
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonPointer.d.ts +8 -8
- package/dist/JsonPointer.js +8 -8
- package/dist/JsonPointer.js.map +1 -1
- package/dist/JsonSchema.d.ts +98 -44
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +297 -234
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Latch.d.ts +23 -35
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +16 -28
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +359 -260
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +195 -175
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +42 -29
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +31 -21
- package/dist/LayerMap.js.map +1 -1
- package/dist/LayerRef.d.ts +6 -2
- package/dist/LayerRef.d.ts.map +1 -1
- package/dist/LayerRef.js +6 -2
- package/dist/LayerRef.js.map +1 -1
- package/dist/LogLevel.d.ts +114 -214
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +41 -76
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +218 -467
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +204 -450
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +7 -5
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +7 -5
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +217 -252
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +150 -183
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +442 -993
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +198 -642
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +144 -173
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +68 -79
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +84 -89
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +44 -47
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts +71 -370
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +59 -284
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts +420 -243
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js +209 -120
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +21 -14
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js +15 -13
- package/dist/Newtype.js.map +1 -1
- package/dist/NonEmptyIterable.d.ts +7 -137
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/NonEmptyIterable.js +5 -93
- package/dist/NonEmptyIterable.js.map +1 -1
- package/dist/Number.d.ts +196 -233
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +90 -109
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +97 -189
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +187 -290
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +447 -812
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +211 -392
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +109 -109
- package/dist/Order.js +91 -91
- package/dist/Order.js.map +1 -1
- package/dist/Ordering.d.ts +20 -23
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/Ordering.js +8 -9
- package/dist/Ordering.js.map +1 -1
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Path.d.ts +38 -41
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +3 -4
- package/dist/Path.js.map +1 -1
- package/dist/Pipeable.d.ts +6 -5
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +2 -2
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +4 -4
- package/dist/PlatformError.js +3 -3
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +4 -2
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +4 -2
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +200 -181
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +100 -108
- package/dist/Predicate.js.map +1 -1
- package/dist/PrimaryKey.d.ts +7 -7
- package/dist/PrimaryKey.js +5 -5
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +425 -494
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +373 -362
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts +24 -18
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +11 -9
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts +200 -159
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +162 -132
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +49 -74
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +35 -54
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +121 -63
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +42 -21
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +24 -13
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js +15 -9
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +291 -488
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +111 -202
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +6 -2
- package/dist/Redactable.d.ts.map +1 -1
- package/dist/Redactable.js +7 -2
- package/dist/Redactable.js.map +1 -1
- package/dist/Redacted.d.ts +25 -25
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +19 -20
- package/dist/Redacted.js.map +1 -1
- package/dist/Reducer.d.ts +8 -15
- package/dist/Reducer.d.ts.map +1 -1
- package/dist/Reducer.js +6 -12
- package/dist/Reducer.js.map +1 -1
- package/dist/Ref.d.ts +95 -165
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +75 -122
- package/dist/Ref.js.map +1 -1
- package/dist/References.d.ts +102 -168
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +102 -168
- package/dist/References.js.map +1 -1
- package/dist/RegExp.d.ts +10 -14
- package/dist/RegExp.d.ts.map +1 -1
- package/dist/RegExp.js +10 -14
- package/dist/RegExp.js.map +1 -1
- package/dist/Request.d.ts +31 -21
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +16 -13
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +201 -90
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +87 -41
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.js.map +1 -1
- package/dist/Result.d.ts +302 -470
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +133 -217
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +50 -75
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +39 -60
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +290 -1636
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +162 -803
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +5 -5
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +18 -6
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +644 -642
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +491 -527
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +27 -50
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +366 -279
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaError.d.ts +7 -6
- package/dist/SchemaError.d.ts.map +1 -1
- package/dist/SchemaError.js +7 -6
- package/dist/SchemaError.js.map +1 -1
- package/dist/SchemaGetter.d.ts +217 -174
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +218 -185
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +62 -190
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +73 -265
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +2 -2
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +123 -75
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +22 -36
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +20 -26
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +114 -74
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +120 -85
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/Scope.d.ts +123 -151
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +72 -92
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.js.map +1 -1
- package/dist/ScopedRef.d.ts +3 -3
- package/dist/ScopedRef.js +2 -2
- package/dist/ScopedRef.js.map +1 -1
- package/dist/Semaphore.d.ts +96 -10
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +78 -39
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +117 -107
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +107 -100
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +1 -1
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +2415 -2949
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +1078 -1381
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +262 -308
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +184 -215
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +109 -114
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +41 -50
- package/dist/Struct.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +282 -250
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +104 -92
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/Symbol.d.ts +3 -3
- package/dist/Symbol.js +3 -3
- package/dist/Symbol.js.map +1 -1
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Take.js.map +1 -1
- package/dist/Terminal.d.ts +2 -2
- package/dist/Terminal.js +1 -1
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +100 -54
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +41 -24
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +287 -679
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +109 -251
- package/dist/Trie.js.map +1 -1
- package/dist/Tuple.d.ts +92 -127
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js +42 -57
- package/dist/Tuple.js.map +1 -1
- package/dist/TxChunk.d.ts +201 -121
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +85 -56
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +62 -46
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxDeferred.js +30 -22
- package/dist/TxDeferred.js.map +1 -1
- package/dist/TxHashMap.d.ts +631 -779
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +268 -330
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +297 -236
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +130 -100
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +126 -95
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPriorityQueue.js +74 -56
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/TxPubSub.d.ts +101 -88
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxPubSub.js +87 -66
- package/dist/TxPubSub.js.map +1 -1
- package/dist/TxQueue.d.ts +200 -180
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +160 -136
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +97 -66
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +67 -45
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/TxRef.d.ts +51 -32
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +23 -15
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +129 -95
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +85 -70
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +97 -70
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.js +44 -34
- package/dist/TxSubscriptionRef.js.map +1 -1
- package/dist/Types.d.ts +126 -67
- package/dist/Types.d.ts.map +1 -1
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +45 -65
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js +6 -9
- package/dist/Unify.js.map +1 -1
- package/dist/Utils.d.ts +23 -16
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +3 -7
- package/dist/Utils.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/array.js.map +1 -1
- package/dist/internal/core.js +1 -1
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/dateTime.js +4 -0
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/doNotation.js.map +1 -1
- package/dist/internal/effect.js +77 -40
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/equal.js.map +1 -1
- package/dist/internal/errors.js.map +1 -1
- package/dist/internal/executionPlan.js.map +1 -1
- package/dist/internal/hashMap.js.map +1 -1
- package/dist/internal/hashSet.js.map +1 -1
- package/dist/internal/layer.js.map +1 -1
- package/dist/internal/matcher.js.map +1 -1
- package/dist/internal/metric.js.map +1 -1
- package/dist/internal/option.js.map +1 -1
- package/dist/internal/persistence.d.ts +2 -0
- package/dist/internal/persistence.d.ts.map +1 -0
- package/dist/internal/persistence.js +3 -0
- package/dist/internal/persistence.js.map +1 -0
- package/dist/internal/random.js.map +1 -1
- package/dist/internal/rcRef.js.map +1 -1
- package/dist/internal/record.js.map +1 -1
- package/dist/internal/redacted.js.map +1 -1
- package/dist/internal/references.js +3 -0
- package/dist/internal/references.js.map +1 -1
- package/dist/internal/request.js.map +1 -1
- package/dist/internal/result.js.map +1 -1
- package/dist/internal/schedule.js.map +1 -1
- package/dist/internal/schema/annotations.js.map +1 -1
- package/dist/internal/schema/cause.js.map +1 -1
- package/dist/internal/schema/fromJsonSchemaDocument.js +13 -11
- package/dist/internal/schema/fromJsonSchemaDocument.js.map +1 -1
- package/dist/internal/schema/fromRepresentation.js +8 -15
- package/dist/internal/schema/fromRepresentation.js.map +1 -1
- package/dist/internal/schema/parser.d.ts +14 -0
- package/dist/internal/schema/parser.d.ts.map +1 -0
- package/dist/internal/schema/parser.js +13 -0
- package/dist/internal/schema/parser.js.map +1 -0
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/internal/schema/toArbitrary.js.map +1 -1
- package/dist/internal/schema/toCodeDocument.js.map +1 -1
- package/dist/internal/schema/toEquivalence.js.map +1 -1
- package/dist/internal/schema/toJsonSchemaDocument.js +48 -6
- package/dist/internal/schema/toJsonSchemaDocument.js.map +1 -1
- package/dist/internal/schema/toRepresentation.js +87 -107
- package/dist/internal/schema/toRepresentation.js.map +1 -1
- package/dist/internal/stackTraceLimit.js.map +1 -1
- package/dist/internal/stream.js.map +1 -1
- package/dist/internal/tracer.js.map +1 -1
- package/dist/internal/trie.js +13 -9
- package/dist/internal/trie.js.map +1 -1
- package/dist/testing/FastCheck.d.ts +8 -7
- package/dist/testing/FastCheck.d.ts.map +1 -1
- package/dist/testing/FastCheck.js +8 -7
- package/dist/testing/FastCheck.js.map +1 -1
- package/dist/testing/TestClock.d.ts +57 -28
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +50 -18
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +32 -31
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js +24 -22
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +29 -29
- package/dist/testing/TestSchema.js +25 -25
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +95 -118
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +94 -117
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Chat.d.ts +132 -97
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +55 -51
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
- package/dist/unstable/ai/IdGenerator.d.ts +32 -28
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.js +26 -21
- package/dist/unstable/ai/IdGenerator.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +107 -67
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +104 -64
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpProtocol.d.ts +30 -0
- package/dist/unstable/ai/McpProtocol.d.ts.map +1 -0
- package/dist/unstable/ai/McpProtocol.js +20 -0
- package/dist/unstable/ai/McpProtocol.js.map +1 -0
- package/dist/unstable/ai/McpSchema.d.ts +141 -75
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +58 -50
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +68 -59
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +694 -241
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +8 -19
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +9 -20
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +112 -38
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +53 -17
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +28 -14
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +9 -4
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +46 -13
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.js +18 -7
- package/dist/unstable/ai/Telemetry.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts +14 -3
- package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
- package/dist/unstable/ai/Tokenizer.js +10 -2
- package/dist/unstable/ai/Tokenizer.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +59 -44
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +48 -39
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +26 -8
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +18 -4
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/index.d.ts +4 -0
- package/dist/unstable/ai/index.d.ts.map +1 -1
- package/dist/unstable/ai/index.js +4 -0
- package/dist/unstable/ai/index.js.map +1 -1
- package/dist/unstable/ai/internal/codec-transformer.js.map +1 -1
- package/dist/unstable/ai/internal/mcpProtocol.d.ts +21 -0
- package/dist/unstable/ai/internal/mcpProtocol.d.ts.map +1 -0
- package/dist/unstable/ai/internal/mcpProtocol.js +22 -0
- package/dist/unstable/ai/internal/mcpProtocol.js.map +1 -0
- package/dist/unstable/ai/internal/mcpProtocolRegistry.d.ts +2 -0
- package/dist/unstable/ai/internal/mcpProtocolRegistry.d.ts.map +1 -0
- package/dist/unstable/ai/internal/mcpProtocolRegistry.js +32 -0
- package/dist/unstable/ai/internal/mcpProtocolRegistry.js.map +1 -0
- package/dist/unstable/ai/internal/structured-output.js +14 -15
- package/dist/unstable/ai/internal/structured-output.js.map +1 -1
- package/dist/unstable/cli/Argument.d.ts +273 -69
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.js +111 -33
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliConfig.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +69 -76
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.js +57 -61
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/CliOutput.d.ts +35 -54
- package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
- package/dist/unstable/cli/CliOutput.js +26 -42
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +705 -107
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +238 -42
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.js.map +1 -1
- package/dist/unstable/cli/Flag.d.ts +418 -138
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +197 -71
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +1 -1
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/HelpDoc.d.ts +12 -4
- package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
- package/dist/unstable/cli/Param.d.ts +292 -78
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +128 -46
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +370 -149
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +344 -136
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts +23 -14
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js +23 -14
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/index.js.map +1 -1
- package/dist/unstable/cli/internal/ansi.js.map +1 -1
- package/dist/unstable/cli/internal/auto-suggest.js.map +1 -1
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/completions/bash.js.map +1 -1
- package/dist/unstable/cli/internal/completions/descriptor.js.map +1 -1
- package/dist/unstable/cli/internal/completions/fish.js.map +1 -1
- package/dist/unstable/cli/internal/completions/zsh.js.map +1 -1
- package/dist/unstable/cli/internal/config.js.map +1 -1
- package/dist/unstable/cli/internal/help.js.map +1 -1
- package/dist/unstable/cli/internal/lexer.js +17 -7
- package/dist/unstable/cli/internal/lexer.js.map +1 -1
- package/dist/unstable/cli/internal/parser.js +2 -2
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cli/internal/wizard.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.js.map +1 -1
- package/dist/unstable/cluster/ClusterError.js.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +8 -8
- package/dist/unstable/cluster/ClusterSchema.js +8 -8
- package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +5 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/DeliverAt.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +10 -10
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +8 -8
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityAddress.js.map +1 -1
- package/dist/unstable/cluster/EntityId.js.map +1 -1
- package/dist/unstable/cluster/EntityProxy.d.ts +4 -2
- package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxy.js +4 -2
- package/dist/unstable/cluster/EntityProxy.js.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +2 -2
- package/dist/unstable/cluster/EntityResource.js +2 -2
- package/dist/unstable/cluster/EntityResource.js.map +1 -1
- package/dist/unstable/cluster/EntityType.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +3 -3
- package/dist/unstable/cluster/Envelope.js +3 -3
- package/dist/unstable/cluster/Envelope.js.map +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts +2 -2
- package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/HttpRunner.js +6 -4
- package/dist/unstable/cluster/HttpRunner.js.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/MachineId.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +9 -9
- package/dist/unstable/cluster/Message.js +6 -6
- package/dist/unstable/cluster/Message.js.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +15 -15
- package/dist/unstable/cluster/MessageStorage.js +5 -5
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +4 -4
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/Runner.js.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +1 -1
- package/dist/unstable/cluster/RunnerHealth.js +1 -1
- package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts +2 -1
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +16 -16
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.d.ts +2 -2
- package/dist/unstable/cluster/RunnerStorage.js +1 -1
- package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +6 -6
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +19 -10
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +3 -2
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +3 -3
- package/dist/unstable/cluster/ShardingConfig.js +3 -3
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.js.map +1 -1
- package/dist/unstable/cluster/SingleRunner.js.map +1 -1
- package/dist/unstable/cluster/Singleton.js.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts +1 -1
- package/dist/unstable/cluster/SingletonAddress.js +1 -1
- package/dist/unstable/cluster/SingletonAddress.js.map +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +8 -8
- package/dist/unstable/cluster/Snowflake.js +8 -8
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/SocketRunner.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js +20 -5
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/TestRunner.js.map +1 -1
- package/dist/unstable/cluster/index.js.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +5 -5
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/cluster/internal/entityReaper.js.map +1 -1
- package/dist/unstable/cluster/internal/hash.js.map +1 -1
- package/dist/unstable/cluster/internal/interruptors.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceMap.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceRef.js.map +1 -1
- package/dist/unstable/cluster/internal/shardLock.js.map +1 -1
- package/dist/unstable/devtools/DevTools.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
- package/dist/unstable/devtools/index.js.map +1 -1
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.js +6 -8
- package/dist/unstable/encoding/Msgpack.js.map +1 -1
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +72 -8
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +58 -8
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/encoding/index.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts +20 -20
- package/dist/unstable/eventlog/Event.js.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +4 -4
- package/dist/unstable/eventlog/EventGroup.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +15 -15
- package/dist/unstable/eventlog/EventJournal.js +13 -13
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +3 -3
- package/dist/unstable/eventlog/EventLog.js +3 -3
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.d.ts +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +2 -2
- package/dist/unstable/eventlog/EventLogMessage.js +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +15 -15
- package/dist/unstable/eventlog/EventLogRemote.js +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.d.ts +11 -2
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.js +45 -21
- package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +4 -4
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +13 -5
- package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +5 -5
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +14 -6
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.js +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/index.js.map +1 -1
- package/dist/unstable/eventlog/internal/identityRootSecretDerivation.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +2 -2
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +30 -18
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts +1 -1
- package/dist/unstable/http/Etag.js +1 -1
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/unstable/http/FetchHttpClient.js.map +1 -1
- package/dist/unstable/http/Headers.d.ts +2 -2
- package/dist/unstable/http/Headers.js +2 -2
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +5 -3
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.js +11 -5
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +51 -44
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +46 -17
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +2 -0
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts +4 -4
- package/dist/unstable/http/HttpClientResponse.js +2 -2
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +6 -6
- package/dist/unstable/http/HttpEffect.js +3 -3
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts +6 -9
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.js +6 -9
- package/dist/unstable/http/HttpMethod.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +75 -9
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js +164 -39
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts +76 -0
- package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
- package/dist/unstable/http/HttpPlatform.js +32 -0
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +88 -89
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +78 -79
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts +13 -13
- package/dist/unstable/http/HttpServer.js +6 -6
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +2 -2
- package/dist/unstable/http/HttpServerError.js +2 -2
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +4 -4
- package/dist/unstable/http/HttpServerRequest.js +4 -4
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +22 -0
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +10 -0
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +35 -7
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpStaticServer.js +35 -7
- package/dist/unstable/http/HttpStaticServer.js.map +1 -1
- package/dist/unstable/http/HttpTraceContext.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +6 -6
- package/dist/unstable/http/Multipart.js +5 -5
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Template.js.map +1 -1
- package/dist/unstable/http/Url.d.ts +33 -63
- package/dist/unstable/http/Url.d.ts.map +1 -1
- package/dist/unstable/http/Url.js +14 -28
- package/dist/unstable/http/Url.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts +10 -18
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +9 -17
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/http/internal/compression.d.ts +2 -0
- package/dist/unstable/http/internal/compression.d.ts.map +1 -0
- package/dist/unstable/http/internal/compression.js +155 -0
- package/dist/unstable/http/internal/compression.js.map +1 -0
- package/dist/unstable/http/internal/preResponseHandler.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +10 -11
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +4 -5
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +11 -13
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +42 -42
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +13 -13
- package/dist/unstable/httpapi/HttpApiError.js +13 -13
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +15 -15
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +71 -24
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +57 -10
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +0 -12
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +6 -6
- package/dist/unstable/httpapi/HttpApiSchema.js +4 -4
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +13 -13
- package/dist/unstable/httpapi/OpenApi.js +13 -13
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/httpapi/index.js.map +1 -1
- package/dist/unstable/httpapi/internal/html.js.map +1 -1
- package/dist/unstable/httpapi/internal/httpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/internal/httpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/internal/mediaType.js.map +1 -1
- package/dist/unstable/observability/Otlp.js.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts +12 -14
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +17 -4
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +4 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts +16 -7
- package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpResource.js +21 -12
- package/dist/unstable/observability/OtlpResource.js.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +13 -4
- package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.js +10 -3
- package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
- package/dist/unstable/observability/index.js.map +1 -1
- package/dist/unstable/observability/internal/otlpEnv.js +1 -1
- package/dist/unstable/observability/internal/otlpEnv.js.map +1 -1
- package/dist/unstable/observability/internal/otlpProtobuf.js.map +1 -1
- package/dist/unstable/observability/internal/protobuf.js +3 -0
- package/dist/unstable/observability/internal/protobuf.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +8 -3
- package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +22 -13
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +8 -8
- package/dist/unstable/persistence/Persistable.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +6 -6
- package/dist/unstable/persistence/PersistedQueue.js +6 -6
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts +3 -3
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +91 -15
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +26 -15
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +24 -13
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts +2 -2
- package/dist/unstable/persistence/Redis.js +1 -1
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/persistence/index.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +64 -21
- package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.js +14 -5
- package/dist/unstable/process/ChildProcess.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +21 -10
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/process/index.js.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.d.ts +8 -8
- package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.js +10 -10
- package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +25 -22
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +14 -13
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +4 -1
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRef.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +24 -3
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +4 -1
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts +1 -1
- package/dist/unstable/reactivity/Hydration.js +1 -1
- package/dist/unstable/reactivity/Hydration.js.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/reactivity/index.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +35 -33
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js +4 -2
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +12 -12
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +12 -11
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts +8 -8
- package/dist/unstable/rpc/RpcGroup.js +1 -1
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMessage.d.ts +31 -30
- package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMessage.js +6 -6
- package/dist/unstable/rpc/RpcMessage.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +10 -10
- package/dist/unstable/rpc/RpcMiddleware.js +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +4 -4
- package/dist/unstable/rpc/RpcSchema.js +3 -3
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts +58 -7
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +175 -96
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +13 -13
- package/dist/unstable/rpc/RpcServer.js +17 -13
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/RpcTest.js.map +1 -1
- package/dist/unstable/rpc/RpcWorker.d.ts +5 -5
- package/dist/unstable/rpc/RpcWorker.js +4 -4
- package/dist/unstable/rpc/RpcWorker.js.map +1 -1
- package/dist/unstable/rpc/Utils.js.map +1 -1
- package/dist/unstable/rpc/index.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +52 -50
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +35 -33
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +5 -5
- package/dist/unstable/schema/VariantSchema.js +2 -2
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/schema/index.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +11 -3
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +9 -4
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/SocketServer.js.map +1 -1
- package/dist/unstable/socket/index.js.map +1 -1
- package/dist/unstable/sql/Migrator.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +1 -1
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +2 -2
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlConnection.js.map +1 -1
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlModel.d.ts +2 -2
- package/dist/unstable/sql/SqlModel.js +2 -2
- package/dist/unstable/sql/SqlModel.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.d.ts +5 -5
- package/dist/unstable/sql/SqlResolver.js +2 -2
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/sql/SqlSchema.js.map +1 -1
- package/dist/unstable/sql/SqlStream.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +6 -6
- package/dist/unstable/sql/Statement.js +15 -15
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/sql/index.js.map +1 -1
- package/dist/unstable/workers/Transferable.d.ts +1 -1
- package/dist/unstable/workers/Transferable.js +1 -1
- package/dist/unstable/workers/Transferable.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts +2 -2
- package/dist/unstable/workers/Worker.js +2 -2
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts +7 -7
- package/dist/unstable/workers/WorkerError.js +6 -6
- package/dist/unstable/workers/WorkerError.js.map +1 -1
- package/dist/unstable/workers/WorkerRunner.d.ts +1 -1
- package/dist/unstable/workers/WorkerRunner.js +1 -1
- package/dist/unstable/workers/WorkerRunner.js.map +1 -1
- package/dist/unstable/workers/index.js.map +1 -1
- package/dist/unstable/workflow/Activity.d.ts +2 -2
- package/dist/unstable/workflow/Activity.js +2 -2
- package/dist/unstable/workflow/Activity.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts +1 -1
- package/dist/unstable/workflow/DurableClock.js +1 -1
- package/dist/unstable/workflow/DurableClock.js.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +10 -10
- package/dist/unstable/workflow/DurableDeferred.js +5 -5
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/DurableQueue.d.ts +22 -20
- package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableQueue.js +22 -20
- package/dist/unstable/workflow/DurableQueue.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts +21 -21
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +13 -14
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.d.ts +4 -2
- package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.js +4 -2
- package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
- package/dist/unstable/workflow/index.js.map +1 -1
- package/dist/unstable/workflow/internal/crypto.js.map +1 -1
- package/package.json +5 -6
- package/src/Array.ts +982 -1045
- package/src/BigDecimal.ts +433 -756
- package/src/BigInt.ts +213 -269
- package/src/Boolean.ts +146 -188
- package/src/Cache.ts +409 -255
- package/src/Cause.ts +167 -277
- package/src/Channel.ts +891 -816
- package/src/ChannelSchema.ts +1 -1
- package/src/Chunk.ts +841 -1181
- package/src/Clock.ts +181 -49
- package/src/Combiner.ts +20 -33
- package/src/Config.ts +615 -332
- package/src/ConfigProvider.ts +214 -120
- package/src/Console.ts +289 -39
- package/src/Context.ts +319 -378
- package/src/Cron.ts +68 -77
- package/src/Crypto.ts +13 -15
- package/src/Data.ts +60 -80
- package/src/DateTime.ts +564 -660
- package/src/Deferred.ts +253 -256
- package/src/Duration.ts +216 -308
- package/src/Effect.ts +2893 -3279
- package/src/Encoding.ts +22 -40
- package/src/Equal.ts +49 -39
- package/src/Equivalence.ts +103 -105
- package/src/ErrorReporter.ts +51 -27
- package/src/ExecutionPlan.ts +13 -55
- package/src/Exit.ts +116 -192
- package/src/Fiber.ts +81 -148
- package/src/FiberHandle.ts +152 -105
- package/src/FiberMap.ts +225 -174
- package/src/FiberSet.ts +124 -82
- package/src/FileSystem.ts +155 -263
- package/src/Filter.ts +61 -33
- package/src/Formatter.ts +54 -56
- package/src/Function.ts +76 -145
- package/src/Graph.ts +416 -770
- package/src/HKT.ts +12 -6
- package/src/Hash.ts +52 -83
- package/src/HashMap.ts +319 -411
- package/src/HashRing.ts +1 -0
- package/src/HashSet.ts +177 -284
- package/src/Inspectable.ts +12 -12
- package/src/Iterable.ts +620 -786
- package/src/JsonPatch.ts +58 -112
- package/src/JsonPointer.ts +8 -8
- package/src/JsonSchema.ts +402 -244
- package/src/Latch.ts +23 -35
- package/src/Layer.ts +359 -260
- package/src/LayerMap.ts +49 -29
- package/src/LayerRef.ts +6 -2
- package/src/LogLevel.ts +114 -214
- package/src/Logger.ts +344 -697
- package/src/ManagedRuntime.ts +7 -5
- package/src/Match.ts +217 -252
- package/src/Metric.ts +516 -1089
- package/src/MutableHashMap.ts +218 -255
- package/src/MutableHashSet.ts +84 -89
- package/src/MutableList.ts +73 -370
- package/src/MutableRef.ts +420 -243
- package/src/Newtype.ts +21 -14
- package/src/NonEmptyIterable.ts +7 -137
- package/src/Number.ts +196 -233
- package/src/Optic.ts +243 -383
- package/src/Option.ts +447 -812
- package/src/Order.ts +109 -109
- package/src/Ordering.ts +20 -23
- package/src/Path.ts +38 -41
- package/src/Pipeable.ts +6 -5
- package/src/PlatformError.ts +4 -4
- package/src/Pool.ts +4 -2
- package/src/Predicate.ts +200 -181
- package/src/PrimaryKey.ts +7 -7
- package/src/PubSub.ts +526 -552
- package/src/Pull.ts +24 -18
- package/src/Queue.ts +200 -159
- package/src/Random.ts +49 -74
- package/src/RcMap.ts +121 -63
- package/src/RcRef.ts +24 -13
- package/src/Record.ts +291 -488
- package/src/Redactable.ts +10 -3
- package/src/Redacted.ts +25 -25
- package/src/Reducer.ts +8 -15
- package/src/Ref.ts +221 -361
- package/src/References.ts +102 -168
- package/src/RegExp.ts +10 -14
- package/src/Request.ts +31 -21
- package/src/RequestResolver.ts +202 -91
- package/src/Result.ts +312 -484
- package/src/Runtime.ts +50 -75
- package/src/Schedule.ts +308 -1734
- package/src/Scheduler.ts +20 -7
- package/src/Schema.ts +716 -745
- package/src/SchemaAST.ts +466 -358
- package/src/SchemaError.ts +7 -6
- package/src/SchemaGetter.ts +242 -190
- package/src/SchemaIssue.ts +89 -275
- package/src/SchemaParser.ts +180 -93
- package/src/SchemaRepresentation.ts +22 -40
- package/src/SchemaTransformation.ts +129 -88
- package/src/Scope.ts +123 -151
- package/src/ScopedRef.ts +4 -4
- package/src/Semaphore.ts +152 -51
- package/src/Sink.ts +128 -113
- package/src/Stdio.ts +1 -1
- package/src/Stream.ts +2602 -3123
- package/src/String.ts +275 -312
- package/src/Struct.ts +109 -114
- package/src/SubscriptionRef.ts +284 -252
- package/src/Symbol.ts +3 -3
- package/src/Terminal.ts +2 -2
- package/src/Tracer.ts +102 -55
- package/src/Trie.ts +287 -679
- package/src/Tuple.ts +92 -127
- package/src/TxChunk.ts +201 -121
- package/src/TxDeferred.ts +62 -46
- package/src/TxHashMap.ts +645 -799
- package/src/TxHashSet.ts +443 -356
- package/src/TxPriorityQueue.ts +130 -98
- package/src/TxPubSub.ts +107 -80
- package/src/TxQueue.ts +214 -183
- package/src/TxReentrantLock.ts +97 -66
- package/src/TxRef.ts +51 -32
- package/src/TxSemaphore.ts +129 -95
- package/src/TxSubscriptionRef.ts +97 -70
- package/src/Types.ts +126 -67
- package/src/Unify.ts +45 -65
- package/src/Utils.ts +23 -16
- package/src/internal/core.ts +2 -2
- package/src/internal/dateTime.ts +6 -0
- package/src/internal/effect.ts +93 -48
- package/src/internal/persistence.ts +2 -0
- package/src/internal/references.ts +3 -2
- package/src/internal/schema/fromJsonSchemaDocument.ts +15 -13
- package/src/internal/schema/fromRepresentation.ts +10 -16
- package/src/internal/schema/parser.ts +22 -0
- package/src/internal/schema/toJsonSchemaDocument.ts +60 -6
- package/src/internal/schema/toRepresentation.ts +104 -119
- package/src/internal/trie.ts +10 -11
- package/src/testing/FastCheck.ts +8 -7
- package/src/testing/TestClock.ts +72 -30
- package/src/testing/TestConsole.ts +32 -31
- package/src/testing/TestSchema.ts +29 -29
- package/src/unstable/ai/AiError.ts +95 -118
- package/src/unstable/ai/AnthropicStructuredOutput.ts +1 -1
- package/src/unstable/ai/Chat.ts +132 -97
- package/src/unstable/ai/IdGenerator.ts +32 -28
- package/src/unstable/ai/LanguageModel.ts +107 -67
- package/src/unstable/ai/McpProtocol.ts +48 -0
- package/src/unstable/ai/McpSchema.ts +60 -50
- package/src/unstable/ai/McpServer.ts +930 -304
- package/src/unstable/ai/Model.ts +9 -20
- package/src/unstable/ai/OpenAiStructuredOutput.ts +1 -1
- package/src/unstable/ai/Prompt.ts +145 -43
- package/src/unstable/ai/Response.ts +28 -14
- package/src/unstable/ai/Telemetry.ts +46 -13
- package/src/unstable/ai/Tokenizer.ts +14 -3
- package/src/unstable/ai/Tool.ts +59 -44
- package/src/unstable/ai/Toolkit.ts +26 -8
- package/src/unstable/ai/index.ts +5 -0
- package/src/unstable/ai/internal/mcpProtocol.ts +85 -0
- package/src/unstable/ai/internal/mcpProtocolRegistry.ts +70 -0
- package/src/unstable/ai/internal/structured-output.ts +13 -18
- package/src/unstable/cli/Argument.ts +273 -69
- package/src/unstable/cli/CliError.ts +69 -76
- package/src/unstable/cli/CliOutput.ts +44 -58
- package/src/unstable/cli/Command.ts +705 -107
- package/src/unstable/cli/Flag.ts +418 -138
- package/src/unstable/cli/GlobalFlag.ts +1 -1
- package/src/unstable/cli/HelpDoc.ts +12 -4
- package/src/unstable/cli/Param.ts +292 -78
- package/src/unstable/cli/Primitive.ts +370 -149
- package/src/unstable/cli/Prompt.ts +28 -14
- package/src/unstable/cli/internal/lexer.ts +8 -2
- package/src/unstable/cli/internal/parser.ts +2 -2
- package/src/unstable/cluster/ClusterSchema.ts +8 -8
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +5 -1
- package/src/unstable/cluster/Entity.ts +15 -16
- package/src/unstable/cluster/EntityProxy.ts +4 -2
- package/src/unstable/cluster/EntityResource.ts +2 -2
- package/src/unstable/cluster/Envelope.ts +3 -3
- package/src/unstable/cluster/HttpRunner.ts +6 -4
- package/src/unstable/cluster/Message.ts +9 -9
- package/src/unstable/cluster/MessageStorage.ts +15 -15
- package/src/unstable/cluster/Reply.ts +4 -6
- package/src/unstable/cluster/RunnerHealth.ts +1 -1
- package/src/unstable/cluster/RunnerServer.ts +41 -8
- package/src/unstable/cluster/RunnerStorage.ts +2 -2
- package/src/unstable/cluster/Runners.ts +23 -12
- package/src/unstable/cluster/Sharding.ts +7 -8
- package/src/unstable/cluster/ShardingConfig.ts +3 -3
- package/src/unstable/cluster/SingletonAddress.ts +1 -1
- package/src/unstable/cluster/Snowflake.ts +8 -8
- package/src/unstable/cluster/SqlMessageStorage.ts +1 -1
- package/src/unstable/cluster/SqlRunnerStorage.ts +21 -5
- package/src/unstable/cluster/internal/entityManager.ts +11 -15
- package/src/unstable/encoding/Msgpack.ts +6 -8
- package/src/unstable/encoding/Sse.ts +98 -16
- package/src/unstable/eventlog/Event.ts +20 -20
- package/src/unstable/eventlog/EventGroup.ts +4 -4
- package/src/unstable/eventlog/EventJournal.ts +15 -15
- package/src/unstable/eventlog/EventLog.ts +3 -3
- package/src/unstable/eventlog/EventLogEncryption.ts +1 -1
- package/src/unstable/eventlog/EventLogMessage.ts +2 -2
- package/src/unstable/eventlog/EventLogRemote.ts +1 -1
- package/src/unstable/eventlog/EventLogServer.ts +41 -7
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +13 -5
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +14 -6
- package/src/unstable/eventlog/EventLogSessionAuth.ts +1 -1
- package/src/unstable/http/Cookies.ts +35 -21
- package/src/unstable/http/Etag.ts +1 -1
- package/src/unstable/http/FetchHttpClient.ts +3 -1
- package/src/unstable/http/Headers.ts +2 -2
- package/src/unstable/http/HttpBody.ts +20 -5
- package/src/unstable/http/HttpClient.ts +83 -55
- package/src/unstable/http/HttpClientRequest.ts +2 -0
- package/src/unstable/http/HttpClientResponse.ts +4 -4
- package/src/unstable/http/HttpEffect.ts +8 -8
- package/src/unstable/http/HttpMethod.ts +6 -9
- package/src/unstable/http/HttpMiddleware.ts +202 -39
- package/src/unstable/http/HttpPlatform.ts +95 -0
- package/src/unstable/http/HttpRouter.ts +102 -98
- package/src/unstable/http/HttpServer.ts +13 -13
- package/src/unstable/http/HttpServerError.ts +2 -2
- package/src/unstable/http/HttpServerRequest.ts +4 -4
- package/src/unstable/http/HttpServerResponse.ts +30 -0
- package/src/unstable/http/HttpStaticServer.ts +35 -7
- package/src/unstable/http/Multipart.ts +6 -6
- package/src/unstable/http/Url.ts +33 -63
- package/src/unstable/http/UrlParams.ts +10 -18
- package/src/unstable/http/internal/compression.ts +196 -0
- package/src/unstable/httpapi/HttpApiBuilder.ts +10 -9
- package/src/unstable/httpapi/HttpApiClient.ts +14 -14
- package/src/unstable/httpapi/HttpApiEndpoint.ts +42 -42
- package/src/unstable/httpapi/HttpApiError.ts +13 -13
- package/src/unstable/httpapi/HttpApiGroup.ts +15 -15
- package/src/unstable/httpapi/HttpApiMiddleware.ts +71 -24
- package/src/unstable/httpapi/HttpApiScalar.ts +0 -12
- package/src/unstable/httpapi/HttpApiSchema.ts +6 -6
- package/src/unstable/httpapi/OpenApi.ts +13 -13
- package/src/unstable/observability/OtlpExporter.ts +31 -19
- package/src/unstable/observability/OtlpMetrics.ts +4 -1
- package/src/unstable/observability/OtlpResource.ts +26 -17
- package/src/unstable/observability/PrometheusMetrics.ts +13 -4
- package/src/unstable/observability/internal/otlpEnv.ts +1 -1
- package/src/unstable/observability/internal/protobuf.ts +3 -0
- package/src/unstable/persistence/KeyValueStore.ts +72 -49
- package/src/unstable/persistence/Persistable.ts +8 -8
- package/src/unstable/persistence/PersistedQueue.ts +6 -6
- package/src/unstable/persistence/Persistence.ts +126 -19
- package/src/unstable/persistence/RateLimiter.ts +26 -15
- package/src/unstable/persistence/Redis.ts +2 -2
- package/src/unstable/process/ChildProcess.ts +64 -21
- package/src/unstable/process/ChildProcessSpawner.ts +21 -10
- package/src/unstable/reactivity/AsyncResult.ts +12 -13
- package/src/unstable/reactivity/Atom.ts +28 -25
- package/src/unstable/reactivity/AtomHttpApi.ts +5 -4
- package/src/unstable/reactivity/AtomRegistry.ts +24 -3
- package/src/unstable/reactivity/AtomRpc.ts +5 -4
- package/src/unstable/reactivity/Hydration.ts +1 -1
- package/src/unstable/rpc/Rpc.ts +35 -33
- package/src/unstable/rpc/RpcClient.ts +16 -15
- package/src/unstable/rpc/RpcGroup.ts +8 -8
- package/src/unstable/rpc/RpcMessage.ts +31 -30
- package/src/unstable/rpc/RpcMiddleware.ts +10 -10
- package/src/unstable/rpc/RpcSchema.ts +4 -4
- package/src/unstable/rpc/RpcSerialization.ts +167 -68
- package/src/unstable/rpc/RpcServer.ts +18 -15
- package/src/unstable/rpc/RpcWorker.ts +5 -5
- package/src/unstable/schema/Model.ts +52 -50
- package/src/unstable/schema/VariantSchema.ts +5 -5
- package/src/unstable/socket/Socket.ts +17 -4
- package/src/unstable/sql/SqlClient.ts +5 -6
- package/src/unstable/sql/SqlModel.ts +2 -2
- package/src/unstable/sql/SqlResolver.ts +5 -5
- package/src/unstable/sql/Statement.ts +24 -23
- package/src/unstable/workers/Transferable.ts +1 -1
- package/src/unstable/workers/Worker.ts +2 -2
- package/src/unstable/workers/WorkerError.ts +7 -7
- package/src/unstable/workers/WorkerRunner.ts +1 -1
- package/src/unstable/workflow/Activity.ts +2 -2
- package/src/unstable/workflow/DurableClock.ts +1 -1
- package/src/unstable/workflow/DurableDeferred.ts +10 -10
- package/src/unstable/workflow/DurableQueue.ts +22 -20
- package/src/unstable/workflow/Workflow.ts +23 -23
- package/src/unstable/workflow/WorkflowEngine.ts +1 -1
- package/src/unstable/workflow/WorkflowProxy.ts +4 -2
- package/dist/internal/version.d.ts +0 -3
- package/dist/internal/version.d.ts.map +0 -1
- package/dist/internal/version.js +0 -2
- package/dist/internal/version.js.map +0 -1
- package/src/internal/version.ts +0 -2
package/dist/DateTime.d.ts
CHANGED
|
@@ -313,21 +313,21 @@ export declare namespace TimeZone {
|
|
|
313
313
|
*
|
|
314
314
|
* **Example** (Resolving ambiguous local times)
|
|
315
315
|
*
|
|
316
|
-
* ```ts
|
|
317
|
-
* import { DateTime } from "effect"
|
|
316
|
+
* ```ts import.meta.vitest
|
|
317
|
+
* import { DateTime, Option } from "effect"
|
|
318
318
|
*
|
|
319
319
|
* // Fall-back example: 01:30 on Nov 2, 2025 in New York happens twice
|
|
320
|
-
* const ambiguousTime = { year: 2025, month: 11, day: 2,
|
|
320
|
+
* const ambiguousTime = { year: 2025, month: 11, day: 2, hour: 1, minute: 30 }
|
|
321
321
|
* const timeZone = DateTime.zoneMakeNamedUnsafe("America/New_York")
|
|
322
322
|
*
|
|
323
|
-
* DateTime.makeZoned(ambiguousTime, {
|
|
323
|
+
* const earlier = DateTime.makeZoned(ambiguousTime, {
|
|
324
324
|
* timeZone,
|
|
325
325
|
* adjustForTimeZone: true,
|
|
326
326
|
* disambiguation: "earlier"
|
|
327
327
|
* })
|
|
328
328
|
* // Earlier occurrence (DST time): 2025-11-02T05:30:00.000Z
|
|
329
329
|
*
|
|
330
|
-
* DateTime.makeZoned(ambiguousTime, {
|
|
330
|
+
* const later = DateTime.makeZoned(ambiguousTime, {
|
|
331
331
|
* timeZone,
|
|
332
332
|
* adjustForTimeZone: true,
|
|
333
333
|
* disambiguation: "later"
|
|
@@ -335,21 +335,26 @@ export declare namespace TimeZone {
|
|
|
335
335
|
* // Later occurrence (standard time): 2025-11-02T06:30:00.000Z
|
|
336
336
|
*
|
|
337
337
|
* // Gap example: 02:30 on Mar 9, 2025 in New York doesn't exist
|
|
338
|
-
* const gapTime = { year: 2025, month: 3, day: 9,
|
|
338
|
+
* const gapTime = { year: 2025, month: 3, day: 9, hour: 2, minute: 30 }
|
|
339
339
|
*
|
|
340
|
-
* DateTime.makeZoned(gapTime, {
|
|
340
|
+
* const beforeGap = DateTime.makeZoned(gapTime, {
|
|
341
341
|
* timeZone,
|
|
342
342
|
* adjustForTimeZone: true,
|
|
343
343
|
* disambiguation: "earlier"
|
|
344
344
|
* })
|
|
345
345
|
* // Time before gap: 2025-03-09T06:30:00.000Z (01:30 EST)
|
|
346
346
|
*
|
|
347
|
-
* DateTime.makeZoned(gapTime, {
|
|
347
|
+
* const afterGap = DateTime.makeZoned(gapTime, {
|
|
348
348
|
* timeZone,
|
|
349
349
|
* adjustForTimeZone: true,
|
|
350
350
|
* disambiguation: "later"
|
|
351
351
|
* })
|
|
352
352
|
* // Time after gap: 2025-03-09T07:30:00.000Z (03:30 EDT)
|
|
353
|
+
*
|
|
354
|
+
* earlier.pipe(Option.getOrThrow, DateTime.formatIso) // => "2025-11-02T05:30:00.000Z"
|
|
355
|
+
* later.pipe(Option.getOrThrow, DateTime.formatIso) // => "2025-11-02T06:30:00.000Z"
|
|
356
|
+
* beforeGap.pipe(Option.getOrThrow, DateTime.formatIso) // => "2025-03-09T06:30:00.000Z"
|
|
357
|
+
* afterGap.pipe(Option.getOrThrow, DateTime.formatIso) // => "2025-03-09T07:30:00.000Z"
|
|
353
358
|
* ```
|
|
354
359
|
*
|
|
355
360
|
* @category models
|
|
@@ -455,7 +460,7 @@ export declare const isZoned: (self: DateTime) => self is Zoned;
|
|
|
455
460
|
*
|
|
456
461
|
* **Example** (Comparing DateTime values for equivalence)
|
|
457
462
|
*
|
|
458
|
-
* ```ts
|
|
463
|
+
* ```ts import.meta.vitest
|
|
459
464
|
* import { DateTime } from "effect"
|
|
460
465
|
*
|
|
461
466
|
* const utc = DateTime.makeUnsafe("2024-01-01T12:00:00Z")
|
|
@@ -463,7 +468,7 @@ export declare const isZoned: (self: DateTime) => self is Zoned;
|
|
|
463
468
|
* timeZone: "Europe/London"
|
|
464
469
|
* })
|
|
465
470
|
*
|
|
466
|
-
*
|
|
471
|
+
* DateTime.Equivalence(utc, zoned) // => true
|
|
467
472
|
* ```
|
|
468
473
|
*
|
|
469
474
|
* @category instances
|
|
@@ -480,7 +485,7 @@ export declare const Equivalence: Equ.Equivalence<DateTime>;
|
|
|
480
485
|
*
|
|
481
486
|
* **Example** (Sorting DateTime values chronologically)
|
|
482
487
|
*
|
|
483
|
-
* ```ts
|
|
488
|
+
* ```ts import.meta.vitest
|
|
484
489
|
* import { Array, DateTime } from "effect"
|
|
485
490
|
*
|
|
486
491
|
* const dates = [
|
|
@@ -489,8 +494,7 @@ export declare const Equivalence: Equ.Equivalence<DateTime>;
|
|
|
489
494
|
* DateTime.makeUnsafe("2024-02-01")
|
|
490
495
|
* ]
|
|
491
496
|
*
|
|
492
|
-
*
|
|
493
|
-
* // Results in chronological order: 2024-01-01, 2024-02-01, 2024-03-01
|
|
497
|
+
* Array.sort(dates, DateTime.Order).map(DateTime.formatIsoDateUtc) // => ["2024-01-01", "2024-02-01", "2024-03-01"]
|
|
494
498
|
* ```
|
|
495
499
|
*
|
|
496
500
|
* @category instances
|
|
@@ -508,15 +512,14 @@ export declare const Order: order.Order<DateTime>;
|
|
|
508
512
|
*
|
|
509
513
|
* **Example** (Clamping DateTime values)
|
|
510
514
|
*
|
|
511
|
-
* ```ts
|
|
515
|
+
* ```ts import.meta.vitest
|
|
512
516
|
* import { DateTime } from "effect"
|
|
513
517
|
*
|
|
514
518
|
* const min = DateTime.makeUnsafe("2024-01-01")
|
|
515
519
|
* const max = DateTime.makeUnsafe("2024-12-31")
|
|
516
520
|
* const date = DateTime.makeUnsafe("2025-06-15")
|
|
517
521
|
*
|
|
518
|
-
*
|
|
519
|
-
* // clamped equals max (2024-12-31)
|
|
522
|
+
* DateTime.clamp(date, { minimum: min, maximum: max }) // => DateTime.makeUnsafe("2024-12-31")
|
|
520
523
|
* ```
|
|
521
524
|
*
|
|
522
525
|
* @category ordering
|
|
@@ -534,15 +537,14 @@ export declare const clamp: {
|
|
|
534
537
|
*
|
|
535
538
|
* **Example** (Clamping DateTime values)
|
|
536
539
|
*
|
|
537
|
-
* ```ts
|
|
540
|
+
* ```ts import.meta.vitest
|
|
538
541
|
* import { DateTime } from "effect"
|
|
539
542
|
*
|
|
540
543
|
* const min = DateTime.makeUnsafe("2024-01-01")
|
|
541
544
|
* const max = DateTime.makeUnsafe("2024-12-31")
|
|
542
545
|
* const date = DateTime.makeUnsafe("2025-06-15")
|
|
543
546
|
*
|
|
544
|
-
*
|
|
545
|
-
* // clamped equals max (2024-12-31)
|
|
547
|
+
* DateTime.clamp(date, { minimum: min, maximum: max }) // => DateTime.makeUnsafe("2024-12-31")
|
|
546
548
|
* ```
|
|
547
549
|
*
|
|
548
550
|
* @category ordering
|
|
@@ -563,15 +565,14 @@ export declare const clamp: {
|
|
|
563
565
|
*
|
|
564
566
|
* **Example** (Clamping DateTime values)
|
|
565
567
|
*
|
|
566
|
-
* ```ts
|
|
568
|
+
* ```ts import.meta.vitest
|
|
567
569
|
* import { DateTime } from "effect"
|
|
568
570
|
*
|
|
569
571
|
* const min = DateTime.makeUnsafe("2024-01-01")
|
|
570
572
|
* const max = DateTime.makeUnsafe("2024-12-31")
|
|
571
573
|
* const date = DateTime.makeUnsafe("2025-06-15")
|
|
572
574
|
*
|
|
573
|
-
*
|
|
574
|
-
* // clamped equals max (2024-12-31)
|
|
575
|
+
* DateTime.clamp(date, { minimum: min, maximum: max }) // => DateTime.makeUnsafe("2024-12-31")
|
|
575
576
|
* ```
|
|
576
577
|
*
|
|
577
578
|
* @category ordering
|
|
@@ -591,13 +592,10 @@ export declare const clamp: {
|
|
|
591
592
|
*
|
|
592
593
|
* **Example** (Creating DateTime values from Dates)
|
|
593
594
|
*
|
|
594
|
-
* ```ts
|
|
595
|
+
* ```ts import.meta.vitest
|
|
595
596
|
* import { DateTime } from "effect"
|
|
596
597
|
*
|
|
597
|
-
*
|
|
598
|
-
* const dateTime = DateTime.fromDateUnsafe(date)
|
|
599
|
-
*
|
|
600
|
-
* console.log(DateTime.formatIso(dateTime)) // "2024-01-01T12:00:00.000Z"
|
|
598
|
+
* DateTime.fromDateUnsafe(new Date("2024-01-01T12:00:00Z")) // => DateTime.makeUnsafe("2024-01-01T12:00:00Z")
|
|
601
599
|
* ```
|
|
602
600
|
*
|
|
603
601
|
* @category constructors
|
|
@@ -622,26 +620,38 @@ export declare const fromDateUnsafe: (date: Date) => Utc;
|
|
|
622
620
|
*
|
|
623
621
|
* **Example** (Creating DateTime values unsafely)
|
|
624
622
|
*
|
|
625
|
-
* ```ts
|
|
623
|
+
* ```ts import.meta.vitest
|
|
626
624
|
* import { DateTime } from "effect"
|
|
627
625
|
*
|
|
628
626
|
* // from Date
|
|
629
|
-
*
|
|
630
|
-
* console.log(DateTime.formatIso(fromDate)) // "2024-01-01T12:00:00.000Z"
|
|
627
|
+
* DateTime.makeUnsafe(new Date("2024-01-01T12:00:00Z")) // => DateTime.makeUnsafe("2024-01-01T12:00:00Z")
|
|
631
628
|
*
|
|
632
629
|
* // from parts
|
|
633
|
-
*
|
|
634
|
-
* console.log(DateTime.formatIso(fromParts)) // "2024-01-01T00:00:00.000Z"
|
|
630
|
+
* DateTime.makeUnsafe({ year: 2024 }) // => DateTime.makeUnsafe("2024-01-01T00:00:00Z")
|
|
635
631
|
*
|
|
636
632
|
* // from string
|
|
637
|
-
*
|
|
638
|
-
* console.log(DateTime.formatIso(fromString)) // "2024-01-01T00:00:00.000Z"
|
|
633
|
+
* DateTime.makeUnsafe("2024-01-01") // => DateTime.makeUnsafe("2024-01-01T00:00:00Z")
|
|
639
634
|
* ```
|
|
640
635
|
*
|
|
641
636
|
* @category constructors
|
|
642
637
|
* @since 4.0.0
|
|
643
638
|
*/
|
|
644
639
|
export declare const makeUnsafe: <A extends DateTime.Input>(input: A) => DateTime.PreserveZone<A>;
|
|
640
|
+
/**
|
|
641
|
+
* Creates a `DateTime.Utc` from the number of seconds since the Unix epoch.
|
|
642
|
+
*
|
|
643
|
+
* **Example** (Creating from epoch seconds)
|
|
644
|
+
*
|
|
645
|
+
* ```ts import.meta.vitest
|
|
646
|
+
* import { DateTime } from "effect"
|
|
647
|
+
*
|
|
648
|
+
* DateTime.fromEpochSeconds(1704067200).toJSON() // => "2024-01-01T00:00:00.000Z"
|
|
649
|
+
* ```
|
|
650
|
+
*
|
|
651
|
+
* @category constructors
|
|
652
|
+
* @since 4.0.0
|
|
653
|
+
*/
|
|
654
|
+
export declare const fromEpochSeconds: (seconds: number) => Utc;
|
|
645
655
|
/**
|
|
646
656
|
* Create a `DateTime.Zoned` using `DateTime.makeUnsafe` and a time zone.
|
|
647
657
|
*
|
|
@@ -665,14 +675,14 @@ export declare const makeUnsafe: <A extends DateTime.Input>(input: A) => DateTim
|
|
|
665
675
|
*
|
|
666
676
|
* **Example** (Creating zoned DateTime values unsafely)
|
|
667
677
|
*
|
|
668
|
-
* ```ts
|
|
678
|
+
* ```ts import.meta.vitest
|
|
669
679
|
* import { DateTime } from "effect"
|
|
670
680
|
*
|
|
671
681
|
* const zoned = DateTime.makeZonedUnsafe("2024-06-15T14:30:00Z", {
|
|
672
682
|
* timeZone: "Europe/London"
|
|
673
683
|
* })
|
|
674
684
|
*
|
|
675
|
-
*
|
|
685
|
+
* DateTime.formatIsoZoned(zoned) // => "2024-06-15T15:30:00.000+01:00[Europe/London]"
|
|
676
686
|
* ```
|
|
677
687
|
*
|
|
678
688
|
* @category constructors
|
|
@@ -706,17 +716,14 @@ export declare const makeZonedUnsafe: (input: DateTime.Input, options?: {
|
|
|
706
716
|
*
|
|
707
717
|
* **Example** (Creating optional zoned DateTime values)
|
|
708
718
|
*
|
|
709
|
-
* ```ts
|
|
710
|
-
* import { DateTime } from "effect"
|
|
719
|
+
* ```ts import.meta.vitest
|
|
720
|
+
* import { DateTime, Option } from "effect"
|
|
711
721
|
*
|
|
712
722
|
* const result = DateTime.makeZoned("2024-06-15T14:30:00Z", {
|
|
713
723
|
* timeZone: "Europe/London"
|
|
714
724
|
* })
|
|
715
725
|
*
|
|
716
|
-
*
|
|
717
|
-
* if (result._tag === "Some") {
|
|
718
|
-
* console.log(DateTime.formatIsoZoned(result.value)) // "2024-06-15T15:30:00.000+01:00[Europe/London]"
|
|
719
|
-
* }
|
|
726
|
+
* result.pipe(Option.map(DateTime.formatIsoZoned)) // => Option.some("2024-06-15T15:30:00.000+01:00[Europe/London]")
|
|
720
727
|
* ```
|
|
721
728
|
*
|
|
722
729
|
* @category constructors
|
|
@@ -744,23 +751,19 @@ export declare const makeZoned: (input: DateTime.Input, options?: {
|
|
|
744
751
|
*
|
|
745
752
|
* **Example** (Creating optional DateTime values)
|
|
746
753
|
*
|
|
747
|
-
* ```ts
|
|
748
|
-
* import { DateTime } from "effect"
|
|
754
|
+
* ```ts import.meta.vitest
|
|
755
|
+
* import { DateTime, Option } from "effect"
|
|
749
756
|
*
|
|
750
757
|
* // from Date
|
|
751
|
-
*
|
|
752
|
-
* console.log(fromDate._tag) // "Some"
|
|
758
|
+
* DateTime.make(new Date("2024-01-01T12:00:00Z")) // => Option.some(DateTime.makeUnsafe("2024-01-01T12:00:00Z"))
|
|
753
759
|
*
|
|
754
760
|
* // from parts
|
|
755
|
-
*
|
|
756
|
-
* console.log(fromParts._tag) // "Some"
|
|
761
|
+
* DateTime.make({ year: 2024 }) // => Option.some(DateTime.makeUnsafe("2024-01-01T00:00:00Z"))
|
|
757
762
|
*
|
|
758
763
|
* // from string
|
|
759
|
-
*
|
|
760
|
-
* console.log(fromString._tag) // "Some"
|
|
764
|
+
* DateTime.make("2024-01-01") // => Option.some(DateTime.makeUnsafe("2024-01-01T00:00:00Z"))
|
|
761
765
|
*
|
|
762
|
-
*
|
|
763
|
-
* console.log(invalid._tag) // "None"
|
|
766
|
+
* DateTime.make("not a date") // => Option.none()
|
|
764
767
|
* ```
|
|
765
768
|
*
|
|
766
769
|
* @category constructors
|
|
@@ -779,19 +782,15 @@ export declare const make: <A extends DateTime.Input>(input: A) => Option.Option
|
|
|
779
782
|
*
|
|
780
783
|
* **Example** (Parsing zoned DateTime strings)
|
|
781
784
|
*
|
|
782
|
-
* ```ts
|
|
783
|
-
* import { DateTime } from "effect"
|
|
785
|
+
* ```ts import.meta.vitest
|
|
786
|
+
* import { DateTime, Option } from "effect"
|
|
784
787
|
*
|
|
785
|
-
*
|
|
788
|
+
* DateTime.makeZonedFromString(
|
|
786
789
|
* "2024-01-01T12:00:00+02:00[Europe/Berlin]"
|
|
787
|
-
* )
|
|
788
|
-
* console.log(result1._tag === "Some") // true
|
|
789
|
-
*
|
|
790
|
-
* const result2 = DateTime.makeZonedFromString("2024-01-01T12:00:00Z")
|
|
791
|
-
* console.log(result2._tag === "Some") // true
|
|
790
|
+
* ).pipe(Option.map(DateTime.formatIsoZoned)) // => Option.some("2024-01-01T11:00:00.000+01:00[Europe/Berlin]")
|
|
792
791
|
*
|
|
793
|
-
*
|
|
794
|
-
*
|
|
792
|
+
* DateTime.makeZonedFromString("2024-01-01T12:00:00Z") // => Option.none()
|
|
793
|
+
* DateTime.makeZonedFromString("invalid") // => Option.none()
|
|
795
794
|
* ```
|
|
796
795
|
*
|
|
797
796
|
* @category constructors
|
|
@@ -799,17 +798,15 @@ export declare const make: <A extends DateTime.Input>(input: A) => Option.Option
|
|
|
799
798
|
*/
|
|
800
799
|
export declare const makeZonedFromString: (input: string) => Option.Option<Zoned>;
|
|
801
800
|
/**
|
|
802
|
-
* Gets the current time using the `Clock` service and
|
|
801
|
+
* Gets the current time using the `Clock` service and converts it to a `DateTime`.
|
|
803
802
|
*
|
|
804
803
|
* **Example** (Getting the current DateTime)
|
|
805
804
|
*
|
|
806
|
-
* ```ts
|
|
805
|
+
* ```ts import.meta.vitest
|
|
807
806
|
* import { DateTime, Effect } from "effect"
|
|
807
|
+
* import { TestClock } from "effect/testing"
|
|
808
808
|
*
|
|
809
|
-
* Effect.
|
|
810
|
-
* const now = yield* DateTime.nowAsDate
|
|
811
|
-
* console.log(now instanceof Date) // true
|
|
812
|
-
* })
|
|
809
|
+
* await Effect.runPromise(Effect.map(DateTime.now, DateTime.isDateTime)) // => true
|
|
813
810
|
* ```
|
|
814
811
|
*
|
|
815
812
|
* @category constructors
|
|
@@ -822,12 +819,11 @@ export declare const now: Effect.Effect<Utc>;
|
|
|
822
819
|
*
|
|
823
820
|
* **Example** (Getting the current Date)
|
|
824
821
|
*
|
|
825
|
-
* ```ts
|
|
822
|
+
* ```ts import.meta.vitest
|
|
826
823
|
* import { DateTime, Effect } from "effect"
|
|
824
|
+
* import { TestClock } from "effect/testing"
|
|
827
825
|
*
|
|
828
|
-
* Effect.
|
|
829
|
-
* const now = yield* DateTime.now
|
|
830
|
-
* })
|
|
826
|
+
* await Effect.runPromise(Effect.map(DateTime.nowAsDate, (now) => now instanceof Date)) // => true
|
|
831
827
|
* ```
|
|
832
828
|
*
|
|
833
829
|
* @category constructors
|
|
@@ -849,11 +845,10 @@ export declare const nowAsDate: Effect.Effect<Date>;
|
|
|
849
845
|
*
|
|
850
846
|
* **Example** (Getting the current DateTime unsafely)
|
|
851
847
|
*
|
|
852
|
-
* ```ts
|
|
848
|
+
* ```ts import.meta.vitest
|
|
853
849
|
* import { DateTime } from "effect"
|
|
854
850
|
*
|
|
855
|
-
*
|
|
856
|
-
* console.log(DateTime.formatIso(now))
|
|
851
|
+
* Number.isFinite(DateTime.toEpochMillis(DateTime.nowUnsafe())) // => true
|
|
857
852
|
* ```
|
|
858
853
|
*
|
|
859
854
|
* @category constructors
|
|
@@ -874,7 +869,7 @@ export declare const nowUnsafe: LazyArg<Utc>;
|
|
|
874
869
|
*
|
|
875
870
|
* **Example** (Converting DateTime values to UTC)
|
|
876
871
|
*
|
|
877
|
-
* ```ts
|
|
872
|
+
* ```ts import.meta.vitest
|
|
878
873
|
* import { DateTime } from "effect"
|
|
879
874
|
*
|
|
880
875
|
* const now = DateTime.makeZonedUnsafe({ year: 2024 }, {
|
|
@@ -883,9 +878,10 @@ export declare const nowUnsafe: LazyArg<Utc>;
|
|
|
883
878
|
*
|
|
884
879
|
* // set as UTC
|
|
885
880
|
* const utc: DateTime.Utc = DateTime.toUtc(now)
|
|
881
|
+
* utc // => DateTime.makeUnsafe("2024-01-01T00:00:00Z")
|
|
886
882
|
* ```
|
|
887
883
|
*
|
|
888
|
-
* @category
|
|
884
|
+
* @category converting
|
|
889
885
|
* @since 3.13.0
|
|
890
886
|
*/
|
|
891
887
|
export declare const toUtc: (self: DateTime) => Utc;
|
|
@@ -894,19 +890,16 @@ export declare const toUtc: (self: DateTime) => Utc;
|
|
|
894
890
|
*
|
|
895
891
|
* **Example** (Setting time zones)
|
|
896
892
|
*
|
|
897
|
-
* ```ts
|
|
898
|
-
* import { DateTime
|
|
893
|
+
* ```ts import.meta.vitest
|
|
894
|
+
* import { DateTime } from "effect"
|
|
899
895
|
*
|
|
900
|
-
*
|
|
901
|
-
*
|
|
902
|
-
* const zone = DateTime.zoneMakeNamedUnsafe("Europe/London")
|
|
896
|
+
* const zone = DateTime.zoneMakeNamedUnsafe("Europe/London")
|
|
897
|
+
* const zoned: DateTime.Zoned = DateTime.setZone(DateTime.makeUnsafe("2024-01-01"), zone)
|
|
903
898
|
*
|
|
904
|
-
*
|
|
905
|
-
* const zoned: DateTime.Zoned = DateTime.setZone(now, zone)
|
|
906
|
-
* })
|
|
899
|
+
* DateTime.isZoned(zoned) // => true
|
|
907
900
|
* ```
|
|
908
901
|
*
|
|
909
|
-
* @category
|
|
902
|
+
* @category transforming
|
|
910
903
|
* @since 3.6.0
|
|
911
904
|
*/
|
|
912
905
|
export declare const setZone: {
|
|
@@ -915,19 +908,16 @@ export declare const setZone: {
|
|
|
915
908
|
*
|
|
916
909
|
* **Example** (Setting time zones)
|
|
917
910
|
*
|
|
918
|
-
* ```ts
|
|
919
|
-
* import { DateTime
|
|
911
|
+
* ```ts import.meta.vitest
|
|
912
|
+
* import { DateTime } from "effect"
|
|
920
913
|
*
|
|
921
|
-
*
|
|
922
|
-
*
|
|
923
|
-
* const zone = DateTime.zoneMakeNamedUnsafe("Europe/London")
|
|
914
|
+
* const zone = DateTime.zoneMakeNamedUnsafe("Europe/London")
|
|
915
|
+
* const zoned: DateTime.Zoned = DateTime.setZone(DateTime.makeUnsafe("2024-01-01"), zone)
|
|
924
916
|
*
|
|
925
|
-
*
|
|
926
|
-
* const zoned: DateTime.Zoned = DateTime.setZone(now, zone)
|
|
927
|
-
* })
|
|
917
|
+
* DateTime.isZoned(zoned) // => true
|
|
928
918
|
* ```
|
|
929
919
|
*
|
|
930
|
-
* @category
|
|
920
|
+
* @category transforming
|
|
931
921
|
* @since 3.6.0
|
|
932
922
|
*/
|
|
933
923
|
(zone: TimeZone, options?: {
|
|
@@ -939,19 +929,16 @@ export declare const setZone: {
|
|
|
939
929
|
*
|
|
940
930
|
* **Example** (Setting time zones)
|
|
941
931
|
*
|
|
942
|
-
* ```ts
|
|
943
|
-
* import { DateTime
|
|
932
|
+
* ```ts import.meta.vitest
|
|
933
|
+
* import { DateTime } from "effect"
|
|
944
934
|
*
|
|
945
|
-
*
|
|
946
|
-
*
|
|
947
|
-
* const zone = DateTime.zoneMakeNamedUnsafe("Europe/London")
|
|
935
|
+
* const zone = DateTime.zoneMakeNamedUnsafe("Europe/London")
|
|
936
|
+
* const zoned: DateTime.Zoned = DateTime.setZone(DateTime.makeUnsafe("2024-01-01"), zone)
|
|
948
937
|
*
|
|
949
|
-
*
|
|
950
|
-
* const zoned: DateTime.Zoned = DateTime.setZone(now, zone)
|
|
951
|
-
* })
|
|
938
|
+
* DateTime.isZoned(zoned) // => true
|
|
952
939
|
* ```
|
|
953
940
|
*
|
|
954
|
-
* @category
|
|
941
|
+
* @category transforming
|
|
955
942
|
* @since 3.6.0
|
|
956
943
|
*/
|
|
957
944
|
(self: DateTime, zone: TimeZone, options?: {
|
|
@@ -968,18 +955,16 @@ export declare const setZone: {
|
|
|
968
955
|
*
|
|
969
956
|
* **Example** (Setting fixed-offset time zones)
|
|
970
957
|
*
|
|
971
|
-
* ```ts
|
|
972
|
-
* import { DateTime
|
|
958
|
+
* ```ts import.meta.vitest
|
|
959
|
+
* import { DateTime } from "effect"
|
|
973
960
|
*
|
|
974
|
-
*
|
|
975
|
-
*
|
|
961
|
+
* const dateTime = DateTime.makeUnsafe("2024-01-01")
|
|
962
|
+
* const zoned: DateTime.Zoned = DateTime.setZoneOffset(dateTime, 3 * 60 * 60 * 1000)
|
|
976
963
|
*
|
|
977
|
-
*
|
|
978
|
-
* const zoned: DateTime.Zoned = DateTime.setZoneOffset(now, 3 * 60 * 60 * 1000)
|
|
979
|
-
* })
|
|
964
|
+
* DateTime.zoneToString(zoned.zone) // => "+03:00"
|
|
980
965
|
* ```
|
|
981
966
|
*
|
|
982
|
-
* @category
|
|
967
|
+
* @category transforming
|
|
983
968
|
* @since 3.6.0
|
|
984
969
|
*/
|
|
985
970
|
export declare const setZoneOffset: {
|
|
@@ -992,18 +977,16 @@ export declare const setZoneOffset: {
|
|
|
992
977
|
*
|
|
993
978
|
* **Example** (Setting fixed-offset time zones)
|
|
994
979
|
*
|
|
995
|
-
* ```ts
|
|
996
|
-
* import { DateTime
|
|
980
|
+
* ```ts import.meta.vitest
|
|
981
|
+
* import { DateTime } from "effect"
|
|
997
982
|
*
|
|
998
|
-
*
|
|
999
|
-
*
|
|
983
|
+
* const dateTime = DateTime.makeUnsafe("2024-01-01")
|
|
984
|
+
* const zoned: DateTime.Zoned = DateTime.setZoneOffset(dateTime, 3 * 60 * 60 * 1000)
|
|
1000
985
|
*
|
|
1001
|
-
*
|
|
1002
|
-
* const zoned: DateTime.Zoned = DateTime.setZoneOffset(now, 3 * 60 * 60 * 1000)
|
|
1003
|
-
* })
|
|
986
|
+
* DateTime.zoneToString(zoned.zone) // => "+03:00"
|
|
1004
987
|
* ```
|
|
1005
988
|
*
|
|
1006
|
-
* @category
|
|
989
|
+
* @category transforming
|
|
1007
990
|
* @since 3.6.0
|
|
1008
991
|
*/
|
|
1009
992
|
(offset: number, options?: {
|
|
@@ -1019,18 +1002,16 @@ export declare const setZoneOffset: {
|
|
|
1019
1002
|
*
|
|
1020
1003
|
* **Example** (Setting fixed-offset time zones)
|
|
1021
1004
|
*
|
|
1022
|
-
* ```ts
|
|
1023
|
-
* import { DateTime
|
|
1005
|
+
* ```ts import.meta.vitest
|
|
1006
|
+
* import { DateTime } from "effect"
|
|
1024
1007
|
*
|
|
1025
|
-
*
|
|
1026
|
-
*
|
|
1008
|
+
* const dateTime = DateTime.makeUnsafe("2024-01-01")
|
|
1009
|
+
* const zoned: DateTime.Zoned = DateTime.setZoneOffset(dateTime, 3 * 60 * 60 * 1000)
|
|
1027
1010
|
*
|
|
1028
|
-
*
|
|
1029
|
-
* const zoned: DateTime.Zoned = DateTime.setZoneOffset(now, 3 * 60 * 60 * 1000)
|
|
1030
|
-
* })
|
|
1011
|
+
* DateTime.zoneToString(zoned.zone) // => "+03:00"
|
|
1031
1012
|
* ```
|
|
1032
1013
|
*
|
|
1033
|
-
* @category
|
|
1014
|
+
* @category transforming
|
|
1034
1015
|
* @since 3.6.0
|
|
1035
1016
|
*/
|
|
1036
1017
|
(self: DateTime, offset: number, options?: {
|
|
@@ -1052,20 +1033,17 @@ export declare const setZoneOffset: {
|
|
|
1052
1033
|
*
|
|
1053
1034
|
* **Example** (Creating named time zones unsafely)
|
|
1054
1035
|
*
|
|
1055
|
-
* ```ts
|
|
1036
|
+
* ```ts import.meta.vitest
|
|
1056
1037
|
* import { DateTime } from "effect"
|
|
1057
1038
|
*
|
|
1058
|
-
*
|
|
1059
|
-
*
|
|
1060
|
-
*
|
|
1061
|
-
* const tokyoZone = DateTime.zoneMakeNamedUnsafe("Asia/Tokyo")
|
|
1062
|
-
* console.log(DateTime.zoneToString(tokyoZone)) // "Asia/Tokyo"
|
|
1039
|
+
* DateTime.zoneToString(DateTime.zoneMakeNamedUnsafe("Europe/London")) // => "Europe/London"
|
|
1040
|
+
* DateTime.zoneToString(DateTime.zoneMakeNamedUnsafe("Asia/Tokyo")) // => "Asia/Tokyo"
|
|
1063
1041
|
*
|
|
1064
1042
|
* // This would throw an IllegalArgumentError:
|
|
1065
1043
|
* // DateTime.zoneMakeNamedUnsafe("Invalid/Zone")
|
|
1066
1044
|
* ```
|
|
1067
1045
|
*
|
|
1068
|
-
* @category
|
|
1046
|
+
* @category constructors
|
|
1069
1047
|
* @since 4.0.0
|
|
1070
1048
|
*/
|
|
1071
1049
|
export declare const zoneMakeNamedUnsafe: (zoneId: string) => TimeZone.Named;
|
|
@@ -1079,7 +1057,7 @@ export declare const zoneMakeNamedUnsafe: (zoneId: string) => TimeZone.Named;
|
|
|
1079
1057
|
*
|
|
1080
1058
|
* **Example** (Creating fixed-offset time zones)
|
|
1081
1059
|
*
|
|
1082
|
-
* ```ts
|
|
1060
|
+
* ```ts import.meta.vitest
|
|
1083
1061
|
* import { DateTime } from "effect"
|
|
1084
1062
|
*
|
|
1085
1063
|
* // Create a time zone with +3 hours offset
|
|
@@ -1088,9 +1066,10 @@ export declare const zoneMakeNamedUnsafe: (zoneId: string) => TimeZone.Named;
|
|
|
1088
1066
|
* const dt = DateTime.makeZonedUnsafe("2024-01-01T12:00:00Z", {
|
|
1089
1067
|
* timeZone: zone
|
|
1090
1068
|
* })
|
|
1069
|
+
* DateTime.formatIsoZoned(dt) // => "2024-01-01T15:00:00.000+03:00"
|
|
1091
1070
|
* ```
|
|
1092
1071
|
*
|
|
1093
|
-
* @category
|
|
1072
|
+
* @category constructors
|
|
1094
1073
|
* @since 3.6.0
|
|
1095
1074
|
*/
|
|
1096
1075
|
export declare const zoneMakeOffset: (offset: number) => TimeZone.Offset;
|
|
@@ -1103,17 +1082,14 @@ export declare const zoneMakeOffset: (offset: number) => TimeZone.Offset;
|
|
|
1103
1082
|
*
|
|
1104
1083
|
* **Example** (Creating optional named time zones)
|
|
1105
1084
|
*
|
|
1106
|
-
* ```ts
|
|
1107
|
-
* import { DateTime } from "effect"
|
|
1108
|
-
*
|
|
1109
|
-
* const validZone = DateTime.zoneMakeNamed("Europe/London")
|
|
1110
|
-
* console.log(validZone._tag === "Some") // true
|
|
1085
|
+
* ```ts import.meta.vitest
|
|
1086
|
+
* import { DateTime, Option } from "effect"
|
|
1111
1087
|
*
|
|
1112
|
-
*
|
|
1113
|
-
*
|
|
1088
|
+
* DateTime.zoneMakeNamed("Europe/London").pipe(Option.map(DateTime.zoneToString)) // => Option.some("Europe/London")
|
|
1089
|
+
* DateTime.zoneMakeNamed("Invalid/Zone") // => Option.none()
|
|
1114
1090
|
* ```
|
|
1115
1091
|
*
|
|
1116
|
-
* @category
|
|
1092
|
+
* @category constructors
|
|
1117
1093
|
* @since 3.6.0
|
|
1118
1094
|
*/
|
|
1119
1095
|
export declare const zoneMakeNamed: (zoneId: string) => Option.Option<TimeZone.Named>;
|
|
@@ -1127,7 +1103,7 @@ export declare const zoneMakeNamed: (zoneId: string) => Option.Option<TimeZone.N
|
|
|
1127
1103
|
*
|
|
1128
1104
|
* **Example** (Creating named time zones effectfully)
|
|
1129
1105
|
*
|
|
1130
|
-
* ```ts
|
|
1106
|
+
* ```ts import.meta.vitest
|
|
1131
1107
|
* import { DateTime, Effect } from "effect"
|
|
1132
1108
|
*
|
|
1133
1109
|
* const program = Effect.gen(function*() {
|
|
@@ -1135,9 +1111,11 @@ export declare const zoneMakeNamed: (zoneId: string) => Option.Option<TimeZone.N
|
|
|
1135
1111
|
* const now = yield* DateTime.now
|
|
1136
1112
|
* return DateTime.setZone(now, zone)
|
|
1137
1113
|
* })
|
|
1114
|
+
*
|
|
1115
|
+
* DateTime.zoneToString((await Effect.runPromise(program)).zone) // => "Europe/London"
|
|
1138
1116
|
* ```
|
|
1139
1117
|
*
|
|
1140
|
-
* @category
|
|
1118
|
+
* @category constructors
|
|
1141
1119
|
* @since 3.6.0
|
|
1142
1120
|
*/
|
|
1143
1121
|
export declare const zoneMakeNamedEffect: (zoneId: string) => Effect.Effect<TimeZone.Named, IllegalArgumentError>;
|
|
@@ -1151,14 +1129,13 @@ export declare const zoneMakeNamedEffect: (zoneId: string) => Effect.Effect<Time
|
|
|
1151
1129
|
*
|
|
1152
1130
|
* **Example** (Creating local time zones)
|
|
1153
1131
|
*
|
|
1154
|
-
* ```ts
|
|
1132
|
+
* ```ts import.meta.vitest
|
|
1155
1133
|
* import { DateTime } from "effect"
|
|
1156
1134
|
*
|
|
1157
|
-
*
|
|
1158
|
-
* console.log(DateTime.zoneToString(localZone)) // Output depends on system time zone
|
|
1135
|
+
* DateTime.isTimeZoneNamed(DateTime.zoneMakeLocal()) // => true
|
|
1159
1136
|
* ```
|
|
1160
1137
|
*
|
|
1161
|
-
* @category
|
|
1138
|
+
* @category constructors
|
|
1162
1139
|
* @since 3.6.0
|
|
1163
1140
|
*/
|
|
1164
1141
|
export declare const zoneMakeLocal: () => TimeZone.Named;
|
|
@@ -1171,19 +1148,15 @@ export declare const zoneMakeLocal: () => TimeZone.Named;
|
|
|
1171
1148
|
*
|
|
1172
1149
|
* **Example** (Parsing time zones)
|
|
1173
1150
|
*
|
|
1174
|
-
* ```ts
|
|
1175
|
-
* import { DateTime } from "effect"
|
|
1151
|
+
* ```ts import.meta.vitest
|
|
1152
|
+
* import { DateTime, Option } from "effect"
|
|
1176
1153
|
*
|
|
1177
|
-
*
|
|
1178
|
-
*
|
|
1179
|
-
*
|
|
1180
|
-
*
|
|
1181
|
-
* console.log(namedZone._tag === "Some") // true
|
|
1182
|
-
* console.log(offsetZone._tag === "Some") // true
|
|
1183
|
-
* console.log(invalid._tag === "None") // true
|
|
1154
|
+
* DateTime.zoneFromString("Europe/London").pipe(Option.map(DateTime.zoneToString)) // => Option.some("Europe/London")
|
|
1155
|
+
* DateTime.zoneFromString("+03:00").pipe(Option.map(DateTime.zoneToString)) // => Option.some("+03:00")
|
|
1156
|
+
* DateTime.zoneFromString("invalid") // => Option.none()
|
|
1184
1157
|
* ```
|
|
1185
1158
|
*
|
|
1186
|
-
* @category
|
|
1159
|
+
* @category decoding
|
|
1187
1160
|
* @since 3.6.0
|
|
1188
1161
|
*/
|
|
1189
1162
|
export declare const zoneFromString: (zone: string) => Option.Option<TimeZone>;
|
|
@@ -1192,17 +1165,14 @@ export declare const zoneFromString: (zone: string) => Option.Option<TimeZone>;
|
|
|
1192
1165
|
*
|
|
1193
1166
|
* **Example** (Formatting time zones)
|
|
1194
1167
|
*
|
|
1195
|
-
* ```ts
|
|
1168
|
+
* ```ts import.meta.vitest
|
|
1196
1169
|
* import { DateTime } from "effect"
|
|
1197
1170
|
*
|
|
1198
|
-
* //
|
|
1199
|
-
* DateTime.zoneToString(DateTime.
|
|
1200
|
-
*
|
|
1201
|
-
* // Outputs "Europe/London"
|
|
1202
|
-
* DateTime.zoneToString(DateTime.zoneMakeNamedUnsafe("Europe/London"))
|
|
1171
|
+
* DateTime.zoneToString(DateTime.zoneMakeOffset(3 * 60 * 60 * 1000)) // => "+03:00"
|
|
1172
|
+
* DateTime.zoneToString(DateTime.zoneMakeNamedUnsafe("Europe/London")) // => "Europe/London"
|
|
1203
1173
|
* ```
|
|
1204
1174
|
*
|
|
1205
|
-
* @category
|
|
1175
|
+
* @category encoding
|
|
1206
1176
|
* @since 3.6.0
|
|
1207
1177
|
*/
|
|
1208
1178
|
export declare const zoneToString: (self: TimeZone) => string;
|
|
@@ -1212,17 +1182,16 @@ export declare const zoneToString: (self: TimeZone) => string;
|
|
|
1212
1182
|
*
|
|
1213
1183
|
* **Example** (Setting named time zones safely)
|
|
1214
1184
|
*
|
|
1215
|
-
* ```ts
|
|
1216
|
-
* import { DateTime,
|
|
1185
|
+
* ```ts import.meta.vitest
|
|
1186
|
+
* import { DateTime, Option } from "effect"
|
|
1217
1187
|
*
|
|
1218
|
-
*
|
|
1219
|
-
*
|
|
1220
|
-
*
|
|
1221
|
-
*
|
|
1222
|
-
* })
|
|
1188
|
+
* const dateTime = DateTime.makeUnsafe("2024-01-01")
|
|
1189
|
+
* const result = DateTime.setZoneNamed(dateTime, "Europe/London").pipe(Option.map(DateTime.formatIsoZoned))
|
|
1190
|
+
*
|
|
1191
|
+
* result // => Option.some("2024-01-01T00:00:00.000+00:00[Europe/London]")
|
|
1223
1192
|
* ```
|
|
1224
1193
|
*
|
|
1225
|
-
* @category
|
|
1194
|
+
* @category transforming
|
|
1226
1195
|
* @since 3.6.0
|
|
1227
1196
|
*/
|
|
1228
1197
|
export declare const setZoneNamed: {
|
|
@@ -1232,17 +1201,16 @@ export declare const setZoneNamed: {
|
|
|
1232
1201
|
*
|
|
1233
1202
|
* **Example** (Setting named time zones safely)
|
|
1234
1203
|
*
|
|
1235
|
-
* ```ts
|
|
1236
|
-
* import { DateTime,
|
|
1204
|
+
* ```ts import.meta.vitest
|
|
1205
|
+
* import { DateTime, Option } from "effect"
|
|
1237
1206
|
*
|
|
1238
|
-
*
|
|
1239
|
-
*
|
|
1240
|
-
*
|
|
1241
|
-
*
|
|
1242
|
-
* })
|
|
1207
|
+
* const dateTime = DateTime.makeUnsafe("2024-01-01")
|
|
1208
|
+
* const result = DateTime.setZoneNamed(dateTime, "Europe/London").pipe(Option.map(DateTime.formatIsoZoned))
|
|
1209
|
+
*
|
|
1210
|
+
* result // => Option.some("2024-01-01T00:00:00.000+00:00[Europe/London]")
|
|
1243
1211
|
* ```
|
|
1244
1212
|
*
|
|
1245
|
-
* @category
|
|
1213
|
+
* @category transforming
|
|
1246
1214
|
* @since 3.6.0
|
|
1247
1215
|
*/
|
|
1248
1216
|
(zoneId: string, options?: {
|
|
@@ -1255,17 +1223,16 @@ export declare const setZoneNamed: {
|
|
|
1255
1223
|
*
|
|
1256
1224
|
* **Example** (Setting named time zones safely)
|
|
1257
1225
|
*
|
|
1258
|
-
* ```ts
|
|
1259
|
-
* import { DateTime,
|
|
1226
|
+
* ```ts import.meta.vitest
|
|
1227
|
+
* import { DateTime, Option } from "effect"
|
|
1260
1228
|
*
|
|
1261
|
-
*
|
|
1262
|
-
*
|
|
1263
|
-
*
|
|
1264
|
-
*
|
|
1265
|
-
* })
|
|
1229
|
+
* const dateTime = DateTime.makeUnsafe("2024-01-01")
|
|
1230
|
+
* const result = DateTime.setZoneNamed(dateTime, "Europe/London").pipe(Option.map(DateTime.formatIsoZoned))
|
|
1231
|
+
*
|
|
1232
|
+
* result // => Option.some("2024-01-01T00:00:00.000+00:00[Europe/London]")
|
|
1266
1233
|
* ```
|
|
1267
1234
|
*
|
|
1268
|
-
* @category
|
|
1235
|
+
* @category transforming
|
|
1269
1236
|
* @since 3.6.0
|
|
1270
1237
|
*/
|
|
1271
1238
|
(self: DateTime, zoneId: string, options?: {
|
|
@@ -1279,17 +1246,16 @@ export declare const setZoneNamed: {
|
|
|
1279
1246
|
*
|
|
1280
1247
|
* **Example** (Setting named time zones unsafely)
|
|
1281
1248
|
*
|
|
1282
|
-
* ```ts
|
|
1283
|
-
* import { DateTime
|
|
1249
|
+
* ```ts import.meta.vitest
|
|
1250
|
+
* import { DateTime } from "effect"
|
|
1284
1251
|
*
|
|
1285
|
-
*
|
|
1286
|
-
*
|
|
1287
|
-
*
|
|
1288
|
-
*
|
|
1289
|
-
* })
|
|
1252
|
+
* const dateTime = DateTime.makeUnsafe("2024-01-01")
|
|
1253
|
+
* const zoned = DateTime.setZoneNamedUnsafe(dateTime, "Europe/London")
|
|
1254
|
+
*
|
|
1255
|
+
* DateTime.zoneToString(zoned.zone) // => "Europe/London"
|
|
1290
1256
|
* ```
|
|
1291
1257
|
*
|
|
1292
|
-
* @category
|
|
1258
|
+
* @category transforming
|
|
1293
1259
|
* @since 4.0.0
|
|
1294
1260
|
*/
|
|
1295
1261
|
export declare const setZoneNamedUnsafe: {
|
|
@@ -1299,17 +1265,16 @@ export declare const setZoneNamedUnsafe: {
|
|
|
1299
1265
|
*
|
|
1300
1266
|
* **Example** (Setting named time zones unsafely)
|
|
1301
1267
|
*
|
|
1302
|
-
* ```ts
|
|
1303
|
-
* import { DateTime
|
|
1268
|
+
* ```ts import.meta.vitest
|
|
1269
|
+
* import { DateTime } from "effect"
|
|
1304
1270
|
*
|
|
1305
|
-
*
|
|
1306
|
-
*
|
|
1307
|
-
*
|
|
1308
|
-
*
|
|
1309
|
-
* })
|
|
1271
|
+
* const dateTime = DateTime.makeUnsafe("2024-01-01")
|
|
1272
|
+
* const zoned = DateTime.setZoneNamedUnsafe(dateTime, "Europe/London")
|
|
1273
|
+
*
|
|
1274
|
+
* DateTime.zoneToString(zoned.zone) // => "Europe/London"
|
|
1310
1275
|
* ```
|
|
1311
1276
|
*
|
|
1312
|
-
* @category
|
|
1277
|
+
* @category transforming
|
|
1313
1278
|
* @since 4.0.0
|
|
1314
1279
|
*/
|
|
1315
1280
|
(zoneId: string, options?: {
|
|
@@ -1322,17 +1287,16 @@ export declare const setZoneNamedUnsafe: {
|
|
|
1322
1287
|
*
|
|
1323
1288
|
* **Example** (Setting named time zones unsafely)
|
|
1324
1289
|
*
|
|
1325
|
-
* ```ts
|
|
1326
|
-
* import { DateTime
|
|
1290
|
+
* ```ts import.meta.vitest
|
|
1291
|
+
* import { DateTime } from "effect"
|
|
1327
1292
|
*
|
|
1328
|
-
*
|
|
1329
|
-
*
|
|
1330
|
-
*
|
|
1331
|
-
*
|
|
1332
|
-
* })
|
|
1293
|
+
* const dateTime = DateTime.makeUnsafe("2024-01-01")
|
|
1294
|
+
* const zoned = DateTime.setZoneNamedUnsafe(dateTime, "Europe/London")
|
|
1295
|
+
*
|
|
1296
|
+
* DateTime.zoneToString(zoned.zone) // => "Europe/London"
|
|
1333
1297
|
* ```
|
|
1334
1298
|
*
|
|
1335
|
-
* @category
|
|
1299
|
+
* @category transforming
|
|
1336
1300
|
* @since 4.0.0
|
|
1337
1301
|
*/
|
|
1338
1302
|
(self: DateTime, zoneId: string, options?: {
|
|
@@ -1352,16 +1316,13 @@ export declare const setZoneNamedUnsafe: {
|
|
|
1352
1316
|
*
|
|
1353
1317
|
* **Example** (Measuring distance between DateTime values)
|
|
1354
1318
|
*
|
|
1355
|
-
* ```ts
|
|
1356
|
-
* import { DateTime,
|
|
1319
|
+
* ```ts import.meta.vitest
|
|
1320
|
+
* import { DateTime, Duration } from "effect"
|
|
1357
1321
|
*
|
|
1358
|
-
*
|
|
1359
|
-
*
|
|
1360
|
-
* const other = DateTime.add(now, { minutes: 1 })
|
|
1322
|
+
* const start = DateTime.makeUnsafe("2024-01-01T00:00:00Z")
|
|
1323
|
+
* const end = DateTime.add(start, { minutes: 1 })
|
|
1361
1324
|
*
|
|
1362
|
-
*
|
|
1363
|
-
* DateTime.distance(now, other)
|
|
1364
|
-
* })
|
|
1325
|
+
* DateTime.distance(start, end) // => Duration.minutes(1)
|
|
1365
1326
|
* ```
|
|
1366
1327
|
*
|
|
1367
1328
|
* @category comparisons
|
|
@@ -1380,16 +1341,13 @@ export declare const distance: {
|
|
|
1380
1341
|
*
|
|
1381
1342
|
* **Example** (Measuring distance between DateTime values)
|
|
1382
1343
|
*
|
|
1383
|
-
* ```ts
|
|
1384
|
-
* import { DateTime,
|
|
1344
|
+
* ```ts import.meta.vitest
|
|
1345
|
+
* import { DateTime, Duration } from "effect"
|
|
1385
1346
|
*
|
|
1386
|
-
*
|
|
1387
|
-
*
|
|
1388
|
-
* const other = DateTime.add(now, { minutes: 1 })
|
|
1347
|
+
* const start = DateTime.makeUnsafe("2024-01-01T00:00:00Z")
|
|
1348
|
+
* const end = DateTime.add(start, { minutes: 1 })
|
|
1389
1349
|
*
|
|
1390
|
-
*
|
|
1391
|
-
* DateTime.distance(now, other)
|
|
1392
|
-
* })
|
|
1350
|
+
* DateTime.distance(start, end) // => Duration.minutes(1)
|
|
1393
1351
|
* ```
|
|
1394
1352
|
*
|
|
1395
1353
|
* @category comparisons
|
|
@@ -1408,16 +1366,13 @@ export declare const distance: {
|
|
|
1408
1366
|
*
|
|
1409
1367
|
* **Example** (Measuring distance between DateTime values)
|
|
1410
1368
|
*
|
|
1411
|
-
* ```ts
|
|
1412
|
-
* import { DateTime,
|
|
1369
|
+
* ```ts import.meta.vitest
|
|
1370
|
+
* import { DateTime, Duration } from "effect"
|
|
1413
1371
|
*
|
|
1414
|
-
*
|
|
1415
|
-
*
|
|
1416
|
-
* const other = DateTime.add(now, { minutes: 1 })
|
|
1372
|
+
* const start = DateTime.makeUnsafe("2024-01-01T00:00:00Z")
|
|
1373
|
+
* const end = DateTime.add(start, { minutes: 1 })
|
|
1417
1374
|
*
|
|
1418
|
-
*
|
|
1419
|
-
* DateTime.distance(now, other)
|
|
1420
|
-
* })
|
|
1375
|
+
* DateTime.distance(start, end) // => Duration.minutes(1)
|
|
1421
1376
|
* ```
|
|
1422
1377
|
*
|
|
1423
1378
|
* @category comparisons
|
|
@@ -1430,14 +1385,13 @@ export declare const distance: {
|
|
|
1430
1385
|
*
|
|
1431
1386
|
* **Example** (Selecting the earlier DateTime)
|
|
1432
1387
|
*
|
|
1433
|
-
* ```ts
|
|
1388
|
+
* ```ts import.meta.vitest
|
|
1434
1389
|
* import { DateTime } from "effect"
|
|
1435
1390
|
*
|
|
1436
1391
|
* const date1 = DateTime.makeUnsafe("2024-01-01")
|
|
1437
1392
|
* const date2 = DateTime.makeUnsafe("2024-02-01")
|
|
1438
1393
|
*
|
|
1439
|
-
*
|
|
1440
|
-
* // earlier equals date1 (2024-01-01)
|
|
1394
|
+
* DateTime.min(date1, date2) // => DateTime.makeUnsafe("2024-01-01")
|
|
1441
1395
|
* ```
|
|
1442
1396
|
*
|
|
1443
1397
|
* @category comparisons
|
|
@@ -1449,14 +1403,13 @@ export declare const min: {
|
|
|
1449
1403
|
*
|
|
1450
1404
|
* **Example** (Selecting the earlier DateTime)
|
|
1451
1405
|
*
|
|
1452
|
-
* ```ts
|
|
1406
|
+
* ```ts import.meta.vitest
|
|
1453
1407
|
* import { DateTime } from "effect"
|
|
1454
1408
|
*
|
|
1455
1409
|
* const date1 = DateTime.makeUnsafe("2024-01-01")
|
|
1456
1410
|
* const date2 = DateTime.makeUnsafe("2024-02-01")
|
|
1457
1411
|
*
|
|
1458
|
-
*
|
|
1459
|
-
* // earlier equals date1 (2024-01-01)
|
|
1412
|
+
* DateTime.min(date1, date2) // => DateTime.makeUnsafe("2024-01-01")
|
|
1460
1413
|
* ```
|
|
1461
1414
|
*
|
|
1462
1415
|
* @category comparisons
|
|
@@ -1468,14 +1421,13 @@ export declare const min: {
|
|
|
1468
1421
|
*
|
|
1469
1422
|
* **Example** (Selecting the earlier DateTime)
|
|
1470
1423
|
*
|
|
1471
|
-
* ```ts
|
|
1424
|
+
* ```ts import.meta.vitest
|
|
1472
1425
|
* import { DateTime } from "effect"
|
|
1473
1426
|
*
|
|
1474
1427
|
* const date1 = DateTime.makeUnsafe("2024-01-01")
|
|
1475
1428
|
* const date2 = DateTime.makeUnsafe("2024-02-01")
|
|
1476
1429
|
*
|
|
1477
|
-
*
|
|
1478
|
-
* // earlier equals date1 (2024-01-01)
|
|
1430
|
+
* DateTime.min(date1, date2) // => DateTime.makeUnsafe("2024-01-01")
|
|
1479
1431
|
* ```
|
|
1480
1432
|
*
|
|
1481
1433
|
* @category comparisons
|
|
@@ -1488,14 +1440,13 @@ export declare const min: {
|
|
|
1488
1440
|
*
|
|
1489
1441
|
* **Example** (Selecting the later DateTime)
|
|
1490
1442
|
*
|
|
1491
|
-
* ```ts
|
|
1443
|
+
* ```ts import.meta.vitest
|
|
1492
1444
|
* import { DateTime } from "effect"
|
|
1493
1445
|
*
|
|
1494
1446
|
* const date1 = DateTime.makeUnsafe("2024-01-01")
|
|
1495
1447
|
* const date2 = DateTime.makeUnsafe("2024-02-01")
|
|
1496
1448
|
*
|
|
1497
|
-
*
|
|
1498
|
-
* // later equals date2 (2024-02-01)
|
|
1449
|
+
* DateTime.max(date1, date2) // => DateTime.makeUnsafe("2024-02-01")
|
|
1499
1450
|
* ```
|
|
1500
1451
|
*
|
|
1501
1452
|
* @category comparisons
|
|
@@ -1507,14 +1458,13 @@ export declare const max: {
|
|
|
1507
1458
|
*
|
|
1508
1459
|
* **Example** (Selecting the later DateTime)
|
|
1509
1460
|
*
|
|
1510
|
-
* ```ts
|
|
1461
|
+
* ```ts import.meta.vitest
|
|
1511
1462
|
* import { DateTime } from "effect"
|
|
1512
1463
|
*
|
|
1513
1464
|
* const date1 = DateTime.makeUnsafe("2024-01-01")
|
|
1514
1465
|
* const date2 = DateTime.makeUnsafe("2024-02-01")
|
|
1515
1466
|
*
|
|
1516
|
-
*
|
|
1517
|
-
* // later equals date2 (2024-02-01)
|
|
1467
|
+
* DateTime.max(date1, date2) // => DateTime.makeUnsafe("2024-02-01")
|
|
1518
1468
|
* ```
|
|
1519
1469
|
*
|
|
1520
1470
|
* @category comparisons
|
|
@@ -1526,14 +1476,13 @@ export declare const max: {
|
|
|
1526
1476
|
*
|
|
1527
1477
|
* **Example** (Selecting the later DateTime)
|
|
1528
1478
|
*
|
|
1529
|
-
* ```ts
|
|
1479
|
+
* ```ts import.meta.vitest
|
|
1530
1480
|
* import { DateTime } from "effect"
|
|
1531
1481
|
*
|
|
1532
1482
|
* const date1 = DateTime.makeUnsafe("2024-01-01")
|
|
1533
1483
|
* const date2 = DateTime.makeUnsafe("2024-02-01")
|
|
1534
1484
|
*
|
|
1535
|
-
*
|
|
1536
|
-
* // later equals date2 (2024-02-01)
|
|
1485
|
+
* DateTime.max(date1, date2) // => DateTime.makeUnsafe("2024-02-01")
|
|
1537
1486
|
* ```
|
|
1538
1487
|
*
|
|
1539
1488
|
* @category comparisons
|
|
@@ -1546,14 +1495,14 @@ export declare const max: {
|
|
|
1546
1495
|
*
|
|
1547
1496
|
* **Example** (Checking whether a DateTime is later)
|
|
1548
1497
|
*
|
|
1549
|
-
* ```ts
|
|
1498
|
+
* ```ts import.meta.vitest
|
|
1550
1499
|
* import { DateTime } from "effect"
|
|
1551
1500
|
*
|
|
1552
1501
|
* const date1 = DateTime.makeUnsafe("2024-02-01")
|
|
1553
1502
|
* const date2 = DateTime.makeUnsafe("2024-01-01")
|
|
1554
1503
|
*
|
|
1555
|
-
*
|
|
1556
|
-
*
|
|
1504
|
+
* DateTime.isGreaterThan(date1, date2) // => true
|
|
1505
|
+
* DateTime.isGreaterThan(date2, date1) // => false
|
|
1557
1506
|
* ```
|
|
1558
1507
|
*
|
|
1559
1508
|
* @category comparisons
|
|
@@ -1565,14 +1514,14 @@ export declare const isGreaterThan: {
|
|
|
1565
1514
|
*
|
|
1566
1515
|
* **Example** (Checking whether a DateTime is later)
|
|
1567
1516
|
*
|
|
1568
|
-
* ```ts
|
|
1517
|
+
* ```ts import.meta.vitest
|
|
1569
1518
|
* import { DateTime } from "effect"
|
|
1570
1519
|
*
|
|
1571
1520
|
* const date1 = DateTime.makeUnsafe("2024-02-01")
|
|
1572
1521
|
* const date2 = DateTime.makeUnsafe("2024-01-01")
|
|
1573
1522
|
*
|
|
1574
|
-
*
|
|
1575
|
-
*
|
|
1523
|
+
* DateTime.isGreaterThan(date1, date2) // => true
|
|
1524
|
+
* DateTime.isGreaterThan(date2, date1) // => false
|
|
1576
1525
|
* ```
|
|
1577
1526
|
*
|
|
1578
1527
|
* @category comparisons
|
|
@@ -1584,14 +1533,14 @@ export declare const isGreaterThan: {
|
|
|
1584
1533
|
*
|
|
1585
1534
|
* **Example** (Checking whether a DateTime is later)
|
|
1586
1535
|
*
|
|
1587
|
-
* ```ts
|
|
1536
|
+
* ```ts import.meta.vitest
|
|
1588
1537
|
* import { DateTime } from "effect"
|
|
1589
1538
|
*
|
|
1590
1539
|
* const date1 = DateTime.makeUnsafe("2024-02-01")
|
|
1591
1540
|
* const date2 = DateTime.makeUnsafe("2024-01-01")
|
|
1592
1541
|
*
|
|
1593
|
-
*
|
|
1594
|
-
*
|
|
1542
|
+
* DateTime.isGreaterThan(date1, date2) // => true
|
|
1543
|
+
* DateTime.isGreaterThan(date2, date1) // => false
|
|
1595
1544
|
* ```
|
|
1596
1545
|
*
|
|
1597
1546
|
* @category comparisons
|
|
@@ -1604,16 +1553,16 @@ export declare const isGreaterThan: {
|
|
|
1604
1553
|
*
|
|
1605
1554
|
* **Example** (Checking whether a DateTime is later or equal)
|
|
1606
1555
|
*
|
|
1607
|
-
* ```ts
|
|
1556
|
+
* ```ts import.meta.vitest
|
|
1608
1557
|
* import { DateTime } from "effect"
|
|
1609
1558
|
*
|
|
1610
1559
|
* const date1 = DateTime.makeUnsafe("2024-01-01")
|
|
1611
1560
|
* const date2 = DateTime.makeUnsafe("2024-01-01")
|
|
1612
1561
|
* const date3 = DateTime.makeUnsafe("2024-02-01")
|
|
1613
1562
|
*
|
|
1614
|
-
*
|
|
1615
|
-
*
|
|
1616
|
-
*
|
|
1563
|
+
* DateTime.isGreaterThanOrEqualTo(date1, date2) // => true
|
|
1564
|
+
* DateTime.isGreaterThanOrEqualTo(date3, date1) // => true
|
|
1565
|
+
* DateTime.isGreaterThanOrEqualTo(date1, date3) // => false
|
|
1617
1566
|
* ```
|
|
1618
1567
|
*
|
|
1619
1568
|
* @category comparisons
|
|
@@ -1625,16 +1574,16 @@ export declare const isGreaterThanOrEqualTo: {
|
|
|
1625
1574
|
*
|
|
1626
1575
|
* **Example** (Checking whether a DateTime is later or equal)
|
|
1627
1576
|
*
|
|
1628
|
-
* ```ts
|
|
1577
|
+
* ```ts import.meta.vitest
|
|
1629
1578
|
* import { DateTime } from "effect"
|
|
1630
1579
|
*
|
|
1631
1580
|
* const date1 = DateTime.makeUnsafe("2024-01-01")
|
|
1632
1581
|
* const date2 = DateTime.makeUnsafe("2024-01-01")
|
|
1633
1582
|
* const date3 = DateTime.makeUnsafe("2024-02-01")
|
|
1634
1583
|
*
|
|
1635
|
-
*
|
|
1636
|
-
*
|
|
1637
|
-
*
|
|
1584
|
+
* DateTime.isGreaterThanOrEqualTo(date1, date2) // => true
|
|
1585
|
+
* DateTime.isGreaterThanOrEqualTo(date3, date1) // => true
|
|
1586
|
+
* DateTime.isGreaterThanOrEqualTo(date1, date3) // => false
|
|
1638
1587
|
* ```
|
|
1639
1588
|
*
|
|
1640
1589
|
* @category comparisons
|
|
@@ -1646,16 +1595,16 @@ export declare const isGreaterThanOrEqualTo: {
|
|
|
1646
1595
|
*
|
|
1647
1596
|
* **Example** (Checking whether a DateTime is later or equal)
|
|
1648
1597
|
*
|
|
1649
|
-
* ```ts
|
|
1598
|
+
* ```ts import.meta.vitest
|
|
1650
1599
|
* import { DateTime } from "effect"
|
|
1651
1600
|
*
|
|
1652
1601
|
* const date1 = DateTime.makeUnsafe("2024-01-01")
|
|
1653
1602
|
* const date2 = DateTime.makeUnsafe("2024-01-01")
|
|
1654
1603
|
* const date3 = DateTime.makeUnsafe("2024-02-01")
|
|
1655
1604
|
*
|
|
1656
|
-
*
|
|
1657
|
-
*
|
|
1658
|
-
*
|
|
1605
|
+
* DateTime.isGreaterThanOrEqualTo(date1, date2) // => true
|
|
1606
|
+
* DateTime.isGreaterThanOrEqualTo(date3, date1) // => true
|
|
1607
|
+
* DateTime.isGreaterThanOrEqualTo(date1, date3) // => false
|
|
1659
1608
|
* ```
|
|
1660
1609
|
*
|
|
1661
1610
|
* @category comparisons
|
|
@@ -1668,14 +1617,14 @@ export declare const isGreaterThanOrEqualTo: {
|
|
|
1668
1617
|
*
|
|
1669
1618
|
* **Example** (Checking whether a DateTime is earlier)
|
|
1670
1619
|
*
|
|
1671
|
-
* ```ts
|
|
1620
|
+
* ```ts import.meta.vitest
|
|
1672
1621
|
* import { DateTime } from "effect"
|
|
1673
1622
|
*
|
|
1674
1623
|
* const date1 = DateTime.makeUnsafe("2024-01-01")
|
|
1675
1624
|
* const date2 = DateTime.makeUnsafe("2024-02-01")
|
|
1676
1625
|
*
|
|
1677
|
-
*
|
|
1678
|
-
*
|
|
1626
|
+
* DateTime.isLessThan(date1, date2) // => true
|
|
1627
|
+
* DateTime.isLessThan(date2, date1) // => false
|
|
1679
1628
|
* ```
|
|
1680
1629
|
*
|
|
1681
1630
|
* @category comparisons
|
|
@@ -1687,14 +1636,14 @@ export declare const isLessThan: {
|
|
|
1687
1636
|
*
|
|
1688
1637
|
* **Example** (Checking whether a DateTime is earlier)
|
|
1689
1638
|
*
|
|
1690
|
-
* ```ts
|
|
1639
|
+
* ```ts import.meta.vitest
|
|
1691
1640
|
* import { DateTime } from "effect"
|
|
1692
1641
|
*
|
|
1693
1642
|
* const date1 = DateTime.makeUnsafe("2024-01-01")
|
|
1694
1643
|
* const date2 = DateTime.makeUnsafe("2024-02-01")
|
|
1695
1644
|
*
|
|
1696
|
-
*
|
|
1697
|
-
*
|
|
1645
|
+
* DateTime.isLessThan(date1, date2) // => true
|
|
1646
|
+
* DateTime.isLessThan(date2, date1) // => false
|
|
1698
1647
|
* ```
|
|
1699
1648
|
*
|
|
1700
1649
|
* @category comparisons
|
|
@@ -1706,14 +1655,14 @@ export declare const isLessThan: {
|
|
|
1706
1655
|
*
|
|
1707
1656
|
* **Example** (Checking whether a DateTime is earlier)
|
|
1708
1657
|
*
|
|
1709
|
-
* ```ts
|
|
1658
|
+
* ```ts import.meta.vitest
|
|
1710
1659
|
* import { DateTime } from "effect"
|
|
1711
1660
|
*
|
|
1712
1661
|
* const date1 = DateTime.makeUnsafe("2024-01-01")
|
|
1713
1662
|
* const date2 = DateTime.makeUnsafe("2024-02-01")
|
|
1714
1663
|
*
|
|
1715
|
-
*
|
|
1716
|
-
*
|
|
1664
|
+
* DateTime.isLessThan(date1, date2) // => true
|
|
1665
|
+
* DateTime.isLessThan(date2, date1) // => false
|
|
1717
1666
|
* ```
|
|
1718
1667
|
*
|
|
1719
1668
|
* @category comparisons
|
|
@@ -1726,16 +1675,16 @@ export declare const isLessThan: {
|
|
|
1726
1675
|
*
|
|
1727
1676
|
* **Example** (Checking whether a DateTime is earlier or equal)
|
|
1728
1677
|
*
|
|
1729
|
-
* ```ts
|
|
1678
|
+
* ```ts import.meta.vitest
|
|
1730
1679
|
* import { DateTime } from "effect"
|
|
1731
1680
|
*
|
|
1732
1681
|
* const date1 = DateTime.makeUnsafe("2024-01-01")
|
|
1733
1682
|
* const date2 = DateTime.makeUnsafe("2024-01-01")
|
|
1734
1683
|
* const date3 = DateTime.makeUnsafe("2024-02-01")
|
|
1735
1684
|
*
|
|
1736
|
-
*
|
|
1737
|
-
*
|
|
1738
|
-
*
|
|
1685
|
+
* DateTime.isLessThanOrEqualTo(date1, date2) // => true
|
|
1686
|
+
* DateTime.isLessThanOrEqualTo(date1, date3) // => true
|
|
1687
|
+
* DateTime.isLessThanOrEqualTo(date3, date1) // => false
|
|
1739
1688
|
* ```
|
|
1740
1689
|
*
|
|
1741
1690
|
* @category comparisons
|
|
@@ -1747,16 +1696,16 @@ export declare const isLessThanOrEqualTo: {
|
|
|
1747
1696
|
*
|
|
1748
1697
|
* **Example** (Checking whether a DateTime is earlier or equal)
|
|
1749
1698
|
*
|
|
1750
|
-
* ```ts
|
|
1699
|
+
* ```ts import.meta.vitest
|
|
1751
1700
|
* import { DateTime } from "effect"
|
|
1752
1701
|
*
|
|
1753
1702
|
* const date1 = DateTime.makeUnsafe("2024-01-01")
|
|
1754
1703
|
* const date2 = DateTime.makeUnsafe("2024-01-01")
|
|
1755
1704
|
* const date3 = DateTime.makeUnsafe("2024-02-01")
|
|
1756
1705
|
*
|
|
1757
|
-
*
|
|
1758
|
-
*
|
|
1759
|
-
*
|
|
1706
|
+
* DateTime.isLessThanOrEqualTo(date1, date2) // => true
|
|
1707
|
+
* DateTime.isLessThanOrEqualTo(date1, date3) // => true
|
|
1708
|
+
* DateTime.isLessThanOrEqualTo(date3, date1) // => false
|
|
1760
1709
|
* ```
|
|
1761
1710
|
*
|
|
1762
1711
|
* @category comparisons
|
|
@@ -1768,16 +1717,16 @@ export declare const isLessThanOrEqualTo: {
|
|
|
1768
1717
|
*
|
|
1769
1718
|
* **Example** (Checking whether a DateTime is earlier or equal)
|
|
1770
1719
|
*
|
|
1771
|
-
* ```ts
|
|
1720
|
+
* ```ts import.meta.vitest
|
|
1772
1721
|
* import { DateTime } from "effect"
|
|
1773
1722
|
*
|
|
1774
1723
|
* const date1 = DateTime.makeUnsafe("2024-01-01")
|
|
1775
1724
|
* const date2 = DateTime.makeUnsafe("2024-01-01")
|
|
1776
1725
|
* const date3 = DateTime.makeUnsafe("2024-02-01")
|
|
1777
1726
|
*
|
|
1778
|
-
*
|
|
1779
|
-
*
|
|
1780
|
-
*
|
|
1727
|
+
* DateTime.isLessThanOrEqualTo(date1, date2) // => true
|
|
1728
|
+
* DateTime.isLessThanOrEqualTo(date1, date3) // => true
|
|
1729
|
+
* DateTime.isLessThanOrEqualTo(date3, date1) // => false
|
|
1781
1730
|
* ```
|
|
1782
1731
|
*
|
|
1783
1732
|
* @category comparisons
|
|
@@ -1790,14 +1739,14 @@ export declare const isLessThanOrEqualTo: {
|
|
|
1790
1739
|
*
|
|
1791
1740
|
* **Example** (Checking whether a DateTime is within bounds)
|
|
1792
1741
|
*
|
|
1793
|
-
* ```ts
|
|
1742
|
+
* ```ts import.meta.vitest
|
|
1794
1743
|
* import { DateTime } from "effect"
|
|
1795
1744
|
*
|
|
1796
1745
|
* const min = DateTime.makeUnsafe("2024-01-01")
|
|
1797
1746
|
* const max = DateTime.makeUnsafe("2024-12-31")
|
|
1798
1747
|
* const date = DateTime.makeUnsafe("2024-06-15")
|
|
1799
1748
|
*
|
|
1800
|
-
*
|
|
1749
|
+
* DateTime.between(date, { minimum: min, maximum: max }) // => true
|
|
1801
1750
|
* ```
|
|
1802
1751
|
*
|
|
1803
1752
|
* @category comparisons
|
|
@@ -1809,14 +1758,14 @@ export declare const between: {
|
|
|
1809
1758
|
*
|
|
1810
1759
|
* **Example** (Checking whether a DateTime is within bounds)
|
|
1811
1760
|
*
|
|
1812
|
-
* ```ts
|
|
1761
|
+
* ```ts import.meta.vitest
|
|
1813
1762
|
* import { DateTime } from "effect"
|
|
1814
1763
|
*
|
|
1815
1764
|
* const min = DateTime.makeUnsafe("2024-01-01")
|
|
1816
1765
|
* const max = DateTime.makeUnsafe("2024-12-31")
|
|
1817
1766
|
* const date = DateTime.makeUnsafe("2024-06-15")
|
|
1818
1767
|
*
|
|
1819
|
-
*
|
|
1768
|
+
* DateTime.between(date, { minimum: min, maximum: max }) // => true
|
|
1820
1769
|
* ```
|
|
1821
1770
|
*
|
|
1822
1771
|
* @category comparisons
|
|
@@ -1831,14 +1780,14 @@ export declare const between: {
|
|
|
1831
1780
|
*
|
|
1832
1781
|
* **Example** (Checking whether a DateTime is within bounds)
|
|
1833
1782
|
*
|
|
1834
|
-
* ```ts
|
|
1783
|
+
* ```ts import.meta.vitest
|
|
1835
1784
|
* import { DateTime } from "effect"
|
|
1836
1785
|
*
|
|
1837
1786
|
* const min = DateTime.makeUnsafe("2024-01-01")
|
|
1838
1787
|
* const max = DateTime.makeUnsafe("2024-12-31")
|
|
1839
1788
|
* const date = DateTime.makeUnsafe("2024-06-15")
|
|
1840
1789
|
*
|
|
1841
|
-
*
|
|
1790
|
+
* DateTime.between(date, { minimum: min, maximum: max }) // => true
|
|
1842
1791
|
* ```
|
|
1843
1792
|
*
|
|
1844
1793
|
* @category comparisons
|
|
@@ -1858,14 +1807,12 @@ export declare const between: {
|
|
|
1858
1807
|
*
|
|
1859
1808
|
* **Example** (Checking future DateTime values effectfully)
|
|
1860
1809
|
*
|
|
1861
|
-
* ```ts
|
|
1810
|
+
* ```ts import.meta.vitest
|
|
1862
1811
|
* import { DateTime, Effect } from "effect"
|
|
1812
|
+
* import { TestClock } from "effect/testing"
|
|
1863
1813
|
*
|
|
1864
|
-
* const
|
|
1865
|
-
*
|
|
1866
|
-
* const isFuture = yield* DateTime.isFuture(futureDate)
|
|
1867
|
-
* console.log(isFuture) // true
|
|
1868
|
-
* })
|
|
1814
|
+
* const futureDate = DateTime.makeUnsafe(1)
|
|
1815
|
+
* await Effect.runPromise(Effect.provide(DateTime.isFuture(futureDate), TestClock.layer())) // => true
|
|
1869
1816
|
* ```
|
|
1870
1817
|
*
|
|
1871
1818
|
* @category comparisons
|
|
@@ -1889,11 +1836,8 @@ export declare const isFuture: (self: DateTime) => Effect.Effect<boolean>;
|
|
|
1889
1836
|
* ```ts
|
|
1890
1837
|
* import { DateTime } from "effect"
|
|
1891
1838
|
*
|
|
1892
|
-
* const
|
|
1893
|
-
*
|
|
1894
|
-
*
|
|
1895
|
-
* console.log(DateTime.isFutureUnsafe(futureDate)) // true
|
|
1896
|
-
* console.log(DateTime.isFutureUnsafe(now)) // false
|
|
1839
|
+
* const oneHourFromNow = DateTime.add(DateTime.nowUnsafe(), { hours: 1 })
|
|
1840
|
+
* DateTime.isFutureUnsafe(oneHourFromNow)
|
|
1897
1841
|
* ```
|
|
1898
1842
|
*
|
|
1899
1843
|
* @category comparisons
|
|
@@ -1909,14 +1853,12 @@ export declare const isFutureUnsafe: (self: DateTime) => boolean;
|
|
|
1909
1853
|
*
|
|
1910
1854
|
* **Example** (Checking past DateTime values effectfully)
|
|
1911
1855
|
*
|
|
1912
|
-
* ```ts
|
|
1856
|
+
* ```ts import.meta.vitest
|
|
1913
1857
|
* import { DateTime, Effect } from "effect"
|
|
1858
|
+
* import { TestClock } from "effect/testing"
|
|
1914
1859
|
*
|
|
1915
|
-
* const
|
|
1916
|
-
*
|
|
1917
|
-
* const isPast = yield* DateTime.isPast(pastDate)
|
|
1918
|
-
* console.log(isPast) // true
|
|
1919
|
-
* })
|
|
1860
|
+
* const pastDate = DateTime.makeUnsafe(-1)
|
|
1861
|
+
* await Effect.runPromise(Effect.provide(DateTime.isPast(pastDate), TestClock.layer())) // => true
|
|
1920
1862
|
* ```
|
|
1921
1863
|
*
|
|
1922
1864
|
* @category comparisons
|
|
@@ -1940,11 +1882,8 @@ export declare const isPast: (self: DateTime) => Effect.Effect<boolean>;
|
|
|
1940
1882
|
* ```ts
|
|
1941
1883
|
* import { DateTime } from "effect"
|
|
1942
1884
|
*
|
|
1943
|
-
* const
|
|
1944
|
-
*
|
|
1945
|
-
*
|
|
1946
|
-
* console.log(DateTime.isPastUnsafe(pastDate)) // true
|
|
1947
|
-
* console.log(DateTime.isPastUnsafe(now)) // false
|
|
1885
|
+
* const oneHourAgo = DateTime.subtract(DateTime.nowUnsafe(), { hours: 1 })
|
|
1886
|
+
* DateTime.isPastUnsafe(oneHourAgo)
|
|
1948
1887
|
* ```
|
|
1949
1888
|
*
|
|
1950
1889
|
* @category comparisons
|
|
@@ -1960,15 +1899,14 @@ export declare const isPastUnsafe: (self: DateTime) => boolean;
|
|
|
1960
1899
|
*
|
|
1961
1900
|
* **Example** (Converting DateTime values to UTC Dates)
|
|
1962
1901
|
*
|
|
1963
|
-
* ```ts
|
|
1902
|
+
* ```ts import.meta.vitest
|
|
1964
1903
|
* import { DateTime } from "effect"
|
|
1965
1904
|
*
|
|
1966
1905
|
* const dt = DateTime.makeZonedUnsafe("2024-01-01T12:00:00Z", {
|
|
1967
1906
|
* timeZone: "Europe/London"
|
|
1968
1907
|
* })
|
|
1969
1908
|
*
|
|
1970
|
-
*
|
|
1971
|
-
* console.log(utcDate.toISOString()) // "2024-01-01T12:00:00.000Z"
|
|
1909
|
+
* DateTime.toDateUtc(dt).toISOString() // => "2024-01-01T12:00:00.000Z"
|
|
1972
1910
|
* ```
|
|
1973
1911
|
*
|
|
1974
1912
|
* @category converting
|
|
@@ -1985,7 +1923,7 @@ export declare const toDateUtc: (self: DateTime) => Date;
|
|
|
1985
1923
|
*
|
|
1986
1924
|
* **Example** (Converting DateTime values to Dates)
|
|
1987
1925
|
*
|
|
1988
|
-
* ```ts
|
|
1926
|
+
* ```ts import.meta.vitest
|
|
1989
1927
|
* import { DateTime } from "effect"
|
|
1990
1928
|
*
|
|
1991
1929
|
* const utc = DateTime.makeUnsafe("2024-01-01T12:00:00Z")
|
|
@@ -1993,8 +1931,8 @@ export declare const toDateUtc: (self: DateTime) => Date;
|
|
|
1993
1931
|
* timeZone: "Europe/London"
|
|
1994
1932
|
* })
|
|
1995
1933
|
*
|
|
1996
|
-
*
|
|
1997
|
-
*
|
|
1934
|
+
* DateTime.toDate(utc).toISOString() // => "2024-01-01T12:00:00.000Z"
|
|
1935
|
+
* DateTime.toDate(zoned).toISOString() // => "2024-01-01T12:00:00.000Z"
|
|
1998
1936
|
* ```
|
|
1999
1937
|
*
|
|
2000
1938
|
* @category converting
|
|
@@ -2011,15 +1949,14 @@ export declare const toDate: (self: DateTime) => Date;
|
|
|
2011
1949
|
*
|
|
2012
1950
|
* **Example** (Reading zoned offsets)
|
|
2013
1951
|
*
|
|
2014
|
-
* ```ts
|
|
1952
|
+
* ```ts import.meta.vitest
|
|
2015
1953
|
* import { DateTime } from "effect"
|
|
2016
1954
|
*
|
|
2017
1955
|
* const zoned = DateTime.makeZonedUnsafe("2024-01-01T12:00:00Z", {
|
|
2018
1956
|
* timeZone: "Europe/London"
|
|
2019
1957
|
* })
|
|
2020
1958
|
*
|
|
2021
|
-
*
|
|
2022
|
-
* console.log(offset) // 0 (London is UTC+0 in winter)
|
|
1959
|
+
* DateTime.zonedOffset(zoned) // => 0
|
|
2023
1960
|
* ```
|
|
2024
1961
|
*
|
|
2025
1962
|
* @category converting
|
|
@@ -2035,15 +1972,14 @@ export declare const zonedOffset: (self: Zoned) => number;
|
|
|
2035
1972
|
*
|
|
2036
1973
|
* **Example** (Formatting zoned offsets)
|
|
2037
1974
|
*
|
|
2038
|
-
* ```ts
|
|
1975
|
+
* ```ts import.meta.vitest
|
|
2039
1976
|
* import { DateTime } from "effect"
|
|
2040
1977
|
*
|
|
2041
1978
|
* const zoned = DateTime.makeZonedUnsafe("2024-01-01T12:00:00Z", {
|
|
2042
1979
|
* timeZone: DateTime.zoneMakeOffset(3 * 60 * 60 * 1000) // +3 hours
|
|
2043
1980
|
* })
|
|
2044
1981
|
*
|
|
2045
|
-
*
|
|
2046
|
-
* console.log(offsetString) // "+03:00"
|
|
1982
|
+
* DateTime.zonedOffsetIso(zoned) // => "+03:00"
|
|
2047
1983
|
* ```
|
|
2048
1984
|
*
|
|
2049
1985
|
* @category converting
|
|
@@ -2059,26 +1995,45 @@ export declare const zonedOffsetIso: (self: Zoned) => string;
|
|
|
2059
1995
|
*
|
|
2060
1996
|
* **Example** (Reading epoch milliseconds)
|
|
2061
1997
|
*
|
|
2062
|
-
* ```ts
|
|
1998
|
+
* ```ts import.meta.vitest
|
|
2063
1999
|
* import { DateTime } from "effect"
|
|
2064
2000
|
*
|
|
2065
2001
|
* const dt = DateTime.makeUnsafe("2024-01-01T00:00:00Z")
|
|
2066
|
-
*
|
|
2067
|
-
*
|
|
2068
|
-
* console.log(epochMillis) // 1704067200000
|
|
2002
|
+
* DateTime.toEpochMillis(dt) // => 1704067200000
|
|
2069
2003
|
* ```
|
|
2070
2004
|
*
|
|
2071
2005
|
* @category converting
|
|
2072
2006
|
* @since 3.6.0
|
|
2073
2007
|
*/
|
|
2074
2008
|
export declare const toEpochMillis: (self: DateTime) => number;
|
|
2009
|
+
/**
|
|
2010
|
+
* Converts a `DateTime` to the number of seconds since the Unix epoch.
|
|
2011
|
+
*
|
|
2012
|
+
* **Details**
|
|
2013
|
+
*
|
|
2014
|
+
* This returns the UTC timestamp regardless of any time zone information.
|
|
2015
|
+
* The result is floored to the nearest second.
|
|
2016
|
+
*
|
|
2017
|
+
* **Example** (Reading epoch seconds)
|
|
2018
|
+
*
|
|
2019
|
+
* ```ts import.meta.vitest
|
|
2020
|
+
* import { DateTime } from "effect"
|
|
2021
|
+
*
|
|
2022
|
+
* const dt = DateTime.makeUnsafe("2024-01-01T00:00:00Z")
|
|
2023
|
+
* DateTime.toEpochSeconds(dt) // => 1704067200
|
|
2024
|
+
* ```
|
|
2025
|
+
*
|
|
2026
|
+
* @category converting
|
|
2027
|
+
* @since 4.0.0
|
|
2028
|
+
*/
|
|
2029
|
+
export declare const toEpochSeconds: (self: DateTime) => number;
|
|
2075
2030
|
/**
|
|
2076
2031
|
* Removes the time aspect of a `DateTime`, first adjusting for the time
|
|
2077
2032
|
* zone. It will return a `DateTime.Utc` only containing the date.
|
|
2078
2033
|
*
|
|
2079
2034
|
* **Example** (Removing time components)
|
|
2080
2035
|
*
|
|
2081
|
-
* ```ts
|
|
2036
|
+
* ```ts import.meta.vitest
|
|
2082
2037
|
* import { DateTime } from "effect"
|
|
2083
2038
|
*
|
|
2084
2039
|
* // returns "2024-01-01T00:00:00Z"
|
|
@@ -2088,7 +2043,7 @@ export declare const toEpochMillis: (self: DateTime) => number;
|
|
|
2088
2043
|
* }).pipe(
|
|
2089
2044
|
* DateTime.removeTime,
|
|
2090
2045
|
* DateTime.formatIso
|
|
2091
|
-
* )
|
|
2046
|
+
* ) // => "2024-01-01T00:00:00.000Z"
|
|
2092
2047
|
* ```
|
|
2093
2048
|
*
|
|
2094
2049
|
* @category converting
|
|
@@ -2104,26 +2059,16 @@ export declare const removeTime: (self: DateTime) => Utc;
|
|
|
2104
2059
|
*
|
|
2105
2060
|
* **Example** (Reading DateTime parts)
|
|
2106
2061
|
*
|
|
2107
|
-
* ```ts
|
|
2062
|
+
* ```ts import.meta.vitest
|
|
2108
2063
|
* import { DateTime } from "effect"
|
|
2109
2064
|
*
|
|
2110
2065
|
* const dt = DateTime.makeUnsafe("2024-01-01T12:30:45.123Z")
|
|
2111
2066
|
* const parts = DateTime.toParts(dt)
|
|
2112
2067
|
*
|
|
2113
|
-
*
|
|
2114
|
-
* // {
|
|
2115
|
-
* // year: 2024,
|
|
2116
|
-
* // month: 1,
|
|
2117
|
-
* // day: 1,
|
|
2118
|
-
* // hours: 12,
|
|
2119
|
-
* // minutes: 30,
|
|
2120
|
-
* // seconds: 45,
|
|
2121
|
-
* // millis: 123,
|
|
2122
|
-
* // weekDay: 1 // Monday
|
|
2123
|
-
* // }
|
|
2068
|
+
* const selectedParts = [parts.year, parts.month, parts.day, parts.hour] // => [2024, 1, 1, 12]
|
|
2124
2069
|
* ```
|
|
2125
2070
|
*
|
|
2126
|
-
* @category
|
|
2071
|
+
* @category getters
|
|
2127
2072
|
* @since 3.6.0
|
|
2128
2073
|
*/
|
|
2129
2074
|
export declare const toParts: (self: DateTime) => DateTime.PartsWithWeekday;
|
|
@@ -2136,7 +2081,7 @@ export declare const toParts: (self: DateTime) => DateTime.PartsWithWeekday;
|
|
|
2136
2081
|
*
|
|
2137
2082
|
* **Example** (Reading UTC DateTime parts)
|
|
2138
2083
|
*
|
|
2139
|
-
* ```ts
|
|
2084
|
+
* ```ts import.meta.vitest
|
|
2140
2085
|
* import { DateTime } from "effect"
|
|
2141
2086
|
*
|
|
2142
2087
|
* const zoned = DateTime.makeZonedUnsafe("2024-01-01T12:30:45.123Z", {
|
|
@@ -2144,11 +2089,10 @@ export declare const toParts: (self: DateTime) => DateTime.PartsWithWeekday;
|
|
|
2144
2089
|
* })
|
|
2145
2090
|
* const parts = DateTime.toPartsUtc(zoned)
|
|
2146
2091
|
*
|
|
2147
|
-
*
|
|
2148
|
-
* // Always returns UTC parts regardless of time zone
|
|
2092
|
+
* const selectedParts = [parts.year, parts.month, parts.day, parts.hour] // => [2024, 1, 1, 12]
|
|
2149
2093
|
* ```
|
|
2150
2094
|
*
|
|
2151
|
-
* @category
|
|
2095
|
+
* @category getters
|
|
2152
2096
|
* @since 3.6.0
|
|
2153
2097
|
*/
|
|
2154
2098
|
export declare const toPartsUtc: (self: DateTime) => DateTime.PartsWithWeekday;
|
|
@@ -2161,15 +2105,14 @@ export declare const toPartsUtc: (self: DateTime) => DateTime.PartsWithWeekday;
|
|
|
2161
2105
|
*
|
|
2162
2106
|
* **Example** (Reading UTC DateTime parts by key)
|
|
2163
2107
|
*
|
|
2164
|
-
* ```ts
|
|
2108
|
+
* ```ts import.meta.vitest
|
|
2165
2109
|
* import { DateTime } from "effect"
|
|
2166
2110
|
*
|
|
2167
2111
|
* const dateTime = DateTime.makeUnsafe({ year: 2024 })
|
|
2168
|
-
*
|
|
2169
|
-
* console.log(year) // 2024
|
|
2112
|
+
* DateTime.getPartUtc(dateTime, "year") // => 2024
|
|
2170
2113
|
* ```
|
|
2171
2114
|
*
|
|
2172
|
-
* @category
|
|
2115
|
+
* @category getters
|
|
2173
2116
|
* @since 3.6.0
|
|
2174
2117
|
*/
|
|
2175
2118
|
export declare const getPartUtc: {
|
|
@@ -2182,15 +2125,14 @@ export declare const getPartUtc: {
|
|
|
2182
2125
|
*
|
|
2183
2126
|
* **Example** (Reading UTC DateTime parts by key)
|
|
2184
2127
|
*
|
|
2185
|
-
* ```ts
|
|
2128
|
+
* ```ts import.meta.vitest
|
|
2186
2129
|
* import { DateTime } from "effect"
|
|
2187
2130
|
*
|
|
2188
2131
|
* const dateTime = DateTime.makeUnsafe({ year: 2024 })
|
|
2189
|
-
*
|
|
2190
|
-
* console.log(year) // 2024
|
|
2132
|
+
* DateTime.getPartUtc(dateTime, "year") // => 2024
|
|
2191
2133
|
* ```
|
|
2192
2134
|
*
|
|
2193
|
-
* @category
|
|
2135
|
+
* @category getters
|
|
2194
2136
|
* @since 3.6.0
|
|
2195
2137
|
*/
|
|
2196
2138
|
(part: keyof DateTime.PartsWithWeekday): (self: DateTime) => number;
|
|
@@ -2203,15 +2145,14 @@ export declare const getPartUtc: {
|
|
|
2203
2145
|
*
|
|
2204
2146
|
* **Example** (Reading UTC DateTime parts by key)
|
|
2205
2147
|
*
|
|
2206
|
-
* ```ts
|
|
2148
|
+
* ```ts import.meta.vitest
|
|
2207
2149
|
* import { DateTime } from "effect"
|
|
2208
2150
|
*
|
|
2209
2151
|
* const dateTime = DateTime.makeUnsafe({ year: 2024 })
|
|
2210
|
-
*
|
|
2211
|
-
* console.log(year) // 2024
|
|
2152
|
+
* DateTime.getPartUtc(dateTime, "year") // => 2024
|
|
2212
2153
|
* ```
|
|
2213
2154
|
*
|
|
2214
|
-
* @category
|
|
2155
|
+
* @category getters
|
|
2215
2156
|
* @since 3.6.0
|
|
2216
2157
|
*/
|
|
2217
2158
|
(self: DateTime, part: keyof DateTime.PartsWithWeekday): number;
|
|
@@ -2225,17 +2166,16 @@ export declare const getPartUtc: {
|
|
|
2225
2166
|
*
|
|
2226
2167
|
* **Example** (Reading DateTime parts by key)
|
|
2227
2168
|
*
|
|
2228
|
-
* ```ts
|
|
2169
|
+
* ```ts import.meta.vitest
|
|
2229
2170
|
* import { DateTime } from "effect"
|
|
2230
2171
|
*
|
|
2231
2172
|
* const dateTime = DateTime.makeZonedUnsafe({ year: 2024 }, {
|
|
2232
2173
|
* timeZone: "Europe/London"
|
|
2233
2174
|
* })
|
|
2234
|
-
*
|
|
2235
|
-
* console.log(year) // 2024
|
|
2175
|
+
* DateTime.getPart(dateTime, "year") // => 2024
|
|
2236
2176
|
* ```
|
|
2237
2177
|
*
|
|
2238
|
-
* @category
|
|
2178
|
+
* @category getters
|
|
2239
2179
|
* @since 3.6.0
|
|
2240
2180
|
*/
|
|
2241
2181
|
export declare const getPart: {
|
|
@@ -2248,17 +2188,16 @@ export declare const getPart: {
|
|
|
2248
2188
|
*
|
|
2249
2189
|
* **Example** (Reading DateTime parts by key)
|
|
2250
2190
|
*
|
|
2251
|
-
* ```ts
|
|
2191
|
+
* ```ts import.meta.vitest
|
|
2252
2192
|
* import { DateTime } from "effect"
|
|
2253
2193
|
*
|
|
2254
2194
|
* const dateTime = DateTime.makeZonedUnsafe({ year: 2024 }, {
|
|
2255
2195
|
* timeZone: "Europe/London"
|
|
2256
2196
|
* })
|
|
2257
|
-
*
|
|
2258
|
-
* console.log(year) // 2024
|
|
2197
|
+
* DateTime.getPart(dateTime, "year") // => 2024
|
|
2259
2198
|
* ```
|
|
2260
2199
|
*
|
|
2261
|
-
* @category
|
|
2200
|
+
* @category getters
|
|
2262
2201
|
* @since 3.6.0
|
|
2263
2202
|
*/
|
|
2264
2203
|
(part: keyof DateTime.PartsWithWeekday): (self: DateTime) => number;
|
|
@@ -2271,17 +2210,16 @@ export declare const getPart: {
|
|
|
2271
2210
|
*
|
|
2272
2211
|
* **Example** (Reading DateTime parts by key)
|
|
2273
2212
|
*
|
|
2274
|
-
* ```ts
|
|
2213
|
+
* ```ts import.meta.vitest
|
|
2275
2214
|
* import { DateTime } from "effect"
|
|
2276
2215
|
*
|
|
2277
2216
|
* const dateTime = DateTime.makeZonedUnsafe({ year: 2024 }, {
|
|
2278
2217
|
* timeZone: "Europe/London"
|
|
2279
2218
|
* })
|
|
2280
|
-
*
|
|
2281
|
-
* console.log(year) // 2024
|
|
2219
|
+
* DateTime.getPart(dateTime, "year") // => 2024
|
|
2282
2220
|
* ```
|
|
2283
2221
|
*
|
|
2284
|
-
* @category
|
|
2222
|
+
* @category getters
|
|
2285
2223
|
* @since 3.6.0
|
|
2286
2224
|
*/
|
|
2287
2225
|
(self: DateTime, part: keyof DateTime.PartsWithWeekday): number;
|
|
@@ -2295,20 +2233,20 @@ export declare const getPart: {
|
|
|
2295
2233
|
*
|
|
2296
2234
|
* **Example** (Updating DateTime parts)
|
|
2297
2235
|
*
|
|
2298
|
-
* ```ts
|
|
2236
|
+
* ```ts import.meta.vitest
|
|
2299
2237
|
* import { DateTime } from "effect"
|
|
2300
2238
|
*
|
|
2301
|
-
* const dt = DateTime.
|
|
2239
|
+
* const dt = DateTime.makeZonedUnsafe("2024-01-01T12:00:00Z", { timeZone: "UTC" })
|
|
2302
2240
|
* const updated = DateTime.setParts(dt, {
|
|
2303
2241
|
* year: 2025,
|
|
2304
2242
|
* month: 6,
|
|
2305
2243
|
* day: 15
|
|
2306
2244
|
* })
|
|
2307
2245
|
*
|
|
2308
|
-
*
|
|
2246
|
+
* updated // => DateTime.makeZonedUnsafe("2025-06-15T12:00:00Z", { timeZone: "UTC" })
|
|
2309
2247
|
* ```
|
|
2310
2248
|
*
|
|
2311
|
-
* @category
|
|
2249
|
+
* @category transforming
|
|
2312
2250
|
* @since 3.6.0
|
|
2313
2251
|
*/
|
|
2314
2252
|
export declare const setParts: {
|
|
@@ -2321,20 +2259,20 @@ export declare const setParts: {
|
|
|
2321
2259
|
*
|
|
2322
2260
|
* **Example** (Updating DateTime parts)
|
|
2323
2261
|
*
|
|
2324
|
-
* ```ts
|
|
2262
|
+
* ```ts import.meta.vitest
|
|
2325
2263
|
* import { DateTime } from "effect"
|
|
2326
2264
|
*
|
|
2327
|
-
* const dt = DateTime.
|
|
2265
|
+
* const dt = DateTime.makeZonedUnsafe("2024-01-01T12:00:00Z", { timeZone: "UTC" })
|
|
2328
2266
|
* const updated = DateTime.setParts(dt, {
|
|
2329
2267
|
* year: 2025,
|
|
2330
2268
|
* month: 6,
|
|
2331
2269
|
* day: 15
|
|
2332
2270
|
* })
|
|
2333
2271
|
*
|
|
2334
|
-
*
|
|
2272
|
+
* updated // => DateTime.makeZonedUnsafe("2025-06-15T12:00:00Z", { timeZone: "UTC" })
|
|
2335
2273
|
* ```
|
|
2336
2274
|
*
|
|
2337
|
-
* @category
|
|
2275
|
+
* @category transforming
|
|
2338
2276
|
* @since 3.6.0
|
|
2339
2277
|
*/
|
|
2340
2278
|
(parts: Partial<DateTime.PartsWithWeekday>): <A extends DateTime>(self: A) => A;
|
|
@@ -2347,20 +2285,20 @@ export declare const setParts: {
|
|
|
2347
2285
|
*
|
|
2348
2286
|
* **Example** (Updating DateTime parts)
|
|
2349
2287
|
*
|
|
2350
|
-
* ```ts
|
|
2288
|
+
* ```ts import.meta.vitest
|
|
2351
2289
|
* import { DateTime } from "effect"
|
|
2352
2290
|
*
|
|
2353
|
-
* const dt = DateTime.
|
|
2291
|
+
* const dt = DateTime.makeZonedUnsafe("2024-01-01T12:00:00Z", { timeZone: "UTC" })
|
|
2354
2292
|
* const updated = DateTime.setParts(dt, {
|
|
2355
2293
|
* year: 2025,
|
|
2356
2294
|
* month: 6,
|
|
2357
2295
|
* day: 15
|
|
2358
2296
|
* })
|
|
2359
2297
|
*
|
|
2360
|
-
*
|
|
2298
|
+
* updated // => DateTime.makeZonedUnsafe("2025-06-15T12:00:00Z", { timeZone: "UTC" })
|
|
2361
2299
|
* ```
|
|
2362
2300
|
*
|
|
2363
|
-
* @category
|
|
2301
|
+
* @category transforming
|
|
2364
2302
|
* @since 3.6.0
|
|
2365
2303
|
*/
|
|
2366
2304
|
<A extends DateTime>(self: A, parts: Partial<DateTime.PartsWithWeekday>): A;
|
|
@@ -2374,7 +2312,7 @@ export declare const setParts: {
|
|
|
2374
2312
|
*
|
|
2375
2313
|
* **Example** (Updating UTC DateTime parts)
|
|
2376
2314
|
*
|
|
2377
|
-
* ```ts
|
|
2315
|
+
* ```ts import.meta.vitest
|
|
2378
2316
|
* import { DateTime } from "effect"
|
|
2379
2317
|
*
|
|
2380
2318
|
* const dt = DateTime.makeUnsafe("2024-01-01T12:00:00Z")
|
|
@@ -2383,10 +2321,10 @@ export declare const setParts: {
|
|
|
2383
2321
|
* hour: 18
|
|
2384
2322
|
* })
|
|
2385
2323
|
*
|
|
2386
|
-
*
|
|
2324
|
+
* updated // => DateTime.makeUnsafe("2025-01-01T18:00:00Z")
|
|
2387
2325
|
* ```
|
|
2388
2326
|
*
|
|
2389
|
-
* @category
|
|
2327
|
+
* @category transforming
|
|
2390
2328
|
* @since 3.6.0
|
|
2391
2329
|
*/
|
|
2392
2330
|
export declare const setPartsUtc: {
|
|
@@ -2399,7 +2337,7 @@ export declare const setPartsUtc: {
|
|
|
2399
2337
|
*
|
|
2400
2338
|
* **Example** (Updating UTC DateTime parts)
|
|
2401
2339
|
*
|
|
2402
|
-
* ```ts
|
|
2340
|
+
* ```ts import.meta.vitest
|
|
2403
2341
|
* import { DateTime } from "effect"
|
|
2404
2342
|
*
|
|
2405
2343
|
* const dt = DateTime.makeUnsafe("2024-01-01T12:00:00Z")
|
|
@@ -2408,10 +2346,10 @@ export declare const setPartsUtc: {
|
|
|
2408
2346
|
* hour: 18
|
|
2409
2347
|
* })
|
|
2410
2348
|
*
|
|
2411
|
-
*
|
|
2349
|
+
* updated // => DateTime.makeUnsafe("2025-01-01T18:00:00Z")
|
|
2412
2350
|
* ```
|
|
2413
2351
|
*
|
|
2414
|
-
* @category
|
|
2352
|
+
* @category transforming
|
|
2415
2353
|
* @since 3.6.0
|
|
2416
2354
|
*/
|
|
2417
2355
|
(parts: Partial<DateTime.PartsWithWeekday>): <A extends DateTime>(self: A) => A;
|
|
@@ -2424,7 +2362,7 @@ export declare const setPartsUtc: {
|
|
|
2424
2362
|
*
|
|
2425
2363
|
* **Example** (Updating UTC DateTime parts)
|
|
2426
2364
|
*
|
|
2427
|
-
* ```ts
|
|
2365
|
+
* ```ts import.meta.vitest
|
|
2428
2366
|
* import { DateTime } from "effect"
|
|
2429
2367
|
*
|
|
2430
2368
|
* const dt = DateTime.makeUnsafe("2024-01-01T12:00:00Z")
|
|
@@ -2433,10 +2371,10 @@ export declare const setPartsUtc: {
|
|
|
2433
2371
|
* hour: 18
|
|
2434
2372
|
* })
|
|
2435
2373
|
*
|
|
2436
|
-
*
|
|
2374
|
+
* updated // => DateTime.makeUnsafe("2025-01-01T18:00:00Z")
|
|
2437
2375
|
* ```
|
|
2438
2376
|
*
|
|
2439
|
-
* @category
|
|
2377
|
+
* @category transforming
|
|
2440
2378
|
* @since 3.6.0
|
|
2441
2379
|
*/
|
|
2442
2380
|
<A extends DateTime>(self: A, parts: Partial<DateTime.PartsWithWeekday>): A;
|
|
@@ -2454,21 +2392,19 @@ declare const CurrentTimeZone_base: Context.ServiceClass<CurrentTimeZone, "effec
|
|
|
2454
2392
|
*
|
|
2455
2393
|
* **Example** (Accessing the current time zone service)
|
|
2456
2394
|
*
|
|
2457
|
-
* ```ts
|
|
2395
|
+
* ```ts import.meta.vitest
|
|
2458
2396
|
* import { DateTime, Effect } from "effect"
|
|
2459
2397
|
*
|
|
2460
2398
|
* const program = Effect.gen(function*() {
|
|
2461
|
-
*
|
|
2462
|
-
* const zone = yield* DateTime.CurrentTimeZone
|
|
2463
|
-
* console.log(DateTime.zoneToString(zone))
|
|
2399
|
+
* return DateTime.zoneToString(yield* DateTime.CurrentTimeZone)
|
|
2464
2400
|
* })
|
|
2465
2401
|
*
|
|
2466
2402
|
* // Provide a time zone
|
|
2467
2403
|
* const layer = DateTime.layerCurrentZoneNamed("Europe/London")
|
|
2468
|
-
* Effect.provide(program, layer)
|
|
2404
|
+
* await Effect.runPromise(Effect.provide(program, layer)) // => "Europe/London"
|
|
2469
2405
|
* ```
|
|
2470
2406
|
*
|
|
2471
|
-
* @category
|
|
2407
|
+
* @category services
|
|
2472
2408
|
* @since 3.11.0
|
|
2473
2409
|
*/
|
|
2474
2410
|
export declare class CurrentTimeZone extends CurrentTimeZone_base {
|
|
@@ -2479,18 +2415,16 @@ export declare class CurrentTimeZone extends CurrentTimeZone_base {
|
|
|
2479
2415
|
*
|
|
2480
2416
|
* **Example** (Setting the current time zone)
|
|
2481
2417
|
*
|
|
2482
|
-
* ```ts
|
|
2418
|
+
* ```ts import.meta.vitest
|
|
2483
2419
|
* import { DateTime, Effect } from "effect"
|
|
2484
2420
|
*
|
|
2485
|
-
* Effect.gen(function*() {
|
|
2486
|
-
* const
|
|
2487
|
-
*
|
|
2488
|
-
*
|
|
2489
|
-
* const zoned = yield* DateTime.setZoneCurrent(now)
|
|
2490
|
-
* }).pipe(DateTime.withCurrentZoneNamed("Europe/London"))
|
|
2421
|
+
* await Effect.runPromise(Effect.gen(function*() {
|
|
2422
|
+
* const zoned = yield* DateTime.setZoneCurrent(DateTime.makeUnsafe("2024-01-01"))
|
|
2423
|
+
* return DateTime.zoneToString(zoned.zone)
|
|
2424
|
+
* }).pipe(DateTime.withCurrentZoneNamed("Europe/London"))) // => "Europe/London"
|
|
2491
2425
|
* ```
|
|
2492
2426
|
*
|
|
2493
|
-
* @category
|
|
2427
|
+
* @category accessors
|
|
2494
2428
|
* @since 3.6.0
|
|
2495
2429
|
*/
|
|
2496
2430
|
export declare const setZoneCurrent: (self: DateTime) => Effect.Effect<Zoned, never, CurrentTimeZone>;
|
|
@@ -2499,17 +2433,18 @@ export declare const setZoneCurrent: (self: DateTime) => Effect.Effect<Zoned, ne
|
|
|
2499
2433
|
*
|
|
2500
2434
|
* **Example** (Providing the current time zone)
|
|
2501
2435
|
*
|
|
2502
|
-
* ```ts
|
|
2436
|
+
* ```ts import.meta.vitest
|
|
2503
2437
|
* import { DateTime, Effect } from "effect"
|
|
2504
2438
|
*
|
|
2505
2439
|
* const zone = DateTime.zoneMakeNamedUnsafe("Europe/London")
|
|
2506
2440
|
*
|
|
2507
|
-
* Effect.gen(function*() {
|
|
2508
|
-
* const
|
|
2509
|
-
*
|
|
2441
|
+
* await Effect.runPromise(Effect.gen(function*() {
|
|
2442
|
+
* const zoned = yield* DateTime.setZoneCurrent(DateTime.makeUnsafe("2024-01-01"))
|
|
2443
|
+
* return DateTime.zoneToString(zoned.zone)
|
|
2444
|
+
* }).pipe(DateTime.withCurrentZone(zone))) // => "Europe/London"
|
|
2510
2445
|
* ```
|
|
2511
2446
|
*
|
|
2512
|
-
* @category
|
|
2447
|
+
* @category providing services
|
|
2513
2448
|
* @since 3.6.0
|
|
2514
2449
|
*/
|
|
2515
2450
|
export declare const withCurrentZone: {
|
|
@@ -2518,17 +2453,18 @@ export declare const withCurrentZone: {
|
|
|
2518
2453
|
*
|
|
2519
2454
|
* **Example** (Providing the current time zone)
|
|
2520
2455
|
*
|
|
2521
|
-
* ```ts
|
|
2456
|
+
* ```ts import.meta.vitest
|
|
2522
2457
|
* import { DateTime, Effect } from "effect"
|
|
2523
2458
|
*
|
|
2524
2459
|
* const zone = DateTime.zoneMakeNamedUnsafe("Europe/London")
|
|
2525
2460
|
*
|
|
2526
|
-
* Effect.gen(function*() {
|
|
2527
|
-
* const
|
|
2528
|
-
*
|
|
2461
|
+
* await Effect.runPromise(Effect.gen(function*() {
|
|
2462
|
+
* const zoned = yield* DateTime.setZoneCurrent(DateTime.makeUnsafe("2024-01-01"))
|
|
2463
|
+
* return DateTime.zoneToString(zoned.zone)
|
|
2464
|
+
* }).pipe(DateTime.withCurrentZone(zone))) // => "Europe/London"
|
|
2529
2465
|
* ```
|
|
2530
2466
|
*
|
|
2531
|
-
* @category
|
|
2467
|
+
* @category providing services
|
|
2532
2468
|
* @since 3.6.0
|
|
2533
2469
|
*/
|
|
2534
2470
|
(value: TimeZone): <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, CurrentTimeZone>>;
|
|
@@ -2537,17 +2473,18 @@ export declare const withCurrentZone: {
|
|
|
2537
2473
|
*
|
|
2538
2474
|
* **Example** (Providing the current time zone)
|
|
2539
2475
|
*
|
|
2540
|
-
* ```ts
|
|
2476
|
+
* ```ts import.meta.vitest
|
|
2541
2477
|
* import { DateTime, Effect } from "effect"
|
|
2542
2478
|
*
|
|
2543
2479
|
* const zone = DateTime.zoneMakeNamedUnsafe("Europe/London")
|
|
2544
2480
|
*
|
|
2545
|
-
* Effect.gen(function*() {
|
|
2546
|
-
* const
|
|
2547
|
-
*
|
|
2481
|
+
* await Effect.runPromise(Effect.gen(function*() {
|
|
2482
|
+
* const zoned = yield* DateTime.setZoneCurrent(DateTime.makeUnsafe("2024-01-01"))
|
|
2483
|
+
* return DateTime.zoneToString(zoned.zone)
|
|
2484
|
+
* }).pipe(DateTime.withCurrentZone(zone))) // => "Europe/London"
|
|
2548
2485
|
* ```
|
|
2549
2486
|
*
|
|
2550
|
-
* @category
|
|
2487
|
+
* @category providing services
|
|
2551
2488
|
* @since 3.6.0
|
|
2552
2489
|
*/
|
|
2553
2490
|
<A, E, R>(self: Effect.Effect<A, E, R>, value: TimeZone): Effect.Effect<A, E, Exclude<R, CurrentTimeZone>>;
|
|
@@ -2558,16 +2495,15 @@ export declare const withCurrentZone: {
|
|
|
2558
2495
|
*
|
|
2559
2496
|
* **Example** (Providing the local time zone)
|
|
2560
2497
|
*
|
|
2561
|
-
* ```ts
|
|
2498
|
+
* ```ts import.meta.vitest
|
|
2562
2499
|
* import { DateTime, Effect } from "effect"
|
|
2563
2500
|
*
|
|
2564
|
-
* Effect.gen(function*() {
|
|
2565
|
-
*
|
|
2566
|
-
*
|
|
2567
|
-
* }).pipe(DateTime.withCurrentZoneLocal)
|
|
2501
|
+
* await Effect.runPromise(Effect.gen(function*() {
|
|
2502
|
+
* return DateTime.isZoned(yield* DateTime.nowInCurrentZone)
|
|
2503
|
+
* }).pipe(DateTime.withCurrentZoneLocal)) // => true
|
|
2568
2504
|
* ```
|
|
2569
2505
|
*
|
|
2570
|
-
* @category
|
|
2506
|
+
* @category providing services
|
|
2571
2507
|
* @since 3.6.0
|
|
2572
2508
|
*/
|
|
2573
2509
|
export declare const withCurrentZoneLocal: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, CurrentTimeZone>>;
|
|
@@ -2576,16 +2512,17 @@ export declare const withCurrentZoneLocal: <A, E, R>(effect: Effect.Effect<A, E,
|
|
|
2576
2512
|
*
|
|
2577
2513
|
* **Example** (Providing a fixed-offset time zone)
|
|
2578
2514
|
*
|
|
2579
|
-
* ```ts
|
|
2515
|
+
* ```ts import.meta.vitest
|
|
2580
2516
|
* import { DateTime, Effect } from "effect"
|
|
2581
2517
|
*
|
|
2582
|
-
* Effect.gen(function*() {
|
|
2583
|
-
*
|
|
2584
|
-
* console.log(DateTime.zoneToString(zone)) // "+03:00"
|
|
2518
|
+
* const program = Effect.gen(function*() {
|
|
2519
|
+
* return DateTime.zoneToString(yield* DateTime.CurrentTimeZone)
|
|
2585
2520
|
* }).pipe(DateTime.withCurrentZoneOffset(3 * 60 * 60 * 1000))
|
|
2521
|
+
*
|
|
2522
|
+
* await Effect.runPromise(program) // => "+03:00"
|
|
2586
2523
|
* ```
|
|
2587
2524
|
*
|
|
2588
|
-
* @category
|
|
2525
|
+
* @category providing services
|
|
2589
2526
|
* @since 3.6.0
|
|
2590
2527
|
*/
|
|
2591
2528
|
export declare const withCurrentZoneOffset: {
|
|
@@ -2594,16 +2531,17 @@ export declare const withCurrentZoneOffset: {
|
|
|
2594
2531
|
*
|
|
2595
2532
|
* **Example** (Providing a fixed-offset time zone)
|
|
2596
2533
|
*
|
|
2597
|
-
* ```ts
|
|
2534
|
+
* ```ts import.meta.vitest
|
|
2598
2535
|
* import { DateTime, Effect } from "effect"
|
|
2599
2536
|
*
|
|
2600
|
-
* Effect.gen(function*() {
|
|
2601
|
-
*
|
|
2602
|
-
* console.log(DateTime.zoneToString(zone)) // "+03:00"
|
|
2537
|
+
* const program = Effect.gen(function*() {
|
|
2538
|
+
* return DateTime.zoneToString(yield* DateTime.CurrentTimeZone)
|
|
2603
2539
|
* }).pipe(DateTime.withCurrentZoneOffset(3 * 60 * 60 * 1000))
|
|
2540
|
+
*
|
|
2541
|
+
* await Effect.runPromise(program) // => "+03:00"
|
|
2604
2542
|
* ```
|
|
2605
2543
|
*
|
|
2606
|
-
* @category
|
|
2544
|
+
* @category providing services
|
|
2607
2545
|
* @since 3.6.0
|
|
2608
2546
|
*/
|
|
2609
2547
|
(offset: number): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, CurrentTimeZone>>;
|
|
@@ -2612,16 +2550,17 @@ export declare const withCurrentZoneOffset: {
|
|
|
2612
2550
|
*
|
|
2613
2551
|
* **Example** (Providing a fixed-offset time zone)
|
|
2614
2552
|
*
|
|
2615
|
-
* ```ts
|
|
2553
|
+
* ```ts import.meta.vitest
|
|
2616
2554
|
* import { DateTime, Effect } from "effect"
|
|
2617
2555
|
*
|
|
2618
|
-
* Effect.gen(function*() {
|
|
2619
|
-
*
|
|
2620
|
-
* console.log(DateTime.zoneToString(zone)) // "+03:00"
|
|
2556
|
+
* const program = Effect.gen(function*() {
|
|
2557
|
+
* return DateTime.zoneToString(yield* DateTime.CurrentTimeZone)
|
|
2621
2558
|
* }).pipe(DateTime.withCurrentZoneOffset(3 * 60 * 60 * 1000))
|
|
2559
|
+
*
|
|
2560
|
+
* await Effect.runPromise(program) // => "+03:00"
|
|
2622
2561
|
* ```
|
|
2623
2562
|
*
|
|
2624
|
-
* @category
|
|
2563
|
+
* @category providing services
|
|
2625
2564
|
* @since 3.6.0
|
|
2626
2565
|
*/
|
|
2627
2566
|
<A, E, R>(effect: Effect.Effect<A, E, R>, offset: number): Effect.Effect<A, E, Exclude<R, CurrentTimeZone>>;
|
|
@@ -2636,16 +2575,16 @@ export declare const withCurrentZoneOffset: {
|
|
|
2636
2575
|
*
|
|
2637
2576
|
* **Example** (Providing a named time zone)
|
|
2638
2577
|
*
|
|
2639
|
-
* ```ts
|
|
2578
|
+
* ```ts import.meta.vitest
|
|
2640
2579
|
* import { DateTime, Effect } from "effect"
|
|
2641
2580
|
*
|
|
2642
|
-
* Effect.gen(function*() {
|
|
2643
|
-
*
|
|
2644
|
-
*
|
|
2645
|
-
* }).pipe(DateTime.withCurrentZoneNamed("Europe/London"))
|
|
2581
|
+
* await Effect.runPromise(Effect.gen(function*() {
|
|
2582
|
+
* const zoned = yield* DateTime.setZoneCurrent(DateTime.makeUnsafe("2024-01-01"))
|
|
2583
|
+
* return DateTime.zoneToString(zoned.zone)
|
|
2584
|
+
* }).pipe(DateTime.withCurrentZoneNamed("Europe/London"))) // => "Europe/London"
|
|
2646
2585
|
* ```
|
|
2647
2586
|
*
|
|
2648
|
-
* @category
|
|
2587
|
+
* @category providing services
|
|
2649
2588
|
* @since 3.6.0
|
|
2650
2589
|
*/
|
|
2651
2590
|
export declare const withCurrentZoneNamed: {
|
|
@@ -2659,16 +2598,16 @@ export declare const withCurrentZoneNamed: {
|
|
|
2659
2598
|
*
|
|
2660
2599
|
* **Example** (Providing a named time zone)
|
|
2661
2600
|
*
|
|
2662
|
-
* ```ts
|
|
2601
|
+
* ```ts import.meta.vitest
|
|
2663
2602
|
* import { DateTime, Effect } from "effect"
|
|
2664
2603
|
*
|
|
2665
|
-
* Effect.gen(function*() {
|
|
2666
|
-
*
|
|
2667
|
-
*
|
|
2668
|
-
* }).pipe(DateTime.withCurrentZoneNamed("Europe/London"))
|
|
2604
|
+
* await Effect.runPromise(Effect.gen(function*() {
|
|
2605
|
+
* const zoned = yield* DateTime.setZoneCurrent(DateTime.makeUnsafe("2024-01-01"))
|
|
2606
|
+
* return DateTime.zoneToString(zoned.zone)
|
|
2607
|
+
* }).pipe(DateTime.withCurrentZoneNamed("Europe/London"))) // => "Europe/London"
|
|
2669
2608
|
* ```
|
|
2670
2609
|
*
|
|
2671
|
-
* @category
|
|
2610
|
+
* @category providing services
|
|
2672
2611
|
* @since 3.6.0
|
|
2673
2612
|
*/
|
|
2674
2613
|
(zone: string): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E | IllegalArgumentError, Exclude<R, CurrentTimeZone>>;
|
|
@@ -2682,16 +2621,16 @@ export declare const withCurrentZoneNamed: {
|
|
|
2682
2621
|
*
|
|
2683
2622
|
* **Example** (Providing a named time zone)
|
|
2684
2623
|
*
|
|
2685
|
-
* ```ts
|
|
2624
|
+
* ```ts import.meta.vitest
|
|
2686
2625
|
* import { DateTime, Effect } from "effect"
|
|
2687
2626
|
*
|
|
2688
|
-
* Effect.gen(function*() {
|
|
2689
|
-
*
|
|
2690
|
-
*
|
|
2691
|
-
* }).pipe(DateTime.withCurrentZoneNamed("Europe/London"))
|
|
2627
|
+
* await Effect.runPromise(Effect.gen(function*() {
|
|
2628
|
+
* const zoned = yield* DateTime.setZoneCurrent(DateTime.makeUnsafe("2024-01-01"))
|
|
2629
|
+
* return DateTime.zoneToString(zoned.zone)
|
|
2630
|
+
* }).pipe(DateTime.withCurrentZoneNamed("Europe/London"))) // => "Europe/London"
|
|
2692
2631
|
* ```
|
|
2693
2632
|
*
|
|
2694
|
-
* @category
|
|
2633
|
+
* @category providing services
|
|
2695
2634
|
* @since 3.6.0
|
|
2696
2635
|
*/
|
|
2697
2636
|
<A, E, R>(effect: Effect.Effect<A, E, R>, zone: string): Effect.Effect<A, E | IllegalArgumentError, Exclude<R, CurrentTimeZone>>;
|
|
@@ -2701,16 +2640,15 @@ export declare const withCurrentZoneNamed: {
|
|
|
2701
2640
|
*
|
|
2702
2641
|
* **Example** (Getting the current time in the current zone)
|
|
2703
2642
|
*
|
|
2704
|
-
* ```ts
|
|
2643
|
+
* ```ts import.meta.vitest
|
|
2705
2644
|
* import { DateTime, Effect } from "effect"
|
|
2706
2645
|
*
|
|
2707
|
-
* Effect.gen(function*() {
|
|
2708
|
-
*
|
|
2709
|
-
*
|
|
2710
|
-
* }).pipe(DateTime.withCurrentZoneNamed("Europe/London"))
|
|
2646
|
+
* await Effect.runPromise(Effect.gen(function*() {
|
|
2647
|
+
* return DateTime.zoneToString((yield* DateTime.nowInCurrentZone).zone)
|
|
2648
|
+
* }).pipe(DateTime.withCurrentZoneNamed("Europe/London"))) // => "Europe/London"
|
|
2711
2649
|
* ```
|
|
2712
2650
|
*
|
|
2713
|
-
* @category
|
|
2651
|
+
* @category accessors
|
|
2714
2652
|
* @since 3.6.0
|
|
2715
2653
|
*/
|
|
2716
2654
|
export declare const nowInCurrentZone: Effect.Effect<Zoned, never, CurrentTimeZone>;
|
|
@@ -2731,17 +2669,15 @@ export declare const nowInCurrentZone: Effect.Effect<Zoned, never, CurrentTimeZo
|
|
|
2731
2669
|
*
|
|
2732
2670
|
* **Example** (Mutating DateTime values with Dates)
|
|
2733
2671
|
*
|
|
2734
|
-
* ```ts
|
|
2672
|
+
* ```ts import.meta.vitest
|
|
2735
2673
|
* import { DateTime } from "effect"
|
|
2736
2674
|
*
|
|
2737
2675
|
* const dt = DateTime.makeUnsafe("2024-01-01T12:00:00Z")
|
|
2738
2676
|
*
|
|
2739
|
-
*
|
|
2677
|
+
* DateTime.mutate(dt, (date) => {
|
|
2740
2678
|
* date.setHours(15) // Set to 3 PM
|
|
2741
2679
|
* date.setMinutes(30) // Set to 30 minutes
|
|
2742
2680
|
* })
|
|
2743
|
-
*
|
|
2744
|
-
* console.log(DateTime.formatIso(modified)) // "2024-01-01T15:30:00.000Z"
|
|
2745
2681
|
* ```
|
|
2746
2682
|
*
|
|
2747
2683
|
* @category mapping
|
|
@@ -2765,17 +2701,15 @@ export declare const mutate: {
|
|
|
2765
2701
|
*
|
|
2766
2702
|
* **Example** (Mutating DateTime values with Dates)
|
|
2767
2703
|
*
|
|
2768
|
-
* ```ts
|
|
2704
|
+
* ```ts import.meta.vitest
|
|
2769
2705
|
* import { DateTime } from "effect"
|
|
2770
2706
|
*
|
|
2771
2707
|
* const dt = DateTime.makeUnsafe("2024-01-01T12:00:00Z")
|
|
2772
2708
|
*
|
|
2773
|
-
*
|
|
2709
|
+
* DateTime.mutate(dt, (date) => {
|
|
2774
2710
|
* date.setHours(15) // Set to 3 PM
|
|
2775
2711
|
* date.setMinutes(30) // Set to 30 minutes
|
|
2776
2712
|
* })
|
|
2777
|
-
*
|
|
2778
|
-
* console.log(DateTime.formatIso(modified)) // "2024-01-01T15:30:00.000Z"
|
|
2779
2713
|
* ```
|
|
2780
2714
|
*
|
|
2781
2715
|
* @category mapping
|
|
@@ -2801,17 +2735,15 @@ export declare const mutate: {
|
|
|
2801
2735
|
*
|
|
2802
2736
|
* **Example** (Mutating DateTime values with Dates)
|
|
2803
2737
|
*
|
|
2804
|
-
* ```ts
|
|
2738
|
+
* ```ts import.meta.vitest
|
|
2805
2739
|
* import { DateTime } from "effect"
|
|
2806
2740
|
*
|
|
2807
2741
|
* const dt = DateTime.makeUnsafe("2024-01-01T12:00:00Z")
|
|
2808
2742
|
*
|
|
2809
|
-
*
|
|
2743
|
+
* DateTime.mutate(dt, (date) => {
|
|
2810
2744
|
* date.setHours(15) // Set to 3 PM
|
|
2811
2745
|
* date.setMinutes(30) // Set to 30 minutes
|
|
2812
2746
|
* })
|
|
2813
|
-
*
|
|
2814
|
-
* console.log(DateTime.formatIso(modified)) // "2024-01-01T15:30:00.000Z"
|
|
2815
2747
|
* ```
|
|
2816
2748
|
*
|
|
2817
2749
|
* @category mapping
|
|
@@ -2831,7 +2763,7 @@ export declare const mutate: {
|
|
|
2831
2763
|
*
|
|
2832
2764
|
* **Example** (Mutating DateTime values with UTC Dates)
|
|
2833
2765
|
*
|
|
2834
|
-
* ```ts
|
|
2766
|
+
* ```ts import.meta.vitest
|
|
2835
2767
|
* import { DateTime } from "effect"
|
|
2836
2768
|
*
|
|
2837
2769
|
* const dt = DateTime.makeZonedUnsafe("2024-01-01T12:00:00Z", {
|
|
@@ -2842,7 +2774,7 @@ export declare const mutate: {
|
|
|
2842
2774
|
* date.setUTCHours(18) // Set UTC time to 6 PM
|
|
2843
2775
|
* })
|
|
2844
2776
|
*
|
|
2845
|
-
*
|
|
2777
|
+
* modified // => DateTime.makeZonedUnsafe("2024-01-01T18:00:00Z", { timeZone: "Europe/London" })
|
|
2846
2778
|
* ```
|
|
2847
2779
|
*
|
|
2848
2780
|
* @category mapping
|
|
@@ -2859,7 +2791,7 @@ export declare const mutateUtc: {
|
|
|
2859
2791
|
*
|
|
2860
2792
|
* **Example** (Mutating DateTime values with UTC Dates)
|
|
2861
2793
|
*
|
|
2862
|
-
* ```ts
|
|
2794
|
+
* ```ts import.meta.vitest
|
|
2863
2795
|
* import { DateTime } from "effect"
|
|
2864
2796
|
*
|
|
2865
2797
|
* const dt = DateTime.makeZonedUnsafe("2024-01-01T12:00:00Z", {
|
|
@@ -2870,7 +2802,7 @@ export declare const mutateUtc: {
|
|
|
2870
2802
|
* date.setUTCHours(18) // Set UTC time to 6 PM
|
|
2871
2803
|
* })
|
|
2872
2804
|
*
|
|
2873
|
-
*
|
|
2805
|
+
* modified // => DateTime.makeZonedUnsafe("2024-01-01T18:00:00Z", { timeZone: "Europe/London" })
|
|
2874
2806
|
* ```
|
|
2875
2807
|
*
|
|
2876
2808
|
* @category mapping
|
|
@@ -2887,7 +2819,7 @@ export declare const mutateUtc: {
|
|
|
2887
2819
|
*
|
|
2888
2820
|
* **Example** (Mutating DateTime values with UTC Dates)
|
|
2889
2821
|
*
|
|
2890
|
-
* ```ts
|
|
2822
|
+
* ```ts import.meta.vitest
|
|
2891
2823
|
* import { DateTime } from "effect"
|
|
2892
2824
|
*
|
|
2893
2825
|
* const dt = DateTime.makeZonedUnsafe("2024-01-01T12:00:00Z", {
|
|
@@ -2898,7 +2830,7 @@ export declare const mutateUtc: {
|
|
|
2898
2830
|
* date.setUTCHours(18) // Set UTC time to 6 PM
|
|
2899
2831
|
* })
|
|
2900
2832
|
*
|
|
2901
|
-
*
|
|
2833
|
+
* modified // => DateTime.makeZonedUnsafe("2024-01-01T18:00:00Z", { timeZone: "Europe/London" })
|
|
2902
2834
|
* ```
|
|
2903
2835
|
*
|
|
2904
2836
|
* @category mapping
|
|
@@ -2912,13 +2844,14 @@ export declare const mutateUtc: {
|
|
|
2912
2844
|
*
|
|
2913
2845
|
* **Example** (Mapping epoch milliseconds)
|
|
2914
2846
|
*
|
|
2915
|
-
* ```ts
|
|
2847
|
+
* ```ts import.meta.vitest
|
|
2916
2848
|
* import { DateTime } from "effect"
|
|
2917
2849
|
*
|
|
2918
2850
|
* // add 10 milliseconds
|
|
2919
|
-
* DateTime.makeUnsafe(0).pipe(
|
|
2851
|
+
* const result = DateTime.makeUnsafe(0).pipe(
|
|
2920
2852
|
* DateTime.mapEpochMillis((millis) => millis + 10)
|
|
2921
2853
|
* )
|
|
2854
|
+
* result // => DateTime.makeUnsafe(10)
|
|
2922
2855
|
* ```
|
|
2923
2856
|
*
|
|
2924
2857
|
* @category mapping
|
|
@@ -2931,13 +2864,14 @@ export declare const mapEpochMillis: {
|
|
|
2931
2864
|
*
|
|
2932
2865
|
* **Example** (Mapping epoch milliseconds)
|
|
2933
2866
|
*
|
|
2934
|
-
* ```ts
|
|
2867
|
+
* ```ts import.meta.vitest
|
|
2935
2868
|
* import { DateTime } from "effect"
|
|
2936
2869
|
*
|
|
2937
2870
|
* // add 10 milliseconds
|
|
2938
|
-
* DateTime.makeUnsafe(0).pipe(
|
|
2871
|
+
* const result = DateTime.makeUnsafe(0).pipe(
|
|
2939
2872
|
* DateTime.mapEpochMillis((millis) => millis + 10)
|
|
2940
2873
|
* )
|
|
2874
|
+
* result // => DateTime.makeUnsafe(10)
|
|
2941
2875
|
* ```
|
|
2942
2876
|
*
|
|
2943
2877
|
* @category mapping
|
|
@@ -2950,13 +2884,14 @@ export declare const mapEpochMillis: {
|
|
|
2950
2884
|
*
|
|
2951
2885
|
* **Example** (Mapping epoch milliseconds)
|
|
2952
2886
|
*
|
|
2953
|
-
* ```ts
|
|
2887
|
+
* ```ts import.meta.vitest
|
|
2954
2888
|
* import { DateTime } from "effect"
|
|
2955
2889
|
*
|
|
2956
2890
|
* // add 10 milliseconds
|
|
2957
|
-
* DateTime.makeUnsafe(0).pipe(
|
|
2891
|
+
* const result = DateTime.makeUnsafe(0).pipe(
|
|
2958
2892
|
* DateTime.mapEpochMillis((millis) => millis + 10)
|
|
2959
2893
|
* )
|
|
2894
|
+
* result // => DateTime.makeUnsafe(10)
|
|
2960
2895
|
* ```
|
|
2961
2896
|
*
|
|
2962
2897
|
* @category mapping
|
|
@@ -2976,13 +2911,13 @@ export declare const mapEpochMillis: {
|
|
|
2976
2911
|
*
|
|
2977
2912
|
* **Example** (Applying time zone adjusted Dates)
|
|
2978
2913
|
*
|
|
2979
|
-
* ```ts
|
|
2914
|
+
* ```ts import.meta.vitest
|
|
2980
2915
|
* import { DateTime } from "effect"
|
|
2981
2916
|
*
|
|
2982
2917
|
* // get the time zone adjusted date in milliseconds
|
|
2983
2918
|
* DateTime.makeZonedUnsafe(0, { timeZone: "Europe/London" }).pipe(
|
|
2984
2919
|
* DateTime.withDate((date) => date.getTime())
|
|
2985
|
-
* )
|
|
2920
|
+
* ) // => 3600000
|
|
2986
2921
|
* ```
|
|
2987
2922
|
*
|
|
2988
2923
|
* @category mapping
|
|
@@ -3001,13 +2936,13 @@ export declare const withDate: {
|
|
|
3001
2936
|
*
|
|
3002
2937
|
* **Example** (Applying time zone adjusted Dates)
|
|
3003
2938
|
*
|
|
3004
|
-
* ```ts
|
|
2939
|
+
* ```ts import.meta.vitest
|
|
3005
2940
|
* import { DateTime } from "effect"
|
|
3006
2941
|
*
|
|
3007
2942
|
* // get the time zone adjusted date in milliseconds
|
|
3008
2943
|
* DateTime.makeZonedUnsafe(0, { timeZone: "Europe/London" }).pipe(
|
|
3009
2944
|
* DateTime.withDate((date) => date.getTime())
|
|
3010
|
-
* )
|
|
2945
|
+
* ) // => 3600000
|
|
3011
2946
|
* ```
|
|
3012
2947
|
*
|
|
3013
2948
|
* @category mapping
|
|
@@ -3026,13 +2961,13 @@ export declare const withDate: {
|
|
|
3026
2961
|
*
|
|
3027
2962
|
* **Example** (Applying time zone adjusted Dates)
|
|
3028
2963
|
*
|
|
3029
|
-
* ```ts
|
|
2964
|
+
* ```ts import.meta.vitest
|
|
3030
2965
|
* import { DateTime } from "effect"
|
|
3031
2966
|
*
|
|
3032
2967
|
* // get the time zone adjusted date in milliseconds
|
|
3033
2968
|
* DateTime.makeZonedUnsafe(0, { timeZone: "Europe/London" }).pipe(
|
|
3034
2969
|
* DateTime.withDate((date) => date.getTime())
|
|
3035
|
-
* )
|
|
2970
|
+
* ) // => 3600000
|
|
3036
2971
|
* ```
|
|
3037
2972
|
*
|
|
3038
2973
|
* @category mapping
|
|
@@ -3051,13 +2986,13 @@ export declare const withDate: {
|
|
|
3051
2986
|
*
|
|
3052
2987
|
* **Example** (Applying UTC Dates)
|
|
3053
2988
|
*
|
|
3054
|
-
* ```ts
|
|
2989
|
+
* ```ts import.meta.vitest
|
|
3055
2990
|
* import { DateTime } from "effect"
|
|
3056
2991
|
*
|
|
3057
2992
|
* // get the date in milliseconds
|
|
3058
2993
|
* DateTime.makeUnsafe(0).pipe(
|
|
3059
2994
|
* DateTime.withDateUtc((date) => date.getTime())
|
|
3060
|
-
* )
|
|
2995
|
+
* ) // => 0
|
|
3061
2996
|
* ```
|
|
3062
2997
|
*
|
|
3063
2998
|
* @category mapping
|
|
@@ -3075,13 +3010,13 @@ export declare const withDateUtc: {
|
|
|
3075
3010
|
*
|
|
3076
3011
|
* **Example** (Applying UTC Dates)
|
|
3077
3012
|
*
|
|
3078
|
-
* ```ts
|
|
3013
|
+
* ```ts import.meta.vitest
|
|
3079
3014
|
* import { DateTime } from "effect"
|
|
3080
3015
|
*
|
|
3081
3016
|
* // get the date in milliseconds
|
|
3082
3017
|
* DateTime.makeUnsafe(0).pipe(
|
|
3083
3018
|
* DateTime.withDateUtc((date) => date.getTime())
|
|
3084
|
-
* )
|
|
3019
|
+
* ) // => 0
|
|
3085
3020
|
* ```
|
|
3086
3021
|
*
|
|
3087
3022
|
* @category mapping
|
|
@@ -3099,13 +3034,13 @@ export declare const withDateUtc: {
|
|
|
3099
3034
|
*
|
|
3100
3035
|
* **Example** (Applying UTC Dates)
|
|
3101
3036
|
*
|
|
3102
|
-
* ```ts
|
|
3037
|
+
* ```ts import.meta.vitest
|
|
3103
3038
|
* import { DateTime } from "effect"
|
|
3104
3039
|
*
|
|
3105
3040
|
* // get the date in milliseconds
|
|
3106
3041
|
* DateTime.makeUnsafe(0).pipe(
|
|
3107
3042
|
* DateTime.withDateUtc((date) => date.getTime())
|
|
3108
|
-
* )
|
|
3043
|
+
* ) // => 0
|
|
3109
3044
|
* ```
|
|
3110
3045
|
*
|
|
3111
3046
|
* @category mapping
|
|
@@ -3118,7 +3053,7 @@ export declare const withDateUtc: {
|
|
|
3118
3053
|
*
|
|
3119
3054
|
* **Example** (Pattern matching DateTime variants)
|
|
3120
3055
|
*
|
|
3121
|
-
* ```ts
|
|
3056
|
+
* ```ts import.meta.vitest
|
|
3122
3057
|
* import { DateTime } from "effect"
|
|
3123
3058
|
*
|
|
3124
3059
|
* const dt1 = DateTime.makeUnsafe("2024-01-01T12:00:00Z") // Utc
|
|
@@ -3136,8 +3071,8 @@ export declare const withDateUtc: {
|
|
|
3136
3071
|
* onZoned: (zoned) => `Zoned: ${DateTime.formatIsoZoned(zoned)}`
|
|
3137
3072
|
* })
|
|
3138
3073
|
*
|
|
3139
|
-
*
|
|
3140
|
-
*
|
|
3074
|
+
* result1 // => "UTC: 2024-01-01T12:00:00.000Z"
|
|
3075
|
+
* result2 // => "Zoned: 2024-06-15T15:30:00.000+01:00[Europe/London]"
|
|
3141
3076
|
* ```
|
|
3142
3077
|
*
|
|
3143
3078
|
* @category mapping
|
|
@@ -3149,7 +3084,7 @@ export declare const match: {
|
|
|
3149
3084
|
*
|
|
3150
3085
|
* **Example** (Pattern matching DateTime variants)
|
|
3151
3086
|
*
|
|
3152
|
-
* ```ts
|
|
3087
|
+
* ```ts import.meta.vitest
|
|
3153
3088
|
* import { DateTime } from "effect"
|
|
3154
3089
|
*
|
|
3155
3090
|
* const dt1 = DateTime.makeUnsafe("2024-01-01T12:00:00Z") // Utc
|
|
@@ -3167,8 +3102,8 @@ export declare const match: {
|
|
|
3167
3102
|
* onZoned: (zoned) => `Zoned: ${DateTime.formatIsoZoned(zoned)}`
|
|
3168
3103
|
* })
|
|
3169
3104
|
*
|
|
3170
|
-
*
|
|
3171
|
-
*
|
|
3105
|
+
* result1 // => "UTC: 2024-01-01T12:00:00.000Z"
|
|
3106
|
+
* result2 // => "Zoned: 2024-06-15T15:30:00.000+01:00[Europe/London]"
|
|
3172
3107
|
* ```
|
|
3173
3108
|
*
|
|
3174
3109
|
* @category mapping
|
|
@@ -3183,7 +3118,7 @@ export declare const match: {
|
|
|
3183
3118
|
*
|
|
3184
3119
|
* **Example** (Pattern matching DateTime variants)
|
|
3185
3120
|
*
|
|
3186
|
-
* ```ts
|
|
3121
|
+
* ```ts import.meta.vitest
|
|
3187
3122
|
* import { DateTime } from "effect"
|
|
3188
3123
|
*
|
|
3189
3124
|
* const dt1 = DateTime.makeUnsafe("2024-01-01T12:00:00Z") // Utc
|
|
@@ -3201,8 +3136,8 @@ export declare const match: {
|
|
|
3201
3136
|
* onZoned: (zoned) => `Zoned: ${DateTime.formatIsoZoned(zoned)}`
|
|
3202
3137
|
* })
|
|
3203
3138
|
*
|
|
3204
|
-
*
|
|
3205
|
-
*
|
|
3139
|
+
* result1 // => "UTC: 2024-01-01T12:00:00.000Z"
|
|
3140
|
+
* result2 // => "Zoned: 2024-06-15T15:30:00.000+01:00[Europe/London]"
|
|
3206
3141
|
* ```
|
|
3207
3142
|
*
|
|
3208
3143
|
* @category mapping
|
|
@@ -3234,13 +3169,13 @@ export declare const match: {
|
|
|
3234
3169
|
*
|
|
3235
3170
|
* **Example** (Adding durations)
|
|
3236
3171
|
*
|
|
3237
|
-
* ```ts
|
|
3172
|
+
* ```ts import.meta.vitest
|
|
3238
3173
|
* import { DateTime } from "effect"
|
|
3239
3174
|
*
|
|
3240
3175
|
* // add 5 minutes
|
|
3241
3176
|
* DateTime.makeUnsafe(0).pipe(
|
|
3242
3177
|
* DateTime.addDuration("5 minutes")
|
|
3243
|
-
* )
|
|
3178
|
+
* ) // => DateTime.makeUnsafe(300000)
|
|
3244
3179
|
* ```
|
|
3245
3180
|
*
|
|
3246
3181
|
* @see {@link add} for calendar-aware date/time part arithmetic
|
|
@@ -3271,13 +3206,13 @@ export declare const addDuration: {
|
|
|
3271
3206
|
*
|
|
3272
3207
|
* **Example** (Adding durations)
|
|
3273
3208
|
*
|
|
3274
|
-
* ```ts
|
|
3209
|
+
* ```ts import.meta.vitest
|
|
3275
3210
|
* import { DateTime } from "effect"
|
|
3276
3211
|
*
|
|
3277
3212
|
* // add 5 minutes
|
|
3278
3213
|
* DateTime.makeUnsafe(0).pipe(
|
|
3279
3214
|
* DateTime.addDuration("5 minutes")
|
|
3280
|
-
* )
|
|
3215
|
+
* ) // => DateTime.makeUnsafe(300000)
|
|
3281
3216
|
* ```
|
|
3282
3217
|
*
|
|
3283
3218
|
* @see {@link add} for calendar-aware date/time part arithmetic
|
|
@@ -3308,13 +3243,13 @@ export declare const addDuration: {
|
|
|
3308
3243
|
*
|
|
3309
3244
|
* **Example** (Adding durations)
|
|
3310
3245
|
*
|
|
3311
|
-
* ```ts
|
|
3246
|
+
* ```ts import.meta.vitest
|
|
3312
3247
|
* import { DateTime } from "effect"
|
|
3313
3248
|
*
|
|
3314
3249
|
* // add 5 minutes
|
|
3315
3250
|
* DateTime.makeUnsafe(0).pipe(
|
|
3316
3251
|
* DateTime.addDuration("5 minutes")
|
|
3317
|
-
* )
|
|
3252
|
+
* ) // => DateTime.makeUnsafe(300000)
|
|
3318
3253
|
* ```
|
|
3319
3254
|
*
|
|
3320
3255
|
* @see {@link add} for calendar-aware date/time part arithmetic
|
|
@@ -3330,13 +3265,13 @@ export declare const addDuration: {
|
|
|
3330
3265
|
*
|
|
3331
3266
|
* **Example** (Subtracting durations)
|
|
3332
3267
|
*
|
|
3333
|
-
* ```ts
|
|
3268
|
+
* ```ts import.meta.vitest
|
|
3334
3269
|
* import { DateTime } from "effect"
|
|
3335
3270
|
*
|
|
3336
3271
|
* // subtract 5 minutes
|
|
3337
3272
|
* DateTime.makeUnsafe(0).pipe(
|
|
3338
3273
|
* DateTime.subtractDuration("5 minutes")
|
|
3339
|
-
* )
|
|
3274
|
+
* ) // => DateTime.makeUnsafe(-300000)
|
|
3340
3275
|
* ```
|
|
3341
3276
|
*
|
|
3342
3277
|
* @category math
|
|
@@ -3348,13 +3283,13 @@ export declare const subtractDuration: {
|
|
|
3348
3283
|
*
|
|
3349
3284
|
* **Example** (Subtracting durations)
|
|
3350
3285
|
*
|
|
3351
|
-
* ```ts
|
|
3286
|
+
* ```ts import.meta.vitest
|
|
3352
3287
|
* import { DateTime } from "effect"
|
|
3353
3288
|
*
|
|
3354
3289
|
* // subtract 5 minutes
|
|
3355
3290
|
* DateTime.makeUnsafe(0).pipe(
|
|
3356
3291
|
* DateTime.subtractDuration("5 minutes")
|
|
3357
|
-
* )
|
|
3292
|
+
* ) // => DateTime.makeUnsafe(-300000)
|
|
3358
3293
|
* ```
|
|
3359
3294
|
*
|
|
3360
3295
|
* @category math
|
|
@@ -3366,13 +3301,13 @@ export declare const subtractDuration: {
|
|
|
3366
3301
|
*
|
|
3367
3302
|
* **Example** (Subtracting durations)
|
|
3368
3303
|
*
|
|
3369
|
-
* ```ts
|
|
3304
|
+
* ```ts import.meta.vitest
|
|
3370
3305
|
* import { DateTime } from "effect"
|
|
3371
3306
|
*
|
|
3372
3307
|
* // subtract 5 minutes
|
|
3373
3308
|
* DateTime.makeUnsafe(0).pipe(
|
|
3374
3309
|
* DateTime.subtractDuration("5 minutes")
|
|
3375
|
-
* )
|
|
3310
|
+
* ) // => DateTime.makeUnsafe(-300000)
|
|
3376
3311
|
* ```
|
|
3377
3312
|
*
|
|
3378
3313
|
* @category math
|
|
@@ -3390,13 +3325,13 @@ export declare const subtractDuration: {
|
|
|
3390
3325
|
*
|
|
3391
3326
|
* **Example** (Adding date and time parts)
|
|
3392
3327
|
*
|
|
3393
|
-
* ```ts
|
|
3328
|
+
* ```ts import.meta.vitest
|
|
3394
3329
|
* import { DateTime } from "effect"
|
|
3395
3330
|
*
|
|
3396
3331
|
* // add 5 minutes
|
|
3397
3332
|
* DateTime.makeUnsafe(0).pipe(
|
|
3398
3333
|
* DateTime.add({ minutes: 5 })
|
|
3399
|
-
* )
|
|
3334
|
+
* ) // => DateTime.makeUnsafe(300000)
|
|
3400
3335
|
* ```
|
|
3401
3336
|
*
|
|
3402
3337
|
* @category math
|
|
@@ -3413,13 +3348,13 @@ export declare const add: {
|
|
|
3413
3348
|
*
|
|
3414
3349
|
* **Example** (Adding date and time parts)
|
|
3415
3350
|
*
|
|
3416
|
-
* ```ts
|
|
3351
|
+
* ```ts import.meta.vitest
|
|
3417
3352
|
* import { DateTime } from "effect"
|
|
3418
3353
|
*
|
|
3419
3354
|
* // add 5 minutes
|
|
3420
3355
|
* DateTime.makeUnsafe(0).pipe(
|
|
3421
3356
|
* DateTime.add({ minutes: 5 })
|
|
3422
|
-
* )
|
|
3357
|
+
* ) // => DateTime.makeUnsafe(300000)
|
|
3423
3358
|
* ```
|
|
3424
3359
|
*
|
|
3425
3360
|
* @category math
|
|
@@ -3436,13 +3371,13 @@ export declare const add: {
|
|
|
3436
3371
|
*
|
|
3437
3372
|
* **Example** (Adding date and time parts)
|
|
3438
3373
|
*
|
|
3439
|
-
* ```ts
|
|
3374
|
+
* ```ts import.meta.vitest
|
|
3440
3375
|
* import { DateTime } from "effect"
|
|
3441
3376
|
*
|
|
3442
3377
|
* // add 5 minutes
|
|
3443
3378
|
* DateTime.makeUnsafe(0).pipe(
|
|
3444
3379
|
* DateTime.add({ minutes: 5 })
|
|
3445
|
-
* )
|
|
3380
|
+
* ) // => DateTime.makeUnsafe(300000)
|
|
3446
3381
|
* ```
|
|
3447
3382
|
*
|
|
3448
3383
|
* @category math
|
|
@@ -3455,13 +3390,13 @@ export declare const add: {
|
|
|
3455
3390
|
*
|
|
3456
3391
|
* **Example** (Subtracting date and time parts)
|
|
3457
3392
|
*
|
|
3458
|
-
* ```ts
|
|
3393
|
+
* ```ts import.meta.vitest
|
|
3459
3394
|
* import { DateTime } from "effect"
|
|
3460
3395
|
*
|
|
3461
3396
|
* // subtract 5 minutes
|
|
3462
3397
|
* DateTime.makeUnsafe(0).pipe(
|
|
3463
3398
|
* DateTime.subtract({ minutes: 5 })
|
|
3464
|
-
* )
|
|
3399
|
+
* ) // => DateTime.makeUnsafe(-300000)
|
|
3465
3400
|
* ```
|
|
3466
3401
|
*
|
|
3467
3402
|
* @category math
|
|
@@ -3473,13 +3408,13 @@ export declare const subtract: {
|
|
|
3473
3408
|
*
|
|
3474
3409
|
* **Example** (Subtracting date and time parts)
|
|
3475
3410
|
*
|
|
3476
|
-
* ```ts
|
|
3411
|
+
* ```ts import.meta.vitest
|
|
3477
3412
|
* import { DateTime } from "effect"
|
|
3478
3413
|
*
|
|
3479
3414
|
* // subtract 5 minutes
|
|
3480
3415
|
* DateTime.makeUnsafe(0).pipe(
|
|
3481
3416
|
* DateTime.subtract({ minutes: 5 })
|
|
3482
|
-
* )
|
|
3417
|
+
* ) // => DateTime.makeUnsafe(-300000)
|
|
3483
3418
|
* ```
|
|
3484
3419
|
*
|
|
3485
3420
|
* @category math
|
|
@@ -3491,13 +3426,13 @@ export declare const subtract: {
|
|
|
3491
3426
|
*
|
|
3492
3427
|
* **Example** (Subtracting date and time parts)
|
|
3493
3428
|
*
|
|
3494
|
-
* ```ts
|
|
3429
|
+
* ```ts import.meta.vitest
|
|
3495
3430
|
* import { DateTime } from "effect"
|
|
3496
3431
|
*
|
|
3497
3432
|
* // subtract 5 minutes
|
|
3498
3433
|
* DateTime.makeUnsafe(0).pipe(
|
|
3499
3434
|
* DateTime.subtract({ minutes: 5 })
|
|
3500
|
-
* )
|
|
3435
|
+
* ) // => DateTime.makeUnsafe(-300000)
|
|
3501
3436
|
* ```
|
|
3502
3437
|
*
|
|
3503
3438
|
* @category math
|
|
@@ -3515,14 +3450,13 @@ export declare const subtract: {
|
|
|
3515
3450
|
*
|
|
3516
3451
|
* **Example** (Rounding down DateTime values)
|
|
3517
3452
|
*
|
|
3518
|
-
* ```ts
|
|
3453
|
+
* ```ts import.meta.vitest
|
|
3519
3454
|
* import { DateTime } from "effect"
|
|
3520
3455
|
*
|
|
3521
3456
|
* // returns "2024-01-01T00:00:00Z"
|
|
3522
3457
|
* DateTime.makeUnsafe("2024-01-01T12:00:00Z").pipe(
|
|
3523
3458
|
* DateTime.startOf("day"),
|
|
3524
|
-
*
|
|
3525
|
-
* )
|
|
3459
|
+
* ) // => DateTime.makeUnsafe("2024-01-01T00:00:00Z")
|
|
3526
3460
|
* ```
|
|
3527
3461
|
*
|
|
3528
3462
|
* @category math
|
|
@@ -3539,14 +3473,13 @@ export declare const startOf: {
|
|
|
3539
3473
|
*
|
|
3540
3474
|
* **Example** (Rounding down DateTime values)
|
|
3541
3475
|
*
|
|
3542
|
-
* ```ts
|
|
3476
|
+
* ```ts import.meta.vitest
|
|
3543
3477
|
* import { DateTime } from "effect"
|
|
3544
3478
|
*
|
|
3545
3479
|
* // returns "2024-01-01T00:00:00Z"
|
|
3546
3480
|
* DateTime.makeUnsafe("2024-01-01T12:00:00Z").pipe(
|
|
3547
3481
|
* DateTime.startOf("day"),
|
|
3548
|
-
*
|
|
3549
|
-
* )
|
|
3482
|
+
* ) // => DateTime.makeUnsafe("2024-01-01T00:00:00Z")
|
|
3550
3483
|
* ```
|
|
3551
3484
|
*
|
|
3552
3485
|
* @category math
|
|
@@ -3565,14 +3498,13 @@ export declare const startOf: {
|
|
|
3565
3498
|
*
|
|
3566
3499
|
* **Example** (Rounding down DateTime values)
|
|
3567
3500
|
*
|
|
3568
|
-
* ```ts
|
|
3501
|
+
* ```ts import.meta.vitest
|
|
3569
3502
|
* import { DateTime } from "effect"
|
|
3570
3503
|
*
|
|
3571
3504
|
* // returns "2024-01-01T00:00:00Z"
|
|
3572
3505
|
* DateTime.makeUnsafe("2024-01-01T12:00:00Z").pipe(
|
|
3573
3506
|
* DateTime.startOf("day"),
|
|
3574
|
-
*
|
|
3575
|
-
* )
|
|
3507
|
+
* ) // => DateTime.makeUnsafe("2024-01-01T00:00:00Z")
|
|
3576
3508
|
* ```
|
|
3577
3509
|
*
|
|
3578
3510
|
* @category math
|
|
@@ -3592,14 +3524,13 @@ export declare const startOf: {
|
|
|
3592
3524
|
*
|
|
3593
3525
|
* **Example** (Rounding up DateTime values)
|
|
3594
3526
|
*
|
|
3595
|
-
* ```ts
|
|
3527
|
+
* ```ts import.meta.vitest
|
|
3596
3528
|
* import { DateTime } from "effect"
|
|
3597
3529
|
*
|
|
3598
3530
|
* // returns "2024-01-01T23:59:59.999Z"
|
|
3599
3531
|
* DateTime.makeUnsafe("2024-01-01T12:00:00Z").pipe(
|
|
3600
3532
|
* DateTime.endOf("day"),
|
|
3601
|
-
*
|
|
3602
|
-
* )
|
|
3533
|
+
* ) // => DateTime.makeUnsafe("2024-01-01T23:59:59.999Z")
|
|
3603
3534
|
* ```
|
|
3604
3535
|
*
|
|
3605
3536
|
* @category math
|
|
@@ -3616,14 +3547,13 @@ export declare const endOf: {
|
|
|
3616
3547
|
*
|
|
3617
3548
|
* **Example** (Rounding up DateTime values)
|
|
3618
3549
|
*
|
|
3619
|
-
* ```ts
|
|
3550
|
+
* ```ts import.meta.vitest
|
|
3620
3551
|
* import { DateTime } from "effect"
|
|
3621
3552
|
*
|
|
3622
3553
|
* // returns "2024-01-01T23:59:59.999Z"
|
|
3623
3554
|
* DateTime.makeUnsafe("2024-01-01T12:00:00Z").pipe(
|
|
3624
3555
|
* DateTime.endOf("day"),
|
|
3625
|
-
*
|
|
3626
|
-
* )
|
|
3556
|
+
* ) // => DateTime.makeUnsafe("2024-01-01T23:59:59.999Z")
|
|
3627
3557
|
* ```
|
|
3628
3558
|
*
|
|
3629
3559
|
* @category math
|
|
@@ -3642,14 +3572,13 @@ export declare const endOf: {
|
|
|
3642
3572
|
*
|
|
3643
3573
|
* **Example** (Rounding up DateTime values)
|
|
3644
3574
|
*
|
|
3645
|
-
* ```ts
|
|
3575
|
+
* ```ts import.meta.vitest
|
|
3646
3576
|
* import { DateTime } from "effect"
|
|
3647
3577
|
*
|
|
3648
3578
|
* // returns "2024-01-01T23:59:59.999Z"
|
|
3649
3579
|
* DateTime.makeUnsafe("2024-01-01T12:00:00Z").pipe(
|
|
3650
3580
|
* DateTime.endOf("day"),
|
|
3651
|
-
*
|
|
3652
|
-
* )
|
|
3581
|
+
* ) // => DateTime.makeUnsafe("2024-01-01T23:59:59.999Z")
|
|
3653
3582
|
* ```
|
|
3654
3583
|
*
|
|
3655
3584
|
* @category math
|
|
@@ -3669,14 +3598,13 @@ export declare const endOf: {
|
|
|
3669
3598
|
*
|
|
3670
3599
|
* **Example** (Rounding DateTime values to nearest units)
|
|
3671
3600
|
*
|
|
3672
|
-
* ```ts
|
|
3601
|
+
* ```ts import.meta.vitest
|
|
3673
3602
|
* import { DateTime } from "effect"
|
|
3674
3603
|
*
|
|
3675
3604
|
* // returns "2024-01-02T00:00:00Z"
|
|
3676
3605
|
* DateTime.makeUnsafe("2024-01-01T12:01:00Z").pipe(
|
|
3677
3606
|
* DateTime.nearest("day"),
|
|
3678
|
-
*
|
|
3679
|
-
* )
|
|
3607
|
+
* ) // => DateTime.makeUnsafe("2024-01-02T00:00:00Z")
|
|
3680
3608
|
* ```
|
|
3681
3609
|
*
|
|
3682
3610
|
* @category math
|
|
@@ -3693,14 +3621,13 @@ export declare const nearest: {
|
|
|
3693
3621
|
*
|
|
3694
3622
|
* **Example** (Rounding DateTime values to nearest units)
|
|
3695
3623
|
*
|
|
3696
|
-
* ```ts
|
|
3624
|
+
* ```ts import.meta.vitest
|
|
3697
3625
|
* import { DateTime } from "effect"
|
|
3698
3626
|
*
|
|
3699
3627
|
* // returns "2024-01-02T00:00:00Z"
|
|
3700
3628
|
* DateTime.makeUnsafe("2024-01-01T12:01:00Z").pipe(
|
|
3701
3629
|
* DateTime.nearest("day"),
|
|
3702
|
-
*
|
|
3703
|
-
* )
|
|
3630
|
+
* ) // => DateTime.makeUnsafe("2024-01-02T00:00:00Z")
|
|
3704
3631
|
* ```
|
|
3705
3632
|
*
|
|
3706
3633
|
* @category math
|
|
@@ -3719,14 +3646,13 @@ export declare const nearest: {
|
|
|
3719
3646
|
*
|
|
3720
3647
|
* **Example** (Rounding DateTime values to nearest units)
|
|
3721
3648
|
*
|
|
3722
|
-
* ```ts
|
|
3649
|
+
* ```ts import.meta.vitest
|
|
3723
3650
|
* import { DateTime } from "effect"
|
|
3724
3651
|
*
|
|
3725
3652
|
* // returns "2024-01-02T00:00:00Z"
|
|
3726
3653
|
* DateTime.makeUnsafe("2024-01-01T12:01:00Z").pipe(
|
|
3727
3654
|
* DateTime.nearest("day"),
|
|
3728
|
-
*
|
|
3729
|
-
* )
|
|
3655
|
+
* ) // => DateTime.makeUnsafe("2024-01-02T00:00:00Z")
|
|
3730
3656
|
* ```
|
|
3731
3657
|
*
|
|
3732
3658
|
* @category math
|
|
@@ -3750,20 +3676,18 @@ export declare const nearest: {
|
|
|
3750
3676
|
*
|
|
3751
3677
|
* **Example** (Formatting DateTime values with Intl options)
|
|
3752
3678
|
*
|
|
3753
|
-
* ```ts
|
|
3679
|
+
* ```ts import.meta.vitest
|
|
3754
3680
|
* import { DateTime } from "effect"
|
|
3755
3681
|
*
|
|
3756
3682
|
* const dt = DateTime.makeZonedUnsafe("2024-06-15T14:30:00Z", {
|
|
3757
3683
|
* timeZone: "Europe/London"
|
|
3758
3684
|
* })
|
|
3759
3685
|
*
|
|
3760
|
-
*
|
|
3686
|
+
* DateTime.format(dt, {
|
|
3761
3687
|
* dateStyle: "full",
|
|
3762
3688
|
* timeStyle: "short",
|
|
3763
3689
|
* locale: "en-US"
|
|
3764
|
-
* })
|
|
3765
|
-
*
|
|
3766
|
-
* console.log(formatted) // "Saturday, June 15, 2024 at 3:30 PM"
|
|
3690
|
+
* }) // => "Saturday, June 15, 2024 at 3:30 PM"
|
|
3767
3691
|
* ```
|
|
3768
3692
|
*
|
|
3769
3693
|
* @category formatting
|
|
@@ -3784,20 +3708,18 @@ export declare const format: {
|
|
|
3784
3708
|
*
|
|
3785
3709
|
* **Example** (Formatting DateTime values with Intl options)
|
|
3786
3710
|
*
|
|
3787
|
-
* ```ts
|
|
3711
|
+
* ```ts import.meta.vitest
|
|
3788
3712
|
* import { DateTime } from "effect"
|
|
3789
3713
|
*
|
|
3790
3714
|
* const dt = DateTime.makeZonedUnsafe("2024-06-15T14:30:00Z", {
|
|
3791
3715
|
* timeZone: "Europe/London"
|
|
3792
3716
|
* })
|
|
3793
3717
|
*
|
|
3794
|
-
*
|
|
3718
|
+
* DateTime.format(dt, {
|
|
3795
3719
|
* dateStyle: "full",
|
|
3796
3720
|
* timeStyle: "short",
|
|
3797
3721
|
* locale: "en-US"
|
|
3798
|
-
* })
|
|
3799
|
-
*
|
|
3800
|
-
* console.log(formatted) // "Saturday, June 15, 2024 at 3:30 PM"
|
|
3722
|
+
* }) // => "Saturday, June 15, 2024 at 3:30 PM"
|
|
3801
3723
|
* ```
|
|
3802
3724
|
*
|
|
3803
3725
|
* @category formatting
|
|
@@ -3820,20 +3742,18 @@ export declare const format: {
|
|
|
3820
3742
|
*
|
|
3821
3743
|
* **Example** (Formatting DateTime values with Intl options)
|
|
3822
3744
|
*
|
|
3823
|
-
* ```ts
|
|
3745
|
+
* ```ts import.meta.vitest
|
|
3824
3746
|
* import { DateTime } from "effect"
|
|
3825
3747
|
*
|
|
3826
3748
|
* const dt = DateTime.makeZonedUnsafe("2024-06-15T14:30:00Z", {
|
|
3827
3749
|
* timeZone: "Europe/London"
|
|
3828
3750
|
* })
|
|
3829
3751
|
*
|
|
3830
|
-
*
|
|
3752
|
+
* DateTime.format(dt, {
|
|
3831
3753
|
* dateStyle: "full",
|
|
3832
3754
|
* timeStyle: "short",
|
|
3833
3755
|
* locale: "en-US"
|
|
3834
|
-
* })
|
|
3835
|
-
*
|
|
3836
|
-
* console.log(formatted) // "Saturday, June 15, 2024 at 3:30 PM"
|
|
3756
|
+
* }) // => "Saturday, June 15, 2024 at 3:30 PM"
|
|
3837
3757
|
* ```
|
|
3838
3758
|
*
|
|
3839
3759
|
* @category formatting
|
|
@@ -3849,21 +3769,19 @@ export declare const format: {
|
|
|
3849
3769
|
*
|
|
3850
3770
|
* **Example** (Formatting DateTime values locally)
|
|
3851
3771
|
*
|
|
3852
|
-
* ```ts
|
|
3772
|
+
* ```ts import.meta.vitest
|
|
3853
3773
|
* import { DateTime } from "effect"
|
|
3854
3774
|
*
|
|
3855
3775
|
* const dt = DateTime.makeUnsafe("2024-06-15T14:30:00Z")
|
|
3856
3776
|
*
|
|
3857
3777
|
* // Uses system local time zone and locale
|
|
3858
|
-
*
|
|
3778
|
+
* DateTime.formatLocal(dt, {
|
|
3859
3779
|
* year: "numeric",
|
|
3860
3780
|
* month: "long",
|
|
3861
3781
|
* day: "numeric",
|
|
3862
3782
|
* hour: "2-digit",
|
|
3863
3783
|
* minute: "2-digit"
|
|
3864
3784
|
* })
|
|
3865
|
-
*
|
|
3866
|
-
* console.log(local) // Output depends on system locale/timezone
|
|
3867
3785
|
* ```
|
|
3868
3786
|
*
|
|
3869
3787
|
* @category formatting
|
|
@@ -3876,21 +3794,19 @@ export declare const formatLocal: {
|
|
|
3876
3794
|
*
|
|
3877
3795
|
* **Example** (Formatting DateTime values locally)
|
|
3878
3796
|
*
|
|
3879
|
-
* ```ts
|
|
3797
|
+
* ```ts import.meta.vitest
|
|
3880
3798
|
* import { DateTime } from "effect"
|
|
3881
3799
|
*
|
|
3882
3800
|
* const dt = DateTime.makeUnsafe("2024-06-15T14:30:00Z")
|
|
3883
3801
|
*
|
|
3884
3802
|
* // Uses system local time zone and locale
|
|
3885
|
-
*
|
|
3803
|
+
* DateTime.formatLocal(dt, {
|
|
3886
3804
|
* year: "numeric",
|
|
3887
3805
|
* month: "long",
|
|
3888
3806
|
* day: "numeric",
|
|
3889
3807
|
* hour: "2-digit",
|
|
3890
3808
|
* minute: "2-digit"
|
|
3891
3809
|
* })
|
|
3892
|
-
*
|
|
3893
|
-
* console.log(local) // Output depends on system locale/timezone
|
|
3894
3810
|
* ```
|
|
3895
3811
|
*
|
|
3896
3812
|
* @category formatting
|
|
@@ -3905,21 +3821,19 @@ export declare const formatLocal: {
|
|
|
3905
3821
|
*
|
|
3906
3822
|
* **Example** (Formatting DateTime values locally)
|
|
3907
3823
|
*
|
|
3908
|
-
* ```ts
|
|
3824
|
+
* ```ts import.meta.vitest
|
|
3909
3825
|
* import { DateTime } from "effect"
|
|
3910
3826
|
*
|
|
3911
3827
|
* const dt = DateTime.makeUnsafe("2024-06-15T14:30:00Z")
|
|
3912
3828
|
*
|
|
3913
3829
|
* // Uses system local time zone and locale
|
|
3914
|
-
*
|
|
3830
|
+
* DateTime.formatLocal(dt, {
|
|
3915
3831
|
* year: "numeric",
|
|
3916
3832
|
* month: "long",
|
|
3917
3833
|
* day: "numeric",
|
|
3918
3834
|
* hour: "2-digit",
|
|
3919
3835
|
* minute: "2-digit"
|
|
3920
3836
|
* })
|
|
3921
|
-
*
|
|
3922
|
-
* console.log(local) // Output depends on system locale/timezone
|
|
3923
3837
|
* ```
|
|
3924
3838
|
*
|
|
3925
3839
|
* @category formatting
|
|
@@ -3938,7 +3852,7 @@ export declare const formatLocal: {
|
|
|
3938
3852
|
*
|
|
3939
3853
|
* **Example** (Formatting DateTime values in UTC)
|
|
3940
3854
|
*
|
|
3941
|
-
* ```ts
|
|
3855
|
+
* ```ts import.meta.vitest
|
|
3942
3856
|
* import { DateTime } from "effect"
|
|
3943
3857
|
*
|
|
3944
3858
|
* const dt = DateTime.makeZonedUnsafe("2024-06-15T14:30:00Z", {
|
|
@@ -3946,7 +3860,7 @@ export declare const formatLocal: {
|
|
|
3946
3860
|
* })
|
|
3947
3861
|
*
|
|
3948
3862
|
* // Force UTC formatting regardless of time zone
|
|
3949
|
-
*
|
|
3863
|
+
* DateTime.formatUtc(dt, {
|
|
3950
3864
|
* year: "numeric",
|
|
3951
3865
|
* month: "2-digit",
|
|
3952
3866
|
* day: "2-digit",
|
|
@@ -3954,8 +3868,6 @@ export declare const formatLocal: {
|
|
|
3954
3868
|
* minute: "2-digit",
|
|
3955
3869
|
* timeZoneName: "short"
|
|
3956
3870
|
* })
|
|
3957
|
-
*
|
|
3958
|
-
* console.log(utcFormatted) // "06/15/2024, 02:30 PM UTC"
|
|
3959
3871
|
* ```
|
|
3960
3872
|
*
|
|
3961
3873
|
* @category formatting
|
|
@@ -3971,7 +3883,7 @@ export declare const formatUtc: {
|
|
|
3971
3883
|
*
|
|
3972
3884
|
* **Example** (Formatting DateTime values in UTC)
|
|
3973
3885
|
*
|
|
3974
|
-
* ```ts
|
|
3886
|
+
* ```ts import.meta.vitest
|
|
3975
3887
|
* import { DateTime } from "effect"
|
|
3976
3888
|
*
|
|
3977
3889
|
* const dt = DateTime.makeZonedUnsafe("2024-06-15T14:30:00Z", {
|
|
@@ -3979,7 +3891,7 @@ export declare const formatUtc: {
|
|
|
3979
3891
|
* })
|
|
3980
3892
|
*
|
|
3981
3893
|
* // Force UTC formatting regardless of time zone
|
|
3982
|
-
*
|
|
3894
|
+
* DateTime.formatUtc(dt, {
|
|
3983
3895
|
* year: "numeric",
|
|
3984
3896
|
* month: "2-digit",
|
|
3985
3897
|
* day: "2-digit",
|
|
@@ -3987,8 +3899,6 @@ export declare const formatUtc: {
|
|
|
3987
3899
|
* minute: "2-digit",
|
|
3988
3900
|
* timeZoneName: "short"
|
|
3989
3901
|
* })
|
|
3990
|
-
*
|
|
3991
|
-
* console.log(utcFormatted) // "06/15/2024, 02:30 PM UTC"
|
|
3992
3902
|
* ```
|
|
3993
3903
|
*
|
|
3994
3904
|
* @category formatting
|
|
@@ -4006,7 +3916,7 @@ export declare const formatUtc: {
|
|
|
4006
3916
|
*
|
|
4007
3917
|
* **Example** (Formatting DateTime values in UTC)
|
|
4008
3918
|
*
|
|
4009
|
-
* ```ts
|
|
3919
|
+
* ```ts import.meta.vitest
|
|
4010
3920
|
* import { DateTime } from "effect"
|
|
4011
3921
|
*
|
|
4012
3922
|
* const dt = DateTime.makeZonedUnsafe("2024-06-15T14:30:00Z", {
|
|
@@ -4014,7 +3924,7 @@ export declare const formatUtc: {
|
|
|
4014
3924
|
* })
|
|
4015
3925
|
*
|
|
4016
3926
|
* // Force UTC formatting regardless of time zone
|
|
4017
|
-
*
|
|
3927
|
+
* DateTime.formatUtc(dt, {
|
|
4018
3928
|
* year: "numeric",
|
|
4019
3929
|
* month: "2-digit",
|
|
4020
3930
|
* day: "2-digit",
|
|
@@ -4022,8 +3932,6 @@ export declare const formatUtc: {
|
|
|
4022
3932
|
* minute: "2-digit",
|
|
4023
3933
|
* timeZoneName: "short"
|
|
4024
3934
|
* })
|
|
4025
|
-
*
|
|
4026
|
-
* console.log(utcFormatted) // "06/15/2024, 02:30 PM UTC"
|
|
4027
3935
|
* ```
|
|
4028
3936
|
*
|
|
4029
3937
|
* @category formatting
|
|
@@ -4048,7 +3956,7 @@ export declare const formatUtc: {
|
|
|
4048
3956
|
*
|
|
4049
3957
|
* **Example** (Formatting DateTime values with custom formatters)
|
|
4050
3958
|
*
|
|
4051
|
-
* ```ts
|
|
3959
|
+
* ```ts import.meta.vitest
|
|
4052
3960
|
* import { DateTime } from "effect"
|
|
4053
3961
|
*
|
|
4054
3962
|
* const dt = DateTime.makeUnsafe("2024-06-15T14:30:00Z")
|
|
@@ -4063,8 +3971,7 @@ export declare const formatUtc: {
|
|
|
4063
3971
|
* timeZone: "Europe/Berlin"
|
|
4064
3972
|
* })
|
|
4065
3973
|
*
|
|
4066
|
-
*
|
|
4067
|
-
* console.log(formatted.length > 0) // true
|
|
3974
|
+
* DateTime.formatIntl(dt, formatter).length > 0 // => true
|
|
4068
3975
|
* ```
|
|
4069
3976
|
*
|
|
4070
3977
|
* @see {@link formatUtc} for formatting with options forced to UTC
|
|
@@ -4089,7 +3996,7 @@ export declare const formatIntl: {
|
|
|
4089
3996
|
*
|
|
4090
3997
|
* **Example** (Formatting DateTime values with custom formatters)
|
|
4091
3998
|
*
|
|
4092
|
-
* ```ts
|
|
3999
|
+
* ```ts import.meta.vitest
|
|
4093
4000
|
* import { DateTime } from "effect"
|
|
4094
4001
|
*
|
|
4095
4002
|
* const dt = DateTime.makeUnsafe("2024-06-15T14:30:00Z")
|
|
@@ -4104,8 +4011,7 @@ export declare const formatIntl: {
|
|
|
4104
4011
|
* timeZone: "Europe/Berlin"
|
|
4105
4012
|
* })
|
|
4106
4013
|
*
|
|
4107
|
-
*
|
|
4108
|
-
* console.log(formatted.length > 0) // true
|
|
4014
|
+
* DateTime.formatIntl(dt, formatter).length > 0 // => true
|
|
4109
4015
|
* ```
|
|
4110
4016
|
*
|
|
4111
4017
|
* @see {@link formatUtc} for formatting with options forced to UTC
|
|
@@ -4130,7 +4036,7 @@ export declare const formatIntl: {
|
|
|
4130
4036
|
*
|
|
4131
4037
|
* **Example** (Formatting DateTime values with custom formatters)
|
|
4132
4038
|
*
|
|
4133
|
-
* ```ts
|
|
4039
|
+
* ```ts import.meta.vitest
|
|
4134
4040
|
* import { DateTime } from "effect"
|
|
4135
4041
|
*
|
|
4136
4042
|
* const dt = DateTime.makeUnsafe("2024-06-15T14:30:00Z")
|
|
@@ -4145,8 +4051,7 @@ export declare const formatIntl: {
|
|
|
4145
4051
|
* timeZone: "Europe/Berlin"
|
|
4146
4052
|
* })
|
|
4147
4053
|
*
|
|
4148
|
-
*
|
|
4149
|
-
* console.log(formatted.length > 0) // true
|
|
4054
|
+
* DateTime.formatIntl(dt, formatter).length > 0 // => true
|
|
4150
4055
|
* ```
|
|
4151
4056
|
*
|
|
4152
4057
|
* @see {@link formatUtc} for formatting with options forced to UTC
|
|
@@ -4166,16 +4071,15 @@ export declare const formatIntl: {
|
|
|
4166
4071
|
*
|
|
4167
4072
|
* **Example** (Formatting DateTime values as ISO strings)
|
|
4168
4073
|
*
|
|
4169
|
-
* ```ts
|
|
4074
|
+
* ```ts import.meta.vitest
|
|
4170
4075
|
* import { DateTime } from "effect"
|
|
4171
4076
|
*
|
|
4172
|
-
*
|
|
4173
|
-
* console.log(DateTime.formatIso(dt)) // "2024-01-01T12:30:45.123Z"
|
|
4077
|
+
* DateTime.formatIso(DateTime.makeUnsafe("2024-01-01T12:30:45.123Z")) // => "2024-01-01T12:30:45.123Z"
|
|
4174
4078
|
*
|
|
4175
4079
|
* const zoned = DateTime.makeZonedUnsafe("2024-01-01T12:30:45.123Z", {
|
|
4176
4080
|
* timeZone: "Europe/London"
|
|
4177
4081
|
* })
|
|
4178
|
-
*
|
|
4082
|
+
* DateTime.formatIso(zoned) // => "2024-01-01T12:30:45.123Z"
|
|
4179
4083
|
* ```
|
|
4180
4084
|
*
|
|
4181
4085
|
* @category formatting
|
|
@@ -4191,16 +4095,16 @@ export declare const formatIso: (self: DateTime) => string;
|
|
|
4191
4095
|
*
|
|
4192
4096
|
* **Example** (Formatting DateTime values as ISO dates)
|
|
4193
4097
|
*
|
|
4194
|
-
* ```ts
|
|
4098
|
+
* ```ts import.meta.vitest
|
|
4195
4099
|
* import { DateTime } from "effect"
|
|
4196
4100
|
*
|
|
4197
4101
|
* const dt = DateTime.makeUnsafe("2024-01-01T23:30:00Z")
|
|
4198
|
-
*
|
|
4102
|
+
* DateTime.formatIsoDate(dt) // => "2024-01-01"
|
|
4199
4103
|
*
|
|
4200
4104
|
* const zoned = DateTime.makeZonedUnsafe("2024-01-01T23:30:00Z", {
|
|
4201
4105
|
* timeZone: "Pacific/Auckland" // UTC+12/13
|
|
4202
4106
|
* })
|
|
4203
|
-
*
|
|
4107
|
+
* DateTime.formatIsoDate(zoned) // => "2024-01-02"
|
|
4204
4108
|
* ```
|
|
4205
4109
|
*
|
|
4206
4110
|
* @category formatting
|
|
@@ -4216,16 +4120,16 @@ export declare const formatIsoDate: (self: DateTime) => string;
|
|
|
4216
4120
|
*
|
|
4217
4121
|
* **Example** (Formatting DateTime values as UTC ISO dates)
|
|
4218
4122
|
*
|
|
4219
|
-
* ```ts
|
|
4123
|
+
* ```ts import.meta.vitest
|
|
4220
4124
|
* import { DateTime } from "effect"
|
|
4221
4125
|
*
|
|
4222
4126
|
* const dt = DateTime.makeUnsafe("2024-01-01T23:30:00Z")
|
|
4223
|
-
*
|
|
4127
|
+
* DateTime.formatIsoDateUtc(dt) // => "2024-01-01"
|
|
4224
4128
|
*
|
|
4225
4129
|
* const zoned = DateTime.makeZonedUnsafe("2024-01-01T23:30:00Z", {
|
|
4226
4130
|
* timeZone: "Pacific/Auckland"
|
|
4227
4131
|
* })
|
|
4228
|
-
*
|
|
4132
|
+
* DateTime.formatIsoDateUtc(zoned) // => "2024-01-01"
|
|
4229
4133
|
* ```
|
|
4230
4134
|
*
|
|
4231
4135
|
* @category formatting
|
|
@@ -4242,16 +4146,16 @@ export declare const formatIsoDateUtc: (self: DateTime) => string;
|
|
|
4242
4146
|
*
|
|
4243
4147
|
* **Example** (Formatting DateTime values with offsets)
|
|
4244
4148
|
*
|
|
4245
|
-
* ```ts
|
|
4149
|
+
* ```ts import.meta.vitest
|
|
4246
4150
|
* import { DateTime } from "effect"
|
|
4247
4151
|
*
|
|
4248
4152
|
* const utc = DateTime.makeUnsafe("2024-01-01T12:00:00Z")
|
|
4249
|
-
*
|
|
4153
|
+
* DateTime.formatIsoOffset(utc) // => "2024-01-01T12:00:00.000Z"
|
|
4250
4154
|
*
|
|
4251
4155
|
* const zoned = DateTime.makeZonedUnsafe("2024-01-01T12:00:00Z", {
|
|
4252
4156
|
* timeZone: DateTime.zoneMakeOffset(3 * 60 * 60 * 1000)
|
|
4253
4157
|
* })
|
|
4254
|
-
*
|
|
4158
|
+
* DateTime.formatIsoOffset(zoned) // => "2024-01-01T15:00:00.000+03:00"
|
|
4255
4159
|
* ```
|
|
4256
4160
|
*
|
|
4257
4161
|
* @category formatting
|
|
@@ -4267,22 +4171,20 @@ export declare const formatIsoOffset: (self: DateTime) => string;
|
|
|
4267
4171
|
*
|
|
4268
4172
|
* **Example** (Formatting zoned DateTime values)
|
|
4269
4173
|
*
|
|
4270
|
-
* ```ts
|
|
4174
|
+
* ```ts import.meta.vitest
|
|
4271
4175
|
* import { DateTime } from "effect"
|
|
4272
4176
|
*
|
|
4273
4177
|
* const zoned = DateTime.makeZonedUnsafe("2024-06-15T14:30:45.123Z", {
|
|
4274
4178
|
* timeZone: "Europe/London"
|
|
4275
4179
|
* })
|
|
4276
4180
|
*
|
|
4277
|
-
*
|
|
4278
|
-
* console.log(formatted) // "2024-06-15T15:30:45.123+01:00[Europe/London]"
|
|
4181
|
+
* DateTime.formatIsoZoned(zoned) // => "2024-06-15T15:30:45.123+01:00[Europe/London]"
|
|
4279
4182
|
*
|
|
4280
4183
|
* const offsetZone = DateTime.makeZonedUnsafe("2024-06-15T14:30:45.123Z", {
|
|
4281
4184
|
* timeZone: DateTime.zoneMakeOffset(3 * 60 * 60 * 1000)
|
|
4282
4185
|
* })
|
|
4283
4186
|
*
|
|
4284
|
-
*
|
|
4285
|
-
* console.log(offsetFormatted) // "2024-06-15T17:30:45.123+03:00"
|
|
4187
|
+
* DateTime.formatIsoZoned(offsetZone) // => "2024-06-15T17:30:45.123+03:00"
|
|
4286
4188
|
* ```
|
|
4287
4189
|
*
|
|
4288
4190
|
* @category formatting
|
|
@@ -4298,7 +4200,7 @@ export declare const formatIsoZoned: (self: Zoned) => string;
|
|
|
4298
4200
|
*
|
|
4299
4201
|
* **Example** (Providing current time zone layers)
|
|
4300
4202
|
*
|
|
4301
|
-
* ```ts
|
|
4203
|
+
* ```ts import.meta.vitest
|
|
4302
4204
|
* import { DateTime, Effect } from "effect"
|
|
4303
4205
|
*
|
|
4304
4206
|
* const zone = DateTime.zoneMakeNamedUnsafe("Europe/London")
|
|
@@ -4306,14 +4208,14 @@ export declare const formatIsoZoned: (self: Zoned) => string;
|
|
|
4306
4208
|
*
|
|
4307
4209
|
* const program = Effect.gen(function*() {
|
|
4308
4210
|
* const now = yield* DateTime.nowInCurrentZone
|
|
4309
|
-
* return DateTime.
|
|
4211
|
+
* return DateTime.zoneToString(now.zone)
|
|
4310
4212
|
* })
|
|
4311
4213
|
*
|
|
4312
4214
|
* // Use the layer to provide the time zone
|
|
4313
|
-
* Effect.provide(program, layer)
|
|
4215
|
+
* await Effect.runPromise(Effect.provide(program, layer)) // => "Europe/London"
|
|
4314
4216
|
* ```
|
|
4315
4217
|
*
|
|
4316
|
-
* @category
|
|
4218
|
+
* @category layers
|
|
4317
4219
|
* @since 3.6.0
|
|
4318
4220
|
*/
|
|
4319
4221
|
export declare const layerCurrentZone: (resource: NoInfer<TimeZone>) => Layer.Layer<CurrentTimeZone>;
|
|
@@ -4326,7 +4228,7 @@ export declare const layerCurrentZone: (resource: NoInfer<TimeZone>) => Layer.La
|
|
|
4326
4228
|
*
|
|
4327
4229
|
* **Example** (Providing fixed-offset time zone layers)
|
|
4328
4230
|
*
|
|
4329
|
-
* ```ts
|
|
4231
|
+
* ```ts import.meta.vitest
|
|
4330
4232
|
* import { DateTime, Effect } from "effect"
|
|
4331
4233
|
*
|
|
4332
4234
|
* // Create a layer for UTC+3
|
|
@@ -4334,13 +4236,13 @@ export declare const layerCurrentZone: (resource: NoInfer<TimeZone>) => Layer.La
|
|
|
4334
4236
|
*
|
|
4335
4237
|
* const program = Effect.gen(function*() {
|
|
4336
4238
|
* const now = yield* DateTime.nowInCurrentZone
|
|
4337
|
-
* return DateTime.
|
|
4239
|
+
* return DateTime.zoneToString(now.zone)
|
|
4338
4240
|
* })
|
|
4339
4241
|
*
|
|
4340
|
-
* Effect.provide(program, layer)
|
|
4242
|
+
* await Effect.runPromise(Effect.provide(program, layer)) // => "+03:00"
|
|
4341
4243
|
* ```
|
|
4342
4244
|
*
|
|
4343
|
-
* @category
|
|
4245
|
+
* @category layers
|
|
4344
4246
|
* @since 3.6.0
|
|
4345
4247
|
*/
|
|
4346
4248
|
export declare const layerCurrentZoneOffset: (offset: number) => Layer.Layer<CurrentTimeZone>;
|
|
@@ -4354,20 +4256,20 @@ export declare const layerCurrentZoneOffset: (offset: number) => Layer.Layer<Cur
|
|
|
4354
4256
|
*
|
|
4355
4257
|
* **Example** (Providing named time zone layers)
|
|
4356
4258
|
*
|
|
4357
|
-
* ```ts
|
|
4259
|
+
* ```ts import.meta.vitest
|
|
4358
4260
|
* import { DateTime, Effect } from "effect"
|
|
4359
4261
|
*
|
|
4360
4262
|
* const layer = DateTime.layerCurrentZoneNamed("Europe/London")
|
|
4361
4263
|
*
|
|
4362
4264
|
* const program = Effect.gen(function*() {
|
|
4363
4265
|
* const now = yield* DateTime.nowInCurrentZone
|
|
4364
|
-
* return DateTime.
|
|
4266
|
+
* return DateTime.zoneToString(now.zone)
|
|
4365
4267
|
* })
|
|
4366
4268
|
*
|
|
4367
|
-
* Effect.provide(program, layer)
|
|
4269
|
+
* await Effect.runPromise(Effect.provide(program, layer)) // => "Europe/London"
|
|
4368
4270
|
* ```
|
|
4369
4271
|
*
|
|
4370
|
-
* @category
|
|
4272
|
+
* @category layers
|
|
4371
4273
|
* @since 3.6.0
|
|
4372
4274
|
*/
|
|
4373
4275
|
export declare const layerCurrentZoneNamed: (zoneId: string) => Layer.Layer<CurrentTimeZone, IllegalArgumentError>;
|
|
@@ -4381,19 +4283,19 @@ export declare const layerCurrentZoneNamed: (zoneId: string) => Layer.Layer<Curr
|
|
|
4381
4283
|
*
|
|
4382
4284
|
* **Example** (Providing local time zone layers)
|
|
4383
4285
|
*
|
|
4384
|
-
* ```ts
|
|
4286
|
+
* ```ts import.meta.vitest
|
|
4385
4287
|
* import { DateTime, Effect } from "effect"
|
|
4386
4288
|
*
|
|
4387
4289
|
* const program = Effect.gen(function*() {
|
|
4388
4290
|
* const now = yield* DateTime.nowInCurrentZone
|
|
4389
|
-
* return DateTime.
|
|
4291
|
+
* return DateTime.isZoned(now)
|
|
4390
4292
|
* })
|
|
4391
4293
|
*
|
|
4392
4294
|
* // Use the system's local time zone
|
|
4393
|
-
* Effect.provide(program, DateTime.layerCurrentZoneLocal)
|
|
4295
|
+
* await Effect.runPromise(Effect.provide(program, DateTime.layerCurrentZoneLocal)) // => true
|
|
4394
4296
|
* ```
|
|
4395
4297
|
*
|
|
4396
|
-
* @category
|
|
4298
|
+
* @category layers
|
|
4397
4299
|
* @since 3.6.0
|
|
4398
4300
|
*/
|
|
4399
4301
|
export declare const layerCurrentZoneLocal: Layer.Layer<CurrentTimeZone>;
|