|
35 | 35 |
|
36 | 36 | /// A private environment key for storing the `OpenFileURLAction` in the |
37 | 37 | /// environment. |
| 38 | + @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) |
38 | 39 | private struct OpenFileURLKey: EnvironmentKey, Sendable { |
39 | 40 | typealias Value = OpenFileURLAction |
40 | 41 |
|
41 | 42 | static let defaultValue: OpenFileURLAction = .default |
42 | 43 | } |
43 | 44 |
|
44 | 45 | /// A type alias for opening windows with URL values. |
| 46 | + @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) |
45 | 47 | public typealias OpenWindowURLAction = OpenWindowWithValueAction<URL> |
46 | 48 |
|
47 | 49 | /// A type alias for opening files with URLs. |
| 50 | + @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) |
48 | 51 | public typealias OpenFileURLAction = OpenWindowURLAction |
49 | 52 |
|
50 | 53 | /// Environment values extension that provides access to the file URL opening |
51 | 54 | /// action. |
| 55 | + @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) |
52 | 56 | extension EnvironmentValues { |
53 | 57 | /// The action used to open file URLs in the current environment. |
54 | 58 | public var openFileURL: OpenFileURLAction { |
|
58 | 62 | } |
59 | 63 |
|
60 | 64 | /// Scene extension that provides file URL opening functionality. |
| 65 | + @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) |
61 | 66 | extension Scene { |
62 | 67 | /// Configures the scene to handle file URL opening. |
63 | 68 | /// - Parameter closure: A closure that handles the URL opening action, |
|
69 | 74 | } |
70 | 75 |
|
71 | 76 | /// View extension that provides file URL opening functionality. |
| 77 | + @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) |
72 | 78 | extension View { |
73 | 79 | /// Configures the view to handle file URL opening. |
74 | 80 | /// - Parameter closure: A closure that handles the URL opening action, |
|
0 commit comments