/** Options for {@link useLaunchLocalRunner}. */
export interface UseLaunchLocalRunnerOptions {
    /**
     * Custom handler for opening the `stigmer://` URL.
     *
     * Defaults to `window.location.href` assignment, which is the standard
     * browser pattern for dispatching custom URL schemes to the OS. The
     * browser does not navigate away — it hands the scheme to the OS and
     * the page stays on screen.
     *
     * Override this when embedding in non-standard environments (Electron,
     * iframe, React Native WebView) where the default browser mechanism
     * does not apply.
     */
    readonly openUrl?: (url: string) => void;
}
/** Result returned by a successful {@link UseLaunchLocalRunnerReturn.launch} call. */
export interface LaunchLocalRunnerResult {
    /** The `stigmer://launch-runner?token=...` URL that was opened. */
    readonly url: string;
    /**
     * Absolute expiry time of the launch token. The desktop app must
     * exchange the token before this time (typically 60 seconds).
     */
    readonly expiresAt: Date | undefined;
}
/** Return value of {@link useLaunchLocalRunner}. */
export interface UseLaunchLocalRunnerReturn {
    /**
     * Create a one-time launch token and open the `stigmer://` URL to
     * trigger the desktop app (or CLI fallback) to start a local runner.
     *
     * Resolves with the constructed URL and token expiry on success.
     * The caller cannot detect whether the desktop app received the URL —
     * use {@link useRunnerList} with `refetch()` to poll for the runner
     * appearing in the list.
     */
    readonly launch: (input: {
        org: string;
    }) => Promise<LaunchLocalRunnerResult>;
    /** `true` while the token creation and URL dispatch are in flight. */
    readonly isLaunching: boolean;
    /**
     * Result from the most recent successful launch dispatch, or `null`
     * when no launch has been dispatched (or after {@link clearError}).
     *
     * Consumers can use `lastLaunchResult.expiresAt` to implement
     * timeout-based detection: if no runner appears before the token
     * expires, the desktop app likely did not receive the deep link.
     */
    readonly lastLaunchResult: LaunchLocalRunnerResult | null;
    /** Error from the last failed launch attempt, or `null` when healthy. */
    readonly error: Error | null;
    /** Reset `error` and `lastLaunchResult` to `null`. */
    readonly clearError: () => void;
}
/**
 * Behavior hook that initiates a browser-to-desktop runner launch.
 *
 * Orchestrates two steps:
 * 1. Calls `stigmer.runner.createLaunchToken({ org })` to mint a
 *    one-time, 60-second token backed by the caller's credentials.
 * 2. Opens `stigmer://launch-runner?token={token}` so the OS dispatches
 *    to the Stigmer Desktop app (which exchanges the token for a JWT
 *    and starts a local runner via its CLI sidecar).
 *
 * The hook reports success when the URL is opened. It does **not**
 * detect whether the desktop app is installed or whether the runner
 * actually started — those are observable via `useRunnerList`.
 *
 * @example
 * ```tsx
 * function LaunchButton({ org }: { org: string }) {
 *   const { launch, isLaunching, error } = useLaunchLocalRunner();
 *
 *   return (
 *     <button onClick={() => launch({ org })} disabled={isLaunching}>
 *       {isLaunching ? "Launching…" : "Launch Local Runner"}
 *     </button>
 *   );
 * }
 * ```
 *
 * @example
 * ```tsx
 * // Custom URL handler for non-browser environments
 * const { launch } = useLaunchLocalRunner({
 *   openUrl: (url) => nativeBridge.openExternal(url),
 * });
 * ```
 */
export declare function useLaunchLocalRunner(options?: UseLaunchLocalRunnerOptions): UseLaunchLocalRunnerReturn;
//# sourceMappingURL=useLaunchLocalRunner.d.ts.map