import { TypedEvent } from "@node-projects/base-custom-webcomponent";
import { IDesignItem } from '../../item/IDesignItem.js';
import { IDocumentStylesheet, IStyleDeclaration, IStyleRule, IStylesheet, IStylesheetService } from './IStylesheetService.js';
import { InstanceServiceContainer } from "../InstanceServiceContainer.js";
import { IDesignerCanvas } from "../../widgets/designerView/IDesignerCanvas.js";
import { Specificity } from "./SpecificityCalculator.js";
export declare abstract class AbstractStylesheetService implements IStylesheetService {
    protected _stylesheets: Map<string, {
        stylesheet: IStylesheet;
        ast: any;
    }>;
    protected _documentStylesheets: Map<string, {
        stylesheet: IDocumentStylesheet;
        ast: any;
    }>;
    protected _allStylesheets: Map<string, {
        stylesheet: IStylesheet | IDocumentStylesheet;
        ast: any;
    }>;
    protected _instanceServiceContainer: InstanceServiceContainer;
    constructor(designerCanvas: IDesignerCanvas);
    abstract getRules(rule: string): IStyleRule[];
    abstract addRule(stylesheet: IStylesheet, rule: string): Promise<IStyleRule>;
    setStylesheets(stylesheets: IStylesheet[]): Promise<void>;
    setDocumentStylesheets(stylesheets: IDocumentStylesheet[]): Promise<void>;
    internalSetStylesheets(stylesheets: IStylesheet[], targetMap: Map<string, {
        stylesheet: IStylesheet;
        ast: any;
    }>): Promise<void>;
    protected internalReparseStylesheet(name: string): Promise<void>;
    protected abstract internalParse(style: string): Promise<any>;
    getStylesheets(): IStylesheet[];
    abstract getAppliedRules(designItem: IDesignItem): IStyleRule[];
    abstract getDeclarations(designItem: IDesignItem, styleName: string): IStyleDeclaration[];
    getDeclarationsSortedBySpecificity(designItem: IDesignItem, styleName: string): IStyleDeclaration[];
    updateDeclarationValue(declaration: IStyleDeclaration, value: string, important: boolean): void;
    abstract insertDeclarationIntoRule(rule: IStyleRule, property: string, value: string, important: boolean): boolean;
    abstract removeDeclarationFromRule(rule: IStyleRule, property: string): boolean;
    abstract updateCompleteStylesheet(name: string, newStyle: string): any;
    abstract updateCompleteStylesheetWithoutUndo(name: string, newStyle: string): any;
    abstract updateDeclarationValueWithoutUndo(declaration: IStyleDeclaration, value: string, important: boolean): any;
    stylesheetChanged: TypedEvent<{
        name: string;
        newStyle: string;
        oldStyle: string;
        changeSource: "extern" | "styleupdate" | "undo";
    }>;
    stylesheetsChanged: TypedEvent<void>;
    static patchStylesheetSelectorForDesigner(text: string): string;
    protected elementMatchesASelector(designItem: IDesignItem, selectors: string[]): false | Specificity;
}
