UNPKG

@telsystems/common

Version:
25 lines (24 loc) 909 B
import MVC from 'react-redux-mvc'; import { IViewModel } from '../interfaces'; export declare class ViewModel<T extends object> extends MVC.Model<T> implements IViewModel<T> { currentAction: any; lastProps: T; currentProps: T; constructor(props?: T, options?: object); createDefaults(): MVC.TState<T>; resetWaiting(prop?: any): this; reset(newState: any): this; isWaiting(action?: string): boolean; isFailed(action?: string): boolean; updateProps(currentProps: T, nextProps: T): void; diff(prop?: string): object; isEqual(prop: string): boolean; getLastProp(prop: string): any; isActionFulfilled(action?: string): boolean; setActionToWaiting(actionName?: string | undefined, updates?: any): any; setActionToFailed({ error, origError }: { error: any; origError: any; }, actionName?: any): MVC.TState<T>; onInit(): this; }