/** * An isomorphic library for detecting and classifying changes between TypeScript declaration files. * * @remarks * This package analyzes TypeScript source code to identify API changes and classify them * according to semantic versioning impact (major, minor, patch, or none). * * This core package is designed to work in both Node.js and browser environments. * It does not use any Node.js-specific APIs like `fs`. * * @example * ```ts * import * as ts from 'typescript'; * import { analyzeChanges } from '@api-extractor-tools/change-detector-core'; * * const result = analyzeChanges(oldSource, newSource, ts); * console.log(`Release type: ${result.releaseType}`); * * for (const { change, releaseType, matchedRule } of result.results) { * console.log(`[${releaseType}] ${change.explanation}`); * } * ``` * * @packageDocumentation */ import type * as ts from 'typescript'; import type { TSESTree } from '@typescript-eslint/typescript-estree'; /* Excluded from this release type: adaptLegacyInputProcessorPlugin */ /* Excluded from this release type: AddedDescriptor */ /* Excluded from this release type: AnalyzableNode */ /* Excluded from this release type: analyzeChanges */ /* Excluded from this release type: AnalyzeChangesOptions */ /* Excluded from this release type: AnalyzeChangesResult */ /* Excluded from this release type: AnalyzedChange */ /* Excluded from this release type: ApiChange */ /* Excluded from this release type: ASTAwareInputProcessor */ /* Excluded from this release type: ASTAwarePolicyDefinition */ /* Excluded from this release type: ASTAwarePolicyOptions */ /* Excluded from this release type: ASTAwareReporter */ /* Excluded from this release type: ASTAwareReporterDefinition */ /* Excluded from this release type: ASTAwareReporterOptions */ /* Excluded from this release type: ASTCapability */ /* Excluded from this release type: ASTChangeJSON */ /* Excluded from this release type: ASTComparisonReport */ /* Excluded from this release type: ASTParameterInfo */ /* Excluded from this release type: ASTProcessResult */ /* Excluded from this release type: ASTReporterOptions */ /* Excluded from this release type: ASTReportJSON */ /* Excluded from this release type: AsyncReporter */ /* Excluded from this release type: calculatePatternConfidence */ /* Excluded from this release type: Change */ /* Excluded from this release type: ChangeAction */ /* Excluded from this release type: ChangeAspect */ /* Excluded from this release type: ChangeCategory */ /* Excluded from this release type: ChangeContext */ /* Excluded from this release type: ChangeDescriptor */ /** * Base properties shared by all change descriptors. */ declare interface ChangeDescriptorBase { /** What construct was affected */ target: ChangeTarget; /** Additional metadata tags for fine-grained policy matching */ tags: Set; } /* Excluded from this release type: ChangeDetails */ /* Excluded from this release type: ChangeDetectorPlugin */ /* Excluded from this release type: ChangeDetectorPluginWithLifecycle */ /* Excluded from this release type: ChangeImpact */ /* Excluded from this release type: ChangeMatcher */ /* Excluded from this release type: ChangesByImpact */ /* Excluded from this release type: ChangeTag */ /* Excluded from this release type: ChangeTarget */ /* Excluded from this release type: ClassificationResult */ /* Excluded from this release type: ClassifiedChange */ /* Excluded from this release type: classifyChange */ /* Excluded from this release type: classifyChanges */ /* Excluded from this release type: ClassifyContext */ /* Excluded from this release type: COMMON_INTENTS */ /* Excluded from this release type: COMMON_PATTERNS */ /* Excluded from this release type: ComparisonReport */ /* Excluded from this release type: ComparisonStats */ /* Excluded from this release type: compilePattern */ /* Excluded from this release type: createASTAwarePolicyDefinition */ /* Excluded from this release type: createASTAwareReporterDefinition */ /* Excluded from this release type: createASTComparisonReport */ /* Excluded from this release type: createPluginRegistry */ /* Excluded from this release type: createPolicy */ /* Excluded from this release type: createProgressivePolicy */ /* Excluded from this release type: createStandardPolicy */ /* Excluded from this release type: decompileToPattern */ /* Excluded from this release type: defaultASTPolicy */ /* Excluded from this release type: detectCommonPattern */ /* Excluded from this release type: detectParameterReordering */ /* Excluded from this release type: determineOverallRelease */ /* Excluded from this release type: diffModules */ /* Excluded from this release type: DiffOptions */ /* Excluded from this release type: DimensionalRule */ /** * Fluent builder for dimensional rules. * * This class provides a chainable API for building dimensional rules * with maximum precision. It's returned by {@link ProgressiveRuleBuilder.dimensional} * and allows specifying all dimensional constraints before returning to the * main builder. * * @example * ```typescript * builder * .dimensional('nested-interface-modification') * .action('modified') * .target('property') * .aspect('type') * .impact('narrowing') * .hasTag('breaking') * .nested(true) * .returns('major') * ``` */ declare class DimensionalRuleBuilder { private progressiveBuilder; private currentRule; constructor(name: string, progressiveBuilder: T); /** * Specify change actions to match. * * @param actions - One or more actions ('added', 'removed', 'renamed', 'reordered', 'modified') * @returns This builder for chaining * * @example * ```typescript * .action('added', 'removed') * ``` */ action(...actions: ChangeAction[]): this; /** * Specify change targets to match. * * @param targets - One or more targets ('export', 'parameter', 'property', etc.) * @returns This builder for chaining * * @example * ```typescript * .target('export', 'parameter') * ``` */ target(...targets: ChangeTarget[]): this; /** * Specify change aspects to match. * * @param aspects - One or more aspects ('type', 'optionality', 'deprecation', etc.) * @returns This builder for chaining * * @example * ```typescript * .aspect('type', 'optionality') * ``` */ aspect(...aspects: ChangeAspect[]): this; /** * Specify change impacts to match. * * @param impacts - One or more impacts ('narrowing', 'widening', 'equivalent', etc.) * @returns This builder for chaining * * @example * ```typescript * .impact('narrowing', 'unrelated') * ``` */ impact(...impacts: ChangeImpact[]): this; /** * Specify tags that must be present for the rule to match. * * @param tags - One or more tags ('optional', 'deprecated', 'internal', etc.) * @returns This builder for chaining * * @example * ```typescript * .hasTag('optional', 'deprecated') * ``` */ hasTag(...tags: ChangeTag[]): this; /** * Mark this rule as applying to nested changes. * * @param value - Whether to match nested changes (default: true) * @returns This builder for chaining * * @example * ```typescript * .nested(true) * ``` */ nested(value?: boolean): this; /** * Complete the dimensional rule and return to the main builder. * * @param releaseType - The release type for this rule ('major', 'minor', 'patch', 'none') * @returns The parent ProgressiveRuleBuilder for continued chaining * * @example * ```typescript * .returns('major') * ``` */ returns(releaseType: ReleaseType): T; } /* Excluded from this release type: DiscoveredPlugin */ /* Excluded from this release type: DSLBuilderState */ /* Excluded from this release type: DSLPolicy */ /* Excluded from this release type: DSLRule */ /* Excluded from this release type: DSLValidationError */ /* Excluded from this release type: DSLValidationResult */ /* Excluded from this release type: DSLValidationWarning */ /* Excluded from this release type: editDistance */ /* Excluded from this release type: EnumMemberInfo */ /* Excluded from this release type: ExportedSymbol */ /* Excluded from this release type: ExtendedVersioningPolicy */ /* Excluded from this release type: extractParameterInfo */ /* Excluded from this release type: findBestPattern */ /* Excluded from this release type: flattenChanges */ /* Excluded from this release type: formatASTReportAsJSON */ /* Excluded from this release type: formatASTReportAsMarkdown */ /* Excluded from this release type: formatASTReportAsText */ /* Excluded from this release type: formatSourceLocation */ /* Excluded from this release type: formatValidationErrors */ /* Excluded from this release type: generateIntentExpression */ /* Excluded from this release type: groupChangesByDescriptor */ /* Excluded from this release type: HybridPolicyDefinition */ /* Excluded from this release type: inferConstraints */ /* Excluded from this release type: InputProcessor */ /* Excluded from this release type: InputProcessorDefinition */ /* Excluded from this release type: InputProcessorOptions */ /* Excluded from this release type: InputProcessorPlugin */ /* Excluded from this release type: IntentExpression */ /* Excluded from this release type: IntentParseResult */ /* Excluded from this release type: IntentRule */ /* Excluded from this release type: IntentSynthesisResult */ /* Excluded from this release type: interpretNameChange */ /* Excluded from this release type: isASTAwareInputProcessor */ /* Excluded from this release type: isASTAwarePolicyDefinition */ /* Excluded from this release type: isASTAwareReporterDefinition */ /* Excluded from this release type: isDimensionalRule */ /* Excluded from this release type: isIntentRule */ /* Excluded from this release type: isPatternRule */ /* Excluded from this release type: isValidIntentExpression */ /* Excluded from this release type: isValidPatternTemplate */ /* Excluded from this release type: isValidPlugin */ /* Excluded from this release type: jsonASTReporter */ /* Excluded from this release type: LoadedPlugin */ /* Excluded from this release type: markdownASTReporter */ /* Excluded from this release type: ModifiedDescriptor */ /* Excluded from this release type: Modifier */ /* Excluded from this release type: ModuleAnalysis */ /* Excluded from this release type: ModuleAnalysisWithTypes */ /* Excluded from this release type: nameSimilarity */ /* Excluded from this release type: NodeKind */ /* Excluded from this release type: NodeMetadata */ /* Excluded from this release type: ParameterInfo */ /* Excluded from this release type: ParameterOrderAnalysis */ /* Excluded from this release type: ParameterPositionAnalysis */ /* Excluded from this release type: ParseDeclarationResult */ /* Excluded from this release type: parseDeclarationString */ /* Excluded from this release type: parseIntent */ /* Excluded from this release type: parseModule */ /* Excluded from this release type: parseModuleWithTypes */ /* Excluded from this release type: ParseOptions */ /* Excluded from this release type: PatternCompileResult */ /* Excluded from this release type: PatternDecompileResult */ /* Excluded from this release type: PatternRule */ /* Excluded from this release type: PatternTemplate */ /* Excluded from this release type: PatternVariable */ /* Excluded from this release type: PLUGIN_KEYWORDS */ /* Excluded from this release type: PluginDiscoveryError */ /* Excluded from this release type: PluginDiscoveryLogger */ /* Excluded from this release type: PluginDiscoveryOptions */ /* Excluded from this release type: PluginDiscoveryResult */ /* Excluded from this release type: PluginError */ /* Excluded from this release type: PluginErrorCode */ /* Excluded from this release type: PluginLifecycle */ /* Excluded from this release type: PluginMetadata */ /* Excluded from this release type: PluginPackageInfo */ /* Excluded from this release type: PluginRegistry */ /* Excluded from this release type: PluginRegistryOptions */ /* Excluded from this release type: PluginResult */ /* Excluded from this release type: PluginValidationError */ /* Excluded from this release type: PluginValidationOptions */ /* Excluded from this release type: PluginValidationResult */ /* Excluded from this release type: Policy */ /* Excluded from this release type: PolicyBuilder */ /* Excluded from this release type: PolicyContext */ /* Excluded from this release type: PolicyDefinition */ /* Excluded from this release type: PolicyOptions */ /* Excluded from this release type: PolicyRule */ /* Excluded from this release type: ProcessResult */ /* Excluded from this release type: ProgressiveRuleBuilder */ declare interface ProgressiveRuleBuilderInterface { addDimensionalRule(rule: DimensionalRule): void; } /* Excluded from this release type: PropertyInfo */ /* Excluded from this release type: readOnlyASTPolicy */ /* Excluded from this release type: RegisterOptions */ /* Excluded from this release type: RegistryLogger */ /* Excluded from this release type: ReleaseType */ /* Excluded from this release type: RemovedDescriptor */ /* Excluded from this release type: RenamedDescriptor */ /* Excluded from this release type: ReorderedDescriptor */ /* Excluded from this release type: ReorderingConfidence */ /* Excluded from this release type: Reporter */ /* Excluded from this release type: ReporterDefinition */ /* Excluded from this release type: ReporterOptions */ /* Excluded from this release type: ReportOutput */ /* Excluded from this release type: ReportOutputFormat */ /* Excluded from this release type: ResolvedCapability */ /* Excluded from this release type: ResolvedPlugin */ /* Excluded from this release type: rule */ /* Excluded from this release type: RuleBuilder */ /* Excluded from this release type: semverDefaultPolicy */ /* Excluded from this release type: semverReadOnlyPolicy */ /* Excluded from this release type: semverWriteOnlyPolicy */ /* Excluded from this release type: SignatureInfo */ /* Excluded from this release type: SourceLocation */ /* Excluded from this release type: SourceMapping */ /* Excluded from this release type: SourcePosition */ /* Excluded from this release type: SourceRange */ /* Excluded from this release type: suggestIntentCorrections */ /* Excluded from this release type: SymbolKind */ /* Excluded from this release type: SymbolMetadata */ /* Excluded from this release type: synthesizeIntent */ /* Excluded from this release type: textASTReporter */ /* Excluded from this release type: TransformationChain */ /* Excluded from this release type: TransformOptions */ /* Excluded from this release type: TypeInfo */ /* Excluded from this release type: TypeParameterInfo */ /* Excluded from this release type: validatePlugin */ /* Excluded from this release type: ValidationResult */ /* Excluded from this release type: Validator */ /* Excluded from this release type: ValidatorDefinition */ /* Excluded from this release type: VersioningPolicy */ /* Excluded from this release type: writeOnlyASTPolicy */ export { }