zigap-utils 3.1.0-preview.3 → 3.1.0-preview.5

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.
@@ -1,8 +1,10 @@
1
- export declare const shouldNavigateToApp: (isValid: boolean, isMobile: boolean, hasNavigated: boolean) => boolean;
1
+ export declare const shouldNavigateToApp: (isValid: boolean, isMobile: boolean, hasNavigated: boolean, resumeFromReload: boolean) => boolean;
2
2
  interface UseDeeplinkAppSwitchArgs {
3
3
  qrCode: string;
4
4
  isMobile: boolean;
5
5
  isValid: boolean;
6
+ /** 리로드 복귀면 앱 재전환을 억제한다(무한 바운스 방지). 기본 false. */
7
+ resumeFromReload?: boolean;
6
8
  }
7
- export declare const useDeeplinkAppSwitch: ({ qrCode, isMobile, isValid }: UseDeeplinkAppSwitchArgs) => void;
9
+ export declare const useDeeplinkAppSwitch: ({ qrCode, isMobile, isValid, resumeFromReload, }: UseDeeplinkAppSwitchArgs) => void;
8
10
  export default useDeeplinkAppSwitch;
@@ -13,9 +13,10 @@ interface UseDeeplinkLoginArgs {
13
13
  validSeconds: number;
14
14
  isMobile: boolean;
15
15
  isValid: boolean;
16
+ resumeFromReload: boolean;
16
17
  onReceive: LoginQRProps['onReceive'];
17
18
  }
18
- export declare const useDeeplinkLogin: ({ roomId, nonce, qrCode, sigMessage, expire, validSeconds, isMobile, isValid, onReceive, }: UseDeeplinkLoginArgs) => {
19
+ export declare const useDeeplinkLogin: ({ roomId, nonce, qrCode, sigMessage, expire, validSeconds, isMobile, isValid, resumeFromReload, onReceive, }: UseDeeplinkLoginArgs) => {
19
20
  isResuming: boolean;
20
21
  };
21
22
  export default useDeeplinkLogin;
@@ -14,9 +14,10 @@ interface UseDeeplinkPaymentArgs {
14
14
  validSeconds: number;
15
15
  isMobile: boolean;
16
16
  isValid: boolean;
17
+ resumeFromReload: boolean;
17
18
  onReceive: PaymentQRProps['onReceive'];
18
19
  }
19
- export declare const useDeeplinkPayment: ({ roomId, nonce, qrCode, network, address, amount, validSeconds, isMobile, isValid, onReceive, }: UseDeeplinkPaymentArgs) => {
20
+ export declare const useDeeplinkPayment: ({ roomId, nonce, qrCode, network, address, amount, validSeconds, isMobile, isValid, resumeFromReload, onReceive, }: UseDeeplinkPaymentArgs) => {
20
21
  isResuming: boolean;
21
22
  };
22
23
  export default useDeeplinkPayment;
@@ -20,6 +20,8 @@ interface UseDeeplinkResumeArgs {
20
20
  timeoutMs?: number;
21
21
  /** false 면 훅 비활성(예: roomId 미정 시). 기본 true. */
22
22
  enabled?: boolean;
23
+ /** 풀 리로드 복귀로 보관 스냅샷을 재사용한 경우. 재등록 없이 마운트 즉시 resume 1회를 발동한다. 기본 false. */
24
+ resumeFromReload?: boolean;
23
25
  }
24
- export declare const useDeeplinkResume: ({ roomId, nonce, type, payload, onResult, onResume, timeoutMs, enabled, }: UseDeeplinkResumeArgs) => void;
26
+ export declare const useDeeplinkResume: ({ roomId, nonce, type, payload, onResult, onResume, timeoutMs, enabled, resumeFromReload, }: UseDeeplinkResumeArgs) => void;
25
27
  export default useDeeplinkResume;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * 마운트당 1회 roomId/nonce/qrCode 를 결정하는 훅. 4개 스캔전용 QR 컴포넌트가 공유한다.
3
+ *
4
+ * 모바일 풀 리로드 복귀 시 보관된 pending 스냅샷이 있으면 그 roomId/nonce 를 재사용한다
5
+ * (새로 생성하면 결과가 보관된 "원래 방"을 잃는다). 그 외(첫 진입/데스크톱)에는 generate() 로
6
+ * 새 roomId/qrCode 를 만들고 nonce 를 새로 발급한다.
7
+ */
8
+ export interface DeeplinkRoom {
9
+ roomId: string;
10
+ nonce: string;
11
+ qrCode: string;
12
+ resumeFromReload: boolean;
13
+ }
14
+ export declare const useDeeplinkRoom: (isMobile: boolean, generate: () => {
15
+ qrCode: string;
16
+ roomId: string;
17
+ }) => DeeplinkRoom;
18
+ export default useDeeplinkRoom;
@@ -12,9 +12,10 @@ interface UseDeeplinkSendTransactionArgs {
12
12
  validSeconds: number;
13
13
  isMobile: boolean;
14
14
  isValid: boolean;
15
+ resumeFromReload: boolean;
15
16
  onReceive: SendTransactionQRProps['onReceive'];
16
17
  }
17
- export declare const useDeeplinkSendTransaction: ({ roomId, nonce, qrCode, transaction, validSeconds, isMobile, isValid, onReceive, }: UseDeeplinkSendTransactionArgs) => {
18
+ export declare const useDeeplinkSendTransaction: ({ roomId, nonce, qrCode, transaction, validSeconds, isMobile, isValid, resumeFromReload, onReceive, }: UseDeeplinkSendTransactionArgs) => {
18
19
  isResuming: boolean;
19
20
  };
20
21
  export default useDeeplinkSendTransaction;
@@ -13,9 +13,10 @@ interface UseDeeplinkSignatureArgs {
13
13
  validSeconds: number;
14
14
  isMobile: boolean;
15
15
  isValid: boolean;
16
+ resumeFromReload: boolean;
16
17
  onReceive: SignatureQRProps['onReceive'];
17
18
  }
18
- export declare const useDeeplinkSignature: ({ roomId, nonce, qrCode, sigMessage, expire, validSeconds, isMobile, isValid, onReceive, }: UseDeeplinkSignatureArgs) => {
19
+ export declare const useDeeplinkSignature: ({ roomId, nonce, qrCode, sigMessage, expire, validSeconds, isMobile, isValid, resumeFromReload, onReceive, }: UseDeeplinkSignatureArgs) => {
19
20
  isResuming: boolean;
20
21
  };
21
22
  export default useDeeplinkSignature;