Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/support-window.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
"5.5": "2024-06-20T17:37:03.845Z",
"5.6": "2024-09-09T16:16:40.226Z",
"5.7": "2024-11-22T17:16:09.621Z",
"5.8": "2025-02-28T16:52:08.252Z"
"5.8": "2025-02-28T16:52:08.252Z",
"5.9": "2025-07-31T17:54:06.216Z"
}
2 changes: 1 addition & 1 deletion docs/support-window.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion types/google-publisher-tag/google-publisher-tag-tests.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Tests for Google Publisher Tag 1.20250728
// Synced from: https://github.com/googleads/google-publisher-tag-types/commit/acc4c06564252357bad326a7d63ec6b7402e0384
// Synced from: https://github.com/googleads/google-publisher-tag-types/commit/02d9acb6d6e8578a1a5fc39691ec36cd799f0a6b

// Test for googletag.cmd
function test_googletag_cmd() {
Expand Down
2 changes: 2 additions & 0 deletions types/google-publisher-tag/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2859,6 +2859,8 @@ declare namespace googletag {
* **Note:** Game manual interstitial is a [limited-access](https://support.google.com/admanager/answer/14640119) format.
*/
GAME_MANUAL_INTERSTITIAL,
/** Ad Intents format. */
AD_INTENTS,
}

/**
Expand Down
2 changes: 2 additions & 0 deletions types/mparticle__web-sdk/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,8 @@ export interface IdentityApiData {
userIdentities: UserIdentities;
}

export type IdentityApiMethods = "identify" | "login" | "logout" | "modify";

export interface Callback {
(): void;
}
Expand Down
39 changes: 21 additions & 18 deletions types/ysdk/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ declare global {

export interface SDK<TGlobalSigned extends boolean = false> {
EVENTS: {
ACCOUNT_SELECTION_DIALOG_CLOSED: "ACCOUNT_SELECTION_DIALOG_CLOSED";
ACCOUNT_SELECTION_DIALOG_OPENED: "ACCOUNT_SELECTION_DIALOG_OPENED";
EXIT: "EXIT";
HISTORY_BACK: "HISTORY_BACK";
ACCOUNT_SELECTION_DIALOG_OPENED: "ACCOUNT_SELECTION_DIALOG_OPENED";
ACCOUNT_SELECTION_DIALOG_CLOSED: "ACCOUNT_SELECTION_DIALOG_CLOSED";
};
adv: {
getBannerAdvStatus(): Promise<{
Expand All @@ -21,15 +21,15 @@ export interface SDK<TGlobalSigned extends boolean = false> {
showFullscreenAdv(opts?: {
callbacks?: {
onClose?: (wasShown: boolean) => void;
onError?: (error: string) => void;
onError?: (error: Error) => void;
onOffline?: () => void;
onOpen?: () => void;
};
}): void;
showRewardedVideo(opts?: {
callbacks?: {
onClose?: () => void;
onError?: (error: string) => void;
onError?: (error: Error) => void;
onOpen?: () => void;
onRewarded?: () => void;
};
Expand All @@ -48,13 +48,19 @@ export interface SDK<TGlobalSigned extends boolean = false> {
start(): void;
stop(): void;
};
GamesAPI: {
getAllGames(): Promise<{
developerURL: string;
games: Game[];
}>;
getGameByID(id: number): Promise<{
game?: Game;
isAvailable: boolean;
}>;
};
LoadingAPI: {
ready(): void;
};
GamesAPI: {
getAllGames(): Promise<{ games: Game[]; developerURL: string }>;
getGameByID(id: number): Promise<{ game?: Game; isAvailable: boolean }>;
};
};
feedback: {
canReview(): Promise<{
Expand Down Expand Up @@ -86,7 +92,7 @@ export interface SDK<TGlobalSigned extends boolean = false> {
getPayments<TSigned extends boolean = false>(opts?: { signed?: TSigned }): Promise<Payments<TSigned>>;
getPlayer<TSigned extends boolean = false>(opts?: {
signed?: TSigned;
}): Promise<TSigned extends true ? Signed<Player> : Player>;
}): Promise<TSigned extends true ? Signature : Player>;
getStorage(): Promise<SafeStorage>;
isAvailableMethod(methodName: string): Promise<boolean>;
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- SDK event args can be of any type
Expand All @@ -109,15 +115,15 @@ export interface GetFlagsParams {

export interface Game {
appID: string;
title: string;
url: string;
coverURL: string;
iconURL: string;
title: string;
url: string;
}

/** When an object is passed through signature, it is not returned as itself,
* but instead the signature field contains an encrypted string with object fields that can be decrypted on your server */
export interface Signed<T> {
export interface Signature {
signature: string;
}

Expand All @@ -135,7 +141,7 @@ export interface Environment {
get payload(): null | string;
}

export enum DeviceType {
export enum DeviceType { // eslint-disable-line @typescript-eslint/naming-convention
DESKTOP = "desktop",
MOBILE = "mobile",
TABLET = "tablet",
Expand Down Expand Up @@ -194,11 +200,8 @@ export interface Product {
export interface Payments<TSigned extends boolean = false> {
consumePurchase(token: string): Promise<void>;
getCatalog(): Promise<Product[]>;
getPurchases(): Promise<TSigned extends true ? Signed<Purchase[]> : Purchase[]>;
purchase(opts?: {
developerPayload?: string;
id: string;
}): Promise<TSigned extends true ? Signed<Purchase> : Purchase>;
getPurchases(): Promise<TSigned extends true ? Signature : Purchase[]>;
purchase(opts?: { developerPayload?: string; id: string }): Promise<TSigned extends true ? Signature : Purchase>;
}

export interface GetLeaderboardEntriesOpts {
Expand Down
2 changes: 1 addition & 1 deletion types/ysdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@types/ysdk",
"version": "1.1.9999",
"version": "1.2.9999",
"private": true,
"dependencies": {},
"devDependencies": {
Expand Down
24 changes: 15 additions & 9 deletions types/ysdk/ysdk-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ async function Payments() {
// $ExpectType Purchase
purchasesUnsigned[0];

// @ts-expect-error
// @ts-expect-error - for testing purpose
purchasesUnsigned.signature;

// $ExpectType Purchase
const purchaseUnsigned = await ysdk.payments.purchase({ id: "test" });

// @ts-expect-error
// @ts-expect-error - for testing purpose
purchaseUnsigned.signature;

// $ExpectType string
Expand All @@ -57,7 +57,7 @@ async function Payments() {

const ysdkSigned = await YaGames.init({ signed: true });

// $ExpectType Signed<Purchase[]>
// $ExpectType Signature
const purchases = await ysdkSigned.payments.getPurchases();

// $ExpectType string
Expand Down Expand Up @@ -207,7 +207,7 @@ async function Player() {
// $ExpectType Promise<Player>
ysdk.getPlayer();

// $ExpectType Signed<Player>
// $ExpectType Signature
const signedPlayer = await ysdk.getPlayer({ signed: true });

// $ExpectType string
Expand Down Expand Up @@ -320,7 +320,7 @@ async function Misc() {
// $ExpectType void
ysdk.features.GameplayAPI.stop();

// $ExpectType Promise<{ games: Game[]; developerURL: string; }>
// $ExpectType Promise<{ developerURL: string; games: Game[]; }>
ysdk.features.GamesAPI.getAllGames();

// $ExpectType Promise<{ game?: Game | undefined; isAvailable: boolean; }>
Expand Down Expand Up @@ -364,10 +364,12 @@ async function Misc() {

// $ExpectType Promise<Record<string, string>>
ysdk.getFlags({
clientFeatures: [{
name: "feature-name",
value: "feature-value",
}],
clientFeatures: [
{
name: "feature-name",
value: "feature-value",
},
],
defaultFlags: {
"test-flag": "default-value",
},
Expand All @@ -386,6 +388,7 @@ async function Misc() {
// Features API
async function Features() {
const ysdk = await YaGames.init();

// $ExpectType void
ysdk.features.GameplayAPI.start();
// $ExpectType void
Expand All @@ -397,6 +400,7 @@ async function Features() {
// Multiplayer API
async function Multiplayer() {
const ysdk = await YaGames.init();

// $ExpectType Multiplayer
ysdk.multiplayer;
// $ExpectType MultiplayerSessions
Expand All @@ -416,12 +420,14 @@ async function Multiplayer() {

async function IsAvailableMethodTest() {
const ysdk = await YaGames.init();

// $ExpectType Promise<boolean>
ysdk.isAvailableMethod("not.existing.method");
}

async function ServerTimeTest() {
const ysdk = await YaGames.init();

// $ExpectType number
ysdk.serverTime();
}