import ContextMapper from "./ContextMapper";
import Rule from "./Rule";

export default class CSSContextMapper extends ContextMapper {
    
    constructor(context : string) {
        super(context);
    }

    buildElementToRuleMap() : Map<Element, Rule[]> {
        let cssQueryResult = document.querySelector(this._context);
        if (cssQueryResult) {
            return this.buildElementToRuleMapForSelectors(cssQueryResult);
        } else {
            return new Map();
        }
    }
    
}