import { StatePropertyTypes } from '../../types';
import { IKosDataModel } from '../../../core';


export interface StateBeanOptions {
  path: string;
}

type StateKeys<T extends Record<string, StatePropertyTypes>> = keyof T;
export type StatePropsMap<T> = Map<StateKeys<T>, T[keyof T]>;

/**
 * State Bean Model
 * @category Model
 */
export interface StateBeanModel<
  T extends Record<string, StatePropertyTypes> = any
> extends StateBeanOptions,
    IKosDataModel {
  id: string;
  path: string;
  props: StatePropsMap<T>;
  updateModel(options: StateBeanOptions): void;
}
