Bump flow version

Reviewed By: priteshrnandgaonkar

Differential Revision: D12839991

fbshipit-source-id: 1dcca0a0bc682bf24430c7313d4af14b87cfc44d
This commit is contained in:
Pascal Hartig
2018-10-30 16:59:22 -07:00
committed by Facebook Github Bot
parent 5ec2add066
commit 0a6dbfcf3e
10 changed files with 2351 additions and 471 deletions

View File

@@ -23,4 +23,4 @@ module.name_mapper='flipper' -> '<PROJECT_ROOT>/src/index.js'
suppress_type=$FlowFixMe
[version]
0.76.0
^0.84.0

View File

@@ -59,7 +59,7 @@ type Electron$MenuItemOptions = {
};
declare class Electron$MenuItem {
constructor: (options: Electron$MenuItemOptions) => void;
constructor(options: Electron$MenuItemOptions): Electron$MenuItem;
enabled: boolean;
visible: boolean;
checked: boolean;

View File

@@ -1842,11 +1842,11 @@ declare module 'electron' {
((eventName: 'devtools-focused', callback: () => void) => void);
}
declare class BrowserView {
constructor: (
constructor(
options?: ?{
webPreferences?: ?{},
},
) => BrowserView;
): BrowserView;
static getAllViews: () => Array<BrowserView>;
static fromWebContents: (webContents: WebContents) => BrowserView | null;
static fromId: (id: number) => BrowserView;
@@ -1862,7 +1862,7 @@ declare module 'electron' {
id: number;
}
declare class BrowserWindow {
constructor: (
constructor(
options?: ?{
width?: ?number,
height?: ?number,
@@ -1968,7 +1968,7 @@ declare module 'electron' {
navigateOnDragDrop?: ?boolean,
},
},
) => BrowserWindow;
): BrowserWindow;
static getAllWindows: () => Array<BrowserWindow>;
static getFocusedWindow: () => BrowserWindow | null;
static fromWebContents: (webContents: WebContents) => BrowserWindow;
@@ -2237,7 +2237,7 @@ declare module 'electron' {
closed: boolean;
}
declare class ClientRequest {
constructor: (options: Object | string) => ClientRequest;
constructor(options: Object | string): ClientRequest;
setHeader: (name: string, value: {}) => void;
getHeader: (
name: string,
@@ -2463,7 +2463,7 @@ declare module 'electron' {
((eventName: 'error', callback: () => void) => void);
}
declare class Menu {
constructor: () => Menu;
constructor(): Menu;
static setApplicationMenu: (menu: Menu | null) => void;
static getApplicationMenu: () => Menu | null;
static sendActionToFirstResponder: (action: string) => void;
@@ -2500,7 +2500,7 @@ declare module 'electron' {
) => void);
}
declare class MenuItem {
constructor: (options: {
constructor(options: {
click?: ?Function,
role?: ?string,
type?: ?'normal' | 'separator' | 'submenu' | 'checkbox' | 'radio',
@@ -2514,7 +2514,7 @@ declare module 'electron' {
submenu?: ?Array<MenuItemConstructorOptions> | Menu,
id?: ?string,
position?: ?string,
}) => MenuItem;
}): MenuItem;
enabled: boolean;
visible: boolean;
checked: boolean;
@@ -2564,7 +2564,7 @@ declare module 'electron' {
}) => void;
}
declare class Notification {
constructor: (options: {
constructor(options: {
title: string,
subtitle?: ?string,
body: string,
@@ -2575,7 +2575,7 @@ declare module 'electron' {
sound?: ?string,
actions?: ?Array<NotificationAction>,
closeButtonText?: ?string,
}) => Notification;
}): Notification;
static isSupported: () => boolean;
show: () => void;
close: () => void;
@@ -2676,7 +2676,7 @@ declare module 'electron' {
) => void;
}
declare class TouchBar {
constructor: (options: {
constructor(options: {
items: Array<
| TouchBarButton
| TouchBarColorPicker
@@ -2699,7 +2699,7 @@ declare module 'electron' {
| TouchBarSlider
| TouchBarSpacer
| null,
}) => TouchBar;
}): TouchBar;
static TouchBarButton: Class<TouchBarButton>;
static TouchBarColorPicker: Class<TouchBarColorPicker>;
static TouchBarGroup: Class<TouchBarGroup>;
@@ -2712,7 +2712,7 @@ declare module 'electron' {
escapeItem: TouchBarItem;
}
declare class Tray {
constructor: (image: NativeImage | string) => Tray;
constructor(image: NativeImage | string): Tray;
destroy: () => void;
setImage: (image: NativeImage | string) => void;
setPressedImage: (image: NativeImage | string) => void;
@@ -3637,51 +3637,51 @@ declare module 'electron' {
((listener: Function) => void);
}
declare class TouchBarButton {
constructor: (options: {
constructor(options: {
label?: ?string,
backgroundColor?: ?string,
icon?: ?NativeImage,
iconPosition?: ?'left' | 'right' | 'overlay',
click?: ?Function,
}) => TouchBarButton;
}): TouchBarButton;
label: string;
backgroundColor: string;
icon: NativeImage;
}
declare class TouchBarColorPicker {
constructor: (options: {
constructor(options: {
availableColors?: ?Array<string>,
selectedColor?: ?string,
change?: ?Function,
}) => TouchBarColorPicker;
}): TouchBarColorPicker;
availableColors: Array<string>;
selectedColor: string;
}
declare class TouchBarGroup {
constructor: (options: {
constructor(options: {
items: TouchBar,
}) => TouchBarGroup;
}): TouchBarGroup;
}
declare class TouchBarLabel {
constructor: (options: {
constructor(options: {
label?: ?string,
textColor?: ?string,
}) => TouchBarLabel;
}): TouchBarLabel;
label: string;
textColor: string;
}
declare class TouchBarPopover {
constructor: (options: {
constructor(options: {
label?: ?string,
icon?: ?NativeImage,
items?: ?TouchBar,
showCloseButton?: ?boolean,
}) => TouchBarPopover;
}): TouchBarPopover;
label: string;
icon: NativeImage;
}
declare class TouchBarScrubber {
constructor: (options: {
constructor(options: {
items: Array<ScrubberItem>,
select: Function,
highlight: Function,
@@ -3690,7 +3690,7 @@ declare module 'electron' {
showArrowButtons: boolean,
mode: string,
continuous: boolean,
}) => TouchBarScrubber;
}): TouchBarScrubber;
items: Array<ScrubberItem>;
selectedStyle: string;
overlayStyle: string;
@@ -3699,7 +3699,7 @@ declare module 'electron' {
continuous: boolean;
}
declare class TouchBarSegmentedControl {
constructor: (options: {
constructor(options: {
segmentStyle?:
| ?'automatic'
| 'rounded'
@@ -3713,28 +3713,28 @@ declare module 'electron' {
segments: Array<SegmentedControlSegment>,
selectedIndex?: ?number,
change: Function,
}) => TouchBarSegmentedControl;
}): TouchBarSegmentedControl;
segmentStyle: string;
segments: Array<SegmentedControlSegment>;
selectedIndex: number;
}
declare class TouchBarSlider {
constructor: (options: {
constructor(options: {
label?: ?string,
value?: ?number,
minValue?: ?number,
maxValue?: ?number,
change?: ?Function,
}) => TouchBarSlider;
}): TouchBarSlider;
label: string;
value: number;
minValue: number;
maxValue: number;
}
declare class TouchBarSpacer {
constructor: (options: {
constructor(options: {
size?: ?'small' | 'large' | 'flexible',
}) => TouchBarSpacer;
}): TouchBarSpacer;
}
declare type Accelerator = any;
declare type WebFrame = any;

File diff suppressed because it is too large Load Diff

View File

@@ -44,7 +44,7 @@
"eslint-plugin-prettier": "^2.4.0",
"eslint-plugin-react": "^7.5.1",
"eslint-plugin-relay": "^0.0.20",
"flow-bin": "^0.76.0",
"flow-bin": "^0.84.0",
"glob": "^7.1.2",
"jest": "^23.6.0",
"prettier": "1.13.6",

View File

@@ -107,6 +107,7 @@ type TrackArgs = {|
type SearchResultTree = {|
id: string,
isMatch: Boolean,
hasChildren: boolean,
children: ?Array<SearchResultTree>,
element: Element,
axElement: Element,
@@ -476,11 +477,13 @@ export default class Layout extends FlipperPlugin<InspectorState> {
});
}
getElementsFromSearchResultTree(tree: ?SearchResultTree) {
getElementsFromSearchResultTree(
tree: ?SearchResultTree,
): Array<SearchResultTree> {
if (!tree) {
return [];
}
var elements = [
let elements = [
{
id: tree.id,
isMatch: tree.isMatch,

View File

@@ -75,7 +75,7 @@ export default class ErrorBoundary extends Component<
</ErrorBoundaryContainer>
);
} else {
return this.props.children;
return this.props.children || null;
}
}
}

View File

@@ -9,7 +9,7 @@ import type {DataInspectorSetValue} from './DataInspector.js';
import {PureComponent} from 'react';
import styled from '../../styled/index.js';
import {SketchPicker} from 'react-color';
import {Component} from 'react';
import {Component, Fragment} from 'react';
import Popover from '../Popover.js';
import {colors} from '../colors.js';
import Input from '../Input.js';
@@ -294,7 +294,7 @@ class ColorEditor extends Component<{
render() {
const colorInfo = parseColor(this.props.value);
if (!colorInfo) {
return;
return <Fragment />;
}
return (

View File

@@ -464,7 +464,7 @@ export default class DataInspector extends Component<DataInspectorProps> {
}
}
let propertyNodesContainer;
let propertyNodesContainer = null;
if (isExpandable && isExpanded) {
const propertyNodes = [];
@@ -532,7 +532,7 @@ export default class DataInspector extends Component<DataInspectorProps> {
if (typeof name !== 'undefined') {
nameElems.push(
<Tooltip
title={tooltips && tooltips[name]}
title={tooltips != null && tooltips[name]}
key="name"
options={nameTooltipOptions}>
<InspectorName>{name}</InspectorName>

View File

@@ -2803,9 +2803,10 @@ flat-cache@^1.2.1:
graceful-fs "^4.1.2"
write "^0.2.1"
flow-bin@^0.76.0:
version "0.76.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.76.0.tgz#eb00036991c3abc106743fcbc7ee321f02aa4faa"
flow-bin@^0.84.0:
version "0.84.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.84.0.tgz#4cb2364c750fb37a7840524fa62456b53f64cdcb"
integrity sha512-ocji8eEYp+YfICsm+F6cIHUcD7v5sb0/ADEXm6gyUKdjQzmSckMrPUdZtyfP973t3YGHKliUMxMvIBHyR5LbXQ==
flow-parser@^0.*:
version "0.81.0"