Skip to content

Commit 65bd368

Browse files
authored
Merge pull request #236 from ian-craig/typings-html-formatter
Add HtmlFormatter typings to expose showUnchanged and hideUnchanged
2 parents 2b4d939 + 5b46175 commit 65bd368

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/index.d.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
export interface Formatter {
2-
format(delta: Delta, original: any): string;
2+
format(delta: Delta, original: any): string;
3+
}
4+
5+
export interface HtmlFormatter extends Formatter {
6+
/**
7+
* Set whether to show or hide unchanged parts of a diff.
8+
* @param show Whether to show unchanged parts
9+
* @param node The root element the diff is contained within. (Default: body)
10+
* @param delay Transition time in ms. (Default: no transition)
11+
*/
12+
showUnchanged(show: boolean, node?: Element | null, delay?: number): void;
13+
14+
/**
15+
* An alias for showUnchanged(false, ...)
16+
* @param node The root element the diff is contained within (Default: body)
17+
* @param delay Transition time in ms. (Default: no transition)
18+
*/
19+
hideUnchanged(node?: Element | null, delay?: number): void;
320
}
421

522
export interface HTMLFormatter extends Formatter {

0 commit comments

Comments
 (0)