import { Component as ReactComponent, ReactNode } from 'react'; interface NoUpdateAction { type: 'NO_UPDATE'; } interface UpdateAction { type: 'UPDATE'; state: S; } interface SideEffectsAction { type: 'SIDE_EFFECTS'; sideEffects: E; } interface UpdateWithSideEffectsAction { type: 'UPDATE_WITH_SIDE_EFFECTS'; state: S; sideEffects: E; } export function noUpdate(action: { type: never }): NoUpdateAction; export function update(state: S): UpdateAction; export function sideEffects(sideEffects: E): SideEffectsAction; export function updateWithSideEffects( state: S, sideEffects: E, ): UpdateWithSideEffectsAction; interface ActionShape { type: string; [key: string]: any; } interface Props { initialState: S; reducer: ( state: S, action: A, ) => | NoUpdateAction | UpdateAction | SideEffectsAction<(state: S) => any> | UpdateWithSideEffectsAction any>; render: ( { state, send }: { state: S; send: (action: A) => void }, ) => ReactNode; } interface State { internalState: S; } export class Component extends ReactComponent< Props, State > {}