From 4e71d9b1eaf4fb106bddd2961986b2808d190cfb Mon Sep 17 00:00:00 2001 From: Benjamin Elo Date: Thu, 5 Sep 2019 05:47:57 -0700 Subject: [PATCH] Removed flow-types file Summary: This completes the navigation plugin ts migration by removing the flow types file. Reviewed By: passy Differential Revision: D17181605 fbshipit-source-id: b4931d28664e990c37dea229a7fe3f52685e5ee7 --- src/chrome/LocationsButton.tsx | 9 +++-- src/plugins/navigation/flow-types.js | 53 ---------------------------- 2 files changed, 4 insertions(+), 58 deletions(-) delete mode 100644 src/plugins/navigation/flow-types.js diff --git a/src/chrome/LocationsButton.tsx b/src/chrome/LocationsButton.tsx index e84d32c25..43b771a75 100644 --- a/src/chrome/LocationsButton.tsx +++ b/src/chrome/LocationsButton.tsx @@ -10,7 +10,7 @@ import {connect} from 'react-redux'; import React, {Component} from 'react'; import {State as Store} from '../reducers'; import {readBookmarksFromDB} from '../plugins/navigation/util/indexedDB'; -import {State as NavPluginState} from '../plugins/navigation/flow-types'; +import {PersistedState as NavPluginState} from '../plugins/navigation/types'; import BaseDevice from '../devices/BaseDevice'; import {State as PluginState} from 'src/reducers/pluginStates'; @@ -109,10 +109,9 @@ class LocationsButton extends Component { } const mapStateFromPluginStatesToProps = (pluginStates: PluginState) => { - const navPluginState: NavPluginState = - pluginStates[ - Object.keys(pluginStates).find(key => /#Navigation$/.test(key)) - ]; + const navPluginState = pluginStates[ + Object.keys(pluginStates).find(key => /#Navigation$/.test(key)) + ] as (NavPluginState | null); const currentURI = navPluginState && navPluginState.currentURI; return { currentURI, diff --git a/src/plugins/navigation/flow-types.js b/src/plugins/navigation/flow-types.js deleted file mode 100644 index 47f8418d3..000000000 --- a/src/plugins/navigation/flow-types.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright 2018-present Facebook. - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * @format - * @flow strict-local - */ - -export type URI = string; - -export type State = {| - shouldShowSaveBookmarkDialog: boolean, - shouldShowURIErrorDialog: boolean, - saveBookmarkURI: ?URI, - requiredParameters: Array, -|}; - -export type PersistedState = {| - bookmarks: Map, - navigationEvents: Array, - bookmarksProvider: AutoCompleteProvider, - appMatchPatterns: Array, - appMatchPatternsProvider: AutoCompleteProvider, - currentURI: string, -|}; - -export type NavigationEvent = {| - date: ?Date, - uri: ?URI, - className: ?string, - screenshot: ?string, -|}; - -export type Bookmark = {| - uri: URI, - commonName: string, -|}; - -export type AutoCompleteProvider = {| - icon: string, - matchPatterns: Map, -|}; - -export type AutoCompleteLineItem = {| - icon: string, - matchPattern: string, - uri: URI, -|}; - -export type AppMatchPattern = {| - className: string, - pattern: string, -|};