From 56a43ff7f5ffcaaff7a27710364cd3f78da4f870 Mon Sep 17 00:00:00 2001 From: Mikhail Silaev Date: Tue, 13 Apr 2021 18:21:12 +0300 Subject: [PATCH] fix: types declaration --- index.d.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index 23e46ca..ee11404 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,4 +1,14 @@ declare module 'fast-json-stable-stringify' { - function stringify(obj: any): string; - export = stringify; + type CmpOperand = { + key: K, + value: T[K], + } + + type Options = Partial<{ + cmp: (a: CmpOperand, b: CmpOperand) => number, + cycles: Boolean, + }> + + function stringify(obj: T, opts?: Options): string; + export = stringify; }