UNPKG

loop-modules

Version:

Shared modules for the Loop product suite.

61 lines (60 loc) 1.9 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 ILoopUserActions { AUTH: string; RESET_AUTH: string; ENTRIES: string; RESET_ENTRIES: string; TOGGLE_SELECTED: string; RESET_SELECTED_ENTRIES: string; } export declare const ActionTypes: ILoopUserActions; /** * 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 AuthAction implements Action { payload: any; type: string; constructor(payload: any); } export declare class ResetAuthAction implements Action { payload: any; type: string; constructor(payload?: any); } export declare class EntriesAction implements Action { payload: any[]; type: string; constructor(payload: any[]); } export declare class ResetEntriesAction implements Action { payload: any[]; type: string; constructor(payload?: any[]); } export declare class ToggleSelectedAction implements Action { payload: any; type: string; constructor(payload: any); } export declare class ResetSelectedEntriesAction 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 = AuthAction | ResetAuthAction | EntriesAction | ResetEntriesAction | ToggleSelectedAction | ResetSelectedEntriesAction;