UNPKG

mui-modal-provider

Version:

[![codecov](https://codecov.io/gh/Quernest/mui-modal-provider/branch/master/graph/badge.svg?token=AL2WK480NF)](https://codecov.io/gh/Quernest/mui-modal-provider) [![package version](https://img.shields.io/npm/v/mui-modal-provider.svg?style=flat-square)](h

33 lines (32 loc) 866 B
import { State, StateElement, ActionMap, ModalComponentProps, Props } from './types'; export declare enum Types { SHOW = "SHOW", HIDE = "HIDE", UPDATE = "UPDATE", DESTROY = "DESTROY", DESTROY_BY_ROOT_ID = "DESTROY_BY_ROOT_ID", UNKNOWN = "UNKNOWN" } interface Payload { [Types.SHOW]: StateElement & { id: string; }; [Types.HIDE]: { id: string; }; [Types.UPDATE]: { id: string; props: ModalComponentProps<Props>; }; [Types.DESTROY]: { id: string; }; [Types.DESTROY_BY_ROOT_ID]: { rootId: string; }; [Types.UNKNOWN]: undefined; } declare type Action = ActionMap<Payload>[keyof ActionMap<Payload>]; export declare const initialState: State; export default function reducer(state: State, action: Action): State; export {};