@cofhe/react 0.5.1 → 0.6.0

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.
@@ -0,0 +1,86 @@
1
+ import { C as CofheFloatingButtonProps, T as Token, B as BaseProps, D as DropdownOption, j as ComponentSize, k as EncryptionStartData, l as EncryptionProgressData, m as EncryptionResultData } from './types-BzYdBjL5.cjs';
2
+ export { b as FheTypesList, F as FloatingButtonPosition } from './types-BzYdBjL5.cjs';
3
+ import '@cofhe/sdk';
4
+ import 'viem';
5
+
6
+ declare const CofheFloatingButtonWithProvider: React.FC<CofheFloatingButtonProps>;
7
+
8
+ declare const MainPage: React.FC;
9
+
10
+ declare const SettingsPage: React.FC;
11
+
12
+ type DelegatePermitPageProps = {
13
+ onSuccessNavigateTo?: () => void;
14
+ onCancel?: () => void;
15
+ onBack?: () => void;
16
+ };
17
+ declare module '../../../pagesConfig/types' {
18
+ interface FloatingButtonPagePropsRegistry {
19
+ [FloatingButtonPage.DelegatePermits]: DelegatePermitPageProps;
20
+ }
21
+ }
22
+
23
+ type TokenInfoPageProps = {
24
+ token: Token;
25
+ };
26
+ declare module '../pagesConfig/types' {
27
+ interface FloatingButtonPagePropsRegistry {
28
+ [FloatingButtonPage.TokenInfo]: TokenInfoPageProps;
29
+ }
30
+ }
31
+
32
+ type SendPageProps = {
33
+ token: Token;
34
+ };
35
+ declare module '../pagesConfig/types' {
36
+ interface FloatingButtonPagePropsRegistry {
37
+ [FloatingButtonPage.Send]: SendPageProps;
38
+ }
39
+ }
40
+
41
+ type Mode = 'shield' | 'unshield';
42
+ type ShieldPageProps = {
43
+ token: Token;
44
+ defaultMode?: Mode;
45
+ };
46
+ declare module '../pagesConfig/types' {
47
+ interface FloatingButtonPagePropsRegistry {
48
+ [FloatingButtonPage.Shield]: ShieldPageProps;
49
+ }
50
+ }
51
+
52
+ interface CofheEncryptInputProps extends BaseProps {
53
+ /** Placeholder text for the text field */
54
+ placeholder?: string;
55
+ /** Initial value for the text field */
56
+ initialValue?: string;
57
+ /** Dropdown options for encryption types */
58
+ options?: DropdownOption[];
59
+ /** Component size */
60
+ size?: ComponentSize;
61
+ /** Whether inputs have errors */
62
+ hasError?: boolean;
63
+ /** Error message to display */
64
+ errorMessage?: string;
65
+ /** Whether the component is disabled */
66
+ disabled?: boolean;
67
+ /** Whether to show the progress bar during encryption */
68
+ showProgressBar?: boolean;
69
+ /** Debounce delay for validation in milliseconds (default: 300) */
70
+ debounceMs?: number;
71
+ /** Callback when text changes */
72
+ onTextChange?: (_value: string) => void;
73
+ /** Callback when encryption type selection changes */
74
+ onTypeChange?: (_value: string) => void;
75
+ /** Callback when encryption starts */
76
+ onEncryptStart?: (_data: EncryptionStartData) => void;
77
+ /** Callback for encryption progress updates */
78
+ onEncryptProgress?: (_data: EncryptionProgressData) => void;
79
+ /** Callback when encryption completes successfully */
80
+ onEncryptComplete?: (_data: EncryptionResultData) => void;
81
+ /** Callback when encryption fails */
82
+ onEncryptError?: (_error: string) => void;
83
+ }
84
+ declare const CofheEncryptInput: React.FC<CofheEncryptInputProps>;
85
+
86
+ export { CofheEncryptInput, CofheFloatingButtonProps, CofheFloatingButtonWithProvider, MainPage, SettingsPage };
@@ -0,0 +1,86 @@
1
+ import { C as CofheFloatingButtonProps, T as Token, B as BaseProps, D as DropdownOption, j as ComponentSize, k as EncryptionStartData, l as EncryptionProgressData, m as EncryptionResultData } from './types-BzYdBjL5.js';
2
+ export { b as FheTypesList, F as FloatingButtonPosition } from './types-BzYdBjL5.js';
3
+ import '@cofhe/sdk';
4
+ import 'viem';
5
+
6
+ declare const CofheFloatingButtonWithProvider: React.FC<CofheFloatingButtonProps>;
7
+
8
+ declare const MainPage: React.FC;
9
+
10
+ declare const SettingsPage: React.FC;
11
+
12
+ type DelegatePermitPageProps = {
13
+ onSuccessNavigateTo?: () => void;
14
+ onCancel?: () => void;
15
+ onBack?: () => void;
16
+ };
17
+ declare module '../../../pagesConfig/types' {
18
+ interface FloatingButtonPagePropsRegistry {
19
+ [FloatingButtonPage.DelegatePermits]: DelegatePermitPageProps;
20
+ }
21
+ }
22
+
23
+ type TokenInfoPageProps = {
24
+ token: Token;
25
+ };
26
+ declare module '../pagesConfig/types' {
27
+ interface FloatingButtonPagePropsRegistry {
28
+ [FloatingButtonPage.TokenInfo]: TokenInfoPageProps;
29
+ }
30
+ }
31
+
32
+ type SendPageProps = {
33
+ token: Token;
34
+ };
35
+ declare module '../pagesConfig/types' {
36
+ interface FloatingButtonPagePropsRegistry {
37
+ [FloatingButtonPage.Send]: SendPageProps;
38
+ }
39
+ }
40
+
41
+ type Mode = 'shield' | 'unshield';
42
+ type ShieldPageProps = {
43
+ token: Token;
44
+ defaultMode?: Mode;
45
+ };
46
+ declare module '../pagesConfig/types' {
47
+ interface FloatingButtonPagePropsRegistry {
48
+ [FloatingButtonPage.Shield]: ShieldPageProps;
49
+ }
50
+ }
51
+
52
+ interface CofheEncryptInputProps extends BaseProps {
53
+ /** Placeholder text for the text field */
54
+ placeholder?: string;
55
+ /** Initial value for the text field */
56
+ initialValue?: string;
57
+ /** Dropdown options for encryption types */
58
+ options?: DropdownOption[];
59
+ /** Component size */
60
+ size?: ComponentSize;
61
+ /** Whether inputs have errors */
62
+ hasError?: boolean;
63
+ /** Error message to display */
64
+ errorMessage?: string;
65
+ /** Whether the component is disabled */
66
+ disabled?: boolean;
67
+ /** Whether to show the progress bar during encryption */
68
+ showProgressBar?: boolean;
69
+ /** Debounce delay for validation in milliseconds (default: 300) */
70
+ debounceMs?: number;
71
+ /** Callback when text changes */
72
+ onTextChange?: (_value: string) => void;
73
+ /** Callback when encryption type selection changes */
74
+ onTypeChange?: (_value: string) => void;
75
+ /** Callback when encryption starts */
76
+ onEncryptStart?: (_data: EncryptionStartData) => void;
77
+ /** Callback for encryption progress updates */
78
+ onEncryptProgress?: (_data: EncryptionProgressData) => void;
79
+ /** Callback when encryption completes successfully */
80
+ onEncryptComplete?: (_data: EncryptionResultData) => void;
81
+ /** Callback when encryption fails */
82
+ onEncryptError?: (_error: string) => void;
83
+ }
84
+ declare const CofheEncryptInput: React.FC<CofheEncryptInputProps>;
85
+
86
+ export { CofheEncryptInput, CofheFloatingButtonProps, CofheFloatingButtonWithProvider, MainPage, SettingsPage };