MCPcopy Create free account
hub / github.com/coder/guts / ImportDeclaration

Struct ImportDeclaration

bindings/declarations.go:135–150  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

133// (`import foo from "x"`) and namespace imports (`import * as ns from "x"`)
134// are not yet supported; add them if you need them.
135type 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
152func (*ImportDeclaration) isNode() {}
153func (*ImportDeclaration) isDeclarationType() {}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected