Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function replaceView(app: IObjectRef, existingView: IObjectRef, viewId: string, idtype: IDType, selection: Range, options?): IAction {
const view = getPlugin(EXTENSION_POINT_TDP_VIEW, viewId);
// assert view
return action(meta('Replace ' + existingView.name + ' with ' + view.name, cat.visual, op.update), CMD_REPLACE_VIEW, replaceViewImpl, [app, existingView], {
viewId,
idtype: idtype ? idtype.id : null,
selection: selection ? selection.toString() : none().toString(),
options
});
}
export function createView(app: IObjectRef, viewId: string, idtype: IDType, selection: Range, options?): IAction {
const view = getPlugin(EXTENSION_POINT_TDP_VIEW, viewId);
// assert view
return action(meta('Add ' + view.name, cat.visual, op.create), CMD_CREATE_VIEW, createViewImpl, [app], {
viewId,
idtype: idtype ? idtype.id : null,
selection: selection ? selection.toString() : none().toString(),
options
});
}