@drskillissue/ganko 0.2.6 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -215,6 +215,13 @@ declare class TypeResolver {
215
215
  * Detects Array<T>, T[], ReadonlyArray<T>, and tuple types.
216
216
  */
217
217
  isArrayType(node: ts.Node): boolean;
218
+ /**
219
+ * Strict array check: only matches Array<T>, T[], ReadonlyArray<T>, and tuples.
220
+ * Does NOT match typed arrays (Uint8Array, Buffer, etc.) or other types with
221
+ * a numeric index signature.
222
+ */
223
+ isStrictArrayType(node: ts.Node): boolean;
224
+ private checkIsStrictArrayType;
218
225
  private checkIsArrayType;
219
226
  /**
220
227
  * Check if a node's type is callable (has call signatures).
@@ -1615,7 +1622,7 @@ interface TailwindValidator {
1615
1622
  declare function resolveTailwindValidator(files: readonly {
1616
1623
  path: string;
1617
1624
  content: string;
1618
- }[]): Promise<TailwindValidator | null>;
1625
+ }[], logger?: Logger): Promise<TailwindValidator | null>;
1619
1626
 
1620
1627
  /**
1621
1628
  * CSSInput - Input type for building CSSGraph from CSS/SCSS source files.
@@ -2024,8 +2031,40 @@ interface SelectorAttributeConstraint {
2024
2031
  value: string | null;
2025
2032
  caseInsensitive: boolean;
2026
2033
  }
2034
+ interface NthPattern {
2035
+ readonly step: number;
2036
+ readonly offset: number;
2037
+ }
2038
+ declare const enum PseudoConstraintKind {
2039
+ Simple = 0,
2040
+ FirstChild = 1,
2041
+ LastChild = 2,
2042
+ OnlyChild = 3,
2043
+ NthChild = 4,
2044
+ NthLastChild = 5,
2045
+ NthOfType = 6,
2046
+ NthLastOfType = 7,
2047
+ MatchesAny = 8,
2048
+ NoneOf = 9
2049
+ }
2050
+ interface ParsedPseudoConstraint {
2051
+ readonly name: string;
2052
+ readonly raw: string;
2053
+ readonly kind: PseudoConstraintKind;
2054
+ readonly nthPattern: NthPattern | null;
2055
+ readonly nestedCompounds: readonly SelectorCompound[][] | null;
2056
+ }
2057
+ interface SelectorCompound {
2058
+ readonly parts: readonly SelectorPart[];
2059
+ readonly tagName: string | null;
2060
+ readonly idValue: string | null;
2061
+ readonly classes: readonly string[];
2062
+ readonly attributes: readonly SelectorAttributeConstraint[];
2063
+ readonly pseudoClasses: readonly ParsedPseudoConstraint[];
2064
+ }
2027
2065
  interface SelectorAnchor {
2028
2066
  subjectTag: string | null;
2067
+ idValue: string | null;
2029
2068
  classes: readonly string[];
2030
2069
  attributes: readonly SelectorAttributeConstraint[];
2031
2070
  includesDescendantCombinator: boolean;
@@ -2055,6 +2094,8 @@ interface SelectorEntity {
2055
2094
  specificity: Specificity;
2056
2095
  specificityScore: number;
2057
2096
  complexity: SelectorComplexity;
2097
+ compounds: readonly SelectorCompound[];
2098
+ combinators: readonly CombinatorType[];
2058
2099
  parts: SelectorPart[];
2059
2100
  anchor: SelectorAnchor;
2060
2101
  overrides: SelectorEntity[];
@@ -2286,7 +2327,8 @@ declare class CSSGraph {
2286
2327
  readonly parseErrors: CSSParseError[];
2287
2328
  readonly failedFilePaths: string[];
2288
2329
  readonly tokenCategories: TokenCategory[];
2289
- readonly filesWithLayers: Set<string>;
2330
+ private _filesWithLayers;
2331
+ get filesWithLayers(): ReadonlySet<string>;
2290
2332
  readonly selectorsByPseudoClass: Map<string, SelectorEntity[]>;
2291
2333
  readonly knownKeyframeNames: Set<string>;
2292
2334
  readonly unresolvedAnimationRefs: UnresolvedAnimationRef[];
@@ -2298,17 +2340,14 @@ declare class CSSGraph {
2298
2340
  readonly multiDeclarationProperties: Map<string, readonly DeclarationEntity[]>;
2299
2341
  /** Declarations whose parent rule is inside a @keyframes block. */
2300
2342
  readonly keyframeDeclarations: DeclarationEntity[];
2301
- /** Rules with zero declarations and zero nested rules. */
2302
- readonly emptyRules: RuleEntity[];
2343
+ /** Rules with zero declarations, zero nested rules, and zero nested at-rules. */
2344
+ private _emptyRules;
2345
+ get emptyRules(): readonly RuleEntity[];
2303
2346
  /** @keyframes at-rules with no effective keyframe declarations. */
2304
- readonly emptyKeyframes: AtRuleEntity[];
2305
- readonly colorDeclarations: DeclarationEntity[];
2306
- readonly calcDeclarations: DeclarationEntity[];
2307
- readonly varDeclarations: DeclarationEntity[];
2308
- readonly urlDeclarations: DeclarationEntity[];
2309
- readonly vendorPrefixedDeclarations: DeclarationEntity[];
2310
- readonly hardcodedColorDeclarations: DeclarationEntity[];
2311
- readonly overqualifiedSelectors: SelectorEntity[];
2347
+ private _emptyKeyframes;
2348
+ get emptyKeyframes(): readonly AtRuleEntity[];
2349
+ private _overqualifiedSelectors;
2350
+ get overqualifiedSelectors(): readonly SelectorEntity[];
2312
2351
  readonly idSelectors: SelectorEntity[];
2313
2352
  readonly attributeSelectors: SelectorEntity[];
2314
2353
  readonly universalSelectors: SelectorEntity[];
@@ -2324,7 +2363,8 @@ declare class CSSGraph {
2324
2363
  readonly usedFontFamilies: Set<string>;
2325
2364
  /** Tailwind validator for utility class lookup (null if not a Tailwind project). */
2326
2365
  readonly tailwind: TailwindValidator | null;
2327
- readonly deepNestedRules: RuleEntity[];
2366
+ private _deepNestedRules;
2367
+ get deepNestedRules(): readonly RuleEntity[];
2328
2368
  constructor(input: CSSInput);
2329
2369
  intern(s: string): string;
2330
2370
  nextFileId(): number;
@@ -2370,37 +2410,16 @@ declare class CSSGraph {
2370
2410
  * Called after all phases complete.
2371
2411
  */
2372
2412
  buildDerivedIndexes(): void;
2373
- private buildRuleDeclarationIndexes;
2374
2413
  private buildContainingMediaStacks;
2375
- private buildKeyframeIndex;
2414
+ private buildKeyframeIndexes;
2376
2415
  private buildContainerNameIndexes;
2377
- private buildElementKinds;
2378
- private buildFilesWithLayers;
2379
- private buildSelectorPseudoClassIndex;
2380
2416
  /**
2381
2417
  * Sort each declarationsByProperty list by sourceOrder and populate
2382
2418
  * multiDeclarationProperties with only those having 2+ entries.
2383
2419
  */
2384
2420
  private buildMultiDeclarationProperties;
2385
- /**
2386
- * Collect declarations whose parent rule is inside a @keyframes block.
2387
- */
2388
- private buildKeyframeDeclarations;
2389
- private buildKeyframeLayoutMutationsByName;
2390
- /**
2391
- * Collect rules with no declarations and no nested rules.
2392
- */
2393
- private buildEmptyRules;
2394
- /**
2395
- * Collect @keyframes with no effective keyframe declarations.
2396
- */
2397
- private buildEmptyKeyframes;
2398
- private buildDeclarationDerivedIndexes;
2399
- private buildSelectorDerivedIndexes;
2400
2421
  private buildLayoutPropertiesByClassToken;
2401
- private buildFontFamilyUsageByRule;
2402
- private buildFontFaceDescriptorsByFamily;
2403
- private buildRuleDerivedIndexes;
2422
+ private buildFontIndexes;
2404
2423
  buildUnusedIndexes(): void;
2405
2424
  }
2406
2425
 
@@ -2526,18 +2545,26 @@ declare const enum LayoutSignalUnit {
2526
2545
  Keyword = 2,
2527
2546
  Unknown = 3
2528
2547
  }
2548
+ declare const enum SignalValueKind {
2549
+ Known = 0,
2550
+ Unknown = 1
2551
+ }
2552
+ declare const enum SignalQuality {
2553
+ Exact = 0,
2554
+ Estimated = 1
2555
+ }
2529
2556
  interface LayoutKnownSignalValue {
2530
- readonly kind: "known";
2557
+ readonly kind: SignalValueKind.Known;
2531
2558
  readonly name: LayoutSignalName;
2532
2559
  readonly normalized: string;
2533
2560
  readonly source: LayoutSignalSource;
2534
2561
  readonly guard: LayoutRuleGuard;
2535
2562
  readonly unit: LayoutSignalUnit;
2536
2563
  readonly px: number | null;
2537
- readonly quality: "exact" | "estimated";
2564
+ readonly quality: SignalQuality;
2538
2565
  }
2539
2566
  interface LayoutUnknownSignalValue {
2540
- readonly kind: "unknown";
2567
+ readonly kind: SignalValueKind.Unknown;
2541
2568
  readonly name: LayoutSignalName;
2542
2569
  readonly source: LayoutSignalSource | null;
2543
2570
  readonly guard: LayoutRuleGuard;
@@ -2775,10 +2802,10 @@ type LayoutReservedSpaceReason = "height" | "block-size" | "min-height" | "min-b
2775
2802
  interface LayoutReservedSpaceFact {
2776
2803
  readonly hasReservedSpace: boolean;
2777
2804
  readonly reasons: readonly LayoutReservedSpaceReason[];
2778
- readonly hasUsableInlineDimension: boolean;
2779
- readonly hasUsableBlockDimension: boolean;
2780
2805
  readonly hasContainIntrinsicSize: boolean;
2781
2806
  readonly hasUsableAspectRatio: boolean;
2807
+ readonly hasDeclaredInlineDimension: boolean;
2808
+ readonly hasDeclaredBlockDimension: boolean;
2782
2809
  }
2783
2810
  declare const enum LayoutScrollAxis {
2784
2811
  None = 0,
@@ -2836,38 +2863,35 @@ interface LayoutNormalizedRuleDeclaration {
2836
2863
  readonly startColumn: number;
2837
2864
  readonly propertyLength: number;
2838
2865
  }
2839
- interface LayoutGraphTopology {
2866
+ interface LayoutElementRecord {
2867
+ readonly ref: LayoutElementRef | null;
2868
+ readonly edges: readonly LayoutMatchEdge[];
2869
+ readonly cascade: ReadonlyMap<string, LayoutCascadedDeclaration>;
2870
+ readonly snapshot: LayoutSignalSnapshot;
2871
+ readonly hotSignals: LayoutSnapshotHotSignals;
2872
+ readonly reservedSpace: LayoutReservedSpaceFact;
2873
+ readonly scrollContainer: LayoutScrollContainerFact;
2874
+ readonly flowParticipation: LayoutFlowParticipationFact;
2875
+ readonly containingBlock: LayoutContainingBlockFact;
2876
+ readonly conditionalDelta: ReadonlyMap<LayoutSignalName, LayoutConditionalSignalDeltaFact> | null;
2877
+ readonly baselineOffsets: ReadonlyMap<LayoutSignalName, readonly number[]> | null;
2878
+ }
2879
+ interface LayoutGraph {
2840
2880
  readonly elements: readonly LayoutElementNode[];
2841
2881
  readonly childrenByParentNode: ReadonlyMap<LayoutElementNode, readonly LayoutElementNode[]>;
2842
2882
  readonly elementBySolidFileAndId: ReadonlyMap<string, ReadonlyMap<number, LayoutElementNode>>;
2843
2883
  readonly elementRefsBySolidFileAndId: ReadonlyMap<string, ReadonlyMap<number, LayoutElementRef>>;
2844
2884
  readonly elementsByTagName: ReadonlyMap<string, readonly LayoutElementNode[]>;
2845
2885
  readonly measurementNodeByRootKey: ReadonlyMap<string, LayoutElementNode>;
2846
- }
2847
- interface LayoutGraphCascade {
2886
+ readonly hostElementRefsByNode: ReadonlyMap<LayoutElementNode, LayoutElementRef>;
2848
2887
  readonly styleRules: readonly LayoutStyleRuleNode[];
2849
2888
  readonly applies: readonly LayoutMatchEdge[];
2850
2889
  readonly cssScopeBySolidFile: ReadonlyMap<string, readonly string[]>;
2851
- readonly appliesByNode: ReadonlyMap<LayoutElementNode, readonly LayoutMatchEdge[]>;
2852
2890
  readonly selectorCandidatesByNode: ReadonlyMap<LayoutElementNode, readonly number[]>;
2853
2891
  readonly selectorsById: ReadonlyMap<number, SelectorEntity>;
2854
- readonly cascadeByElementNode: WeakMap<LayoutElementNode, ReadonlyMap<string, LayoutCascadedDeclaration>>;
2855
- readonly snapshotByElementNode: WeakMap<LayoutElementNode, LayoutSignalSnapshot>;
2856
- readonly snapshotHotSignalsByNode: ReadonlyMap<LayoutElementNode, LayoutSnapshotHotSignals>;
2857
- }
2858
- interface LayoutGraphFacts {
2859
- readonly reservedSpaceFactsByNode: ReadonlyMap<LayoutElementNode, LayoutReservedSpaceFact>;
2860
- readonly scrollContainerFactsByNode: ReadonlyMap<LayoutElementNode, LayoutScrollContainerFact>;
2861
- readonly flowParticipationFactsByNode: ReadonlyMap<LayoutElementNode, LayoutFlowParticipationFact>;
2862
- readonly containingBlockFactsByNode: ReadonlyMap<LayoutElementNode, LayoutContainingBlockFact>;
2863
- readonly conditionalSignalDeltaFactsByNode: ReadonlyMap<LayoutElementNode, ReadonlyMap<LayoutSignalName, LayoutConditionalSignalDeltaFact>>;
2864
- readonly baselineOffsetFactsByNode: ReadonlyMap<LayoutElementNode, ReadonlyMap<LayoutSignalName, readonly number[]>>;
2865
- }
2866
- interface LayoutGraphCohorts {
2892
+ readonly records: ReadonlyMap<LayoutElementNode, LayoutElementRecord>;
2867
2893
  readonly cohortStatsByParentNode: ReadonlyMap<LayoutElementNode, LayoutCohortStats>;
2868
2894
  readonly contextByParentNode: ReadonlyMap<LayoutElementNode, AlignmentContext>;
2869
- }
2870
- interface LayoutGraphIndexes {
2871
2895
  readonly elementsWithConditionalDeltaBySignal: ReadonlyMap<LayoutSignalName, readonly LayoutElementNode[]>;
2872
2896
  readonly elementsWithConditionalOverflowDelta: readonly LayoutElementNode[];
2873
2897
  readonly elementsWithConditionalOffsetDelta: readonly LayoutElementNode[];
@@ -2877,8 +2901,6 @@ interface LayoutGraphIndexes {
2877
2901
  readonly statefulSelectorEntriesByRuleId: ReadonlyMap<number, readonly LayoutStatefulSelectorEntry[]>;
2878
2902
  readonly statefulNormalizedDeclarationsByRuleId: ReadonlyMap<number, readonly LayoutNormalizedRuleDeclaration[]>;
2879
2903
  readonly statefulBaseValueIndex: ReadonlyMap<string, ReadonlyMap<string, ReadonlySet<string>>>;
2880
- }
2881
- interface LayoutGraph extends LayoutGraphTopology, LayoutGraphCascade, LayoutGraphFacts, LayoutGraphCohorts, LayoutGraphIndexes {
2882
2904
  readonly perf: LayoutPerfStatsMutable;
2883
2905
  }
2884
2906
 
@@ -3131,8 +3153,8 @@ declare function scanDependencyCustomProperties(projectRoot: string): ReadonlySe
3131
3153
  * W3C Low Vision Needs.
3132
3154
  */
3133
3155
 
3134
- /** Set the active policy for all policy rules. */
3135
- declare function setActivePolicy(name: string): void;
3156
+ /** Set the active policy for all policy rules. Pass null to disable. */
3157
+ declare function setActivePolicy(name: string | null): void;
3136
3158
 
3137
3159
  declare function buildLayoutGraph(solids: readonly SolidGraph[], css: CSSGraph, logger?: Logger): LayoutGraph;
3138
3160
 
package/dist/index.d.ts CHANGED
@@ -215,6 +215,13 @@ declare class TypeResolver {
215
215
  * Detects Array<T>, T[], ReadonlyArray<T>, and tuple types.
216
216
  */
217
217
  isArrayType(node: ts.Node): boolean;
218
+ /**
219
+ * Strict array check: only matches Array<T>, T[], ReadonlyArray<T>, and tuples.
220
+ * Does NOT match typed arrays (Uint8Array, Buffer, etc.) or other types with
221
+ * a numeric index signature.
222
+ */
223
+ isStrictArrayType(node: ts.Node): boolean;
224
+ private checkIsStrictArrayType;
218
225
  private checkIsArrayType;
219
226
  /**
220
227
  * Check if a node's type is callable (has call signatures).
@@ -1615,7 +1622,7 @@ interface TailwindValidator {
1615
1622
  declare function resolveTailwindValidator(files: readonly {
1616
1623
  path: string;
1617
1624
  content: string;
1618
- }[]): Promise<TailwindValidator | null>;
1625
+ }[], logger?: Logger): Promise<TailwindValidator | null>;
1619
1626
 
1620
1627
  /**
1621
1628
  * CSSInput - Input type for building CSSGraph from CSS/SCSS source files.
@@ -2024,8 +2031,40 @@ interface SelectorAttributeConstraint {
2024
2031
  value: string | null;
2025
2032
  caseInsensitive: boolean;
2026
2033
  }
2034
+ interface NthPattern {
2035
+ readonly step: number;
2036
+ readonly offset: number;
2037
+ }
2038
+ declare const enum PseudoConstraintKind {
2039
+ Simple = 0,
2040
+ FirstChild = 1,
2041
+ LastChild = 2,
2042
+ OnlyChild = 3,
2043
+ NthChild = 4,
2044
+ NthLastChild = 5,
2045
+ NthOfType = 6,
2046
+ NthLastOfType = 7,
2047
+ MatchesAny = 8,
2048
+ NoneOf = 9
2049
+ }
2050
+ interface ParsedPseudoConstraint {
2051
+ readonly name: string;
2052
+ readonly raw: string;
2053
+ readonly kind: PseudoConstraintKind;
2054
+ readonly nthPattern: NthPattern | null;
2055
+ readonly nestedCompounds: readonly SelectorCompound[][] | null;
2056
+ }
2057
+ interface SelectorCompound {
2058
+ readonly parts: readonly SelectorPart[];
2059
+ readonly tagName: string | null;
2060
+ readonly idValue: string | null;
2061
+ readonly classes: readonly string[];
2062
+ readonly attributes: readonly SelectorAttributeConstraint[];
2063
+ readonly pseudoClasses: readonly ParsedPseudoConstraint[];
2064
+ }
2027
2065
  interface SelectorAnchor {
2028
2066
  subjectTag: string | null;
2067
+ idValue: string | null;
2029
2068
  classes: readonly string[];
2030
2069
  attributes: readonly SelectorAttributeConstraint[];
2031
2070
  includesDescendantCombinator: boolean;
@@ -2055,6 +2094,8 @@ interface SelectorEntity {
2055
2094
  specificity: Specificity;
2056
2095
  specificityScore: number;
2057
2096
  complexity: SelectorComplexity;
2097
+ compounds: readonly SelectorCompound[];
2098
+ combinators: readonly CombinatorType[];
2058
2099
  parts: SelectorPart[];
2059
2100
  anchor: SelectorAnchor;
2060
2101
  overrides: SelectorEntity[];
@@ -2286,7 +2327,8 @@ declare class CSSGraph {
2286
2327
  readonly parseErrors: CSSParseError[];
2287
2328
  readonly failedFilePaths: string[];
2288
2329
  readonly tokenCategories: TokenCategory[];
2289
- readonly filesWithLayers: Set<string>;
2330
+ private _filesWithLayers;
2331
+ get filesWithLayers(): ReadonlySet<string>;
2290
2332
  readonly selectorsByPseudoClass: Map<string, SelectorEntity[]>;
2291
2333
  readonly knownKeyframeNames: Set<string>;
2292
2334
  readonly unresolvedAnimationRefs: UnresolvedAnimationRef[];
@@ -2298,17 +2340,14 @@ declare class CSSGraph {
2298
2340
  readonly multiDeclarationProperties: Map<string, readonly DeclarationEntity[]>;
2299
2341
  /** Declarations whose parent rule is inside a @keyframes block. */
2300
2342
  readonly keyframeDeclarations: DeclarationEntity[];
2301
- /** Rules with zero declarations and zero nested rules. */
2302
- readonly emptyRules: RuleEntity[];
2343
+ /** Rules with zero declarations, zero nested rules, and zero nested at-rules. */
2344
+ private _emptyRules;
2345
+ get emptyRules(): readonly RuleEntity[];
2303
2346
  /** @keyframes at-rules with no effective keyframe declarations. */
2304
- readonly emptyKeyframes: AtRuleEntity[];
2305
- readonly colorDeclarations: DeclarationEntity[];
2306
- readonly calcDeclarations: DeclarationEntity[];
2307
- readonly varDeclarations: DeclarationEntity[];
2308
- readonly urlDeclarations: DeclarationEntity[];
2309
- readonly vendorPrefixedDeclarations: DeclarationEntity[];
2310
- readonly hardcodedColorDeclarations: DeclarationEntity[];
2311
- readonly overqualifiedSelectors: SelectorEntity[];
2347
+ private _emptyKeyframes;
2348
+ get emptyKeyframes(): readonly AtRuleEntity[];
2349
+ private _overqualifiedSelectors;
2350
+ get overqualifiedSelectors(): readonly SelectorEntity[];
2312
2351
  readonly idSelectors: SelectorEntity[];
2313
2352
  readonly attributeSelectors: SelectorEntity[];
2314
2353
  readonly universalSelectors: SelectorEntity[];
@@ -2324,7 +2363,8 @@ declare class CSSGraph {
2324
2363
  readonly usedFontFamilies: Set<string>;
2325
2364
  /** Tailwind validator for utility class lookup (null if not a Tailwind project). */
2326
2365
  readonly tailwind: TailwindValidator | null;
2327
- readonly deepNestedRules: RuleEntity[];
2366
+ private _deepNestedRules;
2367
+ get deepNestedRules(): readonly RuleEntity[];
2328
2368
  constructor(input: CSSInput);
2329
2369
  intern(s: string): string;
2330
2370
  nextFileId(): number;
@@ -2370,37 +2410,16 @@ declare class CSSGraph {
2370
2410
  * Called after all phases complete.
2371
2411
  */
2372
2412
  buildDerivedIndexes(): void;
2373
- private buildRuleDeclarationIndexes;
2374
2413
  private buildContainingMediaStacks;
2375
- private buildKeyframeIndex;
2414
+ private buildKeyframeIndexes;
2376
2415
  private buildContainerNameIndexes;
2377
- private buildElementKinds;
2378
- private buildFilesWithLayers;
2379
- private buildSelectorPseudoClassIndex;
2380
2416
  /**
2381
2417
  * Sort each declarationsByProperty list by sourceOrder and populate
2382
2418
  * multiDeclarationProperties with only those having 2+ entries.
2383
2419
  */
2384
2420
  private buildMultiDeclarationProperties;
2385
- /**
2386
- * Collect declarations whose parent rule is inside a @keyframes block.
2387
- */
2388
- private buildKeyframeDeclarations;
2389
- private buildKeyframeLayoutMutationsByName;
2390
- /**
2391
- * Collect rules with no declarations and no nested rules.
2392
- */
2393
- private buildEmptyRules;
2394
- /**
2395
- * Collect @keyframes with no effective keyframe declarations.
2396
- */
2397
- private buildEmptyKeyframes;
2398
- private buildDeclarationDerivedIndexes;
2399
- private buildSelectorDerivedIndexes;
2400
2421
  private buildLayoutPropertiesByClassToken;
2401
- private buildFontFamilyUsageByRule;
2402
- private buildFontFaceDescriptorsByFamily;
2403
- private buildRuleDerivedIndexes;
2422
+ private buildFontIndexes;
2404
2423
  buildUnusedIndexes(): void;
2405
2424
  }
2406
2425
 
@@ -2526,18 +2545,26 @@ declare const enum LayoutSignalUnit {
2526
2545
  Keyword = 2,
2527
2546
  Unknown = 3
2528
2547
  }
2548
+ declare const enum SignalValueKind {
2549
+ Known = 0,
2550
+ Unknown = 1
2551
+ }
2552
+ declare const enum SignalQuality {
2553
+ Exact = 0,
2554
+ Estimated = 1
2555
+ }
2529
2556
  interface LayoutKnownSignalValue {
2530
- readonly kind: "known";
2557
+ readonly kind: SignalValueKind.Known;
2531
2558
  readonly name: LayoutSignalName;
2532
2559
  readonly normalized: string;
2533
2560
  readonly source: LayoutSignalSource;
2534
2561
  readonly guard: LayoutRuleGuard;
2535
2562
  readonly unit: LayoutSignalUnit;
2536
2563
  readonly px: number | null;
2537
- readonly quality: "exact" | "estimated";
2564
+ readonly quality: SignalQuality;
2538
2565
  }
2539
2566
  interface LayoutUnknownSignalValue {
2540
- readonly kind: "unknown";
2567
+ readonly kind: SignalValueKind.Unknown;
2541
2568
  readonly name: LayoutSignalName;
2542
2569
  readonly source: LayoutSignalSource | null;
2543
2570
  readonly guard: LayoutRuleGuard;
@@ -2775,10 +2802,10 @@ type LayoutReservedSpaceReason = "height" | "block-size" | "min-height" | "min-b
2775
2802
  interface LayoutReservedSpaceFact {
2776
2803
  readonly hasReservedSpace: boolean;
2777
2804
  readonly reasons: readonly LayoutReservedSpaceReason[];
2778
- readonly hasUsableInlineDimension: boolean;
2779
- readonly hasUsableBlockDimension: boolean;
2780
2805
  readonly hasContainIntrinsicSize: boolean;
2781
2806
  readonly hasUsableAspectRatio: boolean;
2807
+ readonly hasDeclaredInlineDimension: boolean;
2808
+ readonly hasDeclaredBlockDimension: boolean;
2782
2809
  }
2783
2810
  declare const enum LayoutScrollAxis {
2784
2811
  None = 0,
@@ -2836,38 +2863,35 @@ interface LayoutNormalizedRuleDeclaration {
2836
2863
  readonly startColumn: number;
2837
2864
  readonly propertyLength: number;
2838
2865
  }
2839
- interface LayoutGraphTopology {
2866
+ interface LayoutElementRecord {
2867
+ readonly ref: LayoutElementRef | null;
2868
+ readonly edges: readonly LayoutMatchEdge[];
2869
+ readonly cascade: ReadonlyMap<string, LayoutCascadedDeclaration>;
2870
+ readonly snapshot: LayoutSignalSnapshot;
2871
+ readonly hotSignals: LayoutSnapshotHotSignals;
2872
+ readonly reservedSpace: LayoutReservedSpaceFact;
2873
+ readonly scrollContainer: LayoutScrollContainerFact;
2874
+ readonly flowParticipation: LayoutFlowParticipationFact;
2875
+ readonly containingBlock: LayoutContainingBlockFact;
2876
+ readonly conditionalDelta: ReadonlyMap<LayoutSignalName, LayoutConditionalSignalDeltaFact> | null;
2877
+ readonly baselineOffsets: ReadonlyMap<LayoutSignalName, readonly number[]> | null;
2878
+ }
2879
+ interface LayoutGraph {
2840
2880
  readonly elements: readonly LayoutElementNode[];
2841
2881
  readonly childrenByParentNode: ReadonlyMap<LayoutElementNode, readonly LayoutElementNode[]>;
2842
2882
  readonly elementBySolidFileAndId: ReadonlyMap<string, ReadonlyMap<number, LayoutElementNode>>;
2843
2883
  readonly elementRefsBySolidFileAndId: ReadonlyMap<string, ReadonlyMap<number, LayoutElementRef>>;
2844
2884
  readonly elementsByTagName: ReadonlyMap<string, readonly LayoutElementNode[]>;
2845
2885
  readonly measurementNodeByRootKey: ReadonlyMap<string, LayoutElementNode>;
2846
- }
2847
- interface LayoutGraphCascade {
2886
+ readonly hostElementRefsByNode: ReadonlyMap<LayoutElementNode, LayoutElementRef>;
2848
2887
  readonly styleRules: readonly LayoutStyleRuleNode[];
2849
2888
  readonly applies: readonly LayoutMatchEdge[];
2850
2889
  readonly cssScopeBySolidFile: ReadonlyMap<string, readonly string[]>;
2851
- readonly appliesByNode: ReadonlyMap<LayoutElementNode, readonly LayoutMatchEdge[]>;
2852
2890
  readonly selectorCandidatesByNode: ReadonlyMap<LayoutElementNode, readonly number[]>;
2853
2891
  readonly selectorsById: ReadonlyMap<number, SelectorEntity>;
2854
- readonly cascadeByElementNode: WeakMap<LayoutElementNode, ReadonlyMap<string, LayoutCascadedDeclaration>>;
2855
- readonly snapshotByElementNode: WeakMap<LayoutElementNode, LayoutSignalSnapshot>;
2856
- readonly snapshotHotSignalsByNode: ReadonlyMap<LayoutElementNode, LayoutSnapshotHotSignals>;
2857
- }
2858
- interface LayoutGraphFacts {
2859
- readonly reservedSpaceFactsByNode: ReadonlyMap<LayoutElementNode, LayoutReservedSpaceFact>;
2860
- readonly scrollContainerFactsByNode: ReadonlyMap<LayoutElementNode, LayoutScrollContainerFact>;
2861
- readonly flowParticipationFactsByNode: ReadonlyMap<LayoutElementNode, LayoutFlowParticipationFact>;
2862
- readonly containingBlockFactsByNode: ReadonlyMap<LayoutElementNode, LayoutContainingBlockFact>;
2863
- readonly conditionalSignalDeltaFactsByNode: ReadonlyMap<LayoutElementNode, ReadonlyMap<LayoutSignalName, LayoutConditionalSignalDeltaFact>>;
2864
- readonly baselineOffsetFactsByNode: ReadonlyMap<LayoutElementNode, ReadonlyMap<LayoutSignalName, readonly number[]>>;
2865
- }
2866
- interface LayoutGraphCohorts {
2892
+ readonly records: ReadonlyMap<LayoutElementNode, LayoutElementRecord>;
2867
2893
  readonly cohortStatsByParentNode: ReadonlyMap<LayoutElementNode, LayoutCohortStats>;
2868
2894
  readonly contextByParentNode: ReadonlyMap<LayoutElementNode, AlignmentContext>;
2869
- }
2870
- interface LayoutGraphIndexes {
2871
2895
  readonly elementsWithConditionalDeltaBySignal: ReadonlyMap<LayoutSignalName, readonly LayoutElementNode[]>;
2872
2896
  readonly elementsWithConditionalOverflowDelta: readonly LayoutElementNode[];
2873
2897
  readonly elementsWithConditionalOffsetDelta: readonly LayoutElementNode[];
@@ -2877,8 +2901,6 @@ interface LayoutGraphIndexes {
2877
2901
  readonly statefulSelectorEntriesByRuleId: ReadonlyMap<number, readonly LayoutStatefulSelectorEntry[]>;
2878
2902
  readonly statefulNormalizedDeclarationsByRuleId: ReadonlyMap<number, readonly LayoutNormalizedRuleDeclaration[]>;
2879
2903
  readonly statefulBaseValueIndex: ReadonlyMap<string, ReadonlyMap<string, ReadonlySet<string>>>;
2880
- }
2881
- interface LayoutGraph extends LayoutGraphTopology, LayoutGraphCascade, LayoutGraphFacts, LayoutGraphCohorts, LayoutGraphIndexes {
2882
2904
  readonly perf: LayoutPerfStatsMutable;
2883
2905
  }
2884
2906
 
@@ -3131,8 +3153,8 @@ declare function scanDependencyCustomProperties(projectRoot: string): ReadonlySe
3131
3153
  * W3C Low Vision Needs.
3132
3154
  */
3133
3155
 
3134
- /** Set the active policy for all policy rules. */
3135
- declare function setActivePolicy(name: string): void;
3156
+ /** Set the active policy for all policy rules. Pass null to disable. */
3157
+ declare function setActivePolicy(name: string | null): void;
3136
3158
 
3137
3159
  declare function buildLayoutGraph(solids: readonly SolidGraph[], css: CSSGraph, logger?: Logger): LayoutGraph;
3138
3160