one
Version:
One is a React framework for web, iOS, and Android apps.
3,986 lines • 106 kB
JavaScript
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all) __defProp(target, name, {
get: all[name],
enumerable: true
});
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
});
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var swiftStyleNative_exports = {};
__export(swiftStyleNative_exports, {
dispatchSDKEvent: () => dispatchSDKEvent,
swiftStyleNative: () => swiftStyleNative,
validSDKEventValue: () => validSDKEventValue
});
module.exports = __toCommonJS(swiftStyleNative_exports);
var import_react_native = require("react-native-web");
var import_animatorStyle = require("../animatorStyle.cjs");
const colorFields = [
"foregroundStyle",
"tint",
"background",
"borderColor",
"glassEffectTint"
];
const sdkKinds = {
accentColor: "optionalEnum",
accessibilityAction: "event",
accessibilityActionWithAppIntent: "registeredValue",
accessibilityActivationPointWithActivationPointAndIsEnabled: "record",
accessibilityActivationPointWithUnitPoint: "string",
accessibilityAddTraits: "string",
accessibilityAdjustableAction: "eventEnum",
accessibilityChartDescriptor: "chartDescriptor",
accessibilityCustomContent: "record",
accessibilityDefaultFocus: "defaultFocusBoolean",
accessibilityDirectTouch: "record",
accessibilityDragPointWithPointAndDescription: "record",
accessibilityDragPointWithPointAndDescriptionAndIsEnabled: "record",
accessibilityDropPointWithPointAndDescription: "record",
accessibilityDropPointWithPointAndDescriptionAndIsEnabled: "record",
accessibilityElement: "string",
accessibilityFocused: "bindingFocusBoolean",
accessibilityHeading: "string",
accessibilityHiddenWithBool: "boolean",
accessibilityHiddenWithHiddenAndIsEnabled: "record",
accessibilityHintWithHintAndIsEnabled: "record",
accessibilityHintWithText: "string",
accessibilityIdentifierWithIdentifierAndIsEnabled: "record",
accessibilityIdentifierWithString: "string",
accessibilityIgnoresInvertColors: "boolean",
accessibilityInputLabels: "record",
accessibilityLabeledPair: "record",
accessibilityLabelWithLabelAndIsEnabled: "record",
accessibilityLabelWithText: "string",
accessibilityLinkedGroup: "record",
accessibilityRemoveTraits: "string",
accessibilityRespondsToUserInteractionWithBool: "boolean",
accessibilityRespondsToUserInteractionWithRespondsToUserInteractionAndIsEnabled: "record",
accessibilityRotor: "record",
accessibilityRotorEntry: "record",
accessibilityScrollAction: "eventEnum",
accessibilityScrollStatus: "record",
accessibilityShowsLargeContentViewer: "boolean",
accessibilitySortPriority: "number",
accessibilityTextContentType: "string",
accessibilityValueWithText: "string",
accessibilityValueWithValueDescriptionAndIsEnabled: "record",
accessibilityWithActivationPoint: "string",
accessibilityWithAddTraits: "string",
accessibilityWithHidden: "boolean",
accessibilityWithHint: "string",
accessibilityWithIdentifier: "string",
accessibilityWithLabel: "string",
accessibilityWithRemoveTraits: "string",
accessibilityWithSortPriority: "number",
accessibilityWithValue: "string",
accessibilityZoomAction: "eventStruct",
actionSheet: "record",
addPassToWalletButtonStyle: "string",
alert: "record",
alignmentGuideWithHorizontalAlignment: "record",
alignmentGuideWithVerticalAlignment: "record",
allowedDynamicRange: "optionalEnum",
allowsHitTesting: "boolean",
allowsTightening: "boolean",
allowsWindowActivationEventsWithNoArguments: "boolean",
allowsWindowActivationEventsWithOptionalBool: "optionalBoolean",
anchorPreference: "eventStruct",
animation: "optionalEnum",
appEntityIdentifier: "optionalString",
appEntityUIElements: "registeredValue",
appStoreMerchandising: "record",
appStoreOverlayWithAppClipConfiguration: "record",
appStoreOverlayWithAppConfiguration: "record",
aspectRatio: "record",
assistiveAccessNavigationIconWithImage: "string",
assistiveAccessNavigationIconWithSystemImage: "string",
asyncImageURLSession: "string",
attributedTextFormattingDefinition: "registeredValue",
autocapitalization: "string",
autocorrectionDisabled: "boolean",
backgroundExtensionEffectWithIsEnabled: "boolean",
backgroundExtensionEffectWithNoArguments: "boolean",
backgroundStyle: "style",
badgeProminence: "string",
badgeWithInt: "number",
badgeWithOptionalText: "optionalString",
baselineOffset: "number",
blendMode: "string",
blur: "record",
bold: "boolean",
brightness: "number",
buttonBorderShape: "string",
buttonRepeatBehavior: "string",
buttonSizing: "string",
buttonStyle: "style",
clipped: "boolean",
clipShape: "style",
colorEffect: "record",
colorInvert: "boolean",
colorMultiply: "string",
colorScheme: "string",
compositingGroup: "boolean",
containerCornerOffset: "record",
containerRelativeFrameWithAxesAndAlignment: "record",
containerRelativeFrameWithAxesAndCountAndSpanAndSpacingAndAlignment: "record",
containerShape: "style",
containerValue: "registeredValue",
contentMarginsWithEdgesAndLengthAndPlacement: "record",
contentMarginsWithLengthAndPlacement: "record",
contentShape: "style",
contentTransition: "string",
contrast: "number",
controlGroupStyle: "style",
controlSize: "string",
coordinateSpace: "string",
copyable: "record",
cornerRadiusWithRadiusAndAntialiased: "record",
currentEntitlementTask: "eventAsyncStruct",
cuttable: "eventReturnArray",
dataDetection: "boolean",
datePickerStyle: "style",
defaultAdaptableTabBarPlacement: "string",
defaultAppStorage: "string",
defaultFocus: "defaultFocusBoolean",
defaultHoverEffect: "optionalEnum",
defaultScrollAnchorWithAnchorAndRole: "record",
defaultScrollAnchorWithOptionalUnitPoint: "optionalEnum",
defaultTabBarPlacement: "string",
defersSystemGestures: "string",
deleteDisabled: "boolean",
dialogIcon: "optionalString",
dialogSuppressionToggle: "bindingBoolean",
dialogSuppressionToggleWithLabelAndIsSuppressed: "record",
disableAutocorrection: "optionalBoolean",
disabled: "boolean",
disclosureGroupStyle: "style",
distortionEffect: "record",
documentLaunchSubtitle: "string",
documentLaunchTitle: "string",
dragConfiguration: "boolean",
dragContainer: "dragContainer",
dragContainerSelection: "dragSelection",
draggable: "record",
draggableWithContainerItemID: "dragItemID",
drawingGroup: "record",
dropConfiguration: "eventReturnEnum",
dropDestination: "eventStruct",
dynamicTypeSize: "string",
edgesIgnoringSafeArea: "string",
environment: "registeredValue",
environmentAccessibilityEnabled: "boolean",
environmentAccessibilityPrefersCrossFadeTransitions: "boolean",
environmentAllowedDynamicRange: "optionalEnum",
environmentAllowsTightening: "boolean",
environmentAppearsActive: "boolean",
environmentAutocorrectionDisabled: "boolean",
environmentBackgroundMaterial: "optionalEnum",
environmentBackgroundProminence: "string",
environmentBadgeProminence: "string",
environmentCalendar: "string",
environmentColorScheme: "string",
environmentContentTransition: "string",
environmentContentTransitionAddsDrawingGroup: "boolean",
environmentControlSize: "string",
environmentDefaultMinListHeaderHeight: "optionalNumber",
environmentDefaultMinListRowHeight: "number",
environmentDisableAutocorrection: "optionalBoolean",
environmentDisplayScale: "number",
environmentDynamicTypeSize: "string",
environmentFont: "optionalEnum",
environmentHeaderProminence: "string",
environmentHorizontalScrollBounceBehavior: "string",
environmentHorizontalScrollIndicatorVisibility: "string",
environmentHorizontalSizeClass: "optionalEnum",
environmentImageScale: "string",
environmentIsEnabled: "boolean",
environmentIsFocusEffectEnabled: "boolean",
environmentIsHoverEffectEnabled: "boolean",
environmentIsLuminanceReduced: "boolean",
environmentIsSceneCaptured: "boolean",
environmentIsScrollEnabled: "boolean",
environmentLabelsVisibility: "string",
environmentLayoutDirection: "string",
environmentLegibilityWeight: "optionalEnum",
environmentLineHeight: "optionalEnum",
environmentLineLimit: "optionalNumber",
environmentLineSpacing: "number",
environmentLocale: "string",
environmentMaterialActiveAppearance: "string",
environmentMenuIndicatorVisibility: "string",
environmentMenuOrder: "string",
environmentMinimumScaleFactor: "number",
environmentMultilineTextAlignment: "string",
environmentObject: "registeredValue",
environmentRealityViewCameraControls: "string",
environmentRedactionReasons: "string",
environmentScenePhase: "string",
environmentScrollDismissesKeyboardMode: "string",
environmentSidebarRowSize: "string",
environmentSizeCategory: "string",
environmentSymbolColorRenderingMode: "optionalEnum",
environmentSymbolRenderingMode: "optionalEnum",
environmentSymbolVariableValueMode: "optionalEnum",
environmentSymbolVariants: "string",
environmentSystemPrefersReducedResourceUsage: "boolean",
environmentTextCase: "optionalEnum",
environmentTextSelectionAffinity: "string",
environmentTimeZone: "string",
environmentTruncationMode: "string",
environmentVerticalScrollBounceBehavior: "string",
environmentVerticalScrollIndicatorVisibility: "string",
environmentVerticalSizeClass: "optionalEnum",
equatable: "equatableKey",
fileDialogBrowserOptions: "string",
fileDialogConfirmationLabel: "optionalString",
fileDialogCustomizationID: "string",
fileDialogDefaultDirectory: "optionalURL",
fileDialogImportsUnresolvedAliases: "boolean",
fileDialogMessage: "optionalString",
fileDialogURLEnabled: "boolean",
fileExporter: "record",
fileExporterFilenameLabel: "optionalString",
fileImporterWithIsPresentedAndAllowedContentTypesAndAllowsMultipleSelectionAndOnCompletion: "record",
fileImporterWithIsPresentedAndAllowedContentTypesAndOnCompletion: "record",
fileMover: "record",
findDisabled: "boolean",
findNavigator: "bindingBoolean",
fixedSizeWithHorizontalAndVertical: "record",
fixedSizeWithNoArguments: "boolean",
flipsForRightToLeftLayoutDirection: "boolean",
focusableWithBool: "boolean",
focusableWithIsFocusableAndInteractions: "record",
focused: "bindingFocusBoolean",
focusedObject: "registeredValue",
focusedSceneObject: "registeredValue",
focusedSceneValue: "registeredValue",
focusedValue: "registeredValue",
focusEffectDisabled: "boolean",
font: "optionalEnum",
fontDesignWithOptionalDesign: "optionalEnum",
fontWeightWithOptionalWeight: "optionalEnum",
fontWidth: "optionalEnum",
foregroundColor: "optionalEnum",
formStyle: "style",
frameWithMinWidthAndIdealWidthAndMaxWidthAndMinHeightAndIdealHeightAndMaxHeightAndAlignment: "record",
frameWithNoArguments: "boolean",
frameWithWidthAndHeightAndAlignment: "record",
gaugeStyle: "style",
geometryGroup: "boolean",
gesture: "gesture",
gestureWithUITapRecognizer: "event",
glassEffectID: "record",
glassEffectTransition: "string",
glassEffectUnion: "record",
glassEffectWithGlass: "string",
grayscale: "number",
gridCellAnchor: "string",
gridCellColumns: "number",
gridCellUnsizedAxes: "string",
gridColumnAlignment: "string",
groupBoxStyle: "style",
handGestureShortcut: "record",
handlesExternalEvents: "record",
handlesGameControllerEvents: "string",
headerProminence: "string",
help: "string",
hidden: "boolean",
highPriorityGesture: "gesture",
hoverEffectDisabled: "boolean",
hoverEffectWithHoverEffect: "string",
hoverEffectWithHoverEffectFromSwiftUICore: "string",
hueRotation: "string",
id: "string",
ignoresSafeAreaWithRegionsAndEdgesAndAlignment: "record",
ignoresSafeAreaWithSafeAreaRegions: "string",
imageScale: "string",
inAppPurchaseOptions: "optionSet",
indexViewStyle: "style",
inspectorColumnWidthWithCGFloat: "number",
inspectorColumnWidthWithMinAndIdealAndMax: "record",
interactionActivityTrackingTag: "string",
interactiveDismissDisabled: "boolean",
invalidatableContent: "boolean",
italic: "boolean",
itemProvider: "string",
kerning: "number",
keyboardShortcutWithKeyAndModifiers: "record",
keyboardShortcutWithKeyAndModifiersAndLocalization: "record",
keyboardShortcutWithKeyboardShortcut: "string",
keyboardShortcutWithOptionalKeyboardShortcut: "optionalEnum",
keyboardType: "string",
keyframeAnimator: "keyframeAnimation",
labeledContentStyle: "style",
labelIconToTitleSpacing: "number",
labelReservedIconWidth: "number",
labelsHidden: "boolean",
labelStyle: "style",
labelsVisibility: "string",
layerEffect: "record",
layoutDirectionBehavior: "string",
layoutPriority: "number",
layoutValue: "registeredValue",
lineHeight: "optionalEnum",
lineLimitWithLimitAndReservesSpace: "record",
lineLimitWithOptionalInt: "optionalNumber",
lineSpacing: "number",
listItemTintWithOptionalColor: "optionalEnum",
listItemTintWithOptionalListItemTint: "optionalEnum",
listRowInsets: "record",
listRowSeparator: "record",
listRowSeparatorTint: "record",
listRowSpacing: "optionalNumber",
listSectionIndexVisibility: "string",
listSectionMargins: "record",
listSectionSeparator: "record",
listSectionSeparatorTint: "record",
listSectionSpacingWithCGFloat: "number",
listSectionSpacingWithListSectionSpacing: "string",
listStyle: "style",
lookAroundViewer: "asyncObjectRequest",
luminanceToAlpha: "boolean",
manageSubscriptionsSheet: "bindingBoolean",
manageSubscriptionsSheetWithIsPresentedAndSubscriptionGroupID: "record",
mapCameraKeyframeAnimator: "seedKeyframeAnimation",
mapControlVisibility: "string",
mapFeatureSelectionAccessory: "optionalEnum",
mapFeatureSelectionContent: "registeredValue",
mapFeatureSelectionDisabled: "boolean",
mapItemDetailPopoverWithCurrentLocation: "record",
mapItemDetailPopoverWithCurrentLocationAndArrowEdge: "record",
mapItemDetailSheetWithCurrentLocation: "record",
mapScope: "boolean",
mapStyle: "string",
matchedGeometryEffect: "record",
matchedTransitionSource: "record",
materialActiveAppearance: "string",
menuActionDismissBehavior: "string",
menuIndicator: "string",
menuOrder: "string",
menuStyle: "style",
minimumScaleFactor: "number",
modelContainer: "registeredValue",
modelContext: "registeredValue",
modifier: "registeredValue",
monospaced: "boolean",
monospacedDigit: "boolean",
moveDisabled: "boolean",
multilineTextAlignmentWithStrategy: "string",
multilineTextAlignmentWithTextAlignment: "string",
musicPickerWithMusicVideo: "pickerSelection",
musicPickerWithSong: "pickerSelection",
musicPickerWithTrack: "pickerSelection",
musicSubscriptionOffer: "bindingBoolean",
navigationBarBackButtonHidden: "boolean",
navigationBarHidden: "boolean",
navigationBarTitleDisplayMode: "string",
navigationBarTitleWithText: "string",
navigationBarTitleWithTitleAndDisplayMode: "record",
navigationDocument: "url",
navigationLinkIndicatorVisibility: "string",
navigationSplitViewColumnWidthWithCGFloat: "number",
navigationSplitViewColumnWidthWithMinAndIdealAndMax: "record",
navigationSplitViewStyle: "style",
navigationSubtitle: "string",
navigationTitleWithBindingString: "bindingString",
navigationTitleWithText: "string",
navigationTransition: "style",
navigationViewStyle: "style",
offerCodeRedemption: "bindingBoolean",
offset: "record",
onAppear: "event",
onAppIntentExecution: "registeredValue",
onApplePayCouponCodeChange: "registeredValue",
onApplePayPaymentMethodChange: "registeredValue",
onApplePayShippingContactChange: "registeredValue",
onApplePayShippingMethodChange: "registeredValue",
onCameraCaptureEvent: "eventStruct",
onCameraCaptureEventWithIsEnabledAndDefaultSoundDisabledAndPrimaryActionAndSecondaryAction: "record",
onCameraCaptureEventWithIsEnabledAndPrimaryActionAndSecondaryAction: "record",
onChange: "eventValueString",
onContinueUserActivity: "record",
onContinuousHover: "eventAssociatedEnum",
onDisappear: "event",
onDrag: "string",
onDragSessionUpdated: "eventStruct",
onDrop: "eventDrop",
onDropSessionUpdated: "eventStruct",
onGeometryChangeWithSize: "eventStruct",
onHover: "eventBoolean",
onInAppPurchaseCompletion: "eventAsyncStruct",
onInAppPurchaseStart: "eventAsyncStruct",
onInteractiveResizeChange: "eventBoolean",
onKeyPress: "eventReturnEnum",
onLongPressGesture: "event",
onMapCameraChange: "event",
onMapCameraChangeWithEventStruct: "eventStruct",
onOpenURLWithPerform: "eventString",
onOpenURLWithPrefersInApp: "boolean",
onPencilDoubleTap: "eventStruct",
onPencilSqueeze: "eventAssociatedEnum",
onPreferenceChangePreferredColorScheme: "eventStruct",
onReceive: "eventNotification",
onScrollGeometryChangeWithContainerSize: "eventStruct",
onScrollGeometryChangeWithContentOffset: "eventStruct",
onScrollGeometryChangeWithContentSize: "eventStruct",
onScrollPhaseChange: "eventEnumPair",
onScrollTargetVisibilityChange: "eventStruct",
onScrollVisibilityChange: "eventBoolean",
onSubmit: "event",
onTapGestureWithPerform: "eventStruct",
onTapGestureWithPerformFromSwiftUICore: "event",
paddingWithSet: "string",
paletteSelectionEffect: "string",
pasteDestination: "eventStruct",
payLaterViewAction: "string",
payLaterViewDisplayStyle: "string",
payWithApplePayButtonDisableCardArt: "boolean",
payWithApplePayButtonStyle: "string",
persistentSystemOverlays: "string",
phaseAnimator: "phaseAnimation",
photosPicker: "transferSelection",
photosPickerAccessoryVisibility: "record",
photosPickerDisabledCapabilities: "string",
photosPickerMetadataOptions: "string",
photosPickerSearchText: "optionalString",
photosPickerStyle: "string",
photosReferenceImageViewer: "record",
photosSharedAlbumCreationSheet: "record",
photosSharedAlbumCustomizationSheet: "record",
photosSharedAlbumPostingSheet: "record",
pickerStyle: "style",
position: "record",
postToPhotosSharedAlbumSheet: "record",
preferencePreferredColorScheme: "optionalEnum",
preferredColorScheme: "optionalEnum",
preferredSubscriptionOffer: "selectionID",
preferredSubscriptionPricingTerms: "selectionIndex",
presentationBackground: "style",
presentationBackgroundInteraction: "string",
presentationCompactAdaptationWithHorizontalAdaptationAndVerticalAdaptation: "record",
presentationCompactAdaptationWithPresentationAdaptation: "string",
presentationContentInteraction: "string",
presentationCornerRadius: "optionalNumber",
presentationDetents: "caseSet",
presentationDragIndicator: "string",
presentationPlacement: "string",
presentationSizing: "style",
previewContext: "record",
previewDevice: "optionalString",
previewDisplayName: "optionalString",
previewInterfaceOrientation: "string",
previewLayout: "string",
privacySensitive: "boolean",
productDescription: "string",
productIconBorder: "boolean",
productViewStyle: "style",
progressViewStyle: "style",
projectionEffect: "record",
quickLookPreview: "bindingOptionalString",
realityViewCameraControls: "string",
realityViewLayoutBehavior: "string",
redacted: "string",
refreshable: "eventAsync",
refundRequestSheet: "record",
renameAction: "event",
reorderContainer: "registeredValue",
replaceDisabled: "boolean",
rotation3DEffect: "record",
rotationEffect: "record",
safeAreaPaddingWithCGFloat: "number",
safeAreaPaddingWithSet: "string",
saturation: "number",
scaledToFill: "boolean",
scaledToFit: "boolean",
scaleEffectWithSAndAnchor: "record",
scaleEffectWithXAndYAndAnchor: "record",
scenePaddingWithPaddingAndEdges: "record",
scenePaddingWithSet: "string",
scrollBounceBehavior: "record",
scrollClipDisabled: "boolean",
scrollContentBackground: "string",
scrollDisabled: "boolean",
scrollDismissesKeyboard: "string",
scrollEdgeEffectHidden: "record",
scrollEdgeEffectStyle: "record",
scrollIndicators: "record",
scrollIndicatorsFlash: "boolean",
scrollPositionWithBindingPoint: "bindingPoint",
scrollPositionWithId: "bindingOptionalString",
scrollTargetBehavior: "style",
scrollTargetLayout: "boolean",
scrollTransition: "visualEffect",
searchable: "bindingString",
searchCompletion: "string",
searchDictationBehavior: "string",
searchFocused: "bindingFocusBoolean",
searchPresentationToolbarBehavior: "string",
searchSelection: "bindingTextSelection",
searchSuggestions: "record",
searchToolbarBehavior: "string",
sectionIndexLabel: "optionalString",
selectionDisabled: "boolean",
sensoryFeedback: "record",
shadow: "record",
shortcutsLinkStyle: "string",
signInWithAppleButtonStyle: "string",
simultaneousGesture: "gesture",
siriTipViewStyle: "string",
sliderThumbVisibility: "string",
speechAdjustedPitch: "number",
speechAlwaysIncludesPunctuation: "boolean",
speechAnnouncementsQueued: "boolean",
speechSpellsOutCharacters: "boolean",
springLoadingBehavior: "string",
statusBar: "boolean",
statusBarHidden: "boolean",
storeButton: "record",
storeProductsTask: "eventAsyncStruct",
storeProductTask: "eventAsyncStruct",
strikethrough: "record",
submitLabel: "string",
submitScope: "boolean",
subscriptionIntroductoryOffer: "eventAsyncString",
subscriptionOfferViewButtonVisibility: "record",
subscriptionOfferViewDetailAction: "event",
subscriptionOfferViewStyle: "style",
subscriptionPromotionalOffer: "eventAsyncString",
subscriptionStatusTask: "eventAsyncStruct",
subscriptionStoreButtonLabel: "string",
subscriptionStoreControlBackground: "string",
subscriptionStoreControlStyle: "style",
subscriptionStoreOptionGroupStyle: "style",
subscriptionStorePickerItemBackground: "style",
subscriptionStorePolicyDestination: "record",
subscriptionStorePolicyForegroundStyle: "style",
subscriptionStoreSignInAction: "event",
swipeActionsContainer: "boolean",
symbolColorRenderingMode: "optionalEnum",
symbolEffect: "style",
symbolEffectsRemoved: "boolean",
symbolRenderingMode: "optionalEnum",
symbolVariableValueMode: "optionalEnum",
symbolVariant: "string",
tabBarMinimizeBehavior: "string",
tableColumnHeaders: "string",
tableStyle: "style",
tabViewCustomization: "bindingCodable",
tabViewSearchActivation: "string",
tabViewStyle: "style",
tag: "string",
task: "eventAsync",
textCase: "optionalEnum",
textContentType: "optionalEnum",
textEditorStyle: "style",
textFieldStyle: "style",
textInputAutocapitalization: "optionalEnum",
textInputBorderShape: "string",
textInputFormattingControlVisibility: "record",
textRenderer: "registeredValue",
textScale: "record",
textSelection: "style",
textSelectionAffinity: "string",
tintWithOptionalColor: "optionalEnum",
toggleStyle: "style",
toolbarBackground: "record",
toolbarBackgroundVisibility: "record",
toolbarColorScheme: "record",
toolbarMinimizationBehavior: "record",
toolbarMinimizationRestoration: "record",
toolbarMinimizationSafeAreaAdjustment: "record",
toolbarRole: "string",
toolbarTitleDisplayMode: "string",
toolbarVisibility: "record",
toolbarWithRemoving: "optionalEnum",
toolbarWithVisibilityAndBars: "record",
tracking: "number",
transaction: "record",
transactionTask: "registeredValue",
transformAnchorPreference: "eventStruct",
transformEffect: "record",
transformEnvironmentAccessibilityEnabled: "boolean",
transformEnvironmentAccessibilityPrefersCrossFadeTransitions: "boolean",
transformEnvironmentAllowsTightening: "boolean",
transformEnvironmentAppearsActive: "boolean",
transformEnvironmentAutocorrectionDisabled: "boolean",
transformEnvironmentContentTransitionAddsDrawingGroup: "boolean",
transformEnvironmentDefaultMinListRowHeight: "number",
transformEnvironmentDisplayScale: "number",
transformEnvironmentIsEnabled: "boolean",
transformEnvironmentIsFocusEffectEnabled: "boolean",
transformEnvironmentIsHoverEffectEnabled: "boolean",
transformEnvironmentIsLuminanceReduced: "boolean",
transformEnvironmentIsSceneCaptured: "boolean",
transformEnvironmentIsScrollEnabled: "boolean",
transformEnvironmentLineSpacing: "number",
transformEnvironmentMinimumScaleFactor: "number",
transformEnvironmentSystemPrefersReducedResourceUsage: "boolean",
transformPreferencePreferredColorScheme: "optionalEnum",
transition: "string",
translationPresentation: "record",
translationTask: "sessionRequest",
truncationMode: "string",
typeSelectEquivalent: "optionalString",
typesettingLanguage: "record",
underline: "record",
unredacted: "boolean",
userActivity: "record",
verifyIdentityWithWalletButtonStyle: "string",
visualEffect: "visualEffect",
webViewBackForwardNavigationGestures: "string",
webViewContentBackground: "string",
webViewElementFullscreenBehavior: "string",
webViewLinkPreviews: "string",
webViewMagnificationGestures: "string",
webViewOnScrollGeometryChangeWithContainerSize: "eventStruct",
webViewOnScrollGeometryChangeWithContentOffset: "eventStruct",
webViewOnScrollGeometryChangeWithContentSize: "eventStruct",
webViewScrollPosition: "bindingPoint",
webViewTextSelection: "style",
windowToolbarFullScreenVisibility: "string",
workoutPreview: "record",
writingDirection: "string",
writingToolsAffordanceVisibility: "string",
writingToolsBehavior: "string",
zIndex: "number"
};
const sdkSeedKeyframeFields = { mapCameraKeyframeAnimator: [
"distance",
"heading",
"pitch"
] };
function validScalarEffect(effect, value) {
if (typeof value !== "number" || !Number.isFinite(value)) return false;
if (effect === "opacity") return value >= 0 && value <= 1;
return (effect === "scale" || effect === "blur") && value >= 0;
}
const sdkEventCases = {
accessibilityAdjustableAction: ["increment", "decrement"],
accessibilityScrollAction: [
"top",
"leading",
"bottom",
"trailing"
],
dropConfiguration: [
"cancel",
"forbidden",
"copy",
"move"
],
onKeyPress: ["handled", "ignored"],
onScrollPhaseChange: [
"idle",
"tracking",
"interacting",
"decelerating",
"animating"
],
presentationDetents: ["medium", "large"]
};
const sdkVisualEffects = {
scrollTransition: ["opacity", "scaleEffect"],
visualEffect: ["opacity", "scaleEffect"]
};
const sdkOptionSets = { inAppPurchaseOptions: [
{
field: "quantity",
kind: "number"
},
{
field: "simulatesAskToBuyInSandbox",
kind: "boolean"
},
{
field: "introductoryOfferEligibility",
kind: "string"
}
] };
const sdkAssociatedCases = {
onContinuousHover: {
active: [{ kind: "point" }],
ended: []
},
onPencilSqueeze: {
active: [{
kind: "object",
fields: [{
name: "hoverPose",
value: {
kind: "optional",
value: {
kind: "object",
fields: [
{
name: "location",
value: { kind: "point" }
},
{
name: "anchor",
value: {
kind: "object",
fields: [{
name: "x",
value: { kind: "number" }
}, {
name: "y",
value: { kind: "number" }
}]
}
},
{
name: "zDistance",
value: { kind: "number" }
},
{
name: "altitude",
value: {
kind: "object",
fields: [{
name: "radians",
value: { kind: "number" }
}]
}
},
{
name: "azimuth",
value: {
kind: "object",
fields: [{
name: "radians",
value: { kind: "number" }
}]
}
},
{
name: "roll",
value: {
kind: "object",
fields: [{
name: "radians",
value: { kind: "number" }
}]
}
}
]
}
}
}]
}],
ended: [{
kind: "object",
fields: [{
name: "hoverPose",
value: {
kind: "optional",
value: {
kind: "object",
fields: [
{
name: "location",
value: { kind: "point" }
},
{
name: "anchor",
value: {
kind: "object",
fields: [{
name: "x",
value: { kind: "number" }
}, {
name: "y",
value: { kind: "number" }
}]
}
},
{
name: "zDistance",
value: { kind: "number" }
},
{
name: "altitude",
value: {
kind: "object",
fields: [{
name: "radians",
value: { kind: "number" }
}]
}
},
{
name: "azimuth",
value: {
kind: "object",
fields: [{
name: "radians",
value: { kind: "number" }
}]
}
},
{
name: "roll",
value: {
kind: "object",
fields: [{
name: "radians",
value: { kind: "number" }
}]
}
}
]
}
}
}]
}],
failed: []
}
};
const sdkEventStructs = {
accessibilityZoomAction: {
kind: "object",
fields: [
{
name: "direction",
value: {
kind: "enum",
cases: ["zoomIn", "zoomOut"]
}
},
{
name: "location",
value: {
kind: "object",
fields: [{
name: "x",
value: { kind: "number" }
}, {
name: "y",
value: { kind: "number" }
}]
}
},
{
name: "point",
value: { kind: "point" }
}
]
},
anchorPreference: {
kind: "object",
fields: [{
name: "origin",
value: { kind: "point" }
}, {
name: "size",
value: { kind: "size" }
}]
},
currentEntitlementTask: {
kind: "associatedEnum",
cases: [
{
name: "loading",
values: []
},
{
name: "failure",
values: [{ kind: "description" }]
},
{
name: "success",
values: [{
kind: "optional",
value: { kind: "verification" }
}]
}
],
open: true
},
dropConfiguration: {
kind: "object",
fields: [
{
name: "itemsCount",
value: { kind: "number" }
},
{
name: "suggestedOperations",
value: {
kind: "object",
fields: [{
name: "rawValue",
value: { kind: "number" }
}]
}
},
{
name: "size",
value: { kind: "size" }
},
{
name: "location",
value: { kind: "point" }
}
]
},
dropDestination: {
kind: "object",
fields: [{
name: "items",
value: {
kind: "array",
value: { kind: "string" }
}
}, {
name: "session",
value: {
kind: "object",
fields: [
{
name: "itemsCount",
value: { kind: "number" }
},
{
name: "suggestedOperations",
value: {
kind: "object",
fields: [{
name: "rawValue",
value: { kind: "number" }
}]
}
},
{
name: "size",
value: { kind: "size" }
},
{
name: "location",
value: { kind: "point" }
}
]
}
}]
},
onCameraCaptureEvent: {
kind: "object",
fields: [{
name: "phase",
value: {
kind: "enum",
cases: [
"began",
"cancelled",
"ended"
],
open: true
}
}]
},
onDragSessionUpdated: {
kind: "object",
fields: [{
name: "location",
value: { kind: "point" }
}]
},
onDrop: {
kind: "object",
fields: [{
name: "type",
value: { kind: "string" }
}, {
name: "data",
value: { kind: "string" }
}]
},
onDropSessionUpdated: {
kind: "object",
fields: [
{
name: "itemsCount",
value: { kind: "number" }
},
{
name: "suggestedOperations",
value: {
kind: "object",
fields: [{
name: "rawValue",
value: { kind: "number" }
}]
}
},
{
name: "size",
value: { kind: "size" }
},
{
name: "location",
value: { kind: "point" }
}
]
},
onGeometryChangeWithSize: {
kind: "object",
fields: [{
name: "oldValue",
value: { kind: "size" }
}, {
name: "newValue",
value: { kind: "size" }
}]
},
onInAppPurchaseCompletion: {
kind: "object",
fields: [{
name: "value",
value: {
kind: "object",
fields: [
{
name: "id",
value: { kind: "string" }
},
{
name: "type",
value: {
kind: "object",
fields: [{
name: "rawValue",
value: { kind: "string" }
}]
}
},
{
name: "displayName",
value: { kind: "string" }
},
{
name: "description",
value: { kind: "string" }
},
{
name: "displayPrice",
value: { kind: "string" }
},
{
name: "isFamilyShareable",
value: { kind: "boolean" }
}
]
}
}, {
name: "result",
value: {
kind: "result",
value: {
kind: "associatedEnum",
cases: [
{
name: "success",
values: [{ kind: "verification" }]
},
{
name: "userCancelled",
values: []
},
{
name: "pending",
values: []
}
],
open: true
}
}
}]
},
onInAppPurchaseStart: {
kind: "object",
fields: [
{
name: "id",
value: { kind: "string" }
},
{
name: "type",
value: {
kind: "object",
fields: [{
name: "rawValue",
value: { kind: "string" }
}]
}
},
{
name: "displayName",
value: { kind: "string" }
},
{
name: "description",
value: { kind: "string" }
},
{
name: "displayPrice",
value: { kind: "string" }
},
{
name: "isFamilyShareable",
value: { kind: "boolean" }
}
]
},
onKeyPress: {
kind: "object",
fields: [{
name: "characters",
value: { kind: "string" }
}, {
name: "modifiers",
value: {
kind: "object",
fields: [{
name: "rawValue",
value: { kind: "number" }
}]
}
}]
},
onMapCameraChangeWithEventStruct: {
kind: "object",
fields: [{
name: "camera",
value: {
kind: "object",
fields: [
{
name: "distance",
value: { kind: "number" }
},
{
name: "heading",
value: { kind: "number" }
},
{
name: "pitch",
value: { kind: "number" }
}
]
}
}]
},
onPencilDoubleTap: {
kind: "object",
fields: [{
name: "hoverPose",
value: {
kind: "optional",
value: {
kind: "object",
fields: [
{
name: "location",
value: { kind: "point" }
},
{
name: "anchor",
value: {
kind: "object",
fields: [{
name: "x",
value: { kind: "number" }
}, {
name: "y",
value: { kind: "number" }
}]
}
},
{
name: "zDistance",
value: { kind: "number" }
},
{
name: "altitude",
value: {
kind: "object",
fields: [{
name: "radians",
value: { kind: "number" }
}]
}
},
{
name: "azimuth",
value: {
kind: "object",
fields: [{
name: "radians",
value: { kind: "number" }
}]
}
},
{
name: "roll",
value: {
kind: "object",
fields: [{
name: "radians",
value: { kind: "number" }
}]
}
}
]
}
}
}]
},
onPreferenceChangePreferredColorScheme: {
kind: "optional",
value: {
kind: "enum",
cases: ["light", "dark"],
open: true
}
},
onScrollGeometryChangeWithContainerSize: {
kind: "object",
fields: [{
name: "oldValue",
value: { kind: "size" }
}, {
name: "newValue",
value: { kind: "size" }
}]
},
onScrollGeometryChangeWithContentOffset: {
kind: "object",
fields: [{
name: "oldValue",
value: { kind: "point" }
}, {
name: "newValue",
value: { kind: "point" }
}]
},
onScrollGeometryChangeWithContentSize: {
kind: "object",
fields: [{
name: "oldValue",
value: { kind: "size" }
}, {
name: "newValue",
value: { kind: "size" }
}]
},
onScrollTargetVisibilityChange: {
kind: "array",
value: { kind: "string" }
},
onTapGestureWithPerform: { kind: "point" },
pasteDestination: {
kind: "array",
value: { kind: "string" }
},
storeProductsTask: {
kind: "associatedEnum",
cases: [
{
name: "loading",
values: []
},
{
name: "failure",
values: [{ kind: "description" }]
},
{
name: "success",
values: [{
kind: "array",
value: {
kind: "object",
fields: [
{
name: "id",
value: { kind: "string" }
},
{
name: "type",
value: {
kind: "object",
fields: [{
name: "rawValue",
value: { kind: "string" }
}]
}
},
{
name: "displayName",
value: { kind: "string" }
},
{
name: "description",
value: { kind: "string" }
},
{
name: "displayPrice",
value: { kind: "string" }
},
{
name: "isFamilyShareable",
value: { kind: "boolean" }
}
]
}
}, {
kind: "array",
value: { kind: "string" }
}]
}
],
open: true
},
storeProductTask: {
kind: "associatedEnum",
cases: [
{
name: "loading",
values: []
},
{
name: "unavailable",
values: []
},
{
name: "failure",
values: [{ kind: "description" }]
},
{
name: "success",
values: [{
kind: "object",
fields: [
{
name: "id",
value: { kind: "string" }
},
{
name: "type",
value: {
kind: "object",
fields: [{
name: "rawValue",
value: { kind: "string" }
}]
}
},
{
name: "displayName",
value: { kind: "string" }
},
{
name: "description",
value: { kind: "string" }
},
{
name: "displayPrice",
value: { kind: "string" }
},
{
name: "isFamilyShareable",
value: { kind: "boolean" }
}
]
}]
}
],
open: true
},
subscriptionIntroductoryOffer: {
kind: "object",
fields: [{
name: "product",
value: {
kind: "object",
fields: [
{
name: "id",
value: { kind: "string" }
},
{
name: "type",
value: {
kind: "object",
fields: [{
name: "rawValue",
value: { kind: "string" }
}]
}
},
{
name: "displayName",
value: { kind: "string" }
},
{
name: "description",
value: { kind: "string" }
},
{
name: "displayPrice",
value: { kind: "string" }
},
{
name: "isFamilyShareable",
value: { kind: "boolean" }
}
]
}
}, {
name: "subscriptionInfo",
value: {
kind: "object",
fields: [{
name: "subscriptionGroupID",
value: { kind: "string" }
}]
}
}]
},
subscriptionPromotionalOffer: {
kind: "object",
fields: [
{
name: "product",
value: {
kind: "object",
fields: [
{
name: "id",
value: { kind: "string" }
},
{
name: "type",
value: {
kind: "object",
fields: [{
name: "rawValue",
value: { kind: "string" }
}]
}
},
{
name: "displayName",
value: { kind: "string" }
},
{
name: "description",
value: { kind: "string" }
},
{
name: "displayPrice",
value: { kind: "string" }
},
{
name: "isFamilyShareable",
value: { kind: "boolean" }
}
]
}
},
{
name: "subscriptionInfo",
value: {
kind: "object",
fields: [{
name: "subscriptionGroupID",
value: { kind: "string" }
}]
}
},
{
name: "promotionalOffer",
value: {
kind: "object",
fields: [
{
name: "id",
value: {
kind: "optional",
value: { kind: "string" }
}
},
{
name: "type",
value: {
kind: "object",
fields: [{
name: "rawValue",
value: { kind: "string" }
}]
}
},
{
name: "displayPrice",
value: { kind: "string" }
},
{
name: "periodCount",
value: { kind: "number" }
},
{
name: "paymentMode",
value: {
kind: "object",
fields: [{
name: "rawValue",
value: { kind: "string" }
}]
}
}
]
}
}
]
},
subscriptionStatusTask: {
kind: "associatedEnum",
cases: [
{
name: "loading",
values: []
},
{
name: "failure",
values: [{ kind: "description" }]
},
{
name: "success",
values: [{
kind: "array",
value: {
kind: "object",
fields: [
{
name: "state",
value: {
kind: "object",
fields: [{
name: "rawValue",
value: { kind: "number" }
}]
}
},
{
name: "transaction",
value: { kind: "verification" }
},
{
name: "renewalInfo",
value: { kind: "verification" }
}
]
}
}]
}
],
open: true
},
transformAnchorPreference: {
kind: "object",
fields: [{
name: "origin",
value: { kind: "point" }
}, {
name: "size",
value: { kind: "size" }
}]
},
webViewOnScrollGeometryChangeWithContainerSize: {
kind: "object",
fields: [{
name: "oldValue",
value: { kind: "size" }
}, {
name: "newValue",
value: { kind: "size" }
}]
},
webViewOnScrollGeometryChangeWithContentOffset: {
kind: "object",
fields: [{
name: "oldValue",
value: { kind: "point" }
}, {
name: "newValue",
value: { kind: "point" }
}]
},
webViewOnScrollGeometryChangeWithContentSize: {
kind: "object",
fields: [{
name: "oldValue",
value: { kind: "size" }
}, {
name: "newValue",
value: { kind: "size" }
}]
}
};
const sdkAsyncArguments = {
currentEntitlementTask: [{
field: "productID",
kind: "string"
}],
storeProductsTask: [{
field: "ids",
kind: "stringArray"
}],
storeProductTask: [{
field: "id",
kind: "string"
}],
subscriptionStatusTask: [{
field: "groupID",
kind: "string"
}]
};
const sdkAsyncStringFields = {
subscriptionIntroductoryOffer: {
predicate: "applyOffer",
callback: "compactJWS",
selects: false
},
subscriptionPromotionalOffer: {
predicate: "offer",
callback: "compactJWS",
selects: true
}
};
const sdkSessionRequests = { translationTask: {
inputField: "sourceText",
outputFields: ["sourceText", "targetText"]
} };
const sdkAsyncObjectRequestBindings = { lookAroundViewer: "isPresented" };
const sdkGestureOptions = {
gesture: {
drag: {
kind: "object",
fields: [{
name: "location",
value: { kind: "point" }
}, {
name: "startLocation",
value: { kind: "point" }
}]
},
longPress: { kind: "boolean" },
magnify: {
kind: "object",
fields: [
{
name: "magnification",
value: { kind: "number" }
},
{
name: "velocity",
value: { kind: "number" }
},
{
name: "startAnchor",
value: {
kind: "object",
fields: [{
name: "x",
value: { kind: "number" }
}, {
name: "y",
value: { kind: "number" }
}]
}
},
{
name: "startLocation",
value: { kind: "point" }
}
]
},
rotate: {
kind: "object",
fields: [
{
name: "rotation",
value: {
kind: "object",
fields: [{
name: "radians",
value: { kind: "number" }
}]
}
},
{
name: "velocity",
value: {
kind: "object",
fields: [{
name: "radians",
value: { kind: "number" }
}]
}
},
{
name: "startAnchor",
value: {
kind: "object",
fields: [{
name: "x",
value: { kind: "number" }
}, {
name: "y",
value: { kind: "number" }
}]
}
},
{
name: "startLocation",
value: { kind: "point" }
}
]
},
spatialTap: {
kind: "object",
fields: [{
name: "location",
value: { kind: "point" }
}]
},
tap: null
},
highPriorityGesture: {
drag: {
kind: "object",
fields: [{
name: "location",
value: { kind: "point" }
}, {
name: "startLocation",
value: { kind: "point" }
}]
},
longPress: { kind: "boolean" },
magnify: {
kind: "object",
fields: [
{
name: "magnification",
value: { kind: "number" }
},
{
name: "velocity",
value: { kind: "number" }
},
{
name: "startAnchor",
value: {
kind: "object",
fields: [{
name: "x",
value: { kind: "number" }
}, {
name: "y",
value: { kind: "number" }
}]
}
},
{
name: "startLocation",
value: { kind: "point" }
}
]
},
rotate: {
kind: "object",
fields: [
{
name: "rotation",
value: {
kind: "object",
fields: [{
name: "radians",
value: { kind: "number" }
}]
}
},
{
name: "velocity",
value: {
kind: "object",
fields: [{
name: "radians",
value: { kind: "number" }
}]
}
},
{
name: "startAnchor",
value: {
kind: "object",
fields: [{
name: "x",
value: { kind: "number" }
}, {
name: "y",
value: { kind: "number" }
}]
}
},
{
name: "startLocation",
value: { kind: "point" }
}
]
},
spatialTap: {
kind: "object",
fields: [{
name: "location",
value: { kind: "point" }
}]
},
tap: null
},
simultaneousGesture: {
drag: {
kind: "object",
fields: [{
name: "location",
value: { kind: "point" }
}, {
name: "startLocation",
value: { kind: "point" }
}]
},
longPress: { kind: "boolean" },
magnify: {
kind: "object",
fields: [
{
name: "magnification",
value: { kind: "number" }
},
{
name: "velocity",
value: { kind: "number" }
},
{
name: "startAnchor",
value: {
kind: "object",
fields: [{
name: "x",
value: { kind: "number" }
}, {
name: "y",
value: { kind: "number" }
}]
}
},
{
name: "startLocation",
value: { kind: "point" }
}
]
},
rotate: {
kind: "object",
fields: [
{
name: "rotation",
value: {
kind: "object",
fields: [{
name: "radians",
value: { kind: "number" }
}]
}
},
{
name: "velocity",
value: {
kind: "object",
fields: [{
name: "radians",
value: { kind: "number" }
}]
}
},
{
name: "startAnchor",
value: {
kind: "object",
fields: [{
name: "x",
value: { kind: "number" }
}, {
name: "y",
value: { kind: "number" }
}]
}
},
{
name: "startLocation",
value: { kind: "point" }
}
]
},
spatialTap: {
kind: "object",
fields: [{
name: "location",
value: { kind: "point" }
}]
},
tap: null
}
};
const sdkCodableOptional = { tabViewCustomization: true };
const sdkRecords = {
accessibilityActivationPointWithActivationPointAndIsEnabled: [{
field: "activationPoint",
kind: "enum",
optional: false
}, {
field: "isEnabled",
kind: "boolean",
optional: false
}],
accessibilityCustomContent: [{
field: "label",
kind: "string",
optional: false
}, {
field: "value",
kind: "string",
optional: false
}],
accessibilityDirectTouch: [{
field: "isDirectTouchArea",
kind: "boolean",
optional: false
}, {
field: "options",
kind: "enum",
optional: false
}],
accessibilityDragPointWithPointAndDescription: [{
field: "point",
kind: "enum",
optional: false
}, {
field: "description",
kind: "string",
optional: false
}],
accessibilityDragPointWithPointAndDescriptionAndIsEnabled: [
{
field: "point",
kind: "enum",
optional: false
},
{
field: "description",
kind: "string",
optional: false
},
{
field: "isEnabled",
kind: "boolean",
optional: false
}
],
accessibilityDropPointWithPointAndDescription: [{
field: "point",
kind: "enum",
optional: false
}, {
field: "description",
kind: "string",
optional: false
}],
accessibilityDropPointWithPointAndDescriptionAndIsEnabled: [
{
field: "point",
kind: "enum",
optional: false
},
{
field: "description",
kind: "string",
optional: false
},
{
field: "isEnabled",
kind: "boolean",
optional: false
}
],
accessibilityHiddenWithHiddenAndIsEnabled: [{
field: "hidden",
kind: "boolean",
optional: false
}, {
field: "isEnabled",
kind: "boolean",
optional: false
}],
accessibilityHintWithHintAndIsEnabled: [{
field: "hint",
kind: "string",
optional: false
}, {
field: "isEnabled",
kind: "boolean",
optional: false
}],
accessibilityIdentifierWithIdentifierAndIsEnabled: [{
field: "identifier",
kind: "string",
optional: false
}, {
field: "isEnabled",
kind: "boolean",
optional: false
}],
accessibilityInputLabels: [{
field: "inputLabels",
kind: "stringArray",
optional: false
}, {
field: "isEnabled",
kind: "boolean",
optional: false
}],
accessibilityLabeledPair: [{
field: "role",
kind: "enum",
optional: false
}, {
field: "id",
kind: "string",
optional: false
}],
accessibilityLabelWithLabelAndIsEnabled: [{
field: "label",
kind: "string",
optional: false
}, {
field: "isEnabled",
kind: "boolean",
optional: false
}],
accessibilityLinkedGroup: [{
field: "id",
kind: "string",
optional: false
}],
accessibilityRespondsToUserInteractionWithRespondsToUserInteractionAndIsEnabled: [{
field: "respondsToUserInteraction",
kind: "boolean",
optional: false
}, {
field: "isEnabled",
kind: "boolean",
optional: false
}],
accessibilityRotor: [{
field: "rotorLabel",
kind: "string",
optional: false
}, {
field: "entries",
kind: "stringArray",
optional: false,
unique: true
}],
accessibilityRotorEntry: [{
field: "id",
kind: "string",
optional: false
}],
accessibilityScrollStatus: [{
field: "status",
kind: "string",
optional: false
}, {
field: "isEnabled",
kind: "boolean",
optional: false
}],
accessibilityValueWithValueDescriptionAndIsEnabled: [{
field: "valueDescription",
kind: "string",
optional: false
}, {
field: "isEnabled",
kind: "boolean",
optional: false
}],
actionSheet: [{
field: "isPresented",
kind: "bindingBoolean",
optional: false
}, {
field: "title",
kind: "string",
optional: false
}],
alert: [{
field: "isPresented",
kind: "bindingBoolean",
optional: false
}, {
field: "title",
kind: "string",
optional: false
}],
alignmentGuideWithHorizontalAlignment: [{
field: "g",
kind: "enum",
optional: false
}, {
field: "computeValue",
kind: "number",
optional: false
}],
alignmentGuideWithVerticalAlignment: [{
field: "g",
kind: "enum",
optional: false
}, {
field: "computeValue",
kind: "number",
optional: false
}],
appStoreMerchandising: [{
field: "isPresented",
kind: "bindingBoolean",
optional: false
}, {
field: "kind",
kind: "string",
optional: false
}],
appStoreOverlayWithAppClipConfiguration: [{
field: "isPresented",
kind: "bindingBoolean",
optional: false
}, {
field: "position",
kind: "enum",
optional: false
}],
appStoreOverlayWithAppConfiguration: [
{
field: "isPresented",
kind: "bindingBoolean",
optional: false
},
{
field: "appIdentifier",
kind: "string",
optional: false
},
{
field: "position",
kind: "enum",
optional: false
}
],
aspectRatio: [{
field: "aspectRatio",
kind: "number",
optional: true
}, {
field: "contentMode",
kind: "enum",
optional: false
}],
blur: [{
field: "radius",
kind: "number",
optional: false
}, {
field: "opaque",
kind: "boolean",
optional: false
}],
colorEffect: [{
field: "shader",
kind: "string",
optional: false
}, {
field: "isEnabled",
kind: "boolean",
optional: false
}],
containerCornerOffset: [{
field: "edges",
kind: "enum",
optional: false
}, {
field: "sizeToFit",
kind: "boolean",
optional: false
}],
containerRelativeFrameWithAxesAndAlignment: [{
field: "axes",
kind: "enum",
optional: false
}, {
field: "alignment",
kind: "enum",
optional: false
}],
containerRelativeFrameWithAxesAndCountAndSpanAndSpacingAndAlignment: [
{
field: "axes",
kind: "enum",
optional: false
},
{
field: "count",
kind: "number",
optional: false
},
{
field: "span",
kind: "number",
optional: false
},
{
field: "spacing",
kind: "number",
optional: false
},
{
field: "alignment",
kind: "enum",
optional: false
}
],
contentMarginsWithEdgesAndLengthAndPlacement: [
{
field: "edges",
kind: "enum",
optional: false
},
{
field: "length",
kind: "number",
optional: true
},
{
field: "placement",
kind: "enum",
optional: false
}
],
contentMarginsWithLengthAndPlacement: [{
field: "length",
kind: "number",
optional: false
}, {
field: "placement",
kind: "enum",
optional: false
}],
copyable: [{
field: "payload",
kind: "stringArray",
optional: false
}],
cornerRadiusWithRadiusAndAntialiased: [{
field: "radius",
kind: "number",
optional: false
}, {
field: "antialiased",
kind: "boolean",
optional: false
}],
defaultScrollAnchorWithAnchorAndRole: [{
field: "anchor",
kind: "enum",
optional: true
}, {
field: "role",
kind: "enum",
optional: false
}],
dialogSuppressionToggleWithLabelAndIsSuppressed: [{
field: "label",
kind: "string",
optional: false
}, {
field: "isSuppressed",
kind: "bindingBoolean",
optional: false
}],
distortionEffect: [
{
field: "shader",
kind: "string",
optional: false
},
{
field: "maxSampleOffset",
kind: "numericStruct",
optional: false,
fields: [{
name: "width",
type: "CoreFoundation.CGFloat",
integer: false
}, {
name: "height",
type: "CoreFoundation.CGFloat",
integer: false
}]
},
{
field: "isEnabled",
kind: "boolean",
optional: false
}
],
draggable: [{
field: "payload",
kind: "string",
optional: false
}],
drawingGroup: [{
field: "opaque",
kind: "boolean",
optional: false
}, {
field: "colorMode",
kind: "enum",
optional: false
}],
fileExporter: [
{
field: "isPresented",
kind: "bindingBoolean",
optional: false
},
{
field: "item",
kind: "string",
optional: true
},
{
field: "onCompletion",
kind: "resultURL",
optional: false
}
],
fileImporterWithIsPresentedAndAllowedContentTypesAndAllowsMultipleSelectionAndOnCompletion: [
{
field: "isPresented",
kind: "bindingBoolean",
optional: false
},
{
field: "allowedContentTypes",
kind: "stringArray",
optional: false
},
{
field: "allowsMultipleSelection",
kind: "boolean",
optional: false
},
{
field: "onCompletion",
kind: "resultURLArray",
optional: false
}
],
fileImporterWithIsPresentedAndAllowedContentTypesAndOnCompletion: [
{
field: "isPresented",
kind: "bindingBoolean",
optional: false
},
{
field: "allowedContentTypes",
kind: "stringArray",
optional: false
},
{
field: "onCompletion",
kind: "resultURL",
optional: false
}
],
fileMover: [
{
field: "isPresented",
kind: "bindingBoolean",
optional: false
},
{
field: "file",
kind: "url",
optional: true
},
{
field: "onCompletion",
kind: "resultURL",
optional: false
}
],
fixedSizeWithHorizontalAndVertical: [{
field: "horizontal",
kind: "boolean",
optional: false
}, {
field: "vertical",
kind: "boolean",
optional: false
}],
focusableWithIsFocusableAndInteractions: [{
field: "isFocusable",
kind: "boolean",
optional: false
}, {
field: "interactions",
kind: "enum",
optional: false
}],
frameWithMinWidthAndIdealWidthAndMaxWidthAndMinHeightAndIdealHeightAndMaxHeightAndAlignment: [
{
field: "minWidth",
kind: "number",
optional: true
},
{
field: "idealWidth",
kind: "number",
optional: true
},
{
field: "maxWidth",
kind: "number",
optional: true
},
{
field: "minHeight",
kind: "number",
optional: true
},
{
field: "idealHeight",
kind: "number",
optional: true
},
{
field: "maxHeight",
kind: "number",
optional: true
},
{
field: "alignment",
kind: "enum",
optional: false
}
],
frameWithWidthAndHeightAndAlignment: [
{
field: "width",
kind: "number",
optional: true
},
{
field: "height",
kind: "number",
optional: true
},
{
field: "alignment",
kind: "enum",
optional: false
}
],
glassEffectID: [{
field: "id",
kind: "string",
optional: true
}],
glassEffectUnion: [{
field: "id",
kind: "string",
optional: true
}],
handGestureShortcut: [{
field: "shortcut",
kind: "enum",
optional: false
}, {
field: "isEnabled",
kind: "boolean",
optional: false
}],
handlesExternalEvents: [{
field: "preferring",
kind: "stringSet",
optional: false
}, {
field: "allowing",
kind: "stringSet",
optional: false
}],
ignoresSafeAreaWithRegionsAndEdgesAndAlignment: [
{
field: "regions",
kind: "enum",
optional: false
},
{
field: "edges",
kind: "enum",
optional: false
},
{
field: "alignment",
kind: "enum",
optional: true
}
],
inspectorColumnWidthWithMinAndIdealAndMax: [
{
field: "min",
kind: "number",
optional: true
},
{
field: "ideal",
kind: "number",
optional: false
},
{
field: "max",
kind: "number",
optional: true
}
],
keyboardShortcutWithKeyAndModifiers: [{
field: "key",
kind: "enum",
optional: false
}, {
field: "modifiers",
kind: "enum",
optional: false
}],
keyboardShortcutWithKeyAndModifiersAndLocalization: [
{
field: "key",
kind: "enum",
optional: false
},
{
field: "modifiers",
kind: "enum",
optional: false
},
{
field: "localization",
kind: "enum",
optional: false
}
],
layerEffect: [
{
field: "shader",
kind: "string",
optional: false
},
{
field: "maxSampleOffset",
kind: "numericStruct",
optional: false,
fields: [{
name: "width",
type: "CoreFoundation.CGFloat",
integer: false
}, {
name: "height",
type: "CoreFoundation.CGFloat",
integer: false
}]
},
{
field: "isEnabled",
kind: "boolean",
optional: false
}
],
lineLimitWithLimitAndReservesSpace: [{
field: "limit",
kind: "number",
optional: false
}, {
field: "reservesSpace",
kind: "boolean",
optional: false
}],
listRowInsets: [{
field: "edges",
kind: "enum",
optional: false
}, {
field: "length",
kind: "number",
optional: true
}],
listRowSeparator: [{
field: "visibility",
kind: "enum",
optional: false
}, {
field: "edges",
kind: "enum",
optional: false
}],
listRowSeparatorTint: [{
field: "color",
kind: "enum",
optional: true
}, {
field: "edges",
kind: "enum",
optional: false
}],
listSectionMargins: [{
field: "edges",
kind: "enum",
optional: false
}, {
field: "length",
kind: "number",
optional: true
}],
listSectionSeparator: [{
field: "visibility",
kind: "enum",
optional: false
}, {
field: "edges",
kind: "enum",
optional: false
}],
listSectionSeparatorTint: [{
field: "color",
kind: "enum",
optional: true
}, {
field: "edges",
kind: "enum",
optional: false
}],
manageSubscriptionsSheetWithIsPresentedAndSubscriptionGroupID: [{
field: "isPresented",
kind: "bindingBoolean",
optional: false
}, {
field: "subscriptionGroupID",
kind: "string",
optional: false
}],
mapItemDetailPopoverWithCurrentLocation: [{
field: "isPresented",
kind: "bindingBoolean",
optional: false
}],
mapItemDetailPopoverWithCurrentLocationAndArrowEdge: [{
field: "isPresented",
kind: "bindingBoolean",
optional: false
}, {
field: "arrowEdge",
kind: "enum",
optional: false
}],
mapItemDetailSheetWithCurrentLocation: [{
field: "isPresented",
kind: "bindingBoolean",
optional: false
}],
matchedGeometryEffect: [{
field: "id",
kind: "string",
optional: false
}],
matchedTransitionSource: [{
field: "id",
kind: "string",
optional: false
}],
navigationBarTitleWithTitleAndDisplayMode: [{
field: "title",
kind: "string",
optional: false
}, {
field: "displayMode",
kind: "enum",
optional: false
}],
navigationSplitViewColumnWidthWithMinAndIdealAndMax: [
{
field: "min",
kind: "number",
optional: true
},
{
field: "ideal",
kind: "number",
optional: false
},
{
field: "max",
kind: "number",
optional: true
}
],
offset: [{
field: "x",
kind: "number",
optional: false
}, {
field: "y",
kind: "number",
optional: false
}],
onCameraCaptureEventWithIsEnabledAndDefaultSoundDisabledAndPrimaryActionAndSecondaryAction: [
{
field: "isEnabled",
kind: "boolean",
optional: false
},
{
field: "defaultSoundDisabled",
kind: "boolean",
optional: false
},
{
field: "primaryAction",
kind: "eventStruct",
optional: false,
eventValue: {
kind: "object",
fields: [{
name: "phase",
value: {
kind: "enum",
cases: [
"began",
"cancelled",
"ended"
],
open: true
}
}, {
name: "shouldPlaySound",
value: { kind: "boolean" }
}]
}
},
{
field: "secondaryAction",
kind: "eventStruct",
optional: false,
eventValue: {
kind: "object",
fields: [{
name: "phase",
value: {
kind: "enum",
cases: [
"began",
"cancelled",
"ended"
],
open: true
}
}, {
name: "shouldPlaySound",
value: { kind: "boolean" }
}]
}
}
],
onCameraCaptureEventWithIsEnabledAndPrimaryActionAndSecondaryAction: [
{
field: "isEnabled",
kind: "boolean",
optional: false
},
{
field: "primaryAction",
kind: "eventStruct",
optional: false,
eventValue: {
kind: "object",
fields: [{
name: "phase",
value: {
kind: "enum",
cases: [
"began",
"cancelled",
"ended"
],
open: true
}
}]
}
},
{
field: "secondaryAction",
kind: "eventStruct",
optional: false,
eventValue: {
kind: "object",
fields: [{
name: "phase",
value: {
kind: "enum",
cases: [
"began",
"cancelled",
"ended"
],
open: true
}
}]
}
}
],
onContinueUserActivity: [{
field: "activityType",
kind: "string",
optional: false
}, {
field: "action",
kind: "eventStruct",
optional: false,
eventValue: {
kind: "object",
fields: [
{
name: "activityType",
value: { kind: "string" }
},
{
name: "isEligibleForHandoff",
value: { kind: "boolean" }
},
{
name: "isEligibleForPrediction",
value: { kind: "boolean" }
},
{
name: "isEligibleForPublicIndexing",
value: { kind: "boolean" }
},
{
name: "isEligibleForSearch",
value: { kind: "boolean" }
},
{
name: "needsSave",
value: { kind: "boolean" }
},
{
name: "supportsContinuationStreams",
value: { kind: "boolean" }
},
{
name: "targetContentIdentifier",
value: {
kind: "optional",
value: { kind: "string" }
}
},
{
name: "title",
value: {
kind: "optional",
value: { kind: "string" }
}
}
]
}
}],
photosPickerAccessoryVisibility: [{
field: "visibility",
kind: "enum",
optional: false
}, {
field: "edges",
kind: "enum",
optional: false
}],
photosReferenceImageViewer: [{
field: "fileURL",
kind: "bindingOptionalURL",
optional: false
}, {
field: "onProcessingCompletion",
kind: "resultURL",
optional: false
}],
photosSharedAlbumCreationSheet: [{
field: "isPresented",
kind: "bindingBoolean",
optional: false
}],
photosSharedAlbumCustomizationSheet: [{
field: "isPresented",
kind: "bindingBoolean",
optional: false
}, {
field: "albumIdentifier",
kind: "string",
optional: true
}],
photosSharedAlbumPostingSheet: [{
field: "isPresented",
kind: "bindingBoolean",
optional: false
}, {
field: "items",
kind: "stringArray",
optional: false
}],
position: [{
field: "x",
kind: "number",
optional: false
}, {
field: "y",
kind: "number",
optional: false
}],
postToPhotosSharedAlbumSheet: [{
field: "isPresented",
kind: "bindingBoolean",
optional: false
}, {
field: "items",
kind: "stringArray",
optional: false
}],
presentationCompactAdaptationWithHorizontalAdaptationAndVerticalAdaptation: [{
field: "horizontalAdaptation",
kind: "enum",
optional: false
}, {
field: "verticalAdaptation",
kind: "enum",
optional: false
}],
previewContext: [{
field: "family",
kind: "enum",
optional: false
}],
projectionEffect: [{
field: "transform",
kind: "numericStruct",
optional: false,
fields: [
{
name: "a",
type: "CoreFoundation.CGFloat",
integer: false
},
{
name: "b",
type: "CoreFoundation.CGFloat",
integer: false
},
{
name: "c",
type: "CoreFoundation.CGFloat",
integer: false
},
{
name: "d",
type: "CoreFoundation.CGFloat",
integer: false
},
{
name: "tx",
type: "CoreFoundation.CGFloat",
integer: false
},
{
name: "ty",
type: "CoreFoundation.CGFloat",
integer: false
}
]
}],
refundRequestSheet: [{
field: "transactionID",
kind: "string",
optional: false
}, {
field: "isPresented",
kind: "bindingBoolean",
optional: false
}],
rotation3DEffect: [
{
field: "angle",
kind: "numericStruct",
optional: false,
fields: [{
name: "radians",
type: "Swift.Double",
integer: false
}]
},
{
field: "axis",
kind: "numericTuple",
optional: false,
fields: [
{
name: "x",
type: "CoreFoundation.CGFloat",
integer: false
},
{
name: "y",
type: "CoreFoundation.CGFloat",
integer: false
},
{
name: "z",
type: "CoreFoundation.CGFloat",
integer: false
}
]
},
{
field: "anchor",
kind: "enum",
optional: false
},
{
field: "anchorZ",
kind: "number",
optional: false
},
{
field: "perspective",
kind: "number",
optional: false
}
],
rotationEffect: [{
field: "angle",
kind: "enum",
optional: false
}, {
field: "anchor",
kind: "enum",
optional: false
}],
scaleEffectWithSAndAnchor: [{
field: "s",
kind: "number",
optional: false
}, {
field: "anchor",
kind: "enum",
optional: false
}],
scaleEffectWithXAndYAndAnchor: [
{
field: "x",
kind: "number",
optional: false
},
{
field: "y",
kind: "number",
optional: false
},
{
field: "anchor",
kind: "enum",
optional: false
}
],
scenePaddingWithPaddingAndEdges: [{
field: "padding",
kind: "enum",
optional: false
}, {
field: "edges",
kind: "enum",
optional: false
}],
scrollBounceBehavior: [{
field: "behavior",
kind: "enum",
optional: false
}, {
field: "axes",
kind: "enum",
optional: false
}],
scrollEdgeEffectHidden: [{
field: "hidden",
kind: "boolean",
optional: false
}, {
field: "edges",
kind: "enum",
optional: false
}],
scrollEdgeEffectStyle: [{
field: "style",
kind: "enum",
optional: true
}, {
field: "edges",
kind: "enum",
optional: false
}],
scrollIndicators: [{
field: "visibility",
kind: "enum",
optional: false
}, {
field: "axes",
kind: "enum",
optional: false
}],
searchSuggestions: [{
field: "visibility",
kind: "enum",
optional: false
}, {
field: "placements",
kind: "enum",
optional: false
}],
sensoryFeedback: [{
field: "feedback",
kind: "enum",
optional: false
}, {
field: "trigger",
kind: "string",
optional: false
}],
shadow: [
{
field: "color",
kind: "enum",
optional: false
},
{
field: "radius",
kind: "number",
optional: false
},
{
field: "x",
kind: "number",
optional: false
},
{
field: "y",
kind: "number",
optional: false
}
],
storeButton: [{
field: "visibility",
kind: "enum",
optional: false
}, {
field: "buttonKinds",
kind: "enum",
optional: false
}],
strikethrough: [
{
field: "isActive",
kind: "boolean",
optional: false
},
{
field: "pattern",
kind: "enum",
optional: false
},
{
field: "color",
kind: "enum",
optional: true
}
],
subscriptionOfferViewButtonVisibility: [{
field: "visibility",
kind: "enum",
optional: false
}, {
field: "buttonKinds",
kind: "enum",
optional: false
}],
subscriptionStorePolicyDestination: [{
field: "url",
kind: "url",
optional: false
}, {
field: "button",
kind: "enum",
optional: false
}],
textInputFormattingControlVisibility: [{
field: "visibility",
kind: "enum",
optional: false
}, {
field: "placement",
kind: "enum",
optional: false
}],
textScale: [{
field: "scale",
kind: "enum",
optional: false
}, {
field: "isEnabled",
kind: "boolean",
optional: false
}],
toolbarBackground: [{
field: "visibility",
kind: "enum",
optional: false
}, {
field: "bars",
kind: "enum",
optional: false
}],
toolbarBackgroundVisibility: [{
field: "visibility",
kind: "enum",
optional: false
}, {
field: "bars",
kind: "enum",
optional: false
}],
toolbarColorScheme: [{
field: "colorScheme",
kind: "enum",
optional: true
}, {
field: "bars",
kind: "enum",
optional: false
}],
toolbarMinimizationBehavior: [{
field: "behavior",
kind: "enum",
optional: false
}, {
field: "bars",
kind: "enum",
optional: false
}],
toolbarMinimizationRestoration: [{
field: "restoration",
kind: "enum",
optional: false
}, {
field: "bars",
kind: "enum",
optional: false
}],
toolbarMinimizationSafeAreaAdjustment: [{
field: "adjustment",
kind: "enum",
optional: false
}, {
field: "bars",
kind: "enum",
optional: false
}],
toolbarVisibility: [{
field: "visibility",
kind: "enum",
optional: false
}, {
field: "bars",
kind: "enum",
optional: false
}],
toolbarWithVisibilityAndBars: [{
field: "visibility",
kind: "enum",
optional: false
}, {
field: "bars",
kind: "enum",
optional: false
}],
transaction: [{
field: "transform",
kind: "structUpdate",
optional: false,
fields: [
{
name: "isContinuous",
type: "Swift.Bool",
integer: false
},
{
name: "scrollPositionUpdatePreservesVelocity",
type: "Swift.Bool",
integer: false
},
{
name: "disablesAnimations",
type: "Swift.Bool",
integer: false
},
{
name: "tracksVelocity",
type: "Swift.Bool",
integer: false
}
]
}],
transformEffect: [{
field: "transform",
kind: "numericStruct",
optional: false,
fields: [
{
name: "a",
type: "CoreFoundation.CGFloat",
integer: false
},
{
name: "b",
type: "CoreFoundation.CGFloat",
integer: false
},
{
name: "c",
type: "CoreFoundation.CGFloat",
integer: false
},
{
name: "d",
type: "CoreFoundation.CGFloat",
integer: false
},
{
name: "tx",
type: "CoreFoundation.CGFloat",
integer: false
},
{
name: "ty",
type: "CoreFoundation.CGFloat",
integer: false
}
]
}],
translationPresentation: [{
field: "isPresented",
kind: "bindingBoolean",
optional: false
}, {
field: "text",
kind: "string",
optional: false
}],
typesettingLanguage: [{
field: "language",
kind: "enum",
optional: false
}, {
field: "isEnabled",
kind: "boolean",
optional: false
}],
underline: [
{
field: "isActive",
kind: "boolean",
optional: false
},
{
field: "pattern",
kind: "enum",
optional: false
},
{
field: "color",
kind: "enum",
optional: true
}
],
userActivity: [
{
field: "activityType",
kind: "string",
optional: false
},
{
field: "isActive",
kind: "boolean",
optional: false
},
{
field: "update",
kind: "classUpdate",
optional: false,
fields: [
{
name: "isEligibleForHandoff",
type: "Swift.Bool",
integer: false
},
{
name: "isEligibleForPrediction",
type: "Swift.Bool",
integer: false
},
{
name: "isEligibleForPublicIndexing",
type: "Swift.Bool",
integer: false
},
{
name: "isEligibleForSearch",
type: "Swift.Bool",
integer: false
},
{
name: "needsSave",
type: "Swift.Bool",
integer: false
},
{
name: "supportsContinuationStreams",
type: "Swift.Bool",
integer: false
},
{
name: "targetContentIdentifier",
type: "Swift.String?",
integer: false
},
{
name: "title",
type: "Swift.String?",
integer: false
}
]
}
],
workoutPreview: [{
field: "workout",
kind: "string",
optional: false
}, {
field: "isPresented",
kind: "bindingBoolean",
optional: false
}]
};
function validSDKEventValue(value, shape) {
if (shape.kind === "optional") return value === null || validSDKEventValue(value, shape.value);
if (shape.kind === "array") return Array.isArray(value) && value.every((item) => validSDKEventValue(item, shape.value));
if (shape.kind === "number") return typeof value === "number" && Number.isFinite(value);
if (shape.kind === "string" || shape.kind === "description" || shape.kind === "boolean") return typeof value === (shape.kind === "description" ? "string" : shape.kind);
if (shape.kind === "enum") return typeof value === "string" && (shape.cases.includes(value) || shape.open === true && value === "unknown");
if (shape.kind === "verification") return Boolean(value && typeof value === "object" && (value.case === "verified" || value.case === "unverified") && typeof value.jwsRepresentation === "string" && (value.case === "verified" ? value.error === null : typeof value.error === "string"));
if (shape.kind === "result") return Boolean(value && typeof value === "object" && (value.case === "success" ? validSDKEventValue(value.value, shape.value) : value.case === "failure" && typeof value.error === "string"));
if (shape.kind === "associatedEnum") {
if (!value || typeof value !== "object") return false;
if (shape.open && value.case === "unknown") return Array.isArray(value.values) && value.values.length === 0;
const item = shape.cases.find((entry) => entry.name === value.case);
return Boolean(item && Array.isArray(value.values) && value.values.length === item.values.length && item.values.every((nested, index) => validSDKEventValue(value.values[index], nested)));
}
if (!value || typeof value !== "object") return false;
const record = value;
if (shape.kind === "point") return typeof record.x === "number" && Number.isFinite(record.x) && typeof record.y === "number" && Number.isFinite(record.y);
if (shape.kind === "size") return typeof record.width === "number" && Number.isFinite(record.width) && typeof record.height === "number" && Number.isFinite(record.height);
if (shape.kind !== "object") return false;
return shape.fields.every((field) => Object.hasOwn(record, field.name) && validSDKEventValue(record[field.name], field.value));
}
function validTextRanges(value, text) {
if (value === null) return true;
if (!Array.isArray(value) || value.length === 0) return false;
let previousEnd = -1;
for (const pair of value) {
if (!Array.isArray(pair) || pair.length !== 2) return false;
const [start, end] = pair;
if (!Number.isSafeInteger(start) || !Number.isSafeInteger(end) || start < 0 || start > end || end > text.length || start <= previousEnd || value.length > 1 && start === end) return false;
for (const offset of [start, end]) {
const before = text.charCodeAt(offset - 1);
const after = text.charCodeAt(offset);
if (before >= 55296 && before <= 56319 && after >= 56320 && after <= 57343) return false;
}
previousEnd = end;
}
return true;
}
function swiftStyleNative(style) {
if (!style) return void 0;
const animator = (0, import_animatorStyle.animatorStyleOf)(style);
if (animator) return (0, import_animatorStyle.animatorStyleNative)(animator, swiftStyleNative);
const native = {};
const sdkModifiers = [];
for (const [name, value] of Object.entries(style)) {
if (value === void 0) continue;
if (Object.hasOwn(sdkKinds, name)) {
const kind = sdkKinds[name];
if (kind === "record") {
if (typeof value !== "object" || value === null || Array.isArray(value)) throw new Error(name + " must be a record");
const record = value;
const values = sdkRecords[name].map((argument) => {
const item = record[argument.field];
if (argument.optional && item === null) return null;
if (argument.kind === "bindingBoolean") {
if (!item || typeof item !== "object" || typeof item.value !== "boolean" || typeof item.onChange !== "function") throw new Error(name + "." + argument.field + " must be a boolean binding");
return String(item.value);
}
if (argument.kind === "bindingOptionalURL") {
if (!item || typeof item !== "object" || item.value !== null && typeof item.value !== "string" || typeof item.onChange !== "function") throw new Error(name + "." + argument.field + " must be a URL binding");
return JSON.stringify(item.value);
}
if (argument.kind === "resultURL" || argument.kind === "resultURLArray" || argument.kind === "eventStruct") {
if (typeof item !== "function") throw new Error(name + "." + argument.field + " must be a callback");
return "";
}
if (argument.kind === "classUpdate" || argument.kind === "structUpdate") {
if (!item || typeof item !== "object" || Array.isArray(item) || Object.keys(item).length === 0 || Object.entries(item).some(([key, fieldValue]) => {
const field = argument.fields?.find((entry) => entry.name === key);
return !field || (field.type === "Swift.Bool" ? typeof fieldValue !== "boolean" : field.type.endsWith("?") && fieldValue === null ? false : typeof fieldValue !== "string");
})) throw new Error(name + "." + argument.field + (argument.kind === "classUpdate" ? " must be an SDK class update" : " must be an SDK struct update"));
return JSON.stringify(item);
}
if (argument.kind === "number" && (typeof item !== "number" || !Number.isFinite(item))) throw new Error(name + "." + argument.field + " must be finite");
if (argument.kind === "boolean" && typeof item !== "boolean") throw new Error(name + "." + argument.field + " must be a boolean");
if ((argument.kind === "string" || argument.kind === "url" || argument.kind === "enum") && typeof item !== "string") throw new Error(name + "." + argument.field + " must be a string");
if ((argument.kind === "stringArray" || argument.kind === "stringSet") && (!Array.isArray(item) || item.some((element) => typeof element !== "string"))) throw new Error(name + "." + argument.field + " must be a string array");
if (argument.unique && new Set(item).size !== item.length) throw new Error(name + "." + argument.field + " must contain distinct strings");
if (argument.kind === "numericStruct" || argument.kind === "numericTuple") {
if (!item || typeof item !== "object" || Array.isArray(item) || Object.keys(item).length !== argument.fields.length || argument.fields.some((field) => {
const number = item[field.name];
return typeof number !== "number" || !Number.isFinite(number) || field.integer && !Number.isSafeInteger(number);
})) throw new Error(name + "." + argument.field + " must be a numeric object");
return JSON.stringify(item);
}
return argument.kind === "stringArray" || argument.kind === "stringSet" ? JSON.stringify(item) : String(item);
});
sdkModifiers.push([name, JSON.stringify(values)]);
continue;
}
if (kind === "gesture") {
if (!value || typeof value !== "object" || Array.isArray(value) || typeof value.kind !== "string" || !Object.hasOwn(sdkGestureOptions[name], value.kind) || typeof value.onEnded !== "function") throw new Error(name + " must be an SDK gesture and callback");
sdkModifiers.push([name, value.kind]);
continue;
}
if (kind === "visualEffect") {
if (!value || typeof value !== "object" || Array.isArray(value) || typeof value.kind !== "string" || !sdkVisualEffects[name].includes(value.kind) || typeof value.value !== "number" || !Number.isFinite(value.value)) throw new Error(name + " must be a visual effect and finite value");
sdkModifiers.push([name, JSON.stringify([value.kind, String(value.value)])]);
continue;
}
if (kind === "optionSet") {
if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error(name + " must be an SDK option set");
const record = value;
const options = {};
for (const [field, item] of Object.entries(record)) {
const argument = sdkOptionSets[name].find((entry) => entry.field === field);
if (!argument) throw new Error(name + "." + field + " is not an SDK option");
if (argument.kind === "number" && (typeof item !== "number" || !Number.isSafeInteger(item))) throw new Error(name + "." + field + " must be finite");
if (argument.kind === "boolean" && typeof item !== "boolean") throw new Error(name + "." + field + " must be a boolean");
if (argument.kind === "string" && typeof item !== "string") throw new Error(name + "." + field + " must be a string");
options[field] = String(item);
}
sdkModifiers.push([name, JSON.stringify(options)]);
continue;
}
if (kind === "caseSet") {
if (!Array.isArray(value) || value.some((item) => typeof item !== "string" || !sdkEventCases[name].includes(item))) throw new Error(name + " must be public SDK values");
sdkModifiers.push([name, JSON.stringify(value)]);
continue;
}
if (kind === "bindingTextSelection") {
const binding = value;
if (!binding || typeof binding.text !== "string" || !validTextRanges(binding.value, binding.text) || typeof binding.onChange !== "function") throw new Error(name + " must have search text, UTF-16 ranges, and an onChange callback");
sdkModifiers.push([name, JSON.stringify([binding.text, JSON.stringify(binding.value)])]);
continue;
}
if (kind === "chartDescriptor") {
if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error(name + " must be a chart descriptor");
const chart = value;
if (chart.title !== void 0 && typeof chart.title !== "string" || chart.summary !== void 0 && typeof chart.summary !== "string" || !Array.isArray(chart.series) || chart.series.some((series) => {
if (!series || typeof series !== "object" || Array.isArray(series)) return true;
const item = series;
return typeof item.name !== "string" || typeof item.isContinuous !== "boolean" || !Array.isArray(item.points) || item.points.some((point) => {
if (!point || typeof point !== "object" || Array.isArray(point)) return true;
const coordinate = point;
return typeof coordinate.x !== "number" || !Number.isFinite(coordinate.x) || coordinate.y !== void 0 && (typeof coordinate.y !== "number" || !Number.isFinite(coordinate.y)) || coordinate.label !== void 0 && typeof coordinate.label !== "string";
});
}) || [chart.xAxis, chart.yAxis].some((axis, index) => {
if (index === 1 && axis === void 0) return false;
if (!axis || typeof axis !== "object" || Array.isArray(axis)) return true;
const item = axis;
return typeof item.title !== "string" || !Array.isArray(item.range) || item.range.length !== 2 || item.range.some((bound) => typeof bound !== "number" || !Number.isFinite(bound)) || item.range[0] > item.range[1] || item.gridlinePositions !== void 0 && (!Array.isArray(item.gridlinePositions) || item.gridlinePositions.some((position) => typeof position !== "number" || !Number.isFinite(position)));
})) throw new Error(name + " must contain finite axes and series points");
sdkModifiers.push([name, JSON.stringify(value)]);
continue;
}
if (kind === "phaseAnimation") {
if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error(name + " must be a scalar phase animation");
const config = value;
if (!Array.isArray(config.phases) || config.phases.length < 2 || config.phases.some((phase) => !validScalarEffect(config.effect, phase)) || typeof config.duration !== "number" || !Number.isFinite(config.duration) || config.duration <= 0) throw new Error(name + " must have finite phases and positive duration");
sdkModifiers.push([name, JSON.stringify(value)]);
continue;
}
if (kind === "keyframeAnimation") {
if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error(name + " must be a scalar keyframe animation");
const config = value;
if (!validScalarEffect(config.effect, config.initialValue) || config.repeating !== void 0 && typeof config.repeating !== "boolean" || !Array.isArray(config.frames) || !config.frames.length || config.frames.some((frame) => {
if (!frame || typeof frame !== "object" || Array.isArray(frame)) return true;
const item = frame;
return !validScalarEffect(config.effect, item.value) || typeof item.duration !== "number" || !Number.isFinite(item.duration) || item.duration <= 0;
})) throw new Error(name + " must have finite keyframes and positive durations");
sdkModifiers.push([name, JSON.stringify(value)]);
continue;
}
if (kind === "seedKeyframeAnimation") {
if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error(name + " must be a numeric keyframe animation");
const config = value;
if (typeof config.trigger !== "string" || typeof config.property !== "string" || !sdkSeedKeyframeFields[name]?.includes(config.property) || !Array.isArray(config.frames) || !config.frames.length || config.frames.some((frame) => {
if (!frame || typeof frame !== "object" || Array.isArray(frame)) return true;
const item = frame;
return typeof item.value !== "number" || !Number.isFinite(item.value) || typeof item.duration !== "number" || !Number.isFinite(item.duration) || item.duration <= 0;
})) throw new Error(name + " must have a trigger, numeric property and timed keyframes");
sdkModifiers.push([name, JSON.stringify(value)]);
continue;
}
if (kind === "registeredValue") {
if (typeof value !== "string" || !value) throw new Error(name + " must name a registered native Swift value");
sdkModifiers.push([name, value]);
continue;
}
if (kind === "eventAsyncStruct" && sdkAsyncArguments[name]) {
if (!value || typeof value !== "object" || Array.isArray(value) || typeof value.onAction !== "function") throw new Error(name + " must be an async SDK callback and arguments");
const record = value;
const argumentsFromSDK = sdkAsyncArguments[name].map(({ field, kind: kind2 }) => {
const item = record[field];
if (kind2 === "stringArray") {
if (!Array.isArray(item) || item.some((value2) => typeof value2 !== "string")) throw new Error(name + "." + field + " must be a string array");
return JSON.stringify(item);
}
if (typeof item !== "string") throw new Error(name + "." + field + " must be a string");
return item;
});
sdkModifiers.push([name, JSON.stringify(argumentsFromSDK)]);
continue;
}
if (kind === "eventAsyncString") {
const fields = sdkAsyncStringFields[name];
if (!value || typeof value !== "object" || Array.isArray(value) || typeof value[fields.predicate] !== (fields.selects ? "string" : "boolean") || typeof value[fields.callback] !== "function") throw new Error(name + " must be an async string callback and SDK decision");
sdkModifiers.push([name, String(value[fields.predicate])]);
continue;
}
if (kind === "sessionRequest") {
const inputField = sdkSessionRequests[name].inputField;
if (!value || typeof value !== "object" || Array.isArray(value) || typeof value[inputField] !== "string" || typeof value.onResult !== "function") throw new Error(name + " must have source text and an onResult callback");
sdkModifiers.push([name, value[inputField]]);
continue;
}
if (kind === "pickerSelection") {
const picker = value;
if (!picker || typeof picker !== "object" || typeof picker.isPresented?.value !== "boolean" || typeof picker.isPresented.onChange !== "function" || picker.title !== void 0 && typeof picker.title !== "string" || typeof picker.onSelection !== "function") throw new Error(name + " must have a presentation binding and selection callback");
sdkModifiers.push([name, JSON.stringify([String(picker.isPresented.value), picker.title ?? null])]);
continue;
}
if (kind === "transferSelection") {
const picker = value;
if (!picker || typeof picker !== "object" || typeof picker.isPresented?.value !== "boolean" || typeof picker.isPresented.onChange !== "function" || typeof picker.onSelection !== "function" || typeof picker.onError !== "function") throw new Error(name + " must have a presentation binding, selection callback, and error callback");
sdkModifiers.push([name, String(picker.isPresented.value)]);
continue;
}
if (kind === "eventDrop") {
const record = value;
if (!record || !Array.isArray(record.of) || record.of.length === 0 || record.of.some((item) => typeof item !== "string" || !item) || typeof record.onDrop !== "function") throw new Error(name + " must have content types and an onDrop callback");
sdkModifiers.push([name, JSON.stringify(record.of)]);
continue;
}
if (kind === "eventNotification") {
const record = value;
if (!record || typeof record.name !== "string" || !record.name || typeof record.onAction !== "function") throw new Error(name + " must have a notification name and an onAction callback");
sdkModifiers.push([name, record.name]);
continue;
}
if (kind === "dragSelection") {
if (!Array.isArray(value) || value.some((item) => typeof item !== "string")) throw new Error(name + " must be an array of string IDs");
sdkModifiers.push([name, JSON.stringify(value)]);
continue;
}
if (kind === "asyncObjectRequest") {
const record = value;
const binding = record?.[sdkAsyncObjectRequestBindings[name]];
if (!record || !binding || typeof binding.value !== "boolean" || typeof binding.onChange !== "function" || typeof record.latitude !== "number" || !Number.isFinite(record.latitude) || record.latitude < -90 || record.latitude > 90 || typeof record.longitude !== "number" || !Number.isFinite(record.longitude) || record.longitude < -180 || record.longitude > 180) throw new Error(name + " must have a presentation binding and valid coordinates");
sdkModifiers.push([name, JSON.stringify([
String(binding.value),
String(record.latitude),
String(record.longitude)
])]);
continue;
}
if (kind === "number" && (typeof value !== "number" || !Number.isFinite(value))) throw new Error(name + " must be finite");
if (kind === "optionalNumber" && value !== null && (typeof value !== "number" || !Number.isFinite(value))) throw new Error(name + " must be finite or null");
if ((kind === "boolean" || kind === "defaultFocusBoolean") && typeof value !== "boolean") throw new Error(name + " must be a boolean");
if (kind === "dragContainer" && typeof value !== "boolean") throw new Error(name + " must be a boolean");
if (kind === "dragItemID" && typeof value !== "string") throw new Error(name + " must be a string ID");
if (kind === "optionalBoolean" && value !== null && typeof value !== "boolean") throw new Error(name + " must be a boolean or null");
if (kind === "string" && typeof value !== "string") throw new Error(name + " must be a string");
if (kind === "equatableKey" && typeof value !== "string") throw new Error(name + " must be an equality key");
if (kind === "selectionID" && typeof value !== "string") throw new Error(name + " must be a string");
if (kind === "selectionIndex" && (typeof value !== "number" || !Number.isSafeInteger(value) || value < 0)) throw new Error(name + " must be a nonnegative index");
if (kind === "url" && typeof value !== "string") throw new Error(name + " must be a URL string");
if (kind === "optionalURL" && value !== null && typeof value !== "string") throw new Error(name + " must be a URL string or null");
if (kind === "optionalEnum" && value !== null && typeof value !== "string") throw new Error(name + " must be a string or null");
if (kind === "optionalString" && value !== null && typeof value !== "string") throw new Error(name + " must be a string or null");
if (kind.startsWith("event") && kind !== "eventValueString" && kind !== "eventReturnArray" && kind !== "eventReturnEnum" && typeof value !== "function") throw new Error(name + " must be a callback");
if (kind === "eventValueString" && (typeof value !== "object" || value === null || typeof value.value !== "string" || typeof value.onChange !== "function")) throw new Error(name + " must be a string value and callback");
if (kind === "eventReturnArray" && (typeof value !== "object" || value === null || !Array.isArray(value.items) || !value.items.every((item) => typeof item === "string") || typeof value.onAction !== "function")) throw new Error(name + " must be a string array and callback");
if (kind === "eventReturnEnum" && (typeof value !== "object" || value === null || typeof value.result !== "string" || !sdkEventCases[name].includes(value.result) || typeof value.onAction !== "function")) throw new Error(name + " must be an SDK result and callback");
if ((kind === "bindingBoolean" || kind === "bindingFocusBoolean" || kind === "bindingString" || kind === "bindingOptionalString" || kind === "bindingCodable") && (typeof value !== "object" || value === null || typeof value.onChange !== "function" || (kind === "bindingOptionalString" || kind === "bindingCodable" && sdkCodableOptional[name] ? value.value !== null && typeof value.value !== "string" : typeof value.value !== (kind === "bindingBoolean" || kind === "bindingFocusBoolean" ? "boolean" : "string")))) throw new Error(name + " must be a binding");
if (kind === "bindingCodable" && value.value !== null) JSON.parse(value.value);
if (kind === "bindingPoint" && (typeof value !== "object" || value === null || typeof value.onChange !== "function" || value.value !== null && !validSDKEventValue(value.value, { kind: "point" }))) throw new Error(name + " must be a point binding");
sdkModifiers.push([name, kind === "eventValueString" ? value.value : kind === "eventReturnArray" ? JSON.stringify(value.items) : kind === "eventReturnEnum" ? value.result : kind.startsWith("event") ? "" : kind === "bindingOptionalString" || kind === "bindingPoint" ? JSON.stringify(value.value) : kind === "bindingCodable" && value.value === null ? "null" : kind.startsWith("binding") ? String(value.value) : kind === "optionalString" || kind === "optionalURL" ? JSON.stringify(value) : String(value)]);
} else if (colorFields.includes(name)) {
native[name] = (0, import_react_native.processColor)(value) ?? void 0;
} else {
native[name] = value;
}
}
if (sdkModifiers.length) native.sdkModifiers = JSON.stringify(sdkModifiers);
return native;
}
function dispatchSDKEvent(style, name, value) {
const separator = name.indexOf(".");
if (separator !== -1) {
const parent = name.slice(0, separator);
const field = name.slice(separator + 1);
if (sdkKinds[parent] === "pickerSelection") {
const picker = style?.[parent];
if (field === "isPresented") {
if (value !== "true" && value !== "false") throw new Error(name + " emitted an invalid boolean");
picker?.isPresented.onChange(value === "true");
} else if (field === "onSelection") picker?.onSelection(value);
else throw new Error(name + " emitted an invalid picker event");
return;
}
if (sdkKinds[parent] === "transferSelection") {
const picker = style?.[parent];
if (field === "isPresented") {
if (value !== "true" && value !== "false") throw new Error(name + " emitted an invalid boolean");
picker?.isPresented.onChange(value === "true");
} else if (field === "onSelection") picker?.onSelection(value);
else if (field === "onError") picker?.onError(value);
else if (field === "onItemIdentifier") picker?.onItemIdentifier?.(value);
else throw new Error(name + " emitted an invalid transfer event");
return;
}
if (sdkRecords[parent]?.some((argument) => argument.field === field && argument.kind === "bindingBoolean")) {
if (value !== "true" && value !== "false") throw new Error(name + " emitted an invalid boolean");
const record = style?.[parent];
record?.[field]?.onChange(value === "true");
return;
}
if (sdkRecords[parent]?.some((argument) => argument.field === field && argument.kind === "bindingOptionalURL")) {
const decoded = JSON.parse(value);
if (decoded !== null && typeof decoded !== "string") throw new Error(name + " emitted an invalid URL");
const record = style?.[parent];
record?.[field]?.onChange(decoded);
return;
}
const result = sdkRecords[parent]?.find((argument) => argument.field === field && (argument.kind === "resultURL" || argument.kind === "resultURLArray"));
if (result) {
const decoded = JSON.parse(value);
if (!decoded || typeof decoded !== "object" || Array.isArray(decoded)) throw new Error(name + " emitted an invalid result");
const payload = decoded;
const success = payload.success;
const failure = payload.failure;
const validSuccess = result.kind === "resultURL" ? typeof success === "string" : Array.isArray(success) && success.every((item) => typeof item === "string");
if (!(validSuccess && failure === void 0 || success === void 0 && typeof failure === "string") || Object.keys(payload).length !== 1) throw new Error(name + " emitted an invalid result");
const record = style?.[parent];
record?.[field]?.(payload);
return;
}
const event = sdkRecords[parent]?.find((argument) => argument.field === field && argument.kind === "eventStruct");
if (event) {
const payload = JSON.parse(value);
if (!validSDKEventValue(payload, event.eventValue)) throw new Error(name + " emitted an invalid struct value");
const record = style?.[parent];
record?.[field]?.(payload);
return;
}
}
const modifier = style?.[name];
const kind = sdkKinds[name];
if (kind === "gesture") {
const config = modifier;
const shape = config && sdkGestureOptions[name]?.[config.kind];
if (shape === void 0) throw new Error(name + " emitted an invalid gesture");
if (shape === null) {
if (value !== "") throw new Error(name + " emitted an invalid gesture event");
config?.onEnded();
} else {
const payload = JSON.parse(value);
if (!validSDKEventValue(payload, shape)) throw new Error(name + " emitted an invalid gesture event");
config?.onEnded(payload);
}
} else if (kind === "event") modifier?.();
else if (kind === "eventAsync") {
const native = import_react_native.NativeModules.OneNativeAsyncActionModule;
if (!native) throw new Error("OneNativeAsyncActionModule is unavailable");
void Promise.resolve().then(() => modifier?.()).finally(() => native.complete(value));
} else if (kind === "eventAsyncStruct") {
const native = import_react_native.NativeModules.OneNativeAsyncActionModule;
if (!native) throw new Error("OneNativeAsyncActionModule is unavailable");
const envelope = JSON.parse(value);
if (!envelope || typeof envelope !== "object" || typeof envelope.id !== "string" || typeof envelope.value !== "string") throw new Error(name + " emitted an invalid async event");
const identifier = envelope.id;
const payload = JSON.parse(envelope.value);
if (!validSDKEventValue(payload, sdkEventStructs[name])) throw new Error(name + " emitted an invalid async value");
const action = typeof modifier === "function" ? modifier : modifier?.onAction;
void Promise.resolve().then(() => action?.(payload)).finally(() => native.complete(identifier));
} else if (kind === "eventAsyncString") {
const native = import_react_native.NativeModules.OneNativeAsyncActionModule;
if (!native) throw new Error("OneNativeAsyncActionModule is unavailable");
const envelope = JSON.parse(value);
if (!envelope || typeof envelope !== "object" || typeof envelope.id !== "string" || typeof envelope.value !== "string") throw new Error(name + " emitted an invalid async string event");
const identifier = envelope.id;
try {
const payload = JSON.parse(envelope.value);
if (!validSDKEventValue(payload, sdkEventStructs[name])) throw new Error(name + " emitted an invalid async string value");
const action = modifier?.[sdkAsyncStringFields[name].callback];
void Promise.resolve().then(() => action?.(payload)).then((result) => {
if (typeof result !== "string") throw new Error(name + " must return a string");
native.completeString(identifier, result, null);
}).catch((error) => native.completeString(identifier, null, String(error)));
} catch (error) {
native.completeString(identifier, null, String(error));
throw error;
}
} else if (kind === "sessionRequest") {
const payload = JSON.parse(value);
if (!payload || typeof payload !== "object" || Array.isArray(payload)) throw new Error(name + " emitted an invalid session response");
const result = payload;
const fields = sdkSessionRequests[name].outputFields;
const success = result.error === null && fields.every((field) => typeof result[field] === "string");
const failure = typeof result.error === "string" && fields.every((field) => result[field] === null);
if (!success && !failure) throw new Error(name + " emitted an invalid session response");
modifier?.onResult(result);
} else if (kind === "eventReturnArray") modifier?.onAction();
else if (kind === "eventReturnEnum") {
const payload = JSON.parse(value);
if (!validSDKEventValue(payload, sdkEventStructs[name])) throw new Error(name + " emitted an invalid result event");
modifier?.onAction(payload);
} else if (kind === "eventBoolean") {
if (value !== "true" && value !== "false") throw new Error(name + " emitted an invalid boolean");
modifier?.(value === "true");
} else if (kind === "eventNumber") {
const number = Number(value);
if (!Number.isFinite(number)) throw new Error(name + " emitted an invalid number");
modifier?.(number);
} else if (kind === "eventString") modifier?.(value);
else if (kind === "eventEnum") {
if (!sdkEventCases[name].includes(value)) throw new Error(name + " emitted an invalid enum value");
modifier?.(value);
} else if (kind === "eventEnumPair") {
const pair = JSON.parse(value);
if (!Array.isArray(pair) || pair.length !== 2 || pair.some((item) => typeof item !== "string" || !sdkEventCases[name].includes(item))) throw new Error(name + " emitted invalid enum values");
modifier?.(pair[0], pair[1]);
} else if (kind === "eventAssociatedEnum") {
const payload = JSON.parse(value);
if (!payload || typeof payload !== "object") throw new Error(name + " emitted an invalid enum payload");
const event = payload;
const kinds = typeof event.case === "string" ? sdkAssociatedCases[name]?.[event.case] : void 0;
if (!kinds || !Array.isArray(event.values) || event.values.length !== kinds.length) throw new Error(name + " emitted an invalid enum case");
for (const [index, item] of event.values.entries()) {
if (!validSDKEventValue(item, kinds[index])) throw new Error(name + " emitted an invalid " + kinds[index].kind);
}
;
modifier?.(event);
} else if (kind === "eventStruct") {
const payload = JSON.parse(value);
if (!validSDKEventValue(payload, sdkEventStructs[name])) throw new Error(name + " emitted an invalid struct value");
modifier?.(payload);
} else if (kind === "eventDrop") {
const payload = JSON.parse(value);
if (!validSDKEventValue(payload, sdkEventStructs[name])) throw new Error(name + " emitted an invalid drop value");
modifier?.onDrop(payload);
} else if (kind === "eventNotification") {
if (value !== "") throw new Error(name + " emitted an invalid notification event");
modifier?.onAction();
} else if (kind === "asyncObjectRequest") {
if (value !== "true" && value !== "false") throw new Error(name + " emitted an invalid presentation value");
const binding = modifier?.[sdkAsyncObjectRequestBindings[name]];
binding?.onChange(value === "true");
} else if (kind === "bindingBoolean" || kind === "bindingFocusBoolean") {
if (value !== "true" && value !== "false") throw new Error(name + " emitted an invalid boolean");
modifier?.onChange(value === "true");
} else if (kind === "bindingString" || kind === "bindingCodable") modifier?.onChange(value);
else if (kind === "bindingOptionalString") {
const decoded = JSON.parse(value);
if (decoded !== null && typeof decoded !== "string") throw new Error(name + " emitted an invalid optional string");
modifier?.onChange(decoded);
} else if (kind === "bindingPoint") {
const decoded = JSON.parse(value);
if (decoded !== null && !validSDKEventValue(decoded, { kind: "point" })) throw new Error(name + " emitted an invalid point");
modifier?.onChange(decoded);
} else if (kind === "bindingTextSelection") {
const binding = modifier;
if (!binding) return;
const decoded = JSON.parse(value);
if (!validTextRanges(decoded, binding.text)) throw new Error(name + " emitted invalid UTF-16 ranges");
binding.onChange(decoded);
} else if (kind === "eventValueString") modifier?.onChange(value);
}