@jest-com/types 1.260923.5 → 1.260928.9

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.
Files changed (2) hide show
  1. package/index.d.ts +33 -1
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -89,6 +89,10 @@ export type SubscriptionData = {
89
89
 
90
90
  export type RedirectToTeamGameErrorCode = "game_not_found" | "different_team" | "internal_error";
91
91
  export type NotificationPriority = "low" | "medium" | "high" | "critical";
92
+ export type CaptureEventOptions = {
93
+ send_instantly?: boolean;
94
+ transport?: "XHR" | "fetch" | "sendBeacon";
95
+ };
92
96
  export type ReferralNotificationVariant = {
93
97
  title?: string | null;
94
98
  body: string;
@@ -553,6 +557,33 @@ export interface SocialModule {
553
557
  size?: AvatarSize;
554
558
  username: string;
555
559
  }): string;
560
+ /**
561
+ * Opens the platform's share sheet for an image — the same sheet the
562
+ * platform's own screenshot button shows, offering chat, the native share
563
+ * sheet and download. The player picks where it goes and writes the
564
+ * caption, so a game can never share on the player's behalf without a tap.
565
+ *
566
+ * @param options.image - Base64 PNG (raw or data URL). Omit it to have the
567
+ * platform capture the canvas, or your registered screenshot provider.
568
+ * @param options.entryPayload - Handed back to your game when a player
569
+ * opens the shared message, so a code or coupon travels with it.
570
+ * @returns `{ canceled: true }` when the sheet closed without sharing,
571
+ * including a player who left the page while the post was still landing,
572
+ * so it is not proof that nothing was posted.
573
+ * @example
574
+ * ```typescript
575
+ * await JestSDK.social.shareImage({
576
+ * image: couponCanvas.toDataURL("image/png"),
577
+ * entryPayload: { coupon: "SPRING25" },
578
+ * });
579
+ * ```
580
+ */
581
+ shareImage(options?: {
582
+ image?: string;
583
+ entryPayload?: Record<string, unknown>;
584
+ }): Promise<{
585
+ canceled: boolean;
586
+ }>;
556
587
  /**
557
588
  * Registers a custom screenshot source used when the platform asks the
558
589
  * game for a screenshot, replacing the SDK's automatic canvas capture.
@@ -1149,9 +1180,10 @@ export interface JestSDK {
1149
1180
  * Use stable, lowercase, snake_case names.
1150
1181
  * @param properties - Optional structured data attached to the event
1151
1182
  * (e.g. `{ level: 5, score: 1200 }`).
1183
+ * @param options - Optional immediate sending and transport overrides.
1152
1184
  * @throws {Error} If the SDK is not initialized or arguments are invalid.
1153
1185
  */
1154
- captureEvent(eventName: string, properties?: Record<string, unknown>): void;
1186
+ captureEvent(eventName: string, properties?: Record<string, unknown>, options?: CaptureEventOptions): void;
1155
1187
  /**
1156
1188
  * Redirects the player to another game owned by the same team as the
1157
1189
  * calling game. The platform performs the navigation after verifying
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jest-com/types",
3
- "version": "1.260923.5",
3
+ "version": "1.260928.9",
4
4
  "description": "TypeScript types for the Jest HTML5 game SDK global (window.JestSDK).",
5
5
  "keywords": [
6
6
  "jest",