effect 4.0.0-beta.65 → 4.0.0-beta.67
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 +113 -67
- package/dist/Array.d.ts.map +1 -1
- package/dist/Array.js +28 -18
- package/dist/Array.js.map +1 -1
- package/dist/BigDecimal.d.ts +404 -337
- package/dist/BigDecimal.d.ts.map +1 -1
- package/dist/BigDecimal.js +190 -146
- package/dist/BigDecimal.js.map +1 -1
- package/dist/BigInt.d.ts +167 -97
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +87 -47
- package/dist/BigInt.js.map +1 -1
- package/dist/Boolean.d.ts +62 -31
- package/dist/Boolean.d.ts.map +1 -1
- package/dist/Boolean.js +30 -15
- package/dist/Boolean.js.map +1 -1
- package/dist/Brand.d.ts +20 -1
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +16 -0
- package/dist/Brand.js.map +1 -1
- package/dist/Cache.d.ts +236 -132
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +133 -57
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +77 -65
- package/dist/Cause.d.ts.map +1 -1
- package/dist/Cause.js +43 -36
- package/dist/Cause.js.map +1 -1
- package/dist/Channel.d.ts +1518 -575
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +661 -287
- package/dist/Channel.js.map +1 -1
- package/dist/ChannelSchema.d.ts +119 -10
- package/dist/ChannelSchema.d.ts.map +1 -1
- package/dist/ChannelSchema.js +45 -6
- package/dist/ChannelSchema.js.map +1 -1
- package/dist/Chunk.d.ts +548 -379
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +238 -170
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +15 -8
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js +8 -4
- package/dist/Clock.js.map +1 -1
- package/dist/Combiner.d.ts +2 -4
- package/dist/Combiner.d.ts.map +1 -1
- package/dist/Combiner.js +2 -4
- package/dist/Combiner.js.map +1 -1
- package/dist/Config.d.ts +5 -4
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +9 -8
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +1 -1
- package/dist/ConfigProvider.js +1 -1
- package/dist/Console.d.ts +76 -50
- package/dist/Console.d.ts.map +1 -1
- package/dist/Console.js +69 -46
- package/dist/Console.js.map +1 -1
- package/dist/Context.d.ts +386 -138
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +144 -62
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +69 -48
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +96 -36
- package/dist/Cron.js.map +1 -1
- package/dist/Data.d.ts +3 -2
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js.map +1 -1
- package/dist/DateTime.d.ts +875 -444
- package/dist/DateTime.d.ts.map +1 -1
- package/dist/DateTime.js +376 -217
- package/dist/DateTime.js.map +1 -1
- package/dist/Deferred.d.ts +367 -174
- package/dist/Deferred.d.ts.map +1 -1
- package/dist/Deferred.js +145 -71
- package/dist/Deferred.js.map +1 -1
- package/dist/Differ.d.ts +42 -0
- package/dist/Differ.d.ts.map +1 -1
- package/dist/Differ.js +36 -0
- package/dist/Duration.d.ts +329 -185
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +174 -106
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +2445 -2356
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +906 -758
- package/dist/Effect.js.map +1 -1
- package/dist/Effectable.d.ts +38 -3
- package/dist/Effectable.d.ts.map +1 -1
- package/dist/Effectable.js +3 -3
- package/dist/Effectable.js.map +1 -1
- package/dist/Encoding.d.ts +78 -28
- package/dist/Encoding.d.ts.map +1 -1
- package/dist/Encoding.js +75 -27
- package/dist/Encoding.js.map +1 -1
- package/dist/Equivalence.d.ts +14 -19
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +14 -19
- package/dist/Equivalence.js.map +1 -1
- package/dist/ErrorReporter.d.ts +66 -82
- package/dist/ErrorReporter.d.ts.map +1 -1
- package/dist/ErrorReporter.js +38 -29
- package/dist/ErrorReporter.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +96 -12
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +21 -6
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/Exit.d.ts +7 -5
- package/dist/Exit.d.ts.map +1 -1
- package/dist/Exit.js.map +1 -1
- package/dist/Fiber.d.ts +72 -40
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +39 -21
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +119 -58
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +122 -40
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +288 -160
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +176 -74
- package/dist/FiberMap.js.map +1 -1
- package/dist/FiberSet.d.ts +93 -52
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +97 -34
- package/dist/FiberSet.js.map +1 -1
- package/dist/FileSystem.d.ts +104 -73
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +53 -39
- package/dist/FileSystem.js.map +1 -1
- package/dist/Filter.d.ts +166 -88
- package/dist/Filter.d.ts.map +1 -1
- package/dist/Filter.js +68 -42
- package/dist/Filter.js.map +1 -1
- package/dist/Function.d.ts +154 -86
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +53 -37
- package/dist/Function.js.map +1 -1
- package/dist/Graph.d.ts +682 -365
- package/dist/Graph.d.ts.map +1 -1
- package/dist/Graph.js +308 -157
- package/dist/Graph.js.map +1 -1
- package/dist/HKT.d.ts +29 -13
- package/dist/HKT.d.ts.map +1 -1
- package/dist/Hash.d.ts +31 -18
- package/dist/Hash.d.ts.map +1 -1
- package/dist/Hash.js +25 -15
- package/dist/Hash.js.map +1 -1
- package/dist/HashMap.d.ts +444 -256
- package/dist/HashMap.d.ts.map +1 -1
- package/dist/HashMap.js +223 -105
- package/dist/HashMap.js.map +1 -1
- package/dist/HashRing.d.ts +36 -17
- package/dist/HashRing.d.ts.map +1 -1
- package/dist/HashRing.js +75 -8
- package/dist/HashRing.js.map +1 -1
- package/dist/HashSet.d.ts +194 -104
- package/dist/HashSet.d.ts.map +1 -1
- package/dist/HashSet.js +93 -38
- package/dist/HashSet.js.map +1 -1
- package/dist/Inspectable.d.ts +20 -9
- package/dist/Inspectable.d.ts.map +1 -1
- package/dist/Inspectable.js +16 -6
- package/dist/Inspectable.js.map +1 -1
- package/dist/Iterable.d.ts +309 -149
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +129 -65
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts +4 -3
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +4 -3
- package/dist/JsonPatch.js.map +1 -1
- package/dist/Latch.d.ts +98 -15
- package/dist/Latch.d.ts.map +1 -1
- package/dist/Latch.js +41 -10
- package/dist/Latch.js.map +1 -1
- package/dist/Layer.d.ts +412 -309
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +262 -181
- package/dist/Layer.js.map +1 -1
- package/dist/LayerMap.d.ts +95 -21
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +58 -14
- package/dist/LayerMap.js.map +1 -1
- package/dist/LogLevel.d.ts +92 -131
- package/dist/LogLevel.d.ts.map +1 -1
- package/dist/LogLevel.js +25 -15
- package/dist/LogLevel.js.map +1 -1
- package/dist/Logger.d.ts +155 -99
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +211 -184
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +75 -17
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +22 -16
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Match.d.ts +133 -157
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +85 -76
- package/dist/Match.js.map +1 -1
- package/dist/Metric.d.ts +325 -284
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +217 -212
- package/dist/Metric.js.map +1 -1
- package/dist/MutableHashMap.d.ts +117 -58
- package/dist/MutableHashMap.d.ts.map +1 -1
- package/dist/MutableHashMap.js +52 -29
- package/dist/MutableHashMap.js.map +1 -1
- package/dist/MutableHashSet.d.ts +52 -30
- package/dist/MutableHashSet.d.ts.map +1 -1
- package/dist/MutableHashSet.js +94 -38
- package/dist/MutableHashSet.js.map +1 -1
- package/dist/MutableList.d.ts +92 -49
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +123 -71
- package/dist/MutableList.js.map +1 -1
- package/dist/MutableRef.d.ts +99 -62
- package/dist/MutableRef.d.ts.map +1 -1
- package/dist/MutableRef.js +79 -60
- package/dist/MutableRef.js.map +1 -1
- package/dist/Newtype.d.ts +3 -0
- package/dist/Newtype.d.ts.map +1 -1
- package/dist/Newtype.js.map +1 -1
- package/dist/NonEmptyIterable.d.ts +36 -39
- package/dist/NonEmptyIterable.d.ts.map +1 -1
- package/dist/NonEmptyIterable.js +34 -20
- package/dist/NonEmptyIterable.js.map +1 -1
- package/dist/Number.d.ts +116 -64
- package/dist/Number.d.ts.map +1 -1
- package/dist/Number.js +54 -30
- package/dist/Number.js.map +1 -1
- package/dist/Optic.d.ts +1 -2
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +0 -1
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts +38 -53
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +87 -11
- package/dist/Option.js.map +1 -1
- package/dist/Ordering.d.ts +43 -28
- package/dist/Ordering.d.ts.map +1 -1
- package/dist/Ordering.js +4 -2
- package/dist/Ordering.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts +225 -40
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.js +113 -17
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Path.d.ts +77 -13
- package/dist/Path.d.ts.map +1 -1
- package/dist/Path.js +48 -4
- package/dist/Path.js.map +1 -1
- package/dist/Pipeable.d.ts +71 -15
- package/dist/Pipeable.d.ts.map +1 -1
- package/dist/Pipeable.js +59 -12
- package/dist/Pipeable.js.map +1 -1
- package/dist/PlatformError.d.ts +74 -6
- package/dist/PlatformError.d.ts.map +1 -1
- package/dist/PlatformError.js +68 -5
- package/dist/PlatformError.js.map +1 -1
- package/dist/Pool.d.ts +66 -31
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +26 -24
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +16 -21
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +9 -14
- package/dist/Predicate.js.map +1 -1
- package/dist/PrimaryKey.d.ts +9 -2
- package/dist/PrimaryKey.d.ts.map +1 -1
- package/dist/PrimaryKey.js +7 -1
- package/dist/PrimaryKey.js.map +1 -1
- package/dist/PubSub.d.ts +364 -262
- package/dist/PubSub.d.ts.map +1 -1
- package/dist/PubSub.js +245 -174
- package/dist/PubSub.js.map +1 -1
- package/dist/Pull.d.ts +94 -25
- package/dist/Pull.d.ts.map +1 -1
- package/dist/Pull.js +61 -13
- package/dist/Pull.js.map +1 -1
- package/dist/Queue.d.ts +284 -150
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +216 -113
- package/dist/Queue.js.map +1 -1
- package/dist/Random.d.ts +54 -35
- package/dist/Random.d.ts.map +1 -1
- package/dist/Random.js +36 -24
- package/dist/Random.js.map +1 -1
- package/dist/RcMap.d.ts +151 -141
- package/dist/RcMap.d.ts.map +1 -1
- package/dist/RcMap.js +66 -20
- package/dist/RcMap.js.map +1 -1
- package/dist/RcRef.d.ts +69 -32
- package/dist/RcRef.d.ts.map +1 -1
- package/dist/RcRef.js +33 -16
- package/dist/RcRef.js.map +1 -1
- package/dist/Record.d.ts +273 -129
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +117 -57
- package/dist/Record.js.map +1 -1
- package/dist/Redactable.d.ts +3 -3
- package/dist/Redactable.js +2 -2
- package/dist/Redacted.d.ts +63 -33
- package/dist/Redacted.d.ts.map +1 -1
- package/dist/Redacted.js +30 -14
- package/dist/Redacted.js.map +1 -1
- package/dist/Ref.d.ts +81 -52
- package/dist/Ref.d.ts.map +1 -1
- package/dist/Ref.js +54 -35
- package/dist/Ref.js.map +1 -1
- package/dist/References.d.ts +73 -31
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +66 -30
- package/dist/References.js.map +1 -1
- package/dist/RegExp.d.ts +11 -5
- package/dist/RegExp.d.ts.map +1 -1
- package/dist/RegExp.js +11 -5
- package/dist/RegExp.js.map +1 -1
- package/dist/Request.d.ts +158 -34
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +67 -12
- package/dist/Request.js.map +1 -1
- package/dist/RequestResolver.d.ts +261 -116
- package/dist/RequestResolver.d.ts.map +1 -1
- package/dist/RequestResolver.js +77 -41
- package/dist/RequestResolver.js.map +1 -1
- package/dist/Resource.d.ts +13 -7
- package/dist/Resource.d.ts.map +1 -1
- package/dist/Resource.js +44 -6
- package/dist/Resource.js.map +1 -1
- package/dist/Result.d.ts +26 -16
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +6 -6
- package/dist/Result.js.map +1 -1
- package/dist/Runtime.d.ts +43 -18
- package/dist/Runtime.d.ts.map +1 -1
- package/dist/Runtime.js +35 -16
- package/dist/Runtime.js.map +1 -1
- package/dist/Schedule.d.ts +545 -576
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +261 -247
- package/dist/Schedule.js.map +1 -1
- package/dist/Scheduler.d.ts +43 -6
- package/dist/Scheduler.d.ts.map +1 -1
- package/dist/Scheduler.js +33 -4
- package/dist/Scheduler.js.map +1 -1
- package/dist/Schema.d.ts +815 -294
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +287 -193
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +24 -15
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +13 -9
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +26 -13
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +24 -11
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +1 -8
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +194 -25
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +220 -26
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +2 -2
- package/dist/SchemaTransformation.d.ts +61 -41
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +56 -33
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/SchemaUtils.d.ts +7 -0
- package/dist/SchemaUtils.d.ts.map +1 -1
- package/dist/SchemaUtils.js +23 -0
- package/dist/SchemaUtils.js.map +1 -1
- package/dist/Scope.d.ts +102 -43
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +57 -23
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts +138 -46
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +80 -19
- package/dist/ScopedCache.js.map +1 -1
- package/dist/ScopedRef.d.ts +28 -8
- package/dist/ScopedRef.d.ts.map +1 -1
- package/dist/ScopedRef.js +25 -5
- package/dist/ScopedRef.js.map +1 -1
- package/dist/Semaphore.d.ts +64 -28
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +22 -13
- package/dist/Semaphore.js.map +1 -1
- package/dist/Sink.d.ts +458 -200
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Sink.js +240 -89
- package/dist/Sink.js.map +1 -1
- package/dist/Stdio.d.ts +43 -6
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +33 -4
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +1899 -1186
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +868 -525
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +171 -95
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +125 -67
- package/dist/String.js.map +1 -1
- package/dist/SubscriptionRef.d.ts +308 -203
- package/dist/SubscriptionRef.d.ts.map +1 -1
- package/dist/SubscriptionRef.js +125 -76
- package/dist/SubscriptionRef.js.map +1 -1
- package/dist/Symbol.d.ts +13 -5
- package/dist/Symbol.d.ts.map +1 -1
- package/dist/Symbol.js +13 -5
- package/dist/Symbol.js.map +1 -1
- package/dist/SynchronizedRef.d.ts +278 -62
- package/dist/SynchronizedRef.d.ts.map +1 -1
- package/dist/SynchronizedRef.js +116 -23
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Take.d.ts +26 -2
- package/dist/Take.d.ts.map +1 -1
- package/dist/Take.js +4 -1
- package/dist/Take.js.map +1 -1
- package/dist/Terminal.d.ts +39 -7
- package/dist/Terminal.d.ts.map +1 -1
- package/dist/Terminal.js +10 -4
- package/dist/Terminal.js.map +1 -1
- package/dist/Tracer.d.ts +229 -55
- package/dist/Tracer.d.ts.map +1 -1
- package/dist/Tracer.js +94 -18
- package/dist/Tracer.js.map +1 -1
- package/dist/Trie.d.ts +213 -142
- package/dist/Trie.d.ts.map +1 -1
- package/dist/Trie.js +88 -60
- package/dist/Trie.js.map +1 -1
- package/dist/TxChunk.d.ts +182 -146
- package/dist/TxChunk.d.ts.map +1 -1
- package/dist/TxChunk.js +73 -56
- package/dist/TxChunk.js.map +1 -1
- package/dist/TxDeferred.d.ts +43 -29
- package/dist/TxDeferred.d.ts.map +1 -1
- package/dist/TxDeferred.js +22 -15
- package/dist/TxDeferred.js.map +1 -1
- package/dist/TxHashMap.d.ts +362 -222
- package/dist/TxHashMap.d.ts.map +1 -1
- package/dist/TxHashMap.js +171 -98
- package/dist/TxHashMap.js.map +1 -1
- package/dist/TxHashSet.d.ts +178 -104
- package/dist/TxHashSet.d.ts.map +1 -1
- package/dist/TxHashSet.js +84 -43
- package/dist/TxHashSet.js.map +1 -1
- package/dist/TxPriorityQueue.d.ts +93 -62
- package/dist/TxPriorityQueue.d.ts.map +1 -1
- package/dist/TxPriorityQueue.js +54 -36
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/TxPubSub.d.ts +77 -49
- package/dist/TxPubSub.d.ts.map +1 -1
- package/dist/TxPubSub.js +60 -37
- package/dist/TxPubSub.js.map +1 -1
- package/dist/TxQueue.d.ts +279 -241
- package/dist/TxQueue.d.ts.map +1 -1
- package/dist/TxQueue.js +147 -101
- package/dist/TxQueue.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +69 -46
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +48 -32
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/TxRef.d.ts +69 -40
- package/dist/TxRef.d.ts.map +1 -1
- package/dist/TxRef.js +35 -20
- package/dist/TxRef.js.map +1 -1
- package/dist/TxSemaphore.d.ts +101 -54
- package/dist/TxSemaphore.d.ts.map +1 -1
- package/dist/TxSemaphore.js +76 -34
- package/dist/TxSemaphore.js.map +1 -1
- package/dist/TxSubscriptionRef.d.ts +72 -48
- package/dist/TxSubscriptionRef.d.ts.map +1 -1
- package/dist/TxSubscriptionRef.js +33 -22
- package/dist/TxSubscriptionRef.js.map +1 -1
- package/dist/Types.d.ts +34 -34
- package/dist/UndefinedOr.d.ts +48 -25
- package/dist/UndefinedOr.d.ts.map +1 -1
- package/dist/UndefinedOr.js +28 -25
- package/dist/UndefinedOr.js.map +1 -1
- package/dist/Unify.d.ts +71 -116
- package/dist/Unify.d.ts.map +1 -1
- package/dist/Unify.js +20 -6
- package/dist/Unify.js.map +1 -1
- package/dist/Utils.d.ts +4 -0
- package/dist/Utils.d.ts.map +1 -1
- package/dist/Utils.js +4 -0
- package/dist/Utils.js.map +1 -1
- package/dist/index.d.ts +81 -32
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +81 -32
- package/dist/index.js.map +1 -1
- package/dist/internal/concurrency.js +2 -2
- package/dist/internal/concurrency.js.map +1 -1
- package/dist/internal/core.js +8 -20
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/effect.js +20 -19
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/executionPlan.js +2 -2
- package/dist/internal/executionPlan.js.map +1 -1
- package/dist/internal/option.js +5 -8
- package/dist/internal/option.js.map +1 -1
- package/dist/internal/result.js +5 -8
- package/dist/internal/result.js.map +1 -1
- package/dist/internal/schema/schema.js +1 -1
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/testing/FastCheck.d.ts +6 -3
- package/dist/testing/FastCheck.d.ts.map +1 -1
- package/dist/testing/FastCheck.js +6 -3
- package/dist/testing/FastCheck.js.map +1 -1
- package/dist/testing/TestClock.d.ts +39 -34
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +42 -12
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +39 -30
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js +25 -10
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/TestSchema.js +7 -7
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +197 -130
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +166 -102
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +2 -2
- package/dist/unstable/ai/Chat.d.ts +65 -41
- package/dist/unstable/ai/Chat.d.ts.map +1 -1
- package/dist/unstable/ai/Chat.js +51 -33
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.d.ts +12 -11
- package/dist/unstable/ai/EmbeddingModel.d.ts.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.js +9 -8
- package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
- package/dist/unstable/ai/IdGenerator.d.ts +28 -18
- package/dist/unstable/ai/IdGenerator.d.ts.map +1 -1
- package/dist/unstable/ai/IdGenerator.js +18 -11
- package/dist/unstable/ai/IdGenerator.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +36 -30
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +21 -15
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +339 -119
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +264 -98
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +53 -19
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +65 -17
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Model.d.ts +13 -7
- package/dist/unstable/ai/Model.d.ts.map +1 -1
- package/dist/unstable/ai/Model.js +11 -9
- package/dist/unstable/ai/Model.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +2 -2
- package/dist/unstable/ai/Prompt.d.ts +194 -168
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +75 -66
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +153 -140
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +43 -48
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.d.ts +43 -4
- package/dist/unstable/ai/ResponseIdTracker.d.ts.map +1 -1
- package/dist/unstable/ai/ResponseIdTracker.js +27 -2
- package/dist/unstable/ai/ResponseIdTracker.js.map +1 -1
- package/dist/unstable/ai/Telemetry.d.ts +42 -32
- package/dist/unstable/ai/Telemetry.d.ts.map +1 -1
- package/dist/unstable/ai/Telemetry.js +14 -10
- package/dist/unstable/ai/Telemetry.js.map +1 -1
- package/dist/unstable/ai/Tokenizer.d.ts +13 -8
- package/dist/unstable/ai/Tokenizer.d.ts.map +1 -1
- package/dist/unstable/ai/Tokenizer.js +10 -6
- package/dist/unstable/ai/Tokenizer.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +153 -84
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +97 -44
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +33 -42
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +35 -36
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/index.d.ts +42 -24
- package/dist/unstable/ai/index.d.ts.map +1 -1
- package/dist/unstable/ai/index.js +42 -24
- package/dist/unstable/ai/index.js.map +1 -1
- package/dist/unstable/cli/Argument.d.ts +226 -134
- package/dist/unstable/cli/Argument.d.ts.map +1 -1
- package/dist/unstable/cli/Argument.js +101 -65
- package/dist/unstable/cli/Argument.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +72 -26
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.js +86 -23
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/CliOutput.d.ts +43 -13
- package/dist/unstable/cli/CliOutput.d.ts.map +1 -1
- package/dist/unstable/cli/CliOutput.js +30 -6
- package/dist/unstable/cli/CliOutput.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +218 -117
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +45 -31
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Completions.d.ts +7 -7
- package/dist/unstable/cli/Completions.js +1 -1
- package/dist/unstable/cli/Flag.d.ts +235 -142
- package/dist/unstable/cli/Flag.d.ts.map +1 -1
- package/dist/unstable/cli/Flag.js +111 -71
- package/dist/unstable/cli/Flag.js.map +1 -1
- package/dist/unstable/cli/GlobalFlag.d.ts +42 -14
- package/dist/unstable/cli/GlobalFlag.d.ts.map +1 -1
- package/dist/unstable/cli/GlobalFlag.js +30 -7
- package/dist/unstable/cli/GlobalFlag.js.map +1 -1
- package/dist/unstable/cli/HelpDoc.d.ts +35 -10
- package/dist/unstable/cli/HelpDoc.d.ts.map +1 -1
- package/dist/unstable/cli/HelpDoc.js +21 -0
- package/dist/unstable/cli/Param.d.ts +79 -31
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +161 -99
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts +79 -42
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +66 -35
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts +178 -47
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js +111 -31
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/internal/ansi.d.ts.map +1 -1
- package/dist/unstable/cli/internal/ansi.js +13 -0
- package/dist/unstable/cli/internal/ansi.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts +7 -7
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +12 -10
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/config.d.ts +3 -0
- package/dist/unstable/cli/internal/config.d.ts.map +1 -1
- package/dist/unstable/cli/internal/config.js.map +1 -1
- package/dist/unstable/cli/internal/lexer.js.map +1 -1
- package/dist/unstable/cluster/ClusterCron.d.ts +35 -1
- package/dist/unstable/cluster/ClusterCron.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterCron.js +35 -1
- package/dist/unstable/cluster/ClusterCron.js.map +1 -1
- package/dist/unstable/cluster/ClusterError.d.ts +56 -7
- package/dist/unstable/cluster/ClusterError.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterError.js +56 -7
- package/dist/unstable/cluster/ClusterError.js.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.d.ts +39 -5
- package/dist/unstable/cluster/ClusterMetrics.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterMetrics.js +39 -5
- package/dist/unstable/cluster/ClusterMetrics.js.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.d.ts +61 -8
- package/dist/unstable/cluster/ClusterSchema.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterSchema.js +61 -8
- package/dist/unstable/cluster/ClusterSchema.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts +14 -2
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +36 -3
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/DeliverAt.d.ts +39 -4
- package/dist/unstable/cluster/DeliverAt.d.ts.map +1 -1
- package/dist/unstable/cluster/DeliverAt.js +11 -3
- package/dist/unstable/cluster/DeliverAt.js.map +1 -1
- package/dist/unstable/cluster/Entity.d.ts +75 -16
- package/dist/unstable/cluster/Entity.d.ts.map +1 -1
- package/dist/unstable/cluster/Entity.js +78 -13
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/EntityAddress.d.ts +30 -2
- package/dist/unstable/cluster/EntityAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityAddress.js +30 -2
- package/dist/unstable/cluster/EntityAddress.js.map +1 -1
- package/dist/unstable/cluster/EntityId.d.ts +18 -3
- package/dist/unstable/cluster/EntityId.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityId.js +15 -2
- package/dist/unstable/cluster/EntityId.js.map +1 -1
- package/dist/unstable/cluster/EntityProxy.d.ts +34 -2
- package/dist/unstable/cluster/EntityProxy.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxy.js +24 -2
- package/dist/unstable/cluster/EntityProxy.js.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.d.ts +17 -2
- package/dist/unstable/cluster/EntityProxyServer.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityProxyServer.js +40 -8
- package/dist/unstable/cluster/EntityProxyServer.js.map +1 -1
- package/dist/unstable/cluster/EntityResource.d.ts +43 -6
- package/dist/unstable/cluster/EntityResource.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityResource.js +11 -4
- package/dist/unstable/cluster/EntityResource.js.map +1 -1
- package/dist/unstable/cluster/EntityType.d.ts +27 -3
- package/dist/unstable/cluster/EntityType.d.ts.map +1 -1
- package/dist/unstable/cluster/EntityType.js +24 -2
- package/dist/unstable/cluster/EntityType.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts +105 -23
- package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.js +88 -14
- package/dist/unstable/cluster/Envelope.js.map +1 -1
- package/dist/unstable/cluster/HttpRunner.d.ts +88 -13
- package/dist/unstable/cluster/HttpRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/HttpRunner.js +88 -13
- package/dist/unstable/cluster/HttpRunner.js.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.d.ts +49 -6
- package/dist/unstable/cluster/K8sHttpClient.d.ts.map +1 -1
- package/dist/unstable/cluster/K8sHttpClient.js +31 -6
- package/dist/unstable/cluster/K8sHttpClient.js.map +1 -1
- package/dist/unstable/cluster/MachineId.d.ts +24 -3
- package/dist/unstable/cluster/MachineId.d.ts.map +1 -1
- package/dist/unstable/cluster/MachineId.js +21 -2
- package/dist/unstable/cluster/MachineId.js.map +1 -1
- package/dist/unstable/cluster/Message.d.ts +102 -13
- package/dist/unstable/cluster/Message.d.ts.map +1 -1
- package/dist/unstable/cluster/Message.js +86 -10
- package/dist/unstable/cluster/Message.js.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts +127 -21
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +71 -11
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +101 -12
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +64 -8
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +47 -17
- package/dist/unstable/cluster/Runner.d.ts.map +1 -1
- package/dist/unstable/cluster/Runner.js +47 -17
- package/dist/unstable/cluster/Runner.js.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.d.ts +34 -2
- package/dist/unstable/cluster/RunnerAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.js +34 -2
- package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.d.ts +40 -12
- package/dist/unstable/cluster/RunnerHealth.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerHealth.js +40 -12
- package/dist/unstable/cluster/RunnerHealth.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts +7 -4
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +31 -4
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.d.ts +42 -5
- package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.js +38 -4
- package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/Runners.d.ts +73 -10
- package/dist/unstable/cluster/Runners.d.ts.map +1 -1
- package/dist/unstable/cluster/Runners.js +70 -9
- package/dist/unstable/cluster/Runners.js.map +1 -1
- package/dist/unstable/cluster/ShardId.d.ts +51 -5
- package/dist/unstable/cluster/ShardId.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardId.js +47 -4
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts +10 -2
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +35 -4
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +65 -9
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js +67 -10
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts +27 -6
- package/dist/unstable/cluster/ShardingRegistrationEvent.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingRegistrationEvent.js +28 -4
- package/dist/unstable/cluster/ShardingRegistrationEvent.js.map +1 -1
- package/dist/unstable/cluster/SingleRunner.d.ts +23 -1
- package/dist/unstable/cluster/SingleRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SingleRunner.js +23 -1
- package/dist/unstable/cluster/SingleRunner.js.map +1 -1
- package/dist/unstable/cluster/Singleton.d.ts +15 -1
- package/dist/unstable/cluster/Singleton.d.ts.map +1 -1
- package/dist/unstable/cluster/Singleton.js +15 -1
- package/dist/unstable/cluster/Singleton.js.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts +21 -1
- package/dist/unstable/cluster/SingletonAddress.d.ts.map +1 -1
- package/dist/unstable/cluster/SingletonAddress.js +21 -1
- package/dist/unstable/cluster/SingletonAddress.js.map +1 -1
- package/dist/unstable/cluster/Snowflake.d.ts +89 -19
- package/dist/unstable/cluster/Snowflake.d.ts.map +1 -1
- package/dist/unstable/cluster/Snowflake.js +48 -13
- package/dist/unstable/cluster/Snowflake.js.map +1 -1
- package/dist/unstable/cluster/SocketRunner.d.ts +8 -2
- package/dist/unstable/cluster/SocketRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SocketRunner.js +29 -2
- package/dist/unstable/cluster/SocketRunner.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.d.ts +11 -3
- package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +27 -3
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts +11 -3
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js +46 -7
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/TestRunner.d.ts +18 -1
- package/dist/unstable/cluster/TestRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/TestRunner.js +18 -1
- package/dist/unstable/cluster/TestRunner.js.map +1 -1
- package/dist/unstable/cluster/internal/hash.js +12 -0
- package/dist/unstable/cluster/internal/hash.js.map +1 -1
- package/dist/unstable/devtools/DevTools.d.ts +26 -3
- package/dist/unstable/devtools/DevTools.d.ts.map +1 -1
- package/dist/unstable/devtools/DevTools.js +26 -3
- package/dist/unstable/devtools/DevTools.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.d.ts +20 -5
- package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js +32 -5
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.d.ts +184 -44
- package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js +102 -20
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.d.ts +27 -2
- package/dist/unstable/devtools/DevToolsServer.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsServer.js +21 -1
- package/dist/unstable/devtools/DevToolsServer.js.map +1 -1
- package/dist/unstable/encoding/Msgpack.d.ts +81 -12
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.js +75 -9
- package/dist/unstable/encoding/Msgpack.js.map +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts +149 -21
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js +97 -13
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts +109 -18
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +69 -13
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/eventlog/Event.d.ts +115 -30
- package/dist/unstable/eventlog/Event.d.ts.map +1 -1
- package/dist/unstable/eventlog/Event.js +22 -2
- package/dist/unstable/eventlog/Event.js.map +1 -1
- package/dist/unstable/eventlog/EventGroup.d.ts +50 -17
- package/dist/unstable/eventlog/EventGroup.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventGroup.js +24 -6
- package/dist/unstable/eventlog/EventGroup.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +104 -20
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +108 -16
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts +151 -31
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +111 -20
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.d.ts +42 -6
- package/dist/unstable/eventlog/EventLogEncryption.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js +38 -5
- package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +96 -22
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js +72 -16
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +35 -8
- package/dist/unstable/eventlog/EventLogRemote.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.js +54 -8
- package/dist/unstable/eventlog/EventLogRemote.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.d.ts +17 -3
- package/dist/unstable/eventlog/EventLogServer.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServer.js +17 -3
- package/dist/unstable/eventlog/EventLogServer.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts +32 -6
- package/dist/unstable/eventlog/EventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerEncrypted.js +52 -6
- package/dist/unstable/eventlog/EventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts +74 -16
- package/dist/unstable/eventlog/EventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +90 -16
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts +59 -15
- package/dist/unstable/eventlog/EventLogSessionAuth.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogSessionAuth.js +73 -14
- package/dist/unstable/eventlog/EventLogSessionAuth.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.d.ts +10 -2
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.js +28 -2
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts +32 -3
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js +32 -3
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts +10 -2
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +28 -2
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts +156 -77
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +93 -39
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Etag.d.ts +40 -7
- package/dist/unstable/http/Etag.d.ts.map +1 -1
- package/dist/unstable/http/Etag.js +27 -4
- package/dist/unstable/http/Etag.js.map +1 -1
- package/dist/unstable/http/FetchHttpClient.d.ts +29 -3
- package/dist/unstable/http/FetchHttpClient.d.ts.map +1 -1
- package/dist/unstable/http/FetchHttpClient.js +33 -4
- package/dist/unstable/http/FetchHttpClient.js.map +1 -1
- package/dist/unstable/http/FindMyWay.d.ts +1 -1
- package/dist/unstable/http/FindMyWay.js +1 -1
- package/dist/unstable/http/Headers.d.ts +182 -36
- package/dist/unstable/http/Headers.d.ts.map +1 -1
- package/dist/unstable/http/Headers.js +86 -16
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpBody.d.ts +114 -26
- package/dist/unstable/http/HttpBody.d.ts.map +1 -1
- package/dist/unstable/http/HttpBody.js +100 -22
- package/dist/unstable/http/HttpBody.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +205 -96
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +85 -39
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.d.ts +68 -12
- package/dist/unstable/http/HttpClientError.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientError.js +71 -9
- package/dist/unstable/http/HttpClientError.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +318 -100
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +153 -47
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.d.ts +59 -16
- package/dist/unstable/http/HttpClientResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js +44 -11
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpEffect.d.ts +42 -16
- package/dist/unstable/http/HttpEffect.d.ts.map +1 -1
- package/dist/unstable/http/HttpEffect.js +33 -13
- package/dist/unstable/http/HttpEffect.js.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.d.ts +47 -7
- package/dist/unstable/http/HttpIncomingMessage.d.ts.map +1 -1
- package/dist/unstable/http/HttpIncomingMessage.js +44 -6
- package/dist/unstable/http/HttpIncomingMessage.js.map +1 -1
- package/dist/unstable/http/HttpMethod.d.ts +35 -5
- package/dist/unstable/http/HttpMethod.d.ts.map +1 -1
- package/dist/unstable/http/HttpMethod.js +23 -1
- package/dist/unstable/http/HttpMethod.js.map +1 -1
- package/dist/unstable/http/HttpMiddleware.d.ts +37 -11
- package/dist/unstable/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/unstable/http/HttpMiddleware.js +70 -31
- package/dist/unstable/http/HttpMiddleware.js.map +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts +34 -3
- package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
- package/dist/unstable/http/HttpPlatform.js +35 -4
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +194 -45
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js +122 -28
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServer.d.ts +151 -22
- package/dist/unstable/http/HttpServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpServer.js +77 -12
- package/dist/unstable/http/HttpServer.js.map +1 -1
- package/dist/unstable/http/HttpServerError.d.ts +90 -10
- package/dist/unstable/http/HttpServerError.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerError.js +82 -8
- package/dist/unstable/http/HttpServerError.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts +125 -21
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +112 -31
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.d.ts +32 -6
- package/dist/unstable/http/HttpServerRespondable.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRespondable.js +43 -5
- package/dist/unstable/http/HttpServerRespondable.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts +390 -67
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +209 -38
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/HttpStaticServer.d.ts +22 -4
- package/dist/unstable/http/HttpStaticServer.d.ts.map +1 -1
- package/dist/unstable/http/HttpStaticServer.js +22 -4
- package/dist/unstable/http/HttpStaticServer.js.map +1 -1
- package/dist/unstable/http/HttpTraceContext.d.ts +53 -6
- package/dist/unstable/http/HttpTraceContext.d.ts.map +1 -1
- package/dist/unstable/http/HttpTraceContext.js +47 -5
- package/dist/unstable/http/HttpTraceContext.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +178 -28
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +130 -20
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Multipasta/HeadersParser.d.ts +1 -1
- package/dist/unstable/http/Multipasta/HeadersParser.js +1 -1
- package/dist/unstable/http/Multipasta/Node.d.ts +1 -1
- package/dist/unstable/http/Multipasta/Node.js +1 -1
- package/dist/unstable/http/Multipasta/Search.d.ts +1 -1
- package/dist/unstable/http/Multipasta/Search.js +1 -1
- package/dist/unstable/http/Multipasta/Web.d.ts +1 -1
- package/dist/unstable/http/Multipasta/Web.js +1 -1
- package/dist/unstable/http/Multipasta.d.ts +1 -1
- package/dist/unstable/http/Multipasta.js +1 -1
- package/dist/unstable/http/Template.d.ts +53 -0
- package/dist/unstable/http/Template.d.ts.map +1 -1
- package/dist/unstable/http/Template.js +26 -0
- package/dist/unstable/http/Template.js.map +1 -1
- package/dist/unstable/http/Url.d.ts +56 -42
- package/dist/unstable/http/Url.d.ts.map +1 -1
- package/dist/unstable/http/Url.js +29 -15
- package/dist/unstable/http/Url.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts +233 -49
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +116 -23
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.d.ts +49 -14
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +14 -8
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts +55 -16
- package/dist/unstable/httpapi/HttpApiBuilder.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +47 -9
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +58 -15
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +43 -7
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +214 -59
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +53 -9
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +81 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +98 -1
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.d.ts +87 -20
- package/dist/unstable/httpapi/HttpApiGroup.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js +5 -2
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +113 -22
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +49 -6
- package/dist/unstable/httpapi/HttpApiMiddleware.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.d.ts +19 -4
- package/dist/unstable/httpapi/HttpApiScalar.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiScalar.js +32 -2
- package/dist/unstable/httpapi/HttpApiScalar.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +67 -30
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +48 -27
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts +74 -17
- package/dist/unstable/httpapi/HttpApiSecurity.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSecurity.js +38 -5
- package/dist/unstable/httpapi/HttpApiSecurity.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts +5 -2
- package/dist/unstable/httpapi/HttpApiSwagger.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSwagger.js +24 -2
- package/dist/unstable/httpapi/HttpApiSwagger.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.d.ts +9 -2
- package/dist/unstable/httpapi/HttpApiTest.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiTest.js +28 -3
- package/dist/unstable/httpapi/HttpApiTest.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +86 -15
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +73 -15
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/observability/Otlp.d.ts +33 -3
- package/dist/unstable/observability/Otlp.d.ts.map +1 -1
- package/dist/unstable/observability/Otlp.js +14 -3
- package/dist/unstable/observability/Otlp.js.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts +8 -1
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +32 -1
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts +14 -2
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +29 -2
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +15 -4
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js +32 -2
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpResource.d.ts +49 -12
- package/dist/unstable/observability/OtlpResource.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpResource.js +47 -5
- package/dist/unstable/observability/OtlpResource.js.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.d.ts +28 -3
- package/dist/unstable/observability/OtlpSerialization.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpSerialization.js +28 -3
- package/dist/unstable/observability/OtlpSerialization.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts +16 -2
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +32 -2
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.d.ts +32 -12
- package/dist/unstable/observability/PrometheusMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/PrometheusMetrics.js +7 -5
- package/dist/unstable/observability/PrometheusMetrics.js.map +1 -1
- package/dist/unstable/observability/index.d.ts +2 -1
- package/dist/unstable/observability/index.d.ts.map +1 -1
- package/dist/unstable/observability/index.js +2 -1
- package/dist/unstable/observability/index.js.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.d.ts +93 -18
- package/dist/unstable/persistence/KeyValueStore.d.ts.map +1 -1
- package/dist/unstable/persistence/KeyValueStore.js +81 -21
- package/dist/unstable/persistence/KeyValueStore.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts +76 -15
- package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistable.js +22 -5
- package/dist/unstable/persistence/Persistable.js.map +1 -1
- package/dist/unstable/persistence/PersistedCache.d.ts +27 -2
- package/dist/unstable/persistence/PersistedCache.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedCache.js +24 -1
- package/dist/unstable/persistence/PersistedCache.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts +73 -16
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +60 -13
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts +97 -16
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +90 -14
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +97 -21
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +82 -17
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts +26 -5
- package/dist/unstable/persistence/Redis.d.ts.map +1 -1
- package/dist/unstable/persistence/Redis.js +36 -4
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/process/ChildProcess.d.ts +89 -109
- package/dist/unstable/process/ChildProcess.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcess.js +74 -23
- package/dist/unstable/process/ChildProcess.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.d.ts +22 -11
- package/dist/unstable/process/ChildProcessSpawner.d.ts.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +11 -6
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/process/index.d.ts +2 -1
- package/dist/unstable/process/index.d.ts.map +1 -1
- package/dist/unstable/process/index.js +2 -1
- package/dist/unstable/process/index.js.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.d.ts +196 -59
- package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.js +121 -36
- package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +539 -130
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +256 -62
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.d.ts +41 -2
- package/dist/unstable/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomHttpApi.js +35 -1
- package/dist/unstable/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/unstable/reactivity/AtomRef.d.ts +51 -7
- package/dist/unstable/reactivity/AtomRef.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRef.js +29 -3
- package/dist/unstable/reactivity/AtomRef.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.d.ts +135 -21
- package/dist/unstable/reactivity/AtomRegistry.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +69 -10
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.d.ts +36 -2
- package/dist/unstable/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/unstable/reactivity/AtomRpc.js +29 -1
- package/dist/unstable/reactivity/AtomRpc.js.map +1 -1
- package/dist/unstable/reactivity/Hydration.d.ts +28 -5
- package/dist/unstable/reactivity/Hydration.d.ts.map +1 -1
- package/dist/unstable/reactivity/Hydration.js +35 -3
- package/dist/unstable/reactivity/Hydration.js.map +1 -1
- package/dist/unstable/reactivity/Reactivity.d.ts +95 -13
- package/dist/unstable/reactivity/Reactivity.d.ts.map +1 -1
- package/dist/unstable/reactivity/Reactivity.js +61 -7
- package/dist/unstable/reactivity/Reactivity.js.map +1 -1
- package/dist/unstable/rpc/Rpc.d.ts +255 -56
- package/dist/unstable/rpc/Rpc.d.ts.map +1 -1
- package/dist/unstable/rpc/Rpc.js +44 -11
- package/dist/unstable/rpc/Rpc.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +81 -19
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +53 -13
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.d.ts +26 -2
- package/dist/unstable/rpc/RpcClientError.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClientError.js +26 -2
- package/dist/unstable/rpc/RpcClientError.js.map +1 -1
- package/dist/unstable/rpc/RpcGroup.d.ts +51 -8
- package/dist/unstable/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcGroup.js +3 -1
- package/dist/unstable/rpc/RpcGroup.js.map +1 -1
- package/dist/unstable/rpc/RpcMessage.d.ts +128 -32
- package/dist/unstable/rpc/RpcMessage.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMessage.js +23 -7
- package/dist/unstable/rpc/RpcMessage.js.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.d.ts +100 -20
- package/dist/unstable/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcMiddleware.js +39 -3
- package/dist/unstable/rpc/RpcMiddleware.js.map +1 -1
- package/dist/unstable/rpc/RpcSchema.d.ts +38 -4
- package/dist/unstable/rpc/RpcSchema.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSchema.js +34 -3
- package/dist/unstable/rpc/RpcSchema.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.d.ts +60 -13
- package/dist/unstable/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +56 -12
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts +73 -23
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +70 -23
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/rpc/RpcTest.d.ts +20 -1
- package/dist/unstable/rpc/RpcTest.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcTest.js +20 -1
- package/dist/unstable/rpc/RpcTest.js.map +1 -1
- package/dist/unstable/rpc/RpcWorker.d.ts +40 -6
- package/dist/unstable/rpc/RpcWorker.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcWorker.js +17 -5
- package/dist/unstable/rpc/RpcWorker.js.map +1 -1
- package/dist/unstable/rpc/Utils.d.ts +8 -0
- package/dist/unstable/rpc/Utils.d.ts.map +1 -1
- package/dist/unstable/rpc/Utils.js +8 -0
- package/dist/unstable/rpc/Utils.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +130 -52
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/Model.js +79 -34
- package/dist/unstable/schema/Model.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +104 -24
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +22 -6
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +167 -34
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +124 -29
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/socket/SocketServer.d.ts +58 -10
- package/dist/unstable/socket/SocketServer.d.ts.map +1 -1
- package/dist/unstable/socket/SocketServer.js +43 -5
- package/dist/unstable/socket/SocketServer.js.map +1 -1
- package/dist/unstable/sql/Migrator.d.ts +35 -4
- package/dist/unstable/sql/Migrator.d.ts.map +1 -1
- package/dist/unstable/sql/Migrator.js +45 -5
- package/dist/unstable/sql/Migrator.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts +34 -2
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +38 -1
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlConnection.d.ts +31 -0
- package/dist/unstable/sql/SqlConnection.d.ts.map +1 -1
- package/dist/unstable/sql/SqlConnection.js +22 -0
- package/dist/unstable/sql/SqlConnection.js.map +1 -1
- package/dist/unstable/sql/SqlError.d.ts +99 -0
- package/dist/unstable/sql/SqlError.d.ts.map +1 -1
- package/dist/unstable/sql/SqlError.js +114 -0
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlModel.d.ts +26 -5
- package/dist/unstable/sql/SqlModel.d.ts.map +1 -1
- package/dist/unstable/sql/SqlModel.js +8 -4
- package/dist/unstable/sql/SqlModel.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.d.ts +56 -13
- package/dist/unstable/sql/SqlResolver.d.ts.map +1 -1
- package/dist/unstable/sql/SqlResolver.js +44 -10
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/sql/SqlSchema.d.ts +29 -8
- package/dist/unstable/sql/SqlSchema.d.ts.map +1 -1
- package/dist/unstable/sql/SqlSchema.js +29 -8
- package/dist/unstable/sql/SqlSchema.js.map +1 -1
- package/dist/unstable/sql/SqlStream.d.ts +3 -0
- package/dist/unstable/sql/SqlStream.d.ts.map +1 -1
- package/dist/unstable/sql/SqlStream.js +23 -0
- package/dist/unstable/sql/SqlStream.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts +124 -0
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +82 -0
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/sql/index.d.ts +1 -1
- package/dist/unstable/sql/index.js +1 -1
- package/dist/unstable/workers/Transferable.d.ts +65 -13
- package/dist/unstable/workers/Transferable.d.ts.map +1 -1
- package/dist/unstable/workers/Transferable.js +53 -10
- package/dist/unstable/workers/Transferable.js.map +1 -1
- package/dist/unstable/workers/Worker.d.ts +60 -8
- package/dist/unstable/workers/Worker.d.ts.map +1 -1
- package/dist/unstable/workers/Worker.js +43 -4
- package/dist/unstable/workers/Worker.js.map +1 -1
- package/dist/unstable/workers/WorkerError.d.ts +31 -9
- package/dist/unstable/workers/WorkerError.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerError.js +44 -7
- package/dist/unstable/workers/WorkerError.js.map +1 -1
- package/dist/unstable/workers/WorkerRunner.d.ts +32 -3
- package/dist/unstable/workers/WorkerRunner.d.ts.map +1 -1
- package/dist/unstable/workers/WorkerRunner.js +24 -1
- package/dist/unstable/workers/WorkerRunner.js.map +1 -1
- package/dist/unstable/workers/index.d.ts +1 -1
- package/dist/unstable/workers/index.js +1 -1
- package/dist/unstable/workflow/Activity.d.ts +61 -10
- package/dist/unstable/workflow/Activity.d.ts.map +1 -1
- package/dist/unstable/workflow/Activity.js +21 -6
- package/dist/unstable/workflow/Activity.js.map +1 -1
- package/dist/unstable/workflow/DurableClock.d.ts +12 -3
- package/dist/unstable/workflow/DurableClock.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableClock.js +22 -2
- package/dist/unstable/workflow/DurableClock.js.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.d.ts +126 -31
- package/dist/unstable/workflow/DurableDeferred.d.ts.map +1 -1
- package/dist/unstable/workflow/DurableDeferred.js +76 -13
- package/dist/unstable/workflow/DurableDeferred.js.map +1 -1
- package/dist/unstable/workflow/DurableQueue.d.ts +145 -0
- package/dist/unstable/workflow/DurableQueue.d.ts.map +1 -0
- package/dist/unstable/workflow/DurableQueue.js +200 -0
- package/dist/unstable/workflow/DurableQueue.js.map +1 -0
- package/dist/unstable/workflow/Workflow.d.ts +100 -31
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +76 -20
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +40 -5
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +16 -4
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.d.ts +32 -2
- package/dist/unstable/workflow/WorkflowProxy.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxy.js +2 -2
- package/dist/unstable/workflow/WorkflowProxy.js.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.d.ts +36 -2
- package/dist/unstable/workflow/WorkflowProxyServer.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowProxyServer.js +12 -6
- package/dist/unstable/workflow/WorkflowProxyServer.js.map +1 -1
- package/dist/unstable/workflow/index.d.ts +4 -0
- package/dist/unstable/workflow/index.d.ts.map +1 -1
- package/dist/unstable/workflow/index.js +4 -0
- package/dist/unstable/workflow/index.js.map +1 -1
- package/package.json +11 -11
- package/src/Array.ts +113 -67
- package/src/BigDecimal.ts +404 -337
- package/src/BigInt.ts +167 -97
- package/src/Boolean.ts +62 -31
- package/src/Brand.ts +20 -1
- package/src/Cache.ts +331 -164
- package/src/Cause.ts +77 -65
- package/src/Channel.ts +1585 -607
- package/src/ChannelSchema.ts +137 -12
- package/src/Chunk.ts +549 -380
- package/src/Clock.ts +15 -8
- package/src/Combiner.ts +2 -4
- package/src/Config.ts +12 -10
- package/src/ConfigProvider.ts +1 -1
- package/src/Console.ts +88 -58
- package/src/Context.ts +397 -149
- package/src/Cron.ts +111 -48
- package/src/Data.ts +3 -2
- package/src/DateTime.ts +876 -445
- package/src/Deferred.ts +367 -174
- package/src/Differ.ts +42 -0
- package/src/Duration.ts +329 -185
- package/src/Effect.ts +2474 -2395
- package/src/Effectable.ts +39 -4
- package/src/Encoding.ts +78 -28
- package/src/Equivalence.ts +14 -19
- package/src/ErrorReporter.ts +66 -82
- package/src/ExecutionPlan.ts +97 -13
- package/src/Exit.ts +7 -5
- package/src/Fiber.ts +72 -40
- package/src/FiberHandle.ts +158 -58
- package/src/FiberMap.ts +329 -164
- package/src/FiberSet.ts +130 -52
- package/src/FileSystem.ts +106 -74
- package/src/Filter.ts +166 -88
- package/src/Function.ts +154 -86
- package/src/Graph.ts +682 -365
- package/src/HKT.ts +29 -13
- package/src/Hash.ts +31 -18
- package/src/HashMap.ts +444 -256
- package/src/HashRing.ts +94 -17
- package/src/HashSet.ts +194 -104
- package/src/Inspectable.ts +22 -10
- package/src/Iterable.ts +309 -149
- package/src/JsonPatch.ts +4 -3
- package/src/Latch.ts +98 -15
- package/src/Layer.ts +488 -345
- package/src/LayerMap.ts +98 -25
- package/src/LogLevel.ts +92 -131
- package/src/Logger.ts +357 -288
- package/src/ManagedRuntime.ts +75 -17
- package/src/Match.ts +133 -157
- package/src/Metric.ts +355 -304
- package/src/MutableHashMap.ts +161 -84
- package/src/MutableHashSet.ts +122 -52
- package/src/MutableList.ts +141 -81
- package/src/MutableRef.ts +130 -90
- package/src/Newtype.ts +3 -0
- package/src/NonEmptyIterable.ts +36 -39
- package/src/Number.ts +116 -64
- package/src/Optic.ts +1 -2
- package/src/Option.ts +41 -53
- package/src/Ordering.ts +43 -28
- package/src/PartitionedSemaphore.ts +225 -40
- package/src/Path.ts +77 -13
- package/src/Pipeable.ts +76 -21
- package/src/PlatformError.ts +74 -6
- package/src/Pool.ts +94 -31
- package/src/Predicate.ts +16 -21
- package/src/PrimaryKey.ts +9 -2
- package/src/PubSub.ts +364 -262
- package/src/Pull.ts +94 -25
- package/src/Queue.ts +284 -150
- package/src/Random.ts +54 -35
- package/src/RcMap.ts +151 -141
- package/src/RcRef.ts +69 -32
- package/src/Record.ts +273 -129
- package/src/Redactable.ts +3 -3
- package/src/Redacted.ts +63 -33
- package/src/Ref.ts +161 -104
- package/src/References.ts +73 -31
- package/src/RegExp.ts +11 -5
- package/src/Request.ts +158 -34
- package/src/RequestResolver.ts +277 -119
- package/src/Resource.ts +45 -7
- package/src/Result.ts +31 -18
- package/src/Runtime.ts +45 -19
- package/src/Schedule.ts +575 -600
- package/src/Scheduler.ts +43 -6
- package/src/Schema.ts +845 -319
- package/src/SchemaAST.ts +25 -16
- package/src/SchemaGetter.ts +32 -17
- package/src/SchemaIssue.ts +1 -8
- package/src/SchemaParser.ts +262 -38
- package/src/SchemaTransformation.ts +61 -41
- package/src/SchemaUtils.ts +23 -0
- package/src/Scope.ts +102 -43
- package/src/ScopedCache.ts +192 -56
- package/src/ScopedRef.ts +28 -8
- package/src/Semaphore.ts +64 -28
- package/src/Sink.ts +458 -200
- package/src/Stdio.ts +43 -6
- package/src/Stream.ts +2043 -1256
- package/src/String.ts +171 -95
- package/src/SubscriptionRef.ts +308 -203
- package/src/Symbol.ts +13 -5
- package/src/SynchronizedRef.ts +278 -62
- package/src/Take.ts +26 -2
- package/src/Terminal.ts +40 -7
- package/src/Tracer.ts +229 -55
- package/src/Trie.ts +213 -142
- package/src/TxChunk.ts +182 -146
- package/src/TxDeferred.ts +43 -29
- package/src/TxHashMap.ts +370 -230
- package/src/TxHashSet.ts +250 -152
- package/src/TxPriorityQueue.ts +96 -64
- package/src/TxPubSub.ts +77 -49
- package/src/TxQueue.ts +279 -241
- package/src/TxReentrantLock.ts +70 -47
- package/src/TxRef.ts +70 -41
- package/src/TxSemaphore.ts +101 -54
- package/src/TxSubscriptionRef.ts +72 -48
- package/src/Types.ts +34 -34
- package/src/UndefinedOr.ts +48 -25
- package/src/Unify.ts +71 -116
- package/src/Utils.ts +4 -0
- package/src/index.ts +81 -32
- package/src/internal/concurrency.ts +2 -2
- package/src/internal/core.ts +12 -23
- package/src/internal/effect.ts +25 -29
- package/src/internal/executionPlan.ts +2 -2
- package/src/internal/option.ts +5 -8
- package/src/internal/result.ts +5 -8
- package/src/internal/schema/schema.ts +1 -1
- package/src/testing/FastCheck.ts +6 -3
- package/src/testing/TestClock.ts +63 -34
- package/src/testing/TestConsole.ts +49 -30
- package/src/testing/TestSchema.ts +8 -8
- package/src/unstable/ai/AiError.ts +187 -120
- package/src/unstable/ai/AnthropicStructuredOutput.ts +2 -2
- package/src/unstable/ai/Chat.ts +69 -43
- package/src/unstable/ai/EmbeddingModel.ts +12 -11
- package/src/unstable/ai/IdGenerator.ts +28 -18
- package/src/unstable/ai/LanguageModel.ts +47 -46
- package/src/unstable/ai/McpSchema.ts +339 -119
- package/src/unstable/ai/McpServer.ts +78 -21
- package/src/unstable/ai/Model.ts +23 -18
- package/src/unstable/ai/OpenAiStructuredOutput.ts +2 -2
- package/src/unstable/ai/Prompt.ts +210 -184
- package/src/unstable/ai/Response.ts +159 -147
- package/src/unstable/ai/ResponseIdTracker.ts +43 -4
- package/src/unstable/ai/Telemetry.ts +42 -32
- package/src/unstable/ai/Tokenizer.ts +13 -8
- package/src/unstable/ai/Tool.ts +154 -85
- package/src/unstable/ai/Toolkit.ts +81 -84
- package/src/unstable/ai/index.ts +42 -24
- package/src/unstable/cli/Argument.ts +226 -134
- package/src/unstable/cli/CliError.ts +96 -26
- package/src/unstable/cli/CliOutput.ts +43 -13
- package/src/unstable/cli/Command.ts +225 -125
- package/src/unstable/cli/Completions.ts +7 -7
- package/src/unstable/cli/Flag.ts +235 -142
- package/src/unstable/cli/GlobalFlag.ts +42 -14
- package/src/unstable/cli/HelpDoc.ts +35 -10
- package/src/unstable/cli/Param.ts +328 -190
- package/src/unstable/cli/Primitive.ts +79 -42
- package/src/unstable/cli/Prompt.ts +210 -58
- package/src/unstable/cli/internal/ansi.ts +13 -0
- package/src/unstable/cli/internal/command.ts +17 -15
- package/src/unstable/cli/internal/config.ts +3 -0
- package/src/unstable/cli/internal/lexer.ts +11 -0
- package/src/unstable/cluster/ClusterCron.ts +35 -1
- package/src/unstable/cluster/ClusterError.ts +56 -7
- package/src/unstable/cluster/ClusterMetrics.ts +39 -5
- package/src/unstable/cluster/ClusterSchema.ts +61 -8
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +36 -3
- package/src/unstable/cluster/DeliverAt.ts +39 -4
- package/src/unstable/cluster/Entity.ts +110 -19
- package/src/unstable/cluster/EntityAddress.ts +30 -2
- package/src/unstable/cluster/EntityId.ts +18 -3
- package/src/unstable/cluster/EntityProxy.ts +34 -2
- package/src/unstable/cluster/EntityProxyServer.ts +44 -8
- package/src/unstable/cluster/EntityResource.ts +43 -6
- package/src/unstable/cluster/EntityType.ts +27 -3
- package/src/unstable/cluster/Envelope.ts +128 -23
- package/src/unstable/cluster/HttpRunner.ts +88 -13
- package/src/unstable/cluster/K8sHttpClient.ts +49 -6
- package/src/unstable/cluster/MachineId.ts +24 -3
- package/src/unstable/cluster/Message.ts +102 -13
- package/src/unstable/cluster/MessageStorage.ts +128 -22
- package/src/unstable/cluster/Reply.ts +101 -12
- package/src/unstable/cluster/Runner.ts +47 -17
- package/src/unstable/cluster/RunnerAddress.ts +34 -2
- package/src/unstable/cluster/RunnerHealth.ts +40 -12
- package/src/unstable/cluster/RunnerServer.ts +31 -4
- package/src/unstable/cluster/RunnerStorage.ts +42 -5
- package/src/unstable/cluster/Runners.ts +73 -10
- package/src/unstable/cluster/ShardId.ts +51 -5
- package/src/unstable/cluster/Sharding.ts +35 -4
- package/src/unstable/cluster/ShardingConfig.ts +76 -11
- package/src/unstable/cluster/ShardingRegistrationEvent.ts +31 -7
- package/src/unstable/cluster/SingleRunner.ts +23 -1
- package/src/unstable/cluster/Singleton.ts +15 -1
- package/src/unstable/cluster/SingletonAddress.ts +21 -1
- package/src/unstable/cluster/Snowflake.ts +89 -19
- package/src/unstable/cluster/SocketRunner.ts +29 -2
- package/src/unstable/cluster/SqlMessageStorage.ts +27 -3
- package/src/unstable/cluster/SqlRunnerStorage.ts +46 -7
- package/src/unstable/cluster/TestRunner.ts +18 -1
- package/src/unstable/cluster/internal/hash.ts +12 -0
- package/src/unstable/devtools/DevTools.ts +26 -3
- package/src/unstable/devtools/DevToolsClient.ts +32 -5
- package/src/unstable/devtools/DevToolsSchema.ts +201 -44
- package/src/unstable/devtools/DevToolsServer.ts +27 -2
- package/src/unstable/encoding/Msgpack.ts +97 -12
- package/src/unstable/encoding/Ndjson.ts +149 -21
- package/src/unstable/encoding/Sse.ts +109 -18
- package/src/unstable/eventlog/Event.ts +131 -30
- package/src/unstable/eventlog/EventGroup.ts +50 -17
- package/src/unstable/eventlog/EventJournal.ts +120 -20
- package/src/unstable/eventlog/EventLog.ts +151 -31
- package/src/unstable/eventlog/EventLogEncryption.ts +42 -6
- package/src/unstable/eventlog/EventLogMessage.ts +92 -18
- package/src/unstable/eventlog/EventLogRemote.ts +54 -8
- package/src/unstable/eventlog/EventLogServer.ts +33 -3
- package/src/unstable/eventlog/EventLogServerEncrypted.ts +52 -6
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +90 -16
- package/src/unstable/eventlog/EventLogSessionAuth.ts +77 -15
- package/src/unstable/eventlog/SqlEventJournal.ts +28 -2
- package/src/unstable/eventlog/SqlEventLogServerEncrypted.ts +32 -3
- package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +28 -2
- package/src/unstable/http/Cookies.ts +156 -77
- package/src/unstable/http/Etag.ts +40 -7
- package/src/unstable/http/FetchHttpClient.ts +33 -4
- package/src/unstable/http/FindMyWay.ts +1 -1
- package/src/unstable/http/Headers.ts +252 -50
- package/src/unstable/http/HttpBody.ts +130 -28
- package/src/unstable/http/HttpClient.ts +206 -97
- package/src/unstable/http/HttpClientError.ts +80 -12
- package/src/unstable/http/HttpClientRequest.ts +320 -102
- package/src/unstable/http/HttpClientResponse.ts +59 -16
- package/src/unstable/http/HttpEffect.ts +66 -18
- package/src/unstable/http/HttpIncomingMessage.ts +47 -7
- package/src/unstable/http/HttpMethod.ts +35 -5
- package/src/unstable/http/HttpMiddleware.ts +63 -16
- package/src/unstable/http/HttpPlatform.ts +35 -4
- package/src/unstable/http/HttpRouter.ts +221 -57
- package/src/unstable/http/HttpServer.ts +152 -23
- package/src/unstable/http/HttpServerError.ts +90 -10
- package/src/unstable/http/HttpServerRequest.ts +136 -32
- package/src/unstable/http/HttpServerRespondable.ts +49 -6
- package/src/unstable/http/HttpServerResponse.ts +395 -72
- package/src/unstable/http/HttpStaticServer.ts +22 -4
- package/src/unstable/http/HttpTraceContext.ts +53 -6
- package/src/unstable/http/Multipart.ts +179 -29
- package/src/unstable/http/Multipasta/HeadersParser.ts +1 -1
- package/src/unstable/http/Multipasta/Node.ts +1 -1
- package/src/unstable/http/Multipasta/Search.ts +1 -1
- package/src/unstable/http/Multipasta/Web.ts +1 -1
- package/src/unstable/http/Multipasta.ts +1 -1
- package/src/unstable/http/Template.ts +53 -0
- package/src/unstable/http/Url.ts +56 -42
- package/src/unstable/http/UrlParams.ts +233 -49
- package/src/unstable/httpapi/HttpApi.ts +49 -14
- package/src/unstable/httpapi/HttpApiBuilder.ts +86 -20
- package/src/unstable/httpapi/HttpApiClient.ts +80 -16
- package/src/unstable/httpapi/HttpApiEndpoint.ts +238 -59
- package/src/unstable/httpapi/HttpApiError.ts +100 -1
- package/src/unstable/httpapi/HttpApiGroup.ts +87 -20
- package/src/unstable/httpapi/HttpApiMiddleware.ts +113 -23
- package/src/unstable/httpapi/HttpApiScalar.ts +38 -4
- package/src/unstable/httpapi/HttpApiSchema.ts +67 -30
- package/src/unstable/httpapi/HttpApiSecurity.ts +74 -17
- package/src/unstable/httpapi/HttpApiSwagger.ts +24 -2
- package/src/unstable/httpapi/HttpApiTest.ts +31 -3
- package/src/unstable/httpapi/OpenApi.ts +115 -15
- package/src/unstable/observability/Otlp.ts +33 -3
- package/src/unstable/observability/OtlpExporter.ts +32 -1
- package/src/unstable/observability/OtlpLogger.ts +31 -2
- package/src/unstable/observability/OtlpMetrics.ts +37 -4
- package/src/unstable/observability/OtlpResource.ts +68 -12
- package/src/unstable/observability/OtlpSerialization.ts +28 -3
- package/src/unstable/observability/OtlpTracer.ts +38 -2
- package/src/unstable/observability/PrometheusMetrics.ts +32 -12
- package/src/unstable/observability/index.ts +2 -1
- package/src/unstable/persistence/KeyValueStore.ts +108 -28
- package/src/unstable/persistence/Persistable.ts +76 -15
- package/src/unstable/persistence/PersistedCache.ts +27 -2
- package/src/unstable/persistence/PersistedQueue.ts +98 -16
- package/src/unstable/persistence/Persistence.ts +97 -16
- package/src/unstable/persistence/RateLimiter.ts +98 -22
- package/src/unstable/persistence/Redis.ts +42 -5
- package/src/unstable/process/ChildProcess.ts +100 -79
- package/src/unstable/process/ChildProcessSpawner.ts +22 -11
- package/src/unstable/process/index.ts +2 -1
- package/src/unstable/reactivity/AsyncResult.ts +202 -61
- package/src/unstable/reactivity/Atom.ts +597 -143
- package/src/unstable/reactivity/AtomHttpApi.ts +41 -2
- package/src/unstable/reactivity/AtomRef.ts +51 -7
- package/src/unstable/reactivity/AtomRegistry.ts +141 -22
- package/src/unstable/reactivity/AtomRpc.ts +36 -2
- package/src/unstable/reactivity/Hydration.ts +45 -5
- package/src/unstable/reactivity/Reactivity.ts +95 -13
- package/src/unstable/rpc/Rpc.ts +255 -56
- package/src/unstable/rpc/RpcClient.ts +108 -20
- package/src/unstable/rpc/RpcClientError.ts +26 -2
- package/src/unstable/rpc/RpcGroup.ts +51 -8
- package/src/unstable/rpc/RpcMessage.ts +128 -32
- package/src/unstable/rpc/RpcMiddleware.ts +100 -20
- package/src/unstable/rpc/RpcSchema.ts +38 -4
- package/src/unstable/rpc/RpcSerialization.ts +60 -13
- package/src/unstable/rpc/RpcServer.ts +108 -25
- package/src/unstable/rpc/RpcTest.ts +20 -1
- package/src/unstable/rpc/RpcWorker.ts +42 -8
- package/src/unstable/rpc/Utils.ts +31 -0
- package/src/unstable/schema/Model.ts +148 -52
- package/src/unstable/schema/VariantSchema.ts +104 -24
- package/src/unstable/socket/Socket.ts +168 -35
- package/src/unstable/socket/SocketServer.ts +58 -10
- package/src/unstable/sql/Migrator.ts +57 -5
- package/src/unstable/sql/SqlClient.ts +55 -2
- package/src/unstable/sql/SqlConnection.ts +31 -0
- package/src/unstable/sql/SqlError.ts +117 -0
- package/src/unstable/sql/SqlModel.ts +26 -5
- package/src/unstable/sql/SqlResolver.ts +56 -13
- package/src/unstable/sql/SqlSchema.ts +29 -8
- package/src/unstable/sql/SqlStream.ts +23 -0
- package/src/unstable/sql/Statement.ts +141 -0
- package/src/unstable/sql/index.ts +1 -1
- package/src/unstable/workers/Transferable.ts +65 -13
- package/src/unstable/workers/Worker.ts +60 -8
- package/src/unstable/workers/WorkerError.ts +50 -9
- package/src/unstable/workers/WorkerRunner.ts +32 -3
- package/src/unstable/workers/index.ts +1 -1
- package/src/unstable/workflow/Activity.ts +62 -11
- package/src/unstable/workflow/DurableClock.ts +26 -3
- package/src/unstable/workflow/DurableDeferred.ts +146 -31
- package/src/unstable/workflow/DurableQueue.ts +366 -0
- package/src/unstable/workflow/Workflow.ts +122 -32
- package/src/unstable/workflow/WorkflowEngine.ts +40 -5
- package/src/unstable/workflow/WorkflowProxy.ts +32 -2
- package/src/unstable/workflow/WorkflowProxyServer.ts +40 -6
- package/src/unstable/workflow/index.ts +5 -0
package/src/DateTime.ts
CHANGED
|
@@ -1,4 +1,53 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* The `DateTime` module provides immutable data types and utilities for working
|
|
3
|
+
* with instants, UTC date-times, zoned date-times, and time zones. A
|
|
4
|
+
* `DateTime` is always an absolute point in time, represented internally by
|
|
5
|
+
* epoch milliseconds, and may also carry a `TimeZone` for zone-aware calendar
|
|
6
|
+
* parts and formatting.
|
|
7
|
+
*
|
|
8
|
+
* **Mental model**
|
|
9
|
+
*
|
|
10
|
+
* - `DateTime` is a discriminated union: `Utc | Zoned`
|
|
11
|
+
* - `Utc` stores an absolute instant without an associated time zone
|
|
12
|
+
* - `Zoned` stores the same kind of absolute instant plus a `TimeZone`
|
|
13
|
+
* - Time zones can be fixed offsets or named IANA zones such as `"Europe/Rome"`
|
|
14
|
+
* - Comparison and ordering use the instant, so two values in different zones
|
|
15
|
+
* can still be equivalent
|
|
16
|
+
* - Calendar parts and formatted output depend on whether you ask for UTC parts
|
|
17
|
+
* or zone-adjusted parts
|
|
18
|
+
*
|
|
19
|
+
* **Common tasks**
|
|
20
|
+
*
|
|
21
|
+
* - Construct values: {@link make}, {@link makeUnsafe}, {@link makeZoned}, {@link makeZonedUnsafe}
|
|
22
|
+
* - Get the current instant: {@link now}, {@link nowInCurrentZone}
|
|
23
|
+
* - Create time zones: {@link zoneMakeOffset}, {@link zoneMakeNamed}, {@link zoneFromString}
|
|
24
|
+
* - Attach or change zones: {@link setZone}, {@link setZoneNamed}, {@link setZoneCurrent}, {@link toUtc}
|
|
25
|
+
* - Convert to platform values or parts: {@link toDate}, {@link toDateUtc}, {@link toEpochMillis}, {@link toParts}, {@link toPartsUtc}
|
|
26
|
+
* - Compare and bound values: {@link Equivalence}, {@link Order}, {@link distance}, {@link min}, {@link max}, {@link clamp}, {@link between}
|
|
27
|
+
* - Transform values: {@link add}, {@link subtract}, {@link startOf}, {@link endOf}, {@link nearest}, {@link setParts}, {@link mutate}
|
|
28
|
+
* - Format values: {@link format}, {@link formatUtc}, {@link formatLocal}, {@link formatIntl}, {@link formatIso}, {@link formatIsoZoned}
|
|
29
|
+
* - Provide an application time zone: {@link CurrentTimeZone}, {@link withCurrentZone}, {@link layerCurrentZone}
|
|
30
|
+
*
|
|
31
|
+
* **Gotchas**
|
|
32
|
+
*
|
|
33
|
+
* - `make` and `makeZoned` return `Option`; unsafe constructors throw on invalid
|
|
34
|
+
* input
|
|
35
|
+
* - `DateTime` equality is instant-based, not display-time-based
|
|
36
|
+
* - `setZone` changes the zone used for local parts and formatting without
|
|
37
|
+
* changing the represented instant
|
|
38
|
+
* - Use `adjustForTimeZone` with {@link makeZoned} when input parts should be
|
|
39
|
+
* interpreted as wall-clock time in the target zone
|
|
40
|
+
* - Daylight-saving gaps and repeated local times are resolved with
|
|
41
|
+
* `Disambiguation`
|
|
42
|
+
* - Prefer the Clock-backed {@link now} and `CurrentTimeZone` services in
|
|
43
|
+
* Effect workflows; unsafe helpers read from the host environment directly
|
|
44
|
+
*
|
|
45
|
+
* **See also**
|
|
46
|
+
*
|
|
47
|
+
* - {@link DateTime} for the UTC/zoned data model
|
|
48
|
+
* - {@link TimeZone} for offset and named time-zone values
|
|
49
|
+
* - {@link Disambiguation} for daylight-saving ambiguity handling
|
|
50
|
+
*
|
|
2
51
|
* @since 3.6.0
|
|
3
52
|
*/
|
|
4
53
|
import type { IllegalArgumentError } from "./Cause.ts"
|
|
@@ -22,14 +71,19 @@ const TimeZoneTypeId = Internal.TimeZoneTypeId
|
|
|
22
71
|
* A `DateTime` represents a point in time. It can optionally have a time zone
|
|
23
72
|
* associated with it.
|
|
24
73
|
*
|
|
25
|
-
* @since 3.6.0
|
|
26
74
|
* @category models
|
|
75
|
+
* @since 3.6.0
|
|
27
76
|
*/
|
|
28
77
|
export type DateTime = Utc | Zoned
|
|
29
78
|
|
|
30
79
|
/**
|
|
31
|
-
*
|
|
80
|
+
* Represents a `DateTime` stored as an absolute UTC instant with no associated
|
|
81
|
+
* time zone.
|
|
82
|
+
*
|
|
83
|
+
* Use `DateTime.isUtc` to narrow a `DateTime` to this variant.
|
|
84
|
+
*
|
|
32
85
|
* @category models
|
|
86
|
+
* @since 3.6.0
|
|
33
87
|
*/
|
|
34
88
|
export interface Utc extends DateTime.Proto {
|
|
35
89
|
readonly _tag: "Utc"
|
|
@@ -38,8 +92,14 @@ export interface Utc extends DateTime.Proto {
|
|
|
38
92
|
}
|
|
39
93
|
|
|
40
94
|
/**
|
|
41
|
-
*
|
|
95
|
+
* Represents a `DateTime` with an associated `TimeZone`.
|
|
96
|
+
*
|
|
97
|
+
* A zoned value still represents an absolute instant through
|
|
98
|
+
* `epochMilliseconds`, while the time zone is used for wall-clock parts,
|
|
99
|
+
* formatting, and zone-aware transformations.
|
|
100
|
+
*
|
|
42
101
|
* @category models
|
|
102
|
+
* @since 3.6.0
|
|
43
103
|
*/
|
|
44
104
|
export interface Zoned extends DateTime.Proto {
|
|
45
105
|
readonly _tag: "Zoned"
|
|
@@ -51,31 +111,55 @@ export interface Zoned extends DateTime.Proto {
|
|
|
51
111
|
}
|
|
52
112
|
|
|
53
113
|
/**
|
|
54
|
-
*
|
|
114
|
+
* Companion namespace containing the public helper types used by `DateTime`
|
|
115
|
+
* constructors, parts APIs, formatting, and date/time arithmetic.
|
|
116
|
+
*
|
|
55
117
|
* @category models
|
|
118
|
+
* @since 3.6.0
|
|
56
119
|
*/
|
|
57
120
|
export declare namespace DateTime {
|
|
58
121
|
/**
|
|
59
|
-
*
|
|
122
|
+
* Input accepted by `DateTime.make`, `DateTime.makeUnsafe`, and the zoned
|
|
123
|
+
* constructors.
|
|
124
|
+
*
|
|
125
|
+
* Includes existing `DateTime` values, partial date parts, epoch-millisecond
|
|
126
|
+
* objects, epoch milliseconds, JavaScript `Date` instances, and parseable date
|
|
127
|
+
* strings.
|
|
128
|
+
*
|
|
60
129
|
* @category models
|
|
130
|
+
* @since 3.6.0
|
|
61
131
|
*/
|
|
62
132
|
export type Input = DateTime | Partial<Parts> | Instant | InstantWithZone | Date | number | string
|
|
63
133
|
|
|
64
134
|
/**
|
|
65
|
-
*
|
|
135
|
+
* Type-level helper used by constructors to preserve a zoned input.
|
|
136
|
+
*
|
|
137
|
+
* When the input type is `DateTime.Zoned`, the result type is
|
|
138
|
+
* `DateTime.Zoned`; otherwise the result type is `DateTime.Utc`.
|
|
139
|
+
*
|
|
66
140
|
* @category models
|
|
141
|
+
* @since 3.6.0
|
|
67
142
|
*/
|
|
68
143
|
export type PreserveZone<A extends DateTime.Input> = A extends Zoned ? Zoned : Utc
|
|
69
144
|
|
|
70
145
|
/**
|
|
71
|
-
*
|
|
146
|
+
* Date and time unit name accepted by `DateTime` rounding and arithmetic
|
|
147
|
+
* APIs.
|
|
148
|
+
*
|
|
149
|
+
* Includes both singular units, such as `"day"`, and plural units, such as
|
|
150
|
+
* `"days"`.
|
|
151
|
+
*
|
|
72
152
|
* @category models
|
|
153
|
+
* @since 3.6.0
|
|
73
154
|
*/
|
|
74
155
|
export type Unit = UnitSingular | UnitPlural
|
|
75
156
|
|
|
76
157
|
/**
|
|
77
|
-
*
|
|
158
|
+
* Singular date and time unit names used by rounding APIs such as
|
|
159
|
+
* `DateTime.startOf`, `DateTime.endOf`, and `DateTime.nearest`.
|
|
160
|
+
*
|
|
78
161
|
* @category models
|
|
162
|
+
* @since 3.6.0
|
|
79
163
|
*/
|
|
80
164
|
export type UnitSingular =
|
|
81
165
|
| "millisecond"
|
|
@@ -88,8 +172,11 @@ export declare namespace DateTime {
|
|
|
88
172
|
| "year"
|
|
89
173
|
|
|
90
174
|
/**
|
|
91
|
-
*
|
|
175
|
+
* Plural date and time unit names used by `DateTime.PartsForMath` for
|
|
176
|
+
* amount-based arithmetic.
|
|
177
|
+
*
|
|
92
178
|
* @category models
|
|
179
|
+
* @since 3.6.0
|
|
93
180
|
*/
|
|
94
181
|
export type UnitPlural =
|
|
95
182
|
| "milliseconds"
|
|
@@ -102,8 +189,14 @@ export declare namespace DateTime {
|
|
|
102
189
|
| "years"
|
|
103
190
|
|
|
104
191
|
/**
|
|
105
|
-
*
|
|
192
|
+
* Calendar and time components of a `DateTime`, including the weekday.
|
|
193
|
+
*
|
|
194
|
+
* `month` is one-based (`1` for January through `12` for December), and
|
|
195
|
+
* `weekDay` follows JavaScript `Date#getUTCDay` numbering (`0` for Sunday
|
|
196
|
+
* through `6` for Saturday).
|
|
197
|
+
*
|
|
106
198
|
* @category models
|
|
199
|
+
* @since 3.6.0
|
|
107
200
|
*/
|
|
108
201
|
export interface PartsWithWeekday {
|
|
109
202
|
readonly millisecond: number
|
|
@@ -117,8 +210,12 @@ export declare namespace DateTime {
|
|
|
117
210
|
}
|
|
118
211
|
|
|
119
212
|
/**
|
|
120
|
-
*
|
|
213
|
+
* Calendar and time components of a `DateTime`, without weekday information.
|
|
214
|
+
*
|
|
215
|
+
* `month` is one-based (`1` for January through `12` for December).
|
|
216
|
+
*
|
|
121
217
|
* @category models
|
|
218
|
+
* @since 3.6.0
|
|
122
219
|
*/
|
|
123
220
|
export interface Parts {
|
|
124
221
|
readonly millisecond: number
|
|
@@ -131,8 +228,12 @@ export declare namespace DateTime {
|
|
|
131
228
|
}
|
|
132
229
|
|
|
133
230
|
/**
|
|
134
|
-
*
|
|
231
|
+
* Plural amount fields accepted by `DateTime.add` and `DateTime.subtract`.
|
|
232
|
+
*
|
|
233
|
+
* Each field represents the number of units to add or subtract for that part.
|
|
234
|
+
*
|
|
135
235
|
* @category models
|
|
236
|
+
* @since 3.6.0
|
|
136
237
|
*/
|
|
137
238
|
export interface PartsForMath {
|
|
138
239
|
readonly milliseconds: number
|
|
@@ -146,16 +247,24 @@ export declare namespace DateTime {
|
|
|
146
247
|
}
|
|
147
248
|
|
|
148
249
|
/**
|
|
149
|
-
*
|
|
250
|
+
* Object input representing an absolute instant as milliseconds since the Unix
|
|
251
|
+
* epoch.
|
|
252
|
+
*
|
|
150
253
|
* @category models
|
|
254
|
+
* @since 4.0.0
|
|
151
255
|
*/
|
|
152
256
|
export interface Instant {
|
|
153
257
|
readonly epochMilliseconds: number
|
|
154
258
|
}
|
|
155
259
|
|
|
156
260
|
/**
|
|
157
|
-
*
|
|
261
|
+
* Object input representing an absolute instant plus a time zone identifier.
|
|
262
|
+
*
|
|
263
|
+
* `DateTime.makeZoned` and `DateTime.makeZonedUnsafe` use `timeZoneId` when
|
|
264
|
+
* no explicit `timeZone` option is supplied.
|
|
265
|
+
*
|
|
158
266
|
* @category models
|
|
267
|
+
* @since 4.0.0
|
|
159
268
|
*/
|
|
160
269
|
export interface InstantWithZone {
|
|
161
270
|
readonly timeZoneId: string
|
|
@@ -163,8 +272,13 @@ export declare namespace DateTime {
|
|
|
163
272
|
}
|
|
164
273
|
|
|
165
274
|
/**
|
|
166
|
-
*
|
|
275
|
+
* Shared protocol implemented by all `DateTime` values.
|
|
276
|
+
*
|
|
277
|
+
* Provides the `DateTime` type identifier along with pipe and inspection
|
|
278
|
+
* support.
|
|
279
|
+
*
|
|
167
280
|
* @category models
|
|
281
|
+
* @since 3.6.0
|
|
168
282
|
*/
|
|
169
283
|
export interface Proto extends Pipeable, Inspectable {
|
|
170
284
|
readonly [TypeId]: typeof TypeId
|
|
@@ -172,27 +286,43 @@ export declare namespace DateTime {
|
|
|
172
286
|
}
|
|
173
287
|
|
|
174
288
|
/**
|
|
175
|
-
*
|
|
289
|
+
* Represents a time zone used by `DateTime.Zoned`.
|
|
290
|
+
*
|
|
291
|
+
* A `TimeZone` is either a fixed offset from UTC or a named IANA time zone.
|
|
292
|
+
*
|
|
176
293
|
* @category models
|
|
294
|
+
* @since 3.6.0
|
|
177
295
|
*/
|
|
178
296
|
export type TimeZone = TimeZone.Offset | TimeZone.Named
|
|
179
297
|
|
|
180
298
|
/**
|
|
181
|
-
*
|
|
299
|
+
* Companion namespace containing the public variant and protocol types for
|
|
300
|
+
* `TimeZone`.
|
|
301
|
+
*
|
|
182
302
|
* @category models
|
|
303
|
+
* @since 3.6.0
|
|
183
304
|
*/
|
|
184
305
|
export declare namespace TimeZone {
|
|
185
306
|
/**
|
|
186
|
-
*
|
|
307
|
+
* Shared protocol implemented by all `TimeZone` values.
|
|
308
|
+
*
|
|
309
|
+
* Provides the `TimeZone` type identifier and inspection support.
|
|
310
|
+
*
|
|
187
311
|
* @category models
|
|
312
|
+
* @since 3.6.0
|
|
188
313
|
*/
|
|
189
314
|
export interface Proto extends Inspectable {
|
|
190
315
|
readonly [TimeZoneTypeId]: typeof TimeZoneTypeId
|
|
191
316
|
}
|
|
192
317
|
|
|
193
318
|
/**
|
|
194
|
-
*
|
|
319
|
+
* Fixed-offset time zone.
|
|
320
|
+
*
|
|
321
|
+
* The `offset` is measured in milliseconds from UTC. Positive offsets are
|
|
322
|
+
* ahead of UTC, and negative offsets are behind UTC.
|
|
323
|
+
*
|
|
195
324
|
* @category models
|
|
325
|
+
* @since 3.6.0
|
|
196
326
|
*/
|
|
197
327
|
export interface Offset extends Proto {
|
|
198
328
|
readonly _tag: "Offset"
|
|
@@ -200,8 +330,13 @@ export declare namespace TimeZone {
|
|
|
200
330
|
}
|
|
201
331
|
|
|
202
332
|
/**
|
|
203
|
-
*
|
|
333
|
+
* Named IANA time zone.
|
|
334
|
+
*
|
|
335
|
+
* The `id` field contains the resolved time zone identifier, such as
|
|
336
|
+
* `"Europe/London"` or `"America/New_York"`.
|
|
337
|
+
*
|
|
204
338
|
* @category models
|
|
339
|
+
* @since 3.6.0
|
|
205
340
|
*/
|
|
206
341
|
export interface Named extends Proto {
|
|
207
342
|
readonly _tag: "Named"
|
|
@@ -228,7 +363,8 @@ export declare namespace TimeZone {
|
|
|
228
363
|
*
|
|
229
364
|
* - `"reject"`: Throw an `RangeError` when encountering ambiguous or non-existent times.
|
|
230
365
|
*
|
|
231
|
-
*
|
|
366
|
+
* **Example** (Resolving ambiguous local times)
|
|
367
|
+
*
|
|
232
368
|
* ```ts
|
|
233
369
|
* import { DateTime } from "effect"
|
|
234
370
|
*
|
|
@@ -268,8 +404,8 @@ export declare namespace TimeZone {
|
|
|
268
404
|
* // Time after gap: 2025-03-09T07:30:00.000Z (03:30 EDT)
|
|
269
405
|
* ```
|
|
270
406
|
*
|
|
271
|
-
* @since 3.18.0
|
|
272
407
|
* @category models
|
|
408
|
+
* @since 3.18.0
|
|
273
409
|
*/
|
|
274
410
|
export type Disambiguation = "compatible" | "earlier" | "later" | "reject"
|
|
275
411
|
|
|
@@ -278,48 +414,50 @@ export type Disambiguation = "compatible" | "earlier" | "later" | "reject"
|
|
|
278
414
|
// =============================================================================
|
|
279
415
|
|
|
280
416
|
/**
|
|
281
|
-
*
|
|
417
|
+
* Checks whether a value is a `DateTime`.
|
|
418
|
+
*
|
|
282
419
|
* @category guards
|
|
420
|
+
* @since 3.6.0
|
|
283
421
|
*/
|
|
284
422
|
export const isDateTime: (u: unknown) => u is DateTime = Internal.isDateTime
|
|
285
423
|
|
|
286
424
|
/**
|
|
287
425
|
* Checks if a value is a `TimeZone`.
|
|
288
426
|
*
|
|
289
|
-
* @since 3.6.0
|
|
290
427
|
* @category guards
|
|
428
|
+
* @since 3.6.0
|
|
291
429
|
*/
|
|
292
430
|
export const isTimeZone: (u: unknown) => u is TimeZone = Internal.isTimeZone
|
|
293
431
|
|
|
294
432
|
/**
|
|
295
433
|
* Checks if a value is an offset-based `TimeZone`.
|
|
296
434
|
*
|
|
297
|
-
* @since 3.6.0
|
|
298
435
|
* @category guards
|
|
436
|
+
* @since 3.6.0
|
|
299
437
|
*/
|
|
300
438
|
export const isTimeZoneOffset: (u: unknown) => u is TimeZone.Offset = Internal.isTimeZoneOffset
|
|
301
439
|
|
|
302
440
|
/**
|
|
303
441
|
* Checks if a value is a named `TimeZone` (IANA time zone).
|
|
304
442
|
*
|
|
305
|
-
* @since 3.6.0
|
|
306
443
|
* @category guards
|
|
444
|
+
* @since 3.6.0
|
|
307
445
|
*/
|
|
308
446
|
export const isTimeZoneNamed: (u: unknown) => u is TimeZone.Named = Internal.isTimeZoneNamed
|
|
309
447
|
|
|
310
448
|
/**
|
|
311
449
|
* Checks if a `DateTime` is a UTC `DateTime` (no time zone information).
|
|
312
450
|
*
|
|
313
|
-
* @since 3.6.0
|
|
314
451
|
* @category guards
|
|
452
|
+
* @since 3.6.0
|
|
315
453
|
*/
|
|
316
454
|
export const isUtc: (self: DateTime) => self is Utc = Internal.isUtc
|
|
317
455
|
|
|
318
456
|
/**
|
|
319
457
|
* Checks if a `DateTime` is a zoned `DateTime` (has time zone information).
|
|
320
458
|
*
|
|
321
|
-
* @since 3.6.0
|
|
322
459
|
* @category guards
|
|
460
|
+
* @since 3.6.0
|
|
323
461
|
*/
|
|
324
462
|
export const isZoned: (self: DateTime) => self is Zoned = Internal.isZoned
|
|
325
463
|
|
|
@@ -333,7 +471,8 @@ export const isZoned: (self: DateTime) => self is Zoned = Internal.isZoned
|
|
|
333
471
|
* Two `DateTime` values are considered equivalent if they represent the same
|
|
334
472
|
* point in time, regardless of their time zone.
|
|
335
473
|
*
|
|
336
|
-
*
|
|
474
|
+
* **Example** (Comparing DateTime values for equivalence)
|
|
475
|
+
*
|
|
337
476
|
* ```ts
|
|
338
477
|
* import { DateTime } from "effect"
|
|
339
478
|
*
|
|
@@ -356,7 +495,8 @@ export const Equivalence: Equ.Equivalence<DateTime> = Internal.Equivalence
|
|
|
356
495
|
* `DateTime` values are ordered by their epoch milliseconds, so earlier times
|
|
357
496
|
* come before later times regardless of time zone.
|
|
358
497
|
*
|
|
359
|
-
*
|
|
498
|
+
* **Example** (Sorting DateTime values chronologically)
|
|
499
|
+
*
|
|
360
500
|
* ```ts
|
|
361
501
|
* import { Array, DateTime } from "effect"
|
|
362
502
|
*
|
|
@@ -382,7 +522,8 @@ export const Order: order.Order<DateTime> = Internal.Order
|
|
|
382
522
|
* If the `DateTime` is after the maximum, the maximum is returned.
|
|
383
523
|
* Otherwise, the original `DateTime` is returned.
|
|
384
524
|
*
|
|
385
|
-
*
|
|
525
|
+
* **Example** (Clamping DateTime values)
|
|
526
|
+
*
|
|
386
527
|
* ```ts
|
|
387
528
|
* import { DateTime } from "effect"
|
|
388
529
|
*
|
|
@@ -405,7 +546,8 @@ export const clamp: {
|
|
|
405
546
|
* If the `DateTime` is after the maximum, the maximum is returned.
|
|
406
547
|
* Otherwise, the original `DateTime` is returned.
|
|
407
548
|
*
|
|
408
|
-
*
|
|
549
|
+
* **Example** (Clamping DateTime values)
|
|
550
|
+
*
|
|
409
551
|
* ```ts
|
|
410
552
|
* import { DateTime } from "effect"
|
|
411
553
|
*
|
|
@@ -428,7 +570,8 @@ export const clamp: {
|
|
|
428
570
|
* If the `DateTime` is after the maximum, the maximum is returned.
|
|
429
571
|
* Otherwise, the original `DateTime` is returned.
|
|
430
572
|
*
|
|
431
|
-
*
|
|
573
|
+
* **Example** (Clamping DateTime values)
|
|
574
|
+
*
|
|
432
575
|
* ```ts
|
|
433
576
|
* import { DateTime } from "effect"
|
|
434
577
|
*
|
|
@@ -455,7 +598,8 @@ export const clamp: {
|
|
|
455
598
|
*
|
|
456
599
|
* If the `Date` is invalid, an `IllegalArgumentError` will be thrown.
|
|
457
600
|
*
|
|
458
|
-
*
|
|
601
|
+
* **Example** (Creating DateTime values from Dates)
|
|
602
|
+
*
|
|
459
603
|
* ```ts
|
|
460
604
|
* import { DateTime } from "effect"
|
|
461
605
|
*
|
|
@@ -479,21 +623,26 @@ export const fromDateUnsafe: (date: Date) => Utc = Internal.fromDateUnsafe
|
|
|
479
623
|
* - An object with the parts of a date
|
|
480
624
|
* - A `string` that can be parsed by `Date.parse`
|
|
481
625
|
*
|
|
482
|
-
*
|
|
483
|
-
*
|
|
484
|
-
* @example
|
|
626
|
+
* **Example** (Creating DateTime values unsafely)
|
|
627
|
+
*
|
|
485
628
|
* ```ts
|
|
486
629
|
* import { DateTime } from "effect"
|
|
487
630
|
*
|
|
488
631
|
* // from Date
|
|
489
|
-
* DateTime.makeUnsafe(new Date())
|
|
632
|
+
* const fromDate = DateTime.makeUnsafe(new Date("2024-01-01T12:00:00Z"))
|
|
633
|
+
* console.log(DateTime.formatIso(fromDate)) // "2024-01-01T12:00:00.000Z"
|
|
490
634
|
*
|
|
491
635
|
* // from parts
|
|
492
|
-
* DateTime.makeUnsafe({ year: 2024 })
|
|
636
|
+
* const fromParts = DateTime.makeUnsafe({ year: 2024 })
|
|
637
|
+
* console.log(DateTime.formatIso(fromParts)) // "2024-01-01T00:00:00.000Z"
|
|
493
638
|
*
|
|
494
639
|
* // from string
|
|
495
|
-
* DateTime.makeUnsafe("2024-01-01")
|
|
640
|
+
* const fromString = DateTime.makeUnsafe("2024-01-01")
|
|
641
|
+
* console.log(DateTime.formatIso(fromString)) // "2024-01-01T00:00:00.000Z"
|
|
496
642
|
* ```
|
|
643
|
+
*
|
|
644
|
+
* @category constructors
|
|
645
|
+
* @since 3.6.0
|
|
497
646
|
*/
|
|
498
647
|
export const makeUnsafe: <A extends DateTime.Input>(input: A) => DateTime.PreserveZone<A> = Internal.makeUnsafe
|
|
499
648
|
|
|
@@ -511,14 +660,20 @@ export const makeUnsafe: <A extends DateTime.Input>(input: A) => DateTime.Preser
|
|
|
511
660
|
* - `later`: Always choose the later of two possible times
|
|
512
661
|
* - `reject`: Throw an error when ambiguous times are encountered
|
|
513
662
|
*
|
|
514
|
-
*
|
|
515
|
-
*
|
|
516
|
-
* @example
|
|
663
|
+
* **Example** (Creating zoned DateTime values unsafely)
|
|
664
|
+
*
|
|
517
665
|
* ```ts
|
|
518
666
|
* import { DateTime } from "effect"
|
|
519
667
|
*
|
|
520
|
-
* DateTime.makeZonedUnsafe(
|
|
668
|
+
* const zoned = DateTime.makeZonedUnsafe("2024-06-15T14:30:00Z", {
|
|
669
|
+
* timeZone: "Europe/London"
|
|
670
|
+
* })
|
|
671
|
+
*
|
|
672
|
+
* console.log(DateTime.formatIsoZoned(zoned)) // "2024-06-15T15:30:00.000+01:00[Europe/London]"
|
|
521
673
|
* ```
|
|
674
|
+
*
|
|
675
|
+
* @category constructors
|
|
676
|
+
* @since 3.6.0
|
|
522
677
|
*/
|
|
523
678
|
export const makeZonedUnsafe: (input: DateTime.Input, options?: {
|
|
524
679
|
readonly timeZone?: number | string | TimeZone | undefined
|
|
@@ -527,29 +682,41 @@ export const makeZonedUnsafe: (input: DateTime.Input, options?: {
|
|
|
527
682
|
}) => Zoned = Internal.makeZonedUnsafe
|
|
528
683
|
|
|
529
684
|
/**
|
|
530
|
-
*
|
|
685
|
+
* Creates a `DateTime.Zoned` from an input and a time zone.
|
|
531
686
|
*
|
|
532
|
-
*
|
|
533
|
-
*
|
|
534
|
-
*
|
|
687
|
+
* By default, the input is interpreted as a UTC instant and the time zone is
|
|
688
|
+
* attached without changing that instant. When `adjustForTimeZone` is `true`,
|
|
689
|
+
* the input is interpreted as wall-clock time in the target zone.
|
|
535
690
|
*
|
|
536
|
-
* When `adjustForTimeZone` is true
|
|
537
|
-
*
|
|
538
|
-
* - `compatible` (default): Choose earlier time for repeated times, later for gaps
|
|
539
|
-
* - `earlier`: Always choose the earlier of two possible times
|
|
540
|
-
* - `later`: Always choose the later of two possible times
|
|
541
|
-
* - `reject`: Throw an error when ambiguous times are encountered
|
|
691
|
+
* When `adjustForTimeZone` is `true`, `disambiguation` controls
|
|
692
|
+
* daylight-saving gaps and repeated times:
|
|
542
693
|
*
|
|
543
|
-
*
|
|
694
|
+
* - `"compatible"` (default): chooses the earlier occurrence for repeated
|
|
695
|
+
* times and the later interpretation for gaps
|
|
696
|
+
* - `"earlier"`: chooses the earlier possible instant
|
|
697
|
+
* - `"later"`: chooses the later possible instant
|
|
698
|
+
* - `"reject"`: rejects ambiguous or nonexistent wall-clock times
|
|
699
|
+
*
|
|
700
|
+
* Returns `Some` when construction succeeds, or `None` when the input, time
|
|
701
|
+
* zone, or disambiguation cannot be resolved.
|
|
702
|
+
*
|
|
703
|
+
* **Example** (Creating optional zoned DateTime values)
|
|
544
704
|
*
|
|
545
|
-
* @since 3.6.0
|
|
546
|
-
* @category constructors
|
|
547
|
-
* @example
|
|
548
705
|
* ```ts
|
|
549
706
|
* import { DateTime } from "effect"
|
|
550
707
|
*
|
|
551
|
-
* DateTime.makeZoned(
|
|
708
|
+
* const result = DateTime.makeZoned("2024-06-15T14:30:00Z", {
|
|
709
|
+
* timeZone: "Europe/London"
|
|
710
|
+
* })
|
|
711
|
+
*
|
|
712
|
+
* console.log(result._tag) // "Some"
|
|
713
|
+
* if (result._tag === "Some") {
|
|
714
|
+
* console.log(DateTime.formatIsoZoned(result.value)) // "2024-06-15T15:30:00.000+01:00[Europe/London]"
|
|
715
|
+
* }
|
|
552
716
|
* ```
|
|
717
|
+
*
|
|
718
|
+
* @category constructors
|
|
719
|
+
* @since 3.6.0
|
|
553
720
|
*/
|
|
554
721
|
export const makeZoned: (
|
|
555
722
|
input: DateTime.Input,
|
|
@@ -561,40 +728,54 @@ export const makeZoned: (
|
|
|
561
728
|
) => Option.Option<Zoned> = Internal.makeZoned
|
|
562
729
|
|
|
563
730
|
/**
|
|
564
|
-
*
|
|
731
|
+
* Creates a `DateTime` from one of the following:
|
|
565
732
|
*
|
|
566
733
|
* - A `DateTime`
|
|
567
|
-
* - A `Date`
|
|
568
|
-
* - The
|
|
569
|
-
* - An object with
|
|
570
|
-
* - A
|
|
734
|
+
* - A JavaScript `Date`
|
|
735
|
+
* - The number of milliseconds since the Unix epoch
|
|
736
|
+
* - An object with date and time parts
|
|
737
|
+
* - A string that can be parsed as a date
|
|
571
738
|
*
|
|
572
|
-
*
|
|
739
|
+
* Returns `Some` with the constructed `DateTime` when the input is valid, or
|
|
740
|
+
* `None` when construction would fail, including invalid `Date` instances or
|
|
741
|
+
* unparseable strings.
|
|
742
|
+
*
|
|
743
|
+
* **Example** (Creating optional DateTime values)
|
|
573
744
|
*
|
|
574
|
-
* @since 3.6.0
|
|
575
|
-
* @category constructors
|
|
576
|
-
* @example
|
|
577
745
|
* ```ts
|
|
578
746
|
* import { DateTime } from "effect"
|
|
579
747
|
*
|
|
580
748
|
* // from Date
|
|
581
|
-
* DateTime.make(new Date())
|
|
749
|
+
* const fromDate = DateTime.make(new Date("2024-01-01T12:00:00Z"))
|
|
750
|
+
* console.log(fromDate._tag) // "Some"
|
|
582
751
|
*
|
|
583
752
|
* // from parts
|
|
584
|
-
* DateTime.make({ year: 2024 })
|
|
753
|
+
* const fromParts = DateTime.make({ year: 2024 })
|
|
754
|
+
* console.log(fromParts._tag) // "Some"
|
|
585
755
|
*
|
|
586
756
|
* // from string
|
|
587
|
-
* DateTime.make("2024-01-01")
|
|
757
|
+
* const fromString = DateTime.make("2024-01-01")
|
|
758
|
+
* console.log(fromString._tag) // "Some"
|
|
759
|
+
*
|
|
760
|
+
* const invalid = DateTime.make("not a date")
|
|
761
|
+
* console.log(invalid._tag) // "None"
|
|
588
762
|
* ```
|
|
763
|
+
*
|
|
764
|
+
* @category constructors
|
|
765
|
+
* @since 3.6.0
|
|
589
766
|
*/
|
|
590
767
|
export const make: <A extends DateTime.Input>(input: A) => Option.Option<DateTime.PreserveZone<A>> = Internal.make
|
|
591
768
|
|
|
592
769
|
/**
|
|
593
|
-
*
|
|
770
|
+
* Parses an ISO zoned date-time string into a `DateTime.Zoned`.
|
|
594
771
|
*
|
|
595
|
-
*
|
|
772
|
+
* Accepts named-zone strings such as
|
|
773
|
+
* `YYYY-MM-DDTHH:mm:ss.sss+HH:MM[Time/Zone]` and offset-only strings such as
|
|
774
|
+
* `YYYY-MM-DDTHH:mm:ss.sss+HH:MM`. Returns `None` when the input cannot be
|
|
775
|
+
* parsed.
|
|
776
|
+
*
|
|
777
|
+
* **Example** (Parsing zoned DateTime strings)
|
|
596
778
|
*
|
|
597
|
-
* @example
|
|
598
779
|
* ```ts
|
|
599
780
|
* import { DateTime } from "effect"
|
|
600
781
|
*
|
|
@@ -610,33 +791,36 @@ export const make: <A extends DateTime.Input>(input: A) => Option.Option<DateTim
|
|
|
610
791
|
* console.log(invalid._tag === "None") // true
|
|
611
792
|
* ```
|
|
612
793
|
*
|
|
613
|
-
* @since 3.6.0
|
|
614
794
|
* @category constructors
|
|
795
|
+
* @since 3.6.0
|
|
615
796
|
*/
|
|
616
797
|
export const makeZonedFromString: (input: string) => Option.Option<Zoned> = Internal.makeZonedFromString
|
|
617
798
|
|
|
618
799
|
/**
|
|
619
800
|
* Get the current time using the `Clock` service and convert it to a `DateTime`.
|
|
620
801
|
*
|
|
621
|
-
*
|
|
622
|
-
*
|
|
623
|
-
* @example
|
|
802
|
+
* **Example** (Getting the current DateTime)
|
|
803
|
+
*
|
|
624
804
|
* ```ts
|
|
625
805
|
* import { DateTime, Effect } from "effect"
|
|
626
806
|
*
|
|
627
807
|
* Effect.gen(function*() {
|
|
628
|
-
* const now = yield* DateTime.
|
|
808
|
+
* const now = yield* DateTime.nowAsDate
|
|
809
|
+
* console.log(now instanceof Date) // true
|
|
629
810
|
* })
|
|
630
811
|
* ```
|
|
812
|
+
*
|
|
813
|
+
* @category constructors
|
|
814
|
+
* @since 3.6.0
|
|
631
815
|
*/
|
|
632
816
|
export const now: Effect.Effect<Utc> = Internal.now
|
|
633
817
|
|
|
634
818
|
/**
|
|
635
|
-
*
|
|
819
|
+
* Gets the current time from the `Clock` service and returns it as a
|
|
820
|
+
* JavaScript `Date`.
|
|
821
|
+
*
|
|
822
|
+
* **Example** (Getting the current Date)
|
|
636
823
|
*
|
|
637
|
-
* @since 3.6.0
|
|
638
|
-
* @category constructors
|
|
639
|
-
* @example
|
|
640
824
|
* ```ts
|
|
641
825
|
* import { DateTime, Effect } from "effect"
|
|
642
826
|
*
|
|
@@ -644,6 +828,9 @@ export const now: Effect.Effect<Utc> = Internal.now
|
|
|
644
828
|
* const now = yield* DateTime.now
|
|
645
829
|
* })
|
|
646
830
|
* ```
|
|
831
|
+
*
|
|
832
|
+
* @category constructors
|
|
833
|
+
* @since 3.6.0
|
|
647
834
|
*/
|
|
648
835
|
export const nowAsDate: Effect.Effect<Date> = Internal.nowAsDate
|
|
649
836
|
|
|
@@ -653,7 +840,8 @@ export const nowAsDate: Effect.Effect<Date> = Internal.nowAsDate
|
|
|
653
840
|
* This is a synchronous version of `now` that directly uses `Date.now()`
|
|
654
841
|
* instead of the Effect `Clock` service.
|
|
655
842
|
*
|
|
656
|
-
*
|
|
843
|
+
* **Example** (Getting the current DateTime unsafely)
|
|
844
|
+
*
|
|
657
845
|
* ```ts
|
|
658
846
|
* import { DateTime } from "effect"
|
|
659
847
|
*
|
|
@@ -673,9 +861,8 @@ export const nowUnsafe: LazyArg<Utc> = Internal.nowUnsafe
|
|
|
673
861
|
/**
|
|
674
862
|
* For a `DateTime` returns a new `DateTime.Utc`.
|
|
675
863
|
*
|
|
676
|
-
*
|
|
677
|
-
*
|
|
678
|
-
* @example
|
|
864
|
+
* **Example** (Converting DateTime values to UTC)
|
|
865
|
+
*
|
|
679
866
|
* ```ts
|
|
680
867
|
* import { DateTime } from "effect"
|
|
681
868
|
*
|
|
@@ -686,15 +873,17 @@ export const nowUnsafe: LazyArg<Utc> = Internal.nowUnsafe
|
|
|
686
873
|
* // set as UTC
|
|
687
874
|
* const utc: DateTime.Utc = DateTime.toUtc(now)
|
|
688
875
|
* ```
|
|
876
|
+
*
|
|
877
|
+
* @category time zones
|
|
878
|
+
* @since 3.13.0
|
|
689
879
|
*/
|
|
690
880
|
export const toUtc: (self: DateTime) => Utc = Internal.toUtc
|
|
691
881
|
|
|
692
882
|
/**
|
|
693
883
|
* Set the time zone of a `DateTime`, returning a new `DateTime.Zoned`.
|
|
694
884
|
*
|
|
695
|
-
*
|
|
696
|
-
*
|
|
697
|
-
* @example
|
|
885
|
+
* **Example** (Setting time zones)
|
|
886
|
+
*
|
|
698
887
|
* ```ts
|
|
699
888
|
* import { DateTime, Effect } from "effect"
|
|
700
889
|
*
|
|
@@ -706,14 +895,16 @@ export const toUtc: (self: DateTime) => Utc = Internal.toUtc
|
|
|
706
895
|
* const zoned: DateTime.Zoned = DateTime.setZone(now, zone)
|
|
707
896
|
* })
|
|
708
897
|
* ```
|
|
898
|
+
*
|
|
899
|
+
* @category time zones
|
|
900
|
+
* @since 3.6.0
|
|
709
901
|
*/
|
|
710
902
|
export const setZone: {
|
|
711
903
|
/**
|
|
712
904
|
* Set the time zone of a `DateTime`, returning a new `DateTime.Zoned`.
|
|
713
905
|
*
|
|
714
|
-
*
|
|
715
|
-
*
|
|
716
|
-
* @example
|
|
906
|
+
* **Example** (Setting time zones)
|
|
907
|
+
*
|
|
717
908
|
* ```ts
|
|
718
909
|
* import { DateTime, Effect } from "effect"
|
|
719
910
|
*
|
|
@@ -725,6 +916,9 @@ export const setZone: {
|
|
|
725
916
|
* const zoned: DateTime.Zoned = DateTime.setZone(now, zone)
|
|
726
917
|
* })
|
|
727
918
|
* ```
|
|
919
|
+
*
|
|
920
|
+
* @category time zones
|
|
921
|
+
* @since 3.6.0
|
|
728
922
|
*/
|
|
729
923
|
(
|
|
730
924
|
zone: TimeZone,
|
|
@@ -736,9 +930,8 @@ export const setZone: {
|
|
|
736
930
|
/**
|
|
737
931
|
* Set the time zone of a `DateTime`, returning a new `DateTime.Zoned`.
|
|
738
932
|
*
|
|
739
|
-
*
|
|
740
|
-
*
|
|
741
|
-
* @example
|
|
933
|
+
* **Example** (Setting time zones)
|
|
934
|
+
*
|
|
742
935
|
* ```ts
|
|
743
936
|
* import { DateTime, Effect } from "effect"
|
|
744
937
|
*
|
|
@@ -750,6 +943,9 @@ export const setZone: {
|
|
|
750
943
|
* const zoned: DateTime.Zoned = DateTime.setZone(now, zone)
|
|
751
944
|
* })
|
|
752
945
|
* ```
|
|
946
|
+
*
|
|
947
|
+
* @category time zones
|
|
948
|
+
* @since 3.6.0
|
|
753
949
|
*/
|
|
754
950
|
(
|
|
755
951
|
self: DateTime,
|
|
@@ -766,9 +962,8 @@ export const setZone: {
|
|
|
766
962
|
*
|
|
767
963
|
* The offset is in milliseconds.
|
|
768
964
|
*
|
|
769
|
-
*
|
|
770
|
-
*
|
|
771
|
-
* @example
|
|
965
|
+
* **Example** (Setting fixed-offset time zones)
|
|
966
|
+
*
|
|
772
967
|
* ```ts
|
|
773
968
|
* import { DateTime, Effect } from "effect"
|
|
774
969
|
*
|
|
@@ -779,6 +974,9 @@ export const setZone: {
|
|
|
779
974
|
* const zoned: DateTime.Zoned = DateTime.setZoneOffset(now, 3 * 60 * 60 * 1000)
|
|
780
975
|
* })
|
|
781
976
|
* ```
|
|
977
|
+
*
|
|
978
|
+
* @category time zones
|
|
979
|
+
* @since 3.6.0
|
|
782
980
|
*/
|
|
783
981
|
export const setZoneOffset: {
|
|
784
982
|
/**
|
|
@@ -786,9 +984,8 @@ export const setZoneOffset: {
|
|
|
786
984
|
*
|
|
787
985
|
* The offset is in milliseconds.
|
|
788
986
|
*
|
|
789
|
-
*
|
|
790
|
-
*
|
|
791
|
-
* @example
|
|
987
|
+
* **Example** (Setting fixed-offset time zones)
|
|
988
|
+
*
|
|
792
989
|
* ```ts
|
|
793
990
|
* import { DateTime, Effect } from "effect"
|
|
794
991
|
*
|
|
@@ -799,6 +996,9 @@ export const setZoneOffset: {
|
|
|
799
996
|
* const zoned: DateTime.Zoned = DateTime.setZoneOffset(now, 3 * 60 * 60 * 1000)
|
|
800
997
|
* })
|
|
801
998
|
* ```
|
|
999
|
+
*
|
|
1000
|
+
* @category time zones
|
|
1001
|
+
* @since 3.6.0
|
|
802
1002
|
*/
|
|
803
1003
|
(
|
|
804
1004
|
offset: number,
|
|
@@ -812,9 +1012,8 @@ export const setZoneOffset: {
|
|
|
812
1012
|
*
|
|
813
1013
|
* The offset is in milliseconds.
|
|
814
1014
|
*
|
|
815
|
-
*
|
|
816
|
-
*
|
|
817
|
-
* @example
|
|
1015
|
+
* **Example** (Setting fixed-offset time zones)
|
|
1016
|
+
*
|
|
818
1017
|
* ```ts
|
|
819
1018
|
* import { DateTime, Effect } from "effect"
|
|
820
1019
|
*
|
|
@@ -825,6 +1024,9 @@ export const setZoneOffset: {
|
|
|
825
1024
|
* const zoned: DateTime.Zoned = DateTime.setZoneOffset(now, 3 * 60 * 60 * 1000)
|
|
826
1025
|
* })
|
|
827
1026
|
* ```
|
|
1027
|
+
*
|
|
1028
|
+
* @category time zones
|
|
1029
|
+
* @since 3.6.0
|
|
828
1030
|
*/
|
|
829
1031
|
(
|
|
830
1032
|
self: DateTime,
|
|
@@ -841,7 +1043,8 @@ export const setZoneOffset: {
|
|
|
841
1043
|
*
|
|
842
1044
|
* If the time zone is invalid, an `IllegalArgumentError` will be thrown.
|
|
843
1045
|
*
|
|
844
|
-
*
|
|
1046
|
+
* **Example** (Creating named time zones unsafely)
|
|
1047
|
+
*
|
|
845
1048
|
* ```ts
|
|
846
1049
|
* import { DateTime } from "effect"
|
|
847
1050
|
*
|
|
@@ -855,8 +1058,8 @@ export const setZoneOffset: {
|
|
|
855
1058
|
* // DateTime.zoneMakeNamedUnsafe("Invalid/Zone")
|
|
856
1059
|
* ```
|
|
857
1060
|
*
|
|
858
|
-
* @since 3.6.0
|
|
859
1061
|
* @category time zones
|
|
1062
|
+
* @since 3.6.0
|
|
860
1063
|
*/
|
|
861
1064
|
export const zoneMakeNamedUnsafe: (zoneId: string) => TimeZone.Named = Internal.zoneMakeNamedUnsafe
|
|
862
1065
|
|
|
@@ -866,7 +1069,8 @@ export const zoneMakeNamedUnsafe: (zoneId: string) => TimeZone.Named = Internal.
|
|
|
866
1069
|
* The offset is specified in milliseconds from UTC. Positive values are
|
|
867
1070
|
* ahead of UTC, negative values are behind UTC.
|
|
868
1071
|
*
|
|
869
|
-
*
|
|
1072
|
+
* **Example** (Creating fixed-offset time zones)
|
|
1073
|
+
*
|
|
870
1074
|
* ```ts
|
|
871
1075
|
* import { DateTime } from "effect"
|
|
872
1076
|
*
|
|
@@ -888,7 +1092,8 @@ export const zoneMakeOffset: (offset: number) => TimeZone.Offset = Internal.zone
|
|
|
888
1092
|
*
|
|
889
1093
|
* If the time zone is invalid, `None` will be returned.
|
|
890
1094
|
*
|
|
891
|
-
*
|
|
1095
|
+
* **Example** (Creating optional named time zones)
|
|
1096
|
+
*
|
|
892
1097
|
* ```ts
|
|
893
1098
|
* import { DateTime } from "effect"
|
|
894
1099
|
*
|
|
@@ -909,7 +1114,8 @@ export const zoneMakeNamed: (zoneId: string) => Option.Option<TimeZone.Named> =
|
|
|
909
1114
|
*
|
|
910
1115
|
* If the time zone is invalid, it will fail with an `IllegalArgumentError`.
|
|
911
1116
|
*
|
|
912
|
-
*
|
|
1117
|
+
* **Example** (Creating named time zones effectfully)
|
|
1118
|
+
*
|
|
913
1119
|
* ```ts
|
|
914
1120
|
* import { DateTime, Effect } from "effect"
|
|
915
1121
|
*
|
|
@@ -932,15 +1138,13 @@ export const zoneMakeNamedEffect: (zoneId: string) => Effect.Effect<TimeZone.Nam
|
|
|
932
1138
|
* This uses the system's configured time zone, which may vary depending
|
|
933
1139
|
* on the runtime environment.
|
|
934
1140
|
*
|
|
935
|
-
*
|
|
1141
|
+
* **Example** (Creating local time zones)
|
|
1142
|
+
*
|
|
936
1143
|
* ```ts
|
|
937
1144
|
* import { DateTime } from "effect"
|
|
938
1145
|
*
|
|
939
1146
|
* const localZone = DateTime.zoneMakeLocal()
|
|
940
|
-
*
|
|
941
|
-
* const localTime = DateTime.setZone(now, localZone)
|
|
942
|
-
*
|
|
943
|
-
* console.log(DateTime.formatIsoZoned(localTime))
|
|
1147
|
+
* console.log(DateTime.zoneToString(localZone)) // Output depends on system time zone
|
|
944
1148
|
* ```
|
|
945
1149
|
*
|
|
946
1150
|
* @category time zones
|
|
@@ -953,7 +1157,8 @@ export const zoneMakeLocal: () => TimeZone.Named = Internal.zoneMakeLocal
|
|
|
953
1157
|
*
|
|
954
1158
|
* Supports both IANA time zone identifiers and offset formats like "+03:00".
|
|
955
1159
|
*
|
|
956
|
-
*
|
|
1160
|
+
* **Example** (Parsing time zones)
|
|
1161
|
+
*
|
|
957
1162
|
* ```ts
|
|
958
1163
|
* import { DateTime } from "effect"
|
|
959
1164
|
*
|
|
@@ -974,9 +1179,8 @@ export const zoneFromString: (zone: string) => Option.Option<TimeZone> = Interna
|
|
|
974
1179
|
/**
|
|
975
1180
|
* Format a `TimeZone` as a string.
|
|
976
1181
|
*
|
|
977
|
-
*
|
|
978
|
-
*
|
|
979
|
-
* @example
|
|
1182
|
+
* **Example** (Formatting time zones)
|
|
1183
|
+
*
|
|
980
1184
|
* ```ts
|
|
981
1185
|
* import { DateTime } from "effect"
|
|
982
1186
|
*
|
|
@@ -986,6 +1190,9 @@ export const zoneFromString: (zone: string) => Option.Option<TimeZone> = Interna
|
|
|
986
1190
|
* // Outputs "Europe/London"
|
|
987
1191
|
* DateTime.zoneToString(DateTime.zoneMakeNamedUnsafe("Europe/London"))
|
|
988
1192
|
* ```
|
|
1193
|
+
*
|
|
1194
|
+
* @category time zones
|
|
1195
|
+
* @since 3.6.0
|
|
989
1196
|
*/
|
|
990
1197
|
export const zoneToString: (self: TimeZone) => string = Internal.zoneToString
|
|
991
1198
|
|
|
@@ -993,9 +1200,8 @@ export const zoneToString: (self: TimeZone) => string = Internal.zoneToString
|
|
|
993
1200
|
* Set the time zone of a `DateTime` from an IANA time zone identifier. If the
|
|
994
1201
|
* time zone is invalid, `None` will be returned.
|
|
995
1202
|
*
|
|
996
|
-
*
|
|
997
|
-
*
|
|
998
|
-
* @example
|
|
1203
|
+
* **Example** (Setting named time zones safely)
|
|
1204
|
+
*
|
|
999
1205
|
* ```ts
|
|
1000
1206
|
* import { DateTime, Effect } from "effect"
|
|
1001
1207
|
*
|
|
@@ -1005,15 +1211,17 @@ export const zoneToString: (self: TimeZone) => string = Internal.zoneToString
|
|
|
1005
1211
|
* DateTime.setZoneNamed(now, "Europe/London")
|
|
1006
1212
|
* })
|
|
1007
1213
|
* ```
|
|
1214
|
+
*
|
|
1215
|
+
* @category time zones
|
|
1216
|
+
* @since 3.6.0
|
|
1008
1217
|
*/
|
|
1009
1218
|
export const setZoneNamed: {
|
|
1010
1219
|
/**
|
|
1011
1220
|
* Set the time zone of a `DateTime` from an IANA time zone identifier. If the
|
|
1012
1221
|
* time zone is invalid, `None` will be returned.
|
|
1013
1222
|
*
|
|
1014
|
-
*
|
|
1015
|
-
*
|
|
1016
|
-
* @example
|
|
1223
|
+
* **Example** (Setting named time zones safely)
|
|
1224
|
+
*
|
|
1017
1225
|
* ```ts
|
|
1018
1226
|
* import { DateTime, Effect } from "effect"
|
|
1019
1227
|
*
|
|
@@ -1023,6 +1231,9 @@ export const setZoneNamed: {
|
|
|
1023
1231
|
* DateTime.setZoneNamed(now, "Europe/London")
|
|
1024
1232
|
* })
|
|
1025
1233
|
* ```
|
|
1234
|
+
*
|
|
1235
|
+
* @category time zones
|
|
1236
|
+
* @since 3.6.0
|
|
1026
1237
|
*/
|
|
1027
1238
|
(
|
|
1028
1239
|
zoneId: string,
|
|
@@ -1035,9 +1246,8 @@ export const setZoneNamed: {
|
|
|
1035
1246
|
* Set the time zone of a `DateTime` from an IANA time zone identifier. If the
|
|
1036
1247
|
* time zone is invalid, `None` will be returned.
|
|
1037
1248
|
*
|
|
1038
|
-
*
|
|
1039
|
-
*
|
|
1040
|
-
* @example
|
|
1249
|
+
* **Example** (Setting named time zones safely)
|
|
1250
|
+
*
|
|
1041
1251
|
* ```ts
|
|
1042
1252
|
* import { DateTime, Effect } from "effect"
|
|
1043
1253
|
*
|
|
@@ -1047,6 +1257,9 @@ export const setZoneNamed: {
|
|
|
1047
1257
|
* DateTime.setZoneNamed(now, "Europe/London")
|
|
1048
1258
|
* })
|
|
1049
1259
|
* ```
|
|
1260
|
+
*
|
|
1261
|
+
* @category time zones
|
|
1262
|
+
* @since 3.6.0
|
|
1050
1263
|
*/
|
|
1051
1264
|
(
|
|
1052
1265
|
self: DateTime,
|
|
@@ -1062,9 +1275,8 @@ export const setZoneNamed: {
|
|
|
1062
1275
|
* Set the time zone of a `DateTime` from an IANA time zone identifier. If the
|
|
1063
1276
|
* time zone is invalid, an `IllegalArgumentError` will be thrown.
|
|
1064
1277
|
*
|
|
1065
|
-
*
|
|
1066
|
-
*
|
|
1067
|
-
* @example
|
|
1278
|
+
* **Example** (Setting named time zones unsafely)
|
|
1279
|
+
*
|
|
1068
1280
|
* ```ts
|
|
1069
1281
|
* import { DateTime, Effect } from "effect"
|
|
1070
1282
|
*
|
|
@@ -1074,15 +1286,17 @@ export const setZoneNamed: {
|
|
|
1074
1286
|
* DateTime.setZoneNamedUnsafe(now, "Europe/London")
|
|
1075
1287
|
* })
|
|
1076
1288
|
* ```
|
|
1289
|
+
*
|
|
1290
|
+
* @category time zones
|
|
1291
|
+
* @since 3.6.0
|
|
1077
1292
|
*/
|
|
1078
1293
|
export const setZoneNamedUnsafe: {
|
|
1079
1294
|
/**
|
|
1080
1295
|
* Set the time zone of a `DateTime` from an IANA time zone identifier. If the
|
|
1081
1296
|
* time zone is invalid, an `IllegalArgumentError` will be thrown.
|
|
1082
1297
|
*
|
|
1083
|
-
*
|
|
1084
|
-
*
|
|
1085
|
-
* @example
|
|
1298
|
+
* **Example** (Setting named time zones unsafely)
|
|
1299
|
+
*
|
|
1086
1300
|
* ```ts
|
|
1087
1301
|
* import { DateTime, Effect } from "effect"
|
|
1088
1302
|
*
|
|
@@ -1092,6 +1306,9 @@ export const setZoneNamedUnsafe: {
|
|
|
1092
1306
|
* DateTime.setZoneNamedUnsafe(now, "Europe/London")
|
|
1093
1307
|
* })
|
|
1094
1308
|
* ```
|
|
1309
|
+
*
|
|
1310
|
+
* @category time zones
|
|
1311
|
+
* @since 3.6.0
|
|
1095
1312
|
*/
|
|
1096
1313
|
(
|
|
1097
1314
|
zoneId: string,
|
|
@@ -1104,9 +1321,8 @@ export const setZoneNamedUnsafe: {
|
|
|
1104
1321
|
* Set the time zone of a `DateTime` from an IANA time zone identifier. If the
|
|
1105
1322
|
* time zone is invalid, an `IllegalArgumentError` will be thrown.
|
|
1106
1323
|
*
|
|
1107
|
-
*
|
|
1108
|
-
*
|
|
1109
|
-
* @example
|
|
1324
|
+
* **Example** (Setting named time zones unsafely)
|
|
1325
|
+
*
|
|
1110
1326
|
* ```ts
|
|
1111
1327
|
* import { DateTime, Effect } from "effect"
|
|
1112
1328
|
*
|
|
@@ -1116,6 +1332,9 @@ export const setZoneNamedUnsafe: {
|
|
|
1116
1332
|
* DateTime.setZoneNamedUnsafe(now, "Europe/London")
|
|
1117
1333
|
* })
|
|
1118
1334
|
* ```
|
|
1335
|
+
*
|
|
1336
|
+
* @category time zones
|
|
1337
|
+
* @since 3.6.0
|
|
1119
1338
|
*/
|
|
1120
1339
|
(
|
|
1121
1340
|
self: DateTime,
|
|
@@ -1139,9 +1358,8 @@ export const setZoneNamedUnsafe: {
|
|
|
1139
1358
|
* `other` is *before* `self`, the result will be a negative `Duration`. If they
|
|
1140
1359
|
* are equal, the result will be a `Duration` of zero.
|
|
1141
1360
|
*
|
|
1142
|
-
*
|
|
1143
|
-
*
|
|
1144
|
-
* @example
|
|
1361
|
+
* **Example** (Measuring distance between DateTime values)
|
|
1362
|
+
*
|
|
1145
1363
|
* ```ts
|
|
1146
1364
|
* import { DateTime, Effect } from "effect"
|
|
1147
1365
|
*
|
|
@@ -1153,6 +1371,9 @@ export const setZoneNamedUnsafe: {
|
|
|
1153
1371
|
* DateTime.distance(now, other)
|
|
1154
1372
|
* })
|
|
1155
1373
|
* ```
|
|
1374
|
+
*
|
|
1375
|
+
* @category comparisons
|
|
1376
|
+
* @since 3.6.0
|
|
1156
1377
|
*/
|
|
1157
1378
|
export const distance: {
|
|
1158
1379
|
// =============================================================================
|
|
@@ -1167,9 +1388,8 @@ export const distance: {
|
|
|
1167
1388
|
* `other` is *before* `self`, the result will be a negative `Duration`. If they
|
|
1168
1389
|
* are equal, the result will be a `Duration` of zero.
|
|
1169
1390
|
*
|
|
1170
|
-
*
|
|
1171
|
-
*
|
|
1172
|
-
* @example
|
|
1391
|
+
* **Example** (Measuring distance between DateTime values)
|
|
1392
|
+
*
|
|
1173
1393
|
* ```ts
|
|
1174
1394
|
* import { DateTime, Effect } from "effect"
|
|
1175
1395
|
*
|
|
@@ -1181,6 +1401,9 @@ export const distance: {
|
|
|
1181
1401
|
* DateTime.distance(now, other)
|
|
1182
1402
|
* })
|
|
1183
1403
|
* ```
|
|
1404
|
+
*
|
|
1405
|
+
* @category comparisons
|
|
1406
|
+
* @since 3.6.0
|
|
1184
1407
|
*/
|
|
1185
1408
|
(other: DateTime): (self: DateTime) => Duration.Duration
|
|
1186
1409
|
// =============================================================================
|
|
@@ -1195,9 +1418,8 @@ export const distance: {
|
|
|
1195
1418
|
* `other` is *before* `self`, the result will be a negative `Duration`. If they
|
|
1196
1419
|
* are equal, the result will be a `Duration` of zero.
|
|
1197
1420
|
*
|
|
1198
|
-
*
|
|
1199
|
-
*
|
|
1200
|
-
* @example
|
|
1421
|
+
* **Example** (Measuring distance between DateTime values)
|
|
1422
|
+
*
|
|
1201
1423
|
* ```ts
|
|
1202
1424
|
* import { DateTime, Effect } from "effect"
|
|
1203
1425
|
*
|
|
@@ -1209,6 +1431,9 @@ export const distance: {
|
|
|
1209
1431
|
* DateTime.distance(now, other)
|
|
1210
1432
|
* })
|
|
1211
1433
|
* ```
|
|
1434
|
+
*
|
|
1435
|
+
* @category comparisons
|
|
1436
|
+
* @since 3.6.0
|
|
1212
1437
|
*/
|
|
1213
1438
|
(self: DateTime, other: DateTime): Duration.Duration
|
|
1214
1439
|
} = Internal.distance
|
|
@@ -1216,7 +1441,8 @@ export const distance: {
|
|
|
1216
1441
|
/**
|
|
1217
1442
|
* Returns the earlier of two `DateTime` values.
|
|
1218
1443
|
*
|
|
1219
|
-
*
|
|
1444
|
+
* **Example** (Selecting the earlier DateTime)
|
|
1445
|
+
*
|
|
1220
1446
|
* ```ts
|
|
1221
1447
|
* import { DateTime } from "effect"
|
|
1222
1448
|
*
|
|
@@ -1234,7 +1460,8 @@ export const min: {
|
|
|
1234
1460
|
/**
|
|
1235
1461
|
* Returns the earlier of two `DateTime` values.
|
|
1236
1462
|
*
|
|
1237
|
-
*
|
|
1463
|
+
* **Example** (Selecting the earlier DateTime)
|
|
1464
|
+
*
|
|
1238
1465
|
* ```ts
|
|
1239
1466
|
* import { DateTime } from "effect"
|
|
1240
1467
|
*
|
|
@@ -1252,7 +1479,8 @@ export const min: {
|
|
|
1252
1479
|
/**
|
|
1253
1480
|
* Returns the earlier of two `DateTime` values.
|
|
1254
1481
|
*
|
|
1255
|
-
*
|
|
1482
|
+
* **Example** (Selecting the earlier DateTime)
|
|
1483
|
+
*
|
|
1256
1484
|
* ```ts
|
|
1257
1485
|
* import { DateTime } from "effect"
|
|
1258
1486
|
*
|
|
@@ -1272,7 +1500,8 @@ export const min: {
|
|
|
1272
1500
|
/**
|
|
1273
1501
|
* Returns the later of two `DateTime` values.
|
|
1274
1502
|
*
|
|
1275
|
-
*
|
|
1503
|
+
* **Example** (Selecting the later DateTime)
|
|
1504
|
+
*
|
|
1276
1505
|
* ```ts
|
|
1277
1506
|
* import { DateTime } from "effect"
|
|
1278
1507
|
*
|
|
@@ -1290,7 +1519,8 @@ export const max: {
|
|
|
1290
1519
|
/**
|
|
1291
1520
|
* Returns the later of two `DateTime` values.
|
|
1292
1521
|
*
|
|
1293
|
-
*
|
|
1522
|
+
* **Example** (Selecting the later DateTime)
|
|
1523
|
+
*
|
|
1294
1524
|
* ```ts
|
|
1295
1525
|
* import { DateTime } from "effect"
|
|
1296
1526
|
*
|
|
@@ -1308,7 +1538,8 @@ export const max: {
|
|
|
1308
1538
|
/**
|
|
1309
1539
|
* Returns the later of two `DateTime` values.
|
|
1310
1540
|
*
|
|
1311
|
-
*
|
|
1541
|
+
* **Example** (Selecting the later DateTime)
|
|
1542
|
+
*
|
|
1312
1543
|
* ```ts
|
|
1313
1544
|
* import { DateTime } from "effect"
|
|
1314
1545
|
*
|
|
@@ -1328,7 +1559,8 @@ export const max: {
|
|
|
1328
1559
|
/**
|
|
1329
1560
|
* Checks if the first `DateTime` is after the second `DateTime`.
|
|
1330
1561
|
*
|
|
1331
|
-
*
|
|
1562
|
+
* **Example** (Checking whether a DateTime is later)
|
|
1563
|
+
*
|
|
1332
1564
|
* ```ts
|
|
1333
1565
|
* import { DateTime } from "effect"
|
|
1334
1566
|
*
|
|
@@ -1346,7 +1578,8 @@ export const isGreaterThan: {
|
|
|
1346
1578
|
/**
|
|
1347
1579
|
* Checks if the first `DateTime` is after the second `DateTime`.
|
|
1348
1580
|
*
|
|
1349
|
-
*
|
|
1581
|
+
* **Example** (Checking whether a DateTime is later)
|
|
1582
|
+
*
|
|
1350
1583
|
* ```ts
|
|
1351
1584
|
* import { DateTime } from "effect"
|
|
1352
1585
|
*
|
|
@@ -1364,7 +1597,8 @@ export const isGreaterThan: {
|
|
|
1364
1597
|
/**
|
|
1365
1598
|
* Checks if the first `DateTime` is after the second `DateTime`.
|
|
1366
1599
|
*
|
|
1367
|
-
*
|
|
1600
|
+
* **Example** (Checking whether a DateTime is later)
|
|
1601
|
+
*
|
|
1368
1602
|
* ```ts
|
|
1369
1603
|
* import { DateTime } from "effect"
|
|
1370
1604
|
*
|
|
@@ -1384,7 +1618,8 @@ export const isGreaterThan: {
|
|
|
1384
1618
|
/**
|
|
1385
1619
|
* Checks if the first `DateTime` is after or equal to the second `DateTime`.
|
|
1386
1620
|
*
|
|
1387
|
-
*
|
|
1621
|
+
* **Example** (Checking whether a DateTime is later or equal)
|
|
1622
|
+
*
|
|
1388
1623
|
* ```ts
|
|
1389
1624
|
* import { DateTime } from "effect"
|
|
1390
1625
|
*
|
|
@@ -1404,7 +1639,8 @@ export const isGreaterThanOrEqualTo: {
|
|
|
1404
1639
|
/**
|
|
1405
1640
|
* Checks if the first `DateTime` is after or equal to the second `DateTime`.
|
|
1406
1641
|
*
|
|
1407
|
-
*
|
|
1642
|
+
* **Example** (Checking whether a DateTime is later or equal)
|
|
1643
|
+
*
|
|
1408
1644
|
* ```ts
|
|
1409
1645
|
* import { DateTime } from "effect"
|
|
1410
1646
|
*
|
|
@@ -1424,7 +1660,8 @@ export const isGreaterThanOrEqualTo: {
|
|
|
1424
1660
|
/**
|
|
1425
1661
|
* Checks if the first `DateTime` is after or equal to the second `DateTime`.
|
|
1426
1662
|
*
|
|
1427
|
-
*
|
|
1663
|
+
* **Example** (Checking whether a DateTime is later or equal)
|
|
1664
|
+
*
|
|
1428
1665
|
* ```ts
|
|
1429
1666
|
* import { DateTime } from "effect"
|
|
1430
1667
|
*
|
|
@@ -1446,7 +1683,8 @@ export const isGreaterThanOrEqualTo: {
|
|
|
1446
1683
|
/**
|
|
1447
1684
|
* Checks if the first `DateTime` is before the second `DateTime`.
|
|
1448
1685
|
*
|
|
1449
|
-
*
|
|
1686
|
+
* **Example** (Checking whether a DateTime is earlier)
|
|
1687
|
+
*
|
|
1450
1688
|
* ```ts
|
|
1451
1689
|
* import { DateTime } from "effect"
|
|
1452
1690
|
*
|
|
@@ -1464,7 +1702,8 @@ export const isLessThan: {
|
|
|
1464
1702
|
/**
|
|
1465
1703
|
* Checks if the first `DateTime` is before the second `DateTime`.
|
|
1466
1704
|
*
|
|
1467
|
-
*
|
|
1705
|
+
* **Example** (Checking whether a DateTime is earlier)
|
|
1706
|
+
*
|
|
1468
1707
|
* ```ts
|
|
1469
1708
|
* import { DateTime } from "effect"
|
|
1470
1709
|
*
|
|
@@ -1482,7 +1721,8 @@ export const isLessThan: {
|
|
|
1482
1721
|
/**
|
|
1483
1722
|
* Checks if the first `DateTime` is before the second `DateTime`.
|
|
1484
1723
|
*
|
|
1485
|
-
*
|
|
1724
|
+
* **Example** (Checking whether a DateTime is earlier)
|
|
1725
|
+
*
|
|
1486
1726
|
* ```ts
|
|
1487
1727
|
* import { DateTime } from "effect"
|
|
1488
1728
|
*
|
|
@@ -1502,7 +1742,8 @@ export const isLessThan: {
|
|
|
1502
1742
|
/**
|
|
1503
1743
|
* Checks if the first `DateTime` is before or equal to the second `DateTime`.
|
|
1504
1744
|
*
|
|
1505
|
-
*
|
|
1745
|
+
* **Example** (Checking whether a DateTime is earlier or equal)
|
|
1746
|
+
*
|
|
1506
1747
|
* ```ts
|
|
1507
1748
|
* import { DateTime } from "effect"
|
|
1508
1749
|
*
|
|
@@ -1522,7 +1763,8 @@ export const isLessThanOrEqualTo: {
|
|
|
1522
1763
|
/**
|
|
1523
1764
|
* Checks if the first `DateTime` is before or equal to the second `DateTime`.
|
|
1524
1765
|
*
|
|
1525
|
-
*
|
|
1766
|
+
* **Example** (Checking whether a DateTime is earlier or equal)
|
|
1767
|
+
*
|
|
1526
1768
|
* ```ts
|
|
1527
1769
|
* import { DateTime } from "effect"
|
|
1528
1770
|
*
|
|
@@ -1542,7 +1784,8 @@ export const isLessThanOrEqualTo: {
|
|
|
1542
1784
|
/**
|
|
1543
1785
|
* Checks if the first `DateTime` is before or equal to the second `DateTime`.
|
|
1544
1786
|
*
|
|
1545
|
-
*
|
|
1787
|
+
* **Example** (Checking whether a DateTime is earlier or equal)
|
|
1788
|
+
*
|
|
1546
1789
|
* ```ts
|
|
1547
1790
|
* import { DateTime } from "effect"
|
|
1548
1791
|
*
|
|
@@ -1564,7 +1807,8 @@ export const isLessThanOrEqualTo: {
|
|
|
1564
1807
|
/**
|
|
1565
1808
|
* Checks if a `DateTime` is between two other `DateTime` values (inclusive).
|
|
1566
1809
|
*
|
|
1567
|
-
*
|
|
1810
|
+
* **Example** (Checking whether a DateTime is within bounds)
|
|
1811
|
+
*
|
|
1568
1812
|
* ```ts
|
|
1569
1813
|
* import { DateTime } from "effect"
|
|
1570
1814
|
*
|
|
@@ -1582,7 +1826,8 @@ export const between: {
|
|
|
1582
1826
|
/**
|
|
1583
1827
|
* Checks if a `DateTime` is between two other `DateTime` values (inclusive).
|
|
1584
1828
|
*
|
|
1585
|
-
*
|
|
1829
|
+
* **Example** (Checking whether a DateTime is within bounds)
|
|
1830
|
+
*
|
|
1586
1831
|
* ```ts
|
|
1587
1832
|
* import { DateTime } from "effect"
|
|
1588
1833
|
*
|
|
@@ -1600,7 +1845,8 @@ export const between: {
|
|
|
1600
1845
|
/**
|
|
1601
1846
|
* Checks if a `DateTime` is between two other `DateTime` values (inclusive).
|
|
1602
1847
|
*
|
|
1603
|
-
*
|
|
1848
|
+
* **Example** (Checking whether a DateTime is within bounds)
|
|
1849
|
+
*
|
|
1604
1850
|
* ```ts
|
|
1605
1851
|
* import { DateTime } from "effect"
|
|
1606
1852
|
*
|
|
@@ -1622,7 +1868,8 @@ export const between: {
|
|
|
1622
1868
|
*
|
|
1623
1869
|
* This is an effectful operation that uses the current time from the `Clock` service.
|
|
1624
1870
|
*
|
|
1625
|
-
*
|
|
1871
|
+
* **Example** (Checking future DateTime values effectfully)
|
|
1872
|
+
*
|
|
1626
1873
|
* ```ts
|
|
1627
1874
|
* import { DateTime, Effect } from "effect"
|
|
1628
1875
|
*
|
|
@@ -1643,7 +1890,8 @@ export const isFuture: (self: DateTime) => Effect.Effect<boolean> = Internal.isF
|
|
|
1643
1890
|
*
|
|
1644
1891
|
* This is a synchronous version that uses `Date.now()` directly.
|
|
1645
1892
|
*
|
|
1646
|
-
*
|
|
1893
|
+
* **Example** (Checking future DateTime values unsafely)
|
|
1894
|
+
*
|
|
1647
1895
|
* ```ts
|
|
1648
1896
|
* import { DateTime } from "effect"
|
|
1649
1897
|
*
|
|
@@ -1664,7 +1912,8 @@ export const isFutureUnsafe: (self: DateTime) => boolean = Internal.isFutureUnsa
|
|
|
1664
1912
|
*
|
|
1665
1913
|
* This is an effectful operation that uses the current time from the `Clock` service.
|
|
1666
1914
|
*
|
|
1667
|
-
*
|
|
1915
|
+
* **Example** (Checking past DateTime values effectfully)
|
|
1916
|
+
*
|
|
1668
1917
|
* ```ts
|
|
1669
1918
|
* import { DateTime, Effect } from "effect"
|
|
1670
1919
|
*
|
|
@@ -1685,7 +1934,8 @@ export const isPast: (self: DateTime) => Effect.Effect<boolean> = Internal.isPas
|
|
|
1685
1934
|
*
|
|
1686
1935
|
* This is a synchronous version that uses `Date.now()` directly.
|
|
1687
1936
|
*
|
|
1688
|
-
*
|
|
1937
|
+
* **Example** (Checking past DateTime values unsafely)
|
|
1938
|
+
*
|
|
1689
1939
|
* ```ts
|
|
1690
1940
|
* import { DateTime } from "effect"
|
|
1691
1941
|
*
|
|
@@ -1710,7 +1960,8 @@ export const isPastUnsafe: (self: DateTime) => boolean = Internal.isPastUnsafe
|
|
|
1710
1960
|
*
|
|
1711
1961
|
* This always returns the UTC representation, ignoring any time zone information.
|
|
1712
1962
|
*
|
|
1713
|
-
*
|
|
1963
|
+
* **Example** (Converting DateTime values to UTC Dates)
|
|
1964
|
+
*
|
|
1714
1965
|
* ```ts
|
|
1715
1966
|
* import { DateTime } from "effect"
|
|
1716
1967
|
*
|
|
@@ -1733,7 +1984,8 @@ export const toDateUtc: (self: DateTime) => Date = Internal.toDateUtc
|
|
|
1733
1984
|
* For `DateTime.Zoned`, this adjusts for the time zone before converting.
|
|
1734
1985
|
* For `DateTime.Utc`, this is equivalent to `toDateUtc`.
|
|
1735
1986
|
*
|
|
1736
|
-
*
|
|
1987
|
+
* **Example** (Converting DateTime values to Dates)
|
|
1988
|
+
*
|
|
1737
1989
|
* ```ts
|
|
1738
1990
|
* import { DateTime } from "effect"
|
|
1739
1991
|
*
|
|
@@ -1757,7 +2009,8 @@ export const toDate: (self: DateTime) => Date = Internal.toDate
|
|
|
1757
2009
|
* Returns the offset from UTC in milliseconds. Positive values indicate
|
|
1758
2010
|
* time zones ahead of UTC, negative values indicate time zones behind UTC.
|
|
1759
2011
|
*
|
|
1760
|
-
*
|
|
2012
|
+
* **Example** (Reading zoned offsets)
|
|
2013
|
+
*
|
|
1761
2014
|
* ```ts
|
|
1762
2015
|
* import { DateTime } from "effect"
|
|
1763
2016
|
*
|
|
@@ -1779,7 +2032,8 @@ export const zonedOffset: (self: Zoned) => number = Internal.zonedOffset
|
|
|
1779
2032
|
*
|
|
1780
2033
|
* The offset is formatted as "±HH:MM".
|
|
1781
2034
|
*
|
|
1782
|
-
*
|
|
2035
|
+
* **Example** (Formatting zoned offsets)
|
|
2036
|
+
*
|
|
1783
2037
|
* ```ts
|
|
1784
2038
|
* import { DateTime } from "effect"
|
|
1785
2039
|
*
|
|
@@ -1801,7 +2055,8 @@ export const zonedOffsetIso: (self: Zoned) => string = Internal.zonedOffsetIso
|
|
|
1801
2055
|
*
|
|
1802
2056
|
* This returns the UTC timestamp regardless of any time zone information.
|
|
1803
2057
|
*
|
|
1804
|
-
*
|
|
2058
|
+
* **Example** (Reading epoch milliseconds)
|
|
2059
|
+
*
|
|
1805
2060
|
* ```ts
|
|
1806
2061
|
* import { DateTime } from "effect"
|
|
1807
2062
|
*
|
|
@@ -1809,7 +2064,6 @@ export const zonedOffsetIso: (self: Zoned) => string = Internal.zonedOffsetIso
|
|
|
1809
2064
|
* const epochMillis = DateTime.toEpochMillis(dt)
|
|
1810
2065
|
*
|
|
1811
2066
|
* console.log(epochMillis) // 1704067200000
|
|
1812
|
-
* console.log(new Date(epochMillis).toISOString()) // "2024-01-01T00:00:00.000Z"
|
|
1813
2067
|
* ```
|
|
1814
2068
|
*
|
|
1815
2069
|
* @category conversions
|
|
@@ -1821,9 +2075,8 @@ export const toEpochMillis: (self: DateTime) => number = Internal.toEpochMillis
|
|
|
1821
2075
|
* Remove the time aspect of a `DateTime`, first adjusting for the time
|
|
1822
2076
|
* zone. It will return a `DateTime.Utc` only containing the date.
|
|
1823
2077
|
*
|
|
1824
|
-
*
|
|
1825
|
-
*
|
|
1826
|
-
* @example
|
|
2078
|
+
* **Example** (Removing time components)
|
|
2079
|
+
*
|
|
1827
2080
|
* ```ts
|
|
1828
2081
|
* import { DateTime } from "effect"
|
|
1829
2082
|
*
|
|
@@ -1836,6 +2089,9 @@ export const toEpochMillis: (self: DateTime) => number = Internal.toEpochMillis
|
|
|
1836
2089
|
* DateTime.formatIso
|
|
1837
2090
|
* )
|
|
1838
2091
|
* ```
|
|
2092
|
+
*
|
|
2093
|
+
* @category conversions
|
|
2094
|
+
* @since 3.6.0
|
|
1839
2095
|
*/
|
|
1840
2096
|
export const removeTime: (self: DateTime) => Utc = Internal.removeTime
|
|
1841
2097
|
|
|
@@ -1848,7 +2104,8 @@ export const removeTime: (self: DateTime) => Utc = Internal.removeTime
|
|
|
1848
2104
|
*
|
|
1849
2105
|
* The parts will be time zone adjusted if the `DateTime` is zoned.
|
|
1850
2106
|
*
|
|
1851
|
-
*
|
|
2107
|
+
* **Example** (Reading DateTime parts)
|
|
2108
|
+
*
|
|
1852
2109
|
* ```ts
|
|
1853
2110
|
* import { DateTime } from "effect"
|
|
1854
2111
|
*
|
|
@@ -1878,7 +2135,8 @@ export const toParts: (self: DateTime) => DateTime.PartsWithWeekday = Internal.t
|
|
|
1878
2135
|
*
|
|
1879
2136
|
* The parts will always be in UTC, ignoring any time zone information.
|
|
1880
2137
|
*
|
|
1881
|
-
*
|
|
2138
|
+
* **Example** (Reading UTC DateTime parts)
|
|
2139
|
+
*
|
|
1882
2140
|
* ```ts
|
|
1883
2141
|
* import { DateTime } from "effect"
|
|
1884
2142
|
*
|
|
@@ -1901,17 +2159,18 @@ export const toPartsUtc: (self: DateTime) => DateTime.PartsWithWeekday = Interna
|
|
|
1901
2159
|
*
|
|
1902
2160
|
* The part will be in the UTC time zone.
|
|
1903
2161
|
*
|
|
1904
|
-
*
|
|
1905
|
-
*
|
|
1906
|
-
* @example
|
|
2162
|
+
* **Example** (Reading UTC DateTime parts by key)
|
|
2163
|
+
*
|
|
1907
2164
|
* ```ts
|
|
1908
2165
|
* import { DateTime } from "effect"
|
|
1909
|
-
* import * as assert from "node:assert"
|
|
1910
2166
|
*
|
|
1911
|
-
* const
|
|
1912
|
-
* const year = DateTime.getPartUtc(
|
|
1913
|
-
*
|
|
2167
|
+
* const dateTime = DateTime.makeUnsafe({ year: 2024 })
|
|
2168
|
+
* const year = DateTime.getPartUtc(dateTime, "year")
|
|
2169
|
+
* console.log(year) // 2024
|
|
1914
2170
|
* ```
|
|
2171
|
+
*
|
|
2172
|
+
* @category parts
|
|
2173
|
+
* @since 3.6.0
|
|
1915
2174
|
*/
|
|
1916
2175
|
export const getPartUtc: {
|
|
1917
2176
|
/**
|
|
@@ -1919,17 +2178,18 @@ export const getPartUtc: {
|
|
|
1919
2178
|
*
|
|
1920
2179
|
* The part will be in the UTC time zone.
|
|
1921
2180
|
*
|
|
1922
|
-
*
|
|
1923
|
-
*
|
|
1924
|
-
* @example
|
|
2181
|
+
* **Example** (Reading UTC DateTime parts by key)
|
|
2182
|
+
*
|
|
1925
2183
|
* ```ts
|
|
1926
2184
|
* import { DateTime } from "effect"
|
|
1927
|
-
* import * as assert from "node:assert"
|
|
1928
2185
|
*
|
|
1929
|
-
* const
|
|
1930
|
-
* const year = DateTime.getPartUtc(
|
|
1931
|
-
*
|
|
2186
|
+
* const dateTime = DateTime.makeUnsafe({ year: 2024 })
|
|
2187
|
+
* const year = DateTime.getPartUtc(dateTime, "year")
|
|
2188
|
+
* console.log(year) // 2024
|
|
1932
2189
|
* ```
|
|
2190
|
+
*
|
|
2191
|
+
* @category parts
|
|
2192
|
+
* @since 3.6.0
|
|
1933
2193
|
*/
|
|
1934
2194
|
(part: keyof DateTime.PartsWithWeekday): (self: DateTime) => number
|
|
1935
2195
|
/**
|
|
@@ -1937,17 +2197,18 @@ export const getPartUtc: {
|
|
|
1937
2197
|
*
|
|
1938
2198
|
* The part will be in the UTC time zone.
|
|
1939
2199
|
*
|
|
1940
|
-
*
|
|
1941
|
-
*
|
|
1942
|
-
* @example
|
|
2200
|
+
* **Example** (Reading UTC DateTime parts by key)
|
|
2201
|
+
*
|
|
1943
2202
|
* ```ts
|
|
1944
2203
|
* import { DateTime } from "effect"
|
|
1945
|
-
* import * as assert from "node:assert"
|
|
1946
2204
|
*
|
|
1947
|
-
* const
|
|
1948
|
-
* const year = DateTime.getPartUtc(
|
|
1949
|
-
*
|
|
2205
|
+
* const dateTime = DateTime.makeUnsafe({ year: 2024 })
|
|
2206
|
+
* const year = DateTime.getPartUtc(dateTime, "year")
|
|
2207
|
+
* console.log(year) // 2024
|
|
1950
2208
|
* ```
|
|
2209
|
+
*
|
|
2210
|
+
* @category parts
|
|
2211
|
+
* @since 3.6.0
|
|
1951
2212
|
*/
|
|
1952
2213
|
(self: DateTime, part: keyof DateTime.PartsWithWeekday): number
|
|
1953
2214
|
} = Internal.getPartUtc
|
|
@@ -1957,19 +2218,20 @@ export const getPartUtc: {
|
|
|
1957
2218
|
*
|
|
1958
2219
|
* The part will be time zone adjusted.
|
|
1959
2220
|
*
|
|
1960
|
-
*
|
|
1961
|
-
*
|
|
1962
|
-
* @example
|
|
2221
|
+
* **Example** (Reading DateTime parts by key)
|
|
2222
|
+
*
|
|
1963
2223
|
* ```ts
|
|
1964
2224
|
* import { DateTime } from "effect"
|
|
1965
|
-
* import * as assert from "node:assert"
|
|
1966
2225
|
*
|
|
1967
|
-
* const
|
|
2226
|
+
* const dateTime = DateTime.makeZonedUnsafe({ year: 2024 }, {
|
|
1968
2227
|
* timeZone: "Europe/London"
|
|
1969
2228
|
* })
|
|
1970
|
-
* const year = DateTime.getPart(
|
|
1971
|
-
*
|
|
2229
|
+
* const year = DateTime.getPart(dateTime, "year")
|
|
2230
|
+
* console.log(year) // 2024
|
|
1972
2231
|
* ```
|
|
2232
|
+
*
|
|
2233
|
+
* @category parts
|
|
2234
|
+
* @since 3.6.0
|
|
1973
2235
|
*/
|
|
1974
2236
|
export const getPart: {
|
|
1975
2237
|
/**
|
|
@@ -1977,19 +2239,20 @@ export const getPart: {
|
|
|
1977
2239
|
*
|
|
1978
2240
|
* The part will be time zone adjusted.
|
|
1979
2241
|
*
|
|
1980
|
-
*
|
|
1981
|
-
*
|
|
1982
|
-
* @example
|
|
2242
|
+
* **Example** (Reading DateTime parts by key)
|
|
2243
|
+
*
|
|
1983
2244
|
* ```ts
|
|
1984
2245
|
* import { DateTime } from "effect"
|
|
1985
|
-
* import * as assert from "node:assert"
|
|
1986
2246
|
*
|
|
1987
|
-
* const
|
|
2247
|
+
* const dateTime = DateTime.makeZonedUnsafe({ year: 2024 }, {
|
|
1988
2248
|
* timeZone: "Europe/London"
|
|
1989
2249
|
* })
|
|
1990
|
-
* const year = DateTime.getPart(
|
|
1991
|
-
*
|
|
2250
|
+
* const year = DateTime.getPart(dateTime, "year")
|
|
2251
|
+
* console.log(year) // 2024
|
|
1992
2252
|
* ```
|
|
2253
|
+
*
|
|
2254
|
+
* @category parts
|
|
2255
|
+
* @since 3.6.0
|
|
1993
2256
|
*/
|
|
1994
2257
|
(part: keyof DateTime.PartsWithWeekday): (self: DateTime) => number
|
|
1995
2258
|
/**
|
|
@@ -1997,19 +2260,20 @@ export const getPart: {
|
|
|
1997
2260
|
*
|
|
1998
2261
|
* The part will be time zone adjusted.
|
|
1999
2262
|
*
|
|
2000
|
-
*
|
|
2001
|
-
*
|
|
2002
|
-
* @example
|
|
2263
|
+
* **Example** (Reading DateTime parts by key)
|
|
2264
|
+
*
|
|
2003
2265
|
* ```ts
|
|
2004
2266
|
* import { DateTime } from "effect"
|
|
2005
|
-
* import * as assert from "node:assert"
|
|
2006
2267
|
*
|
|
2007
|
-
* const
|
|
2268
|
+
* const dateTime = DateTime.makeZonedUnsafe({ year: 2024 }, {
|
|
2008
2269
|
* timeZone: "Europe/London"
|
|
2009
2270
|
* })
|
|
2010
|
-
* const year = DateTime.getPart(
|
|
2011
|
-
*
|
|
2271
|
+
* const year = DateTime.getPart(dateTime, "year")
|
|
2272
|
+
* console.log(year) // 2024
|
|
2012
2273
|
* ```
|
|
2274
|
+
*
|
|
2275
|
+
* @category parts
|
|
2276
|
+
* @since 3.6.0
|
|
2013
2277
|
*/
|
|
2014
2278
|
(self: DateTime, part: keyof DateTime.PartsWithWeekday): number
|
|
2015
2279
|
} = Internal.getPart
|
|
@@ -2019,7 +2283,8 @@ export const getPart: {
|
|
|
2019
2283
|
*
|
|
2020
2284
|
* The date will be time zone adjusted for `DateTime.Zoned`.
|
|
2021
2285
|
*
|
|
2022
|
-
*
|
|
2286
|
+
* **Example** (Updating DateTime parts)
|
|
2287
|
+
*
|
|
2023
2288
|
* ```ts
|
|
2024
2289
|
* import { DateTime } from "effect"
|
|
2025
2290
|
*
|
|
@@ -2042,7 +2307,8 @@ export const setParts: {
|
|
|
2042
2307
|
*
|
|
2043
2308
|
* The date will be time zone adjusted for `DateTime.Zoned`.
|
|
2044
2309
|
*
|
|
2045
|
-
*
|
|
2310
|
+
* **Example** (Updating DateTime parts)
|
|
2311
|
+
*
|
|
2046
2312
|
* ```ts
|
|
2047
2313
|
* import { DateTime } from "effect"
|
|
2048
2314
|
*
|
|
@@ -2065,7 +2331,8 @@ export const setParts: {
|
|
|
2065
2331
|
*
|
|
2066
2332
|
* The date will be time zone adjusted for `DateTime.Zoned`.
|
|
2067
2333
|
*
|
|
2068
|
-
*
|
|
2334
|
+
* **Example** (Updating DateTime parts)
|
|
2335
|
+
*
|
|
2069
2336
|
* ```ts
|
|
2070
2337
|
* import { DateTime } from "effect"
|
|
2071
2338
|
*
|
|
@@ -2090,7 +2357,8 @@ export const setParts: {
|
|
|
2090
2357
|
*
|
|
2091
2358
|
* The parts are always interpreted as UTC, ignoring any time zone information.
|
|
2092
2359
|
*
|
|
2093
|
-
*
|
|
2360
|
+
* **Example** (Updating UTC DateTime parts)
|
|
2361
|
+
*
|
|
2094
2362
|
* ```ts
|
|
2095
2363
|
* import { DateTime } from "effect"
|
|
2096
2364
|
*
|
|
@@ -2112,7 +2380,8 @@ export const setPartsUtc: {
|
|
|
2112
2380
|
*
|
|
2113
2381
|
* The parts are always interpreted as UTC, ignoring any time zone information.
|
|
2114
2382
|
*
|
|
2115
|
-
*
|
|
2383
|
+
* **Example** (Updating UTC DateTime parts)
|
|
2384
|
+
*
|
|
2116
2385
|
* ```ts
|
|
2117
2386
|
* import { DateTime } from "effect"
|
|
2118
2387
|
*
|
|
@@ -2134,7 +2403,8 @@ export const setPartsUtc: {
|
|
|
2134
2403
|
*
|
|
2135
2404
|
* The parts are always interpreted as UTC, ignoring any time zone information.
|
|
2136
2405
|
*
|
|
2137
|
-
*
|
|
2406
|
+
* **Example** (Updating UTC DateTime parts)
|
|
2407
|
+
*
|
|
2138
2408
|
* ```ts
|
|
2139
2409
|
* import { DateTime } from "effect"
|
|
2140
2410
|
*
|
|
@@ -2158,13 +2428,21 @@ export const setPartsUtc: {
|
|
|
2158
2428
|
// =============================================================================
|
|
2159
2429
|
|
|
2160
2430
|
/**
|
|
2161
|
-
*
|
|
2431
|
+
* Context service that supplies the ambient `TimeZone` for APIs that work in
|
|
2432
|
+
* the current zone, such as `DateTime.setZoneCurrent` and
|
|
2433
|
+
* `DateTime.nowInCurrentZone`.
|
|
2434
|
+
*
|
|
2435
|
+
* Provide it with `DateTime.withCurrentZone`, one of the `withCurrentZone*`
|
|
2436
|
+
* helpers, or one of the `layerCurrentZone*` layers.
|
|
2437
|
+
*
|
|
2438
|
+
* **Example** (Accessing the current time zone service)
|
|
2439
|
+
*
|
|
2162
2440
|
* ```ts
|
|
2163
2441
|
* import { DateTime, Effect } from "effect"
|
|
2164
2442
|
*
|
|
2165
2443
|
* const program = Effect.gen(function*() {
|
|
2166
2444
|
* // Access the current time zone service
|
|
2167
|
-
* const zone = yield* DateTime.CurrentTimeZone
|
|
2445
|
+
* const zone = yield* DateTime.CurrentTimeZone
|
|
2168
2446
|
* console.log(DateTime.zoneToString(zone))
|
|
2169
2447
|
* })
|
|
2170
2448
|
*
|
|
@@ -2173,8 +2451,8 @@ export const setPartsUtc: {
|
|
|
2173
2451
|
* Effect.provide(program, layer)
|
|
2174
2452
|
* ```
|
|
2175
2453
|
*
|
|
2176
|
-
* @since 3.11.0
|
|
2177
2454
|
* @category current time zone
|
|
2455
|
+
* @since 3.11.0
|
|
2178
2456
|
*/
|
|
2179
2457
|
export class CurrentTimeZone extends Context.Service<CurrentTimeZone, TimeZone>()(
|
|
2180
2458
|
"effect/DateTime/CurrentTimeZone"
|
|
@@ -2184,9 +2462,8 @@ export class CurrentTimeZone extends Context.Service<CurrentTimeZone, TimeZone>(
|
|
|
2184
2462
|
* Set the time zone of a `DateTime` to the current time zone, which is
|
|
2185
2463
|
* determined by the `CurrentTimeZone` service.
|
|
2186
2464
|
*
|
|
2187
|
-
*
|
|
2188
|
-
*
|
|
2189
|
-
* @example
|
|
2465
|
+
* **Example** (Setting the current time zone)
|
|
2466
|
+
*
|
|
2190
2467
|
* ```ts
|
|
2191
2468
|
* import { DateTime, Effect } from "effect"
|
|
2192
2469
|
*
|
|
@@ -2197,16 +2474,18 @@ export class CurrentTimeZone extends Context.Service<CurrentTimeZone, TimeZone>(
|
|
|
2197
2474
|
* const zoned = yield* DateTime.setZoneCurrent(now)
|
|
2198
2475
|
* }).pipe(DateTime.withCurrentZoneNamed("Europe/London"))
|
|
2199
2476
|
* ```
|
|
2477
|
+
*
|
|
2478
|
+
* @category current time zone
|
|
2479
|
+
* @since 3.6.0
|
|
2200
2480
|
*/
|
|
2201
2481
|
export const setZoneCurrent = (self: DateTime): Effect.Effect<Zoned, never, CurrentTimeZone> =>
|
|
2202
|
-
Effect.map(CurrentTimeZone
|
|
2482
|
+
Effect.map(CurrentTimeZone, (zone) => setZone(self, zone))
|
|
2203
2483
|
|
|
2204
2484
|
/**
|
|
2205
2485
|
* Provide the `CurrentTimeZone` to an effect.
|
|
2206
2486
|
*
|
|
2207
|
-
*
|
|
2208
|
-
*
|
|
2209
|
-
* @example
|
|
2487
|
+
* **Example** (Providing the current time zone)
|
|
2488
|
+
*
|
|
2210
2489
|
* ```ts
|
|
2211
2490
|
* import { DateTime, Effect } from "effect"
|
|
2212
2491
|
*
|
|
@@ -2216,14 +2495,16 @@ export const setZoneCurrent = (self: DateTime): Effect.Effect<Zoned, never, Curr
|
|
|
2216
2495
|
* const now = yield* DateTime.nowInCurrentZone
|
|
2217
2496
|
* }).pipe(DateTime.withCurrentZone(zone))
|
|
2218
2497
|
* ```
|
|
2498
|
+
*
|
|
2499
|
+
* @category current time zone
|
|
2500
|
+
* @since 3.6.0
|
|
2219
2501
|
*/
|
|
2220
2502
|
export const withCurrentZone: {
|
|
2221
2503
|
/**
|
|
2222
2504
|
* Provide the `CurrentTimeZone` to an effect.
|
|
2223
2505
|
*
|
|
2224
|
-
*
|
|
2225
|
-
*
|
|
2226
|
-
* @example
|
|
2506
|
+
* **Example** (Providing the current time zone)
|
|
2507
|
+
*
|
|
2227
2508
|
* ```ts
|
|
2228
2509
|
* import { DateTime, Effect } from "effect"
|
|
2229
2510
|
*
|
|
@@ -2233,14 +2514,16 @@ export const withCurrentZone: {
|
|
|
2233
2514
|
* const now = yield* DateTime.nowInCurrentZone
|
|
2234
2515
|
* }).pipe(DateTime.withCurrentZone(zone))
|
|
2235
2516
|
* ```
|
|
2517
|
+
*
|
|
2518
|
+
* @category current time zone
|
|
2519
|
+
* @since 3.6.0
|
|
2236
2520
|
*/
|
|
2237
2521
|
(value: TimeZone): <A, E, R>(self: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, CurrentTimeZone>>
|
|
2238
2522
|
/**
|
|
2239
2523
|
* Provide the `CurrentTimeZone` to an effect.
|
|
2240
2524
|
*
|
|
2241
|
-
*
|
|
2242
|
-
*
|
|
2243
|
-
* @example
|
|
2525
|
+
* **Example** (Providing the current time zone)
|
|
2526
|
+
*
|
|
2244
2527
|
* ```ts
|
|
2245
2528
|
* import { DateTime, Effect } from "effect"
|
|
2246
2529
|
*
|
|
@@ -2250,6 +2533,9 @@ export const withCurrentZone: {
|
|
|
2250
2533
|
* const now = yield* DateTime.nowInCurrentZone
|
|
2251
2534
|
* }).pipe(DateTime.withCurrentZone(zone))
|
|
2252
2535
|
* ```
|
|
2536
|
+
*
|
|
2537
|
+
* @category current time zone
|
|
2538
|
+
* @since 3.6.0
|
|
2253
2539
|
*/
|
|
2254
2540
|
<A, E, R>(self: Effect.Effect<A, E, R>, value: TimeZone): Effect.Effect<A, E, Exclude<R, CurrentTimeZone>>
|
|
2255
2541
|
} = provideService(CurrentTimeZone)
|
|
@@ -2258,9 +2544,8 @@ export const withCurrentZone: {
|
|
|
2258
2544
|
* Provide the `CurrentTimeZone` to an effect, using the system's local time
|
|
2259
2545
|
* zone.
|
|
2260
2546
|
*
|
|
2261
|
-
*
|
|
2262
|
-
*
|
|
2263
|
-
* @example
|
|
2547
|
+
* **Example** (Providing the local time zone)
|
|
2548
|
+
*
|
|
2264
2549
|
* ```ts
|
|
2265
2550
|
* import { DateTime, Effect } from "effect"
|
|
2266
2551
|
*
|
|
@@ -2269,6 +2554,9 @@ export const withCurrentZone: {
|
|
|
2269
2554
|
* const now = yield* DateTime.nowInCurrentZone
|
|
2270
2555
|
* }).pipe(DateTime.withCurrentZoneLocal)
|
|
2271
2556
|
* ```
|
|
2557
|
+
*
|
|
2558
|
+
* @category current time zone
|
|
2559
|
+
* @since 3.6.0
|
|
2272
2560
|
*/
|
|
2273
2561
|
export const withCurrentZoneLocal = <A, E, R>(
|
|
2274
2562
|
effect: Effect.Effect<A, E, R>
|
|
@@ -2278,33 +2566,37 @@ export const withCurrentZoneLocal = <A, E, R>(
|
|
|
2278
2566
|
/**
|
|
2279
2567
|
* Provide the `CurrentTimeZone` to an effect, using a offset.
|
|
2280
2568
|
*
|
|
2281
|
-
*
|
|
2282
|
-
*
|
|
2283
|
-
* @example
|
|
2569
|
+
* **Example** (Providing a fixed-offset time zone)
|
|
2570
|
+
*
|
|
2284
2571
|
* ```ts
|
|
2285
2572
|
* import { DateTime, Effect } from "effect"
|
|
2286
2573
|
*
|
|
2287
2574
|
* Effect.gen(function*() {
|
|
2288
|
-
*
|
|
2289
|
-
*
|
|
2575
|
+
* const zone = yield* DateTime.CurrentTimeZone
|
|
2576
|
+
* console.log(DateTime.zoneToString(zone)) // "+03:00"
|
|
2290
2577
|
* }).pipe(DateTime.withCurrentZoneOffset(3 * 60 * 60 * 1000))
|
|
2291
2578
|
* ```
|
|
2579
|
+
*
|
|
2580
|
+
* @category current time zone
|
|
2581
|
+
* @since 3.6.0
|
|
2292
2582
|
*/
|
|
2293
2583
|
export const withCurrentZoneOffset: {
|
|
2294
2584
|
/**
|
|
2295
2585
|
* Provide the `CurrentTimeZone` to an effect, using a offset.
|
|
2296
2586
|
*
|
|
2297
|
-
*
|
|
2298
|
-
*
|
|
2299
|
-
* @example
|
|
2587
|
+
* **Example** (Providing a fixed-offset time zone)
|
|
2588
|
+
*
|
|
2300
2589
|
* ```ts
|
|
2301
2590
|
* import { DateTime, Effect } from "effect"
|
|
2302
2591
|
*
|
|
2303
2592
|
* Effect.gen(function*() {
|
|
2304
|
-
*
|
|
2305
|
-
*
|
|
2593
|
+
* const zone = yield* DateTime.CurrentTimeZone
|
|
2594
|
+
* console.log(DateTime.zoneToString(zone)) // "+03:00"
|
|
2306
2595
|
* }).pipe(DateTime.withCurrentZoneOffset(3 * 60 * 60 * 1000))
|
|
2307
2596
|
* ```
|
|
2597
|
+
*
|
|
2598
|
+
* @category current time zone
|
|
2599
|
+
* @since 3.6.0
|
|
2308
2600
|
*/
|
|
2309
2601
|
(offset: number): <A, E, R>(
|
|
2310
2602
|
effect: Effect.Effect<A, E, R>
|
|
@@ -2312,17 +2604,19 @@ export const withCurrentZoneOffset: {
|
|
|
2312
2604
|
/**
|
|
2313
2605
|
* Provide the `CurrentTimeZone` to an effect, using a offset.
|
|
2314
2606
|
*
|
|
2315
|
-
*
|
|
2316
|
-
*
|
|
2317
|
-
* @example
|
|
2607
|
+
* **Example** (Providing a fixed-offset time zone)
|
|
2608
|
+
*
|
|
2318
2609
|
* ```ts
|
|
2319
2610
|
* import { DateTime, Effect } from "effect"
|
|
2320
2611
|
*
|
|
2321
2612
|
* Effect.gen(function*() {
|
|
2322
|
-
*
|
|
2323
|
-
*
|
|
2613
|
+
* const zone = yield* DateTime.CurrentTimeZone
|
|
2614
|
+
* console.log(DateTime.zoneToString(zone)) // "+03:00"
|
|
2324
2615
|
* }).pipe(DateTime.withCurrentZoneOffset(3 * 60 * 60 * 1000))
|
|
2325
2616
|
* ```
|
|
2617
|
+
*
|
|
2618
|
+
* @category current time zone
|
|
2619
|
+
* @since 3.6.0
|
|
2326
2620
|
*/
|
|
2327
2621
|
<A, E, R>(effect: Effect.Effect<A, E, R>, offset: number): Effect.Effect<A, E, Exclude<R, CurrentTimeZone>>
|
|
2328
2622
|
} = dual(
|
|
@@ -2337,9 +2631,8 @@ export const withCurrentZoneOffset: {
|
|
|
2337
2631
|
*
|
|
2338
2632
|
* If the time zone is invalid, it will fail with an `IllegalArgumentError`.
|
|
2339
2633
|
*
|
|
2340
|
-
*
|
|
2341
|
-
*
|
|
2342
|
-
* @example
|
|
2634
|
+
* **Example** (Providing a named time zone)
|
|
2635
|
+
*
|
|
2343
2636
|
* ```ts
|
|
2344
2637
|
* import { DateTime, Effect } from "effect"
|
|
2345
2638
|
*
|
|
@@ -2348,6 +2641,9 @@ export const withCurrentZoneOffset: {
|
|
|
2348
2641
|
* const now = yield* DateTime.nowInCurrentZone
|
|
2349
2642
|
* }).pipe(DateTime.withCurrentZoneNamed("Europe/London"))
|
|
2350
2643
|
* ```
|
|
2644
|
+
*
|
|
2645
|
+
* @category current time zone
|
|
2646
|
+
* @since 3.6.0
|
|
2351
2647
|
*/
|
|
2352
2648
|
export const withCurrentZoneNamed: {
|
|
2353
2649
|
/**
|
|
@@ -2356,9 +2652,8 @@ export const withCurrentZoneNamed: {
|
|
|
2356
2652
|
*
|
|
2357
2653
|
* If the time zone is invalid, it will fail with an `IllegalArgumentError`.
|
|
2358
2654
|
*
|
|
2359
|
-
*
|
|
2360
|
-
*
|
|
2361
|
-
* @example
|
|
2655
|
+
* **Example** (Providing a named time zone)
|
|
2656
|
+
*
|
|
2362
2657
|
* ```ts
|
|
2363
2658
|
* import { DateTime, Effect } from "effect"
|
|
2364
2659
|
*
|
|
@@ -2367,6 +2662,9 @@ export const withCurrentZoneNamed: {
|
|
|
2367
2662
|
* const now = yield* DateTime.nowInCurrentZone
|
|
2368
2663
|
* }).pipe(DateTime.withCurrentZoneNamed("Europe/London"))
|
|
2369
2664
|
* ```
|
|
2665
|
+
*
|
|
2666
|
+
* @category current time zone
|
|
2667
|
+
* @since 3.6.0
|
|
2370
2668
|
*/
|
|
2371
2669
|
(zone: string): <A, E, R>(
|
|
2372
2670
|
effect: Effect.Effect<A, E, R>
|
|
@@ -2377,9 +2675,8 @@ export const withCurrentZoneNamed: {
|
|
|
2377
2675
|
*
|
|
2378
2676
|
* If the time zone is invalid, it will fail with an `IllegalArgumentError`.
|
|
2379
2677
|
*
|
|
2380
|
-
*
|
|
2381
|
-
*
|
|
2382
|
-
* @example
|
|
2678
|
+
* **Example** (Providing a named time zone)
|
|
2679
|
+
*
|
|
2383
2680
|
* ```ts
|
|
2384
2681
|
* import { DateTime, Effect } from "effect"
|
|
2385
2682
|
*
|
|
@@ -2388,6 +2685,9 @@ export const withCurrentZoneNamed: {
|
|
|
2388
2685
|
* const now = yield* DateTime.nowInCurrentZone
|
|
2389
2686
|
* }).pipe(DateTime.withCurrentZoneNamed("Europe/London"))
|
|
2390
2687
|
* ```
|
|
2688
|
+
*
|
|
2689
|
+
* @category current time zone
|
|
2690
|
+
* @since 3.6.0
|
|
2391
2691
|
*/
|
|
2392
2692
|
<A, E, R>(effect: Effect.Effect<A, E, R>, zone: string): Effect.Effect<A, E | IllegalArgumentError, Exclude<R, CurrentTimeZone>>
|
|
2393
2693
|
} = dual(
|
|
@@ -2402,9 +2702,8 @@ export const withCurrentZoneNamed: {
|
|
|
2402
2702
|
/**
|
|
2403
2703
|
* Get the current time as a `DateTime.Zoned`, using the `CurrentTimeZone`.
|
|
2404
2704
|
*
|
|
2405
|
-
*
|
|
2406
|
-
*
|
|
2407
|
-
* @example
|
|
2705
|
+
* **Example** (Getting the current time in the current zone)
|
|
2706
|
+
*
|
|
2408
2707
|
* ```ts
|
|
2409
2708
|
* import { DateTime, Effect } from "effect"
|
|
2410
2709
|
*
|
|
@@ -2413,6 +2712,9 @@ export const withCurrentZoneNamed: {
|
|
|
2413
2712
|
* const now = yield* DateTime.nowInCurrentZone
|
|
2414
2713
|
* }).pipe(DateTime.withCurrentZoneNamed("Europe/London"))
|
|
2415
2714
|
* ```
|
|
2715
|
+
*
|
|
2716
|
+
* @category current time zone
|
|
2717
|
+
* @since 3.6.0
|
|
2416
2718
|
*/
|
|
2417
2719
|
export const nowInCurrentZone: Effect.Effect<Zoned, never, CurrentTimeZone> = Effect.flatMap(now, setZoneCurrent)
|
|
2418
2720
|
|
|
@@ -2428,7 +2730,8 @@ export const nowInCurrentZone: Effect.Effect<Zoned, never, CurrentTimeZone> = Ef
|
|
|
2428
2730
|
*
|
|
2429
2731
|
* Supports `disambiguation` when the new wall clock time is ambiguous.
|
|
2430
2732
|
*
|
|
2431
|
-
*
|
|
2733
|
+
* **Example** (Mutating DateTime values with Dates)
|
|
2734
|
+
*
|
|
2432
2735
|
* ```ts
|
|
2433
2736
|
* import { DateTime } from "effect"
|
|
2434
2737
|
*
|
|
@@ -2442,8 +2745,8 @@ export const nowInCurrentZone: Effect.Effect<Zoned, never, CurrentTimeZone> = Ef
|
|
|
2442
2745
|
* console.log(DateTime.formatIso(modified)) // "2024-01-01T15:30:00.000Z"
|
|
2443
2746
|
* ```
|
|
2444
2747
|
*
|
|
2445
|
-
* @since 3.6.0
|
|
2446
2748
|
* @category mapping
|
|
2749
|
+
* @since 3.6.0
|
|
2447
2750
|
*/
|
|
2448
2751
|
export const mutate: {
|
|
2449
2752
|
// =============================================================================
|
|
@@ -2458,7 +2761,8 @@ export const mutate: {
|
|
|
2458
2761
|
*
|
|
2459
2762
|
* Supports `disambiguation` when the new wall clock time is ambiguous.
|
|
2460
2763
|
*
|
|
2461
|
-
*
|
|
2764
|
+
* **Example** (Mutating DateTime values with Dates)
|
|
2765
|
+
*
|
|
2462
2766
|
* ```ts
|
|
2463
2767
|
* import { DateTime } from "effect"
|
|
2464
2768
|
*
|
|
@@ -2472,8 +2776,8 @@ export const mutate: {
|
|
|
2472
2776
|
* console.log(DateTime.formatIso(modified)) // "2024-01-01T15:30:00.000Z"
|
|
2473
2777
|
* ```
|
|
2474
2778
|
*
|
|
2475
|
-
* @since 3.6.0
|
|
2476
2779
|
* @category mapping
|
|
2780
|
+
* @since 3.6.0
|
|
2477
2781
|
*/
|
|
2478
2782
|
(
|
|
2479
2783
|
f: (date: Date) => void,
|
|
@@ -2493,7 +2797,8 @@ export const mutate: {
|
|
|
2493
2797
|
*
|
|
2494
2798
|
* Supports `disambiguation` when the new wall clock time is ambiguous.
|
|
2495
2799
|
*
|
|
2496
|
-
*
|
|
2800
|
+
* **Example** (Mutating DateTime values with Dates)
|
|
2801
|
+
*
|
|
2497
2802
|
* ```ts
|
|
2498
2803
|
* import { DateTime } from "effect"
|
|
2499
2804
|
*
|
|
@@ -2507,8 +2812,8 @@ export const mutate: {
|
|
|
2507
2812
|
* console.log(DateTime.formatIso(modified)) // "2024-01-01T15:30:00.000Z"
|
|
2508
2813
|
* ```
|
|
2509
2814
|
*
|
|
2510
|
-
* @since 3.6.0
|
|
2511
2815
|
* @category mapping
|
|
2816
|
+
* @since 3.6.0
|
|
2512
2817
|
*/
|
|
2513
2818
|
<A extends DateTime>(
|
|
2514
2819
|
self: A,
|
|
@@ -2522,7 +2827,8 @@ export const mutate: {
|
|
|
2522
2827
|
/**
|
|
2523
2828
|
* Modify a `DateTime` by applying a function to a cloned UTC `Date` instance.
|
|
2524
2829
|
*
|
|
2525
|
-
*
|
|
2830
|
+
* **Example** (Mutating DateTime values with UTC Dates)
|
|
2831
|
+
*
|
|
2526
2832
|
* ```ts
|
|
2527
2833
|
* import { DateTime } from "effect"
|
|
2528
2834
|
*
|
|
@@ -2537,14 +2843,15 @@ export const mutate: {
|
|
|
2537
2843
|
* console.log(DateTime.formatIso(modified)) // "2024-01-01T18:00:00.000Z"
|
|
2538
2844
|
* ```
|
|
2539
2845
|
*
|
|
2540
|
-
* @since 3.6.0
|
|
2541
2846
|
* @category mapping
|
|
2847
|
+
* @since 3.6.0
|
|
2542
2848
|
*/
|
|
2543
2849
|
export const mutateUtc: {
|
|
2544
2850
|
/**
|
|
2545
2851
|
* Modify a `DateTime` by applying a function to a cloned UTC `Date` instance.
|
|
2546
2852
|
*
|
|
2547
|
-
*
|
|
2853
|
+
* **Example** (Mutating DateTime values with UTC Dates)
|
|
2854
|
+
*
|
|
2548
2855
|
* ```ts
|
|
2549
2856
|
* import { DateTime } from "effect"
|
|
2550
2857
|
*
|
|
@@ -2559,14 +2866,15 @@ export const mutateUtc: {
|
|
|
2559
2866
|
* console.log(DateTime.formatIso(modified)) // "2024-01-01T18:00:00.000Z"
|
|
2560
2867
|
* ```
|
|
2561
2868
|
*
|
|
2562
|
-
* @since 3.6.0
|
|
2563
2869
|
* @category mapping
|
|
2870
|
+
* @since 3.6.0
|
|
2564
2871
|
*/
|
|
2565
2872
|
(f: (date: Date) => void): <A extends DateTime>(self: A) => A
|
|
2566
2873
|
/**
|
|
2567
2874
|
* Modify a `DateTime` by applying a function to a cloned UTC `Date` instance.
|
|
2568
2875
|
*
|
|
2569
|
-
*
|
|
2876
|
+
* **Example** (Mutating DateTime values with UTC Dates)
|
|
2877
|
+
*
|
|
2570
2878
|
* ```ts
|
|
2571
2879
|
* import { DateTime } from "effect"
|
|
2572
2880
|
*
|
|
@@ -2581,8 +2889,8 @@ export const mutateUtc: {
|
|
|
2581
2889
|
* console.log(DateTime.formatIso(modified)) // "2024-01-01T18:00:00.000Z"
|
|
2582
2890
|
* ```
|
|
2583
2891
|
*
|
|
2584
|
-
* @since 3.6.0
|
|
2585
2892
|
* @category mapping
|
|
2893
|
+
* @since 3.6.0
|
|
2586
2894
|
*/
|
|
2587
2895
|
<A extends DateTime>(self: A, f: (date: Date) => void): A
|
|
2588
2896
|
} = Internal.mutateUtc
|
|
@@ -2591,9 +2899,8 @@ export const mutateUtc: {
|
|
|
2591
2899
|
* Transform a `DateTime` by applying a function to the number of milliseconds
|
|
2592
2900
|
* since the Unix epoch.
|
|
2593
2901
|
*
|
|
2594
|
-
*
|
|
2595
|
-
*
|
|
2596
|
-
* @example
|
|
2902
|
+
* **Example** (Mapping epoch milliseconds)
|
|
2903
|
+
*
|
|
2597
2904
|
* ```ts
|
|
2598
2905
|
* import { DateTime } from "effect"
|
|
2599
2906
|
*
|
|
@@ -2602,15 +2909,17 @@ export const mutateUtc: {
|
|
|
2602
2909
|
* DateTime.mapEpochMillis((millis) => millis + 10)
|
|
2603
2910
|
* )
|
|
2604
2911
|
* ```
|
|
2912
|
+
*
|
|
2913
|
+
* @category mapping
|
|
2914
|
+
* @since 3.6.0
|
|
2605
2915
|
*/
|
|
2606
2916
|
export const mapEpochMillis: {
|
|
2607
2917
|
/**
|
|
2608
2918
|
* Transform a `DateTime` by applying a function to the number of milliseconds
|
|
2609
2919
|
* since the Unix epoch.
|
|
2610
2920
|
*
|
|
2611
|
-
*
|
|
2612
|
-
*
|
|
2613
|
-
* @example
|
|
2921
|
+
* **Example** (Mapping epoch milliseconds)
|
|
2922
|
+
*
|
|
2614
2923
|
* ```ts
|
|
2615
2924
|
* import { DateTime } from "effect"
|
|
2616
2925
|
*
|
|
@@ -2619,15 +2928,17 @@ export const mapEpochMillis: {
|
|
|
2619
2928
|
* DateTime.mapEpochMillis((millis) => millis + 10)
|
|
2620
2929
|
* )
|
|
2621
2930
|
* ```
|
|
2931
|
+
*
|
|
2932
|
+
* @category mapping
|
|
2933
|
+
* @since 3.6.0
|
|
2622
2934
|
*/
|
|
2623
2935
|
(f: (millis: number) => number): <A extends DateTime>(self: A) => A
|
|
2624
2936
|
/**
|
|
2625
2937
|
* Transform a `DateTime` by applying a function to the number of milliseconds
|
|
2626
2938
|
* since the Unix epoch.
|
|
2627
2939
|
*
|
|
2628
|
-
*
|
|
2629
|
-
*
|
|
2630
|
-
* @example
|
|
2940
|
+
* **Example** (Mapping epoch milliseconds)
|
|
2941
|
+
*
|
|
2631
2942
|
* ```ts
|
|
2632
2943
|
* import { DateTime } from "effect"
|
|
2633
2944
|
*
|
|
@@ -2636,17 +2947,22 @@ export const mapEpochMillis: {
|
|
|
2636
2947
|
* DateTime.mapEpochMillis((millis) => millis + 10)
|
|
2637
2948
|
* )
|
|
2638
2949
|
* ```
|
|
2950
|
+
*
|
|
2951
|
+
* @category mapping
|
|
2952
|
+
* @since 3.6.0
|
|
2639
2953
|
*/
|
|
2640
2954
|
<A extends DateTime>(self: A, f: (millis: number) => number): A
|
|
2641
2955
|
} = Internal.mapEpochMillis
|
|
2642
2956
|
|
|
2643
2957
|
/**
|
|
2644
|
-
*
|
|
2645
|
-
*
|
|
2958
|
+
* Applies a function to a JavaScript `Date` representing the `DateTime`'s UTC
|
|
2959
|
+
* instant and returns the function's result.
|
|
2960
|
+
*
|
|
2961
|
+
* This ignores any associated time zone. Use `DateTime.withDate` when the
|
|
2962
|
+
* callback should receive the time-zone-adjusted wall-clock date.
|
|
2963
|
+
*
|
|
2964
|
+
* **Example** (Using time zone adjusted Dates)
|
|
2646
2965
|
*
|
|
2647
|
-
* @since 3.6.0
|
|
2648
|
-
* @category mapping
|
|
2649
|
-
* @example
|
|
2650
2966
|
* ```ts
|
|
2651
2967
|
* import { DateTime } from "effect"
|
|
2652
2968
|
*
|
|
@@ -2655,15 +2971,20 @@ export const mapEpochMillis: {
|
|
|
2655
2971
|
* DateTime.withDate((date) => date.getTime())
|
|
2656
2972
|
* )
|
|
2657
2973
|
* ```
|
|
2974
|
+
*
|
|
2975
|
+
* @category mapping
|
|
2976
|
+
* @since 3.6.0
|
|
2658
2977
|
*/
|
|
2659
2978
|
export const withDate: {
|
|
2660
2979
|
/**
|
|
2661
|
-
*
|
|
2662
|
-
*
|
|
2980
|
+
* Applies a function to a JavaScript `Date` representing the `DateTime`'s UTC
|
|
2981
|
+
* instant and returns the function's result.
|
|
2982
|
+
*
|
|
2983
|
+
* This ignores any associated time zone. Use `DateTime.withDate` when the
|
|
2984
|
+
* callback should receive the time-zone-adjusted wall-clock date.
|
|
2985
|
+
*
|
|
2986
|
+
* **Example** (Using time zone adjusted Dates)
|
|
2663
2987
|
*
|
|
2664
|
-
* @since 3.6.0
|
|
2665
|
-
* @category mapping
|
|
2666
|
-
* @example
|
|
2667
2988
|
* ```ts
|
|
2668
2989
|
* import { DateTime } from "effect"
|
|
2669
2990
|
*
|
|
@@ -2672,15 +2993,20 @@ export const withDate: {
|
|
|
2672
2993
|
* DateTime.withDate((date) => date.getTime())
|
|
2673
2994
|
* )
|
|
2674
2995
|
* ```
|
|
2996
|
+
*
|
|
2997
|
+
* @category mapping
|
|
2998
|
+
* @since 3.6.0
|
|
2675
2999
|
*/
|
|
2676
3000
|
<A>(f: (date: Date) => A): (self: DateTime) => A
|
|
2677
3001
|
/**
|
|
2678
|
-
*
|
|
2679
|
-
*
|
|
3002
|
+
* Applies a function to a JavaScript `Date` representing the `DateTime`'s UTC
|
|
3003
|
+
* instant and returns the function's result.
|
|
3004
|
+
*
|
|
3005
|
+
* This ignores any associated time zone. Use `DateTime.withDate` when the
|
|
3006
|
+
* callback should receive the time-zone-adjusted wall-clock date.
|
|
3007
|
+
*
|
|
3008
|
+
* **Example** (Using time zone adjusted Dates)
|
|
2680
3009
|
*
|
|
2681
|
-
* @since 3.6.0
|
|
2682
|
-
* @category mapping
|
|
2683
|
-
* @example
|
|
2684
3010
|
* ```ts
|
|
2685
3011
|
* import { DateTime } from "effect"
|
|
2686
3012
|
*
|
|
@@ -2689,17 +3015,22 @@ export const withDate: {
|
|
|
2689
3015
|
* DateTime.withDate((date) => date.getTime())
|
|
2690
3016
|
* )
|
|
2691
3017
|
* ```
|
|
3018
|
+
*
|
|
3019
|
+
* @category mapping
|
|
3020
|
+
* @since 3.6.0
|
|
2692
3021
|
*/
|
|
2693
3022
|
<A>(self: DateTime, f: (date: Date) => A): A
|
|
2694
3023
|
} = Internal.withDate
|
|
2695
3024
|
|
|
2696
3025
|
/**
|
|
2697
|
-
*
|
|
2698
|
-
*
|
|
3026
|
+
* Applies a function to a JavaScript `Date` representing the `DateTime`'s UTC
|
|
3027
|
+
* instant and returns the function's result.
|
|
3028
|
+
*
|
|
3029
|
+
* This ignores any associated time zone. Use `DateTime.withDate` when the
|
|
3030
|
+
* callback should receive the time-zone-adjusted wall-clock date.
|
|
3031
|
+
*
|
|
3032
|
+
* **Example** (Using UTC Dates)
|
|
2699
3033
|
*
|
|
2700
|
-
* @since 3.6.0
|
|
2701
|
-
* @category mapping
|
|
2702
|
-
* @example
|
|
2703
3034
|
* ```ts
|
|
2704
3035
|
* import { DateTime } from "effect"
|
|
2705
3036
|
*
|
|
@@ -2708,15 +3039,20 @@ export const withDate: {
|
|
|
2708
3039
|
* DateTime.withDateUtc((date) => date.getTime())
|
|
2709
3040
|
* )
|
|
2710
3041
|
* ```
|
|
3042
|
+
*
|
|
3043
|
+
* @category mapping
|
|
3044
|
+
* @since 3.6.0
|
|
2711
3045
|
*/
|
|
2712
3046
|
export const withDateUtc: {
|
|
2713
3047
|
/**
|
|
2714
|
-
*
|
|
2715
|
-
*
|
|
3048
|
+
* Applies a function to a JavaScript `Date` representing the `DateTime`'s UTC
|
|
3049
|
+
* instant and returns the function's result.
|
|
3050
|
+
*
|
|
3051
|
+
* This ignores any associated time zone. Use `DateTime.withDate` when the
|
|
3052
|
+
* callback should receive the time-zone-adjusted wall-clock date.
|
|
3053
|
+
*
|
|
3054
|
+
* **Example** (Using UTC Dates)
|
|
2716
3055
|
*
|
|
2717
|
-
* @since 3.6.0
|
|
2718
|
-
* @category mapping
|
|
2719
|
-
* @example
|
|
2720
3056
|
* ```ts
|
|
2721
3057
|
* import { DateTime } from "effect"
|
|
2722
3058
|
*
|
|
@@ -2725,15 +3061,20 @@ export const withDateUtc: {
|
|
|
2725
3061
|
* DateTime.withDateUtc((date) => date.getTime())
|
|
2726
3062
|
* )
|
|
2727
3063
|
* ```
|
|
3064
|
+
*
|
|
3065
|
+
* @category mapping
|
|
3066
|
+
* @since 3.6.0
|
|
2728
3067
|
*/
|
|
2729
3068
|
<A>(f: (date: Date) => A): (self: DateTime) => A
|
|
2730
3069
|
/**
|
|
2731
|
-
*
|
|
2732
|
-
*
|
|
3070
|
+
* Applies a function to a JavaScript `Date` representing the `DateTime`'s UTC
|
|
3071
|
+
* instant and returns the function's result.
|
|
3072
|
+
*
|
|
3073
|
+
* This ignores any associated time zone. Use `DateTime.withDate` when the
|
|
3074
|
+
* callback should receive the time-zone-adjusted wall-clock date.
|
|
3075
|
+
*
|
|
3076
|
+
* **Example** (Using UTC Dates)
|
|
2733
3077
|
*
|
|
2734
|
-
* @since 3.6.0
|
|
2735
|
-
* @category mapping
|
|
2736
|
-
* @example
|
|
2737
3078
|
* ```ts
|
|
2738
3079
|
* import { DateTime } from "effect"
|
|
2739
3080
|
*
|
|
@@ -2742,6 +3083,9 @@ export const withDateUtc: {
|
|
|
2742
3083
|
* DateTime.withDateUtc((date) => date.getTime())
|
|
2743
3084
|
* )
|
|
2744
3085
|
* ```
|
|
3086
|
+
*
|
|
3087
|
+
* @category mapping
|
|
3088
|
+
* @since 3.6.0
|
|
2745
3089
|
*/
|
|
2746
3090
|
<A>(self: DateTime, f: (date: Date) => A): A
|
|
2747
3091
|
} = Internal.withDateUtc
|
|
@@ -2749,12 +3093,15 @@ export const withDateUtc: {
|
|
|
2749
3093
|
/**
|
|
2750
3094
|
* Pattern match on a `DateTime` to handle `Utc` and `Zoned` cases differently.
|
|
2751
3095
|
*
|
|
2752
|
-
*
|
|
3096
|
+
* **Example** (Pattern matching DateTime variants)
|
|
3097
|
+
*
|
|
2753
3098
|
* ```ts
|
|
2754
3099
|
* import { DateTime } from "effect"
|
|
2755
3100
|
*
|
|
2756
|
-
* const dt1 = DateTime.
|
|
2757
|
-
* const dt2 = DateTime.makeZonedUnsafe(
|
|
3101
|
+
* const dt1 = DateTime.makeUnsafe("2024-01-01T12:00:00Z") // Utc
|
|
3102
|
+
* const dt2 = DateTime.makeZonedUnsafe("2024-06-15T14:30:00Z", {
|
|
3103
|
+
* timeZone: "Europe/London"
|
|
3104
|
+
* }) // Zoned
|
|
2758
3105
|
*
|
|
2759
3106
|
* const result1 = DateTime.match(dt1, {
|
|
2760
3107
|
* onUtc: (utc) => `UTC: ${DateTime.formatIso(utc)}`,
|
|
@@ -2765,6 +3112,9 @@ export const withDateUtc: {
|
|
|
2765
3112
|
* onUtc: (utc) => `UTC: ${DateTime.formatIso(utc)}`,
|
|
2766
3113
|
* onZoned: (zoned) => `Zoned: ${DateTime.formatIsoZoned(zoned)}`
|
|
2767
3114
|
* })
|
|
3115
|
+
*
|
|
3116
|
+
* console.log(result1) // "UTC: 2024-01-01T12:00:00.000Z"
|
|
3117
|
+
* console.log(result2) // "Zoned: 2024-06-15T15:30:00.000+01:00[Europe/London]"
|
|
2768
3118
|
* ```
|
|
2769
3119
|
*
|
|
2770
3120
|
* @category mapping
|
|
@@ -2774,12 +3124,15 @@ export const match: {
|
|
|
2774
3124
|
/**
|
|
2775
3125
|
* Pattern match on a `DateTime` to handle `Utc` and `Zoned` cases differently.
|
|
2776
3126
|
*
|
|
2777
|
-
*
|
|
3127
|
+
* **Example** (Pattern matching DateTime variants)
|
|
3128
|
+
*
|
|
2778
3129
|
* ```ts
|
|
2779
3130
|
* import { DateTime } from "effect"
|
|
2780
3131
|
*
|
|
2781
|
-
* const dt1 = DateTime.
|
|
2782
|
-
* const dt2 = DateTime.makeZonedUnsafe(
|
|
3132
|
+
* const dt1 = DateTime.makeUnsafe("2024-01-01T12:00:00Z") // Utc
|
|
3133
|
+
* const dt2 = DateTime.makeZonedUnsafe("2024-06-15T14:30:00Z", {
|
|
3134
|
+
* timeZone: "Europe/London"
|
|
3135
|
+
* }) // Zoned
|
|
2783
3136
|
*
|
|
2784
3137
|
* const result1 = DateTime.match(dt1, {
|
|
2785
3138
|
* onUtc: (utc) => `UTC: ${DateTime.formatIso(utc)}`,
|
|
@@ -2790,6 +3143,9 @@ export const match: {
|
|
|
2790
3143
|
* onUtc: (utc) => `UTC: ${DateTime.formatIso(utc)}`,
|
|
2791
3144
|
* onZoned: (zoned) => `Zoned: ${DateTime.formatIsoZoned(zoned)}`
|
|
2792
3145
|
* })
|
|
3146
|
+
*
|
|
3147
|
+
* console.log(result1) // "UTC: 2024-01-01T12:00:00.000Z"
|
|
3148
|
+
* console.log(result2) // "Zoned: 2024-06-15T15:30:00.000+01:00[Europe/London]"
|
|
2793
3149
|
* ```
|
|
2794
3150
|
*
|
|
2795
3151
|
* @category mapping
|
|
@@ -2804,12 +3160,15 @@ export const match: {
|
|
|
2804
3160
|
/**
|
|
2805
3161
|
* Pattern match on a `DateTime` to handle `Utc` and `Zoned` cases differently.
|
|
2806
3162
|
*
|
|
2807
|
-
*
|
|
3163
|
+
* **Example** (Pattern matching DateTime variants)
|
|
3164
|
+
*
|
|
2808
3165
|
* ```ts
|
|
2809
3166
|
* import { DateTime } from "effect"
|
|
2810
3167
|
*
|
|
2811
|
-
* const dt1 = DateTime.
|
|
2812
|
-
* const dt2 = DateTime.makeZonedUnsafe(
|
|
3168
|
+
* const dt1 = DateTime.makeUnsafe("2024-01-01T12:00:00Z") // Utc
|
|
3169
|
+
* const dt2 = DateTime.makeZonedUnsafe("2024-06-15T14:30:00Z", {
|
|
3170
|
+
* timeZone: "Europe/London"
|
|
3171
|
+
* }) // Zoned
|
|
2813
3172
|
*
|
|
2814
3173
|
* const result1 = DateTime.match(dt1, {
|
|
2815
3174
|
* onUtc: (utc) => `UTC: ${DateTime.formatIso(utc)}`,
|
|
@@ -2820,6 +3179,9 @@ export const match: {
|
|
|
2820
3179
|
* onUtc: (utc) => `UTC: ${DateTime.formatIso(utc)}`,
|
|
2821
3180
|
* onZoned: (zoned) => `Zoned: ${DateTime.formatIsoZoned(zoned)}`
|
|
2822
3181
|
* })
|
|
3182
|
+
*
|
|
3183
|
+
* console.log(result1) // "UTC: 2024-01-01T12:00:00.000Z"
|
|
3184
|
+
* console.log(result2) // "Zoned: 2024-06-15T15:30:00.000+01:00[Europe/London]"
|
|
2823
3185
|
* ```
|
|
2824
3186
|
*
|
|
2825
3187
|
* @category mapping
|
|
@@ -2841,9 +3203,8 @@ export const match: {
|
|
|
2841
3203
|
/**
|
|
2842
3204
|
* Add the given `Duration` to a `DateTime`.
|
|
2843
3205
|
*
|
|
2844
|
-
*
|
|
2845
|
-
*
|
|
2846
|
-
* @example
|
|
3206
|
+
* **Example** (Adding durations)
|
|
3207
|
+
*
|
|
2847
3208
|
* ```ts
|
|
2848
3209
|
* import { DateTime } from "effect"
|
|
2849
3210
|
*
|
|
@@ -2852,6 +3213,9 @@ export const match: {
|
|
|
2852
3213
|
* DateTime.addDuration("5 minutes")
|
|
2853
3214
|
* )
|
|
2854
3215
|
* ```
|
|
3216
|
+
*
|
|
3217
|
+
* @category math
|
|
3218
|
+
* @since 3.6.0
|
|
2855
3219
|
*/
|
|
2856
3220
|
export const addDuration: {
|
|
2857
3221
|
// =============================================================================
|
|
@@ -2861,9 +3225,8 @@ export const addDuration: {
|
|
|
2861
3225
|
/**
|
|
2862
3226
|
* Add the given `Duration` to a `DateTime`.
|
|
2863
3227
|
*
|
|
2864
|
-
*
|
|
2865
|
-
*
|
|
2866
|
-
* @example
|
|
3228
|
+
* **Example** (Adding durations)
|
|
3229
|
+
*
|
|
2867
3230
|
* ```ts
|
|
2868
3231
|
* import { DateTime } from "effect"
|
|
2869
3232
|
*
|
|
@@ -2872,6 +3235,9 @@ export const addDuration: {
|
|
|
2872
3235
|
* DateTime.addDuration("5 minutes")
|
|
2873
3236
|
* )
|
|
2874
3237
|
* ```
|
|
3238
|
+
*
|
|
3239
|
+
* @category math
|
|
3240
|
+
* @since 3.6.0
|
|
2875
3241
|
*/
|
|
2876
3242
|
(duration: Duration.Input): <A extends DateTime>(self: A) => A
|
|
2877
3243
|
// =============================================================================
|
|
@@ -2881,9 +3247,8 @@ export const addDuration: {
|
|
|
2881
3247
|
/**
|
|
2882
3248
|
* Add the given `Duration` to a `DateTime`.
|
|
2883
3249
|
*
|
|
2884
|
-
*
|
|
2885
|
-
*
|
|
2886
|
-
* @example
|
|
3250
|
+
* **Example** (Adding durations)
|
|
3251
|
+
*
|
|
2887
3252
|
* ```ts
|
|
2888
3253
|
* import { DateTime } from "effect"
|
|
2889
3254
|
*
|
|
@@ -2892,6 +3257,9 @@ export const addDuration: {
|
|
|
2892
3257
|
* DateTime.addDuration("5 minutes")
|
|
2893
3258
|
* )
|
|
2894
3259
|
* ```
|
|
3260
|
+
*
|
|
3261
|
+
* @category math
|
|
3262
|
+
* @since 3.6.0
|
|
2895
3263
|
*/
|
|
2896
3264
|
<A extends DateTime>(self: A, duration: Duration.Input): A
|
|
2897
3265
|
} = Internal.addDuration
|
|
@@ -2899,9 +3267,8 @@ export const addDuration: {
|
|
|
2899
3267
|
/**
|
|
2900
3268
|
* Subtract the given `Duration` from a `DateTime`.
|
|
2901
3269
|
*
|
|
2902
|
-
*
|
|
2903
|
-
*
|
|
2904
|
-
* @example
|
|
3270
|
+
* **Example** (Subtracting durations)
|
|
3271
|
+
*
|
|
2905
3272
|
* ```ts
|
|
2906
3273
|
* import { DateTime } from "effect"
|
|
2907
3274
|
*
|
|
@@ -2910,14 +3277,16 @@ export const addDuration: {
|
|
|
2910
3277
|
* DateTime.subtractDuration("5 minutes")
|
|
2911
3278
|
* )
|
|
2912
3279
|
* ```
|
|
3280
|
+
*
|
|
3281
|
+
* @category math
|
|
3282
|
+
* @since 3.6.0
|
|
2913
3283
|
*/
|
|
2914
3284
|
export const subtractDuration: {
|
|
2915
3285
|
/**
|
|
2916
3286
|
* Subtract the given `Duration` from a `DateTime`.
|
|
2917
3287
|
*
|
|
2918
|
-
*
|
|
2919
|
-
*
|
|
2920
|
-
* @example
|
|
3288
|
+
* **Example** (Subtracting durations)
|
|
3289
|
+
*
|
|
2921
3290
|
* ```ts
|
|
2922
3291
|
* import { DateTime } from "effect"
|
|
2923
3292
|
*
|
|
@@ -2926,14 +3295,16 @@ export const subtractDuration: {
|
|
|
2926
3295
|
* DateTime.subtractDuration("5 minutes")
|
|
2927
3296
|
* )
|
|
2928
3297
|
* ```
|
|
3298
|
+
*
|
|
3299
|
+
* @category math
|
|
3300
|
+
* @since 3.6.0
|
|
2929
3301
|
*/
|
|
2930
3302
|
(duration: Duration.Input): <A extends DateTime>(self: A) => A
|
|
2931
3303
|
/**
|
|
2932
3304
|
* Subtract the given `Duration` from a `DateTime`.
|
|
2933
3305
|
*
|
|
2934
|
-
*
|
|
2935
|
-
*
|
|
2936
|
-
* @example
|
|
3306
|
+
* **Example** (Subtracting durations)
|
|
3307
|
+
*
|
|
2937
3308
|
* ```ts
|
|
2938
3309
|
* import { DateTime } from "effect"
|
|
2939
3310
|
*
|
|
@@ -2942,6 +3313,9 @@ export const subtractDuration: {
|
|
|
2942
3313
|
* DateTime.subtractDuration("5 minutes")
|
|
2943
3314
|
* )
|
|
2944
3315
|
* ```
|
|
3316
|
+
*
|
|
3317
|
+
* @category math
|
|
3318
|
+
* @since 3.6.0
|
|
2945
3319
|
*/
|
|
2946
3320
|
<A extends DateTime>(self: A, duration: Duration.Input): A
|
|
2947
3321
|
} = Internal.subtractDuration
|
|
@@ -2952,9 +3326,8 @@ export const subtractDuration: {
|
|
|
2952
3326
|
* The time zone is taken into account when adding days, weeks, months, and
|
|
2953
3327
|
* years.
|
|
2954
3328
|
*
|
|
2955
|
-
*
|
|
2956
|
-
*
|
|
2957
|
-
* @example
|
|
3329
|
+
* **Example** (Adding date and time parts)
|
|
3330
|
+
*
|
|
2958
3331
|
* ```ts
|
|
2959
3332
|
* import { DateTime } from "effect"
|
|
2960
3333
|
*
|
|
@@ -2963,6 +3336,9 @@ export const subtractDuration: {
|
|
|
2963
3336
|
* DateTime.add({ minutes: 5 })
|
|
2964
3337
|
* )
|
|
2965
3338
|
* ```
|
|
3339
|
+
*
|
|
3340
|
+
* @category math
|
|
3341
|
+
* @since 3.6.0
|
|
2966
3342
|
*/
|
|
2967
3343
|
export const add: {
|
|
2968
3344
|
/**
|
|
@@ -2971,9 +3347,8 @@ export const add: {
|
|
|
2971
3347
|
* The time zone is taken into account when adding days, weeks, months, and
|
|
2972
3348
|
* years.
|
|
2973
3349
|
*
|
|
2974
|
-
*
|
|
2975
|
-
*
|
|
2976
|
-
* @example
|
|
3350
|
+
* **Example** (Adding date and time parts)
|
|
3351
|
+
*
|
|
2977
3352
|
* ```ts
|
|
2978
3353
|
* import { DateTime } from "effect"
|
|
2979
3354
|
*
|
|
@@ -2982,6 +3357,9 @@ export const add: {
|
|
|
2982
3357
|
* DateTime.add({ minutes: 5 })
|
|
2983
3358
|
* )
|
|
2984
3359
|
* ```
|
|
3360
|
+
*
|
|
3361
|
+
* @category math
|
|
3362
|
+
* @since 3.6.0
|
|
2985
3363
|
*/
|
|
2986
3364
|
(parts: Partial<DateTime.PartsForMath>): <A extends DateTime>(self: A) => A
|
|
2987
3365
|
/**
|
|
@@ -2990,9 +3368,8 @@ export const add: {
|
|
|
2990
3368
|
* The time zone is taken into account when adding days, weeks, months, and
|
|
2991
3369
|
* years.
|
|
2992
3370
|
*
|
|
2993
|
-
*
|
|
2994
|
-
*
|
|
2995
|
-
* @example
|
|
3371
|
+
* **Example** (Adding date and time parts)
|
|
3372
|
+
*
|
|
2996
3373
|
* ```ts
|
|
2997
3374
|
* import { DateTime } from "effect"
|
|
2998
3375
|
*
|
|
@@ -3001,6 +3378,9 @@ export const add: {
|
|
|
3001
3378
|
* DateTime.add({ minutes: 5 })
|
|
3002
3379
|
* )
|
|
3003
3380
|
* ```
|
|
3381
|
+
*
|
|
3382
|
+
* @category math
|
|
3383
|
+
* @since 3.6.0
|
|
3004
3384
|
*/
|
|
3005
3385
|
<A extends DateTime>(self: A, parts: Partial<DateTime.PartsForMath>): A
|
|
3006
3386
|
} = Internal.add
|
|
@@ -3008,9 +3388,8 @@ export const add: {
|
|
|
3008
3388
|
/**
|
|
3009
3389
|
* Subtract the given `amount` of `unit`'s from a `DateTime`.
|
|
3010
3390
|
*
|
|
3011
|
-
*
|
|
3012
|
-
*
|
|
3013
|
-
* @example
|
|
3391
|
+
* **Example** (Subtracting date and time parts)
|
|
3392
|
+
*
|
|
3014
3393
|
* ```ts
|
|
3015
3394
|
* import { DateTime } from "effect"
|
|
3016
3395
|
*
|
|
@@ -3019,14 +3398,16 @@ export const add: {
|
|
|
3019
3398
|
* DateTime.subtract({ minutes: 5 })
|
|
3020
3399
|
* )
|
|
3021
3400
|
* ```
|
|
3401
|
+
*
|
|
3402
|
+
* @category math
|
|
3403
|
+
* @since 3.6.0
|
|
3022
3404
|
*/
|
|
3023
3405
|
export const subtract: {
|
|
3024
3406
|
/**
|
|
3025
3407
|
* Subtract the given `amount` of `unit`'s from a `DateTime`.
|
|
3026
3408
|
*
|
|
3027
|
-
*
|
|
3028
|
-
*
|
|
3029
|
-
* @example
|
|
3409
|
+
* **Example** (Subtracting date and time parts)
|
|
3410
|
+
*
|
|
3030
3411
|
* ```ts
|
|
3031
3412
|
* import { DateTime } from "effect"
|
|
3032
3413
|
*
|
|
@@ -3035,14 +3416,16 @@ export const subtract: {
|
|
|
3035
3416
|
* DateTime.subtract({ minutes: 5 })
|
|
3036
3417
|
* )
|
|
3037
3418
|
* ```
|
|
3419
|
+
*
|
|
3420
|
+
* @category math
|
|
3421
|
+
* @since 3.6.0
|
|
3038
3422
|
*/
|
|
3039
3423
|
(parts: Partial<DateTime.PartsForMath>): <A extends DateTime>(self: A) => A
|
|
3040
3424
|
/**
|
|
3041
3425
|
* Subtract the given `amount` of `unit`'s from a `DateTime`.
|
|
3042
3426
|
*
|
|
3043
|
-
*
|
|
3044
|
-
*
|
|
3045
|
-
* @example
|
|
3427
|
+
* **Example** (Subtracting date and time parts)
|
|
3428
|
+
*
|
|
3046
3429
|
* ```ts
|
|
3047
3430
|
* import { DateTime } from "effect"
|
|
3048
3431
|
*
|
|
@@ -3051,6 +3434,9 @@ export const subtract: {
|
|
|
3051
3434
|
* DateTime.subtract({ minutes: 5 })
|
|
3052
3435
|
* )
|
|
3053
3436
|
* ```
|
|
3437
|
+
*
|
|
3438
|
+
* @category math
|
|
3439
|
+
* @since 3.6.0
|
|
3054
3440
|
*/
|
|
3055
3441
|
<A extends DateTime>(self: A, parts: Partial<DateTime.PartsForMath>): A
|
|
3056
3442
|
} = Internal.subtract
|
|
@@ -3061,9 +3447,8 @@ export const subtract: {
|
|
|
3061
3447
|
* If the part is `week`, the `weekStartsOn` option can be used to specify the
|
|
3062
3448
|
* day of the week that the week starts on. The default is 0 (Sunday).
|
|
3063
3449
|
*
|
|
3064
|
-
*
|
|
3065
|
-
*
|
|
3066
|
-
* @example
|
|
3450
|
+
* **Example** (Rounding down DateTime values)
|
|
3451
|
+
*
|
|
3067
3452
|
* ```ts
|
|
3068
3453
|
* import { DateTime } from "effect"
|
|
3069
3454
|
*
|
|
@@ -3073,6 +3458,9 @@ export const subtract: {
|
|
|
3073
3458
|
* DateTime.formatIso
|
|
3074
3459
|
* )
|
|
3075
3460
|
* ```
|
|
3461
|
+
*
|
|
3462
|
+
* @category math
|
|
3463
|
+
* @since 3.6.0
|
|
3076
3464
|
*/
|
|
3077
3465
|
export const startOf: {
|
|
3078
3466
|
/**
|
|
@@ -3081,9 +3469,8 @@ export const startOf: {
|
|
|
3081
3469
|
* If the part is `week`, the `weekStartsOn` option can be used to specify the
|
|
3082
3470
|
* day of the week that the week starts on. The default is 0 (Sunday).
|
|
3083
3471
|
*
|
|
3084
|
-
*
|
|
3085
|
-
*
|
|
3086
|
-
* @example
|
|
3472
|
+
* **Example** (Rounding down DateTime values)
|
|
3473
|
+
*
|
|
3087
3474
|
* ```ts
|
|
3088
3475
|
* import { DateTime } from "effect"
|
|
3089
3476
|
*
|
|
@@ -3093,6 +3480,9 @@ export const startOf: {
|
|
|
3093
3480
|
* DateTime.formatIso
|
|
3094
3481
|
* )
|
|
3095
3482
|
* ```
|
|
3483
|
+
*
|
|
3484
|
+
* @category math
|
|
3485
|
+
* @since 3.6.0
|
|
3096
3486
|
*/
|
|
3097
3487
|
(
|
|
3098
3488
|
part: DateTime.UnitSingular,
|
|
@@ -3104,9 +3494,8 @@ export const startOf: {
|
|
|
3104
3494
|
* If the part is `week`, the `weekStartsOn` option can be used to specify the
|
|
3105
3495
|
* day of the week that the week starts on. The default is 0 (Sunday).
|
|
3106
3496
|
*
|
|
3107
|
-
*
|
|
3108
|
-
*
|
|
3109
|
-
* @example
|
|
3497
|
+
* **Example** (Rounding down DateTime values)
|
|
3498
|
+
*
|
|
3110
3499
|
* ```ts
|
|
3111
3500
|
* import { DateTime } from "effect"
|
|
3112
3501
|
*
|
|
@@ -3116,6 +3505,9 @@ export const startOf: {
|
|
|
3116
3505
|
* DateTime.formatIso
|
|
3117
3506
|
* )
|
|
3118
3507
|
* ```
|
|
3508
|
+
*
|
|
3509
|
+
* @category math
|
|
3510
|
+
* @since 3.6.0
|
|
3119
3511
|
*/
|
|
3120
3512
|
<A extends DateTime>(
|
|
3121
3513
|
self: A,
|
|
@@ -3130,9 +3522,8 @@ export const startOf: {
|
|
|
3130
3522
|
* If the part is `week`, the `weekStartsOn` option can be used to specify the
|
|
3131
3523
|
* day of the week that the week starts on. The default is 0 (Sunday).
|
|
3132
3524
|
*
|
|
3133
|
-
*
|
|
3134
|
-
*
|
|
3135
|
-
* @example
|
|
3525
|
+
* **Example** (Rounding up DateTime values)
|
|
3526
|
+
*
|
|
3136
3527
|
* ```ts
|
|
3137
3528
|
* import { DateTime } from "effect"
|
|
3138
3529
|
*
|
|
@@ -3142,6 +3533,9 @@ export const startOf: {
|
|
|
3142
3533
|
* DateTime.formatIso
|
|
3143
3534
|
* )
|
|
3144
3535
|
* ```
|
|
3536
|
+
*
|
|
3537
|
+
* @category math
|
|
3538
|
+
* @since 3.6.0
|
|
3145
3539
|
*/
|
|
3146
3540
|
export const endOf: {
|
|
3147
3541
|
/**
|
|
@@ -3150,9 +3544,8 @@ export const endOf: {
|
|
|
3150
3544
|
* If the part is `week`, the `weekStartsOn` option can be used to specify the
|
|
3151
3545
|
* day of the week that the week starts on. The default is 0 (Sunday).
|
|
3152
3546
|
*
|
|
3153
|
-
*
|
|
3154
|
-
*
|
|
3155
|
-
* @example
|
|
3547
|
+
* **Example** (Rounding up DateTime values)
|
|
3548
|
+
*
|
|
3156
3549
|
* ```ts
|
|
3157
3550
|
* import { DateTime } from "effect"
|
|
3158
3551
|
*
|
|
@@ -3162,6 +3555,9 @@ export const endOf: {
|
|
|
3162
3555
|
* DateTime.formatIso
|
|
3163
3556
|
* )
|
|
3164
3557
|
* ```
|
|
3558
|
+
*
|
|
3559
|
+
* @category math
|
|
3560
|
+
* @since 3.6.0
|
|
3165
3561
|
*/
|
|
3166
3562
|
(
|
|
3167
3563
|
part: DateTime.UnitSingular,
|
|
@@ -3173,9 +3569,8 @@ export const endOf: {
|
|
|
3173
3569
|
* If the part is `week`, the `weekStartsOn` option can be used to specify the
|
|
3174
3570
|
* day of the week that the week starts on. The default is 0 (Sunday).
|
|
3175
3571
|
*
|
|
3176
|
-
*
|
|
3177
|
-
*
|
|
3178
|
-
* @example
|
|
3572
|
+
* **Example** (Rounding up DateTime values)
|
|
3573
|
+
*
|
|
3179
3574
|
* ```ts
|
|
3180
3575
|
* import { DateTime } from "effect"
|
|
3181
3576
|
*
|
|
@@ -3185,6 +3580,9 @@ export const endOf: {
|
|
|
3185
3580
|
* DateTime.formatIso
|
|
3186
3581
|
* )
|
|
3187
3582
|
* ```
|
|
3583
|
+
*
|
|
3584
|
+
* @category math
|
|
3585
|
+
* @since 3.6.0
|
|
3188
3586
|
*/
|
|
3189
3587
|
<A extends DateTime>(
|
|
3190
3588
|
self: A,
|
|
@@ -3199,9 +3597,8 @@ export const endOf: {
|
|
|
3199
3597
|
* If the part is `week`, the `weekStartsOn` option can be used to specify the
|
|
3200
3598
|
* day of the week that the week starts on. The default is 0 (Sunday).
|
|
3201
3599
|
*
|
|
3202
|
-
*
|
|
3203
|
-
*
|
|
3204
|
-
* @example
|
|
3600
|
+
* **Example** (Rounding DateTime values to nearest units)
|
|
3601
|
+
*
|
|
3205
3602
|
* ```ts
|
|
3206
3603
|
* import { DateTime } from "effect"
|
|
3207
3604
|
*
|
|
@@ -3211,6 +3608,9 @@ export const endOf: {
|
|
|
3211
3608
|
* DateTime.formatIso
|
|
3212
3609
|
* )
|
|
3213
3610
|
* ```
|
|
3611
|
+
*
|
|
3612
|
+
* @category math
|
|
3613
|
+
* @since 3.6.0
|
|
3214
3614
|
*/
|
|
3215
3615
|
export const nearest: {
|
|
3216
3616
|
/**
|
|
@@ -3219,9 +3619,8 @@ export const nearest: {
|
|
|
3219
3619
|
* If the part is `week`, the `weekStartsOn` option can be used to specify the
|
|
3220
3620
|
* day of the week that the week starts on. The default is 0 (Sunday).
|
|
3221
3621
|
*
|
|
3222
|
-
*
|
|
3223
|
-
*
|
|
3224
|
-
* @example
|
|
3622
|
+
* **Example** (Rounding DateTime values to nearest units)
|
|
3623
|
+
*
|
|
3225
3624
|
* ```ts
|
|
3226
3625
|
* import { DateTime } from "effect"
|
|
3227
3626
|
*
|
|
@@ -3231,6 +3630,9 @@ export const nearest: {
|
|
|
3231
3630
|
* DateTime.formatIso
|
|
3232
3631
|
* )
|
|
3233
3632
|
* ```
|
|
3633
|
+
*
|
|
3634
|
+
* @category math
|
|
3635
|
+
* @since 3.6.0
|
|
3234
3636
|
*/
|
|
3235
3637
|
(
|
|
3236
3638
|
part: DateTime.UnitSingular,
|
|
@@ -3242,9 +3644,8 @@ export const nearest: {
|
|
|
3242
3644
|
* If the part is `week`, the `weekStartsOn` option can be used to specify the
|
|
3243
3645
|
* day of the week that the week starts on. The default is 0 (Sunday).
|
|
3244
3646
|
*
|
|
3245
|
-
*
|
|
3246
|
-
*
|
|
3247
|
-
* @example
|
|
3647
|
+
* **Example** (Rounding DateTime values to nearest units)
|
|
3648
|
+
*
|
|
3248
3649
|
* ```ts
|
|
3249
3650
|
* import { DateTime } from "effect"
|
|
3250
3651
|
*
|
|
@@ -3254,6 +3655,9 @@ export const nearest: {
|
|
|
3254
3655
|
* DateTime.formatIso
|
|
3255
3656
|
* )
|
|
3256
3657
|
* ```
|
|
3658
|
+
*
|
|
3659
|
+
* @category math
|
|
3660
|
+
* @since 3.6.0
|
|
3257
3661
|
*/
|
|
3258
3662
|
<A extends DateTime>(
|
|
3259
3663
|
self: A,
|
|
@@ -3267,14 +3671,17 @@ export const nearest: {
|
|
|
3267
3671
|
// =============================================================================
|
|
3268
3672
|
|
|
3269
3673
|
/**
|
|
3270
|
-
*
|
|
3674
|
+
* Formats a `DateTime` with `Intl.DateTimeFormat`.
|
|
3675
|
+
*
|
|
3676
|
+
* Unless a `timeZone` option is supplied, UTC values are formatted in UTC and
|
|
3677
|
+
* zoned values are formatted in their named zone or fixed-offset zone.
|
|
3271
3678
|
*
|
|
3272
|
-
*
|
|
3679
|
+
* Fixed-offset zones depend on runtime support for offset `timeZone`
|
|
3680
|
+
* identifiers. When unsupported, formatting falls back to UTC with the
|
|
3681
|
+
* `DateTime` adjusted to the offset.
|
|
3273
3682
|
*
|
|
3274
|
-
*
|
|
3275
|
-
* "UTC" and use the adjusted `Date`.
|
|
3683
|
+
* **Example** (Formatting DateTime values with Intl options)
|
|
3276
3684
|
*
|
|
3277
|
-
* @example
|
|
3278
3685
|
* ```ts
|
|
3279
3686
|
* import { DateTime } from "effect"
|
|
3280
3687
|
*
|
|
@@ -3291,8 +3698,8 @@ export const nearest: {
|
|
|
3291
3698
|
* console.log(formatted) // "Saturday, June 15, 2024 at 3:30 PM"
|
|
3292
3699
|
* ```
|
|
3293
3700
|
*
|
|
3294
|
-
* @since 3.6.0
|
|
3295
3701
|
* @category formatting
|
|
3702
|
+
* @since 3.6.0
|
|
3296
3703
|
*/
|
|
3297
3704
|
export const format: {
|
|
3298
3705
|
// =============================================================================
|
|
@@ -3300,14 +3707,17 @@ export const format: {
|
|
|
3300
3707
|
// =============================================================================
|
|
3301
3708
|
|
|
3302
3709
|
/**
|
|
3303
|
-
*
|
|
3710
|
+
* Formats a `DateTime` with `Intl.DateTimeFormat`.
|
|
3711
|
+
*
|
|
3712
|
+
* Unless a `timeZone` option is supplied, UTC values are formatted in UTC and
|
|
3713
|
+
* zoned values are formatted in their named zone or fixed-offset zone.
|
|
3304
3714
|
*
|
|
3305
|
-
*
|
|
3715
|
+
* Fixed-offset zones depend on runtime support for offset `timeZone`
|
|
3716
|
+
* identifiers. When unsupported, formatting falls back to UTC with the
|
|
3717
|
+
* `DateTime` adjusted to the offset.
|
|
3306
3718
|
*
|
|
3307
|
-
*
|
|
3308
|
-
* "UTC" and use the adjusted `Date`.
|
|
3719
|
+
* **Example** (Formatting DateTime values with Intl options)
|
|
3309
3720
|
*
|
|
3310
|
-
* @example
|
|
3311
3721
|
* ```ts
|
|
3312
3722
|
* import { DateTime } from "effect"
|
|
3313
3723
|
*
|
|
@@ -3324,8 +3734,8 @@ export const format: {
|
|
|
3324
3734
|
* console.log(formatted) // "Saturday, June 15, 2024 at 3:30 PM"
|
|
3325
3735
|
* ```
|
|
3326
3736
|
*
|
|
3327
|
-
* @since 3.6.0
|
|
3328
3737
|
* @category formatting
|
|
3738
|
+
* @since 3.6.0
|
|
3329
3739
|
*/
|
|
3330
3740
|
(
|
|
3331
3741
|
options?:
|
|
@@ -3339,14 +3749,17 @@ export const format: {
|
|
|
3339
3749
|
// =============================================================================
|
|
3340
3750
|
|
|
3341
3751
|
/**
|
|
3342
|
-
*
|
|
3752
|
+
* Formats a `DateTime` with `Intl.DateTimeFormat`.
|
|
3753
|
+
*
|
|
3754
|
+
* Unless a `timeZone` option is supplied, UTC values are formatted in UTC and
|
|
3755
|
+
* zoned values are formatted in their named zone or fixed-offset zone.
|
|
3343
3756
|
*
|
|
3344
|
-
*
|
|
3757
|
+
* Fixed-offset zones depend on runtime support for offset `timeZone`
|
|
3758
|
+
* identifiers. When unsupported, formatting falls back to UTC with the
|
|
3759
|
+
* `DateTime` adjusted to the offset.
|
|
3345
3760
|
*
|
|
3346
|
-
*
|
|
3347
|
-
* "UTC" and use the adjusted `Date`.
|
|
3761
|
+
* **Example** (Formatting DateTime values with Intl options)
|
|
3348
3762
|
*
|
|
3349
|
-
* @example
|
|
3350
3763
|
* ```ts
|
|
3351
3764
|
* import { DateTime } from "effect"
|
|
3352
3765
|
*
|
|
@@ -3363,8 +3776,8 @@ export const format: {
|
|
|
3363
3776
|
* console.log(formatted) // "Saturday, June 15, 2024 at 3:30 PM"
|
|
3364
3777
|
* ```
|
|
3365
3778
|
*
|
|
3366
|
-
* @since 3.6.0
|
|
3367
3779
|
* @category formatting
|
|
3780
|
+
* @since 3.6.0
|
|
3368
3781
|
*/
|
|
3369
3782
|
(
|
|
3370
3783
|
self: DateTime,
|
|
@@ -3381,7 +3794,8 @@ export const format: {
|
|
|
3381
3794
|
*
|
|
3382
3795
|
* It will use the system's local time zone & locale.
|
|
3383
3796
|
*
|
|
3384
|
-
*
|
|
3797
|
+
* **Example** (Formatting DateTime values locally)
|
|
3798
|
+
*
|
|
3385
3799
|
* ```ts
|
|
3386
3800
|
* import { DateTime } from "effect"
|
|
3387
3801
|
*
|
|
@@ -3399,8 +3813,8 @@ export const format: {
|
|
|
3399
3813
|
* console.log(local) // Output depends on system locale/timezone
|
|
3400
3814
|
* ```
|
|
3401
3815
|
*
|
|
3402
|
-
* @since 3.6.0
|
|
3403
3816
|
* @category formatting
|
|
3817
|
+
* @since 3.6.0
|
|
3404
3818
|
*/
|
|
3405
3819
|
export const formatLocal: {
|
|
3406
3820
|
/**
|
|
@@ -3408,7 +3822,8 @@ export const formatLocal: {
|
|
|
3408
3822
|
*
|
|
3409
3823
|
* It will use the system's local time zone & locale.
|
|
3410
3824
|
*
|
|
3411
|
-
*
|
|
3825
|
+
* **Example** (Formatting DateTime values locally)
|
|
3826
|
+
*
|
|
3412
3827
|
* ```ts
|
|
3413
3828
|
* import { DateTime } from "effect"
|
|
3414
3829
|
*
|
|
@@ -3426,8 +3841,8 @@ export const formatLocal: {
|
|
|
3426
3841
|
* console.log(local) // Output depends on system locale/timezone
|
|
3427
3842
|
* ```
|
|
3428
3843
|
*
|
|
3429
|
-
* @since 3.6.0
|
|
3430
3844
|
* @category formatting
|
|
3845
|
+
* @since 3.6.0
|
|
3431
3846
|
*/
|
|
3432
3847
|
(
|
|
3433
3848
|
options?:
|
|
@@ -3441,7 +3856,8 @@ export const formatLocal: {
|
|
|
3441
3856
|
*
|
|
3442
3857
|
* It will use the system's local time zone & locale.
|
|
3443
3858
|
*
|
|
3444
|
-
*
|
|
3859
|
+
* **Example** (Formatting DateTime values locally)
|
|
3860
|
+
*
|
|
3445
3861
|
* ```ts
|
|
3446
3862
|
* import { DateTime } from "effect"
|
|
3447
3863
|
*
|
|
@@ -3459,8 +3875,8 @@ export const formatLocal: {
|
|
|
3459
3875
|
* console.log(local) // Output depends on system locale/timezone
|
|
3460
3876
|
* ```
|
|
3461
3877
|
*
|
|
3462
|
-
* @since 3.6.0
|
|
3463
3878
|
* @category formatting
|
|
3879
|
+
* @since 3.6.0
|
|
3464
3880
|
*/
|
|
3465
3881
|
(
|
|
3466
3882
|
self: DateTime,
|
|
@@ -3477,7 +3893,8 @@ export const formatLocal: {
|
|
|
3477
3893
|
*
|
|
3478
3894
|
* This forces the time zone to be UTC.
|
|
3479
3895
|
*
|
|
3480
|
-
*
|
|
3896
|
+
* **Example** (Formatting DateTime values in UTC)
|
|
3897
|
+
*
|
|
3481
3898
|
* ```ts
|
|
3482
3899
|
* import { DateTime } from "effect"
|
|
3483
3900
|
*
|
|
@@ -3498,8 +3915,8 @@ export const formatLocal: {
|
|
|
3498
3915
|
* console.log(utcFormatted) // "06/15/2024, 02:30 PM UTC"
|
|
3499
3916
|
* ```
|
|
3500
3917
|
*
|
|
3501
|
-
* @since 3.6.0
|
|
3502
3918
|
* @category formatting
|
|
3919
|
+
* @since 3.6.0
|
|
3503
3920
|
*/
|
|
3504
3921
|
export const formatUtc: {
|
|
3505
3922
|
/**
|
|
@@ -3507,7 +3924,8 @@ export const formatUtc: {
|
|
|
3507
3924
|
*
|
|
3508
3925
|
* This forces the time zone to be UTC.
|
|
3509
3926
|
*
|
|
3510
|
-
*
|
|
3927
|
+
* **Example** (Formatting DateTime values in UTC)
|
|
3928
|
+
*
|
|
3511
3929
|
* ```ts
|
|
3512
3930
|
* import { DateTime } from "effect"
|
|
3513
3931
|
*
|
|
@@ -3528,8 +3946,8 @@ export const formatUtc: {
|
|
|
3528
3946
|
* console.log(utcFormatted) // "06/15/2024, 02:30 PM UTC"
|
|
3529
3947
|
* ```
|
|
3530
3948
|
*
|
|
3531
|
-
* @since 3.6.0
|
|
3532
3949
|
* @category formatting
|
|
3950
|
+
* @since 3.6.0
|
|
3533
3951
|
*/
|
|
3534
3952
|
(
|
|
3535
3953
|
options?:
|
|
@@ -3543,7 +3961,8 @@ export const formatUtc: {
|
|
|
3543
3961
|
*
|
|
3544
3962
|
* This forces the time zone to be UTC.
|
|
3545
3963
|
*
|
|
3546
|
-
*
|
|
3964
|
+
* **Example** (Formatting DateTime values in UTC)
|
|
3965
|
+
*
|
|
3547
3966
|
* ```ts
|
|
3548
3967
|
* import { DateTime } from "effect"
|
|
3549
3968
|
*
|
|
@@ -3564,8 +3983,8 @@ export const formatUtc: {
|
|
|
3564
3983
|
* console.log(utcFormatted) // "06/15/2024, 02:30 PM UTC"
|
|
3565
3984
|
* ```
|
|
3566
3985
|
*
|
|
3567
|
-
* @since 3.6.0
|
|
3568
3986
|
* @category formatting
|
|
3987
|
+
* @since 3.6.0
|
|
3569
3988
|
*/
|
|
3570
3989
|
(
|
|
3571
3990
|
self: DateTime,
|
|
@@ -3580,7 +3999,8 @@ export const formatUtc: {
|
|
|
3580
3999
|
/**
|
|
3581
4000
|
* Format a `DateTime` as a string using the `DateTimeFormat` API.
|
|
3582
4001
|
*
|
|
3583
|
-
*
|
|
4002
|
+
* **Example** (Formatting DateTime values with custom formatters)
|
|
4003
|
+
*
|
|
3584
4004
|
* ```ts
|
|
3585
4005
|
* import { DateTime } from "effect"
|
|
3586
4006
|
*
|
|
@@ -3600,14 +4020,15 @@ export const formatUtc: {
|
|
|
3600
4020
|
* console.log(formatted) // "15. Juni 2024, 16:30"
|
|
3601
4021
|
* ```
|
|
3602
4022
|
*
|
|
3603
|
-
* @since 3.6.0
|
|
3604
4023
|
* @category formatting
|
|
4024
|
+
* @since 3.6.0
|
|
3605
4025
|
*/
|
|
3606
4026
|
export const formatIntl: {
|
|
3607
4027
|
/**
|
|
3608
4028
|
* Format a `DateTime` as a string using the `DateTimeFormat` API.
|
|
3609
4029
|
*
|
|
3610
|
-
*
|
|
4030
|
+
* **Example** (Formatting DateTime values with custom formatters)
|
|
4031
|
+
*
|
|
3611
4032
|
* ```ts
|
|
3612
4033
|
* import { DateTime } from "effect"
|
|
3613
4034
|
*
|
|
@@ -3627,14 +4048,15 @@ export const formatIntl: {
|
|
|
3627
4048
|
* console.log(formatted) // "15. Juni 2024, 16:30"
|
|
3628
4049
|
* ```
|
|
3629
4050
|
*
|
|
3630
|
-
* @since 3.6.0
|
|
3631
4051
|
* @category formatting
|
|
4052
|
+
* @since 3.6.0
|
|
3632
4053
|
*/
|
|
3633
4054
|
(format: Intl.DateTimeFormat): (self: DateTime) => string
|
|
3634
4055
|
/**
|
|
3635
4056
|
* Format a `DateTime` as a string using the `DateTimeFormat` API.
|
|
3636
4057
|
*
|
|
3637
|
-
*
|
|
4058
|
+
* **Example** (Formatting DateTime values with custom formatters)
|
|
4059
|
+
*
|
|
3638
4060
|
* ```ts
|
|
3639
4061
|
* import { DateTime } from "effect"
|
|
3640
4062
|
*
|
|
@@ -3654,8 +4076,8 @@ export const formatIntl: {
|
|
|
3654
4076
|
* console.log(formatted) // "15. Juni 2024, 16:30"
|
|
3655
4077
|
* ```
|
|
3656
4078
|
*
|
|
3657
|
-
* @since 3.6.0
|
|
3658
4079
|
* @category formatting
|
|
4080
|
+
* @since 3.6.0
|
|
3659
4081
|
*/
|
|
3660
4082
|
(self: DateTime, format: Intl.DateTimeFormat): string
|
|
3661
4083
|
} = Internal.formatIntl
|
|
@@ -3665,7 +4087,8 @@ export const formatIntl: {
|
|
|
3665
4087
|
*
|
|
3666
4088
|
* Always returns the UTC representation in ISO 8601 format, ignoring any time zone.
|
|
3667
4089
|
*
|
|
3668
|
-
*
|
|
4090
|
+
* **Example** (Formatting DateTime values as ISO strings)
|
|
4091
|
+
*
|
|
3669
4092
|
* ```ts
|
|
3670
4093
|
* import { DateTime } from "effect"
|
|
3671
4094
|
*
|
|
@@ -3688,7 +4111,8 @@ export const formatIso: (self: DateTime) => string = Internal.formatIso
|
|
|
3688
4111
|
*
|
|
3689
4112
|
* Returns only the date part (YYYY-MM-DD) after applying time zone adjustments.
|
|
3690
4113
|
*
|
|
3691
|
-
*
|
|
4114
|
+
* **Example** (Formatting DateTime values as ISO dates)
|
|
4115
|
+
*
|
|
3692
4116
|
* ```ts
|
|
3693
4117
|
* import { DateTime } from "effect"
|
|
3694
4118
|
*
|
|
@@ -3711,7 +4135,8 @@ export const formatIsoDate: (self: DateTime) => string = Internal.formatIsoDate
|
|
|
3711
4135
|
*
|
|
3712
4136
|
* Returns only the date part (YYYY-MM-DD) in UTC, ignoring any time zone.
|
|
3713
4137
|
*
|
|
3714
|
-
*
|
|
4138
|
+
* **Example** (Formatting DateTime values as UTC ISO dates)
|
|
4139
|
+
*
|
|
3715
4140
|
* ```ts
|
|
3716
4141
|
* import { DateTime } from "effect"
|
|
3717
4142
|
*
|
|
@@ -3735,7 +4160,8 @@ export const formatIsoDateUtc: (self: DateTime) => string = Internal.formatIsoDa
|
|
|
3735
4160
|
* For `DateTime.Utc`, returns the same as `formatIso`. For `DateTime.Zoned`,
|
|
3736
4161
|
* includes the time zone offset in the format.
|
|
3737
4162
|
*
|
|
3738
|
-
*
|
|
4163
|
+
* **Example** (Formatting DateTime values with offsets)
|
|
4164
|
+
*
|
|
3739
4165
|
* ```ts
|
|
3740
4166
|
* import { DateTime } from "effect"
|
|
3741
4167
|
*
|
|
@@ -3758,7 +4184,8 @@ export const formatIsoOffset: (self: DateTime) => string = Internal.formatIsoOff
|
|
|
3758
4184
|
*
|
|
3759
4185
|
* It uses the format: `YYYY-MM-DDTHH:mm:ss.sss+HH:MM[Time/Zone]`.
|
|
3760
4186
|
*
|
|
3761
|
-
*
|
|
4187
|
+
* **Example** (Formatting zoned DateTime values)
|
|
4188
|
+
*
|
|
3762
4189
|
* ```ts
|
|
3763
4190
|
* import { DateTime } from "effect"
|
|
3764
4191
|
*
|
|
@@ -3777,8 +4204,8 @@ export const formatIsoOffset: (self: DateTime) => string = Internal.formatIsoOff
|
|
|
3777
4204
|
* console.log(offsetFormatted) // "2024-06-15T17:30:45.123+03:00"
|
|
3778
4205
|
* ```
|
|
3779
4206
|
*
|
|
3780
|
-
* @since 3.6.0
|
|
3781
4207
|
* @category formatting
|
|
4208
|
+
* @since 3.6.0
|
|
3782
4209
|
*/
|
|
3783
4210
|
export const formatIsoZoned: (self: Zoned) => string = Internal.formatIsoZoned
|
|
3784
4211
|
|
|
@@ -3787,7 +4214,8 @@ export const formatIsoZoned: (self: Zoned) => string = Internal.formatIsoZoned
|
|
|
3787
4214
|
*
|
|
3788
4215
|
* This layer provides the `CurrentTimeZone` service with the specified time zone.
|
|
3789
4216
|
*
|
|
3790
|
-
*
|
|
4217
|
+
* **Example** (Providing current time zone layers)
|
|
4218
|
+
*
|
|
3791
4219
|
* ```ts
|
|
3792
4220
|
* import { DateTime, Effect } from "effect"
|
|
3793
4221
|
*
|
|
@@ -3815,7 +4243,8 @@ export const layerCurrentZone: (resource: NoInfer<TimeZone>) => Layer.Layer<Curr
|
|
|
3815
4243
|
*
|
|
3816
4244
|
* This layer provides the `CurrentTimeZone` service with a fixed offset time zone.
|
|
3817
4245
|
*
|
|
3818
|
-
*
|
|
4246
|
+
* **Example** (Providing fixed-offset time zone layers)
|
|
4247
|
+
*
|
|
3819
4248
|
* ```ts
|
|
3820
4249
|
* import { DateTime, Effect } from "effect"
|
|
3821
4250
|
*
|
|
@@ -3842,7 +4271,8 @@ export const layerCurrentZoneOffset = (offset: number): Layer.Layer<CurrentTimeZ
|
|
|
3842
4271
|
* This layer provides the `CurrentTimeZone` service with a named time zone.
|
|
3843
4272
|
* If the time zone identifier is invalid, the layer will fail.
|
|
3844
4273
|
*
|
|
3845
|
-
*
|
|
4274
|
+
* **Example** (Providing named time zone layers)
|
|
4275
|
+
*
|
|
3846
4276
|
* ```ts
|
|
3847
4277
|
* import { DateTime, Effect } from "effect"
|
|
3848
4278
|
*
|
|
@@ -3870,7 +4300,8 @@ export const layerCurrentZoneNamed: (zoneId: string) => Layer.Layer<
|
|
|
3870
4300
|
* This layer provides the `CurrentTimeZone` service using the system's
|
|
3871
4301
|
* configured local time zone.
|
|
3872
4302
|
*
|
|
3873
|
-
*
|
|
4303
|
+
* **Example** (Providing local time zone layers)
|
|
4304
|
+
*
|
|
3874
4305
|
* ```ts
|
|
3875
4306
|
* import { DateTime, Effect } from "effect"
|
|
3876
4307
|
*
|