Skip to content

Commit

Permalink
add interface declaration for usages from typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
zendive authored Aug 13, 2024
1 parent 1736d2b commit 40e7d3a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,21 @@ console.diffRight(Date.now());

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

### Typescript

Global Console interface declaration for quick copy/paste when used from typescript:

```typescript
declare global {
interface Console {
diff(left: unknown, right?: unknown): void;
diffPush(next: unknown): void;
diffLeft(left: unknown): void;
diffRight(right: unknown): void;
}
}
```

### Usage basics

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

0 comments on commit 40e7d3a

Please sign in to comment.