---
url: /reference/@cssdoc/index/classes/CssDocIndex.md
---
# Class: CssDocIndex

Defined in: [packages/index/src/index.ts:242](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L242)

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](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L254)

#### Parameters

##### records

[`RecordInfo`](../interfaces/RecordInfo.md)\[]

##### file?

`string`

##### matcher?

[`ModifierMatcher`](../../core/classes/ModifierMatcher.md)

##### customPropertyValues?

`ReadonlyMap`<`string`, `string`> = `...`

##### globalPrecedence?

`"base"` | `"global"`

#### Returns

`CssDocIndex`

## Properties

### customPropertyValues

```ts
readonly customPropertyValues: ReadonlyMap<string, string>;
```

Defined in: [packages/index/src/index.ts:248](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L248)

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](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L243)

***

### globalPrecedence

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

Defined in: [packages/index/src/index.ts:250](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L250)

The precedence model when multiple records define the same modifier.

***

### matcher

```ts
readonly matcher: ModifierMatcher;
```

Defined in: [packages/index/src/index.ts:246](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L246)

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](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L244)

## Accessors

### entries

#### Get Signature

```ts
get entries(): CssDocEntry[];
```

Defined in: [packages/index/src/index.ts:285](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L285)

Every documented record's model entry.

##### Returns

[`CssDocEntry`](../../core/interfaces/CssDocEntry.md)\[]

## Methods

### aliasOf()

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

Defined in: [packages/index/src/index.ts:373](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L373)

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:378](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L378)

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:385](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L385)

Every custom function, paired with its record.

#### Returns

`object`\[]

***

### animationsFor()

```ts
animationsFor(name): CssAnimation[];
```

Defined in: [packages/index/src/index.ts:327](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L327)

#### Parameters

##### name

`string`

#### Returns

[`CssAnimation`](../../core/interfaces/CssAnimation.md)\[]

***

### componentForClass()

```ts
componentForClass(className): CssDocEntry | undefined;
```

Defined in: [packages/index/src/index.ts:290](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L290)

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

#### Parameters

##### className

`string`

#### Returns

[`CssDocEntry`](../../core/interfaces/CssDocEntry.md) | `undefined`

***

### conditionsFor()

```ts
conditionsFor(name): CssCondition[];
```

Defined in: [packages/index/src/index.ts:323](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L323)

#### Parameters

##### name

`string`

#### Returns

[`CssCondition`](../../core/interfaces/CssCondition.md)\[]

***

### customPropertiesFor()

```ts
customPropertiesFor(name): CssPropertyDeclared[];
```

Defined in: [packages/index/src/index.ts:311](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L311)

#### Parameters

##### name

`string`

#### Returns

[`CssPropertyDeclared`](../../core/interfaces/CssPropertyDeclared.md)\[]

***

### deprecationOf()

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

Defined in: [packages/index/src/index.ts:367](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L367)

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](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L315)

#### Parameters

##### name

`string`

#### Returns

[`CssFunction`](../../core/interfaces/CssFunction.md)\[]

***

### isModifier()

```ts
isModifier(base, modifier): boolean;
```

Defined in: [packages/index/src/index.ts:361](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L361)

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.

#### Parameters

##### base

`string`

##### modifier

`string`

#### Returns

`boolean`

***

### location()

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

Defined in: [packages/index/src/index.ts:392](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L392)

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

#### Parameters

##### name

`string`

##### key?

`string` = `"record"`

#### Returns

[`Location`](../interfaces/Location.md) | `undefined`

***

### modifiersFor()

```ts
modifiersFor(name): CssModifier[];
```

Defined in: [packages/index/src/index.ts:299](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L299)

#### Parameters

##### name

`string`

#### Returns

[`CssModifier`](../../core/interfaces/CssModifier.md)\[]

***

### partsFor()

```ts
partsFor(name): CssPart[];
```

Defined in: [packages/index/src/index.ts:303](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L303)

#### Parameters

##### name

`string`

#### Returns

[`CssPart`](../../core/interfaces/CssPart.md)\[]

***

### recordInfo()

```ts
recordInfo(name): RecordInfo | undefined;
```

Defined in: [packages/index/src/index.ts:295](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L295)

The full [RecordInfo](../interfaces/RecordInfo.md) for a record name.

#### Parameters

##### name

`string`

#### Returns

[`RecordInfo`](../interfaces/RecordInfo.md) | `undefined`

***

### resolveCustomProperty()

```ts
resolveCustomProperty(name): object;
```

Defined in: [packages/index/src/index.ts:277](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L277)

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](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L307)

#### Parameters

##### name

`string`

#### Returns

[`CssPart`](../../core/interfaces/CssPart.md)\[]

***

### statesFor()

```ts
statesFor(name): CssState[];
```

Defined in: [packages/index/src/index.ts:319](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L319)

#### Parameters

##### name

`string`

#### Returns

[`CssState`](../../core/interfaces/CssState.md)\[]

***

### structureFor()

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

Defined in: [packages/index/src/index.ts:331](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L331)

#### Parameters

##### name

`string`

#### Returns

[`StructureNode`](../../core/interfaces/StructureNode.md)\[] | `undefined`

***

### structureVariantsFor()

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

Defined in: [packages/index/src/index.ts:335](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L335)

#### Parameters

##### name

`string`

#### Returns

| [`StructureVariant`](../../core/interfaces/StructureVariant.md)\[]
| `undefined`

***

### toManifest()

```ts
toManifest(): CssDocManifest;
```

Defined in: [packages/index/src/index.ts:400](https://github.com/thedannywahl/cssdoc/blob/main/packages/index/src/index.ts#L400)

A stable, serializable snapshot.

#### Returns

[`CssDocManifest`](../interfaces/CssDocManifest.md)
