@apps-in-toss/devtools 3.0.3 → 3.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -649,8 +649,8 @@ interface AddAccessoryButtonOptions {
649
649
  };
650
650
  }
651
651
  declare const partner: {
652
- addAccessoryButton(options: AddAccessoryButtonOptions): Promise<void>;
653
- removeAccessoryButton(): Promise<void>;
652
+ addAccessoryButton: (options: AddAccessoryButtonOptions) => Promise<void>;
653
+ removeAccessoryButton: () => Promise<void>;
654
654
  };
655
655
  //#endregion
656
656
  //#region src/mock/permissions.d.ts
@@ -1026,123 +1026,4 @@ declare function listUserPresets(): MockPreset[];
1026
1026
  declare function saveUserPreset(label: string, state: MockPresetState, description?: string): MockPreset;
1027
1027
  declare function deleteUserPreset(id: string): void;
1028
1028
  //#endregion
1029
- //#region src/mock/safe-area-bridge.d.ts
1030
- /** The postMessage envelope the launcher posts to the framed dev app (inset forward). */
1031
- declare const SAFE_AREA_INSETS_MESSAGE_TYPE: "ait:safe-area-insets";
1032
- /**
1033
- * The postMessage command the launcher partner bar's `←` button sends to the
1034
- * framed dev app (#510). The framed page calls `history.back()` in response.
1035
- *
1036
- * Protocol: only `{ type: 'ait:navigate-back' }` is valid. No other fields are
1037
- * read or acted on — extra fields are silently ignored by the shape guard.
1038
- * Game variant never sends this message (back button is partner-bar-only).
1039
- */
1040
- declare const NAVIGATE_BACK_MESSAGE_TYPE: "ait:navigate-back";
1041
- /**
1042
- * The postMessage envelope the framed mini-app self-reports its webViewType
1043
- * with (#580). The mini-app knows its own type from the build constant
1044
- * `__WEB_VIEW_TYPE__` (`granite.config.ts`'s `webViewProps.type`, injected by
1045
- * the devtools unplugin). The launcher is cross-origin so it cannot read that
1046
- * constant directly — the mini-app posts it to `window.parent` once so the
1047
- * launcher (env-2 PWA shell) switches to game mode automatically, with no
1048
- * manual `?navBarType=game` URL edit.
1049
- *
1050
- * Direction: this is the SEND side's contract (posted from inside the iframe by
1051
- * `@ait-co/debug-console`'s `packages/debug-console/src/attach.ts`). The
1052
- * launcher's receive half lives in
1053
- * `e2e/fixture/launcher/Launcher.tsx` and mirrors the same value enum inline,
1054
- * staying decoupled from the mock package internals — the same pattern the
1055
- * other launcher message types follow.
1056
- *
1057
- * Value enum: only `'partner'` and `'game'` are valid. The SDK's deprecated
1058
- * `'external'` alias of `partner` (web-framework 2.6.1) is mapped to `'partner'`
1059
- * at the send site so the wire only ever carries the two shapes the launcher
1060
- * emulates.
1061
- */
1062
- declare const WEB_VIEW_TYPE_MESSAGE_TYPE: "ait:web-view-type";
1063
- /** The two webViewType shapes the launcher can emulate (#580). */
1064
- type WebViewTypeValue = "partner" | "game";
1065
- /**
1066
- * Parse + validate a raw postMessage payload into a `SafeAreaInsets`, or return
1067
- * null when it is not a well-formed `ait:safe-area-insets` message. Pure — unit
1068
- * tested without a real MessageEvent.
1069
- */
1070
- declare function parseSafeAreaInsetsMessage(data: unknown): SafeAreaInsets$1 | null;
1071
- /**
1072
- * Parse + validate a raw postMessage payload into a webViewType value
1073
- * (`'partner'` | `'game'`), or return `null` when it is not a well-formed
1074
- * `ait:web-view-type` message (#580). Pure — unit tested without a real
1075
- * MessageEvent.
1076
- *
1077
- * Strict shape guard (the safety boundary for the cross-origin receive path):
1078
- * the payload must be a non-null object whose `type` is exactly
1079
- * {@link WEB_VIEW_TYPE_MESSAGE_TYPE} and whose `value` is exactly `'partner'`
1080
- * or `'game'` (an enum allow-list). Anything else — a foreign type, a missing
1081
- * or non-string value, the deprecated `'external'` alias, or any other string —
1082
- * returns `null` so a stray postMessage can never flip the launcher's visual
1083
- * mode. The send site is responsible for collapsing `'external'` → `'partner'`
1084
- * before posting; the parser does NOT silently accept it.
1085
- */
1086
- declare function parseWebViewTypeMessage(data: unknown): WebViewTypeValue | null;
1087
- /**
1088
- * Apply forwarded insets to the mock state. Skips the write (and the resulting
1089
- * subscribe notify) when nothing changed, so repeated identical messages from a
1090
- * resize storm don't churn subscribers.
1091
- */
1092
- declare function applyForwardedSafeAreaInsets(insets: SafeAreaInsets$1): void;
1093
- /**
1094
- * Install the window `message` listener that receives forwarded insets. Safe to
1095
- * call multiple times (idempotent) and a no-op outside a browser (SSR/jsdom
1096
- * without a window). Imported for its side effect by the mock barrel so any
1097
- * consumer that aliases `@apps-in-toss/web-framework` to the mock gets it wired.
1098
- *
1099
- * On each valid `ait:safe-area-insets` message:
1100
- * 1. Writes the corrected insets into the mock `SafeAreaInsets` state
1101
- * (existing #484 behaviour — for apps that still read SDK insets).
1102
- * 2. Drives the env-2 dead-band compensation style via
1103
- * {@link applyEnv2Compensation} — injects a `body { margin-top: calc(-1 *
1104
- * env(safe-area-inset-top)) }` style when `top === 0` (partner mode) and
1105
- * removes it when `top > 0` (game / full-bleed mode).
1106
- */
1107
- declare function installSafeAreaInsetsBridge(): void;
1108
- /**
1109
- * Parse a raw postMessage payload as an `ait:navigate-back` command.
1110
- *
1111
- * Returns true when the payload is a well-formed navigate-back command
1112
- * (`{ type: 'ait:navigate-back' }`), false otherwise. Pure — unit tested
1113
- * without a real MessageEvent.
1114
- *
1115
- * Shape guard: only the `type` field is inspected; any extra fields are
1116
- * ignored so future extensions do not break older receivers. The function
1117
- * does NOT read any data field beyond `type` — no sensitive values, no host
1118
- * disclosure (same principle as the insets bridge).
1119
- */
1120
- declare function isNavigateBackMessage(data: unknown): boolean;
1121
- /**
1122
- * Install the window `message` listener that handles `ait:navigate-back`
1123
- * commands (#510). When the launcher partner bar's `←` button is clicked it
1124
- * posts `{ type: 'ait:navigate-back' }` to the framed dev app; this listener
1125
- * calls `dispatchHostBackNavigation()` from the navigation module.
1126
- *
1127
- * Dispatch semantics: if there are any `graniteEvent.addEventListener('backEvent', …)`
1128
- * subscribers the CustomEvent `__ait:backEvent` is fired (same path as the env-1
1129
- * panel back button — the mini-app intercept channel). When there are no
1130
- * subscribers `history.back()` is called as the fallback. Back semantics are
1131
- * owned entirely by the navigation module; this bridge only delegates.
1132
- *
1133
- * Safe to call multiple times (idempotent) and a no-op outside a browser.
1134
- * Installed together with the inset bridge by `installBridges()` so any consumer
1135
- * of the mock barrel gets both wired automatically.
1136
- *
1137
- * No-op on apps that predate this bridge — the launcher posts the message but
1138
- * older mocks simply have no listener (harmless).
1139
- */
1140
- declare function installNavigateBackBridge(): void;
1141
- /**
1142
- * Install both env-2 postMessage bridges in one call (#484 insets + #510
1143
- * navigate-back). The mock barrel calls this at import time so consumers get
1144
- * all bridges wired without any explicit setup.
1145
- */
1146
- declare function installBridges(): void;
1147
- //#endregion
1148
- export { Accuracy, type AitDevtoolsState, Analytics, type AnalyticsLogEntry, Clipboard, type ConsentedUserData, type ConsentedUserDataKey, type DeclaredAgeRange, Device, type DeviceApiMode, type DeviceModes, Environment, FetchAlbumPhotosPermissionError, FetchContactsPermissionError, File, Game, GetClipboardTextPermissionError, GetCurrentLocationPermissionError, GoogleAdMob, type HapticFeedbackType, IAP, type IapNextResult, type LocationCoords, type MockContact, type MockData, type MockIapProduct, type MockLocation, type MockPreset, type MockPresetState, NAVIGATE_BACK_MESSAGE_TYPE, type NetworkStatus, Notification, OpenCameraPermissionError, type OperationalEnvironment, PermissionError, type PermissionName, type PermissionStatus, type PlatformOS, type Primitive, Promotion, Review, SAFE_AREA_INSETS_MESSAGE_TYPE, SafeArea, SafeAreaInsets, type SafeAreaInsets$1 as SafeAreaInsetsType, Screen, SetClipboardTextPermissionError, Share, StartUpdateLocationPermissionError, Storage, TossAds, TossAuth, TossPay, User, WEB_VIEW_TYPE_MESSAGE_TYPE, type WebViewTypeValue, aitState, appLogin, applyForwardedSafeAreaInsets, applyPreset, appsInTossEvent, appsInTossSignTossCert, builtInPresets, captureCurrentState, checkoutPayment, closeView, contactsViral, createAsyncBridge, createConstantBridge, createEventBridge, deleteUserPreset, env, eventLog, fetchAlbumItems, fetchAlbumPhotos, fetchContacts, generateHapticFeedback, getAnonymousKey, getAppsInTossGlobals, getClipboardText, getConsentedUserData, getCurrentLocation, getDeclaredAgeRange, getDefaultPlaceholderImages, getDeviceId, getGameCenterGameProfile, getGroupId, getIsTossLoginIntegratedService, getLocale, getNetworkStatus, getOperationalEnvironment, getPermission, getPlatformOS, getSafeAreaInsets, getSchemeUri, getServerTime, getTossAppVersion, getTossShareLink, getUserKeyForGame, graniteEvent, grantPromotionReward, grantPromotionRewardForGame, installBridges, installNavigateBackBridge, installSafeAreaInsetsBridge, isMinVersionSupported, isNavigateBackMessage, listUserPresets, loadFullScreenAd, matchesPreset, onVisibilityChangedByTransparentServiceWeb, openCamera, openGameCenterLeaderboard, openPDFViewer, openPermissionDialog, openURL, parseSafeAreaInsetsMessage, parseWebViewTypeMessage, partner, requestNotificationAgreement, requestPermission, requestReview, requestTossPayPaysBilling, saveBase64Data, saveUserPreset, setClipboardText, setDeviceOrientation, setIosSwipeGestureEnabled, setScreenAwakeMode, setSecureScreen, share, showFullScreenAd, startUpdateLocation, submitGameCenterLeaderBoardScore, tdsEvent };
1029
+ export { Accuracy, type AitDevtoolsState, Analytics, type AnalyticsLogEntry, Clipboard, type ConsentedUserData, type ConsentedUserDataKey, type DeclaredAgeRange, Device, type DeviceApiMode, type DeviceModes, Environment, FetchAlbumPhotosPermissionError, FetchContactsPermissionError, File, Game, GetClipboardTextPermissionError, GetCurrentLocationPermissionError, GoogleAdMob, type HapticFeedbackType, IAP, type IapNextResult, type LocationCoords, type MockContact, type MockData, type MockIapProduct, type MockLocation, type MockPreset, type MockPresetState, type NetworkStatus, Notification, OpenCameraPermissionError, type OperationalEnvironment, PermissionError, type PermissionName, type PermissionStatus, type PlatformOS, type Primitive, Promotion, Review, SafeArea, SafeAreaInsets, type SafeAreaInsets$1 as SafeAreaInsetsType, Screen, SetClipboardTextPermissionError, Share, StartUpdateLocationPermissionError, Storage, TossAds, TossAuth, TossPay, User, aitState, appLogin, applyPreset, appsInTossEvent, appsInTossSignTossCert, builtInPresets, captureCurrentState, checkoutPayment, closeView, contactsViral, createAsyncBridge, createConstantBridge, createEventBridge, deleteUserPreset, env, eventLog, fetchAlbumItems, fetchAlbumPhotos, fetchContacts, generateHapticFeedback, getAnonymousKey, getAppsInTossGlobals, getClipboardText, getConsentedUserData, getCurrentLocation, getDeclaredAgeRange, getDefaultPlaceholderImages, getDeviceId, getGameCenterGameProfile, getGroupId, getIsTossLoginIntegratedService, getLocale, getNetworkStatus, getOperationalEnvironment, getPermission, getPlatformOS, getSafeAreaInsets, getSchemeUri, getServerTime, getTossAppVersion, getTossShareLink, getUserKeyForGame, graniteEvent, grantPromotionReward, grantPromotionRewardForGame, isMinVersionSupported, listUserPresets, loadFullScreenAd, matchesPreset, onVisibilityChangedByTransparentServiceWeb, openCamera, openGameCenterLeaderboard, openPDFViewer, openPermissionDialog, openURL, partner, requestNotificationAgreement, requestPermission, requestReview, requestTossPayPaysBilling, saveBase64Data, saveUserPreset, setClipboardText, setDeviceOrientation, setIosSwipeGestureEnabled, setScreenAwakeMode, setSecureScreen, share, showFullScreenAd, startUpdateLocation, submitGameCenterLeaderBoardScore, tdsEvent };