Merge pull request #28872 from ide/rn-devtools-types

[react-native] Add types for devtools modules
This commit is contained in:
Eloy Durán 2018-09-17 14:43:49 +02:00 committed by GitHub
commit a44effb209
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

22
types/react-native/Devtools.d.ts vendored Normal file
View 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[]>;
}

View File

@ -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 PropTypes from 'prop-types';
import * as React from 'react';