UNPKG

@capgo/cli

Version:
72 lines (71 loc) • 3.49 kB
import type { FC } from 'react'; import type { OnboardingResult, Platform } from '../types.js'; import type { BuilderLoginServices } from '../login.js'; import type { BuilderLoginMetadata } from './login-gate.js'; import type { BuilderAppSelectionServices } from '../app-selection.js'; import type { AppSelectionEvent } from './app-selection-gate.js'; import type { OnboardingBeforeExit } from './exit.js'; export declare function useTerminalSize(): { cols: number; rows: number; }; export interface OnboardingShellProps { appId: string; suggestedSource: 'builder' | 'capacitor'; appSelectionServices: BuilderAppSelectionServices; /** * iOS-side bundle id default — sourced from `config.appId` (top-level), which * is what `cap sync` writes into `PRODUCT_BUNDLE_IDENTIFIER`. Distinct from * the Capgo app ID selected by this shell, which may use the Builder override * or another visible app. Threaded to the iOS OnboardingApp; Android ignores it. */ iosBundleIdInitial: string; /** Android package name for Appflow validation; defaults to the legacy Capgo key. */ appflowPackageName?: string; iosDir: string; androidDir: string; /** * Whether guided ASC-key creation may be offered (macOS + signed helper * installed + signature/team verified — see the probe in command.ts). * Threaded into the iOS OnboardingApp; the Android app ignores it. */ guidedHelperUsable: boolean; apikey?: string; loginServices: BuilderLoginServices; supaHost?: string; /** Custom Supabase anon key for self-hosting (--supa-anon). */ supaAnon?: string; /** Correlation id for this onboarding run; threaded into every analytics event the apps emit. */ journeyId: string; /** Pre-resolved platform (--platform flag or the single existing native dir); skips the picker. */ initialPlatform?: Platform; /** * Set when a newer @capgo/cli is published. Drives the self-update prompt * shown as the FIRST wizard screen (before platform selection / auto-load). * Undefined → up to date → no prompt. */ updateInfo?: { currentVersion: string; latestVersion: string; }; /** Shows the terminal replay/analytics opt-out notice on the first shell screen. */ analyticsNotice?: boolean; /** Called once a platform is chosen so the caller can print the completion breadcrumb. */ onResolvePlatform?: (platform: Platform) => void; /** Called by the mounted app on every step transition, so the caller can record * where the user dropped off for the quit event. */ onStep?: (step: string) => void; /** Called by the mounted app when it reaches the build-complete screen, so the * caller prints the accurate post-exit message + durable summary. If the wizard * exits any other way (cancel / missing platform), this never fires and the * caller treats it as cancelled. */ onResult?: (result: OnboardingResult) => void; /** Awaited immediately before Ink exits so replay can capture the alt-screen frame. */ onBeforeExit?: OnboardingBeforeExit; /** Called after the login gate has verified a key. */ onAuthenticated?: (key: string, metadata: BuilderLoginMetadata) => void; onAppSelected?: (appId: string) => void; onAppSelectionEvent?: (event: AppSelectionEvent) => void; } declare const OnboardingShell: FC<OnboardingShellProps>; export default OnboardingShell;