From d7eb7eaec8dced0201b070e6f3f47894113f35a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Thu, 5 Oct 2023 02:01:31 -0400 Subject: [PATCH] fix(typing): declare modules for untyped dependencies --- typings/blueimp-md5.d.ts | 3 +++ typings/blueimp-md5.ts | 4 ++-- typings/express.d.ts | 6 +++--- typings/h3.d.ts | 10 ++++++++++ typings/mongoose-sequence.d.ts | 2 +- typings/next.d.ts | 28 ++++++++++++++-------------- typings/san.d.ts | 1 + 7 files changed, 34 insertions(+), 20 deletions(-) create mode 100644 typings/blueimp-md5.d.ts create mode 100644 typings/h3.d.ts create mode 100644 typings/san.d.ts diff --git a/typings/blueimp-md5.d.ts b/typings/blueimp-md5.d.ts new file mode 100644 index 0000000..dc9325d --- /dev/null +++ b/typings/blueimp-md5.d.ts @@ -0,0 +1,3 @@ +declare module "blueimp-md5"; +declare module "bcryptjs"; +export {}; diff --git a/typings/blueimp-md5.ts b/typings/blueimp-md5.ts index a9aa6f8..642586f 100644 --- a/typings/blueimp-md5.ts +++ b/typings/blueimp-md5.ts @@ -1,2 +1,2 @@ -declare module "blueimp-md5" -declare module "bcryptjs" \ No newline at end of file +declare module "blueimp-md5"; +declare module "bcryptjs"; diff --git a/typings/express.d.ts b/typings/express.d.ts index a5c1b14..de9bdec 100644 --- a/typings/express.d.ts +++ b/typings/express.d.ts @@ -1,12 +1,12 @@ import { Document } from "mongoose"; import { IStory } from "~/models/stories"; import { IUser } from "~/models/user"; -import {Request} from "express" +import { Request } from "express"; declare global { declare namespace Express { interface Request { - newStory?: IStory, + newStory?: IStory; user?: IUser; files: any; AddID?: string | number; @@ -14,7 +14,7 @@ declare global { cidx?: number; } interface User { - [key: string]: any + [key: string]: any; } } } diff --git a/typings/h3.d.ts b/typings/h3.d.ts new file mode 100644 index 0000000..e9fcca6 --- /dev/null +++ b/typings/h3.d.ts @@ -0,0 +1,10 @@ +import type { H3Event, H3EventContext } from "h3"; +import { IFicmas } from "~/models/challenges/ficmas"; +import { IUser } from "~/models/user"; +declare module "h3" { + interface H3EventContext { + currentUser?: IUser; + ficmasarray_raw?: IFicmas[]; + chapterIndex: number; + } +} diff --git a/typings/mongoose-sequence.d.ts b/typings/mongoose-sequence.d.ts index a4b0710..a9acdd9 100644 --- a/typings/mongoose-sequence.d.ts +++ b/typings/mongoose-sequence.d.ts @@ -1 +1 @@ -declare module 'mongoose-sequence'; \ No newline at end of file +declare module "mongoose-sequence"; diff --git a/typings/next.d.ts b/typings/next.d.ts index a8b30bf..10599fd 100644 --- a/typings/next.d.ts +++ b/typings/next.d.ts @@ -1,14 +1,14 @@ -import { Document } from "mongoose"; -import { IStory } from "~/models/stories"; -import { IUser } from "~/models/user"; - -declare module "next" { - export interface NextApiRequest { - newStory?: IStory, - user?: IUser; - files: any; - AddID?: string | number; - readStory?: IStory; - cidx?: number; - } -} \ No newline at end of file +import { Document } from "mongoose"; +import { IStory } from "~/models/stories"; +import { IUser } from "~/models/user"; + +declare module "next" { + export interface NextApiRequest { + newStory?: IStory; + user?: IUser; + files: any; + AddID?: string | number; + readStory?: IStory; + cidx?: number; + } +} diff --git a/typings/san.d.ts b/typings/san.d.ts new file mode 100644 index 0000000..1d90c09 --- /dev/null +++ b/typings/san.d.ts @@ -0,0 +1 @@ +declare module "sanitize-html";