Migrate user

Summary: Migrate user and introduce a global declarations file.

Reviewed By: danielbuechele

Differential Revision: D16690480

fbshipit-source-id: be4e5218715dcae4b403b24cdbc2f3e89728dd59
This commit is contained in:
Pascal Hartig
2019-08-09 10:32:36 -07:00
committed by Facebook Github Bot
parent 4afc417ea5
commit e56d3a4c6d
6 changed files with 27 additions and 15 deletions

View File

@@ -23,7 +23,7 @@ import {
} from '../reducers/application.tsx'; } from '../reducers/application.tsx';
import type {Logger} from '../fb-interfaces/Logger.js'; import type {Logger} from '../fb-interfaces/Logger.js';
import {Idler} from '../utils/Idler'; import {Idler} from '../utils/Idler';
import {shareFlipperData} from '../fb-stubs/user'; import {shareFlipperData} from '../fb-stubs/user.tsx';
import {exportStore, EXPORT_FLIPPER_TRACE_EVENT} from '../utils/exportData.js'; import {exportStore, EXPORT_FLIPPER_TRACE_EVENT} from '../utils/exportData.js';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import {clipboard} from 'electron'; import {clipboard} from 'electron';

View File

@@ -17,8 +17,8 @@ import {
Link, Link,
colors, colors,
} from 'flipper'; } from 'flipper';
import {writeKeychain, getUser} from '../fb-stubs/user';
import {login} from '../reducers/user.tsx'; import {login} from '../reducers/user.tsx';
import {writeKeychain, getUser} from '../fb-stubs/user.tsx';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
const Container = styled(FlexColumn)({ const Container = styled(FlexColumn)({

View File

@@ -21,20 +21,20 @@ export async function shareFlipperData(
trace: string, trace: string,
): Promise< ): Promise<
| { | {
id: string, id: string;
os: 'string', os: 'string';
deviceType: string, deviceType: string;
plugins: string[], plugins: string[];
fileUrl: string, fileUrl: string;
flipperUrl: string, flipperUrl: string;
} }
| { | {
error: string, error: string;
error_class: string, error_class: string;
stacktrace: string, stacktrace: string;
}, }
> { > {
new window.Notification('Feature not implemented'); new Notification('Feature not implemented');
return Promise.reject(); return Promise.reject();
} }

View File

@@ -10,7 +10,7 @@ export * from './ui/index.js';
export * from './utils/index.js'; export * from './utils/index.js';
export {default as GK} from './fb-stubs/GK.tsx'; export {default as GK} from './fb-stubs/GK.tsx';
export {default as createPaste} from './fb-stubs/createPaste.tsx'; export {default as createPaste} from './fb-stubs/createPaste.tsx';
export {graphQLQuery} from './fb-stubs/user.js'; export {graphQLQuery} from './fb-stubs/user.tsx';
export { export {
FlipperBasePlugin, FlipperBasePlugin,
FlipperPlugin, FlipperPlugin,

View File

@@ -16,6 +16,6 @@
"flipper": ["./src/index.js"] "flipper": ["./src/index.js"]
} }
}, },
"include": ["src/**/*", "types/globals.tsx"], "include": ["src/**/*", "types/globals.tsx", "types/nodejs.tsx"],
"exclude": ["node_modules", "**/*.spec.ts"] "exclude": ["node_modules", "**/*.spec.ts"]
} }

12
types/nodejs.tsx Normal file
View File

@@ -0,0 +1,12 @@
/**
* 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
*/
declare module NodeJS {
interface Global {
electronRequire: (name: string) => void;
}
}