How to use roosterjs - 3 common examples

To help you get started, we’ve selected a few roosterjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / roosterjs / publish / samplecode / 5 / source.ts View on Github external
import * as RoosterJs from 'roosterjs';

let contentDiv = document.getElementById('contentDiv') as HTMLDivElement;
let editor = RoosterJs.createEditor(contentDiv);
github microsoft / roosterjs / publish / samplecode / 7 / source.ts View on Github external
onPluginEvent(event: PluginEvent) {
        if (event.eventType == PluginEventType.KeyPress) {
            let keyboardEvent = event.rawEvent;
            if (keyboardEvent.which >= KEY_0 && keyboardEvent.which <= KEY_9) {
                let text = NUMBERS[keyboardEvent.which - KEY_0] + ' ';
                this.editor.insertContent(text);
                keyboardEvent.preventDefault();
            }
        }
    }
}

let contentDiv = document.getElementById('contentDiv') as HTMLDivElement;
let myPlugin = new MyPlugin();
let editor = createEditor(contentDiv, [myPlugin]);
github microsoft / roosterjs / samplecode / 5 / source.ts View on Github external
import * as RoosterJs from 'roosterjs';

let contentDiv = document.getElementById('contentDiv') as HTMLDivElement;
let editor = RoosterJs.createEditor(contentDiv);

roosterjs

A simple facade for all roosterjs code

MIT
Latest version published 4 days ago

Package Health Score

84 / 100
Full package analysis

Popular roosterjs functions