import type { InAppBrowserAuthResult, InAppBrowserOptions, InAppBrowserResult } from '../types'; /** * Stateful surface returned by {@link useInAppBrowser}. * * @example * ```tsx * const { open, isLoading, error } = useInAppBrowser() * * const onPress = () => { * open('https://example.com').catch(() => { * // `error` is also populated automatically. * }) * } * ``` */ export interface UseInAppBrowserReturn { /** Present the in-app browser, tracking `isLoading` / `error` on this hook. */ open: (url: string, options?: InAppBrowserOptions) => Promise; /** Launch an auth session, tracking `isLoading` / `error` on this hook. */ openAuth: (url: string, redirectUrl: string, options?: InAppBrowserOptions) => Promise; /** Stateless passthrough to the native `close`. */ close: () => Promise; /** Stateless passthrough to the native `closeAuth`. */ closeAuth: () => Promise; /** Stateless passthrough to the native `isAvailable`. */ isAvailable: () => Promise; /** `true` while an `open` / `openAuth` call is in flight. */ isLoading: boolean; /** Last error thrown by `open` / `openAuth`, cleared when a new call starts. */ error: Error | null; } /** * React hook that wraps the imperative {@link nativeOpen} / {@link nativeOpenAuth} * APIs with loading and error state tracking. `close`, `closeAuth`, and * `isAvailable` are direct delegates to the stateless module API. * * `open`/`openAuth` and the returned object are memoized with `useCallback` / * `useMemo` so consumers passing them to `useEffect` deps or `React.memo` * children get stable identities — independent of whether the host app has * `babel-plugin-react-compiler` enabled. */ export declare const useInAppBrowser: () => UseInAppBrowserReturn; //# sourceMappingURL=useInAppBrowser.d.ts.map