build ts binding

Seto committed Nov 28, 2025 at 16:46 UTC d1f65f9b047109df0168e5b907623e7d0031f054
4 files changed +18 -2
bun.lockb
Binary files a/bun.lockb and b/bun.lockb differ
dist-js/ads/rewarded.d.ts
+3
@@ -1,10 +1,13 @@
1 import { MobileAd, type MobileAdOptions } from "./common";
2 +import { PluginListener } from "@tauri-apps/api/core";
3 export declare class RewardedAd extends MobileAd<RewardedAdOptions> {
4 static cls: string;
5 isLoaded(): Promise<unknown>;
6 load(): Promise<void>;
7 show(): Promise<void>;
8 + onRewarded(handler: (payload: any) => void): Promise<PluginListener>;
9 }
10 +export declare function onRewarded(handler: (payload: any) => void): Promise<PluginListener>;
11 export declare class RewardedInterstitialAd extends MobileAd<RewardedAdOptions> {
12 static cls: string;
13 isLoaded(): Promise<unknown>;
dist-js/index.cjs
+7
@@ -129,8 +129,14 @@ var RewardedAd = class extends MobileAd {
129 async show() {
130 return super.show();
131 }
132 + async onRewarded(handler) {
133 + return await (0, __tauri_apps_api_core.addPluginListener)("admob", "rewarded_reward", handler);
134 + }
135 };
136 RewardedAd.cls = "RewardedAd";
137 +async function onRewarded(handler) {
138 + return await (0, __tauri_apps_api_core.addPluginListener)("admob", "rewarded/reward", handler);
139 +}
140 var RewardedInterstitialAd = class extends MobileAd {
141 isLoaded() {
142 return super.isLoaded();
@@ -151,4 +157,5 @@ exports.MobileAd = MobileAd;
157 exports.RewardedAd = RewardedAd;
158 exports.RewardedInterstitialAd = RewardedInterstitialAd;
159 exports.isPrivacyOptionsRequired = isPrivacyOptionsRequired;
160 +exports.onRewarded = onRewarded;
161 exports.showPrivacyOptionsForm = showPrivacyOptionsForm;
\ No newline at end of file
dist-js/index.js
+8 -2
@@ -1,4 +1,4 @@
1 -import { invoke } from "@tauri-apps/api/core";
1 +import { addPluginListener, invoke } from "@tauri-apps/api/core";
2
3 //#region node_modules/.pnpm/@rollup+plugin-typescript@11.1.6_rollup@2.79.2_tslib@2.8.1_typescript@5.9.3/node_modules/tslib/tslib.es6.js
4 function __classPrivateFieldGet(receiver, state, kind, f) {
@@ -129,8 +129,14 @@ var RewardedAd = class extends MobileAd {
129 async show() {
130 return super.show();
131 }
132 + async onRewarded(handler) {
133 + return await addPluginListener("admob", "rewarded_reward", handler);
134 + }
135 };
136 RewardedAd.cls = "RewardedAd";
137 +async function onRewarded(handler) {
138 + return await addPluginListener("admob", "rewarded/reward", handler);
139 +}
140 var RewardedInterstitialAd = class extends MobileAd {
141 isLoaded() {
142 return super.isLoaded();
@@ -145,4 +151,4 @@ var RewardedInterstitialAd = class extends MobileAd {
151 RewardedInterstitialAd.cls = "RewardedInterstitialAd";
152
153 //#endregion
148 -export { BannerAd, InterstitialAd, MobileAd, RewardedAd, RewardedInterstitialAd, isPrivacyOptionsRequired, showPrivacyOptionsForm };
\ No newline at end of file
154 +export { BannerAd, InterstitialAd, MobileAd, RewardedAd, RewardedInterstitialAd, isPrivacyOptionsRequired, onRewarded, showPrivacyOptionsForm };
\ No newline at end of file