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