import ko = require ( "knockout" ) ; class ITaskEditorExtensionDelegates { fileContentProviderDelegate ? : ( filePath : string , callback : ( content : any ) => void , errorCallback : ( error : any ) => void ) => void ; } class configuration { target : string ; inputValues : { [ key ] : string ; } ; extensionDelegates : ITaskEditorExtensionDelegates ; } class gridViewModel { public parameters = ko . observableArray ( [ ] ) ; public initialize ( initialValue ) { var value = [ ] ; if ( initialValue != undefined && initialValue != "" ) { try { value = JSON . parse ( initialValue ) ; } catch { } } this . parameters ( value ) ; } public add ( ) { this . parameters . push ( { name : "" , value : "" } ) ; } public remove ( variable , evt ) { var context = ko . contextFor ( evt . target ) . $parent ; context . parameters . remove ( this ) ; } public onOkClicked ( ) { return JSON . stringify ( this . parameters ( ) ) ; } } var vm = new gridViewModel ( ) ; ko . applyBindings ( vm ) ; var config = VSS . getConfiguration ( ) ; vm . initialize ( config . inputValues [ config . target ] ) ; VSS . register ( "openalm2.task-editor-extension.my-task-editor-extension" , vm ) ; VSS . notifyLoadSucceeded ( ) ;