diff --git a/src/becca/entities/bblob.js b/src/becca/entities/bblob.ts similarity index 75% rename from src/becca/entities/bblob.js rename to src/becca/entities/bblob.ts index def5888ee..2ea67f044 100644 --- a/src/becca/entities/bblob.js +++ b/src/becca/entities/bblob.ts @@ -1,18 +1,21 @@ +import { BlobRow } from "./rows"; + class BBlob { static get entityName() { return "blobs"; } static get primaryKeyName() { return "blobId"; } static get hashedProperties() { return ["blobId", "content"]; } - constructor(row) { - /** @type {string} */ + blobId: string; + content: string | Buffer; + contentLength: number; + dateModified: string; + utcDateModified: string; + + constructor(row: BlobRow) { this.blobId = row.blobId; - /** @type {string|Buffer} */ this.content = row.content; - /** @type {int} */ this.contentLength = row.contentLength; - /** @type {string} */ this.dateModified = row.dateModified; - /** @type {string} */ this.utcDateModified = row.utcDateModified; } @@ -27,4 +30,4 @@ class BBlob { } } -module.exports = BBlob; +export = BBlob; diff --git a/src/becca/entities/rows.ts b/src/becca/entities/rows.ts index e2f0a240c..54c0e8b04 100644 --- a/src/becca/entities/rows.ts +++ b/src/becca/entities/rows.ts @@ -51,4 +51,12 @@ export interface EtapiTokenRow { utcDateCreated?: string; utcDateModified?: string; isDeleted: boolean; +} + +export interface BlobRow { + blobId: string; + content: string | Buffer; + contentLength: number; + dateModified: string; + utcDateModified: string; } \ No newline at end of file