Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with Typescript #74

Open
AhmedElbatt opened this issue Nov 7, 2018 · 0 comments
Open

Integration with Typescript #74

AhmedElbatt opened this issue Nov 7, 2018 · 0 comments

Comments

@AhmedElbatt
Copy link

AhmedElbatt commented Nov 7, 2018

Hi Steven,

May I ask you if you can provide me with a demo on how I can use the tinyMCE-mention in TS file.That is a simple of my code :

import * as tinymce from 'tinymce';
import { getMainLayoutUrl } from '../getMainLayout';
var mentions = require('tinymce-mention');

export function loadCommentEditor(selector: string) {
let mainCss = getMainLayoutUrl();

tinymce.init({
    selector: selector,
    entity_encoding: "raw",
    language: globalVar.language,
    language_url: globalVar.tinyMceSettings.languageUrl,
    mentions: {
        source: [
            { name: 'Tyra Porcelli' },
            { name: 'Brigid Reddish' },
            { name: 'Ashely Buckler' },
            { name: 'Teddy Whelan' }
        ]
    },
    menubar: false,
    statusbar: false,
    branding: false,
    plugins: [
        'autolink lists link charmap anchor textcolor',
        'visualblocks code',
        'paste'
    ],
    external_plugins: {
        'mention': 'http://stevendevooght.github.io/tinyMCE-mention/javascripts/tinymce/plugins/mention/plugin.js'
    },
    toolbar: 'bold italic underline forecolor bullist numlist | link | code |',
    content_css: mainCss,
});

I receive that error in webpack running
TS2345: Argument of type '{ selector: string; entity_encoding: string; language: string; language_url: string; mentions: { source: { name: string; }[]; }; menubar: false; statusbar: false; branding: false; plugins: string[]; external_plugins: { ...; }; toolbar: string; content_css: string; }' is not assignable to parameter of type 'Settings'.Object literal may only specify known properties, and 'mentions' does not exist in type 'Settings'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant