Skip to content

Commit

Permalink
Fix jsb (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
dumganhar authored Dec 10, 2024
1 parent ffc5739 commit 353e905
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
1 change: 1 addition & 0 deletions @types/jsb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1320,6 +1320,7 @@ declare namespace jsb {
export class SubscriptionUpdateParams {
private constructor();
static newBuilder(): () => SubscriptionUpdateParamsBuilder;
static ReplacementMode: typeof jsb.ReplacementMode;
}

export class BillingFlowParams {
Expand Down
2 changes: 1 addition & 1 deletion cc.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
"modules": ["tiled-map"],
"dependentModules": ["2d"]
},
"vendor": {
"vendor-google": {
"modules": ["vendor-google"]
},
"spine": {
Expand Down
27 changes: 13 additions & 14 deletions vendor/google/billing/billing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,25 @@
import { JSB } from 'internal:constants';
import './billing-enum';

declare const jsb: any;

const ns = JSB ? jsb : {} as unknown as typeof jsb;
export namespace google {
export namespace billing {
export const BillingClient = JSB ? jsb.BillingClient : null as unknown as typeof jsb.BillingClient;
export const BillingResult = JSB ? jsb.BillingResult : null as unknown as typeof jsb.BillingResult;
export const BillingClient = ns.BillingClient;
export const BillingResult = ns.BillingResult;

export const PendingPurchasesParams = JSB ? jsb.PendingPurchasesParams : null as unknown as typeof jsb.PendingPurchasesParams;
export const PendingPurchasesParams = ns.PendingPurchasesParams;

// export const ProductDetailsParams = jsb.ProductDetailsParams;
export const QueryProductDetailsParams = JSB ? jsb.QueryProductDetailsParams : null as unknown as typeof jsb.QueryProductDetailsParams;
// export const ProductDetailsParams = ns.ProductDetailsParams;
export const QueryProductDetailsParams = ns.QueryProductDetailsParams;

export const Product = JSB ? jsb.Product : null as unknown as typeof jsb.Product;
export const BillingFlowParams = JSB ? jsb.BillingFlowParams : null as unknown as typeof jsb.BillingFlowParams;
export const Product = ns.Product;
export const BillingFlowParams = ns.BillingFlowParams;

export const ConsumeParams = JSB ? jsb.ConsumeParams : null as unknown as typeof jsb.ConsumeParams;
export const AcknowledgePurchaseParams = JSB ? jsb.AcknowledgePurchaseParams : null as unknown as typeof jsb.AcknowledgePurchaseParams;
export const QueryPurchasesParams = JSB ? jsb.QueryPurchasesParams : null as unknown as typeof jsb.QueryPurchasesParams;
export const InAppMessageParams = JSB ? jsb.InAppMessageParams : null as unknown as typeof jsb.InAppMessageParams;
export const GetBillingConfigParams = JSB ? jsb.GetBillingConfigParams : null as unknown as typeof jsb.GetBillingConfigParams;
export const ConsumeParams = ns.ConsumeParams;
export const AcknowledgePurchaseParams = ns.AcknowledgePurchaseParams;
export const QueryPurchasesParams = ns.QueryPurchasesParams;
export const InAppMessageParams = ns.InAppMessageParams;
export const GetBillingConfigParams = ns.GetBillingConfigParams;
}
}
export declare namespace google {
Expand Down

0 comments on commit 353e905

Please sign in to comment.