Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Component, Context as ReactContext, ReactNode } from 'react';
import Rollbar, { Callback, Configuration } from 'rollbar';
import { RollbarInstance, BaseOptions, RollbarCtor } from './src/provider';

export const LEVEL_DEBUG = 'debug';
export const LEVEL_INFO = 'info';
Expand Down Expand Up @@ -54,6 +53,10 @@ interface ProviderState {

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

declare const RollbarInstance: unique symbol;
declare const BaseOptions: unique symbol;
declare const RollbarCtor: unique symbol;

interface ContextInterface {
[RollbarInstance]: Rollbar;
[BaseOptions]: Configuration;
Expand All @@ -62,7 +65,7 @@ interface ContextInterface {

export const Context: ReactContext<ContextInterface>;

export function getRollbarFromContext(context: Context): Rollbar;
export function getRollbarFromContext(context: ReactContext<ContextInterface>): Rollbar;
export function useRollbar(): Rollbar;
export function useRollbarConfiguration(config: Rollbar.Configuration): void;
export function useRollbarContext(ctx?: string, isLayout?: boolean): void;
Expand Down