message: refactor: add types to persistant map
diff: @@ -2,7 +2,7 @@ import IIdentifiable from '../Identifiable.interface';
  import InvalidParameterError from '../errors/InvalidParameterError';
  import IStorage from '@src/Storage.interface';
  -export default class PersistentMap {
  +export default class PersistentMap<Value = any> {
  public static getData(storage: IStorage, ...identifier: string[]) {
  let key = storage.generateKey.apply(storage, identifier);
  @@ -27,14 +27,14 @@ export default class PersistentMap {
  return Object.keys(this.map);
  }
  - public get(id: string, defaultValue?: any) {
  + public get(id: string, defaultValue?: Value): Value {
  let value = this.map[id];
  return typeof value !== 'undefined' ? value : defaultValue;
  }
  - public set(id: string, value: any);
  - public set(value: any);
  + public set(id: string, value: Value): void;
  + public set(value: Value): void;
  public set() {
  if (typeof arguments[0] === 'string') {
  let id = arguments[0];
  @@ -54,15 +54,15 @@ export default class PersistentMap {
  this.save();
  }
  - public remove(id: IIdentifiable);
  - public remove(id: string);
  + public remove(id: IIdentifiable): void;
  + public remove(id: string): void;
  public remove() {
  - let id;
  + let id: string;
  if (typeof arguments[0] === 'string') {
  id = arguments[0];
  } else if (typeof arguments[0].getId === 'function') {
  - id = arguments[0].getId();
  + id = (arguments[0] as IIdentifiable).getId();
  } else {
  throw new InvalidParameterError('I need to know which id do you want to remove');
  }
  @@ -79,8 +79,8 @@ export default class PersistentMap {
  this.storage.removeHook(this.key);
  }
  - public registerHook(id: string, func: (newValue: any, oldValue: any, key: string) => void);
  - public registerHook(func: (newValue: any, oldValue: any, key: string) => void);
  + public registerHook(id: string, func: (newValue: Value, oldValue: Value, key: string) => void): void;
  + public registerHook(func: (newValue: Value, oldValue: Value, key: string) => void): void;
  public registerHook() {
  if (typeof arguments[0] === 'string' && typeof arguments[1] === 'function') {
  let id = arguments[0];
  @@ -100,7 +100,7 @@ export default class PersistentMap {
  }
  }
  - public registerNewHook(func: (value: any, id: string) => void) {
  + public registerNewHook(func: (value: Value, id: string) => void) {
  this.registerHook((newValue, oldValue) => {
  let newValueKeys = Object.keys(newValue || {});
  let oldValueKeys = Object.keys(oldValue || {});
  