File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,10 @@ type PropChangeOptions = {
3636 oldValue : any ;
3737} ;
3838
39+ const Events = {
40+ IMPORT_SCHEMA : 'shell.document.importSchema' ,
41+ } ;
42+
3943export default class DocumentModel {
4044 private readonly [ documentSymbol ] : InnerDocumentModel ;
4145 private readonly [ editorSymbol ] : Editor ;
@@ -135,6 +139,7 @@ export default class DocumentModel {
135139 */
136140 importSchema ( schema : RootSchema ) {
137141 this [ documentSymbol ] . import ( schema ) ;
142+ this [ editorSymbol ] . emit ( Events . IMPORT_SCHEMA , schema ) ;
138143 }
139144
140145 /**
@@ -290,4 +295,12 @@ export default class DocumentModel {
290295 } ,
291296 ) ;
292297 }
298+
299+ /**
300+ * import schema event
301+ * @param fn
302+ */
303+ onImportSchema ( fn : ( schema : RootSchema ) => void ) {
304+ this [ editorSymbol ] . on ( Events . IMPORT_SCHEMA , fn as any ) ;
305+ }
293306}
You can’t perform that action at this time.
0 commit comments