@mosip/react-inji-verify-sdk 0.14.0-beta.0 → 0.14.0-beta.2
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/components/Button/Button.d.ts +10 -0
- package/dist/components/openid4vp-verification/OpenID4VPVerification.d.ts +1 -1
- package/dist/components/openid4vp-verification/OpenID4VPVerification.types.d.ts +15 -1
- package/dist/components/openid4vp-verification/WalletSelectionModal.d.ts +12 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/utils/api.d.ts +1 -0
- package/dist/utils/themeUtils.d.ts +4 -0
- package/package.json +10 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactElement, ButtonHTMLAttributes } from "react";
|
|
2
|
+
type ButtonVariant = "fill" | "outline" | "clear";
|
|
3
|
+
type ButtonProps = HTMLAttributes<HTMLButtonElement> & ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
4
|
+
title: string;
|
|
5
|
+
icon?: ReactElement;
|
|
6
|
+
variant?: ButtonVariant;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const Button: ({ title, icon, variant, disabled, className, id, ...rest }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OpenID4VPVerificationProps } from "./OpenID4VPVerification.types";
|
|
2
1
|
import React from "react";
|
|
2
|
+
import { OpenID4VPVerificationProps } from "./OpenID4VPVerification.types";
|
|
3
3
|
declare const OpenID4VPVerification: React.FC<OpenID4VPVerificationProps>;
|
|
4
4
|
export default OpenID4VPVerification;
|
|
@@ -39,6 +39,11 @@ export interface VPRequestBody {
|
|
|
39
39
|
presentationDefinitionId?: string;
|
|
40
40
|
presentationDefinition?: PresentationDefinition;
|
|
41
41
|
}
|
|
42
|
+
export interface Wallet {
|
|
43
|
+
name: string;
|
|
44
|
+
scheme: string;
|
|
45
|
+
icon: string;
|
|
46
|
+
}
|
|
42
47
|
type ExclusivePresentationDefinition =
|
|
43
48
|
/**
|
|
44
49
|
* ID of the presentation definition used for verification.
|
|
@@ -73,6 +78,14 @@ type ExclusiveCallbacks =
|
|
|
73
78
|
onVPProcessed: (VPResult: VerificationResults) => void;
|
|
74
79
|
onVPReceived?: never;
|
|
75
80
|
};
|
|
81
|
+
type SameDeviceFlowEnabledProps = {
|
|
82
|
+
isEnableSameDeviceFlow: true;
|
|
83
|
+
supportedWallets: Wallet[];
|
|
84
|
+
};
|
|
85
|
+
type SameDeviceFlowDisabledProps = {
|
|
86
|
+
isEnableSameDeviceFlow?: false | undefined;
|
|
87
|
+
supportedWallets?: Wallet[];
|
|
88
|
+
};
|
|
76
89
|
interface InputDescriptor {
|
|
77
90
|
id: string;
|
|
78
91
|
format?: {
|
|
@@ -92,7 +105,7 @@ export interface PresentationDefinition {
|
|
|
92
105
|
};
|
|
93
106
|
input_descriptors: InputDescriptor[];
|
|
94
107
|
}
|
|
95
|
-
|
|
108
|
+
type BaseProps = ExclusivePresentationDefinition & ExclusiveCallbacks & {
|
|
96
109
|
/**
|
|
97
110
|
|
|
98
111
|
React element that triggers the verification process (e.g., a button).
|
|
@@ -137,4 +150,5 @@ export type OpenID4VPVerificationProps = ExclusivePresentationDefinition & Exclu
|
|
|
137
150
|
*/
|
|
138
151
|
onError: (error: Error) => void;
|
|
139
152
|
};
|
|
153
|
+
export type OpenID4VPVerificationProps = (BaseProps & SameDeviceFlowEnabledProps) | (BaseProps & SameDeviceFlowDisabledProps);
|
|
140
154
|
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Wallet } from "./OpenID4VPVerification.types";
|
|
3
|
+
interface WalletSelectionModalProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
wallets: Wallet[];
|
|
6
|
+
selectedWallet: Wallet | null;
|
|
7
|
+
onSelect: (wallet: Wallet | null) => void;
|
|
8
|
+
onCancel: () => void;
|
|
9
|
+
onProceed: () => void;
|
|
10
|
+
}
|
|
11
|
+
declare const WalletSelectionModal: React.FC<WalletSelectionModalProps>;
|
|
12
|
+
export default WalletSelectionModal;
|
package/dist/index.d.ts
CHANGED