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

Typescript support, missing properties on interface RenderingOptions #126

Closed
marco-silva0000 opened this issue Oct 25, 2019 · 1 comment
Closed
Labels

Comments

@marco-silva0000
Copy link

I'm testing this component in an Angular 4 app, therefore I'm using typescript, even though I'm no typescript master.

While trying some options, specifically:

new EasyMDE({
      renderingConfig: {
        markedOptions: {
          sanitize: true,
        },
    },

But the angular compiler got an error as follows:

renderingConfig: { markedOp...' is not assignable to parameter of type 'Options'.
  Types of property 'renderingConfig' are incompatible.
    Type '{ markedOptions: { sanitize: boolean; }; }' is not assignable to type 'RenderingOptions'.
      Object literal may only specify known properties, and 'markedOptions' does not exist in type 'RenderingOptions'.

and also:

ERROR in /..../node_modules/easymde/types/easymde.d.ts (153,17): Cannot find namespace 'CodeMirror'.
ERROR in /..../node_modules/easymde/types/easymde.d.ts (22,23): Cannot find type definition file for 'codemirror'.

after changing the local files to

    interface RenderingOptions {
        singleLineBreaks?: boolean;
        codeSyntaxHighlighting?: boolean;
        markedOptions?: object;
    }

and also, after removing the codemirror references, there were no more errors and it worked as expected.

Is this something in my compiler, or is the typescript support still not fully fleshed out?

@Ionaru
Copy link
Owner

Ionaru commented Oct 25, 2019

I think this is caused by missing typings on this end.

@Ionaru Ionaru added Bug and removed Question labels Nov 3, 2019
@Ionaru Ionaru closed this as completed in e9e5bef Nov 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants