Skip to content

Commit bb926a4

Browse files
authored
fix: Add typings to Provider (#27)
1 parent ad8f667 commit bb926a4

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

index.d.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, ReactNode } from "react";
2-
import Rollbar, { Callback } from "rollbar";
2+
import Rollbar, { Callback, Configuration } from "rollbar";
33

44
export const LEVEL_DEBUG = "debug";
55
export const LEVEL_INFO = "info";
@@ -39,6 +39,20 @@ export class RollbarContext extends Component<{
3939
children: ReactNode;
4040
context?: string;
4141
}> {}
42+
43+
export interface ProviderProps {
44+
Rollbar?: new (options: Configuration) => Rollbar;
45+
config?: Configuration | (() => Configuation);
46+
instance?: Rollbar;
47+
}
48+
49+
interface ProviderState {
50+
rollbar: Rollbar;
51+
options: Coniguration;
52+
}
53+
54+
export class Provider extends Component<ProviderProps, ProviderState> {}
55+
4256
export function useRollbar(): Rollbar;
4357
export function useRollbarConfiguration(config: Rollbar.Configuration): void;
4458
export function useRollbarContext(ctx?: string, isLayout?: boolean): void;

0 commit comments

Comments
 (0)