@fishan/myers-core-diff
Version:
A high-performance core diff engine based on Myers' algorithm, with plugin support for custom strategies (e.g., Patience, Preserve Structure).
24 lines (23 loc) • 945 B
TypeScript
/**
* @license
* Copyright (c) 2025, Internal Implementation
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import { MyersCoreDiff } from './myers_core_diff.js';
/**
* Registers the `'preserveStructure'` diff strategy within a given Core Engine.
* Once registered, the engine can use this strategy via `engine.setStrategy('preserveStructure')`.
*
* @param {typeof MyersCoreDiff} CoreEngine - The core diff engine class (typically `MyersCoreDiff`).
* @returns {void}
*
* @example
* import { registerPreserveStructureStrategy } from './preserveStructurePlugin.js';
* import { MyersCoreDiff } from './myers_core_diff.js';
*
* registerPreserveStructureStrategy(MyersCoreDiff);
* const diff = new MyersCoreDiff({ strategy: 'preserveStructure' });
*/
export declare function registerPreserveStructureStrategy(CoreEngine: typeof MyersCoreDiff): void;