Skip to content

SensorKit macOS xcode13.0 beta1

tj_devel709 edited this page Jul 22, 2021 · 3 revisions

#SensorKit.framework https://github.com/xamarin/xamarin-macios/pull/12188

diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/SensorKit.framework/Headers/SRKeyboardMetrics.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/SensorKit.framework/Headers/SRKeyboardMetrics.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/SensorKit.framework/Headers/SRKeyboardMetrics.h	2021-03-16 08:43:22.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/SensorKit.framework/Headers/SRKeyboardMetrics.h	2021-06-02 12:45:45.000000000 -0400
@@ -28,6 +28,9 @@
 /// The height of the keyboard in mm in the session
 @property (readonly) NSMeasurement<NSUnitLength*> *height;
 
+/// The input modes used during a keyboard session
+@property (readonly, copy) NSArray<NSString *> *inputModes API_AVAILABLE(ios(15.0)) API_UNAVAILABLE(watchos) API_UNAVAILABLE(tvos, macos);
+
 @end
 
 SR_EXTERN API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(watchos) API_UNAVAILABLE(tvos, macos)
@@ -246,4 +249,53 @@
 
 @end
 
+SR_EXTERN API_AVAILABLE(ios(15.0)) API_UNAVAILABLE(watchos) API_UNAVAILABLE(tvos, macos)
+@interface SRKeyboardMetrics (SpeedMetrics)
+
+/// The total number of pauses during the session
+@property (readonly) NSInteger totalPauses;
+
+/// The total number of pauses made while entering the path for any words composed using continuous path during the session
+@property (readonly) NSInteger totalPathPauses;
+
+/// The words per minute typed during the session
+@property (readonly) double typingSpeed;
+
+/// The words per minute typed using continuous path during the session
+@property (readonly) double pathTypingSpeed;
+
+/// Total number of continuous typing episodes during the session
+@property (readonly) NSInteger totalTypingEpisodes;
+
+@end
+
+/** @abstract Categories of sentiment from words or emoji */
+typedef NS_ENUM(NSInteger, SRKeyboardMetricsSentimentCategory) {
+    SRKeyboardMetricsSentimentCategoryAbsolutist,
+    SRKeyboardMetricsSentimentCategoryDown,
+    SRKeyboardMetricsSentimentCategoryDeath,
+    SRKeyboardMetricsSentimentCategoryAnxiety,
+    SRKeyboardMetricsSentimentCategoryAnger,
+    SRKeyboardMetricsSentimentCategoryHealth,
+    SRKeyboardMetricsSentimentCategoryPositive,
+    SRKeyboardMetricsSentimentCategorySad,
+    SRKeyboardMetricsSentimentCategoryLowEnergy,
+    SRKeyboardMetricsSentimentCategoryConfused,
+} API_AVAILABLE(ios(15.0)) API_UNAVAILABLE(watchos) API_UNAVAILABLE(tvos, macos);
+
+/**
+ * These metrics describe the number of words and emoji of a particular category typed during
+ * a keyboard session. Words and emoji may be counted in multiple categories.
+ */
+SR_EXTERN API_AVAILABLE(ios(15.0)) API_UNAVAILABLE(watchos) API_UNAVAILABLE(tvos, macos)
+@interface SRKeyboardMetrics (SentimentCounts)
+
+/// The count of words typed per category in the session
+- (NSInteger)wordCountForSentimentCategory:(SRKeyboardMetricsSentimentCategory)category;
+
+/// The count of emoji typed per category in the session
+- (NSInteger)emojiCountForSentimentCategory:(SRKeyboardMetricsSentimentCategory)category;
+
+@end
+
 NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/SensorKit.framework/Headers/SRSensors.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/SensorKit.framework/Headers/SRSensors.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/SensorKit.framework/Headers/SRSensors.h	2021-03-16 09:52:41.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/SensorKit.framework/Headers/SRSensors.h	2021-06-02 12:45:45.000000000 -0400
@@ -8,19 +8,208 @@
 #import <Foundation/Foundation.h>
 #import <SensorKit/SRDefines.h>
 
+/*!
+ * @typedef SRSensor
+ *
+ * @brief
+ * A type of data stream stored in the SensorKit data store.
+ *
+ */
 typedef NSString * SRSensor NS_TYPED_ENUM API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(watchos, macos) API_UNAVAILABLE(tvos);
 
 NS_ASSUME_NONNULL_BEGIN
 
+/*!
+ * @const SRSensorAmbientLightSensor
+ *
+ * @brief
+ * Sensor stream for Environmental Brightness and Color.
+ *
+ * @discussion
+ * This data stream stores ambient light sensor data from devices when the screen is on.
+ * Fetches from this stream return objects of type SRAmbientLightSample.
+ */
 SR_EXTERN SRSensor const SRSensorAmbientLightSensor API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(watchos, macos) API_UNAVAILABLE(tvos);
+
+/*!
+ * @const SRSensorAccelerometer
+ *
+ * @brief
+ * Accelerometer sensor stream for Motion.
+ *
+ * @discussion
+ * This data stream stores acceleration measured by the device's accelerometer.
+ * Fetches from this stream return objects of type NSArray<CMRecordedAccelerometerData *> * as defined in the CoreMotion framework.
+ */
 SR_EXTERN SRSensor const SRSensorAccelerometer API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(watchos, macos) API_UNAVAILABLE(tvos);
+
+/*!
+ * @const SRSensorRotationRate
+ *
+ * @brief
+ * Rotation rate sensor stream for Motion.
+ *
+ * @discussion
+ * This data stream stores rotation rate measured by the device's gyroscope.
+ * Fetches from this stream return objects of type NSArray<CMRecordedRotationRateData *> * as defined in the CoreMotion framework.
+ */
 SR_EXTERN SRSensor const SRSensorRotationRate API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(watchos, macos) API_UNAVAILABLE(tvos);
+
+/*!
+ * @const SRSensorVisits
+ *
+ * @brief
+ * Sensor stream for Frequently Visited Locations.
+ *
+ * @discussion
+ * This data stream stores visit information from frequently visited locations including:
+ * @textblock
+ *   - arrival and departure times
+ *   - distance from your home
+ *   - an anonymous location identifier but no specific location information
+ * @/textblock
+ *
+ * Fetches from this stream return objects of type SRVisit.
+ */
 SR_EXTERN SRSensor const SRSensorVisits API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(watchos, macos) API_UNAVAILABLE(tvos);
+
+/*!
+ * @const SRSensorPedometerData
+ *
+ * @brief
+ * Sensor stream for Pedometer.
+ *
+ * @discussion
+ * This stream stores information about your step count.
+ * Fetches from this stream return objects of type CMPedometerData as defined in the CoreMotion framework.
+ */
 SR_EXTERN SRSensor const SRSensorPedometerData API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(watchos, macos) API_UNAVAILABLE(tvos);
+
+/*!
+ * @const SRSensorDeviceUsageReport
+ *
+ * @brief
+ * Sensor stream for Device Usage.
+ *
+ * @discussion
+ * This stream stores information about device usage including:
+ * @textblock
+ *   - Types of apps used
+ *   - Types of notifications received
+ *   - Types of websites visited
+ *   - Number of device unlocks and unlock duration
+ *   - Number of times the screen is on and the duration
+ * @/textblock
+ *
+ * Fetches from this stream return objects of type SRDeviceUsageReport.
+ */
 SR_EXTERN SRSensor const SRSensorDeviceUsageReport API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(watchos, macos) API_UNAVAILABLE(tvos);
+
+/*!
+ * @const SRSensorMessagesUsageReport
+ *
+ * @brief
+ * Sensor stream for Messages Usage.
+ *
+ * @discussion
+ * This streams stores information about messages usage including:
+ * @textblock
+ *   - The number of incoming and outgoing messages
+ *   - The number of individuals contacted but none of their personal information
+ * @/textblock
+ *
+ * Fetches from this stream return objects of type SRMessagesUsageReport.
+ */
 SR_EXTERN SRSensor const SRSensorMessagesUsageReport API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(watchos, macos) API_UNAVAILABLE(tvos);
+
+/*!
+ * @const SRSensorPhoneUsageReport
+ *
+ * @brief
+ * Sensor stream for Phone Usage
+ *
+ * @discussion
+ * This streams stores information about phone usage including:
+ * @textblock
+ *   - The number of incoming and outgoing calls
+ *   - The number of individuals contacted but none of their personal information
+ * @/textblock
+ *
+ * Fetches from this stream return objects of type SRPhoneUsageReport.
+ */
 SR_EXTERN SRSensor const SRSensorPhoneUsageReport API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(watchos, macos) API_UNAVAILABLE(tvos);
+
+/*!
+ * @const SRSensorOnWristState
+ *
+ * @brief
+ * Sensor stream for Watch on Wrist
+ *
+ * @discussion
+ * This streams stores information about Apple Watch wear including:
+ * @textblock
+ *   - When the watch is worn
+ *   - Digital crown and orientation settings
+ * @/textblock
+ *
+ * Fetches from this stream return objects of type SRWristDetection.
+ */
 SR_EXTERN SRSensor const SRSensorOnWristState API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(watchos, macos) API_UNAVAILABLE(tvos);
+
+/*!
+ * @const SRSensorKeyboardMetrics
+ *
+ * @brief
+ * Sensor stream for Keyboard Usage
+ *
+ * @discussion
+ * This stream stores information about keyboard usage from all apps where a keyboard is used including:
+ * @textblock
+ *   - Metrics about typing speed and accuracy
+ *   - Metrics about the length of typed or swiped words
+ *   - Metrics about the typing errors made
+ *   - The number of words and emojis that convey emotion
+ * @/textblock
+ *
+ * Fetches from this stream return objects of type SRKeyboardMetrics.
+ */
 SR_EXTERN SRSensor const SRSensorKeyboardMetrics API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(watchos, macos) API_UNAVAILABLE(tvos);
 
+/*!
+ * @const SRSensorSiriSpeechMetrics
+ *
+ * @brief
+ * Siri sensor stream for Speech Metrics
+ *
+ * @discussion
+ * This stream stores information data about your voice during Siri sessions including:
+ * @textblock
+ *   - Tenor, pitch, and cadence
+ *   - Metrics such as average words per minute and average pause length
+ * @/textblock
+ * This steam does not store any raw audio nor any audio or data from other parties.
+ *
+ * Fetches from this stream return objects of type SFSpeechRecognitionMetadata as defined in the Speech framework.
+ */
+SR_EXTERN SRSensor const SRSensorSiriSpeechMetrics API_AVAILABLE(ios(15.0)) API_UNAVAILABLE(watchos, macos) API_UNAVAILABLE(tvos);
+
+/*!
+ * @const SRSensorTelephonySpeechMetrics
+ *
+ * @brief
+ * Telephony sensor stream for Speech Metrics
+ *
+ * @discussion
+ * This stream stores information data about your voice during phone calls including:
+ * @textblock
+ *   - Tenor, pitch, and cadence
+ *   - Metrics such as average words per minute and average pause length
+ * @/textblock
+ *
+ * This steam does not store any raw audio nor any audio or data from other parties.
+ *
+ * Fetches from this stream return objects of type SFSpeechRecognitionMetadata as defined in the Speech framework.
+ */
+SR_EXTERN SRSensor const SRSensorTelephonySpeechMetrics API_AVAILABLE(ios(15.0)) API_UNAVAILABLE(watchos, macos) API_UNAVAILABLE(tvos);
+
 NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/SensorKit.framework/Headers/SRUsageReports.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/SensorKit.framework/Headers/SRUsageReports.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/SensorKit.framework/Headers/SRUsageReports.h	2021-03-16 09:52:41.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/SensorKit.framework/Headers/SRUsageReports.h	2021-06-02 12:42:52.000000000 -0400
@@ -49,6 +49,22 @@
 
 @end
 
+typedef NS_ENUM(NSInteger, SRTextInputSessionType) {
+    SRTextInputSessionTypeKeyboard = 1,
+    SRTextInputSessionTypeThirdPartyKeyboard,
+    SRTextInputSessionTypePencil,
+    SRTextInputSessionTypeDictation,
+} API_AVAILABLE(ios(15.0)) API_UNAVAILABLE(watchos) API_UNAVAILABLE(tvos, macos);
+
+SR_EXTERN API_AVAILABLE(ios(15.0)) API_UNAVAILABLE(watchos) API_UNAVAILABLE(tvos, macos)
+@interface SRTextInputSession : NSObject
+
+@property (readonly) NSTimeInterval duration;
+
+@property (readonly) SRTextInputSessionType sessionType;
+
+@end
+
 SR_EXTERN API_AVAILABLE(ios(14.0)) API_UNAVAILABLE(watchos) API_UNAVAILABLE(tvos, macos)
 @interface SRApplicationUsage : NSObject
 
@@ -58,6 +74,30 @@
 /// The amount of time the app is used
 @property (readonly) NSTimeInterval usageTime;
 
+/*!
+ * @property reportApplicationIdentifier
+ *
+ * @brief An application identifier that is valid for the duration of the report.
+ *
+ * @discussion This is useful for identifying distinct application uses within the same
+ * report duration without revealing the actual application identifier.
+ */
+@property (readonly, copy) NSString *reportApplicationIdentifier API_AVAILABLE(ios(15.0)) API_UNAVAILABLE(watchos) API_UNAVAILABLE(tvos, macos);
+
+/*!
+ * @property textInputSessions
+ *
+ * @brief
+ * The text input session types that occurred during this application usage
+ *
+ * @discussion
+ * The list of text input sessions describes the order and type of text input that may
+ * have occured during an application usage. Multiple sessions of the same text input
+ * type will appear as separate array entries. If no text input occurred, this array
+ * will be empty.
+ */
+@property (readonly, copy) NSArray<SRTextInputSession *> *textInputSessions API_AVAILABLE(ios(15.0)) API_UNAVAILABLE(watchos) API_UNAVAILABLE(tvos, macos);
+
 @end
 
 typedef NS_ENUM(NSInteger, SRNotificationEvent) {
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/SensorKit.framework/Headers/SensorKit.apinotes /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/SensorKit.framework/Headers/SensorKit.apinotes
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/SensorKit.framework/Headers/SensorKit.apinotes	2021-03-16 04:44:19.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/SensorKit.framework/Headers/SensorKit.apinotes	2021-05-22 07:16:14.000000000 -0400
@@ -44,6 +44,10 @@
   SwiftName: SRWristDetection.WristLocation
 - Name: SRCrownOrientation
   SwiftName: SRWristDetection.CrownOrientation
+- Name: SRKeyboardMetricsSentimentCategory
+  SwiftName: SRKeyboardMetrics.SentimentCategory
+- Name: SRTextInputSessionType
+  SwiftName: SRTextInputSession.SessionType
 # Local Variables:
 # mode: yaml
 # End:
Clone this wiki locally