@@ -35,39 +35,25 @@ type ModalInstance = ModalConfiguration & {
3535} ;
3636
3737export type ModalContextValue = {
38- open (
39- config ?: ModalConfiguration ,
40- fn ?: ( instance : ModalInstance , value : unknown ) => void ,
41- onCancel ?: ( instance : ModalInstance ) => void ,
42- ) : void ;
43- push (
44- config ?: ModalConfiguration ,
45- fn ?: ( instance : ModalInstance , value : unknown ) => void ,
46- onCancel ?: ( instance : ModalInstance ) => void ,
47- ) : ModalInstance ;
48- cancel ( ) : void ;
49- close ( ) : void ;
50- confirm ( value : unknown ) : void ;
51- showInputError ( text : string ) : void ;
52- onKeyDown ( event : KeyboardEvent ) : void ;
53- setModal ( modal : ReactNode ) : void ;
38+ modal : {
39+ open (
40+ config ?: ModalConfiguration ,
41+ fn ?: ( instance : ModalInstance , value : unknown ) => void ,
42+ onCancel ?: ( instance : ModalInstance ) => void ,
43+ ) : void ;
44+ push (
45+ config ?: ModalConfiguration ,
46+ fn ?: ( instance : ModalInstance , value : unknown ) => void ,
47+ onCancel ?: ( instance : ModalInstance ) => void ,
48+ ) : ModalInstance ;
49+ cancel ( ) : void ;
50+ close ( ) : void ;
51+ confirm ( value : unknown ) : void ;
52+ showInputError ( text : string ) : void ;
53+ onKeyDown ( event : KeyboardEvent ) : void ;
54+ setModal ( modal : ReactNode ) : void ;
55+ } ;
56+ currentModal : ReactNode ;
5457} ;
5558
56- export const ModalContext = createContext < ModalContextValue > ( {
57- open : ( ) => undefined ,
58- push : ( ) => ( {
59- render : ( ) : void => undefined ,
60- hide : ( ) : void => undefined ,
61- destroy : ( ) : void => undefined ,
62- close : ( ) : void => undefined ,
63- confirm : ( ) : void => undefined ,
64- cancel : ( ) : void => undefined ,
65- showInputError : ( ) : void => undefined ,
66- } ) ,
67- cancel : ( ) => undefined ,
68- close : ( ) => undefined ,
69- confirm : ( ) => undefined ,
70- showInputError : ( ) => undefined ,
71- onKeyDown : ( ) => undefined ,
72- setModal : ( ) => undefined ,
73- } ) ;
59+ export const ModalContext = createContext < ModalContextValue | undefined > ( undefined ) ;
0 commit comments