import type { CloudDeployActionApi } from './use-cloud-deploy-action.js';
import type { GitStatusDto } from './use-git-status.js';
import type { SyncActionState } from './use-sync-action.js';
export type SmartDeployStateKind = 'loading' | 'getOnline' | 'connectCloud' | 'deploy' | 'save' | 'pushAndDeploy' | 'saveAndRepublish' | 'live' | 'working' | 'failed';
export interface SmartDeployState {
    kind: SmartDeployStateKind;
    /** Number of changes (uncommitted + unpushed). Used for badge display. */
    changeCount: number;
    /** True iff the user has connected at least one cloud provider. */
    hasCloud: boolean;
    /** True iff the user has a GitHub remote attached. */
    hasRemote: boolean;
    /** Live URL when in `live` state. */
    liveUrl: string | null;
    /** Last-error message when in `failed` state. */
    errorMessage: string | null;
    /** Source of the failure (so the panel can highlight the right section). */
    failedSource: 'sync' | 'deploy' | null;
    /** Which side is actively running when `kind === 'working'`. Used by
     *  the top-bar button to swap the generic "Working…" label for a
     *  specific one: "Syncing code", "Deploying to Cloudflare Pages", or
     *  the one-click "Getting online…" umbrella that covers the whole
     *  create-repo + auto-deploy pipeline. */
    workingSource: 'sync' | 'deploy' | 'getOnline' | null;
    /** Friendly display name of the cloud provider the deploy targets,
     *  e.g. "Cloudflare Pages". Threaded in from the parent so the
     *  hook doesn't have to own the enum→name mapping. */
    cloudProviderName: string | null;
}
export interface UseSmartDeployStateInput {
    /** Output of useGitStatus. Pass `null` for `status` while still loading. */
    gitStatus: GitStatusDto | null;
    /** True iff useGitStatus has not yet completed its first fetch attempt. */
    gitStatusLoading: boolean;
    /** Persisted Application.gitRemoteUrl — defensive fallback when live
     *  status hasn't loaded or is empty. Set on the Application row when
     *  the publish flow has run successfully. */
    persistedRemoteUrl: string | null;
    /** Output of useCloudDeployAction. */
    cloudDeploy: CloudDeployActionApi;
    /** Output of useSyncAction. */
    syncAction: SyncActionState;
    /** Whether at least one cloud provider is connected. From /api/cloud-providers. */
    hasConnectedCloudProvider: boolean;
    /** Friendly display name of the target cloud provider, e.g.
     *  "Cloudflare Pages". Threaded through so the button label can read
     *  "Deploying to Cloudflare Pages" without the hook owning any
     *  enum→string mapping. Falls through to null when no provider is
     *  picked yet (`Working…` fallback). */
    cloudProviderName: string | null;
    /** True while the one-click "Get online" pipeline is running
     *  (create GitHub remote → refresh git status → auto-deploy to the
     *  connected cloud provider). Forces the state machine to `working`
     *  with `workingSource: 'getOnline'` for the ENTIRE pipeline so the
     *  button label can't flicker between intermediate truths — without
     *  it, the brief window between create-remote completing and
     *  cloudDeploy.initiate() being called would bounce the label
     *  through `deploy`/`save` before landing on `working` again. */
    oneClickRunning?: boolean;
}
export declare function useSmartDeployState({ gitStatus, gitStatusLoading, persistedRemoteUrl, cloudDeploy, syncAction, hasConnectedCloudProvider, cloudProviderName, oneClickRunning, }: UseSmartDeployStateInput): SmartDeployState;
//# sourceMappingURL=use-smart-deploy-state.d.ts.map