Remove custom abcjs types (#1024)

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
Tilman Vatteroth 2021-02-08 21:19:02 +01:00 committed by GitHub
parent 47f5e7653b
commit 8a2d26f718
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 15 deletions

View file

@ -19,12 +19,13 @@ export const AbcFrame: React.FC<AbcFrameProps> = ({ code }) => {
return return
} }
const actualContainer = container.current const actualContainer = container.current
import(/* webpackChunkName: "abc.js" */ 'abcjs').then((imp) => { import(/* webpackChunkName: "abc.js" */ 'abcjs')
imp.renderAbc(actualContainer, code) .then((imp) => {
}) imp.renderAbc(actualContainer, code, {})
.catch(() => { })
console.error('error while loading abcjs') .catch(() => {
}) console.error('error while loading abcjs')
})
}, [code]) }, [code])
return <div ref={ container } className={ 'abcjs-score bg-white text-black text-center overflow-x-auto' }/> return <div ref={ container } className={ 'abcjs-score bg-white text-black text-center overflow-x-auto' }/>

View file

@ -1,9 +0,0 @@
/*
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
declare module 'abcjs' {
export function renderAbc(target: string | HTMLElement, code: string)
}