mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[react-native] Add types for devtools modules
Adds type declarations for `parseErrorStack` and `symbolicateStackTrace`, which are used to process caught errors.
This commit is contained in:
parent
f6466f9257
commit
3c4f383e95
22
types/react-native/Devtools.d.ts
vendored
Normal file
22
types/react-native/Devtools.d.ts
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
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[]>;
|
||||
}
|
||||
1
types/react-native/index.d.ts
vendored
1
types/react-native/index.d.ts
vendored
@ -30,6 +30,7 @@
|
||||
/// <reference path="globals.d.ts" />
|
||||
/// <reference path="legacy-properties.d.ts" />
|
||||
/// <reference path="BatchedBridge.d.ts" />
|
||||
/// <reference path="Devtools.d.ts" />
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user