DefinitelyTyped/types/react-native/Devtools.d.ts
James Ide 3c4f383e95 [react-native] Add types for devtools modules
Adds type declarations for `parseErrorStack` and `symbolicateStackTrace`, which are used to process caught errors.
2018-09-13 17:56:35 -07:00

23 lines
682 B
TypeScript

declare module 'react-native/Libraries/Core/Devtools/parseErrorStack' {
export type StackFrame = {
file: string;
methodName: string;
lineNumber: number;
column: number | null;
};
export interface ExtendedError extends Error {
framesToPop?: number;
}
export default function parseErrorStack(error: ExtendedError): StackFrame[];
}
declare module 'react-native/Libraries/Core/Devtools/symbolicateStackTrace' {
import { StackFrame } from 'react-native/Libraries/Core/Devtools/parseErrorStack';
export default function symbolicateStackTrace(
stack: ReadonlyArray<StackFrame>
): Promise<StackFrame[]>;
}