UNPKG

@capgo/cli

Version:
43 lines (42 loc) • 1.66 kB
export interface StoreListing { url: string; name: string | null; icon_url: string | null; } export interface StoreListings { ios: StoreListing | null; android: StoreListing | null; } export interface SavedStoreUrls { ios_store_url?: string | null; android_store_url?: string | null; } interface StoreListingOptions { apikey: string; appId: string; apiHost?: string; } type ConfirmListing = (message: string) => Promise<boolean>; /** Whether this run can ask the user to confirm a detected store listing. */ export declare function canConfirmStoreListings(silent?: boolean): boolean; /** * Looks up the public store listings whose bundle ID / package name equals the * app ID. Returns null when the lookup is unavailable (older backend, network). */ export declare function fetchStoreListings({ apikey, appId, apiHost }: StoreListingOptions): Promise<StoreListings | null>; /** * Picks which detected listings to save: only platforms without a saved URL, * each confirmed by the user when `confirmListing` is set, otherwise accepted * because the store ID matches the app ID exactly. */ export declare function selectStoreUrlsToSave(listings: StoreListings, saved: SavedStoreUrls, confirmListing?: ConfirmListing): Promise<SavedStoreUrls>; /** * Detects the app's store listings and saves them, asking the user to confirm * each one when the terminal is interactive. Best effort: never throws. */ export declare function detectAndSaveStoreListings(options: StoreListingOptions & { saved?: SavedStoreUrls; interactive: boolean; confirmListing?: ConfirmListing; }): Promise<SavedStoreUrls>; export {};