peachsim 0.1.2428 → 0.1.2429
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-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +173 -66
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +2 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +163 -56
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +181 -74
- package/dist-lib/host/fetch-proxy-handler.cjs +6 -6
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +9 -6
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +9 -6
- package/dist-lib/native-app-identity-project.cjs +6 -3
- package/dist-lib/native-app-identity-project.mjs +6 -3
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +24 -24
- package/dist-lib/public-origins-lib.json +53 -53
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +194 -85
- package/dist-lib/swift-compile.cjs +35 -22
- package/dist-lib/swift-compile.mjs +35 -22
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +159 -52
- package/dist-lib/vite.cjs +6 -6
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +2 -2
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +7 -0
- package/dist-types/packages/peach-globals/src/globalsContract.d.ts +2 -0
- package/dist-types/packages/peach-globals/src/index.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/locationBridgeContract.d.ts +20 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/CoreData.h +3 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSEntityMigrationPolicy.h +17 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObject.h +2 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObjectContext.h +6 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentContainer.h +15 -0
- package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentStoreDescription.h +10 -0
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManagerDelegate.h +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreServices.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSBase.h +28 -0
- package/sdk/ios/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSImportExtension.h +21 -0
- package/sdk/ios/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSIndexExtensionRequestHandler.h +17 -0
- package/sdk/ios/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSPerson.h +28 -0
- package/sdk/ios/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchQuery.h +77 -0
- package/sdk/ios/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchableIndex.h +154 -0
- package/sdk/ios/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchableIndexDescription.h +19 -0
- package/sdk/ios/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchableItem.h +86 -0
- package/sdk/ios/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchableItemAttributeSet.h +95 -0
- package/sdk/ios/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchableItemAttributeSet_Categories.h +19 -0
- package/sdk/ios/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchableItemAttributeSet_Documents.h +71 -0
- package/sdk/ios/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchableItemAttributeSet_Events.h +34 -0
- package/sdk/ios/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchableItemAttributeSet_General.h +138 -0
- package/sdk/ios/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchableItemAttributeSet_Images.h +116 -0
- package/sdk/ios/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchableItemAttributeSet_Media.h +235 -0
- package/sdk/ios/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchableItemAttributeSet_Messaging.h +99 -0
- package/sdk/ios/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSearchableItemAttributeSet_Places.h +96 -0
- package/sdk/ios/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSSuggestion.h +37 -0
- package/sdk/ios/System/Library/Frameworks/CoreSpotlight.framework/Headers/CSUserQuery.h +73 -0
- package/sdk/ios/System/Library/Frameworks/CoreSpotlight.framework/Headers/CoreSpotlight.apinotes +26 -0
- package/sdk/ios/System/Library/Frameworks/CoreSpotlight.framework/Headers/CoreSpotlight.h +29 -0
- package/sdk/ios/System/Library/Frameworks/CoreSpotlight.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIScrollView.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationSettings.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNUserNotificationCenter.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKBackForwardList.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKBackForwardListItem.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKContentRuleList.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKContentRuleListStore.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKContentWorld.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKContentWorldConfiguration.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKContextMenuElementInfo.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKDOMNodeSnapshot.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKDownload.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKFindConfiguration.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKFindResult.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKFormInfo.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKFrameInfo.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKHTTPCookieStore.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKJSHandle.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKNavigation.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKNavigationAction.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKNavigationResponse.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKOpenPanelParameters.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKPDFConfiguration.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKPreferences.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKPreviewElementInfo.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKProcessPool.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKScriptMessage.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKSecurityOrigin.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKSnapshotConfiguration.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKUserContentController.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKUserScript.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKWebExtension.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKWebExtensionContext.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKWebExtensionController.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKWebExtensionControllerConfiguration.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKWebExtensionMatchPattern.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKWebView.h +2 -2
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKWebViewConfiguration.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKWebpagePreferences.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKWebsiteDataRecord.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKWebsiteDataStore.h +1 -1
- package/sdk/ios/System/Library/Frameworks/WebKit.framework/Headers/WKWindowFeatures.h +1 -1
- package/sdk/ios/System/Library/Frameworks/_LocationEssentials.framework/Headers/CLLocationEssentials.h +3 -3
- package/src/core-data-model.ts +112 -5
- package/src/swift-compile.ts +34 -11
- package/src/swift-objc-import.ts +19 -13
- package/src/xcode-project.ts +5 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface SootSimLocationFix {
|
|
2
|
+
latitude: number;
|
|
3
|
+
longitude: number;
|
|
4
|
+
altitude?: number;
|
|
5
|
+
accuracy?: number;
|
|
6
|
+
heading?: number;
|
|
7
|
+
speed?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface SootSimLocationResult {
|
|
10
|
+
ok: boolean;
|
|
11
|
+
source: 'custom' | 'default';
|
|
12
|
+
fix?: SootSimLocationFix;
|
|
13
|
+
error?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface SootSimLocationBridge {
|
|
16
|
+
get(): SootSimLocationResult;
|
|
17
|
+
set(fix: SootSimLocationFix): SootSimLocationResult;
|
|
18
|
+
clear(): SootSimLocationResult;
|
|
19
|
+
subscribe(listener: (status: SootSimLocationResult) => void): () => void;
|
|
20
|
+
}
|
package/package.json
CHANGED
package/runtime-companion.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"abi":1,"sha256":"
|
|
1
|
+
{"abi":1,"sha256":"c3e71b5eaf9166fc3fdc4333c354332e1ff41e1a6c71b6814afebe7c7d14bf9b","file":"node/cli-c3e71b5eaf9166fc3fdc4333c354332e1ff41e1a6c71b6814afebe7c7d14bf9b.cjs"}
|
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
#import <CoreData/NSExpressionDescription.h>
|
|
11
11
|
#import <CoreData/NSFetchIndexDescription.h>
|
|
12
12
|
#import <CoreData/NSFetchIndexElementDescription.h>
|
|
13
|
+
#import <CoreData/NSEntityMigrationPolicy.h>
|
|
13
14
|
#import <CoreData/NSMergePolicy.h>
|
|
14
15
|
#import <CoreData/NSFetchRequest.h>
|
|
15
16
|
#import <CoreData/NSFetchedResultsController.h>
|
|
17
|
+
#import <CoreData/NSPersistentStoreDescription.h>
|
|
18
|
+
#import <CoreData/NSPersistentContainer.h>
|
package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSEntityMigrationPolicy.h
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
#import <Foundation/Foundation.h>
|
|
3
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
4
|
+
@class NSManagedObject;
|
|
5
|
+
@class NSEntityMapping;
|
|
6
|
+
@class NSMigrationManager;
|
|
7
|
+
__attribute__((availability(ios,introduced=3.0)))
|
|
8
|
+
PEACH_SWIFT_CLASS(CoreData) @interface NSEntityMigrationPolicy : NSObject
|
|
9
|
+
- (BOOL)beginEntityMapping:(NSEntityMapping *)mapping manager:(NSMigrationManager *)manager error:(NSError **)error;
|
|
10
|
+
- (BOOL)createDestinationInstancesForSourceInstance:(NSManagedObject *)sInstance entityMapping:(NSEntityMapping *)mapping manager:(NSMigrationManager *)manager error:(NSError **)error;
|
|
11
|
+
- (BOOL)endInstanceCreationForEntityMapping:(NSEntityMapping *)mapping manager:(NSMigrationManager *)manager error:(NSError **)error;
|
|
12
|
+
- (BOOL)createRelationshipsForDestinationInstance:(NSManagedObject *)dInstance entityMapping:(NSEntityMapping *)mapping manager:(NSMigrationManager *)manager error:(NSError **)error;
|
|
13
|
+
- (BOOL)endRelationshipCreationForEntityMapping:(NSEntityMapping *)mapping manager:(NSMigrationManager *)manager error:(NSError **)error;
|
|
14
|
+
- (BOOL)performCustomValidationForEntityMapping:(NSEntityMapping *)mapping manager:(NSMigrationManager *)manager error:(NSError **)error;
|
|
15
|
+
- (BOOL)endEntityMapping:(NSEntityMapping *)mapping manager:(NSMigrationManager *)manager error:(NSError **)error;
|
|
16
|
+
@end
|
|
17
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
NS_ASSUME_NONNULL_BEGIN
|
|
7
7
|
__attribute__((availability(ios,introduced=3.0))) NS_SWIFT_NONISOLATED NS_SWIFT_NONSENDABLE __attribute__((objc_requires_property_definitions))
|
|
8
8
|
PEACH_SWIFT_CLASS(CoreData) @interface NSManagedObject : NSObject
|
|
9
|
+
- (__kindof NSManagedObject *)initWithEntity:(NSEntityDescription *)entity insertIntoManagedObjectContext:(nullable NSManagedObjectContext *)context NS_DESIGNATED_INITIALIZER;
|
|
10
|
+
- (instancetype)initWithContext:(NSManagedObjectContext *)moc API_AVAILABLE(ios(10.0));
|
|
9
11
|
@property (nullable, nonatomic, readonly, assign) NSManagedObjectContext *managedObjectContext;
|
|
10
12
|
@property (nonatomic, readonly, strong) NSEntityDescription *entity;
|
|
11
13
|
@property (nonatomic, readonly, strong) NSManagedObjectID *objectID;
|
package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSManagedObjectContext.h
CHANGED
|
@@ -10,6 +10,9 @@ extern NSString * const NSManagedObjectContextObjectsDidChangeNotification __att
|
|
|
10
10
|
extern NSString * const NSInsertedObjectsKey __attribute__((availability(ios,introduced=3.0)));
|
|
11
11
|
extern NSString * const NSUpdatedObjectsKey __attribute__((availability(ios,introduced=3.0)));
|
|
12
12
|
extern NSString * const NSDeletedObjectsKey __attribute__((availability(ios,introduced=3.0)));
|
|
13
|
+
extern NSString * const NSRefreshedObjectsKey __attribute__((availability(ios,introduced=3.0)));
|
|
14
|
+
extern NSString * const NSInvalidatedObjectsKey __attribute__((availability(ios,introduced=3.0)));
|
|
15
|
+
extern NSString * const NSInvalidatedAllObjectsKey __attribute__((availability(ios,introduced=3.0)));
|
|
13
16
|
typedef NS_ENUM(NSUInteger, NSManagedObjectContextConcurrencyType) {
|
|
14
17
|
NSConfinementConcurrencyType __attribute__((availability(ios,introduced=3.0,deprecated=9.0))) = 0x00,
|
|
15
18
|
NSPrivateQueueConcurrencyType = 0x01,
|
|
@@ -31,13 +34,16 @@ PEACH_SWIFT_CLASS(CoreData) @interface NSManagedObjectContext : NSObject <NSCodi
|
|
|
31
34
|
- (NSUInteger)countForFetchRequest:(NSFetchRequest *)request error:(NSError **)error __attribute__((availability(ios,introduced=3.0))) __attribute__((swift_error(nonnull_error)));
|
|
32
35
|
- (void)deleteObject:(NSManagedObject *)object;
|
|
33
36
|
- (void)refreshObject:(NSManagedObject *)object mergeChanges:(BOOL)flag;
|
|
37
|
+
- (void)reset;
|
|
34
38
|
@property (nonatomic, readonly, strong) NSSet<__kindof NSManagedObject *> *insertedObjects;
|
|
35
39
|
@property (nonatomic, readonly, strong) NSSet<__kindof NSManagedObject *> *updatedObjects;
|
|
36
40
|
@property (nonatomic, readonly, strong) NSSet<__kindof NSManagedObject *> *deletedObjects;
|
|
37
41
|
- (BOOL)save:(NSError **)error;
|
|
38
42
|
@property (strong) id mergePolicy;
|
|
43
|
+
@property (nonatomic) BOOL automaticallyMergesChangesFromParent __attribute__((availability(ios,introduced=10.0)));
|
|
39
44
|
- (BOOL)obtainPermanentIDsForObjects:(NSArray<NSManagedObject *> *)objects error:(NSError **)error __attribute__((availability(ios,introduced=3.0)));
|
|
40
45
|
- (void)mergeChangesFromContextDidSaveNotification:(NSNotification *)notification __attribute__((availability(ios,introduced=3.0)));
|
|
46
|
+
+ (void)mergeChangesFromRemoteContextSave:(NSDictionary *)changeNotificationData intoContexts:(NSArray<NSManagedObjectContext *> *)contexts __attribute__((availability(ios,introduced=9.0)));
|
|
41
47
|
- (nullable __kindof NSManagedObject *)existingObjectWithID:(NSManagedObjectID *)objectID error:(NSError **)error __attribute__((availability(ios,introduced=3.0)));
|
|
42
48
|
@end
|
|
43
49
|
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
#import <Foundation/Foundation.h>
|
|
3
|
+
#import <CoreData/NSManagedObjectContext.h>
|
|
4
|
+
#import <CoreData/NSPersistentStoreDescription.h>
|
|
5
|
+
@class NSManagedObjectModel;
|
|
6
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
7
|
+
__attribute__((availability(ios,introduced=10.0))) NS_SWIFT_SENDABLE
|
|
8
|
+
PEACH_SWIFT_CLASS(CoreData) @interface NSPersistentContainer : NSObject
|
|
9
|
+
@property (strong, readonly) NSManagedObjectContext *viewContext;
|
|
10
|
+
@property (copy) NSArray<NSPersistentStoreDescription *> *persistentStoreDescriptions;
|
|
11
|
+
- (instancetype)initWithName:(NSString *)name managedObjectModel:(NSManagedObjectModel *)model NS_DESIGNATED_INITIALIZER;
|
|
12
|
+
- (void)loadPersistentStoresWithCompletionHandler:(void (^)(NSPersistentStoreDescription *, NSError * _Nullable))block NS_SWIFT_DISABLE_ASYNC;
|
|
13
|
+
- (NSManagedObjectContext *)newBackgroundContext NS_RETURNS_RETAINED;
|
|
14
|
+
@end
|
|
15
|
+
NS_ASSUME_NONNULL_END
|
package/sdk/ios/System/Library/Frameworks/CoreData.framework/Headers/NSPersistentStoreDescription.h
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#pragma once
|
|
2
|
+
#import <Foundation/Foundation.h>
|
|
3
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
4
|
+
__attribute__((availability(ios,introduced=10.0)))
|
|
5
|
+
PEACH_SWIFT_CLASS(CoreData) @interface NSPersistentStoreDescription : NSObject <NSCopying>
|
|
6
|
+
- (void)setOption:(nullable NSObject *)option forKey:(NSString *)key;
|
|
7
|
+
@property BOOL shouldAddStoreAsynchronously;
|
|
8
|
+
- (instancetype)initWithURL:(NSURL *)url NS_DESIGNATED_INITIALIZER;
|
|
9
|
+
@end
|
|
10
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//
|
|
2
|
+
// CSBase.h
|
|
3
|
+
// CoreSpotlight
|
|
4
|
+
//
|
|
5
|
+
// Copyright © 2015 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
#if !defined(CORESPOTLIGHT_EXPORT)
|
|
11
|
+
#define CORESPOTLIGHT_EXPORT extern
|
|
12
|
+
#endif
|
|
13
|
+
|
|
14
|
+
#ifndef CS_AVAILABLE
|
|
15
|
+
#define CS_AVAILABLE(mac, ios) NS_AVAILABLE(mac, ios)
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
#ifndef CS_CLASS_AVAILABLE
|
|
19
|
+
#define CS_CLASS_AVAILABLE(mac, ios) NS_CLASS_AVAILABLE(mac, ios)
|
|
20
|
+
#endif
|
|
21
|
+
|
|
22
|
+
#ifndef CS_DEPRECATED
|
|
23
|
+
#define CS_DEPRECATED(_macIntro, _macDep, _iosIntro, _iosDep, ...) NS_DEPRECATED(_macIntro, _macDep, _iosIntro, _iosDep, __VA_ARGS__)
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
#ifndef CS_TVOS_UNAVAILABLE
|
|
27
|
+
#define CS_TVOS_UNAVAILABLE __TVOS_PROHIBITED
|
|
28
|
+
#endif
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//
|
|
2
|
+
// CSImportExtension.h
|
|
3
|
+
// CoreSpotlight
|
|
4
|
+
//
|
|
5
|
+
// Copyright © 2020–2026 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <CoreSpotlight/CSSearchableItemAttributeSet.h>
|
|
9
|
+
|
|
10
|
+
#import <Foundation/Foundation.h>
|
|
11
|
+
|
|
12
|
+
API_AVAILABLE(macos(12.0), ios(15.0), visionos(1.0))
|
|
13
|
+
API_UNAVAILABLE(tvos, watchos)
|
|
14
|
+
PEACH_SWIFT_CLASS(SwiftUI) @interface CSImportExtension : NSObject <NSExtensionRequestHandling>
|
|
15
|
+
|
|
16
|
+
// The developer should implement this method to import the file located at contentURL, and update the provided attributes.
|
|
17
|
+
- (BOOL)updateAttributes:(CSSearchableItemAttributeSet * _Nonnull)attributes
|
|
18
|
+
forFileAtURL:(NSURL * _Nonnull)contentURL
|
|
19
|
+
error:(NSError * _Nullable * _Nonnull)error;
|
|
20
|
+
|
|
21
|
+
@end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//
|
|
2
|
+
// CSIndexExtensionRequestHandler.h
|
|
3
|
+
// CoreSpotlight
|
|
4
|
+
//
|
|
5
|
+
// Copyright © 2015–2026 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <CoreSpotlight/CSSearchableIndex.h>
|
|
9
|
+
|
|
10
|
+
#import <Foundation/Foundation.h>
|
|
11
|
+
|
|
12
|
+
__attribute__((visibility("default")))
|
|
13
|
+
API_AVAILABLE(macos(10.11), ios(9.0), visionos(1.0))
|
|
14
|
+
API_UNAVAILABLE(tvos, watchos)
|
|
15
|
+
PEACH_SWIFT_CLASS(SwiftUI) @interface CSIndexExtensionRequestHandler : NSObject <NSExtensionRequestHandling,CSSearchableIndexDelegate>
|
|
16
|
+
|
|
17
|
+
@end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//
|
|
2
|
+
// CSPerson.h
|
|
3
|
+
// CoreSpotlight
|
|
4
|
+
//
|
|
5
|
+
// Copyright © 2015–2026 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
+
|
|
12
|
+
API_AVAILABLE(macos(10.11), ios(9.0), visionos(1.0))
|
|
13
|
+
API_UNAVAILABLE(tvos, watchos)
|
|
14
|
+
PEACH_SWIFT_CLASS(SwiftUI) @interface CSPerson : NSObject <NSSecureCoding,NSCopying>
|
|
15
|
+
|
|
16
|
+
- (instancetype)initWithDisplayName:(nullable NSString *)displayName handles:(NSArray<NSString*> *)handles handleIdentifier:(NSString *)handleIdentifier;
|
|
17
|
+
|
|
18
|
+
@property (readonly,nullable) NSString *displayName; //An optional display name for displaying this recipient
|
|
19
|
+
|
|
20
|
+
@property (readonly) NSArray<NSString*> *handles; //An array of contact handles, e.g. phone numbers
|
|
21
|
+
|
|
22
|
+
@property (readonly) NSString *handleIdentifier; //A CNContactPropertyKey to identify the type of of handle, e.g. CNContactPhoneNumbersKey
|
|
23
|
+
|
|
24
|
+
@property (copy,nullable) NSString *contactIdentifier; //If the property has already been resolved, the identifier for the Contact
|
|
25
|
+
|
|
26
|
+
@end
|
|
27
|
+
|
|
28
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
//
|
|
2
|
+
// CSSearchQuery.h
|
|
3
|
+
// CoreSpotlight
|
|
4
|
+
//
|
|
5
|
+
// Copyright © 2015–2026 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
+
|
|
12
|
+
extern NSErrorDomain const CSSearchQueryErrorDomain API_AVAILABLE(macos(10.12), ios(10.0), visionos(1.0)) API_UNAVAILABLE(tvos, watchos);
|
|
13
|
+
|
|
14
|
+
typedef NS_ENUM(NSInteger, CSSearchQueryErrorCode) {
|
|
15
|
+
CSSearchQueryErrorCodeUnknown = -2000,
|
|
16
|
+
CSSearchQueryErrorCodeIndexUnreachable = -2001,
|
|
17
|
+
CSSearchQueryErrorCodeInvalidQuery = -2002,
|
|
18
|
+
CSSearchQueryErrorCodeCancelled = -2003,
|
|
19
|
+
} API_AVAILABLE(macos(10.12), ios(10.0), visionos(1.0)) API_UNAVAILABLE(tvos, watchos);
|
|
20
|
+
|
|
21
|
+
typedef NS_OPTIONS(NSUInteger, CSSearchQuerySourceOptions) {
|
|
22
|
+
CSSearchQuerySourceOptionDefault = 0,
|
|
23
|
+
CSSearchQuerySourceOptionAllowMail = 1 << 0, // com.apple.corespotlight.search.allow.mail entitlement
|
|
24
|
+
} NS_SWIFT_NAME(CSSearchQueryContext.SourceOptions) API_AVAILABLE(macos(13.0)) API_UNAVAILABLE(ios, tvos, watchos, visionos);
|
|
25
|
+
|
|
26
|
+
@class CSSearchableItem;
|
|
27
|
+
|
|
28
|
+
API_AVAILABLE(macos(13.0), ios(16.0), visionos(1.0))
|
|
29
|
+
API_UNAVAILABLE(tvos, watchos)
|
|
30
|
+
PEACH_SWIFT_CLASS(SwiftUI) @interface CSSearchQueryContext : NSObject<NSSecureCoding, NSCopying>
|
|
31
|
+
|
|
32
|
+
@property (nonatomic, strong) NSArray<NSString *> *fetchAttributes;
|
|
33
|
+
@property (nonatomic, copy) NSArray<NSString *> *filterQueries;
|
|
34
|
+
@property (nullable, nonatomic, strong) NSString *keyboardLanguage;
|
|
35
|
+
|
|
36
|
+
@property (nonatomic, assign) CSSearchQuerySourceOptions sourceOptions API_UNAVAILABLE(ios, tvos, watchos, visionos);
|
|
37
|
+
|
|
38
|
+
@end
|
|
39
|
+
|
|
40
|
+
API_AVAILABLE(macos(10.12), ios(10.0), visionos(1.0))
|
|
41
|
+
API_UNAVAILABLE(tvos, watchos)
|
|
42
|
+
PEACH_SWIFT_CLASS(SwiftUI) @interface CSSearchQuery : NSObject
|
|
43
|
+
|
|
44
|
+
- (instancetype)init NS_UNAVAILABLE;
|
|
45
|
+
|
|
46
|
+
// queryString: The query string (e.g., 'contentType == "public.email-message" && subject != "Re:*"')
|
|
47
|
+
- (instancetype)initWithQueryString:(NSString * _Nonnull)queryString queryContext:(CSSearchQueryContext * _Nullable)queryContext NS_DESIGNATED_INITIALIZER API_AVAILABLE(macos(13.0), ios(16.0), visionos(1.0)) API_UNAVAILABLE(tvos, watchos);
|
|
48
|
+
|
|
49
|
+
// queryString: The query string (e.g., 'contentType == "public.email-message" && subject != "Re:*"')
|
|
50
|
+
// attributes: The attributes to be fetched for the searchable items
|
|
51
|
+
- (instancetype)initWithQueryString:(NSString *)queryString attributes:(NSArray<NSString *> * _Nullable)attributes API_DEPRECATED("Use initWithQueryString:queryContext instead", macos(10.12, 13.0), ios(10.0, 16.0), visionos(1.0, 1.0)) API_UNAVAILABLE(tvos, watchos);
|
|
52
|
+
|
|
53
|
+
@property (readonly, getter=isCancelled) BOOL cancelled;
|
|
54
|
+
|
|
55
|
+
// The query will update the count before each foundItemsHandler invocation to reflect
|
|
56
|
+
// the number of items found so far; if foundItemsHandler is nil then the count will
|
|
57
|
+
// contain the total number of found items when the query completes.
|
|
58
|
+
@property (readonly) NSUInteger foundItemCount;
|
|
59
|
+
|
|
60
|
+
// The foundItemsHandler will be invoked repeatedly with a new batch of searchable items.
|
|
61
|
+
// The query serializes all the foundItemsHandler invocations.
|
|
62
|
+
@property (nullable, copy) void (^foundItemsHandler)(NSArray<CSSearchableItem *> *items);
|
|
63
|
+
|
|
64
|
+
@property (nullable, copy) void (^completionHandler)(NSError * _Nullable error);
|
|
65
|
+
|
|
66
|
+
// An array of NSFileProtectionComplete, NSFileProtectionCompleteUnlessOpen,
|
|
67
|
+
// or NSFileProtectionCompleteUntilFirstUserAuthentication.
|
|
68
|
+
// By default the data protection will be read from the "com.apple.developer.default-data-protection"
|
|
69
|
+
// entitlement if any or NSFileProtectionCompleteUntilFirstUserAuthentication will be used otherwise.
|
|
70
|
+
@property (copy) NSArray<NSFileProtectionType> *protectionClasses;
|
|
71
|
+
|
|
72
|
+
- (void)start;
|
|
73
|
+
- (void)cancel;
|
|
74
|
+
|
|
75
|
+
@end
|
|
76
|
+
|
|
77
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
//
|
|
2
|
+
// CSSearchableIndex.h
|
|
3
|
+
// CoreSpotlight
|
|
4
|
+
//
|
|
5
|
+
// Copyright © 2015–2026 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <CoreSpotlight/CSSearchableItem.h>
|
|
9
|
+
|
|
10
|
+
#import <Foundation/Foundation.h>
|
|
11
|
+
|
|
12
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
13
|
+
|
|
14
|
+
extern NSString * const CSIndexErrorDomain API_AVAILABLE(macos(10.11), ios(9.0), visionos(1.0)) API_UNAVAILABLE(tvos, watchos);
|
|
15
|
+
|
|
16
|
+
typedef NS_ENUM(NSInteger, CSIndexErrorCode) {
|
|
17
|
+
CSIndexErrorCodeUnknownError = -1,
|
|
18
|
+
CSIndexErrorCodeIndexUnavailableError = -1000, //The indexer was unavailable
|
|
19
|
+
CSIndexErrorCodeInvalidItemError = -1001, //The CSSearchableItem is invalid for some reason
|
|
20
|
+
CSIndexErrorCodeInvalidClientStateError = -1002, //The provided clientState was not valid for some reason
|
|
21
|
+
CSIndexErrorCodeRemoteConnectionError = -1003, //There was an error trying to communicate with the remote process
|
|
22
|
+
CSIndexErrorCodeQuotaExceeded = -1004, //Quota for bundle was exceeded
|
|
23
|
+
CSIndexErrorCodeIndexingUnsupported = -1005, //Indexing isn't supported on this device
|
|
24
|
+
CSIndexErrorCodeMismatchedClientState API_AVAILABLE(macos(15.0), ios(18.0), visionos(2.0)) API_UNAVAILABLE(tvos, watchos) = -1006, //The expected client state did not match the indexed one.
|
|
25
|
+
} API_AVAILABLE(macos(10.11), ios(9.0), visionos(1.0)) API_UNAVAILABLE(tvos, watchos);
|
|
26
|
+
|
|
27
|
+
@protocol CSSearchableIndexDelegate;
|
|
28
|
+
|
|
29
|
+
API_AVAILABLE(macos(10.11), ios(9.0), visionos(1.0))
|
|
30
|
+
API_UNAVAILABLE(tvos, watchos)
|
|
31
|
+
PEACH_SWIFT_CLASS(SwiftUI) @interface CSSearchableIndex : NSObject
|
|
32
|
+
|
|
33
|
+
@property (weak,nullable) id<CSSearchableIndexDelegate> indexDelegate;
|
|
34
|
+
|
|
35
|
+
@property (nonatomic, readonly) NSFileProtectionType protectionClass API_AVAILABLE(macos(27.0), ios(27.0), visionos(27.0)) API_UNAVAILABLE(tvos, watchos);
|
|
36
|
+
|
|
37
|
+
// Not all devices support indexing. Call this method to check if indexing is supported on the current device.
|
|
38
|
+
+ (BOOL)isIndexingAvailable;
|
|
39
|
+
|
|
40
|
+
+ (instancetype)defaultSearchableIndex;
|
|
41
|
+
|
|
42
|
+
// Apps can set a name for the index instance. This name is used as a handle for the client state used with the batch API, allowing a single client to have multiple client states; you have to retrieve the client state for an index instance with the same name as you used when setting the client state.
|
|
43
|
+
- (instancetype)initWithName:(NSString *)name;
|
|
44
|
+
|
|
45
|
+
// Apps can set a default protection class for items in their entitlements. You can alternately create an instance with a custom protection class to use on iOS. It should be one of NSFileProtectionComplete, NSFileProtectionCompleteUnlessOpen, or NSFileProtectionCompleteUntilFirstUserAuthentication.
|
|
46
|
+
- (instancetype)initWithName:(NSString *)name protectionClass:(nullable NSFileProtectionType)protectionClass;
|
|
47
|
+
|
|
48
|
+
// Call this method to add or update items in the index.
|
|
49
|
+
// Completion handlers will be called once the data has been journaled by the index. If the completion handler returns an error, the client should retry, as it was not journaled correctly.
|
|
50
|
+
// reindexSearchableItemsWithIdentifiers will be called if the journaling completed successfully but the data was not able to be indexed for some reason.
|
|
51
|
+
- (void)indexSearchableItems:(NSArray<CSSearchableItem *> *)items completionHandler:(void (^ __nullable)(NSError * __nullable error))completionHandler;
|
|
52
|
+
|
|
53
|
+
// Call this method to remove items with the given identifiers from the index.
|
|
54
|
+
// Completion handlers will be called once the data has been journaled by the index. If the completion handler returns an error, the client should retry, as it was not journaled correctly.
|
|
55
|
+
// reindexSearchableItemsWithIdentifiers will be called if the journaling completed successfully but the data was not able to be indexed for some reason.
|
|
56
|
+
- (void)deleteSearchableItemsWithIdentifiers:(NSArray<NSString *> *)identifiers completionHandler:(void (^ __nullable)(NSError * __nullable error))completionHandler;
|
|
57
|
+
|
|
58
|
+
// Call this method on the index to remove any items from the index with the given domain identifiers.
|
|
59
|
+
// The delete is recursive so if domain identifiers are of the form <account-id>.<mailbox-id>, for example,
|
|
60
|
+
// calling delete with <account-id> will delete all the searchable items with that account and any mailbox.
|
|
61
|
+
- (void)deleteSearchableItemsWithDomainIdentifiers:(NSArray<NSString *> *)domainIdentifiers completionHandler:(void (^ __nullable)(NSError * __nullable error))completionHandler;
|
|
62
|
+
|
|
63
|
+
// Call this method to delete all searchable items from the index.
|
|
64
|
+
- (void)deleteAllSearchableItemsWithCompletionHandler:(void (^ __nullable)(NSError * __nullable error))completionHandler;
|
|
65
|
+
|
|
66
|
+
@end
|
|
67
|
+
|
|
68
|
+
API_AVAILABLE(macos(10.11), ios(9.0), visionos(1.0))
|
|
69
|
+
API_UNAVAILABLE(tvos, watchos)
|
|
70
|
+
@interface CSSearchableIndex (CSOptionalBatching)
|
|
71
|
+
|
|
72
|
+
// Batching:
|
|
73
|
+
|
|
74
|
+
// For some clients, it may be beneficial to batch updates to the index. Those clients can use batching and persist client state information (< 250 bytes) in the index. That state information can be used to determine where indexing needs to resume from in case of a client crash or jetsam. Batching is supported for indexSearchableItems deleteSearchableItemsWithIdentifiers. Persisted client state will be reset whenever deleteAllSearchableItemsWithCompletionHandler is called.
|
|
75
|
+
|
|
76
|
+
// Note: Batching is unsupported for the CSSearchableIndex returned by the defaultSearchableIndex method
|
|
77
|
+
|
|
78
|
+
// Thread safety: In batch mode, the client takes responsibility for protecting the private CSSearchableIndex instance from concurrent access from multiple threads. Concurrent calls to the index instance will have undefined results. beginIndexBatch must not be called again before endIndexBatchWithClientState:completionHandler: has returned (it is however safe to call before the completionHandler passed to endIndexBatchWithClientState:completionHandler has been called).
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
// Begin a batch of index adds, updates, or deletes.
|
|
82
|
+
- (void)beginIndexBatch;
|
|
83
|
+
|
|
84
|
+
// End a batch passing in expected client state information to be persisted in the index, along with new client state for the current batch. The completion handler will be called once the client state has been persisted. If the client state does not match expected, an error of CSIndexErrorCodeMismatchedClientState will be returned.
|
|
85
|
+
- (void)endIndexBatchWithExpectedClientState:(nullable NSData *)expectedClientState newClientState:(NSData *)newClientState completionHandler:(void (^ __nullable)(NSError * __nullable error))completionHandler NS_SWIFT_NAME(endIndexBatch(expectedClientState:newClientState:completionHandler:)) API_AVAILABLE(macos(15.0), ios(18.0), visionos(2.0)) API_UNAVAILABLE(tvos, watchos);
|
|
86
|
+
|
|
87
|
+
// End a batch passing in client state information to be persisted in the index. The completion handler will be called once the client state has been persisted.
|
|
88
|
+
- (void)endIndexBatchWithClientState:(NSData *)clientState completionHandler:(void (^ __nullable)(NSError * __nullable error))completionHandler;
|
|
89
|
+
|
|
90
|
+
// Async fetches the app's last stored client state information.
|
|
91
|
+
- (void)fetchLastClientStateWithCompletionHandler:(void (^)(NSData * __nullable clientState,NSError * __nullable error))completionHandler;
|
|
92
|
+
|
|
93
|
+
@end
|
|
94
|
+
|
|
95
|
+
API_AVAILABLE(macos(13.0))
|
|
96
|
+
API_UNAVAILABLE(ios, tvos, watchos, visionos)
|
|
97
|
+
@interface CSSearchableIndex (CSExternalProvider)
|
|
98
|
+
|
|
99
|
+
- (void)fetchDataForBundleIdentifier:(NSString *)bundleIdentifier
|
|
100
|
+
itemIdentifier:(NSString *)itemIdentifier
|
|
101
|
+
contentType:(UTType *)contentType
|
|
102
|
+
completionHandler:(void (^)(NSData * _Nullable, NSError * _Nullable))completionHandler;
|
|
103
|
+
|
|
104
|
+
@end
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
// An application that is long running should provide a CSSearchableIndexDelegate conforming object to handle communication from the index.
|
|
108
|
+
// Alternatively, an app can provide an extension whose request handler conforms to this protocol and the extension will be called if the app isn't running.
|
|
109
|
+
API_AVAILABLE(macos(10.11), ios(9.0), visionos(1.0))
|
|
110
|
+
API_UNAVAILABLE(tvos, watchos)
|
|
111
|
+
@protocol CSSearchableIndexDelegate <NSObject>
|
|
112
|
+
|
|
113
|
+
@required
|
|
114
|
+
|
|
115
|
+
// The index requests that the delegate should reindex all of its searchable data and clear any local state that it might have persisted because the index has been lost.
|
|
116
|
+
// The app or extension should call indexSearchableItems on the passed in CSSearchableIndex.
|
|
117
|
+
// The app or extension must call the acknowledgement handler once any client state information has been persisted, that way, in case of a crash, the indexer can call this again.
|
|
118
|
+
// If the app passes clientState information in a batch, the acknowledgement can be called right away.
|
|
119
|
+
// The passed in index shouldn't be used in an extension if a custom protection class is needed.
|
|
120
|
+
- (void)searchableIndex:(CSSearchableIndex *)searchableIndex reindexAllSearchableItemsWithAcknowledgementHandler:(void (^)(void))acknowledgementHandler;
|
|
121
|
+
|
|
122
|
+
// The index requests that the delegate should reindex the searchable data with the provided identifiers.
|
|
123
|
+
// The app or extension should call indexSearchableItems:completionHandler on the passed in index CSSearchableIndex to update the items' states.
|
|
124
|
+
// The app or extension must call the acknowledgement handler once any client state information has been persisted, that way, in case of a crash, the indexer can call this again.
|
|
125
|
+
// If the app passes clientState information in a batch, the acknowledgement can be called right away.
|
|
126
|
+
// The passed in index shouldn't be used in an extension if a custom protection class is needed.
|
|
127
|
+
- (void)searchableIndex:(CSSearchableIndex *)searchableIndex reindexSearchableItemsWithIdentifiers:(NSArray <NSString *> *)identifiers
|
|
128
|
+
acknowledgementHandler:(void (^)(void))acknowledgementHandler;
|
|
129
|
+
|
|
130
|
+
@optional
|
|
131
|
+
|
|
132
|
+
// When on battery power, it is possible for indexing to slowed down to prevent battery drain.
|
|
133
|
+
// The developer may want to optionally implement these methods to receive notice that indexing is being throttled and react accordingly (e.g. by priortizing indexing of more important content).
|
|
134
|
+
- (void)searchableIndexDidThrottle:(CSSearchableIndex *)searchableIndex;
|
|
135
|
+
- (void)searchableIndexDidFinishThrottle:(CSSearchableIndex *)searchableIndex;
|
|
136
|
+
|
|
137
|
+
// The developer may provide a NSData representation if type was specified in providerDataTypeIdentifiers property.
|
|
138
|
+
- (nullable NSData *)dataForSearchableIndex:(CSSearchableIndex *)searchableIndex itemIdentifier:(NSString *)itemIdentifier typeIdentifier:(NSString *)typeIdentifier error:(out NSError ** __nullable)outError API_AVAILABLE(macos(10.13), ios(11.0), visionos(1.0)) API_UNAVAILABLE(tvos, watchos);
|
|
139
|
+
|
|
140
|
+
// The developer may provide a NSURL to file representation representation if type was specified from providerDataTypeIdentifiers or providerInPlaceFileTypeIdentifiers property.
|
|
141
|
+
- (nullable NSURL *)fileURLForSearchableIndex:(CSSearchableIndex *)searchableIndex itemIdentifier:(NSString *)itemIdentifier typeIdentifier:(NSString *)typeIdentifier inPlace:(BOOL)inPlace error:(out NSError ** __nullable)outError API_AVAILABLE(macos(10.13), ios(11.0), visionos(1.0)) API_UNAVAILABLE(tvos, watchos);
|
|
142
|
+
|
|
143
|
+
// The index requests that the delegate provide searchable items for the provided identifiers with the default protection class
|
|
144
|
+
- (void)searchableItemsForIdentifiers:(NSArray <NSString *> *)identifiers searchableItemsHandler:(void (^)(NSArray<CSSearchableItem *> *items))searchableItemsHandler NS_SWIFT_ASYNC(2) API_AVAILABLE(macos(15.4), ios(18.4), visionos(2.4)) API_UNAVAILABLE(tvos, watchos);
|
|
145
|
+
|
|
146
|
+
// The index requests that the delegate provide searchable items for the provided identifiers in the specified protection class
|
|
147
|
+
- (void)searchableItemsForIdentifiers:(NSArray <NSString *> *)identifiers protectionClass:(NSFileProtectionType)protectionClass searchableItemsHandler:(void (^)(NSArray<CSSearchableItem *> *items))searchableItemsHandler NS_SWIFT_ASYNC(3) API_AVAILABLE(macos(27.0), ios(27.0), visionos(27.0)) API_UNAVAILABLE(tvos, watchos);
|
|
148
|
+
|
|
149
|
+
// The developer may want to be notified when an item has been updated with specific attributes (see: CSSearchableItemUpdateListenerOptions for Apple Intelligence attributes)
|
|
150
|
+
- (void)searchableItemsDidUpdate:(NSArray<CSSearchableItem *> *)items API_AVAILABLE(macos(15.4), ios(18.4), visionos(2.4)) API_UNAVAILABLE(tvos, watchos);
|
|
151
|
+
|
|
152
|
+
@end
|
|
153
|
+
|
|
154
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//
|
|
2
|
+
// CSSearchableIndexDescription.h
|
|
3
|
+
// CoreSpotlight
|
|
4
|
+
//
|
|
5
|
+
// Copyright © 2026 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
|
|
10
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
+
|
|
12
|
+
API_AVAILABLE(macos(27.0), ios(27.0), visionos(27.0))
|
|
13
|
+
API_UNAVAILABLE(tvos, watchos)
|
|
14
|
+
PEACH_SWIFT_CLASS(SwiftUI) @interface CSSearchableIndexDescription : NSObject <NSSecureCoding, NSCopying>
|
|
15
|
+
|
|
16
|
+
@property (nonatomic, readonly, nullable) NSFileProtectionType protectionClass;
|
|
17
|
+
@end
|
|
18
|
+
|
|
19
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
//
|
|
2
|
+
// CSSearchableItem.h
|
|
3
|
+
// CoreSpotlight
|
|
4
|
+
//
|
|
5
|
+
// Copyright © 2015–2026 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <CoreSpotlight/CSSearchableItemAttributeSet.h>
|
|
9
|
+
|
|
10
|
+
#import <Foundation/Foundation.h>
|
|
11
|
+
|
|
12
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
13
|
+
|
|
14
|
+
// When opening a document from Spotlight, the application's application:willContinueUserActivityWithType:
|
|
15
|
+
// method will get called with CSSearchableItemActionType, followed by application:continueUserActivity:restorationHandler:
|
|
16
|
+
// with an NSUserActivity where the userInfo dictionary has a key value pair where CSSearchableItemActivityIdentifier is the key
|
|
17
|
+
// and the value is the uniqueIdentifier used when creating the item.
|
|
18
|
+
extern NSString * const CSSearchableItemActionType API_AVAILABLE(macos(10.11), ios(9.0), visionos(1.0)) API_UNAVAILABLE(tvos, watchos);
|
|
19
|
+
extern NSString * const CSSearchableItemActivityIdentifier API_AVAILABLE(macos(10.11), ios(9.0), visionos(1.0)) API_UNAVAILABLE(tvos, watchos);
|
|
20
|
+
|
|
21
|
+
// For custom actions on iOS, the userInfo dictionary also has another key value pair where CSActionIdentifier is the key
|
|
22
|
+
// and the value is the action tapped in the UI based on what was indexed by the app.
|
|
23
|
+
extern NSString * const CSActionIdentifier API_AVAILABLE(ios(15.0), visionos(1.0)) API_UNAVAILABLE(macos, tvos, watchos);
|
|
24
|
+
|
|
25
|
+
// When continuing a query from Spotlight, the application's -application:willContinueUserActivityWithType:
|
|
26
|
+
// method will get called with CSQueryContinuationActionType, followed by -application:continueUserActivity:restorationHandler:
|
|
27
|
+
// with an NSUserActivity where the userInfo dictionary has a key value pair with CSSearchQueryString as the key
|
|
28
|
+
// and the value is the string the application should use when performing its query.
|
|
29
|
+
// The application should declare that it supports the query continuation by adding the CoreSpotlightContinuation key to its Info.plist:
|
|
30
|
+
//
|
|
31
|
+
// <key>CoreSpotlightContinuation</key>
|
|
32
|
+
// <true/>
|
|
33
|
+
//
|
|
34
|
+
extern NSString * const CSQueryContinuationActionType API_AVAILABLE(macos(10.12), ios(10.0), visionos(1.0)) API_UNAVAILABLE(tvos, watchos);
|
|
35
|
+
extern NSString * const CSSearchQueryString API_AVAILABLE(macos(10.12), ios(10.0), visionos(1.0)) API_UNAVAILABLE(tvos, watchos);
|
|
36
|
+
|
|
37
|
+
typedef NS_OPTIONS(NSUInteger, CSSearchableItemUpdateListenerOptions) {
|
|
38
|
+
CSSearchableItemUpdateListenerOptionDefault = 0,
|
|
39
|
+
CSSearchableItemUpdateListenerOptionSummarization = 1 << 1, // textContentSummary
|
|
40
|
+
CSSearchableItemUpdateListenerOptionPriority = 1 << 2, // isPriority
|
|
41
|
+
} NS_SWIFT_NAME(CSSearchableItem.UpdateListenerOptions) API_AVAILABLE(macos(15.4), ios(18.4), visionos(2.4)) API_UNAVAILABLE(tvos, watchos);
|
|
42
|
+
|
|
43
|
+
API_AVAILABLE(macos(10.11), ios(9.0), visionos(1.0))
|
|
44
|
+
API_UNAVAILABLE(tvos, watchos)
|
|
45
|
+
PEACH_SWIFT_CLASS(SwiftUI) @interface CSSearchableItem : NSObject <NSSecureCoding, NSCopying>
|
|
46
|
+
|
|
47
|
+
// uniqueIdentifier can be null, in which case one will be generated.
|
|
48
|
+
// If passing in null, you must retrieve and store the generated identifier in persistent storage, so that you can open the appropriate item when recalled in a query
|
|
49
|
+
- (instancetype)initWithUniqueIdentifier:(nullable NSString *)uniqueIdentifier
|
|
50
|
+
domainIdentifier:(nullable NSString *)domainIdentifier
|
|
51
|
+
attributeSet:(CSSearchableItemAttributeSet *)attributeSet;
|
|
52
|
+
|
|
53
|
+
// For comparison of items ranked by the query
|
|
54
|
+
- (NSComparisonResult)compareByRank:(CSSearchableItem *)other API_AVAILABLE(macos(13.0), ios(16.0), visionos(1.0)) API_UNAVAILABLE(tvos, watchos);
|
|
55
|
+
|
|
56
|
+
// Should be unique to your application group.
|
|
57
|
+
// REQUIRED since this is the way you will refer to the item to update the index / delete it from the index
|
|
58
|
+
// Starts with an UUID for ease of use, but you can replace it with an UID of your own before the item is first indexed if you wish.
|
|
59
|
+
@property (copy) NSString *uniqueIdentifier;
|
|
60
|
+
|
|
61
|
+
// An optional identifier that represents the "domain" or owner of this item.
|
|
62
|
+
// This might be an identifier for a mailbox in an account whose indexed data you may want to remove when the account is deleted.
|
|
63
|
+
// In that case the domainIdentifier should be of the form <account-id>.<mailbox-id> where <account-id> and <mailbox-id> should not contains periods.
|
|
64
|
+
// Calling deleteSearchableItemsWithDomainIdentifiers with <account-id>.<mailbox-id> will delete all items with that domain identifier.
|
|
65
|
+
// Calling deleteSearchableItemsWithDomainIdentifiers with <account-id> will delete all items with <account-id> and any <mailbox-id>.
|
|
66
|
+
@property (copy, nullable) NSString *domainIdentifier;
|
|
67
|
+
|
|
68
|
+
// Searchable items have an expiration date or time to live. By default it's set to 1 month.
|
|
69
|
+
@property (copy, null_resettable) NSDate * expirationDate;
|
|
70
|
+
|
|
71
|
+
// Set of attributes containing meta data for the item
|
|
72
|
+
@property (strong) CSSearchableItemAttributeSet *attributeSet;
|
|
73
|
+
|
|
74
|
+
// A flag to specify whether or not this item should be treated as an update
|
|
75
|
+
// By default index insertions are treated as a full delete of any existing item, followed by an insert, and the client needs to specify whether or not this should be treated as an update.
|
|
76
|
+
// If an item is marked as an update, but does not already exist in the index, it will be dropped during the attempted indexing.
|
|
77
|
+
// In update mode, attributes can be marked as deleted by setting their value to nil.
|
|
78
|
+
@property (assign) BOOL isUpdate;
|
|
79
|
+
|
|
80
|
+
// An option flag to specify whether to listen for specific attribute updates that Spotlight can provide.
|
|
81
|
+
// A developer may be notified by a call of searchableItemsDidUpdate to its delegate, where specific properties will be available on the item.
|
|
82
|
+
@property (assign) CSSearchableItemUpdateListenerOptions updateListenerOptions API_AVAILABLE(macos(15.4), ios(18.4), visionos(2.4)) API_UNAVAILABLE(tvos, watchos);
|
|
83
|
+
|
|
84
|
+
@end
|
|
85
|
+
|
|
86
|
+
NS_ASSUME_NONNULL_END
|