Skip to content

Commit 56a43ff

Browse files
committed
fix: types declaration
1 parent 49e230d commit 56a43ff

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

index.d.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
declare module 'fast-json-stable-stringify' {
2-
function stringify(obj: any): string;
3-
export = stringify;
2+
type CmpOperand<T, K extends keyof T> = {
3+
key: K,
4+
value: T[K],
5+
}
6+
7+
type Options<T> = Partial<{
8+
cmp: <KA extends keyof T, KB extends keyof T>(a: CmpOperand<T, KA>, b: CmpOperand<T, KB>) => number,
9+
cycles: Boolean,
10+
}>
11+
12+
function stringify<T extends object>(obj: T, opts?: Options<T>): string;
13+
export = stringify;
414
}

0 commit comments

Comments
 (0)