@hook-sdk/template 0.9.0 → 0.10.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.
package/dist/index.d.cts CHANGED
@@ -1,92 +1,113 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as react from 'react';
2
3
  import { ReactNode, ComponentType, Component } from 'react';
3
- import { z } from 'zod';
4
4
  import * as _hook_sdk_sdk from '@hook-sdk/sdk';
5
- import { CheckoutCycle, CheckoutCardData, CheckoutHolderInfo, PlanState, ReminderSlot } from '@hook-sdk/sdk';
5
+ import { CheckoutMethod as CheckoutMethod$1, CheckoutCycle, CheckoutResult, CheckoutCardData, CheckoutHolderInfo, PlanState, ReminderSlot } from '@hook-sdk/sdk';
6
6
  export { PlanInfo, PlanState } from '@hook-sdk/sdk';
7
+ import { z } from 'zod';
7
8
 
8
- declare const AppConfigSchema: z.ZodObject<{
9
- $schema: z.ZodOptional<z.ZodString>;
10
- slug: z.ZodString;
11
- name: z.ZodString;
12
- display_name: z.ZodOptional<z.ZodString>;
13
- email_alias: z.ZodString;
14
- theme: z.ZodObject<{
15
- primary_color: z.ZodString;
16
- background_color: z.ZodOptional<z.ZodString>;
17
- logo_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
18
- icon_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
19
- }, z.core.$strict>;
20
- features_enabled: z.ZodArray<z.ZodEnum<{
21
- db: "db";
22
- storage: "storage";
23
- upload: "upload";
24
- leaderboard: "leaderboard";
25
- push: "push";
26
- subscription: "subscription";
27
- install_prompt: "install_prompt";
28
- }>>;
29
- persistedKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
30
- dependencies_allowlist: z.ZodArray<z.ZodString>;
31
- subscription: z.ZodObject<{
32
- price_cents: z.ZodNumber;
33
- currency: z.ZodLiteral<"brl">;
34
- trial_days: z.ZodNumber;
35
- mode: z.ZodDefault<z.ZodEnum<{
36
- trial: "trial";
37
- pay_first: "pay_first";
38
- free: "free";
39
- }>>;
40
- cpf_required: z.ZodOptional<z.ZodBoolean>;
41
- trial_type: z.ZodOptional<z.ZodEnum<{
42
- sem_cartao: "sem_cartao";
43
- com_cartao: "com_cartao";
44
- nenhum: "nenhum";
45
- }>>;
46
- paywall_config: z.ZodObject<{
47
- title: z.ZodString;
48
- subtitle: z.ZodOptional<z.ZodString>;
49
- benefits: z.ZodArray<z.ZodString>;
50
- cta: z.ZodString;
51
- priceHint: z.ZodOptional<z.ZodString>;
52
- footerNote: z.ZodOptional<z.ZodString>;
53
- }, z.core.$strict>;
54
- }, z.core.$strict>;
55
- auth: z.ZodOptional<z.ZodObject<{
56
- has_forgot: z.ZodDefault<z.ZodBoolean>;
57
- email_verification_required: z.ZodDefault<z.ZodBoolean>;
58
- min_password_length: z.ZodDefault<z.ZodNumber>;
59
- pre_auth_routes: z.ZodDefault<z.ZodArray<z.ZodString>>;
60
- post_auth_landing: z.ZodDefault<z.ZodString>;
61
- signup_anti_enum: z.ZodDefault<z.ZodBoolean>;
62
- }, z.core.$strict>>;
63
- sdk_version_required: z.ZodString;
64
- template_version_required: z.ZodOptional<z.ZodString>;
65
- max_bundle_size_kb: z.ZodNumber;
66
- }, z.core.$strict>;
67
- type AppConfig = z.infer<typeof AppConfigSchema>;
9
+ type Cycle = 'MONTHLY' | 'YEARLY';
10
+ type CheckoutMethod = 'card' | 'pix-auto' | 'pix-once';
11
+ type AuthFlowConfig = {
12
+ minPassword: number;
13
+ requiresEmailVerify: boolean;
14
+ googleOAuth: boolean;
15
+ postAuthLanding: string;
16
+ preAuthRoutes: string[];
17
+ };
18
+ type PaywallConfig = {
19
+ mode: 'free';
20
+ } | {
21
+ mode: 'trial' | 'pay_first';
22
+ trialDays?: number;
23
+ cycles: Cycle[];
24
+ prices: {
25
+ monthlyCents: number;
26
+ yearlyCents: number;
27
+ };
28
+ anchorPrices?: {
29
+ monthlyCents: number;
30
+ yearlyCents: number;
31
+ };
32
+ checkoutMethods: CheckoutMethod[];
33
+ requiresCpf: boolean;
34
+ cancelWindowDays?: number;
35
+ errorMessages: 'default' | 'custom';
36
+ };
37
+ type PersistedKey = {
38
+ key: string;
39
+ default: unknown;
40
+ guardRegen?: boolean;
41
+ debounceMs?: number;
42
+ };
43
+ type OnboardingStep = {
44
+ id: string;
45
+ screen: string;
46
+ validates?: string[];
47
+ };
48
+ type OnboardingConfig = {
49
+ trigger: 'pre_signup' | 'post_signup' | 'pre_signup_custom' | 'optional';
50
+ steps: OnboardingStep[];
51
+ persistTo: 'appData';
52
+ persistKey: string;
53
+ };
54
+ type DeepLinks = {
55
+ passwordReset?: string;
56
+ emailVerify?: string;
57
+ };
58
+ type AppConfig = {
59
+ slug: string;
60
+ name: string;
61
+ branding: {
62
+ primaryColor: string;
63
+ logoUrl: string;
64
+ };
65
+ authFlow: AuthFlowConfig;
66
+ paywall: PaywallConfig;
67
+ persistedKeys: PersistedKey[];
68
+ onboarding?: OnboardingConfig;
69
+ deepLinks?: DeepLinks;
70
+ features_enabled?: string[];
71
+ };
68
72
 
69
- type AuthScreen = 'login' | 'signup' | 'forgot' | 'reset';
70
73
  interface AuthScreenProps {
71
- onNavigate: (to: AuthScreen) => void;
74
+ /**
75
+ * Optional callback for in-screen navigation between the auth screens
76
+ * (e.g. Login → Signup). Pre-Router screens used this; Router-based
77
+ * screens should use `useNavigate()` from react-router-dom directly and
78
+ * may ignore this prop.
79
+ */
80
+ onNavigate?: (target: 'login' | 'signup' | 'forgot' | 'reset') => void;
72
81
  }
73
- declare function DefaultLoginScreen({ onNavigate }: AuthScreenProps): react_jsx_runtime.JSX.Element;
74
82
 
75
- interface AppRootProps {
76
- config: AppConfig;
83
+ declare function PaymentReturnHandler({ children }: {
77
84
  children: ReactNode;
78
- Login?: ComponentType<AuthScreenProps>;
79
- Signup?: ComponentType<AuthScreenProps>;
80
- Forgot?: ComponentType<AuthScreenProps>;
81
- /**
82
- * Tela de reset de senha (form com nova senha via link do email).
83
- * Renderizada pelo AuthGate quando URL tem `?token=` + user não logado.
84
- * Default: DefaultResetScreen.
85
- */
86
- Reset?: ComponentType<AuthScreenProps>;
85
+ }): react_jsx_runtime.JSX.Element;
86
+
87
+ type AppRootSlots = {
88
+ Login: ComponentType<AuthScreenProps>;
89
+ Signup: ComponentType<AuthScreenProps>;
90
+ Forgot: ComponentType<AuthScreenProps>;
91
+ Reset: ComponentType<AuthScreenProps>;
92
+ /** Required when config.authFlow.requiresEmailVerify === true. */
93
+ EmailVerify?: ComponentType<AuthScreenProps>;
94
+ /** Required when config.paywall.mode !== "free". */
87
95
  Paywall?: ComponentType;
88
- }
89
- declare function AppRoot({ config, children, Login, Signup, Forgot, Reset, Paywall, }: AppRootProps): react_jsx_runtime.JSX.Element;
96
+ /** Map of step id → component. Used when config.onboarding && trigger !== "pre_signup_custom". */
97
+ Onboarding?: Record<string, ComponentType>;
98
+ /** Required when config.onboarding?.trigger === "pre_signup_custom". */
99
+ PreAuthFlow?: ComponentType;
100
+ };
101
+ type AppRootProps = AppRootSlots & {
102
+ config: AppConfig;
103
+ children?: ReactNode;
104
+ /** Test-only: skip BrowserRouter (which fights jsdom's document.location). */
105
+ testRouter?: 'memory';
106
+ /** Test-only: initial entries for MemoryRouter. */
107
+ testInitialEntries?: string[];
108
+ };
109
+
110
+ declare function AppRoot(props: AppRootProps): react_jsx_runtime.JSX.Element;
90
111
 
91
112
  interface PushPromptTexts {
92
113
  cta: string;
@@ -119,22 +140,6 @@ interface InstallSplashProps {
119
140
  }
120
141
  declare function InstallSplash({ children, title, subtitle }: InstallSplashProps): react_jsx_runtime.JSX.Element;
121
142
 
122
- declare function DefaultSignupScreen({ onNavigate }: AuthScreenProps): react_jsx_runtime.JSX.Element;
123
-
124
- declare function DefaultForgotScreen({ onNavigate }: AuthScreenProps): react_jsx_runtime.JSX.Element;
125
-
126
- /**
127
- * Tela default de reset de senha. Renderizada pelo AuthGate quando
128
- * `?token=` está presente na URL (link vindo do email de password_reset).
129
- *
130
- * AuthScreenProps.onNavigate é usado pra voltar pro login após reset
131
- * bem-sucedido (usuário precisa re-autenticar — backend revoga todos
132
- * os refresh tokens na chamada de `auth.reset`).
133
- */
134
- declare function DefaultResetScreen({ onNavigate }: AuthScreenProps): react_jsx_runtime.JSX.Element;
135
-
136
- declare function DefaultPaywall(): react_jsx_runtime.JSX.Element;
137
-
138
143
  declare function LoadingState({ message }: {
139
144
  message?: string;
140
145
  }): react_jsx_runtime.JSX.Element;
@@ -159,6 +164,18 @@ declare class ErrorBoundary extends Component<Props, State> {
159
164
  render(): string | number | boolean | Iterable<ReactNode> | react_jsx_runtime.JSX.Element;
160
165
  }
161
166
 
167
+ /**
168
+ * Reads `?token=` from the URL on mount + on location change. When present and
169
+ * the current pathname is `/`, redirects to the configured deep-link path
170
+ * (passwordReset or emailVerify) substituting `:token` for the actual value.
171
+ *
172
+ * Mounts once inside `<AppRoot>` (post-Router); a no-op when `deepLinks` is
173
+ * undefined or no `token` is in the URL.
174
+ */
175
+ declare function DeepLinkHandler({ deepLinks }: {
176
+ deepLinks?: DeepLinks;
177
+ }): null;
178
+
162
179
  type AuthFormErrorCode = 'invalid_credentials' | 'rate_limited' | 'email_unverified' | 'account_locked' | 'network' | 'server';
163
180
  interface AuthFormError {
164
181
  code: AuthFormErrorCode;
@@ -267,64 +284,98 @@ interface UseResetFormResult {
267
284
  declare function useResetForm(): UseResetFormResult;
268
285
 
269
286
  type SubscriptionStatus = 'active' | 'trialing' | 'expired' | 'canceled' | 'past_due' | 'pending' | 'none';
270
- type PaymentMethod = 'card' | 'pix-auto' | 'pix-once';
287
+ type PaymentMethod = CheckoutMethod$1;
288
+ interface PaywallError {
289
+ code: string;
290
+ message: string;
291
+ userMessage: string;
292
+ }
293
+ /**
294
+ * Local pixPending shape — re-exposes SDK's reactive `subscription.pixPending`
295
+ * with two extra UI-facing fields:
296
+ * - `expiresAt`: null (kept for compat; SDK does not surface expiry on auto/once)
297
+ * - `paid`: derived from `subscription.current.status` — flips true when the
298
+ * underlying subscription transitions to ACTIVE/TRIAL after the user pays
299
+ * the QR code. SDK clears the underlying pixPending shortly after; this
300
+ * wrapper preserves the "paid" frame for ~1 render so the paywall can show
301
+ * confirmation copy before unmounting the modal.
302
+ */
271
303
  interface PixPending {
272
304
  method: 'pix-auto' | 'pix-once';
273
305
  qrCodePayload: string | null;
274
306
  qrCodeBase64: string | null;
275
307
  expiresAt: string | null;
276
- /**
277
- * Flipa `true` quando o polling detecta subscription ACTIVE/TRIAL (webhook
278
- * PAYMENT_RECEIVED ou AUTHORIZATION_ACTIVATED chegou). UI deve renderizar
279
- * confirmação visual nesse momento; após 2-3s chama `dismissPix` pra
280
- * limpar o modal e deixar SubscriptionGate liberar o app.
281
- */
282
308
  paid: boolean;
283
309
  }
310
+ interface CardFormState {
311
+ number: string;
312
+ cvv: string;
313
+ expiry: string;
314
+ holder: string;
315
+ }
316
+ interface CardFormStateWithSetter extends CardFormState {
317
+ set: (patch: Partial<CardFormState>) => void;
318
+ }
319
+ interface CpfState {
320
+ required: boolean;
321
+ value: string;
322
+ set: (v: string) => void;
323
+ valid: boolean;
324
+ }
284
325
  interface PaywallCheckoutArgs {
285
326
  cpf: string;
286
327
  cycle: CheckoutCycle;
287
- method: 'card' | 'pix-auto';
288
- /** Required when method === 'card'. */
328
+ method: 'card' | 'pix-auto' | 'pix-once';
289
329
  card?: CheckoutCardData;
290
- /** Required when method === 'card'. */
291
330
  holderInfo?: CheckoutHolderInfo;
292
- /** Optional; backend falls back to X-Forwarded-For when absent. */
293
331
  remoteIp?: string;
294
332
  }
333
+ interface PaywallPlanDerived {
334
+ monthlyCents: number;
335
+ yearlyCents: number | null;
336
+ anchorMonthlyCents?: number;
337
+ anchorYearlyCents?: number;
338
+ monthlyEquivalent: number;
339
+ discountPercent: number;
340
+ }
295
341
  /**
296
- * Hook headless pro Paywall. Expõe status da subscription + ação
297
- * `checkout({cpf, cycle, method, card?, holderInfo?, remoteIp?})`.
298
- *
299
- * App Store substrate (2026-04-24, SDK 0.14.0+):
300
- *
301
- * - **method='card'** backend tokeniza via Asaas `/v3/creditCard/tokenize`
302
- * e cria subscription com `nextDueDate = today + trialDays`. Sem cobrança
303
- * no day 0; trial corre enquanto Asaas já segura o instrumento. Caller
304
- * obrigatório passar `card` + `holderInfo`. Nada é persistido/loggado no
305
- * SDK — PAN/CVV transitam só no request HTTPS direto ao backend. Após
306
- * success chama `subscription.refresh()` pra SubscriptionGate liberar
307
- * o app automaticamente (status passa pra `trialing`).
342
+ * Headless paywall state owns:
343
+ * - reactive subscription status (proxied from SDK)
344
+ * - cycle / selectedMethod / cpf / card form state
345
+ * - methods list (config.paywall.checkoutMethods filtered by SDK methodAvailability)
346
+ * - submit() — high-level no-args entrypoint that uses internal state
347
+ * - error mapping via asaasErrorMessage when paywall.errorMessages === 'default'
308
348
  *
309
- * - **method='pix-auto'** Pix Automático BACEN Jornada 3. User escaneia
310
- * QR 1x, autoriza débito recorrente no app do banco. Retorna QR via
311
- * `pixPending` (polling existing detecta ativação e flipa `paid=true`).
312
- *
313
- * Subscription real é atualizada via webhook (`PAYMENT_RECEIVED` ou
314
- * `PIX_AUTOMATIC_RECURRING_AUTHORIZATION_ACTIVATED`).
349
+ * Backward-compat aliases preserved for SDK 0.13/template 0.9 consumers:
350
+ * - `availableMethods` mirrors `methods`
351
+ * - `opening` mirrors `submitting`
352
+ * - `checkout(args)` takes legacy args + validates card/holderInfo presence
353
+ * - `dismissPix` no-op (SDK polling auto-clears pixPending on settle)
354
+ * - `monthlyEquivalent(cycle)` helper
315
355
  */
316
356
  declare function usePaywallState(): {
317
357
  status: SubscriptionStatus;
318
358
  daysLeftInTrial: number | null;
319
359
  initialLoadComplete: boolean;
360
+ plan: PaywallPlanDerived | null;
361
+ cycle: CheckoutCycle;
362
+ setCycle: react.Dispatch<react.SetStateAction<CheckoutCycle>>;
363
+ methods: readonly CheckoutMethod$1[];
364
+ selectedMethod: CheckoutMethod$1;
365
+ setSelectedMethod: react.Dispatch<react.SetStateAction<CheckoutMethod$1>>;
366
+ cpfState: CpfState;
367
+ cardState: CardFormStateWithSetter;
368
+ submit: () => Promise<CheckoutResult | undefined>;
320
369
  checkout: (args: PaywallCheckoutArgs) => Promise<void>;
321
370
  cancel: () => Promise<void>;
322
- opening: boolean;
323
- error: Error | null;
324
371
  pixPending: PixPending | null;
372
+ error: PaywallError | null;
373
+ submitting: boolean;
374
+ opening: boolean;
375
+ availableMethods: readonly CheckoutMethod$1[];
376
+ monthlyEquivalent: (c: CheckoutCycle) => number;
325
377
  dismissPix: () => void;
326
- availableMethods: readonly ("card" | "pix-auto")[];
327
- monthlyEquivalent: (cycle: CheckoutCycle) => number;
378
+ refreshPlan: () => void;
328
379
  };
329
380
 
330
381
  /**
@@ -623,4 +674,148 @@ declare function shouldBlockInstall(state: InstallState, now?: number): boolean;
623
674
  */
624
675
  declare function shouldShowPermanentOption(state: InstallState): boolean;
625
676
 
626
- export { type AndroidBrowser, AppRoot, type AppRootProps, type AuthFormError, type AuthFormErrorCode, type AuthScreen, type AuthScreenProps, DefaultForgotScreen, DefaultLoginScreen, DefaultPaywall, DefaultResetScreen, DefaultSignupScreen, EmptyState, ErrorBoundary, type IOSBrowser, type InAppApp, type InstallActions, InstallGate, InstallSplash, type InstallState, type InstallVariant, LoadingState, type PaymentMethod, type PixPending, type Platform, PushPrompt, type PushPromptProps, type PushPromptTexts, type PushUiState, type SubscriptionStatus, type ToastItem, type UseLoginFormResult, type UseResetFormResult, computeAnchorCents, dailyFromYearly, detectAndroidBrowser, detectIOSBrowser, detectInAppApp, detectPlatform, detectStandalone, discountPercent, formatBRL, monthlyFromYearly, shouldBlockInstall, shouldShowPermanentOption, useAuth, useAuthPrimitives, useForgotForm, useInstallPrompt, useLoginForm, usePaywallState, usePlan, usePush, useReminders, useResetForm, useSignupForm, useSubscription, useToast };
677
+ declare function asaasErrorMessage(code: string): string;
678
+
679
+ type RouteBoundaryProps = {
680
+ children: ReactNode;
681
+ };
682
+ declare function RouteBoundary({ children }: RouteBoundaryProps): react_jsx_runtime.JSX.Element;
683
+
684
+ type PreAuthShellProps = {
685
+ basename?: string;
686
+ /** Test-only escape hatch — use MemoryRouter so jsdom doesn't fight document.location. */
687
+ testRouter?: 'memory';
688
+ /** Optional initial entries for MemoryRouter; ignored otherwise. */
689
+ testInitialEntries?: string[];
690
+ children: ReactNode;
691
+ };
692
+ declare function PreAuthShell({ basename, testRouter, testInitialEntries, children, }: PreAuthShellProps): react_jsx_runtime.JSX.Element;
693
+
694
+ type PersistenceRegistryProps = {
695
+ config: PersistedKey[];
696
+ children: ReactNode;
697
+ };
698
+ /**
699
+ * Fire-and-forget prefetch of every key declared in `app.config.json.persistedKeys`
700
+ * via `appData.bulkRead`. Does NOT gate render — children mount immediately;
701
+ * `usePersistedState` consumers hit cache as soon as the prefetch resolves.
702
+ *
703
+ * Use when the consuming app tolerates a brief flash of `defaultValue` before
704
+ * hydrated state lands. For strict "no flash" semantics use `<PersistedKeysPrefetch>`
705
+ * (gating variant in `internal/`).
706
+ */
707
+ declare function PersistenceRegistry({ config, children }: PersistenceRegistryProps): react_jsx_runtime.JSX.Element;
708
+
709
+ type OnboardingStepDef = {
710
+ id: string;
711
+ screen: string;
712
+ validates?: string[];
713
+ };
714
+ type OnboardingFlowProps = {
715
+ steps: OnboardingStepDef[];
716
+ screens: Record<string, ComponentType>;
717
+ onComplete: (value: Record<string, unknown>) => void;
718
+ persistKey: string;
719
+ };
720
+ declare function OnboardingFlow({ steps, screens, onComplete, persistKey, }: OnboardingFlowProps): react_jsx_runtime.JSX.Element;
721
+
722
+ type OnboardingStepCtx = {
723
+ stepIndex: number;
724
+ totalSteps: number;
725
+ next: () => void;
726
+ prev: () => void;
727
+ value: Record<string, unknown>;
728
+ setValue: (patch: Record<string, unknown>) => void;
729
+ valid: boolean;
730
+ };
731
+ declare function useOnboardingStep(): OnboardingStepCtx;
732
+
733
+ /**
734
+ * Returns `true` when `app.config.json.features_enabled` includes `name`.
735
+ * Use to gate optional UI surfaces (e.g. share button, premium-only screens)
736
+ * without scattering the feature list across the codebase.
737
+ */
738
+ declare function useFeature(name: string): boolean;
739
+
740
+ declare function AppConfigProvider({ config, children, }: {
741
+ config: AppConfig;
742
+ children: ReactNode;
743
+ }): react_jsx_runtime.JSX.Element;
744
+ declare function useAppConfig(): AppConfig;
745
+
746
+ declare const AppConfigSchema: z.ZodObject<{
747
+ slug: z.ZodString;
748
+ name: z.ZodString;
749
+ branding: z.ZodObject<{
750
+ primaryColor: z.ZodString;
751
+ logoUrl: z.ZodString;
752
+ }, z.core.$strip>;
753
+ authFlow: z.ZodObject<{
754
+ minPassword: z.ZodNumber;
755
+ requiresEmailVerify: z.ZodBoolean;
756
+ googleOAuth: z.ZodBoolean;
757
+ postAuthLanding: z.ZodString;
758
+ preAuthRoutes: z.ZodArray<z.ZodString>;
759
+ }, z.core.$strip>;
760
+ paywall: z.ZodDiscriminatedUnion<[z.ZodObject<{
761
+ mode: z.ZodEnum<{
762
+ trial: "trial";
763
+ pay_first: "pay_first";
764
+ }>;
765
+ trialDays: z.ZodOptional<z.ZodNumber>;
766
+ cycles: z.ZodArray<z.ZodEnum<{
767
+ MONTHLY: "MONTHLY";
768
+ YEARLY: "YEARLY";
769
+ }>>;
770
+ prices: z.ZodObject<{
771
+ monthlyCents: z.ZodNumber;
772
+ yearlyCents: z.ZodNumber;
773
+ }, z.core.$strip>;
774
+ anchorPrices: z.ZodOptional<z.ZodObject<{
775
+ monthlyCents: z.ZodNumber;
776
+ yearlyCents: z.ZodNumber;
777
+ }, z.core.$strip>>;
778
+ checkoutMethods: z.ZodArray<z.ZodEnum<{
779
+ card: "card";
780
+ "pix-auto": "pix-auto";
781
+ "pix-once": "pix-once";
782
+ }>>;
783
+ requiresCpf: z.ZodBoolean;
784
+ cancelWindowDays: z.ZodOptional<z.ZodNumber>;
785
+ errorMessages: z.ZodEnum<{
786
+ default: "default";
787
+ custom: "custom";
788
+ }>;
789
+ }, z.core.$strip>, z.ZodObject<{
790
+ mode: z.ZodLiteral<"free">;
791
+ }, z.core.$strip>], "mode">;
792
+ persistedKeys: z.ZodArray<z.ZodObject<{
793
+ key: z.ZodString;
794
+ default: z.ZodUnknown;
795
+ guardRegen: z.ZodOptional<z.ZodBoolean>;
796
+ debounceMs: z.ZodOptional<z.ZodNumber>;
797
+ }, z.core.$strip>>;
798
+ onboarding: z.ZodOptional<z.ZodObject<{
799
+ trigger: z.ZodEnum<{
800
+ pre_signup: "pre_signup";
801
+ post_signup: "post_signup";
802
+ pre_signup_custom: "pre_signup_custom";
803
+ optional: "optional";
804
+ }>;
805
+ steps: z.ZodArray<z.ZodObject<{
806
+ id: z.ZodString;
807
+ screen: z.ZodString;
808
+ validates: z.ZodOptional<z.ZodArray<z.ZodString>>;
809
+ }, z.core.$strip>>;
810
+ persistTo: z.ZodLiteral<"appData">;
811
+ persistKey: z.ZodString;
812
+ }, z.core.$strip>>;
813
+ deepLinks: z.ZodOptional<z.ZodObject<{
814
+ passwordReset: z.ZodOptional<z.ZodString>;
815
+ emailVerify: z.ZodOptional<z.ZodString>;
816
+ }, z.core.$strict>>;
817
+ features_enabled: z.ZodOptional<z.ZodArray<z.ZodString>>;
818
+ }, z.core.$strict>;
819
+ declare function parseAppConfig(input: unknown): AppConfig;
820
+
821
+ export { type AndroidBrowser, type AppConfig, AppConfigProvider, AppConfigSchema, AppRoot, type AppRootProps, type AppRootSlots, type AuthFlowConfig, type AuthFormError, type AuthFormErrorCode, type AuthScreenProps, type CheckoutMethod, type Cycle, DeepLinkHandler, type DeepLinks, EmptyState, ErrorBoundary, type IOSBrowser, type InAppApp, type InstallActions, InstallGate, InstallSplash, type InstallState, type InstallVariant, LoadingState, type OnboardingConfig, OnboardingFlow, type OnboardingFlowProps, type OnboardingStep, type OnboardingStepCtx, type OnboardingStepDef, type PaymentMethod, PaymentReturnHandler, type PaywallConfig, type PersistedKey, PersistenceRegistry, type PersistenceRegistryProps, type PixPending, type Platform, PreAuthShell, type PreAuthShellProps, PushPrompt, type PushPromptProps, type PushPromptTexts, type PushUiState, RouteBoundary, type RouteBoundaryProps, type SubscriptionStatus, type ToastItem, type UseLoginFormResult, type UseResetFormResult, asaasErrorMessage, computeAnchorCents, dailyFromYearly, detectAndroidBrowser, detectIOSBrowser, detectInAppApp, detectPlatform, detectStandalone, discountPercent, formatBRL, monthlyFromYearly, parseAppConfig, shouldBlockInstall, shouldShowPermanentOption, useAppConfig, useAuth, useAuthPrimitives, useFeature, useForgotForm, useInstallPrompt, useLoginForm, useOnboardingStep, usePaywallState, usePlan, usePush, useReminders, useResetForm, useSignupForm, useSubscription, useToast };