import { type AdvisorySuppression } from "./advisory-suppression.ts"; import { type AnalysisContext, type InitializationImportRead } from "./analyzer.ts"; import type { ModuleStartupCode } from "./ast.ts"; import { type Advisory, type Diagnostic } from "./diagnostic.ts"; import type { EmbeddedJavaScriptEditorToken } from "./embedded-javascript-editor.ts"; import type { CompilerEmbeddedJavaScriptModule, CompilerExtension, CompilerResourceDependency, CompilerStyleSegments, ModuleInterface } from "./extension.ts"; import { SourceText, type Span } from "./source.ts"; import { type SemanticIndex } from "./semantic.ts"; export { advisory, diagnostic, formatAdvisory, formatDiagnostic, mechanicalEdits, mechanicalFix, type Advisory, type Diagnostic, type DiagnosticEdit, type DiagnosticFix } from "./diagnostic.ts"; export { resolveAdvisorySuppressions, resolveDeferredAdvisorySuppressions, scanAdvisorySuppressions, type AdvisoryResolution, type AdvisorySuppression, type AdvisorySuppressionScan } from "./advisory-suppression.ts"; export { applyMechanicalFixes, type AppliedMechanicalFix, type MechanicalFixResult } from "./mechanical-fix.ts"; export { formatSource, formatSourceResult, type FormatResult } from "./formatter.ts"; export { collectionMemberGuidance, removedStandardFunctionGuidance, sourceTypeNameGuidance, type CollectionKind, type CollectionMemberGuidance, type SourceTypeGuidance } from "./language-guidance.ts"; export { inspectJavaScriptModule, MAX_JAVASCRIPT_MODULE_SYNTAX_NODES, MAX_JAVASCRIPT_MODULE_TOKENS, type JavaScriptModuleEdge, type JavaScriptModuleInspection, type JavaScriptModuleInspectionOptions, type JavaScriptOpaqueModuleLoad } from "./javascript-module.ts"; export { SourceText, type Span } from "./source.ts"; export type { EmbeddedJavaScriptEditorToken, EmbeddedJavaScriptEditorTokenModifier, EmbeddedJavaScriptEditorTokenType } from "./embedded-javascript-editor.ts"; export { MAX_VELAR_SOURCE_CODE_UNITS } from "./limits.ts"; export { bindingNameRestriction, isCoreReservedBinding, isForbiddenPrototypeMember, isJavaScriptReservedBinding, isSourceIdentifierPart, isSourceIdentifierStart, isValidSourceIdentifier, memberNameRestriction, type BindingNameRestriction, type MemberNameRestriction } from "./source-names.ts"; export { VELAR_EXTENSION_PROTOCOL_VERSION } from "./extension.ts"; export { CORE_EXPRESSION_CONSTRUCTS, CORE_STATEMENT_CONSTRUCTS, coreStatementConstructKey, type ModuleStartupCode, type ModuleStartupStatement } from "./ast.ts"; export { keywordKinds } from "./token.ts"; export type { CompilerAnalysisExtension, CompilerAnalyzerFactory, CompilerEditorCompletion, CompilerEditorExtension, CompilerEmbeddedJavaScriptModule, CompilerEmitter, CompilerEmitterOptions, CompilerExtension, CompilerFormattingExtension, CompilerInspectionExtension, CompilerInterfaceContext, CompilerIntrinsicAnalysisContext, CompilerLexicalExtension, CompilerLexicalScanContext, CompilerLexicalScanResult, CompilerModuleExtension, CompilerParserFactory, CompilerProjectEditorCompletion, CompilerProjectEditorCompletionContext, CompilerProjectEditorCompletionResult, CompilerProjectEditorExtension, CompilerProjectEditorRenameContext, CompilerProjectEditorVisibleSymbol, CompilerResourceDependency, CompilerStyleSegments, ModuleInterface, ModuleTest, VelarExtensionContract, VelarExtensionKind } from "./extension.ts"; export { semanticImportAt, semanticModuleReferenceAt, semanticSymbolAt, semanticVisibleSymbolsAt, type CompilerSemanticExtension, type SemanticDeclareOptions, type SemanticExpression, type SemanticExtensionContext, type SemanticFunctionLike, type SemanticImport, type SemanticIndex, type SemanticMember, type SemanticMemberReference, type SemanticModuleReference, type SemanticReference, type SemanticScope, type SemanticSymbol, type SemanticSymbolKind, type SemanticSyntaxDocumentation, type SemanticSyntaxToken, type SemanticSyntaxTokenKind } from "./semantic.ts"; export { analysisTypeIdentity, binaryStorageKind, classApplicationType, describeType, genericApplicationIdentity, genericApplicationType, invalidType, isReadonlyView, optionalOf, readonlyViewOf, semanticTypeIdentity, unionOf, VELAR_BYTES_TYPE_IDENTITY, VELAR_FLOAT32_BUFFER_TYPE_IDENTITY, VELAR_UINT8_BUFFER_TYPE_IDENTITY, VELAR_UINT16_BUFFER_TYPE_IDENTITY, VELAR_UINT32_BUFFER_TYPE_IDENTITY, type BinaryStorageKind, type EnumInfo, type GenericApplication, type GenericTypeInfo, type ValueType } from "./types.ts"; export { permanentNamespaceCoveringModule } from "./analyzer.ts"; export type { AnalysisContext, ClassField, ClassInfo, InitializationImportRead } from "./analyzer.ts"; export { CORE_CONTEXTUAL_KEYWORD_WORDS, CORE_CONTEXTUAL_KEYWORDS, CORE_COMPILER_CONTEXTUAL_NAMES, CORE_NUMERIC_SUFFIXES, CORE_PRELUDE_NAMES, CORE_STATEMENT_HEAD_KEYWORDS, CORE_VOCABULARY_NAMES, CORE_WORDS, PERMANENT_NAMESPACE_NAMES, TYPE_PARAMETER_DECLARATION_FORMS, VELAR_CORE_API_VERSION, typeParameterDeclarationFormsPhrase, type CoreContextualKeyword, type CoreContextualKeywordWord, type CoreCompilerContext, type CoreCompilerContextualName, type CoreNumericSuffix, type CorePreludeName, type CoreVocabularyName, type PermanentNamespaceName, type TypeParameterDeclarationForm, } from "./core-vocabulary.ts"; export interface CompileOptions { readonly path?: string; readonly analysis?: AnalysisContext; readonly exportFunctions?: ReadonlySet; readonly extensions?: readonly CompilerExtension[]; readonly resourceContents?: ReadonlyMap; /** The project manifest's extension sections, by extension id; see AnalysisContext. */ readonly extensionConfig?: ReadonlyMap; /** Required when analysis supplies project runtime-Type links or module namespace metadata. */ readonly sharedRuntimeModules?: boolean; /** 当前源文件是否作为程序入口生成 `@main`;直接编译单个源文件时默认为 true。 */ readonly executeMain?: boolean; /** * 是否生成 Source Map。编译器 API 默认生成,便于开发工具和诊断调用方继续 * 获得完整位置信息;生产构建可显式关闭,避免在随后不会写出映射时仍遍历 * 整份生成代码和源位置表。 */ readonly emitSourceMap?: boolean; } export interface CompileResult { /** 模块是否声明了编译器拥有的 `@main` 程序入口。 */ readonly hasMain: boolean; /** * 模块顶层的启动代码——没有 `@main` 时它就停在那里。 * * `hasMain` 只回答入口区域在不在;应用入口契约还要知道「不在的时候,启动代码 * 是什么形状」,才能把可证明等价的一种改写交给 `velar fix`,把其余形状原样退 * 回给作者。两个问题由同一次解析回答,不需要下游重新解析。 */ readonly moduleStartup: ModuleStartupCode; readonly code: string | null; readonly sourceMap: string | null; readonly embeddedModules: readonly CompilerEmbeddedJavaScriptModule[]; /** Editor-only roles from embedded JavaScript; separate from Velar symbols/references. */ readonly embeddedJavaScriptTokens: readonly EmbeddedJavaScriptEditorToken[]; readonly css: string | null; readonly styleSegments: CompilerStyleSegments | null; readonly runtimeModules: readonly string[]; readonly extensions: readonly string[]; readonly diagnostics: readonly Diagnostic[]; /** * D89: the advisory channel. Advisories are reported beside the diagnostics * and never counted with them, so they never withhold `code`. */ readonly advisories: readonly Advisory[]; /** * D114 MD-I4: the `velar-allow` clauses this compile could neither apply nor * call stale, because they name an advisory only the project graph raises. * The driver that owns the graph applies them with * `resolveDeferredAdvisorySuppressions`. */ readonly advisorySuppressions: readonly AdvisorySuppression[]; readonly source: SourceText; readonly dependencies: readonly ModuleDependency[]; readonly resources: readonly CompilerResourceDependency[]; readonly moduleInterface: ModuleInterface; readonly semanticIndex: SemanticIndex; /** Initialization-position reads of imported bindings; the project driver checks them against module cycles. */ readonly initializationImportReads: readonly InitializationImportRead[]; } export interface ModuleDependencySpecifier { readonly imported: string; readonly local: string; readonly namespace: boolean; /** CO-I7: author source span of the written export name, when the source wrote one. */ readonly span?: Span; } export interface ModuleDependency { readonly source: string; /** Author source span of the literal module specifier. */ readonly span: Span; readonly javascript: boolean; readonly unsafe: boolean; readonly dynamic: boolean; /** A checked resource edge that is emitted as an ESM value import. */ readonly resource?: "json"; /** True for `export {name} from "source"` re-export dependencies. */ readonly reExport?: boolean; /** True when the importing module declares `extern module "source"` itself. */ readonly externOwned?: boolean; readonly specifiers: readonly ModuleDependencySpecifier[]; } export interface ModuleInspection { readonly diagnostics: readonly Diagnostic[]; /** D89: the lexical and syntactic advisories of this module. */ readonly advisories: readonly Advisory[]; readonly source: SourceText; readonly dependencies: readonly ModuleDependency[]; readonly resources: readonly CompilerResourceDependency[]; readonly moduleInterface: ModuleInterface; readonly semanticIndex: SemanticIndex; /** Editor-only roles from embedded JavaScript; separate from Velar symbols/references. */ readonly embeddedJavaScriptTokens: readonly EmbeddedJavaScriptEditorToken[]; } export declare function inspectModule(text: string, options?: Pick): ModuleInspection; export declare function compile(text: string, options?: CompileOptions): CompileResult; export { validationPathKindIdentity, validationPathKindMembers, validationPathKindWireValues, validationPathKindType, validationPathSegmentType, validationPathType } from "./validation-path.ts"; //# sourceMappingURL=index.d.ts.map