import { Inspect, State } from 'immertation'; import { ActionId } from '../tasks/types.js'; import * as React from "react"; /** * Callback function for the stream() method. * Receives the dispatched value and an inspect proxy for annotation tracking. * * @template T - The payload type */ export type ConsumerRenderer = (value: T, inspect: Inspect) => React.ReactNode; /** * Model for consumed values. * Allows Immertation's State to manage the value with real inspect capabilities. * @template T - The payload type */ export type Model = { value: T; }; /** * Entry storing the latest value and listeners for an action. * Uses Immertation's State to provide real inspect functionality for consumed values. * @template T - The payload type */ export type Entry = { state: State>; listeners: Set<() => void>; }; /** * The consumer context is a Map storing entries keyed by action. */ export type ConsumerContext = Map; /** * Props for the Consumer provider component. */ export type Props = { children: React.ReactNode; };