let working_dir = "user" const enum EntryType { Directory, File } type File = string type Entry = { readonly inner: T, readonly type: EntryType } function Entry(inner: T): Entry { const type = typeof inner == "object" ? EntryType.Directory : EntryType.File return { inner: inner, type: type } } const user = { ["about_me.txt"]: Entry(""), ["services.txt"]: Entry("") } const home = { ["user"]: Entry(user) } const root = { ["bin"]: Entry({}), ["home"]: Entry(home) } const fs = { ["/"]: Entry(root) } export { fs, working_dir }