UNPKG

loop-modules

Version:

Shared modules for the Loop product suite.

55 lines (54 loc) 1.73 kB
import { Action } from '@ngrx/store'; /** * For each action type in an action group, make a simple * enum object for all of this group's action types. * * The 'type' utility function coerces strings into string * literal types and runs a simple check to guarantee all * action types in the application are unique. */ export interface ILoopDocumentActions { QUERY: string; ADD_SELECTED: string; REMOVE_SELECTED: string; SET_ENTRIES: string; SET_SELECTED: string; } export declare const ActionTypes: ILoopDocumentActions; /** * Every action is comprised of at least a type and an optional * payload. Expressing actions as classes enables powerful * type checking in reducer functions. * * See Discriminated Unions: https://www.typescriptlang.org/docs/handbook/advanced-types.html#discriminated-unions */ export declare class QueryAction implements Action { payload: any[]; type: string; constructor(payload: any[]); } export declare class AddSelectedAction implements Action { payload: any; type: string; constructor(payload: any); } export declare class RemoveSelectedAction implements Action { payload: any; type: string; constructor(payload: any); } export declare class SetEntriesAction implements Action { payload: any[]; type: string; constructor(payload?: any[]); } export declare class SetSelectedAction implements Action { payload: any[]; type: string; constructor(payload: any[]); } /** * Export a type alias of all actions in this action group * so that reducers can easily compose action types */ export declare type Actions = QueryAction | AddSelectedAction | RemoveSelectedAction | SetEntriesAction | SetSelectedAction;