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:
committed by
Facebook Github Bot
parent
84f9a1d8b5
commit
292efb0bb3
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
import NavigationPlugin from '../';
|
import NavigationPlugin from '../';
|
||||||
|
|
||||||
import type {PersistedState} from '../';
|
import type {PersistedState} from '../flow-types';
|
||||||
|
|
||||||
function constructPersistedStateMock(): PersistedState {
|
function constructPersistedStateMock(): PersistedState {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
import {DetailSidebar, FlexCenter, styled, colors} from 'flipper';
|
import {DetailSidebar, FlexCenter, styled, colors} from 'flipper';
|
||||||
|
|
||||||
import type {Bookmark} from '../';
|
import type {Bookmark} from '../flow-types';
|
||||||
|
|
||||||
type Props = {|
|
type Props = {|
|
||||||
bookmarks: Map<string, Bookmark>,
|
bookmarks: Map<string, Bookmark>,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
import {Button, FlexColumn, Input, Sheet, styled} from 'flipper';
|
import {Button, FlexColumn, Input, Sheet, styled} from 'flipper';
|
||||||
import {useState} from 'react';
|
import {useState} from 'react';
|
||||||
|
|
||||||
import type {Bookmark} from '../';
|
import type {Bookmark} from '../flow-types';
|
||||||
|
|
||||||
type Props = {|
|
type Props = {|
|
||||||
uri: ?string,
|
uri: ?string,
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import {
|
|||||||
} from 'flipper';
|
} from 'flipper';
|
||||||
import {IconButton, FavoriteButton} from './';
|
import {IconButton, FavoriteButton} from './';
|
||||||
|
|
||||||
import type {Bookmark} from '../';
|
import type {Bookmark} from '../flow-types';
|
||||||
|
|
||||||
type Props = {|
|
type Props = {|
|
||||||
onFavorite: (query: string) => void,
|
onFavorite: (query: string) => void,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
import {styled} from 'flipper';
|
import {styled} from 'flipper';
|
||||||
import {NavigationInfoBox} from './';
|
import {NavigationInfoBox} from './';
|
||||||
|
|
||||||
import type {Bookmark, NavigationEvent} from '../';
|
import type {Bookmark, NavigationEvent} from '../flow-types';
|
||||||
|
|
||||||
type Props = {|
|
type Props = {|
|
||||||
bookmarks: Map<string, Bookmark>,
|
bookmarks: Map<string, Bookmark>,
|
||||||
|
|||||||
27
src/plugins/navigation/flow-types.js
Normal file
27
src/plugins/navigation/flow-types.js
Normal 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,
|
||||||
|
|};
|
||||||
@@ -16,25 +16,12 @@ import {
|
|||||||
} from './components';
|
} from './components';
|
||||||
import {readBookmarksFromDB, writeBookmarkToDB} from './util/indexedDB';
|
import {readBookmarksFromDB, writeBookmarkToDB} from './util/indexedDB';
|
||||||
|
|
||||||
type State = {|
|
import type {
|
||||||
bookmarks: Map<string, Bookmark>,
|
State,
|
||||||
shouldShowSaveBookmarkDialog: boolean,
|
PersistedState,
|
||||||
saveBookmarkURI: ?string,
|
Bookmark,
|
||||||
|};
|
NavigationEvent,
|
||||||
|
} from './flow-types';
|
||||||
export type NavigationEvent = {|
|
|
||||||
date: ?Date,
|
|
||||||
uri: ?string,
|
|
||||||
|};
|
|
||||||
|
|
||||||
export type Bookmark = {|
|
|
||||||
uri: string,
|
|
||||||
commonName: string,
|
|
||||||
|};
|
|
||||||
|
|
||||||
export type PersistedState = {|
|
|
||||||
navigationEvents: Array<NavigationEvent>,
|
|
||||||
|};
|
|
||||||
|
|
||||||
export default class extends FlipperPlugin<State, {}, PersistedState> {
|
export default class extends FlipperPlugin<State, {}, PersistedState> {
|
||||||
static title = 'Navigation';
|
static title = 'Navigation';
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* @flow strict-local
|
* @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 = 'flipper_navigation_plugin_db';
|
||||||
const FLIPPER_NAVIGATION_PLUGIN_DB_VERSION = 1;
|
const FLIPPER_NAVIGATION_PLUGIN_DB_VERSION = 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user