From ec3fd9e1553d71976f1e546d080eac4d4fa15c16 Mon Sep 17 00:00:00 2001 From: marlon-erler Date: Mon, 22 Jul 2024 01:22:59 +0200 Subject: [PATCH] add references --- src/Model/fileModel.ts | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/Model/fileModel.ts b/src/Model/fileModel.ts index 0948db1d..2d7de68b 100644 --- a/src/Model/fileModel.ts +++ b/src/Model/fileModel.ts @@ -39,7 +39,8 @@ export default class FileModel { ); // check if fileContent already exists - const existingFileContent: string | null = this.storageModel.read(fileContentPath); + const existingFileContent: string | null = + this.storageModel.read(fileContentPath); if (existingFileContent != null) return; const stringifiedContent: string = stringify(fileContent); @@ -104,9 +105,9 @@ export default class FileModel { dataVersion: DATA_VERSION, id: v4(), - contentVersions: [] - } - } + contentVersions: [], + }; + }; } // types @@ -121,3 +122,20 @@ export interface FileContent extends ValidObject { type: string; } + +// references +export const FileContentReference: FileContent = { + dataVersion: DATA_VERSION, + + id: "", + creationDate: "", + + type: "", +}; + +export const FileReference: File = { + dataVersion: DATA_VERSION, + + id: "", + contentVersions: [FileContentReference], +}; \ No newline at end of file