import type { Immutable } from "immer"; import type { Cmd, InitResult, Message, Subscription, UpdateFunctionOptions } from "react-elmish/immutable"; import { type ModelAndPropsFactory, type RenderWithModelOptions, type UpdateArgsFactory } from "react-elmish/immutable/testing"; import type { ElmishState } from "../ElmishDi"; interface ElmishStateResult { init: (props: TProps) => InitResult; update: (msg: TMessage, model: Immutable, props: TProps, optionsTemplate?: Partial>) => [Partial, ...(Cmd | undefined)[]]; updateAndExecCmd: (msg: TMessage, model: Immutable, props: TProps, optionsTemplate?: Partial>) => Promise<[Partial, (TMessage | null)[]]>; consecutiveUpdate: (msg: TMessage, model: Immutable, props: TProps, optionsTemplate?: Partial>) => Promise>; subscription?: Subscription; createUpdateArgs: UpdateArgsFactory; createModelAndProps: ModelAndPropsFactory; } declare function getElmishState(createState: (dependencies: TDependencies) => ElmishState, initProps: () => TProps, dependencies: TDependencies): ElmishStateResult; declare function getElmishStateFactory(createState: (dependencies: TDependencies) => ElmishState, initProps: () => TProps): (dependencies: TDependencies) => ElmishStateResult; interface RenderOptions extends RenderWithModelOptions { dependencies?: TDependencies; model: TModel; } declare function renderWithDependencies(render: () => TResult, { dependencies, model, ...rest }: RenderOptions): TResult; declare function resetDependencies(): void; export type { ElmishStateResult, RenderOptions }; export { getElmishState, getElmishStateFactory, renderWithDependencies, resetDependencies };