UNPKG

1.03 kBPlain TextView Raw
1// The actual type definitions are wrong, so we are fixing them lol
2// eslint-disable-next-line import/namespace
3import type { StackFrame } from "react-native/Libraries/Core/NativeExceptionsManager"
4
5/** @see https://github.com/facebook/react-native/blob/v0.72.1/packages/react-native/Libraries/Core/Devtools/symbolicateStackTrace.js#L17-L25 */
6export type CodeFrame = Readonly<{
7 content: string
8 location:
9 | {
10 row: number
11 column: number
12 }
13 | null
14 | undefined
15 fileName: string
16}>
17
18/** @see https://github.com/facebook/react-native/blob/v0.72.1/packages/react-native/Libraries/Core/Devtools/symbolicateStackTrace.js#L27-L30 */
19export type SymbolicatedStackTrace = Readonly<{
20 stack: Array<StackFrame>
21 codeFrame: CodeFrame | null | undefined
22}>
23
24/** @see https://github.com/facebook/react-native/blob/v0.72.1/packages/react-native/Libraries/Core/Devtools/symbolicateStackTrace.js#L32-L34 */
25export type SymbolicateStackTraceFn = (stack: Array<StackFrame>) => Promise<SymbolicatedStackTrace>