import { Attr } from "@opticss/element-analysis"; import { ObjectDictionary } from "@opticss/util"; import { AttrToken } from "../BlockSyntax"; import { ResolvedConfiguration } from "../configuration"; import { AttrValue } from "./AttrValue"; import { Block } from "./Block"; import { BlockClass } from "./BlockClass"; import { Inheritable } from "./Inheritable"; export declare class Attribute extends Inheritable { private _hasValues; private _presenceRule; private _sourceAttributes; protected get ChildConstructor(): typeof AttrValue; protected tokenToUid(token: AttrToken): string; get name(): string; get namespace(): string | null; /** * @returns If this Attribute contains anything but the "presence" AttrValue. **/ get hasValues(): boolean; /** * @returns If this Attribute only contains the "presence" AttrValue. **/ get isBooleanAttribute(): boolean; /** * @returns The "presence" Value, or `undefined`. **/ get presenceRule(): AttrValue | undefined; /** * @returns This Attribute's parent `BlockClass` **/ get blockClass(): BlockClass; /** * @returns An array of all `AttrValue`s contained in this `Attribute`. **/ values(): AttrValue[]; resolvedValues(): AttrValue[]; /** * @returns A hash of all `Value`s contained in this `Attribute`. **/ valuesHash(): ObjectDictionary; resolveValuesHash(): ObjectDictionary; /** * @returns An Map of all `Value`s contained in this `Attribute`. **/ valuesMap(): Map; resolveValuesMap(): Map; /** * Ensures that a AttrValue of name `name` exists in this Attribute. If no * `AttrValue` exists, one is created. If no name is passed, it ensures the * "presence" AttrValue. * @param name string The `AttrValue` name to ensure. * @returns The `AttrValue` **/ ensureValue(name?: string): AttrValue; /** * Get am Attribute's own (read: non-inherited) `AttrValue` of name * `name` from this `Attribute`. If no name is passed, it tries * to retrieve the "presence" AttrValue. * @param name string The name of the `AttrValue` to retrieve. * @returns The `AttrValue` or `undefined`. **/ getValue(name?: string): AttrValue | null; /** * Get am Attribute's own or inherited `AttrValue` of name `name` from this * `Attribute` or its base. If no name is passed, it tries to retrieve * the "presence" AttrValue. * @param name string The name of the `AttrValue` to retrieve. * @returns The `AttrValue` or `undefined`. **/ resolveValue(name?: string): AttrValue | null; /** * @returns whether this Attribute has any Values defined, directly or inherited. */ hasResolvedValues(): boolean; /** * Resolves all AttrValues from this Attribute's inheritance * chain. * @returns All AttrValues this Attribute contains. */ resolveValues(): Map; /** * Retrieve this Attribute's selector as it appears in the Block source code. * * @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 Attribute's attribute selector. */ asSource(scope?: Block | boolean): string; /** * Emit analysis attributes for the `AttrValue`s this * `Attribute` represents in their authored source format. */ asSourceAttributes(): Attr[]; /** * Export as new class name. * @param config Option hash configuring output mode. * @returns String representing output class. */ cssClass(config: ResolvedConfiguration, reservedClassNames: Set): string; /** * Return array self and all children. * @returns Array of Styles. */ all(): Attribute[]; } /** * @param o object The object to test. * @returns If the supplied object `o` is a `Attribute`. */ export declare function isAttribute(o: object): o is Attribute; //# sourceMappingURL=Attribute.d.ts.map