mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-16 22:21:51 +00:00
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:
parent
c4d6556fe4
commit
6d6bc735e9
2 changed files with 9 additions and 2 deletions
|
@ -66,6 +66,14 @@ import fs from "fs";
|
||||||
import sharp from "sharp";
|
import sharp from "sharp";
|
||||||
import twemoji from "twemoji";
|
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";
|
import { Url, URL, URLSearchParams } from "url";
|
||||||
const ConfigSchema = t.type({
|
const ConfigSchema = t.type({
|
||||||
can_roles: t.boolean,
|
can_roles: t.boolean,
|
||||||
|
|
|
@ -8,8 +8,7 @@
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"target": "es2018",
|
"target": "es2018",
|
||||||
"lib": [
|
"lib": [
|
||||||
"esnext",
|
"esnext"
|
||||||
"DOM"
|
|
||||||
],
|
],
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
|
|
Loading…
Add table
Reference in a new issue