Fix TS error with twemoji typings without dom lib

Including the dom lib doesn't make much sense since we're not in a
browser environment. While this solution isn't perfect either, I
think it's more fitting.
This commit is contained in:
Dragory 2020-01-18 11:12:11 +02:00
parent c4d6556fe4
commit 6d6bc735e9
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
2 changed files with 9 additions and 2 deletions

View file

@ -66,6 +66,14 @@ import fs from "fs";
import sharp from "sharp";
import twemoji from "twemoji";
declare global {
// This is here so TypeScript doesn't give an error when importing twemoji
// since one of the signatures of twemoji.parse() takes an HTMLElement but
// we're not in a browser environment so including the DOM lib would not make
// sense
type HTMLElement = unknown;
}
import { Url, URL, URLSearchParams } from "url";
const ConfigSchema = t.type({
can_roles: t.boolean,

View file

@ -8,8 +8,7 @@
"emitDecoratorMetadata": true,
"target": "es2018",
"lib": [
"esnext",
"DOM"
"esnext"
],
"baseUrl": ".",
"resolveJsonModule": true,