import { Spec } from '../../specs' ; internal export const UPSERT_SPEC = 'UPSERT_SPEC' ; internal export const REMOVE_SPEC = 'REMOVE_SPEC' ; internal export const SPEC_PARSED = 'SPEC_PARSED' ; internal export const SPEC_UNMOUNTED = 'SPEC_UNMOUNTED' ; interface SpecParsedAction { type : typeof SPEC_PARSED ; } interface SpecUnmountedAction { type : typeof SPEC_UNMOUNTED ; } interface UpsertSpecAction { type : typeof UPSERT_SPEC ; spec : Spec ; } interface RemoveSpecAction { type : typeof REMOVE_SPEC ; id : string ; } internal export function upsertSpec ( spec ) { return { type : UPSERT_SPEC , spec } ; } internal export function removeSpec ( id ) { return { type : REMOVE_SPEC , id } ; } internal export function specParsed ( ) { return { type : SPEC_PARSED } ; } internal export function specUnmounted ( ) { return { type : SPEC_UNMOUNTED } ; } internal export type SpecActions = SpecParsedAction | SpecUnmountedAction | UpsertSpecAction | RemoveSpecAction ;