declare type Id = string;

declare type Option<T> = T | null;

export interface Uid<E = RecordStatus> {
  id: Id;
  status: E;
}

export const enum RecordStatus {
  Active = "Active",
  Disabled = "Disabled",
  Deleted = "Deleted",
}

// export type Gid = Uid<RecordStatus>

export type Entry<T, ID = Uid> = T & ID;

export interface EnumVariant<T, D> {
  type: T;
  data: D;
}

export type DateType = Date;
export type Datetime = string;

export const enum Space {
  User = "User",
  Org = "Org",
}

export type SpaceId = EnumVariant<Space.User, Id> | EnumVariant<Space.Org, Id>;

export const enum NodeType {
  Note = "Note",
  Folder = "Folder",
}

export type NodeId =
  | EnumVariant<NodeType.Note, Id>
  | EnumVariant<NodeType.Folder, Id>;

export type NodeEntry =
  | EnumVariant<NodeType.Note, {note: 'note'}>
  | EnumVariant<NodeType.Folder, {folder: 'folder'}>;
