import {DataPersisterArgs, DataProviderArgs} from "~/types/interfaces";

export default class TypesTesting {
  /**
   * Test si l'argument est bien de type DataProviderArgs
   * @param args
   */
  public static isDataProviderArgs (args: DataProviderArgs|DataPersisterArgs): args is DataProviderArgs {
    return (args as DataProviderArgs).imgArgs !== undefined
        || (args as DataProviderArgs).listArgs !== undefined
  }

  /**
   * Test si l'argument est bien de type DataPersister
   * @param args
   */
  public static isDataPersisterArgs (args: DataProviderArgs|DataPersisterArgs): args is DataPersisterArgs {
    return (args as DataPersisterArgs).data !== undefined
  }
}
