Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IAnalysis<K>

Type parameters

  • K: keyof TemplateTypes

Hierarchy

Index

Constructors

constructor

Properties

elements

elements: Map<string, ElementAnalysis<any, any, any>>

A per-element correlation of styles used. The current correlation is added to this list when endElement is called.

idGenerator

idGenerator: IdentGenerator

Optional parent

parent: Analyzer<K>

template

template: TemplateTypes[K]

Methods

addBlock

blockCount

  • blockCount(): number

blockDependencies

  • blockDependencies(): Set<Block>

elementCount

  • elementCount(): number

endElement

  • endElement<BooleanExpression, StringExpression, TernaryExpression>(element: ElementAnalysis<BooleanExpression, StringExpression, TernaryExpression>, endPosition?: SourcePosition): void
  • Finish an {ElementAnalysis} object returned from Analysis.startElement to the end location in source and save {Style} usage on the parent {Analysis}.

    Type parameters

    • BooleanExpression

    • StringExpression

    • TernaryExpression

    Parameters

    • element: ElementAnalysis<BooleanExpression, StringExpression, TernaryExpression>

      The {ElementAnalysis} we are finishing.

    • Optional endPosition: SourcePosition

      Optional. The location in code where this element tag is closed..

    Returns void

forOptimizer

getBlock

  • getBlock(name: string): Block | undefined

getBlockName

  • getBlockName(block: Block): string | null

getElement

  • getElement<BooleanExpression, StringExpression, TernaryExpression>(idx: number): ElementAnalysis<BooleanExpression, StringExpression, TernaryExpression>

getElementById

  • getElementById<BooleanExpression, StringExpression, TernaryExpression>(id: string): ElementAnalysis<BooleanExpression, StringExpression, TernaryExpression> | undefined

referencedBlocks

  • referencedBlocks(): Block[]

serialize

serializedName

  • serializedName(o: Style): string

startElement

  • startElement<BooleanExpression, StringExpression, TernaryExpression>(location: SourceLocation | SourcePosition, tagName?: undefined | string): ElementAnalysis<BooleanExpression, StringExpression, TernaryExpression>
  • Get a new {ElementAnalysis} object to track an individual element's {Style} consumption in this {Analysis}' template. Every {ElementAnalysis} returned from Analysis.startElement must be passed to Analysis.endElement before startElement is called again.

    Type parameters

    • BooleanExpression

    • StringExpression

    • TernaryExpression

    Parameters

    • location: SourceLocation | SourcePosition

      The {SourceLocation} of this element in the template.

    • Optional tagName: undefined | string

      Optional. The tag name of the element being represented by this {ElementAnalysis}.

    Returns ElementAnalysis<BooleanExpression, StringExpression, TernaryExpression>

    A new {ElementAnalysis}.

styleCount

  • styleCount(): number

stylesFound

  • stylesFound(dynamic?: undefined | true | false): IterableIterator<Style>

transitiveBlockDependencies

  • transitiveBlockDependencies(): Set<Block>

Static deserialize

Generated using TypeDoc