@jest-com/types 1.260923.5 → 1.260923.7
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/index.d.ts +27 -0
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -553,6 +553,33 @@ export interface SocialModule {
|
|
|
553
553
|
size?: AvatarSize;
|
|
554
554
|
username: string;
|
|
555
555
|
}): string;
|
|
556
|
+
/**
|
|
557
|
+
* Opens the platform's share sheet for an image — the same sheet the
|
|
558
|
+
* platform's own screenshot button shows, offering chat, the native share
|
|
559
|
+
* sheet and download. The player picks where it goes and writes the
|
|
560
|
+
* caption, so a game can never share on the player's behalf without a tap.
|
|
561
|
+
*
|
|
562
|
+
* @param options.image - Base64 PNG (raw or data URL). Omit it to have the
|
|
563
|
+
* platform capture the canvas, or your registered screenshot provider.
|
|
564
|
+
* @param options.entryPayload - Handed back to your game when a player
|
|
565
|
+
* opens the shared message, so a code or coupon travels with it.
|
|
566
|
+
* @returns `{ canceled: true }` when the sheet closed without sharing,
|
|
567
|
+
* including a player who left the page while the post was still landing,
|
|
568
|
+
* so it is not proof that nothing was posted.
|
|
569
|
+
* @example
|
|
570
|
+
* ```typescript
|
|
571
|
+
* await JestSDK.social.shareImage({
|
|
572
|
+
* image: couponCanvas.toDataURL("image/png"),
|
|
573
|
+
* entryPayload: { coupon: "SPRING25" },
|
|
574
|
+
* });
|
|
575
|
+
* ```
|
|
576
|
+
*/
|
|
577
|
+
shareImage(options?: {
|
|
578
|
+
image?: string;
|
|
579
|
+
entryPayload?: Record<string, unknown>;
|
|
580
|
+
}): Promise<{
|
|
581
|
+
canceled: boolean;
|
|
582
|
+
}>;
|
|
556
583
|
/**
|
|
557
584
|
* Registers a custom screenshot source used when the platform asks the
|
|
558
585
|
* game for a screenshot, replacing the SDK's automatic canvas capture.
|