ImportDeclaration is a top-level ECMAScript import statement. import { z } from "zod" import { Foo as Bar } from "./schemas" import type { Baz } from "./types" import "polyfill" Only the named-imports and side-effect forms are modeled. Default imports (`import foo from "x"`) and namespace impo
| 133 | // (`import foo from "x"`) and namespace imports (`import * as ns from "x"`) |
| 134 | // are not yet supported; add them if you need them. |
| 135 | type ImportDeclaration struct { |
| 136 | // Module is the module specifier (the right-hand side of `from`). |
| 137 | Module string |
| 138 | // Named is the list of imported names. Order is preserved while merging; |
| 139 | // the final emitted order is sorted alphabetically in Serialize. |
| 140 | // Ignored when SideEffect is true. |
| 141 | Named []*ImportSpecifier |
| 142 | // IsTypeOnly emits `import type { ... }` instead of `import { ... }`. |
| 143 | // Ignored when SideEffect is true (`import type "x"` is not valid TS). |
| 144 | IsTypeOnly bool |
| 145 | // SideEffect emits the bare form `import "module"` with no import clause. |
| 146 | // When true, Named and IsTypeOnly are ignored. |
| 147 | SideEffect bool |
| 148 | SupportComments |
| 149 | Source |
| 150 | } |
| 151 | |
| 152 | func (*ImportDeclaration) isNode() {} |
| 153 | func (*ImportDeclaration) isDeclarationType() {} |
nothing calls this directly
no outgoing calls
no test coverage detected