@arcmantle/lit-jsx / compiler/import-discovery
compiler/import-discovery
Classes
ImportDiscovery
Defined in: compiler/import-discovery.ts:10
Constructors
Constructor
new ImportDiscovery():
ImportDiscovery
Returns
Properties
programCache
readonlystaticprogramCache:Map<string,NodePath<Program>>
Defined in: compiler/import-discovery.ts:12
resolvedCache
readonlystaticresolvedCache:Map<string,Map<string,boolean>>
Defined in: compiler/import-discovery.ts:13
Methods
followExportChain()
protectedfollowExportChain(programPath,importedName): {binding:Binding;programPath:NodePath<Program>; } |undefined
Defined in: compiler/import-discovery.ts:249
Parameters
programPath
NodePath<Program>
importedName
string
Returns
{ binding: Binding; programPath: NodePath<Program>; } | undefined
getProgramPathFromFile()
protectedgetProgramPathFromFile(filePath):NodePath<Program> |undefined
Defined in: compiler/import-discovery.ts:336
Parameters
filePath
string
Returns
NodePath<Program> | undefined
isClass()
protectedisClass(programPath,binding):boolean
Defined in: compiler/import-discovery.ts:88
Recursively follows a binding to determine if it resolves to a class (not a string literal).
Parameters
programPath
NodePath<Program>
binding
Binding
Returns
boolean
isClassByImportDiscovery()
isClassByImportDiscovery(
path):boolean
Defined in: compiler/import-discovery.ts:64
Checks if a JSX element is specifically a class (not a string literal). Returns true only for class declarations/expressions, false otherwise. Used to determine if .tagName accessor should be used.
Parameters
path
NodePath
Returns
boolean
isClassOrStringLiteral()
protectedisClassOrStringLiteral(programPath,binding):boolean
Defined in: compiler/import-discovery.ts:164
Recursively follows a binding to determine if it resolves to a class or string literal.
Parameters
programPath
NodePath<Program>
binding
Binding
Returns
boolean
isDynamicOrCustomELement()
isDynamicOrCustomELement(
path):boolean
Defined in: compiler/import-discovery.ts:24
Checks if a JSX element is a class (custom element) or string literal (static element). Returns true if it's a custom element (class) or static element (string literal).
Parameters
path
NodePath
Returns
boolean
resolveSourcePath()
protectedresolveSourcePath(programPath,source):string
Defined in: compiler/import-discovery.ts:350
Parameters
programPath
NodePath<Program>
source
string
Returns
string
clearCacheForFile()
staticclearCacheForFile(filePath):void
Defined in: compiler/import-discovery.ts:15
Parameters
filePath
string
Returns
void
Functions
isClassByImportDiscovery()
isClassByImportDiscovery(...
args):boolean
Defined in: compiler/import-discovery.ts:372
Parameters
args
...[NodePath<Node>]
Returns
boolean
isDynamicOrCustomElement()
isDynamicOrCustomElement(...
args):boolean
Defined in: compiler/import-discovery.ts:364
Parameters
args
...[NodePath<Node>]
Returns
boolean