Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
restorer: ILayoutRestorer,
rendermime: IRenderMimeRegistry,
settingRegistry: ISettingRegistry
): IMarkdownViewerTracker {
const { commands, docRegistry } = app;
// Add the markdown renderer factory.
rendermime.addFactory(markdownRendererFactory);
const namespace = 'markdownviewer-widget';
const tracker = new InstanceTracker({
namespace
});
let config: Partial = {
...MarkdownViewer.defaultConfig
};
/**
* Update the settings of a widget.
*/
function updateWidget(widget: MarkdownViewer): void {
Object.keys(config).forEach((k: keyof MarkdownViewer.IConfig) => {
widget.setOption(k, config[k]);
});
}
/**
* Update the setting values.
*/
function updateSettings(settings: ISettingRegistry.ISettings) {
config = settings.composite as Partial;