diff --git a/index.d.ts b/index.d.ts index 5e6bc45..5131b22 100644 --- a/index.d.ts +++ b/index.d.ts @@ -2,16 +2,30 @@ import { DiffOptions } from 'jest-diff'; -declare type FileMatcherOptions = { - diff: DiffOptions +declare module 'jest-file-snapshot' { + export const toMatchFile: jest.CustomMatcher; } -declare namespace jest { - interface Matchers { - toMatchFile: (output: string, filename?: string, options?: FileMatcherOptions) => void - } +declare interface FileMatcherOptions { + diff: DiffOptions; +} + +declare global { + namespace jest { + interface Matchers { + toMatchFile: ( + output: string, + filename?: string, + options?: FileMatcherOptions + ) => void; + } - interface Expect { - toMatchFile: (output: string, filename?: string, options?: FileMatcherOptions) => void + interface Expect { + toMatchFile: ( + output: string, + filename?: string, + options?: FileMatcherOptions + ) => void; + } } }