@startuml

class Key {
  + index: number
  + display: string
  + actions: Action[]
}

class Font {
  + name: string
  + size: number
  + bold: boolean
  + italic: boolean
  + Font(fontInterface: FontInterface)
  + toObject(): FontInterface
}

enum ImageType {
  Standard
  Hide
  Bold
}

class Layout {
  + id: string
  + associatedId: string | null
  + index: number
  + title: string
  + subtitle: string
  + categoryId: number
  + creationDate: number
  + updateDate: number
  + isEnable: boolean
  + isHid: boolean
  + isFactory: boolean
  + isMac: boolean
  + linkApplicationPath: string[]
  + linkApplicationEnable: boolean
  + isDefault: boolean
  + isDarkMode: boolean
  + keys: Key[]
  + font: Font
  + imageType: ImageType
  + augmentedHidEnable: boolean
  + systemLayoutId: string
  + constructor(layoutInterface: LayoutInterface)
  + clearAllKeys(): void
  + toObject(): LayoutInterface
  + exportableLayoutObject(): ExportableLayoutInterface
  + savableLayoutObject(): any
  + static imageTypeId(imageType: ImageType): number
  + static imageTypeFromId(imageTypeId: number): ImageType
}

class Action {
  + isGrey: boolean
  + display: string
  + modifier: number
  + subActions: SubAction[]
  + shortcutKeys: Key[] | null
  + constructor(actionInterface: ActionInterface)
  + toObject(): ActionInterface
  + emptySubActionText(): string | null
  + characterSubActionText(): string | null
  + hardwareSubActionText(): string | null
  + layoutSubActionText(): string | null
  + applicationSubActionText(): string | null
  + urlSubActionText(): string | null
  + subActionType(): SubActionType | null
  + setDisplay(text: string): void
  + setSubAction(text: string, subActionType: SubActionType): void
  + getShortcutKeys(layoutKeys: Key[]): Key[]
  + clearShortcuts(): void
}

enum SubActionDTOErrorCodes {
  Null
  Data
  Type
}

enum SubActionType {
  Empty
  Character
  Shortcut
  Application
  WebUrl
  Hardware
  Layout
}

class SubAction {
  + data: string
  + type: number
  + constructor(subActionInterface: SubActionInterface)
  + toObject(): SubActionInterface
}

interface LayoutInterface extends BaseLayoutInterface {
  creationDate: number;
  updateDate: number;
  isDefault: boolean;
  keys: KeyInterface[];
  systemLayoutId: string;
  isHid: boolean;
  isFactory: boolean;
  isMac: boolean;
}


interface ExportableLayoutInterface {
  imageType: number;
  keys: {};
  linkApplicationPath: string[];
  font: {};
  title: string;
  subtitle: string;
  isDarkMode: boolean;
  linkApplicationEnable: boolean;
  isMac: boolean;
}

interface BaseLayoutInterface {
  id: string;
  index: number;
  title: string;
  subtitle: string;
  linkApplicationPath: string[];
  linkApplicationEnable: boolean;
  isDarkMode: boolean;
  associatedId: string | null;
  isEnable: boolean;
  categoryId: number;
  font: FontInterface;
  imageType: number;
  augmentedHidEnable: boolean;
}

interface ActionInterface {
  display: string;
  modifier: number;
  subactions: SubActionInterface[];
  isgrey: boolean;
}

interface SubActionInterface {
  data: string;
  type: number;
}


Layout "1" *-- "1..*" Key
Layout --> Font
Key "1" *-- "1..*" Action
Action "1" *-- "1..*" SubAction

@enduml