@narcisbodea/smstunnel-sdk 1.0.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,93 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ interface SmsTunnelLabels {
4
+ title: string;
5
+ description: string;
6
+ serverUrlLabel: string;
7
+ serverUrlPlaceholder: string;
8
+ saveButton: string;
9
+ pairedStatus: string;
10
+ deviceLabel: string;
11
+ unpairButton: string;
12
+ unpairConfirm: string;
13
+ notPairedStatus: string;
14
+ notPairedDescription: string;
15
+ connectButton: string;
16
+ scanQrPrompt: string;
17
+ waitingForPairing: string;
18
+ cancelButton: string;
19
+ qrExpired: string;
20
+ testSmsTitle: string;
21
+ testPhonePlaceholder: string;
22
+ testMessagePlaceholder: string;
23
+ sendTestButton: string;
24
+ smsSentSuccess: string;
25
+ smsError: string;
26
+ }
27
+ declare const EN_LABELS: SmsTunnelLabels;
28
+ declare const RO_LABELS: SmsTunnelLabels;
29
+
30
+ interface SmsTunnelPairingProps {
31
+ apiBaseUrl: string;
32
+ getAuthHeaders?: () => Record<string, string>;
33
+ labels?: SmsTunnelLabels;
34
+ onPaired?: (device: {
35
+ deviceName: string;
36
+ }) => void;
37
+ onUnpaired?: () => void;
38
+ showTestSms?: boolean;
39
+ showServerUrlInput?: boolean;
40
+ qrSize?: number;
41
+ routePrefix?: string;
42
+ className?: string;
43
+ }
44
+ interface UseSmsTunnelOptions {
45
+ apiBaseUrl: string;
46
+ getAuthHeaders?: () => Record<string, string>;
47
+ routePrefix?: string;
48
+ pollInterval?: number;
49
+ }
50
+ interface SmsTunnelState {
51
+ status: 'loading' | 'unpaired' | 'paired';
52
+ serverUrl: string;
53
+ deviceName: string;
54
+ showQr: boolean;
55
+ qrData: string;
56
+ generating: boolean;
57
+ polling: boolean;
58
+ error: string;
59
+ }
60
+
61
+ declare function SmsTunnelPairing({ apiBaseUrl, getAuthHeaders, labels, onPaired, onUnpaired, showTestSms, showServerUrlInput, qrSize, routePrefix, className, }: SmsTunnelPairingProps): react_jsx_runtime.JSX.Element;
62
+
63
+ interface QrCodeCanvasProps {
64
+ value: string;
65
+ size?: number;
66
+ }
67
+ declare function QrCodeCanvas({ value, size }: QrCodeCanvasProps): react_jsx_runtime.JSX.Element;
68
+
69
+ declare function useSmsTunnel(options: UseSmsTunnelOptions): {
70
+ generateQr: () => Promise<void>;
71
+ cancelPairing: () => void;
72
+ unpair: () => Promise<void>;
73
+ sendTestSms: (to: string, message: string) => Promise<{
74
+ success: boolean;
75
+ messageId?: string;
76
+ error?: string;
77
+ } | {
78
+ success: boolean;
79
+ error: any;
80
+ }>;
81
+ updateServerUrl: (serverUrl: string) => Promise<void>;
82
+ refetch: () => Promise<void>;
83
+ status: "loading" | "unpaired" | "paired";
84
+ serverUrl: string;
85
+ deviceName: string;
86
+ showQr: boolean;
87
+ qrData: string;
88
+ generating: boolean;
89
+ polling: boolean;
90
+ error: string;
91
+ };
92
+
93
+ export { EN_LABELS, QrCodeCanvas, type QrCodeCanvasProps, RO_LABELS, type SmsTunnelLabels, SmsTunnelPairing, type SmsTunnelPairingProps, type SmsTunnelState, type UseSmsTunnelOptions, useSmsTunnel };