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

    Function defineScreenItem

    • Declares an item of a list a host screen shows, with only what an item has: its id — a literal of its own, not a ScreenId — the schema of one list entry (input), its data and state, its enter and its actions.

      The engine runs the item's enter when the host shows it — the item's own requests, an impression, a thread's preview — under the host's frame, one item after another, after the host's burst; it emits no navigation. An item is not a screen: it is in no screen set and no trail (only its identity key is, when an edge is taken from it), and it has no lists of its own. Several item definitions share actions, state or enter as plain values (a factory spread into actions); a nested list of an entry (a carousel's slides) is data, and the actions over it take an index.

      The item's handle shows its data under data and, on its top level, only the identity key its list declares (key); toJSON() returns the data.

      host (optional) is the schema of the state of the screen the item is shown on: the item's state receives that state as host, decoded with it, so a fact the host owns — the thread a message belongs to — reaches the item's actions without a copy in each entry. The host screen's state must fit the schema; a misfit is a type error in the platform's screenSet.

      Type Parameters

      • const Id extends string
      • Input
      • Data extends object
      • State
      • E
      • R
      • Actions extends Readonly<Record<string, ScreenMember<never>>>
      • RL = never

      Parameters

      Returns ScreenItemDefinition<
          Id,
          Input,
          Data,
          State,
          E,
          R
          | RL,
          Actions,
          undefined,
          never,
      >

    • Declares an item of a list a host screen shows, with only what an item has: its id — a literal of its own, not a ScreenId — the schema of one list entry (input), its data and state, its enter and its actions.

      The engine runs the item's enter when the host shows it — the item's own requests, an impression, a thread's preview — under the host's frame, one item after another, after the host's burst; it emits no navigation. An item is not a screen: it is in no screen set and no trail (only its identity key is, when an edge is taken from it), and it has no lists of its own. Several item definitions share actions, state or enter as plain values (a factory spread into actions); a nested list of an entry (a carousel's slides) is data, and the actions over it take an index.

      The item's handle shows its data under data and, on its top level, only the identity key its list declares (key); toJSON() returns the data.

      host (optional) is the schema of the state of the screen the item is shown on: the item's state receives that state as host, decoded with it, so a fact the host owns — the thread a message belongs to — reaches the item's actions without a copy in each entry. The host screen's state must fit the schema; a misfit is a type error in the platform's screenSet.

      Type Parameters

      • const Id extends string
      • Input
      • Data extends object
      • State
      • E
      • R
      • Actions extends Readonly<Record<string, ScreenMember<never>>>
      • Host
      • RL = never

      Parameters

      Returns ScreenItemDefinition<Id, Input, Data, State, E, R | RL, Actions, Host, never>