From bb926a4feb4a6e35cdea09ce5ee678f7b243be3f Mon Sep 17 00:00:00 2001 From: Quinn Turner Date: Tue, 25 Jan 2022 19:51:39 -0400 Subject: [PATCH] fix: Add typings to Provider (#27) --- index.d.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index a56c86c..540ab6a 100644 --- a/index.d.ts +++ b/index.d.ts @@ -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"; @@ -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 {} + export function useRollbar(): Rollbar; export function useRollbarConfiguration(config: Rollbar.Configuration): void; export function useRollbarContext(ctx?: string, isLayout?: boolean): void;