Skip to content

Class: CssDocIndex

Defined in: packages/index/src/index.ts:242

A queryable view over the parsed records.

Constructors

Constructor

ts
new CssDocIndex(
   records, 
   file?, 
   matcher?, 
   customPropertyValues?, 
   globalPrecedence?): CssDocIndex;

Defined in: packages/index/src/index.ts:254

Parameters

records

RecordInfo[]

file?

string

matcher?

ModifierMatcher

customPropertyValues?

ReadonlyMap<string, string> = ...

globalPrecedence?

"global" | "base"

Returns

CssDocIndex

Properties

customPropertyValues

ts
readonly customPropertyValues: ReadonlyMap<string, string>;

Defined in: packages/index/src/index.ts:248

Every custom property's effective value (--x: value declarations and @property initial-values).


file?

ts
readonly optional file?: string;

Defined in: packages/index/src/index.ts:243


globalPrecedence

ts
readonly globalPrecedence: "global" | "base";

Defined in: packages/index/src/index.ts:250

The precedence model when multiple records define the same modifier.


matcher

ts
readonly matcher: ModifierMatcher;

Defined in: packages/index/src/index.ts:246

The modifier matcher for this index's convention — how members are matched and rendered.


records

ts
readonly records: readonly RecordInfo[];

Defined in: packages/index/src/index.ts:244

Accessors

entries

Get Signature

ts
get entries(): CssDocEntry[];

Defined in: packages/index/src/index.ts:285

Every documented record's model entry.

Returns

CssDocEntry[]

Methods

aliasOf()

ts
aliasOf(base, modifier): 
  | {
  canonical?: string;
  note?: string;
}
  | undefined;

Defined in: packages/index/src/index.ts:393

The alias mapping of a modifier on base, if documented as an alias. Checks both base-specific and global modifiers (applying globalPrecedence logic).

Parameters

base

string

modifier

string

Returns

| { canonical?: string; note?: string; } | undefined


allCustomProperties()

ts
allCustomProperties(): object[];

Defined in: packages/index/src/index.ts:419

Every declared custom property, paired with the record that declares it (for var(...) completion).

Returns

object[]


allFunctions()

ts
allFunctions(): object[];

Defined in: packages/index/src/index.ts:426

Every custom function, paired with its record.

Returns

object[]


animationsFor()

ts
animationsFor(name): CssAnimation[];

Defined in: packages/index/src/index.ts:327

Parameters

name

string

Returns

CssAnimation[]


componentForClass()

ts
componentForClass(className): CssDocEntry | undefined;

Defined in: packages/index/src/index.ts:290

The record whose base class matches className (with or without a leading dot).

Parameters

className

string

Returns

CssDocEntry | undefined


conditionsFor()

ts
conditionsFor(name): CssCondition[];

Defined in: packages/index/src/index.ts:323

Parameters

name

string

Returns

CssCondition[]


customPropertiesFor()

ts
customPropertiesFor(name): CssPropertyDeclared[];

Defined in: packages/index/src/index.ts:311

Parameters

name

string

Returns

CssPropertyDeclared[]


deprecationOf()

ts
deprecationOf(base, modifier): 
  | {
  canonical?: string;
  note?: string;
}
  | undefined;

Defined in: packages/index/src/index.ts:364

The deprecation of a modifier on base, if it is deprecated (including via a * family). Checks both base-specific and global modifiers (applying globalPrecedence logic).

Parameters

base

string

modifier

string

Returns

| { canonical?: string; note?: string; } | undefined


functionsFor()

ts
functionsFor(name): CssFunction[];

Defined in: packages/index/src/index.ts:315

Parameters

name

string

Returns

CssFunction[]


isModifier()

ts
isModifier(base, modifier): boolean;

Defined in: packages/index/src/index.ts:342

Whether modifier (a class token or attribute expression) is a documented modifier of base — an exact match, or an instance of a documented * family (-icon-arrow-icon-*). Checks both base-specific modifiers and global modifiers (applying globalPrecedence logic).

Parameters

base

string

modifier

string

Returns

boolean


location()

ts
location(name, key?): Location | undefined;

Defined in: packages/index/src/index.ts:433

The definition location of a record member (or the record itself), if a span is known.

Parameters

name

string

key?

string = "record"

Returns

Location | undefined


modifiersFor()

ts
modifiersFor(name): CssModifier[];

Defined in: packages/index/src/index.ts:299

Parameters

name

string

Returns

CssModifier[]


partsFor()

ts
partsFor(name): CssPart[];

Defined in: packages/index/src/index.ts:303

Parameters

name

string

Returns

CssPart[]


recordInfo()

ts
recordInfo(name): RecordInfo | undefined;

Defined in: packages/index/src/index.ts:295

The full RecordInfo for a record name.

Parameters

name

string

Returns

RecordInfo | undefined


resolveCustomProperty()

ts
resolveCustomProperty(name): object;

Defined in: packages/index/src/index.ts:277

A custom property's declared value and its fully resolved value — following var() references through the index to a terminal literal, the way browser dev tools do. resolved is omitted when nothing was followed (no var(), or the chain couldn't be resolved further).

Parameters

name

string

Returns

object

declared?
ts
optional declared?: string;
resolved?
ts
optional resolved?: string;

shadowPartsFor()

ts
shadowPartsFor(name): CssPart[];

Defined in: packages/index/src/index.ts:307

Parameters

name

string

Returns

CssPart[]


statesFor()

ts
statesFor(name): CssState[];

Defined in: packages/index/src/index.ts:319

Parameters

name

string

Returns

CssState[]


structureFor()

ts
structureFor(name): StructureNode[] | undefined;

Defined in: packages/index/src/index.ts:331

Parameters

name

string

Returns

StructureNode[] | undefined


structureVariantsFor()

ts
structureVariantsFor(name): 
  | StructureVariant[]
  | undefined;

Defined in: packages/index/src/index.ts:335

Parameters

name

string

Returns

| StructureVariant[] | undefined


toManifest()

ts
toManifest(): CssDocManifest;

Defined in: packages/index/src/index.ts:441

A stable, serializable snapshot.

Returns

CssDocManifest

Released under the MIT License