import { AppStateStatus, NativeEventSubscription } from 'react-native';
import { Barrier } from './Barrier';
import { STATES } from './constants';
import Semaphore from './Semaphore';
import Emitter from './Emitter';
export { STATES };
declare global {
    var __turboModuleProxy: object | undefined;
}
declare class StaticServer {
    _appStateSub?: NativeEventSubscription;
    _configPath?: string;
    _fileDir: string;
    _hostname: string;
    _nonLocal: boolean;
    _origin: string;
    _stopInBackground: boolean;
    _port: number;
    _signalBarrier?: Barrier<void>;
    _state: STATES;
    _stateChangeEmitter: Emitter;
    _id: number;
    _sem: Semaphore;
    get fileDir(): string;
    get hostname(): string;
    get nonLocal(): boolean;
    get origin(): string;
    get stopInBackground(): boolean;
    get port(): number;
    get state(): STATES;
    _setState(neu: STATES): void;
    /**
     * Creates a new StaticServer instance.
     *
     * Because the legacy, the following alternative signatures are supported,
     * and the overall constructor implementation is thus subpar.
     *
     * new StaticServer(port, root, opts);
     * new StaticServer(port, opts);
     * new StaticServer(port, root);
     * new StaticServer(opts);
     * new StaticServer(port);
     * new StaticServer();
     *
     * @param {object} options
     */
    constructor({ fileDir, nonLocal, stopInBackground, port, }: {
        fileDir: string;
        nonLocal: boolean;
        port: number;
        stopInBackground: boolean;
    });
    addStateListener(listener: (newState: STATES) => void): () => void;
    _configureAppStateHandling(): void;
    _removeConfigFile(): Promise<void>;
    /**
     * This method throws if server is not in a "stable" state, i.e. not in one
     * of these: ACTIVE, CRASHED, INACTIVE.
     */
    _stableStateGuard(): void;
    start(): Promise<string>;
    /**
     * Soft-stop the server: if automatic pause for background is enabled,
     * it will be automatically reactivated when the app goes into foreground
     * again. End users are expected to use public .stop() method below, which
     * additionally cleans-up that automatic re-activation.
     * @returns {Promise<>}
     */
    _stop(): Promise<void>;
    /**
     * Stops or pauses the server, if it is running, depending on whether it was
     * started with keepAlive option or not (note, keepAlive means that server is
     * not paused / restarted when the app goes into background). Pausing the
     * server means it will
     * automatically start again the next time the app transitions from background
     * to foreground. To ensure the server is stopped for good, pass in `kill`
     * flag. In that case only explicit call to .start() will start the server
     * again.
     * @param kill
     * @returns {Promise<>}
     */
    stop(): Promise<void>;
    _handleAppStateChange(appState: AppStateStatus): void;
}
export default StaticServer;
//# sourceMappingURL=index.d.ts.map