Skip to content

Commit

Permalink
fix: Add typings to Provider (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
quinnturner authored Jan 25, 2022
1 parent ad8f667 commit bb926a4
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, ReactNode } from "react";
import Rollbar, { Callback } from "rollbar";
import Rollbar, { Callback, Configuration } from "rollbar";

export const LEVEL_DEBUG = "debug";
export const LEVEL_INFO = "info";
Expand Down Expand Up @@ -39,6 +39,20 @@ export class RollbarContext extends Component<{
children: ReactNode;
context?: string;
}> {}

export interface ProviderProps {
Rollbar?: new (options: Configuration) => Rollbar;
config?: Configuration | (() => Configuation);
instance?: Rollbar;
}

interface ProviderState {
rollbar: Rollbar;
options: Coniguration;
}

export class Provider extends Component<ProviderProps, ProviderState> {}

export function useRollbar(): Rollbar;
export function useRollbarConfiguration(config: Rollbar.Configuration): void;
export function useRollbarContext(ctx?: string, isLayout?: boolean): void;
Expand Down

0 comments on commit bb926a4

Please sign in to comment.