@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.
package/dist/mock/2x.d.ts CHANGED
@@ -776,8 +776,8 @@ interface AddAccessoryButtonOptions {
776
776
  };
777
777
  }
778
778
  declare const partner: {
779
- addAccessoryButton(options: AddAccessoryButtonOptions): Promise<void>;
780
- removeAccessoryButton(): Promise<void>;
779
+ addAccessoryButton: (options: AddAccessoryButtonOptions) => Promise<void>;
780
+ removeAccessoryButton: () => Promise<void>;
781
781
  };
782
782
  //#endregion
783
783
  //#region src/mock/permissions.d.ts
@@ -1153,123 +1153,4 @@ declare function listUserPresets(): MockPreset[];
1153
1153
  declare function saveUserPreset(label: string, state: MockPresetState, description?: string): MockPreset;
1154
1154
  declare function deleteUserPreset(id: string): void;
1155
1155
  //#endregion
1156
- //#region src/mock/safe-area-bridge.d.ts
1157
- /** The postMessage envelope the launcher posts to the framed dev app (inset forward). */
1158
- declare const SAFE_AREA_INSETS_MESSAGE_TYPE: "ait:safe-area-insets";
1159
- /**
1160
- * The postMessage command the launcher partner bar's `←` button sends to the
1161
- * framed dev app (#510). The framed page calls `history.back()` in response.
1162
- *
1163
- * Protocol: only `{ type: 'ait:navigate-back' }` is valid. No other fields are
1164
- * read or acted on — extra fields are silently ignored by the shape guard.
1165
- * Game variant never sends this message (back button is partner-bar-only).
1166
- */
1167
- declare const NAVIGATE_BACK_MESSAGE_TYPE: "ait:navigate-back";
1168
- /**
1169
- * The postMessage envelope the framed mini-app self-reports its webViewType
1170
- * with (#580). The mini-app knows its own type from the build constant
1171
- * `__WEB_VIEW_TYPE__` (`granite.config.ts`'s `webViewProps.type`, injected by
1172
- * the devtools unplugin). The launcher is cross-origin so it cannot read that
1173
- * constant directly — the mini-app posts it to `window.parent` once so the
1174
- * launcher (env-2 PWA shell) switches to game mode automatically, with no
1175
- * manual `?navBarType=game` URL edit.
1176
- *
1177
- * Direction: this is the SEND side's contract (posted from inside the iframe by
1178
- * `@ait-co/debug-console`'s `packages/debug-console/src/attach.ts`). The
1179
- * launcher's receive half lives in
1180
- * `e2e/fixture/launcher/Launcher.tsx` and mirrors the same value enum inline,
1181
- * staying decoupled from the mock package internals — the same pattern the
1182
- * other launcher message types follow.
1183
- *
1184
- * Value enum: only `'partner'` and `'game'` are valid. The SDK's deprecated
1185
- * `'external'` alias of `partner` (web-framework 2.6.1) is mapped to `'partner'`
1186
- * at the send site so the wire only ever carries the two shapes the launcher
1187
- * emulates.
1188
- */
1189
- declare const WEB_VIEW_TYPE_MESSAGE_TYPE: "ait:web-view-type";
1190
- /** The two webViewType shapes the launcher can emulate (#580). */
1191
- type WebViewTypeValue = "partner" | "game";
1192
- /**
1193
- * Parse + validate a raw postMessage payload into a `SafeAreaInsets`, or return
1194
- * null when it is not a well-formed `ait:safe-area-insets` message. Pure — unit
1195
- * tested without a real MessageEvent.
1196
- */
1197
- declare function parseSafeAreaInsetsMessage(data: unknown): SafeAreaInsets$1 | null;
1198
- /**
1199
- * Parse + validate a raw postMessage payload into a webViewType value
1200
- * (`'partner'` | `'game'`), or return `null` when it is not a well-formed
1201
- * `ait:web-view-type` message (#580). Pure — unit tested without a real
1202
- * MessageEvent.
1203
- *
1204
- * Strict shape guard (the safety boundary for the cross-origin receive path):
1205
- * the payload must be a non-null object whose `type` is exactly
1206
- * {@link WEB_VIEW_TYPE_MESSAGE_TYPE} and whose `value` is exactly `'partner'`
1207
- * or `'game'` (an enum allow-list). Anything else — a foreign type, a missing
1208
- * or non-string value, the deprecated `'external'` alias, or any other string —
1209
- * returns `null` so a stray postMessage can never flip the launcher's visual
1210
- * mode. The send site is responsible for collapsing `'external'` → `'partner'`
1211
- * before posting; the parser does NOT silently accept it.
1212
- */
1213
- declare function parseWebViewTypeMessage(data: unknown): WebViewTypeValue | null;
1214
- /**
1215
- * Apply forwarded insets to the mock state. Skips the write (and the resulting
1216
- * subscribe notify) when nothing changed, so repeated identical messages from a
1217
- * resize storm don't churn subscribers.
1218
- */
1219
- declare function applyForwardedSafeAreaInsets(insets: SafeAreaInsets$1): void;
1220
- /**
1221
- * Install the window `message` listener that receives forwarded insets. Safe to
1222
- * call multiple times (idempotent) and a no-op outside a browser (SSR/jsdom
1223
- * without a window). Imported for its side effect by the mock barrel so any
1224
- * consumer that aliases `@apps-in-toss/web-framework` to the mock gets it wired.
1225
- *
1226
- * On each valid `ait:safe-area-insets` message:
1227
- * 1. Writes the corrected insets into the mock `SafeAreaInsets` state
1228
- * (existing #484 behaviour — for apps that still read SDK insets).
1229
- * 2. Drives the env-2 dead-band compensation style via
1230
- * {@link applyEnv2Compensation} — injects a `body { margin-top: calc(-1 *
1231
- * env(safe-area-inset-top)) }` style when `top === 0` (partner mode) and
1232
- * removes it when `top > 0` (game / full-bleed mode).
1233
- */
1234
- declare function installSafeAreaInsetsBridge(): void;
1235
- /**
1236
- * Parse a raw postMessage payload as an `ait:navigate-back` command.
1237
- *
1238
- * Returns true when the payload is a well-formed navigate-back command
1239
- * (`{ type: 'ait:navigate-back' }`), false otherwise. Pure — unit tested
1240
- * without a real MessageEvent.
1241
- *
1242
- * Shape guard: only the `type` field is inspected; any extra fields are
1243
- * ignored so future extensions do not break older receivers. The function
1244
- * does NOT read any data field beyond `type` — no sensitive values, no host
1245
- * disclosure (same principle as the insets bridge).
1246
- */
1247
- declare function isNavigateBackMessage(data: unknown): boolean;
1248
- /**
1249
- * Install the window `message` listener that handles `ait:navigate-back`
1250
- * commands (#510). When the launcher partner bar's `←` button is clicked it
1251
- * posts `{ type: 'ait:navigate-back' }` to the framed dev app; this listener
1252
- * calls `dispatchHostBackNavigation()` from the navigation module.
1253
- *
1254
- * Dispatch semantics: if there are any `graniteEvent.addEventListener('backEvent', …)`
1255
- * subscribers the CustomEvent `__ait:backEvent` is fired (same path as the env-1
1256
- * panel back button — the mini-app intercept channel). When there are no
1257
- * subscribers `history.back()` is called as the fallback. Back semantics are
1258
- * owned entirely by the navigation module; this bridge only delegates.
1259
- *
1260
- * Safe to call multiple times (idempotent) and a no-op outside a browser.
1261
- * Installed together with the inset bridge by `installBridges()` so any consumer
1262
- * of the mock barrel gets both wired automatically.
1263
- *
1264
- * No-op on apps that predate this bridge — the launcher posts the message but
1265
- * older mocks simply have no listener (harmless).
1266
- */
1267
- declare function installNavigateBackBridge(): void;
1268
- /**
1269
- * Install both env-2 postMessage bridges in one call (#484 insets + #510
1270
- * navigate-back). The mock barrel calls this at import time so consumers get
1271
- * all bridges wired without any explicit setup.
1272
- */
1273
- declare function installBridges(): void;
1274
- //#endregion
1275
- export { Accuracy, type AitDevtoolsState, Analytics, type AnalyticsLogEntry, type ConsentedUserData, type ConsentedUserDataKey, type DeclaredAgeRange, type DeviceApiMode, type DeviceModes, FetchAlbumPhotosPermissionError, FetchContactsPermissionError, 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, OpenCameraPermissionError, type OperationalEnvironment, PermissionError, type PermissionName, type PermissionStatus, type PlatformOS, type Primitive, SAFE_AREA_INSETS_MESSAGE_TYPE, SafeAreaInsets, type SafeAreaInsets$1 as SafeAreaInsetsType, SetClipboardTextPermissionError, StartUpdateLocationPermissionError, Storage, TossAds, 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 };
1156
+ export { Accuracy, type AitDevtoolsState, Analytics, type AnalyticsLogEntry, type ConsentedUserData, type ConsentedUserDataKey, type DeclaredAgeRange, type DeviceApiMode, type DeviceModes, FetchAlbumPhotosPermissionError, FetchContactsPermissionError, GetClipboardTextPermissionError, GetCurrentLocationPermissionError, GoogleAdMob, type HapticFeedbackType, IAP, type IapNextResult, type LocationCoords, type MockContact, type MockData, type MockIapProduct, type MockLocation, type MockPreset, type MockPresetState, type NetworkStatus, OpenCameraPermissionError, type OperationalEnvironment, PermissionError, type PermissionName, type PermissionStatus, type PlatformOS, type Primitive, SafeAreaInsets, type SafeAreaInsets$1 as SafeAreaInsetsType, SetClipboardTextPermissionError, StartUpdateLocationPermissionError, Storage, TossAds, 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 };