diff --git a/src/chrome/ShareSheet.js b/src/chrome/ShareSheet.js index 2c7d34e88..cad2630bb 100644 --- a/src/chrome/ShareSheet.js +++ b/src/chrome/ShareSheet.js @@ -23,7 +23,7 @@ import { } from '../reducers/application.tsx'; import type {Logger} from '../fb-interfaces/Logger.js'; 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 PropTypes from 'prop-types'; import {clipboard} from 'electron'; diff --git a/src/chrome/SignInSheet.js b/src/chrome/SignInSheet.js index 6021aceaf..b996e314d 100644 --- a/src/chrome/SignInSheet.js +++ b/src/chrome/SignInSheet.js @@ -17,8 +17,8 @@ import { Link, colors, } from 'flipper'; -import {writeKeychain, getUser} from '../fb-stubs/user'; import {login} from '../reducers/user.tsx'; +import {writeKeychain, getUser} from '../fb-stubs/user.tsx'; import {connect} from 'react-redux'; const Container = styled(FlexColumn)({ diff --git a/src/fb-stubs/user.js b/src/fb-stubs/user.tsx similarity index 68% rename from src/fb-stubs/user.js rename to src/fb-stubs/user.tsx index 04434c516..623b3f4a2 100644 --- a/src/fb-stubs/user.js +++ b/src/fb-stubs/user.tsx @@ -21,20 +21,20 @@ export async function shareFlipperData( trace: string, ): Promise< | { - id: string, - os: 'string', - deviceType: string, - plugins: string[], - fileUrl: string, - flipperUrl: string, + id: string; + os: 'string'; + deviceType: string; + plugins: string[]; + fileUrl: string; + flipperUrl: string; } | { - error: string, - error_class: string, - stacktrace: string, - }, + error: string; + error_class: string; + stacktrace: string; + } > { - new window.Notification('Feature not implemented'); + new Notification('Feature not implemented'); return Promise.reject(); } diff --git a/src/index.js b/src/index.js index b58936f68..56e86a563 100644 --- a/src/index.js +++ b/src/index.js @@ -10,7 +10,7 @@ export * from './ui/index.js'; export * from './utils/index.js'; export {default as GK} from './fb-stubs/GK.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 { FlipperBasePlugin, FlipperPlugin, diff --git a/tsconfig.json b/tsconfig.json index 6f515f360..9ccd48cf5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,6 +16,6 @@ "flipper": ["./src/index.js"] } }, - "include": ["src/**/*", "types/globals.tsx"], + "include": ["src/**/*", "types/globals.tsx", "types/nodejs.tsx"], "exclude": ["node_modules", "**/*.spec.ts"] } diff --git a/types/nodejs.tsx b/types/nodejs.tsx new file mode 100644 index 000000000..dce102805 --- /dev/null +++ b/types/nodejs.tsx @@ -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; + } +}