Skip to content

Commit 40e7d3a

Browse files
authoredAug 13, 2024··
add interface declaration for usages from typescript
1 parent 1736d2b commit 40e7d3a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
 

‎README.md

+15
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,21 @@ console.diffRight(Date.now());
116116

117117
- **console.diff\_(\*)** - uses deprecated `nativeClone` serialization method, based of JSON.parse(JSON.stringify(...)), left for backward compatibility
118118

119+
### Typescript
120+
121+
Global Console interface declaration for quick copy/paste when used from typescript:
122+
123+
```typescript
124+
declare global {
125+
interface Console {
126+
diff(left: unknown, right?: unknown): void;
127+
diffPush(next: unknown): void;
128+
diffLeft(left: unknown): void;
129+
diffRight(right: unknown): void;
130+
}
131+
}
132+
```
133+
119134
### Usage basics
120135

121136
Historically, left side represents the old state and right side the new state.

0 commit comments

Comments
 (0)
Please sign in to comment.