import { ComponentValue, IComponentValue } from './component-value';

export type ComponentDetails = Record<string, Record<'componentValues', IComponentValue>>;

export interface IComponentLogEntry {
    name: string;
    originalKey: string;
    componentValues: IComponentValue[];
    overridden?: boolean;
}

export class ComponentLogEntry implements IComponentLogEntry {
    readonly name: string;
    readonly originalKey: string;
    readonly componentValues: ComponentValue[];
    readonly overridden: boolean;

    constructor(entry: IComponentLogEntry) {
        this.name = entry.name;
        this.originalKey = entry.name;
        this.componentValues = entry.componentValues;
        this.overridden = !!entry.overridden;
    }
}
