Skip to content

Commit

Permalink
Fixing internal classes that are used as both values and types
Browse files Browse the repository at this point in the history
  • Loading branch information
qiuguohua committed Dec 9, 2024
1 parent 5779f65 commit 99c9636
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 67 deletions.
40 changes: 20 additions & 20 deletions @types/jsb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1105,28 +1105,28 @@ declare namespace jsb {
SUBS = 'subs'
}

export namespace BillingFlowParams {
export interface ProductDetailsParamsBuilder {
setOfferToken: (purchaseToken: string) => ProductDetailsParamsBuilder;
setProductDetails: (productDetails: ProductDetails) => ProductDetailsParamsBuilder;
build: () => ProductDetailsParams;
}
export class ProductDetailsParams {
public static newBuilder(): ProductDetailsParamsBuilder;
}
export interface ProductDetailsParamsBuilder {
setOfferToken: (purchaseToken: string) => ProductDetailsParamsBuilder;
setProductDetails: (productDetails: ProductDetails) => ProductDetailsParamsBuilder;
build: () => ProductDetailsParams;
}
export class ProductDetailsParams {
newBuilder: () => ProductDetailsParamsBuilder;
}

export interface SubscriptionUpdateParamsBuilder {
setOldPurcchaseToken: (purchaseToken: string) => SubscriptionUpdateParamsBuilder;
setOriginalExternalTransactionId: (externalTransactionId: string) => SubscriptionUpdateParamsBuilder;
setSubscriptionReplacementMode: (subscriptionReplacementMode: number) => SubscriptionUpdateParamsBuilder;
build: () => SubscriptionUpdateParams;
}
export class SubscriptionUpdateParams {
public static newBuilder(): SubscriptionUpdateParamsBuilder;
}
export interface SubscriptionUpdateParamsBuilder {
setOldPurcchaseToken: (purchaseToken: string) => SubscriptionUpdateParamsBuilder;
setOriginalExternalTransactionId: (externalTransactionId: string) => SubscriptionUpdateParamsBuilder;
setSubscriptionReplacementMode: (subscriptionReplacementMode: number) => SubscriptionUpdateParamsBuilder;
build: () => SubscriptionUpdateParams;
}
export class SubscriptionUpdateParams {
newBuilder(): () => SubscriptionUpdateParamsBuilder;
}

export class BillingFlowParams {
static ProductDetailsParams: jsb.ProductDetailsParams;
static SubscriptionUpdateParams: jsb.SubscriptionUpdateParams;
static Builder: BillingFlowParamsBuilder;
public static newBuilder(): BillingFlowParamsBuilder;
}
Expand All @@ -1135,8 +1135,8 @@ declare namespace jsb {
setIsOfferPersonalized: (isOfferPersonalized: boolean) => BillingFlowParamsBuilder;
setObfuscatedAccountId: (obfuscatedAccountid: string) => BillingFlowParamsBuilder;
setObfuscatedProfileId: (obfuscatedProfileId: string) => BillingFlowParamsBuilder;
setProductDetailsParamsList: (userChoiceBillingListener: BillingFlowParams.ProductDetailsParams[]) => BillingFlowParamsBuilder;
setSubscriptionUpdateParams: (userChoiceBillingListener: BillingFlowParams.SubscriptionUpdateParams) => BillingFlowParamsBuilder;
setProductDetailsParamsList: (userChoiceBillingListener: ProductDetailsParams[]) => BillingFlowParamsBuilder;
setSubscriptionUpdateParams: (userChoiceBillingListener: SubscriptionUpdateParams) => BillingFlowParamsBuilder;
build: () => BillingFlowParams;
}

Expand Down
82 changes: 35 additions & 47 deletions vendor/google/billing/billing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,70 +26,58 @@ import { EventTarget } from '../../../cocos/core/event';

export namespace google {
export namespace billing {
export type UserChoiceDetails = jsb.UserChoiceDetails;
export type OneTimePurchaseOfferDetails = jsb.OneTimePurchaseOfferDetails;
export type InstallmentPlanDetails = jsb.InstallmentPlanDetails;
export type PricingPhase = jsb.PricingPhase;
export type SubscriptionOfferDetails = jsb.SubscriptionOfferDetails;
export type ProductDetails = jsb.ProductDetails;
export type AccountIdentifiers = jsb.AccountIdentifiers;
export type PendingPurchaseUpdate = jsb.PendingPurchaseUpdate;
export type Purchase = jsb.Purchase;
export type BillingConfig = jsb.BillingConfig;
export type AlternativeBillingOnlyReportingDetails = jsb.AlternativeBillingOnlyReportingDetails;
export type ExternalOfferReportingDetails = jsb.ExternalOfferReportingDetails;
export type InAppMessageResult = jsb.InAppMessageResult;
/**
* @en Params containing the response code and the debug message from In-app Billing API response.
* @zh 包含应用内结算 API 响应代码和调试信息的参数
*/

// export namespace BillingClient {
// export type Builder = jsb.BillingClientBuilder;
// }
export type BillingClient = jsb.BillingClient;
export const BillingClient = jsb.BillingClient;
// export namespace BillingResult {
// export type Builder = jsb.BillingResultBuilder;
// }
export type BillingResult = jsb.BillingResult;
export const BillingResult = jsb.BillingResult;

export type PendingPurchasesParams = jsb.PendingPurchasesParams;
export const PendingPurchasesParams = jsb.PendingPurchasesParams;

export type QueryProductDetailsParams = jsb.QueryProductDetailsParams;
export const ProductDetailsParams = jsb.ProductDetailsParams;
export const QueryProductDetailsParams = jsb.QueryProductDetailsParams;

export type Product = jsb.Product;
export const Product = jsb.Product;

// export namespace BillingFlowParams {
// export type Builder = jsb.BillingFlowParamsBuilder;
// export type SubscriptionUpdateParams = jsb.BillingFlowParams.SubscriptionUpdateParams;
// export type ProductDetailsParams = jsb.BillingFlowParams.ProductDetailsParams;
// }
export type BillingFlowParams = jsb.BillingFlowParams;
//export type IBillingFlowParams = jsb.IBillingFlowParams;
//export const BillingFlowParams: typeof jsb.IBillingFlowParams = jsb.BillingFlowParams;
export const BillingFlowParams: typeof jsb.BillingFlowParams = jsb.BillingFlowParams;

export type ConsumeParams = jsb.ConsumeParams;
export const ConsumeParams = jsb.ConsumeParams;

export type AcknowledgePurchaseParams = jsb.AcknowledgePurchaseParams;
export const AcknowledgePurchaseParams = jsb.AcknowledgePurchaseParams;

export type QueryPurchasesParams = jsb.QueryPurchasesParams;
export const QueryPurchasesParams = jsb.QueryPurchasesParams;

export type InAppMessageParams = jsb.InAppMessageParams;
export const InAppMessageParams = jsb.InAppMessageParams;

export type GetBillingConfigParams = jsb.GetBillingConfigParams;
export const GetBillingConfigParams = jsb.GetBillingConfigParams;
}
}

export declare namespace google {
export namespace billing {
export type UserChoiceDetails = jsb.UserChoiceDetails;
export type OneTimePurchaseOfferDetails = jsb.OneTimePurchaseOfferDetails;
export type InstallmentPlanDetails = jsb.InstallmentPlanDetails;
export type PricingPhase = jsb.PricingPhase;
export type SubscriptionOfferDetails = jsb.SubscriptionOfferDetails;
export type ProductDetails = jsb.ProductDetails;
export type AccountIdentifiers = jsb.AccountIdentifiers;
export type PendingPurchaseUpdate = jsb.PendingPurchaseUpdate;
export type Purchase = jsb.Purchase;
export type BillingConfig = jsb.BillingConfig;
export type AlternativeBillingOnlyReportingDetails = jsb.AlternativeBillingOnlyReportingDetails;
export type ExternalOfferReportingDetails = jsb.ExternalOfferReportingDetails;
export type InAppMessageResult = jsb.InAppMessageResult;
export type BillingClient = jsb.BillingClient;
export type BillingResult = jsb.BillingResult;
export type PendingPurchasesParams = jsb.PendingPurchasesParams;
export type QueryProductDetailsParams = jsb.QueryProductDetailsParams;
export type Product = jsb.Product;
export namespace BillingFlowParams {
//export type Builder = typeof jsb.BillingFlowParamsBuilder;
export type SubscriptionUpdateParams = typeof jsb.SubscriptionUpdateParams;
export type ProductDetailsParams = typeof jsb.ProductDetailsParams;
}
export type BillingFlowParams = typeof jsb.BillingFlowParams;
export type ConsumeParams = jsb.ConsumeParams;
export type AcknowledgePurchaseParams = jsb.AcknowledgePurchaseParams;
export type QueryPurchasesParams = jsb.QueryPurchasesParams;
export type InAppMessageParams = jsb.InAppMessageParams;
export type GetBillingConfigParams = jsb.GetBillingConfigParams;
}
}
// export declare namespace BillingFlowParams {
// export type Builder = jsb.BillingFlowParamsBuilder;
// export type SubscriptionUpdateParams = jsb.SubscriptionUpdateParams;
Expand Down

0 comments on commit 99c9636

Please sign in to comment.