Readonlyactions: ActionsOptional ReadonlybeforeLeave?: (left: ScreenBeforeLeave<Input, Data, State>) => Effect<void, never, RBL>Optional ReadonlybeforeResume?: (returning: ScreenBeforeResume<Input, Data, State>) => Effect<void, never, RBR>Readonlydata: ScreenCodec<Data>Readonlyenter: (args: ScreenEnterArgs<Kind, Input>) => Effect<Data, E, R>Readonlyid: IdOptional Readonlyidentity?: IdentityThe screen's one main identifier: the data field its handle also shows on the top level.
Readonlyinput: ScreenCodec<Input, ScreenEncodedInput>Optional Readonlyitems?: ItemsReadonlykind: KindOptional Readonlyleave?: (left: ScreenLeave<Input, Data, State>) => Effect<void, never, RL>Optional ReadonlyreadReleased?: ScreenReleasedReaderHow a frame an earlier release stored is read into this screen's current stored shape; see ScreenShape.readReleased.
Optional ReadonlyreadReleasedInput?: ScreenReleasedInputReaderHow an input an earlier release stored alone (a trail's, the process's root) is read; see ScreenShape.readReleasedInput.
Optional Readonlyresume?: (resumed: ScreenResume<Input, Data, State>) => Effect<void, never, RL>Readonlystate: ScreenStateOf<Input, Data, State>
Declares a screen: its id in the core screen catalog (
SCREEN_CATALOG), its kind, its schemas, the burst the app sends when it shows the screen, and what can be done from it. An item of a list is declared with defineScreenItem.inputanddataare what an edge passes and whatenterreturns (the user's data, checked againstdata, shown under the handle'sdata).identity(optional) names the screen's one main identifier, a field of its data the handle also shows on its top level (profile.userId). Every other field is only underdata.state: ({ input, data }) => Stateis what continuing from the screen needs — a token that came with the edge's input included;noScreenStatefor a screen that keeps none.enter({ input, navigate })is the burst, once per frame: the requests the app sends, andnavigate— the screen's own navigation event, exactly once — at the point where the app writes it.beforeLeave(optional) runs when a transition is about to cover or close the screen, while its chain is still in front (before the covering burst);beforeResume(optional) runs when a transition is about to bring the screen back on top, before its chain moves (the tap-time work);leaveandresume(optional) are a visit's end and a new visit's start: run each time the screen stops being on top and each time it is on top again after that.actionsareaction((state, ...args) => Effect)(something done on the screen) andopens(id, (state, ...args) => ({ source, skipOrdinals?, input }))(a transition into another screen; with arguments, their schema comes third). Both see the state, not the data.itemsare the lists of items it shows, each a plain object over a field of its data:{ at: 'threads', key: 'thread', item: ThreadItem }, or, for entries of several kinds,{ at: 'media', key: 'pk', by: 'media_type', variants: { 1: PhotoItem, 2: VideoItem, 8: CarouselItem } }(see ScreenItemListCheck).keyis the entries' identity field.The handle is a snapshot:
{ data, id, kind, origin, [identity], ...actions, ...items }, frozen all the way down; an action does not change its data — fresh data comes with opening the screen again.datais its one enumerable member andtoJSON()returns it, soJSON.stringify(handle)is the data's JSON. A member key used twice, or a reserved key, is a type error.