igpapi — Instagram private API Simulator for Node.js (API reference) 4.14.0
    Preparing search index...

    Interface RunMobileApp<R, Screen, A, E, Built>

    What a platform gives to run one app process, birth to death: the effect that builds the process, the first step that starts it (a launch or a restore) and the caller's main.

    interface RunMobileApp<R, Screen, A, E, Built extends object = object> {
        closing?: Effect<void, never, R>;
        main: (screen: Screen) => Effect<A, E, R>;
        open: (built: Built) => Effect<Screen, unknown, R>;
        process: Effect<
            Built & {
                closeConnections?: () => void | Promise<void>;
                layer: Layer<R>;
            },
            unknown,
        >;
        signal?: AbortSignal;
    }

    Type Parameters

    • R
    • Screen
    • A
    • E
    • Built extends object = object
    Index

    Properties

    closing?: Effect<void, never, R>

    What the app does when it closes, run inside the process once main has ended — on success, on failure, on interruption and on abort — before the process is gone: pending telemetry is delivered. It cannot fail; a platform logs what it could not do. After it, the process's connections are closed (closeConnections), and then the runtime is disposed. It runs only for a process that was built.

    main: (screen: Screen) => Effect<A, E, R>

    What the caller does with the process, from the first screen on (main).

    open: (built: Built) => Effect<Screen, unknown, R>

    The first step: starts the app the way the entry names and shows the first screen.

    process: Effect<
        Built & {
            closeConnections?: () => void | Promise<void>;
            layer: Layer<R>;
        },
        unknown,
    >

    Builds the process; its failure arrives as the run's rejection. The built process may carry closeConnections, the one place the process's network connections are closed (see RunMobileApp.closing).

    The layer provides MobileProcessBackground beside R (the platform's app layer merges the core's makeMobileProcessBackgroundLayer): the run waits for the process's background fibers after main (see runMobileApp), so every process the entries build carries the set, on both platforms. The wait is looked up at run time — the layer's declared output is the platform's surface, which a platform without a launch tail does not have to widen. So is the process's reference (CurrentAppProcess): the run races the start and main against the process's own end and reads that end once more after the wait; a layer without one never ends itself.

    signal?: AbortSignal

    Aborting it interrupts main, closes the process and rejects the call with the abort reason. A signal that is already aborted builds nothing.