Class: JsxRosetta::IR::ModuleImport
- Inherits:
-
Data
- Object
- Data
- JsxRosetta::IR::ModuleImport
- Includes:
- Node
- Defined in:
- lib/jsx_rosetta/ir/types.rb
Overview
A top-level ‘import` declaration. Captured at lowering time so the ExpressionTranslator can recognize use-site references and bail out to a TODO instead of emitting a bare snake_case identifier that NameErrors at render time.
name : String — the local binding name (the side the source uses
to reference the imported value). For `import { foo as bar }`
this is "bar"; for `import * as styles` this is "styles";
for `import Default` this is "Default".
source : String — the module specifier verbatim
(e.g. "./styles.module.css", "@apollo/client", "react").
Lets backends apply per-source policy later (e.g. always
strip `*.module.css` references).
kind : Symbol — :default | :named | :namespace. imported_name : String? — original exported name from the source module.
For `import { ChevronRight as CR } from "lucide-react"`,
`name` is `"CR"` and `imported_name` is `"ChevronRight"`.
nil for default / namespace imports where there's no
distinct exported name. Backends that look up vendored
data by canonical name (icons) need the imported name;
most callers want the local binding.
Instance Attribute Summary collapse
-
#imported_name ⇒ Object
readonly
Returns the value of attribute imported_name.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Attribute Details
#imported_name ⇒ Object (readonly)
Returns the value of attribute imported_name
140 141 142 |
# File 'lib/jsx_rosetta/ir/types.rb', line 140 def imported_name @imported_name end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind
140 141 142 |
# File 'lib/jsx_rosetta/ir/types.rb', line 140 def kind @kind end |
#name ⇒ Object (readonly)
Returns the value of attribute name
140 141 142 |
# File 'lib/jsx_rosetta/ir/types.rb', line 140 def name @name end |
#source ⇒ Object (readonly)
Returns the value of attribute source
140 141 142 |
# File 'lib/jsx_rosetta/ir/types.rb', line 140 def source @source end |