import type { InitResult, Message, Subscription, UpdateFunctionOptions, UpdateReturnType } from "react-elmish"; import { type RenderWithModelOptions, type UpdateArgsFactory } from "react-elmish/testing"; import type { ElmishState } from "../ElmishDi"; type ModelAndPropsFactory = (modelTemplate?: Partial, propsTemplate?: Partial) => [TModel, TProps]; interface ElmishStateResult { init: (props: TProps) => InitResult; update: (msg: TMessage, model: TModel, props: TProps, optionsTemplate?: Partial>) => UpdateReturnType; updateAndExecCmd: (msg: TMessage, model: TModel, props: TProps, optionsTemplate?: Partial>) => Promise<[Partial, (TMessage | null)[]]>; consecutiveUpdate: (msg: TMessage, model: TModel, 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 };