From 4e969e50eb9b4a05177f405f366b256c1245db66 Mon Sep 17 00:00:00 2001 From: Sators Date: Mon, 20 Feb 2023 09:49:13 -0500 Subject: [PATCH 1/2] Fix parameters for OpenCheckoutOptions, add HostedPage type --- index.d.ts | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/index.d.ts b/index.d.ts index b85319b..9cc052e 100644 --- a/index.d.ts +++ b/index.d.ts @@ -25,14 +25,14 @@ type InitOptions = { }; type OpenCheckoutOptions = { - hostedPage: Function; - layout: Layout; - loaded: Function; - error: Function; - success(hostedPageId: string): void; - close: Function; - step(currentStep: string): void; -}; + hostedPage(): Promise + layout?: Layout + loaded?: Function + error?: Function + success?(hostedPageId: string): void + close?: Function + step?(currentStep: string): void +} interface AddressDetails { first_name?: string; @@ -560,3 +560,13 @@ export interface Component { callbacks: Callbacks ): Promise; } + +export type HostedPage = { + id: string + type: string + url: string + state: string + embed: boolean + created_at: number + expires_at: number +} From 4fa02ab9110779b6b03759c9dcabeb0974209df6 Mon Sep 17 00:00:00 2001 From: Sators Date: Mon, 20 Feb 2023 09:55:40 -0500 Subject: [PATCH 2/2] Shuffle hosted page location to avoid conflicts --- index.d.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/index.d.ts b/index.d.ts index 9cc052e..371593e 100644 --- a/index.d.ts +++ b/index.d.ts @@ -34,6 +34,16 @@ type OpenCheckoutOptions = { step?(currentStep: string): void } +export type HostedPage = { + id: string + type: string + url: string + state: string + embed: boolean + created_at: number + expires_at: number +} + interface AddressDetails { first_name?: string; last_name?: string; @@ -560,13 +570,3 @@ export interface Component { callbacks: Callbacks ): Promise; } - -export type HostedPage = { - id: string - type: string - url: string - state: string - embed: boolean - created_at: number - expires_at: number -}