import { Action , ActionWithError } from '../types/base' ; export function createAction < T extends string > ( type ) ; export function createAction < T extends string , P > ( type , payload ) ; export function createAction < T extends string , P > ( type , payload ? ) { return typeof payload === 'undefined' ? { type } : { type , payload } ; } export function createErrorAction < T extends string , E extends object > ( type , error ) ; export function createErrorAction < T extends string , E extends object = Record < string , any > > ( type , error ) { return { type , error } ; } export function createErrorActionWithPayload < T extends string , P , E extends object > ( type , payload , error ) ; export function createErrorActionWithPayload < T extends string , P , E extends object = Record < string , any > > ( type , payload , error ) { return { type , payload , error } ; }