Base Functions

The TeamSQL Extension SDK comes with base functions you can use to you speed up the development of your own extension.

Each main extension class inherits from Extension class, the base functions are available via this:


The rest of this article lists the base functions available for your use.

openURL(url: string): void

Opens a new browser window to the given URL


showAlert(message: string): void

Shows an alert box inside TeamSQL


openNewTab(value: string): void

Opens a new tab/query editor in TeamSQL. You can set the value populating newly-opened tab by sending a value string.

this.openNewTab("SELECT * FROM actor;");

copyToClipboard(value: string): void

Copies string values to your clipboard


getActiveEditor(): monaco.editor.IStandaloneCodeEditor

Returns the active tab's code editor as an IStandaloneCodeEditor object

let editor = this.getActiveEditor();

addActionToActiveEditor(action: monaco.editor.IActionDescriptor)

Adds a new action to TeamSQL Code Editor

                id: 'my-id',
                label: 'My Action',
                keybindings: [monaco.KeyMod.Alt | monaco.KeyMod.Shift | monaco.KeyCode.KEY_F],
                keybindingContext: null,
                contextMenuGroupId: '10',
                run: function (ed) {
                    // Do whatever you want to do when it's clicked
                    return null;
                enablement: {
                    textFocus: true,

results matching ""

    No results matching ""