@@ -18,12 +18,12 @@ export enum ResponseType {
1818 CollapseFolder = "CollapseFolder" ,
1919 SetActiveTool = "SetActiveTool" ,
2020 SetActiveDocument = "SetActiveDocument" ,
21- NewDocument = "NewDocument" ,
22- CloseDocument = "CloseDocument" ,
21+ UpdateOpenDocumentsList = "UpdateOpenDocumentsList" ,
2322 UpdateWorkingColors = "UpdateWorkingColors" ,
24- PromptCloseConfirmationModal = "PromptCloseConfirmationModal" ,
2523 SetCanvasZoom = "SetCanvasZoom" ,
2624 SetRotation = "SetRotation" ,
25+ PromptConfirmationToCloseDocument = "PromptConfirmationToCloseDocument" ,
26+ PromptConfirmationToCloseAllDocuments = "PromptConfirmationToCloseAllDocuments" ,
2727}
2828
2929export function registerResponseHandler ( responseType : ResponseType , callback : ResponseCallback ) {
@@ -57,10 +57,8 @@ function parseResponse(responseType: string, data: any): Response {
5757 return newSetActiveTool ( data . SetActiveTool ) ;
5858 case "SetActiveDocument" :
5959 return newSetActiveDocument ( data . SetActiveDocument ) ;
60- case "NewDocument" :
61- return newNewDocument ( data . NewDocument ) ;
62- case "CloseDocument" :
63- return newCloseDocument ( data . CloseDocument ) ;
60+ case "UpdateOpenDocumentsList" :
61+ return newUpdateOpenDocumentsList ( data . UpdateOpenDocumentsList ) ;
6462 case "UpdateCanvas" :
6563 return newUpdateCanvas ( data . UpdateCanvas ) ;
6664 case "SetCanvasZoom" :
@@ -71,20 +69,22 @@ function parseResponse(responseType: string, data: any): Response {
7169 return newExportDocument ( data . ExportDocument ) ;
7270 case "UpdateWorkingColors" :
7371 return newUpdateWorkingColors ( data . UpdateWorkingColors ) ;
74- case "PromptCloseConfirmationModal" :
75- return { } ;
72+ case "PromptConfirmationToCloseDocument" :
73+ return newPromptConfirmationToCloseDocument ( data . PromptConfirmationToCloseDocument ) ;
74+ case "PromptConfirmationToCloseAllDocuments" :
75+ return newPromptConfirmationToCloseAllDocuments ( data . PromptConfirmationToCloseAllDocuments ) ;
7676 default :
7777 throw new Error ( `Unrecognized origin/responseType pair: ${ origin } , '${ responseType } '` ) ;
7878 }
7979}
8080
8181export type Response = SetActiveTool | UpdateCanvas | DocumentChanged | CollapseFolder | ExpandFolder | UpdateWorkingColors | SetCanvasZoom | SetRotation ;
8282
83- export interface CloseDocument {
84- document_index : number ;
83+ export interface UpdateOpenDocumentsList {
84+ open_documents : Array < string > ;
8585}
86- function newCloseDocument ( input : any ) : CloseDocument {
87- return { document_index : input . document_index } ;
86+ function newUpdateOpenDocumentsList ( input : any ) : UpdateOpenDocumentsList {
87+ return { open_documents : input . open_documents } ;
8888}
8989
9090export interface Color {
@@ -127,15 +127,19 @@ function newSetActiveDocument(input: any): SetActiveDocument {
127127 } ;
128128}
129129
130- export interface NewDocument {
131- document_name : string ;
130+ export interface PromptConfirmationToCloseDocument {
131+ document_index : number ;
132132}
133- function newNewDocument ( input : any ) : NewDocument {
133+ function newPromptConfirmationToCloseDocument ( input : any ) : PromptConfirmationToCloseDocument {
134134 return {
135- document_name : input . document_name ,
135+ document_index : input . document_index ,
136136 } ;
137137}
138138
139+ function newPromptConfirmationToCloseAllDocuments ( _input : any ) : { } {
140+ return { } ;
141+ }
142+
139143export interface UpdateCanvas {
140144 document : string ;
141145}
0 commit comments