droplinked-web3-ui 0.0.11 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,19 +1,33 @@
1
1
  import { JSX } from 'react/jsx-runtime';
2
2
 
3
- export declare function DroplinkedClaimNFT({ orderId, skuId, onError, onMainProcessSuccess, buttonText, isButtonDisabled, }: DroplinkedClaimNFTProps): JSX.Element;
3
+ export declare interface ActionInputsMap {
4
+ [Actions.Payment]: PaymentInputs;
5
+ [Actions.ClaimNFT]: ClaimNFTInputs;
6
+ }
7
+
8
+ export declare const Actions: {
9
+ readonly Payment: "payment";
10
+ readonly ClaimNFT: "claimNFT";
11
+ };
12
+
13
+ export declare type Actions = typeof Actions;
14
+
15
+ export declare type ActionType = typeof Actions[keyof typeof Actions];
4
16
 
5
- declare interface DroplinkedClaimNFTProps {
17
+ export declare interface ClaimNFTInputs {
6
18
  orderId: string;
7
19
  skuId: string;
8
20
  onError: (message: string) => void;
9
- onMainProcessSuccess: (transactionHash: string) => void;
21
+ onSuccess: (transactionHash: string) => void;
10
22
  buttonText: string;
11
23
  isButtonDisabled: boolean;
12
24
  }
13
25
 
14
- export declare function DroplinkedWeb3Ui({ ...props }: Props): JSX.Element;
26
+ export declare function DroplinkedWeb3Ui<T extends ActionType>({ action, inputs }: Props<T>): JSX.Element;
15
27
 
16
- declare interface Props {
28
+ export declare type Inputs = PaymentInputs | ClaimNFTInputs;
29
+
30
+ export declare interface PaymentInputs {
17
31
  cartId: string;
18
32
  shopId: string;
19
33
  price: number;
@@ -21,7 +35,12 @@ declare interface Props {
21
35
  abbreviation: string;
22
36
  symbol: string;
23
37
  onError: (error: string) => void;
24
- onMainProcessSuccess: (orderId?: string) => void;
38
+ onSuccess: (orderId?: string) => void;
39
+ }
40
+
41
+ declare interface Props<T extends ActionType> {
42
+ action: T;
43
+ inputs: ActionInputsMap[T];
25
44
  }
26
45
 
27
46
  export { }