Skip to content

Commit c0df281

Browse files
provide shape for provider and consumer
use suggestion from @audunru from #94
1 parent 340971c commit c0df281

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

index.d.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ declare module 'gatsby-plugin-intl' {
77
export class Link<TState> extends gatsby.Link<TState> {}
88
export const navigate: typeof gatsby.navigate;
99
export const changeLocale: (language: string, to?: string) => void;
10-
export const IntlContextProvider: React.Provider<any>;
11-
export const IntlContextConsumer: React.Consumer<any>;
10+
11+
import { IntlShape } from "react-intl";
12+
interface GatsbyPluginIntlShape extends IntlShape {
13+
language: string;
14+
languages: string[];
15+
routed: boolean;
16+
originalPath: string;
17+
redirect: boolean;
18+
}
19+
export const IntlContextProvider: React.Provider<GatsbyPluginIntlShape>;
20+
export const IntlContextConsumer: React.Consumer<GatsbyPluginIntlShape>;
1221
}

0 commit comments

Comments
 (0)