@versatiledatakit/shared
Version:
Versatile Data Kit Shared library enables reusability of shared features like: NgRx Redux, Error Handlers, Utils, Generic Components, etc.
51 lines (50 loc) • 1.31 kB
TypeScript
import { Action } from '@ngrx/store';
/**
* ** Base Action for Redux Impl.
*/
export declare abstract class BaseAction implements Action {
/**
* ** Type of Action.
*/
readonly type: string;
/**
* ** Constructor.
*/
protected constructor(type: string);
}
/**
* ** Base Action with payload for Redux Impl.
*/
export declare abstract class BaseActionWithPayload<T> extends BaseAction {
/**
* ** Action payload data.
*/
readonly payload: T;
/**
* ** Action Task.
*/
readonly task: string;
/**
* ** Constructor.
*/
protected constructor(type: string, payload: T, task?: string);
/**
* ** Factory method that have to be overridden in Subclasses.
*/
static of(..._args: unknown[]): BaseActionWithPayload<unknown>;
}
/**
* ** Generic Action with payload for Redux Impl.
*
* - All parameters type, payload and optional task are provided to Constructor.
*/
export declare class GenericAction<T> extends BaseActionWithPayload<T> {
/**
* ** Constructor.
*/
constructor(type: string, payload: T, task?: string);
/**
* ** Factory method for Generic Action with type and payload in Constructor.
*/
static of<K>(type: string, payload: K, task?: string): GenericAction<K>;
}