Collection of CSS classes extracted from source files.
Tracks classes per-file for efficient incremental updates.
Handles include/exclude filtering and explicit class tracking.
Uses null instead of empty collections to avoid allocation overhead.
constructor
Creates a new CssClasses collection.
type new (additional_classes?: Set<string> | null, exclude_classes?: Set<string> | null): CssClasses
additional_classes
classes to always include (also treated as explicit for warnings)
Set<string> | nullnullexclude_classes
classes to exclude from output (also suppresses warnings)
Set<string> | nullnulladd
Adds extraction results for a file. Replaces any previous classes and diagnostics for this file.
type (id: string, data: ExtractionData): void
id
file identifier
stringdata
extraction data fields to store for this file
voiddelete
type (id: string): void
id
stringvoidget
Gets all unique class names as a Set (with exclude filter applied).
type (): Set<string>
Set<string>get_with_locations
Gets all classes with their source locations (with exclude filter applied).
Locations from additional_classes are null.
type (): Map<string, SourceLocation[] | null>
Map<string, SourceLocation[] | null>get_all
Gets all classes and their locations in a single call.
More efficient than calling get() and get_with_locations() separately
when both are needed (avoids potential double recalculation).
Results have exclude filter applied and explicit_classes includes additional_classes.
type (): { all_classes: Set<string>; all_classes_with_locations: Map<string, SourceLocation[] | null>; explicit_classes: Set<string> | null; all_elements: Set<...>; explicit_elements: Set<...> | null; explicit_variables: Set<...> | null; }
{ all_classes: Set<string>; all_classes_with_locations: Map<string, SourceLocation[] | null>; explicit_classes: Set<string> | null; all_elements: Set<...>; explicit_elements: Set<...> | null; explicit_variables: Set<...> | null; }get_diagnostics
Gets all extraction diagnostics from all files.
type (): ExtractionDiagnostic[]
ExtractionDiagnostic[]