From 46fabc223fb77f276209da312dc02d1163c972b5 Mon Sep 17 00:00:00 2001 From: Josh Moore Date: Fri, 14 Jul 2023 14:28:52 -0600 Subject: [PATCH] feat: added BusBoy/ass file metadata types --- common/global.d.ts | 3 +++ common/types.d.ts | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/common/global.d.ts b/common/global.d.ts index 047b91f..543d8e7 100644 --- a/common/global.d.ts +++ b/common/global.d.ts @@ -1,3 +1,4 @@ +import { BusBoyFile } from 'ass'; import { Request, Response } from 'express'; declare global { @@ -14,6 +15,8 @@ declare global { */ host: string } + + files: { [key: string]: BusBoyFile } } } } diff --git a/common/types.d.ts b/common/types.d.ts index c253cb4..46b3cc3 100644 --- a/common/types.d.ts +++ b/common/types.d.ts @@ -28,6 +28,31 @@ declare module 'ass' { gfySize: (val: any) => boolean; maximumFileSize: (val: any) => boolean; } + + interface BusBoyFile { + uuid: string; + field: string; + file: string; + filename: string; + encoding: string; + mimetype: string; + truncated: boolean; + done: boolean; + } + + interface AssFile { + fakeid: string; + id: NID; + mimetype: string; + filename: string; + save: { + local?: string; + s3?: any; + } + sha256: string; + timestamp: string; + uploader: NID; + } } //#region Dummy modules