import { TypedEvent } from "@node-projects/base-custom-webcomponent"; import { IDesignItem } from "../../item/IDesignItem.js"; import { Specificity } from "./SpecificityCalculator.js"; export interface IStyleRule { selector: string; declarations: IStyleDeclaration[]; specificity: Specificity; stylesheetName?: string; stylesheet: IStylesheet; } export interface IStyleDeclaration { name: string; value: string; important: boolean; parent: IStyleRule; stylesheet?: IStylesheet; } export interface IStylesheet { content: string; name: string; readOnly?: boolean; } export interface IDocumentStylesheet extends IStylesheet { designItem: IDesignItem; } export interface IStylesheetService { setStylesheets(stylesheets: IStylesheet[]): Promise; getStylesheets(): IStylesheet[]; getRules(selector: string): IStyleRule[]; setDocumentStylesheets(stylesheets: IDocumentStylesheet[]): Promise; getAppliedRules(designItem: IDesignItem): IStyleRule[]; getDeclarations(designItem: IDesignItem, styleName: string): IStyleDeclaration[]; getDeclarationsSortedBySpecificity(designItem: IDesignItem, styleName: string): IStyleDeclaration[]; updateDeclarationValue(declaration: IStyleDeclaration, value: string, important: boolean): any; updateDeclarationValueWithoutUndo(declaration: IStyleDeclaration, value: string, important: boolean): any; insertDeclarationIntoRule(rule: IStyleRule, property: string, value: string, important: boolean): boolean; removeDeclarationFromRule(rule: IStyleRule, property: string): boolean; updateCompleteStylesheet(name: string, newStyle: string): Promise; updateCompleteStylesheetWithoutUndo(name: string, newStyle: string): Promise; addRule(stylesheet: IStylesheet, selector: string): Promise; stylesheetChanged: TypedEvent<{ name: string; newStyle: string; oldStyle: string; changeSource: 'extern' | 'styleupdate' | 'undo'; }>; stylesheetsChanged: TypedEvent; }