text-compare-vue3
Version:
A powerful text comparison plugin for Vue.js with character-level diff support
29 lines (27 loc) • 811 B
TypeScript
import { Ref } from 'vue';
export interface TextComparisonOptions {
customColors?: {
commonColor?: string;
removedColor?: string;
addedColor?: string;
};
}
export interface DiffStyles {
common: {
color: string;
};
removed: {
backgroundColor: string;
color: string;
};
added: {
backgroundColor: string;
color: string;
};
}
export declare function useTextComparison(initialText1: string | Ref<string>, initialText2: string | Ref<string>, options?: TextComparisonOptions): {
diffResult: import('vue').ComputedRef<import('../types').DiffResult>;
similarity: import('vue').ComputedRef<number>;
styles: import('vue').ComputedRef<DiffStyles>;
updateTexts: (newText1: string, newText2: string) => void;
};