(
target: Extract<ImportTarget, { kind: "binding" | "expression" }>
)
| 6226 | |
| 6227 | // e.g. a Type, a literal holding one, or a function returning one |
| 6228 | definesArk( |
| 6229 | target: Extract<ImportTarget, { kind: "binding" | "expression" }> |
| 6230 | ): boolean { |
| 6231 | const { module } = target |
| 6232 | let fn: readonly [FunctionNode, SourceModule] | undefined |
| 6233 | if (target.kind === "binding") { |
| 6234 | if (isArk(this.bindingKindOf(target.binding, module))) return true |
| 6235 | fn = this.boundFunctionOf(target.binding, module) |
| 6236 | } else { |
| 6237 | const node = unwrapChain(target.node) |
| 6238 | if (isArk(this.kindOf(node, module))) return true |
| 6239 | const named = namedFunctionOf(node, module) |
| 6240 | if (isFunctionNode(named)) fn = [named, module] |
| 6241 | } |
| 6242 | const returned = fn && returnedOf(fn[0]) |
| 6243 | const literal = |
| 6244 | this.targetLiteralOf(target, this.finalKindOfKey, new Set()) ?? |
| 6245 | (fn && returned && this.literalOf(returned, fn[1], this.finalKindOfKey)) |
| 6246 | const held = literal ? this.heldKindOf(literal) : 0 |
| 6247 | return ( |
| 6248 | isArk(held) || |
| 6249 | isFactory(held) || |
| 6250 | (!!fn && isArk(this.finalKindOfKey(...fn))) |
| 6251 | ) |
| 6252 | } |
| 6253 | } |
| 6254 | |
| 6255 | const arktypeExportOf = ( |
nothing calls this directly
no test coverage detected