Created
June 4, 2020 15:47
-
-
Save ljmotta/8fb6bee80ea9cc6267130f72289186b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { DefaultKeyboardShortcutsService, KeyboardShortcutsApi } from "@kogito-tooling/microeditor-envelope"; | |
import { ChannelType, getOperatingSystem } from "@kogito-tooling/core-api"; | |
export class EmbeddedEditorKeyboardShortcuts { | |
private static instance: KeyboardShortcutsApi; | |
public static getInstance(channel: ChannelType): KeyboardShortcutsApi { | |
if (!EmbeddedEditorKeyboardShortcuts.instance) { | |
console.log("new instance") | |
const editorContext = { channel, operatingSystem: getOperatingSystem() }; | |
EmbeddedEditorKeyboardShortcuts.instance = new DefaultKeyboardShortcutsService(editorContext); | |
} | |
return EmbeddedEditorKeyboardShortcuts.instance; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment