1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-27 08:21:03 +02:00

Tools: Try to add codemirror types again (#3380)

* Try add codemirror type again

* Add global typedef for codemirror

* Add comment
This commit is contained in:
Caleb John 2020-06-18 11:58:11 -06:00 committed by GitHub
parent 0273e58783
commit 77005fc495
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 2 deletions

View File

@ -61,6 +61,7 @@ Modules/TinyMCE/IconPack/postinstall.js
Modules/TinyMCE/langs/
# AUTO-GENERATED - EXCLUDED TYPESCRIPT BUILD
ElectronClient/global.d.js
ElectronClient/gui/MultiNoteActions.js
ElectronClient/gui/NoteContentPropertiesDialog.js
ElectronClient/gui/NoteEditor/NoteBody/AceEditor/AceEditor.js

1
.gitignore vendored
View File

@ -51,6 +51,7 @@ Tools/commit_hook.txt
*.map
# AUTO-GENERATED - EXCLUDED TYPESCRIPT BUILD
ElectronClient/global.d.js
ElectronClient/gui/MultiNoteActions.js
ElectronClient/gui/NoteContentPropertiesDialog.js
ElectronClient/gui/NoteEditor/NoteBody/AceEditor/AceEditor.js

4
ElectronClient/global.d.ts vendored Normal file
View File

@ -0,0 +1,4 @@
// Declare codemirror module so that we can import it using the import syntax.
// This also means it will implicitly have the any type, which is necessary because
// of the flexible manner that codemirror is made https://discuss.codemirror.net/t/basic-codemirror-configuration-in-typescript-project/2047/2
declare module 'codemirror';

View File

@ -1,5 +1,8 @@
import * as React from 'react';
import { useEffect, useImperativeHandle, useState, useRef, useCallback, forwardRef } from 'react';
import * as CodeMirror from 'codemirror';
import 'codemirror/addon/comment/comment';
import 'codemirror/addon/dialog/dialog';
import 'codemirror/addon/edit/closebrackets';
@ -25,8 +28,6 @@ import 'codemirror/mode/clike/clike';
import 'codemirror/mode/diff/diff';
import 'codemirror/mode/sql/sql';
const CodeMirror = require('codemirror');
export interface CancelledKeys {
mac: string[],
default: string[],