@shortkitsdk/react-native 0.2.31 → 0.2.32
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/android/libs/shortkit-release.aar +0 -0
- package/ios/ShortKitBridge.swift +77 -3
- package/ios/ShortKitModule.mm +5 -1
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Info.plist +2 -2
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.abi.json +1130 -142
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +35 -2
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios.swiftinterface +35 -2
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/ShortKitSDK +0 -0
- package/ios/ShortKitSDK.xcframework/ios-arm64/ShortKitSDK.framework/_CodeSignature/CodeResources +9 -9
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Info.plist +2 -2
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +1130 -142
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +35 -2
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +35 -2
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +1130 -142
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +35 -2
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +35 -2
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/ShortKitSDK +0 -0
- package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/_CodeSignature/CodeResources +17 -17
- package/package.json +1 -1
- package/src/ShortKitCommands.ts +12 -2
- package/src/ShortKitContext.ts +7 -1
- package/src/specs/NativeShortKitModule.ts +2 -1
- package/src/types.ts +4 -0
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
import AVFoundation
|
|
6
6
|
import Combine
|
|
7
7
|
import CoreGraphics
|
|
8
|
+
import CoreImage
|
|
9
|
+
import CoreMedia
|
|
10
|
+
import CoreVideo
|
|
8
11
|
import Foundation
|
|
9
12
|
import Network
|
|
10
13
|
import QuartzCore
|
|
@@ -459,17 +462,29 @@ extension ShortKitSDK.ShortKitDelegate {
|
|
|
459
462
|
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didTapContent contentId: Swift.String, at index: Swift.Int)
|
|
460
463
|
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didFetchContentItems items: [ShortKitSDK.ContentItem])
|
|
461
464
|
}
|
|
465
|
+
public enum DownloadPhase : Swift.String, Swift.Sendable {
|
|
466
|
+
case downloading
|
|
467
|
+
case compositing
|
|
468
|
+
case finalizing
|
|
469
|
+
public init?(rawValue: Swift.String)
|
|
470
|
+
public typealias RawValue = Swift.String
|
|
471
|
+
public var rawValue: Swift.String {
|
|
472
|
+
get
|
|
473
|
+
}
|
|
474
|
+
}
|
|
462
475
|
public protocol ShortKitDownloadDelegate : AnyObject {
|
|
463
476
|
func shortKit(_ shortKit: ShortKitSDK.ShortKit, didStartDownload item: ShortKitSDK.ContentItem)
|
|
464
477
|
func shortKit(_ shortKit: ShortKitSDK.ShortKit, didUpdateDownloadProgress item: ShortKitSDK.ContentItem, progress: Swift.Double)
|
|
465
478
|
func shortKit(_ shortKit: ShortKitSDK.ShortKit, didCompleteDownload item: ShortKitSDK.ContentItem, fileURL: Foundation.URL)
|
|
466
479
|
func shortKit(_ shortKit: ShortKitSDK.ShortKit, didFailDownload item: ShortKitSDK.ContentItem, error: ShortKitSDK.ShortKitDownloadError)
|
|
480
|
+
func shortKit(_ shortKit: ShortKitSDK.ShortKit, didUpdateDownloadProgress item: ShortKitSDK.ContentItem, progress: Swift.Double, phase: ShortKitSDK.DownloadPhase)
|
|
467
481
|
}
|
|
468
482
|
extension ShortKitSDK.ShortKitDownloadDelegate {
|
|
469
483
|
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didStartDownload item: ShortKitSDK.ContentItem)
|
|
470
484
|
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didUpdateDownloadProgress item: ShortKitSDK.ContentItem, progress: Swift.Double)
|
|
471
485
|
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didCompleteDownload item: ShortKitSDK.ContentItem, fileURL: Foundation.URL)
|
|
472
486
|
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didFailDownload item: ShortKitSDK.ContentItem, error: ShortKitSDK.ShortKitDownloadError)
|
|
487
|
+
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didUpdateDownloadProgress item: ShortKitSDK.ContentItem, progress: Swift.Double, phase: ShortKitSDK.DownloadPhase)
|
|
473
488
|
}
|
|
474
489
|
public enum DownloadMode {
|
|
475
490
|
case nonInterruptive
|
|
@@ -480,12 +495,26 @@ public enum DownloadMode {
|
|
|
480
495
|
get
|
|
481
496
|
}
|
|
482
497
|
}
|
|
483
|
-
public enum
|
|
498
|
+
public enum DownloadOverlayMode {
|
|
499
|
+
case none
|
|
500
|
+
case staticSnapshot(source: any UIKit.UIView & ShortKitSDK.FeedOverlay)
|
|
501
|
+
}
|
|
502
|
+
public protocol ExportableFeedOverlay : AnyObject {
|
|
503
|
+
func prepareForExport(duration: Foundation.TimeInterval, size: CoreFoundation.CGSize) async
|
|
504
|
+
func snapshotAtTime(_ time: Foundation.TimeInterval) async -> UIKit.UIImage?
|
|
505
|
+
func tearDownAfterExport()
|
|
506
|
+
}
|
|
507
|
+
public enum ShortKitDownloadError : Swift.Error, Foundation.LocalizedError {
|
|
484
508
|
case downloadNotAvailable
|
|
485
509
|
case downloadInProgress
|
|
486
510
|
case networkError(any Swift.Error)
|
|
487
511
|
case httpError(statusCode: Swift.Int)
|
|
488
512
|
case cancelled
|
|
513
|
+
case exportFailed(underlying: any Swift.Error)
|
|
514
|
+
case overlayNotVisibleForSnapshot
|
|
515
|
+
public var errorDescription: Swift.String? {
|
|
516
|
+
get
|
|
517
|
+
}
|
|
489
518
|
}
|
|
490
519
|
@_hasMissingDesignatedInitializers final public class FeedPreload : @unchecked Swift.Sendable {
|
|
491
520
|
public init(immediateItems items: [ShortKitSDK.FeedInput])
|
|
@@ -553,6 +582,7 @@ public enum ShortKitFeedLifecycle {
|
|
|
553
582
|
@objc get
|
|
554
583
|
}
|
|
555
584
|
@_Concurrency.MainActor @preconcurrency @objc override dynamic public func motionEnded(_ motion: UIKit.UIEvent.EventSubtype, with event: UIKit.UIEvent?)
|
|
585
|
+
@_Concurrency.MainActor @preconcurrency public func overlayView(forItemId itemId: Swift.String) -> (any UIKit.UIView & ShortKitSDK.FeedOverlay)?
|
|
556
586
|
}
|
|
557
587
|
extension ShortKitSDK.ShortKitFeedViewController : UIKit.UICollectionViewDelegate {
|
|
558
588
|
@_Concurrency.MainActor @preconcurrency @objc dynamic public func collectionView(_ collectionView: UIKit.UICollectionView, willDisplay cell: UIKit.UICollectionViewCell, forItemAt indexPath: Foundation.IndexPath)
|
|
@@ -1171,7 +1201,7 @@ final public class ShortKit {
|
|
|
1171
1201
|
final public func clearUserId()
|
|
1172
1202
|
@_Concurrency.MainActor final public func setColdStartQueue(_ items: [ShortKitSDK.FeedInput])
|
|
1173
1203
|
final public func clearColdStartCache()
|
|
1174
|
-
final public func downloadVideo(_ item: ShortKitSDK.ContentItem, mode: ShortKitSDK.DownloadMode = .nonInterruptive) async throws -> Foundation.URL
|
|
1204
|
+
final public func downloadVideo(_ item: ShortKitSDK.ContentItem, mode: ShortKitSDK.DownloadMode = .nonInterruptive, overlayMode: ShortKitSDK.DownloadOverlayMode = .none) async throws -> Foundation.URL
|
|
1175
1205
|
final public func cancelDownload()
|
|
1176
1206
|
@objc deinit
|
|
1177
1207
|
}
|
|
@@ -1274,6 +1304,9 @@ extension ShortKitSDK.DebugTimeControl : Swift.Hashable {}
|
|
|
1274
1304
|
extension ShortKitSDK.SwipeCurve : Swift.Equatable {}
|
|
1275
1305
|
extension ShortKitSDK.SwipeCurve : Swift.Hashable {}
|
|
1276
1306
|
extension ShortKitSDK.SwipeCurve : Swift.RawRepresentable {}
|
|
1307
|
+
extension ShortKitSDK.DownloadPhase : Swift.Equatable {}
|
|
1308
|
+
extension ShortKitSDK.DownloadPhase : Swift.Hashable {}
|
|
1309
|
+
extension ShortKitSDK.DownloadPhase : Swift.RawRepresentable {}
|
|
1277
1310
|
extension ShortKitSDK.DownloadMode : Swift.Equatable {}
|
|
1278
1311
|
extension ShortKitSDK.DownloadMode : Swift.Hashable {}
|
|
1279
1312
|
extension ShortKitSDK.ShortKitFeedView : Swift.Sendable {}
|
|
Binary file
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
import AVFoundation
|
|
6
6
|
import Combine
|
|
7
7
|
import CoreGraphics
|
|
8
|
+
import CoreImage
|
|
9
|
+
import CoreMedia
|
|
10
|
+
import CoreVideo
|
|
8
11
|
import Foundation
|
|
9
12
|
import Network
|
|
10
13
|
import QuartzCore
|
|
@@ -459,17 +462,29 @@ extension ShortKitSDK.ShortKitDelegate {
|
|
|
459
462
|
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didTapContent contentId: Swift.String, at index: Swift.Int)
|
|
460
463
|
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didFetchContentItems items: [ShortKitSDK.ContentItem])
|
|
461
464
|
}
|
|
465
|
+
public enum DownloadPhase : Swift.String, Swift.Sendable {
|
|
466
|
+
case downloading
|
|
467
|
+
case compositing
|
|
468
|
+
case finalizing
|
|
469
|
+
public init?(rawValue: Swift.String)
|
|
470
|
+
public typealias RawValue = Swift.String
|
|
471
|
+
public var rawValue: Swift.String {
|
|
472
|
+
get
|
|
473
|
+
}
|
|
474
|
+
}
|
|
462
475
|
public protocol ShortKitDownloadDelegate : AnyObject {
|
|
463
476
|
func shortKit(_ shortKit: ShortKitSDK.ShortKit, didStartDownload item: ShortKitSDK.ContentItem)
|
|
464
477
|
func shortKit(_ shortKit: ShortKitSDK.ShortKit, didUpdateDownloadProgress item: ShortKitSDK.ContentItem, progress: Swift.Double)
|
|
465
478
|
func shortKit(_ shortKit: ShortKitSDK.ShortKit, didCompleteDownload item: ShortKitSDK.ContentItem, fileURL: Foundation.URL)
|
|
466
479
|
func shortKit(_ shortKit: ShortKitSDK.ShortKit, didFailDownload item: ShortKitSDK.ContentItem, error: ShortKitSDK.ShortKitDownloadError)
|
|
480
|
+
func shortKit(_ shortKit: ShortKitSDK.ShortKit, didUpdateDownloadProgress item: ShortKitSDK.ContentItem, progress: Swift.Double, phase: ShortKitSDK.DownloadPhase)
|
|
467
481
|
}
|
|
468
482
|
extension ShortKitSDK.ShortKitDownloadDelegate {
|
|
469
483
|
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didStartDownload item: ShortKitSDK.ContentItem)
|
|
470
484
|
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didUpdateDownloadProgress item: ShortKitSDK.ContentItem, progress: Swift.Double)
|
|
471
485
|
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didCompleteDownload item: ShortKitSDK.ContentItem, fileURL: Foundation.URL)
|
|
472
486
|
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didFailDownload item: ShortKitSDK.ContentItem, error: ShortKitSDK.ShortKitDownloadError)
|
|
487
|
+
public func shortKit(_ shortKit: ShortKitSDK.ShortKit, didUpdateDownloadProgress item: ShortKitSDK.ContentItem, progress: Swift.Double, phase: ShortKitSDK.DownloadPhase)
|
|
473
488
|
}
|
|
474
489
|
public enum DownloadMode {
|
|
475
490
|
case nonInterruptive
|
|
@@ -480,12 +495,26 @@ public enum DownloadMode {
|
|
|
480
495
|
get
|
|
481
496
|
}
|
|
482
497
|
}
|
|
483
|
-
public enum
|
|
498
|
+
public enum DownloadOverlayMode {
|
|
499
|
+
case none
|
|
500
|
+
case staticSnapshot(source: any UIKit.UIView & ShortKitSDK.FeedOverlay)
|
|
501
|
+
}
|
|
502
|
+
public protocol ExportableFeedOverlay : AnyObject {
|
|
503
|
+
func prepareForExport(duration: Foundation.TimeInterval, size: CoreFoundation.CGSize) async
|
|
504
|
+
func snapshotAtTime(_ time: Foundation.TimeInterval) async -> UIKit.UIImage?
|
|
505
|
+
func tearDownAfterExport()
|
|
506
|
+
}
|
|
507
|
+
public enum ShortKitDownloadError : Swift.Error, Foundation.LocalizedError {
|
|
484
508
|
case downloadNotAvailable
|
|
485
509
|
case downloadInProgress
|
|
486
510
|
case networkError(any Swift.Error)
|
|
487
511
|
case httpError(statusCode: Swift.Int)
|
|
488
512
|
case cancelled
|
|
513
|
+
case exportFailed(underlying: any Swift.Error)
|
|
514
|
+
case overlayNotVisibleForSnapshot
|
|
515
|
+
public var errorDescription: Swift.String? {
|
|
516
|
+
get
|
|
517
|
+
}
|
|
489
518
|
}
|
|
490
519
|
@_hasMissingDesignatedInitializers final public class FeedPreload : @unchecked Swift.Sendable {
|
|
491
520
|
public init(immediateItems items: [ShortKitSDK.FeedInput])
|
|
@@ -553,6 +582,7 @@ public enum ShortKitFeedLifecycle {
|
|
|
553
582
|
@objc get
|
|
554
583
|
}
|
|
555
584
|
@_Concurrency.MainActor @preconcurrency @objc override dynamic public func motionEnded(_ motion: UIKit.UIEvent.EventSubtype, with event: UIKit.UIEvent?)
|
|
585
|
+
@_Concurrency.MainActor @preconcurrency public func overlayView(forItemId itemId: Swift.String) -> (any UIKit.UIView & ShortKitSDK.FeedOverlay)?
|
|
556
586
|
}
|
|
557
587
|
extension ShortKitSDK.ShortKitFeedViewController : UIKit.UICollectionViewDelegate {
|
|
558
588
|
@_Concurrency.MainActor @preconcurrency @objc dynamic public func collectionView(_ collectionView: UIKit.UICollectionView, willDisplay cell: UIKit.UICollectionViewCell, forItemAt indexPath: Foundation.IndexPath)
|
|
@@ -1171,7 +1201,7 @@ final public class ShortKit {
|
|
|
1171
1201
|
final public func clearUserId()
|
|
1172
1202
|
@_Concurrency.MainActor final public func setColdStartQueue(_ items: [ShortKitSDK.FeedInput])
|
|
1173
1203
|
final public func clearColdStartCache()
|
|
1174
|
-
final public func downloadVideo(_ item: ShortKitSDK.ContentItem, mode: ShortKitSDK.DownloadMode = .nonInterruptive) async throws -> Foundation.URL
|
|
1204
|
+
final public func downloadVideo(_ item: ShortKitSDK.ContentItem, mode: ShortKitSDK.DownloadMode = .nonInterruptive, overlayMode: ShortKitSDK.DownloadOverlayMode = .none) async throws -> Foundation.URL
|
|
1175
1205
|
final public func cancelDownload()
|
|
1176
1206
|
@objc deinit
|
|
1177
1207
|
}
|
|
@@ -1274,6 +1304,9 @@ extension ShortKitSDK.DebugTimeControl : Swift.Hashable {}
|
|
|
1274
1304
|
extension ShortKitSDK.SwipeCurve : Swift.Equatable {}
|
|
1275
1305
|
extension ShortKitSDK.SwipeCurve : Swift.Hashable {}
|
|
1276
1306
|
extension ShortKitSDK.SwipeCurve : Swift.RawRepresentable {}
|
|
1307
|
+
extension ShortKitSDK.DownloadPhase : Swift.Equatable {}
|
|
1308
|
+
extension ShortKitSDK.DownloadPhase : Swift.Hashable {}
|
|
1309
|
+
extension ShortKitSDK.DownloadPhase : Swift.RawRepresentable {}
|
|
1277
1310
|
extension ShortKitSDK.DownloadMode : Swift.Equatable {}
|
|
1278
1311
|
extension ShortKitSDK.DownloadMode : Swift.Hashable {}
|
|
1279
1312
|
extension ShortKitSDK.ShortKitFeedView : Swift.Sendable {}
|
package/ios/ShortKitSDK.xcframework/ios-arm64_x86_64-simulator/ShortKitSDK.framework/ShortKitSDK
CHANGED
|
Binary file
|
|
@@ -10,39 +10,39 @@
|
|
|
10
10
|
</data>
|
|
11
11
|
<key>Info.plist</key>
|
|
12
12
|
<data>
|
|
13
|
-
|
|
13
|
+
c83UUfp8vl8OKNZgemM5Ckeupdw=
|
|
14
14
|
</data>
|
|
15
15
|
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.abi.json</key>
|
|
16
16
|
<data>
|
|
17
|
-
|
|
17
|
+
YIhDAI7GfkS3Bw8cCovcAQ/5bkc=
|
|
18
18
|
</data>
|
|
19
19
|
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
|
|
20
20
|
<data>
|
|
21
|
-
|
|
21
|
+
jVb2+supqwkO14hFF9JSxbmcFUI=
|
|
22
22
|
</data>
|
|
23
23
|
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
|
|
24
24
|
<data>
|
|
25
|
-
|
|
25
|
+
FQPcCHhpOilSUl89AxPXIKCLN/E=
|
|
26
26
|
</data>
|
|
27
27
|
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
|
|
28
28
|
<data>
|
|
29
|
-
|
|
29
|
+
jVb2+supqwkO14hFF9JSxbmcFUI=
|
|
30
30
|
</data>
|
|
31
31
|
<key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
|
|
32
32
|
<data>
|
|
33
|
-
|
|
33
|
+
YIhDAI7GfkS3Bw8cCovcAQ/5bkc=
|
|
34
34
|
</data>
|
|
35
35
|
<key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
|
|
36
36
|
<data>
|
|
37
|
-
|
|
37
|
+
lr+Br5j/UDEGV7GBxg48gH/rncc=
|
|
38
38
|
</data>
|
|
39
39
|
<key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
|
|
40
40
|
<data>
|
|
41
|
-
|
|
41
|
+
rTbauAd6wfGmUohCAGP+wwgmsNc=
|
|
42
42
|
</data>
|
|
43
43
|
<key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
|
|
44
44
|
<data>
|
|
45
|
-
|
|
45
|
+
lr+Br5j/UDEGV7GBxg48gH/rncc=
|
|
46
46
|
</data>
|
|
47
47
|
<key>Modules/module.modulemap</key>
|
|
48
48
|
<data>
|
|
@@ -66,56 +66,56 @@
|
|
|
66
66
|
<dict>
|
|
67
67
|
<key>hash2</key>
|
|
68
68
|
<data>
|
|
69
|
-
|
|
69
|
+
v/uw62M6gyB+9mO/YoZTKs+xDZr5p0ehAwX9vFBOrA0=
|
|
70
70
|
</data>
|
|
71
71
|
</dict>
|
|
72
72
|
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface</key>
|
|
73
73
|
<dict>
|
|
74
74
|
<key>hash2</key>
|
|
75
75
|
<data>
|
|
76
|
-
|
|
76
|
+
rxdNx/TSUVd/Pd8Fok5Kgwj/fUtUaq0HgqKC4JVJUx0=
|
|
77
77
|
</data>
|
|
78
78
|
</dict>
|
|
79
79
|
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc</key>
|
|
80
80
|
<dict>
|
|
81
81
|
<key>hash2</key>
|
|
82
82
|
<data>
|
|
83
|
-
|
|
83
|
+
khqs3UMVZ5tpEkBvJa5S2d3uTs80aVX+io6b4/TDNPE=
|
|
84
84
|
</data>
|
|
85
85
|
</dict>
|
|
86
86
|
<key>Modules/ShortKitSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface</key>
|
|
87
87
|
<dict>
|
|
88
88
|
<key>hash2</key>
|
|
89
89
|
<data>
|
|
90
|
-
|
|
90
|
+
rxdNx/TSUVd/Pd8Fok5Kgwj/fUtUaq0HgqKC4JVJUx0=
|
|
91
91
|
</data>
|
|
92
92
|
</dict>
|
|
93
93
|
<key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json</key>
|
|
94
94
|
<dict>
|
|
95
95
|
<key>hash2</key>
|
|
96
96
|
<data>
|
|
97
|
-
|
|
97
|
+
v/uw62M6gyB+9mO/YoZTKs+xDZr5p0ehAwX9vFBOrA0=
|
|
98
98
|
</data>
|
|
99
99
|
</dict>
|
|
100
100
|
<key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface</key>
|
|
101
101
|
<dict>
|
|
102
102
|
<key>hash2</key>
|
|
103
103
|
<data>
|
|
104
|
-
|
|
104
|
+
o9sGqAin0CW2u4q6wc85avBuxWQyEOnzzDME35fQ3ZY=
|
|
105
105
|
</data>
|
|
106
106
|
</dict>
|
|
107
107
|
<key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
|
|
108
108
|
<dict>
|
|
109
109
|
<key>hash2</key>
|
|
110
110
|
<data>
|
|
111
|
-
|
|
111
|
+
HACqT0qILr02nDrz4hMSwIx1+67UnBeq1ote6RrUXWs=
|
|
112
112
|
</data>
|
|
113
113
|
</dict>
|
|
114
114
|
<key>Modules/ShortKitSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface</key>
|
|
115
115
|
<dict>
|
|
116
116
|
<key>hash2</key>
|
|
117
117
|
<data>
|
|
118
|
-
|
|
118
|
+
o9sGqAin0CW2u4q6wc85avBuxWQyEOnzzDME35fQ3ZY=
|
|
119
119
|
</data>
|
|
120
120
|
</dict>
|
|
121
121
|
<key>Modules/module.modulemap</key>
|
package/package.json
CHANGED
package/src/ShortKitCommands.ts
CHANGED
|
@@ -32,7 +32,17 @@ export const ShortKitCommands = {
|
|
|
32
32
|
NativeShortKitModule?.prefetchStoryboard(playbackId),
|
|
33
33
|
getStoryboardData: (playbackId: string): Promise<string | null> =>
|
|
34
34
|
NativeShortKitModule?.getStoryboardData(playbackId) ?? Promise.resolve(null),
|
|
35
|
-
downloadVideo: (
|
|
36
|
-
|
|
35
|
+
downloadVideo: (
|
|
36
|
+
itemId: string,
|
|
37
|
+
options?: {
|
|
38
|
+
mode?: 'interruptive' | 'nonInterruptive';
|
|
39
|
+
overlayMode?: 'none' | 'static' | 'deterministic';
|
|
40
|
+
}
|
|
41
|
+
): Promise<string> => {
|
|
42
|
+
const mode = options?.mode ?? 'nonInterruptive';
|
|
43
|
+
const overlayMode = options?.overlayMode ?? 'none';
|
|
44
|
+
return NativeShortKitModule?.downloadVideo(itemId, mode, overlayMode)
|
|
45
|
+
?? Promise.reject(new Error('ShortKit not initialized'));
|
|
46
|
+
},
|
|
37
47
|
cancelDownload: () => NativeShortKitModule?.cancelDownload(),
|
|
38
48
|
} as const;
|
package/src/ShortKitContext.ts
CHANGED
|
@@ -55,7 +55,13 @@ export interface ShortKitContextValue {
|
|
|
55
55
|
|
|
56
56
|
// Download
|
|
57
57
|
downloadState: DownloadState;
|
|
58
|
-
downloadVideo: (
|
|
58
|
+
downloadVideo: (
|
|
59
|
+
itemId: string,
|
|
60
|
+
options?: {
|
|
61
|
+
mode?: 'interruptive' | 'nonInterruptive';
|
|
62
|
+
overlayMode?: 'none' | 'static' | 'deterministic';
|
|
63
|
+
}
|
|
64
|
+
) => Promise<string>;
|
|
59
65
|
cancelDownload: () => void;
|
|
60
66
|
}
|
|
61
67
|
|
|
@@ -140,6 +140,7 @@ type DownloadStartedEvent = Readonly<{
|
|
|
140
140
|
type DownloadProgressEvent = Readonly<{
|
|
141
141
|
itemId: string;
|
|
142
142
|
progress: number;
|
|
143
|
+
phase: 'downloading' | 'compositing' | 'finalizing';
|
|
143
144
|
}>;
|
|
144
145
|
|
|
145
146
|
type DownloadCompletedEvent = Readonly<{
|
|
@@ -306,7 +307,7 @@ export interface Spec extends TurboModule {
|
|
|
306
307
|
getStoryboardData(playbackId: string): Promise<string>;
|
|
307
308
|
|
|
308
309
|
// --- Download ---
|
|
309
|
-
downloadVideo(itemId: string, mode: string): Promise<string>;
|
|
310
|
+
downloadVideo(itemId: string, mode: string, overlayMode: string): Promise<string>;
|
|
310
311
|
cancelDownload(): void;
|
|
311
312
|
|
|
312
313
|
// --- Carousel accessors ---
|
package/src/types.ts
CHANGED
|
@@ -73,6 +73,10 @@ export interface ContentItem {
|
|
|
73
73
|
|
|
74
74
|
export type DownloadStatus = 'idle' | 'downloading' | 'completed' | 'failed';
|
|
75
75
|
|
|
76
|
+
export type DownloadOverlayMode = 'none' | 'static' | 'deterministic';
|
|
77
|
+
|
|
78
|
+
export type DownloadPhase = 'downloading' | 'compositing' | 'finalizing';
|
|
79
|
+
|
|
76
80
|
export interface DownloadState {
|
|
77
81
|
status: DownloadStatus;
|
|
78
82
|
/** ID of the content item being downloaded, if any. */
|