diff --git a/public/js/cover.js b/public/js/cover.ts similarity index 100% rename from public/js/cover.js rename to public/js/cover.ts diff --git a/public/js/extra.js b/public/js/extra.ts similarity index 100% rename from public/js/extra.js rename to public/js/extra.ts diff --git a/public/js/history.js b/public/js/history.ts similarity index 100% rename from public/js/history.js rename to public/js/history.ts diff --git a/public/js/index.js b/public/js/index.ts similarity index 100% rename from public/js/index.js rename to public/js/index.ts diff --git a/public/js/lib/appState.js b/public/js/lib/appState.ts similarity index 100% rename from public/js/lib/appState.js rename to public/js/lib/appState.ts diff --git a/public/js/lib/config/index.ts b/public/js/lib/config/index.ts index 1b7e2183..89fe0bfb 100644 --- a/public/js/lib/config/index.ts +++ b/public/js/lib/config/index.ts @@ -1,10 +1,11 @@ -interface Window { +declare interface Window { DROPBOX_APP_KEY: string, domain: string, urlpath: string, debug: boolean, serverurl: string, version: string + USE_CDN: boolean } export const DROPBOX_APP_KEY = window.DROPBOX_APP_KEY || '' diff --git a/public/js/lib/editor/config.js b/public/js/lib/editor/config.ts similarity index 100% rename from public/js/lib/editor/config.js rename to public/js/lib/editor/config.ts diff --git a/public/js/lib/editor/constants.js b/public/js/lib/editor/constants.ts similarity index 100% rename from public/js/lib/editor/constants.js rename to public/js/lib/editor/constants.ts diff --git a/public/js/lib/editor/index.js b/public/js/lib/editor/index.ts similarity index 99% rename from public/js/lib/editor/index.js rename to public/js/lib/editor/index.ts index eb887da6..84675d63 100644 --- a/public/js/lib/editor/index.js +++ b/public/js/lib/editor/index.ts @@ -11,6 +11,8 @@ import CodeMirrorSpellChecker, { supportLanguages, supportLanguageCodes } from ' import { initTableEditor } from './table-editor' import { availableThemes } from './constants' +declare const CodeMirror: any + /* config section */ const isMac = CodeMirror.keyMap.default === CodeMirror.keyMap.macDefault const defaultEditorMode = 'gfm' diff --git a/public/js/lib/editor/markdown-lint/index.js b/public/js/lib/editor/markdown-lint/index.ts similarity index 99% rename from public/js/lib/editor/markdown-lint/index.js rename to public/js/lib/editor/markdown-lint/index.ts index 349d458b..83f8fda6 100644 --- a/public/js/lib/editor/markdown-lint/index.js +++ b/public/js/lib/editor/markdown-lint/index.ts @@ -10,6 +10,8 @@ window.markdownit = require('markdown-it') // eslint-disable-next-line require('script-loader!markdownlint'); +declare const CodeMirror: any + (function (mod) { mod(CodeMirror) })(function (CodeMirror) { diff --git a/public/js/lib/editor/spellcheck.js b/public/js/lib/editor/spellcheck.ts similarity index 100% rename from public/js/lib/editor/spellcheck.js rename to public/js/lib/editor/spellcheck.ts diff --git a/public/js/lib/editor/table-editor.js b/public/js/lib/editor/table-editor.ts similarity index 100% rename from public/js/lib/editor/table-editor.js rename to public/js/lib/editor/table-editor.ts diff --git a/public/js/lib/editor/ui-elements.js b/public/js/lib/editor/ui-elements.ts similarity index 100% rename from public/js/lib/editor/ui-elements.js rename to public/js/lib/editor/ui-elements.ts diff --git a/public/js/lib/editor/utils.js b/public/js/lib/editor/utils.ts similarity index 99% rename from public/js/lib/editor/utils.js rename to public/js/lib/editor/utils.ts index 32bd4419..525361ab 100644 --- a/public/js/lib/editor/utils.js +++ b/public/js/lib/editor/utils.ts @@ -1,4 +1,5 @@ /* global CodeMirror, editor */ +declare const CodeMirror: any const wrapSymbols = ['*', '_', '~', '^', '+', '='] export function wrapTextWith (editor, cm, symbol) { if (!cm.getSelection()) { diff --git a/public/js/lib/markdown/utils.js b/public/js/lib/markdown/utils.ts similarity index 100% rename from public/js/lib/markdown/utils.js rename to public/js/lib/markdown/utils.ts diff --git a/public/js/lib/modeType.js b/public/js/lib/modeType.ts similarity index 100% rename from public/js/lib/modeType.js rename to public/js/lib/modeType.ts diff --git a/public/js/lib/renderer/csvpreview.js b/public/js/lib/renderer/csvpreview.ts similarity index 100% rename from public/js/lib/renderer/csvpreview.js rename to public/js/lib/renderer/csvpreview.ts diff --git a/public/js/lib/renderer/fretboard/fretboard.js b/public/js/lib/renderer/fretboard/fretboard.ts similarity index 99% rename from public/js/lib/renderer/fretboard/fretboard.js rename to public/js/lib/renderer/fretboard/fretboard.ts index c7e56fd1..f155c925 100644 --- a/public/js/lib/renderer/fretboard/fretboard.js +++ b/public/js/lib/renderer/fretboard/fretboard.ts @@ -12,6 +12,8 @@ import dotWideMiddle from './svg/dotWideMiddle.svg' import stringO from './svg/string_o.svg' import stringX from './svg/string_x.svg' +declare const $: any + const switchListV = { o: `