Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HtmlFormatter typings to expose showUnchanged and hideUnchanged #236

Merged
merged 2 commits into from
Jan 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
export interface Formatter {
format(delta: Delta, original: any): string;
format(delta: Delta, original: any): string;
}

export interface HtmlFormatter extends Formatter {
/**
* Set whether to show or hide unchanged parts of a diff.
* @param show Whether to show unchanged parts
* @param node The root element the diff is contained within. (Default: body)
* @param delay Transition time in ms. (Default: no transition)
*/
showUnchanged(show: boolean, node?: Element | null, delay?: number): void;

/**
* An alias for showUnchanged(false, ...)
* @param node The root element the diff is contained within (Default: body)
* @param delay Transition time in ms. (Default: no transition)
*/
hideUnchanged(node?: Element | null, delay?: number): void;
}

export interface HTMLFormatter extends Formatter {
Expand Down