import { Attr } from "@opticss/element-analysis"; import { ResolvedConfiguration } from "../configuration"; import { AnyNode, Inheritable } from "./Inheritable"; import { RulesetContainer } from "./RulesetContainer"; export { RulesetContainer, Resolution, Ruleset } from "./RulesetContainer"; /** * Abstract class that serves as the base for all Styles. Contains basic * properties and abstract methods that extenders must implement. */ export declare abstract class Style, Root extends Inheritable, Parent extends Inheritable | null, Child extends Inheritable | never, Token extends any = string> extends Inheritable { /** cache of resolveStyles() */ private _resolvedStyles; /** cache of all style aliases */ private _styleAliases; abstract readonly rulesets: RulesetContainer; /** * The preset selector for this particular class node. * This is set when definition files encounter the `block-class` declaration. */ presetCssClass: string | undefined; /** * Save name, parent container, and create the PropertyContainer for this data object. */ constructor(name: string, parent: Parent); /** * Return the css selector for this `Style`. * @param config Option hash configuring output mode. * @returns The CSS class. */ abstract cssClass(config: ResolvedConfiguration, reservedClassNames: Set): string; /** * Return the source selector this `Style` was read from. * @param scope Optional scope to resolve this name relative to. If `true`, return the Block name instead of `:scope`. If a Block object, return with the local name instead of `:scope`. * @returns The source selector. */ abstract asSource(scope?: Root | boolean): string; /** * Return an attribute for analysis using the authored source syntax. */ abstract asSourceAttributes(): Attr[]; /** * Returns all the classes needed to represent this block object * including inherited classes. * @returns this object's css class and all inherited classes. */ cssClasses(config: ResolvedConfiguration, reservedClassNames: Set): string[]; /** * Returns all the classes needed to represent this block object * including inherited classes and block aliases. * @returns this object's css class and all inherited classes. */ cssClassesWithAliases(config: ResolvedConfiguration, reservedClassNames: Set): Set; /** * Adds a set of aliases to the to this object */ setStyleAliases(aliases: Set): void; /** * Set a specific class name for this style node. This is used in definition * files when a specific class is defined using the block-class declaration. * * Setting a class name overrides any default class name that would have * been generated by the node and ignored the current configuration. * * @param selector - The class name to set. */ setPresetClassName(selector: string): void; /** * Returns the aliases on this object */ getStyleAliases(): Set; /** * Return all Block Objects that are implied by this object. * This takes inheritance, attr/class correlations, and any * other declared links between styles into account. * * This Block Object itself is included in the returned result * so the resolved value's size is always 1 or greater. */ resolveStyles(): Set; /** * Debug utility to help log Styles * @param config Options for rendering cssClass. * @returns A debug string. */ asDebug(config: ResolvedConfiguration): string; } //# sourceMappingURL=Style.d.ts.map