Add annotations to unannotated variable declarations [manually-modified]

Reviewed By: panagosg7

Differential Revision: D35948108

fbshipit-source-id: 7d286c9dd66dbd25281e2d831691f8bb34504b5d
This commit is contained in:
Sam Zhou 2022-04-27 19:15:55 -07:00 коммит произвёл Facebook GitHub Bot
Родитель ff80493d6e
Коммит 0c4c6ca319
10 изменённых файлов: 21 добавлений и 14 удалений

Просмотреть файл

@ -100,7 +100,7 @@ function parseLine(line: string): ?HermesStackEntry {
module.exports = function parseHermesStack(stack: string): HermesParsedStack { module.exports = function parseHermesStack(stack: string): HermesParsedStack {
const lines = stack.split(/\n/); const lines = stack.split(/\n/);
let entries = []; let entries: Array<HermesStackEntryFrame | HermesStackEntrySkipped> = [];
let lastMessageLine = -1; let lastMessageLine = -1;
for (let i = 0; i < lines.length; ++i) { for (let i = 0; i < lines.length; ++i) {
const line = lines[i]; const line = lines[i];

Просмотреть файл

@ -10,14 +10,15 @@
'use strict'; 'use strict';
import type {SpyData} from '../BatchedBridge/MessageQueue';
const JSEventLoopWatchdog = require('./JSEventLoopWatchdog'); const JSEventLoopWatchdog = require('./JSEventLoopWatchdog');
const MessageQueue = require('../BatchedBridge/MessageQueue');
const MessageQueue = require('../BatchedBridge/MessageQueue');
const infoLog = require('../Utilities/infoLog'); const infoLog = require('../Utilities/infoLog');
const BridgeSpyStallHandler = { const BridgeSpyStallHandler = {
register: function () { register: function () {
let spyBuffer = []; let spyBuffer: Array<SpyData> = [];
MessageQueue.spy(data => { MessageQueue.spy(data => {
spyBuffer.push(data); spyBuffer.push(data);
}); });
@ -27,7 +28,7 @@ const BridgeSpyStallHandler = {
infoLog( infoLog(
spyBuffer.length + ' bridge messages during stall: ', spyBuffer.length + ' bridge messages during stall: ',
spyBuffer.map(info => { spyBuffer.map(info => {
let args = '<args>'; let args: string | Array<?string> = '<args>';
try { try {
args = JSON.stringify(info.args); args = JSON.stringify(info.args);
} catch (e1) { } catch (e1) {

Просмотреть файл

@ -154,7 +154,7 @@ const _interactionSet = new Set();
const _addInteractionSet = new Set(); const _addInteractionSet = new Set();
const _deleteInteractionSet = new Set(); const _deleteInteractionSet = new Set();
const _taskQueue = new TaskQueue({onMoreTasks: _scheduleUpdate}); const _taskQueue = new TaskQueue({onMoreTasks: _scheduleUpdate});
let _nextUpdateHandle = 0; let _nextUpdateHandle: $FlowFixMe | TimeoutID = 0;
let _inc = 0; let _inc = 0;
let _deadline = -1; let _deadline = -1;

Просмотреть файл

@ -1128,7 +1128,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
)} )}
</VirtualizedListContextProvider> </VirtualizedListContextProvider>
); );
let ret = innerRet; let ret: React.Node = innerRet;
if (__DEV__) { if (__DEV__) {
ret = ( ret = (
<ScrollView.Context.Consumer> <ScrollView.Context.Consumer>
@ -1742,7 +1742,10 @@ class VirtualizedList extends React.PureComponent<Props, State> {
return; return;
} }
this.setState(state => { this.setState(state => {
let newState; let newState: ?(
| {first: number, last: number, ...}
| $TEMPORARY$object<{first: number, last: number}>
);
const {contentLength, offset, visibleLength} = this._scrollMetrics; const {contentLength, offset, visibleLength} = this._scrollMetrics;
if (!isVirtualizationDisabled) { if (!isVirtualizationDisabled) {
// If we run this with bogus data, we'll force-render window {first: 0, last: 0}, // If we run this with bogus data, we'll force-render window {first: 0, last: 0},
@ -2109,7 +2112,7 @@ function describeNestedLists(childList: {
` listKey: ${childList.key}\n` + ` listKey: ${childList.key}\n` +
` cellKey: ${childList.cellKey}`; ` cellKey: ${childList.cellKey}`;
let debugInfo = childList.parentDebugInfo; let debugInfo: ?ListDebugInfo = childList.parentDebugInfo;
while (debugInfo) { while (debugInfo) {
trace += trace +=
`\n Parent (${debugInfo.horizontal ? 'horizontal' : 'vertical'}):\n` + `\n Parent (${debugInfo.horizontal ? 'horizontal' : 'vertical'}):\n` +

Просмотреть файл

@ -156,7 +156,7 @@ function appendNewLog(newLog) {
// sybolication for up to a second before adding the log. // sybolication for up to a second before adding the log.
const OPTIMISTIC_WAIT_TIME = 1000; const OPTIMISTIC_WAIT_TIME = 1000;
let addPendingLog = () => { let addPendingLog: ?() => void = () => {
logs.add(newLog); logs.add(newLog);
if (_selectedIndex < 0) { if (_selectedIndex < 0) {
setSelectedLog(logs.size - 1); setSelectedLog(logs.size - 1);

Просмотреть файл

@ -88,7 +88,7 @@ class AppContainer extends React.Component<Props, State> {
} }
} }
let innerView = ( let innerView: React.Node = (
<View <View
collapsable={!this.state.inspector} collapsable={!this.state.inspector}
key={this.state.mainKey} key={this.state.mainKey}

Просмотреть файл

@ -43,7 +43,10 @@ export function createStringifySafeWithLimits(limits: {|
return value; return value;
} }
let retval = value; let retval:
| string
| {+[string]: mixed}
| $TEMPORARY$object<{'...(truncated keys)...': number}> = value;
if (Array.isArray(value)) { if (Array.isArray(value)) {
if (stack.length >= maxDepth) { if (stack.length >= maxDepth) {
retval = `[ ... array with ${value.length} values ... ]`; retval = `[ ... array with ${value.length} values ... ]`;

Просмотреть файл

@ -230,7 +230,7 @@ class WebSocket extends (EventTarget(...WEBSOCKET_EVENTS): any) {
if (ev.id !== this._socketId) { if (ev.id !== this._socketId) {
return; return;
} }
let data = ev.data; let data: Blob | BlobData | ArrayBuffer | string = ev.data;
switch (ev.type) { switch (ev.type) {
case 'binary': case 'binary':
data = base64.toByteArray(ev.data).buffer; data = base64.toByteArray(ev.data).buffer;

Просмотреть файл

@ -195,7 +195,7 @@ class ArrayProperty extends Property {
getFullCppType(): string { getFullCppType(): string {
let elemType: string = 'folly::dynamic'; let elemType: string = 'folly::dynamic';
let recursive = false; let recursive: ?(false | boolean) = false;
if (this.items) { if (this.items) {
if (this.items.type) { if (this.items.type) {

Просмотреть файл

@ -228,7 +228,7 @@ class CheckboxExample extends React.Component<
}; };
_onCheckboxPress = () => { _onCheckboxPress = () => {
let checkboxState = false; let checkboxState: boolean | $TEMPORARY$string<'mixed'> = false;
if (this.state.checkboxState === false) { if (this.state.checkboxState === false) {
checkboxState = 'mixed'; checkboxState = 'mixed';
} else if (this.state.checkboxState === 'mixed') { } else if (this.state.checkboxState === 'mixed') {