XuqmGroup-H5SDK/node_modules/@microsoft/api-extractor/lib-esm/analyzer/AstNamespaceImport.js
徐勤民 e34fa2052a feat(private): add private deployment SDK module
Adds @xuqm/h5-sdk/private entry point with JSON-based initialization,
feature gating, and error codes for private deployment scenarios.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 21:08:08 +08:00

57 行
1.9 KiB
JavaScript

// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
// See LICENSE in the project root for license information.
import { AstSyntheticEntity } from './AstEntity';
/**
* `AstNamespaceImport` represents a namespace that is created implicitly by a statement
* such as `import * as example from "./file";`
*
* @remarks
*
* A typical input looks like this:
* ```ts
* // Suppose that example.ts exports two functions f1() and f2().
* import * as example from "./file";
* export { example };
* ```
*
* API Extractor's .d.ts rollup will transform it into an explicit namespace, like this:
* ```ts
* declare f1(): void;
* declare f2(): void;
*
* declare namespace example {
* export {
* f1,
* f2
* }
* }
* ```
*
* The current implementation does not attempt to relocate f1()/f2() to be inside the `namespace`
* because other type signatures may reference them directly (without using the namespace qualifier).
* The `declare namespace example` is a synthetic construct represented by `AstNamespaceImport`.
*/
export class AstNamespaceImport extends AstSyntheticEntity {
constructor(options) {
super();
/**
* Returns true if the AstSymbolTable.analyze() was called for this object.
* See that function for details.
*/
this.analyzed = false;
this.astModule = options.astModule;
this.namespaceName = options.namespaceName;
this.declaration = options.declaration;
this.symbol = options.symbol;
}
/** {@inheritdoc} */
get localName() {
// abstract
return this.namespaceName;
}
fetchAstModuleExportInfo(collector) {
const astModuleExportInfo = collector.astSymbolTable.fetchAstModuleExportInfo(this.astModule);
return astModuleExportInfo;
}
}
//# sourceMappingURL=AstNamespaceImport.js.map