Skip to content

Commit

Permalink
♻️ fix #13
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Feb 17, 2019
1 parent 529b465 commit b5c6eed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/ts/editor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Editor {
this.bindEvent(vditor)
}

private html2md(TurndownService: any, vditor: Vditor, textHTML: string, textPlain: string) {
private html2md(TurndownService:Turndown, vditor: Vditor, textHTML: string, textPlain: string) {
let onlyMultiCode = false
// no escape
TurndownService.prototype.escape = (string: string) => {
Expand Down Expand Up @@ -169,7 +169,7 @@ class Editor {
})
}

let TurndownService: any
let TurndownService:Turndown
const html2md = this.html2md
this.element.addEventListener('paste', (event: Event) => {
event.stopPropagation()
Expand Down
13 changes: 12 additions & 1 deletion src/ts/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,21 @@ declare module 'turndown'
declare module 'turndown-plugin-gfm/lib/turndown-plugin-gfm.es.js'

declare var webkitAudioContext: {
prototype: AudioContext;
prototype: AudioContext
new(contextOptions?: AudioContextOptions): AudioContext
}

declare interface Turndown {
prototype: {
escape(name: string): string
}
new(): {
addRule(name: string, options: {}): void
use(plugin: Turndown): void
turndown(text: string): string
}
}

interface HTMLInputEvent extends Event {
target: HTMLInputElement & EventTarget
}
Expand Down

0 comments on commit b5c6eed

Please sign in to comment.