From 6b129045e86991e9df5a76083b7274ba5e0ae495 Mon Sep 17 00:00:00 2001 From: rhpidfyre Date: Sat, 8 Mar 2025 16:11:18 -0500 Subject: [PATCH] entry.d.ts --- src/rt/rfwfs/types/entry.d.ts | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/rt/rfwfs/types/entry.d.ts diff --git a/src/rt/rfwfs/types/entry.d.ts b/src/rt/rfwfs/types/entry.d.ts new file mode 100644 index 0000000..f954bfe --- /dev/null +++ b/src/rt/rfwfs/types/entry.d.ts @@ -0,0 +1,42 @@ +import { Permissions, ReadStatus } from "../enum" +import { WrapResultEntry } from "../wrap" + +type FileInner = string | number +type ConstEnum = number + +interface Entry { + name: string, + timestamp: number, + permissions: Permissions, + //please do not change the inner values directly on entries or else there will be catastrophic consequences + readonly type: EntryType, +} +interface EntryFileInner { + __body: FileInner, + write: (item: FileInner) => boolean, + read: () => FileInner | undefined, +} +interface EntryFile extends Entry { + inner: EntryFileInner, + hash: string, +} +interface EntryCollection extends Entry { + inner: EntryCollectionManipulate, +} +interface EntryCollectionManipulate { + __body: T[], + find: (file_name: string) => WrapResultEntry + push: (entry: Entry) => PushStatus, + sort: () => void, + pop: (file_name: string) => WrapResultEntry, +} + +export { + FileInner, + ConstEnum, + Entry, + EntryFile, + EntryFileInner, + EntryCollection, + EntryCollectionManipulate, +} \ No newline at end of file