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

    Interface ScreenShape<Id, Kind, Input, Data, State, E, R, Actions, Host, Top>

    What screens and items share: an id, a kind, the schemas, the enter the engine runs when the thing is shown, and the actions.

    interface ScreenShape<
        Id extends ScreenHandleId,
        Kind extends ScreenKind,
        Input,
        Data extends object,
        State,
        E,
        R,
        Actions extends object,
        Host = undefined,
        Top extends PropertyKey = never,
    > {
        "~top"?: ScreenTopLevelMarker<Top>;
        actions: Actions;
        beforeLeave?: (
            left: ScreenBeforeLeave<Input, Data, State>,
        ) => Effect<void, never, R>;
        beforeResume?: (
            returning: ScreenBeforeResume<Input, Data, State>,
        ) => Effect<void, never, R>;
        data: ScreenCodec<Data>;
        enter: (args: ScreenEnterArgs<Kind, Input, Host>) => Effect<Data, E, R>;
        id: Id;
        input: ScreenCodec<Input, ScreenEncodedInput>;
        kind: Kind;
        leave:
            | ((left: ScreenLeave<Input, Data, State>) => Effect<void, never, R>)
            | undefined;
        readReleased?: ScreenReleasedReader;
        readReleasedInput?: ScreenReleasedInputReader;
        resume:
            | (
                (resumed: ScreenResume<Input, Data, State>) => Effect<void, never, R>
            )
            | undefined;
        state: (opened: ScreenStateArgs<Input, Data, Host>) => State;
    }

    Type Parameters

    • Id extends ScreenHandleId
    • Kind extends ScreenKind
    • Input
    • Data extends object
    • State
    • E
    • R
    • Actions extends object
    • Host = undefined
    • Top extends PropertyKey = never

    Hierarchy (View Summary)

    Index

    Properties

    "~top"?: ScreenTopLevelMarker<Top>

    The data fields the handle also shows on its top level: the screen's one main identifier (identity), or none. A type only, never set.

    actions: Actions
    beforeLeave?: (
        left: ScreenBeforeLeave<Input, Data, State>,
    ) => Effect<void, never, R>

    What the engine runs when a transition is about to cover or close the screen, while its chain and endpoint are still in front: the app's departure work that goes out before the covering screen's burst. A screen and a feed declare it (an item does not). It receives the visit in progress, cannot fail, and runs before the transition and before leave.

    beforeResume?: (
        returning: ScreenBeforeResume<Input, Data, State>,
    ) => Effect<void, never, R>

    What the engine runs when a transition is about to bring the screen back on top (a tab tap back to it, the covering screen's back), while the screen in front still has its chain and endpoint: the app's tap-time work, the counterpart of the first show's burst before its own navigation event. Only a screen declares it. It cannot fail, and runs before the transition and before resume.

    What enter returns: the user's data, under the handle's data; never in a trail.

    enter: (args: ScreenEnterArgs<Kind, Input, Host>) => Effect<Data, E, R>
    id: Id

    What an edge passes to enter — for an item, the schema of one list entry.

    kind: Kind
    leave:
        | ((left: ScreenLeave<Input, Data, State>) => Effect<void, never, R>)
        | undefined

    What the engine runs each time the thing stops being on top — covered by another screen, closed, or left by a tab switch — after the transition that did it committed. It receives the visit that ended, with its duration by the engine's clock. It cannot fail; absent when the thing does nothing then.

    readReleased?: ScreenReleasedReader

    How a checkpoint written by an earlier release is read into this screen: the stored input and data, in the shape that release gave them, become the current stored shape before the definition's schemas decode them. A field the release wrote and the screen no longer holds is read with a schema of its own and mapped into where its fact lives now, or dropped with a logged StoredSnapshotFieldDropped; it never fails the restore (“Stored snapshots of earlier releases”). Absent on a screen whose stored shape never changed; a frame already in the current shape passes through it unchanged.

    readReleasedInput?: ScreenReleasedInputReader

    The same reading for an input stored alone — a trail's root and steps, the process's root: the input of an earlier release, read into the current stored shape before the screen's input schema decodes it.

    resume:
        | (
            (resumed: ScreenResume<Input, Data, State>) => Effect<void, never, R>
        )
        | undefined

    What the engine runs each time the thing is on top again after a leave — the screen that covered it was closed — after that transition committed. Never on the first show (that is enter), never after a rolled-back transition. It cannot fail; absent when the thing does nothing then.

    state: (opened: ScreenStateArgs<Input, Data, Host>) => State

    What continuing from it needs, from its input and data (and, for an item, its host screen's state).