Moved NavPlugin types into seperate file

Summary: Moved Flow types into their own file. I will be adding more types as part of the auto complete for the navigation bar and this is to keep the code more organized.

Reviewed By: danielbuechele

Differential Revision: D16540279

fbshipit-source-id: d69ac0d05f91e9d92fcda37325c791ddc83a52c9
This commit is contained in:
Benjamin Elo
2019-07-29 03:44:54 -07:00
committed by Facebook Github Bot
parent 84f9a1d8b5
commit 292efb0bb3
8 changed files with 39 additions and 25 deletions

View File

@@ -8,7 +8,7 @@
import NavigationPlugin from '../';
import type {PersistedState} from '../';
import type {PersistedState} from '../flow-types';
function constructPersistedStateMock(): PersistedState {
return {

View File

@@ -8,7 +8,7 @@
import {DetailSidebar, FlexCenter, styled, colors} from 'flipper';
import type {Bookmark} from '../';
import type {Bookmark} from '../flow-types';
type Props = {|
bookmarks: Map<string, Bookmark>,

View File

@@ -9,7 +9,7 @@
import {Button, FlexColumn, Input, Sheet, styled} from 'flipper';
import {useState} from 'react';
import type {Bookmark} from '../';
import type {Bookmark} from '../flow-types';
type Props = {|
uri: ?string,

View File

@@ -16,7 +16,7 @@ import {
} from 'flipper';
import {IconButton, FavoriteButton} from './';
import type {Bookmark} from '../';
import type {Bookmark} from '../flow-types';
type Props = {|
onFavorite: (query: string) => void,

View File

@@ -9,7 +9,7 @@
import {styled} from 'flipper';
import {NavigationInfoBox} from './';
import type {Bookmark, NavigationEvent} from '../';
import type {Bookmark, NavigationEvent} from '../flow-types';
type Props = {|
bookmarks: Map<string, Bookmark>,

View File

@@ -0,0 +1,27 @@
/**
* 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 State = {|
bookmarks: Map<string, Bookmark>,
shouldShowSaveBookmarkDialog: boolean,
saveBookmarkURI: ?string,
|};
export type PersistedState = {|
navigationEvents: Array<NavigationEvent>,
|};
export type NavigationEvent = {|
date: ?Date,
uri: ?string,
|};
export type Bookmark = {|
uri: string,
commonName: string,
|};

View File

@@ -16,25 +16,12 @@ import {
} from './components';
import {readBookmarksFromDB, writeBookmarkToDB} from './util/indexedDB';
type State = {|
bookmarks: Map<string, Bookmark>,
shouldShowSaveBookmarkDialog: boolean,
saveBookmarkURI: ?string,
|};
export type NavigationEvent = {|
date: ?Date,
uri: ?string,
|};
export type Bookmark = {|
uri: string,
commonName: string,
|};
export type PersistedState = {|
navigationEvents: Array<NavigationEvent>,
|};
import type {
State,
PersistedState,
Bookmark,
NavigationEvent,
} from './flow-types';
export default class extends FlipperPlugin<State, {}, PersistedState> {
static title = 'Navigation';

View File

@@ -6,7 +6,7 @@
* @flow strict-local
*/
import type {Bookmark} from '../';
import type {Bookmark} from '../flow-types';
const FLIPPER_NAVIGATION_PLUGIN_DB = 'flipper_navigation_plugin_db';
const FLIPPER_NAVIGATION_PLUGIN_DB_VERSION = 1;