Skip to content

Commit 434591a

Browse files
authored
Update availability to be in sync with Clock/Instant/Duration (apple#159)
1 parent 6e9a575 commit 434591a

14 files changed

+36
-36
lines changed

Sources/AsyncAlgorithms/AsyncChunksOfCountOrSignalSequence.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,25 @@ extension AsyncSequence {
3131
}
3232

3333
/// Creates an asynchronous sequence that creates chunks of a given `RangeReplaceableCollection` type of a given count or when an `AsyncTimerSequence` fires.
34-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
34+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
3535
public func chunks<C: Clock, Collected: RangeReplaceableCollection>(ofCount count: Int, or timer: AsyncTimerSequence<C>, into: Collected.Type) -> AsyncChunksOfCountOrSignalSequence<Self, Collected, AsyncTimerSequence<C>> where Collected.Element == Element {
3636
AsyncChunksOfCountOrSignalSequence(self, count: count, signal: timer)
3737
}
3838

3939
/// Creates an asynchronous sequence that creates chunks of a given count or when an `AsyncTimerSequence` fires.
40-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
40+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
4141
public func chunks<C: Clock>(ofCount count: Int, or timer: AsyncTimerSequence<C>) -> AsyncChunksOfCountOrSignalSequence<Self, [Element], AsyncTimerSequence<C>> {
4242
chunks(ofCount: count, or: timer, into: [Element].self)
4343
}
4444

4545
/// Creates an asynchronous sequence that creates chunks of a given `RangeReplaceableCollection` type when an `AsyncTimerSequence` fires.
46-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
46+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
4747
public func chunked<C: Clock, Collected: RangeReplaceableCollection>(by timer: AsyncTimerSequence<C>, into: Collected.Type) -> AsyncChunksOfCountOrSignalSequence<Self, Collected, AsyncTimerSequence<C>> where Collected.Element == Element {
4848
AsyncChunksOfCountOrSignalSequence(self, count: nil, signal: timer)
4949
}
5050

5151
/// Creates an asynchronous sequence that creates chunks when an `AsyncTimerSequence` fires.
52-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
52+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
5353
public func chunked<C: Clock>(by timer: AsyncTimerSequence<C>) -> AsyncChunksOfCountOrSignalSequence<Self, [Element], AsyncTimerSequence<C>> {
5454
chunked(by: timer, into: [Element].self)
5555
}

Sources/AsyncAlgorithms/AsyncDebounceSequence.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@
1212
extension AsyncSequence {
1313
/// Creates an asynchronous sequence that emits the latest element after a given quiescence period
1414
/// has elapsed by using a specified Clock.
15-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
15+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
1616
public func debounce<C: Clock>(for interval: C.Instant.Duration, tolerance: C.Instant.Duration? = nil, clock: C) -> AsyncDebounceSequence<Self, C> {
1717
AsyncDebounceSequence(self, interval: interval, tolerance: tolerance, clock: clock)
1818
}
1919

2020
/// Creates an asynchronous sequence that emits the latest element after a given quiescence period
2121
/// has elapsed.
22-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
22+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
2323
public func debounce(for interval: Duration, tolerance: Duration? = nil) -> AsyncDebounceSequence<Self, ContinuousClock> {
2424
debounce(for: interval, tolerance: tolerance, clock: .continuous)
2525
}
2626
}
2727

2828
/// An `AsyncSequence` that emits the latest element after a given quiescence period
2929
/// has elapsed.
30-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
30+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
3131
public struct AsyncDebounceSequence<Base: AsyncSequence, C: Clock>: Sendable
3232
where Base.AsyncIterator: Sendable, Base.Element: Sendable, Base: Sendable {
3333
let base: Base
@@ -43,7 +43,7 @@ public struct AsyncDebounceSequence<Base: AsyncSequence, C: Clock>: Sendable
4343
}
4444
}
4545

46-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
46+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
4747
extension AsyncDebounceSequence: AsyncSequence {
4848
public typealias Element = Base.Element
4949

Sources/AsyncAlgorithms/AsyncThrottleSequence.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@
1111

1212
extension AsyncSequence {
1313
/// Create a rate-limited `AsyncSequence` by emitting values at most every specified interval.
14-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
14+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
1515
public func throttle<C: Clock, Reduced>(for interval: C.Instant.Duration, clock: C, reducing: @Sendable @escaping (Reduced?, Element) async -> Reduced) -> AsyncThrottleSequence<Self, C, Reduced> {
1616
AsyncThrottleSequence(self, interval: interval, clock: clock, reducing: reducing)
1717
}
1818

1919
/// Create a rate-limited `AsyncSequence` by emitting values at most every specified interval.
20-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
20+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
2121
public func throttle<Reduced>(for interval: Duration, reducing: @Sendable @escaping (Reduced?, Element) async -> Reduced) -> AsyncThrottleSequence<Self, ContinuousClock, Reduced> {
2222
throttle(for: interval, clock: .continuous, reducing: reducing)
2323
}
2424

2525
/// Create a rate-limited `AsyncSequence` by emitting values at most every specified interval.
26-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
26+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
2727
public func throttle<C: Clock>(for interval: C.Instant.Duration, clock: C, latest: Bool = true) -> AsyncThrottleSequence<Self, C, Element> {
2828
throttle(for: interval, clock: clock) { previous, element in
2929
if latest {
@@ -35,14 +35,14 @@ extension AsyncSequence {
3535
}
3636

3737
/// Create a rate-limited `AsyncSequence` by emitting values at most every specified interval.
38-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
38+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
3939
public func throttle(for interval: Duration, latest: Bool = true) -> AsyncThrottleSequence<Self, ContinuousClock, Element> {
4040
throttle(for: interval, clock: .continuous, latest: latest)
4141
}
4242
}
4343

4444
/// A rate-limited `AsyncSequence` by emitting values at most every specified interval.
45-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
45+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
4646
public struct AsyncThrottleSequence<Base: AsyncSequence, C: Clock, Reduced> {
4747
let base: Base
4848
let interval: C.Instant.Duration
@@ -57,7 +57,7 @@ public struct AsyncThrottleSequence<Base: AsyncSequence, C: Clock, Reduced> {
5757
}
5858
}
5959

60-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
60+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
6161
extension AsyncThrottleSequence: AsyncSequence {
6262
public typealias Element = Reduced
6363

@@ -100,8 +100,8 @@ extension AsyncThrottleSequence: AsyncSequence {
100100
}
101101
}
102102

103-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
103+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
104104
extension AsyncThrottleSequence: Sendable where Base: Sendable, Element: Sendable { }
105105

106-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
106+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
107107
extension AsyncThrottleSequence.Iterator: Sendable where Base.AsyncIterator: Sendable { }

Sources/AsyncAlgorithms/AsyncTimerSequence.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//===----------------------------------------------------------------------===//
1111

1212
/// An `AsyncSequence` that produces elements at regular intervals.
13-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
13+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
1414
public struct AsyncTimerSequence<C: Clock>: AsyncSequence {
1515
public typealias Element = C.Instant
1616

@@ -71,24 +71,24 @@ public struct AsyncTimerSequence<C: Clock>: AsyncSequence {
7171
}
7272
}
7373

74-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
74+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
7575
extension AsyncTimerSequence {
7676
/// Create an `AsyncTimerSequence` with a given repeating interval.
7777
public static func repeating(every interval: C.Instant.Duration, tolerance: C.Instant.Duration? = nil, clock: C) -> AsyncTimerSequence<C> {
7878
return AsyncTimerSequence(interval: interval, tolerance: tolerance, clock: clock)
7979
}
8080
}
8181

82-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
82+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
8383
extension AsyncTimerSequence where C == SuspendingClock {
8484
/// Create an `AsyncTimerSequence` with a given repeating interval.
8585
public static func repeating(every interval: Duration, tolerance: Duration? = nil) -> AsyncTimerSequence<SuspendingClock> {
8686
return AsyncTimerSequence(interval: interval, tolerance: tolerance, clock: SuspendingClock())
8787
}
8888
}
8989

90-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
90+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
9191
extension AsyncTimerSequence: Sendable { }
9292

93-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
93+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
9494
extension AsyncTimerSequence.Iterator: Sendable { }

Sources/AsyncSequenceValidation/AsyncSequenceValidationDiagram.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
import _CAsyncSequenceValidationSupport
1313

14-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
14+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
1515
@resultBuilder
1616
public struct AsyncSequenceValidationDiagram : Sendable {
1717
public struct Component<T> {

Sources/AsyncSequenceValidation/Clock.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
import AsyncAlgorithms
1313

14-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
14+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
1515
extension AsyncSequenceValidationDiagram {
1616
public struct Clock {
1717
let queue: WorkQueue
@@ -22,7 +22,7 @@ extension AsyncSequenceValidationDiagram {
2222
}
2323
}
2424

25-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
25+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
2626
extension AsyncSequenceValidationDiagram.Clock: Clock {
2727
public struct Step: DurationProtocol, Hashable, CustomStringConvertible {
2828
internal var rawValue: Int

Sources/AsyncSequenceValidation/Event.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
12+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
1313
extension AsyncSequenceValidationDiagram {
1414
struct Failure: Error, Equatable { }
1515

Sources/AsyncSequenceValidation/Expectation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
12+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
1313
extension AsyncSequenceValidationDiagram {
1414
public struct ExpectationResult: Sendable {
1515
public struct Event: Sendable {

Sources/AsyncSequenceValidation/Input.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
12+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
1313
extension AsyncSequenceValidationDiagram {
1414
public struct Specification: Sendable {
1515
public let specification: String

Sources/AsyncSequenceValidation/Job.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
import _CAsyncSequenceValidationSupport
1313

14-
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
14+
@available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *)
1515
struct Job: Hashable, @unchecked Sendable {
1616
let job: JobRef
1717

0 commit comments

Comments
 (0)