2019-08-28 01:54:01 +08:00
|
|
|
/**
|
|
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
|
|
|
*
|
|
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
|
|
|
|
*
|
|
|
|
|
* @flow
|
|
|
|
|
*/
|
2019-01-23 03:04:37 +08:00
|
|
|
|
2019-08-14 08:58:03 +08:00
|
|
|
import {createContext} from 'react';
|
2019-01-23 03:04:37 +08:00
|
|
|
import Store from '../store';
|
|
|
|
|
|
2019-12-19 04:12:34 +08:00
|
|
|
import type {ViewAttributeSource} from 'react-devtools-shared/src/devtools/views/DevTools';
|
2019-08-14 08:58:03 +08:00
|
|
|
import type {FrontendBridge} from 'react-devtools-shared/src/bridge';
|
2019-07-21 05:08:23 +08:00
|
|
|
|
|
|
|
|
export const BridgeContext = createContext<FrontendBridge>(
|
2019-08-14 08:58:03 +08:00
|
|
|
((null: any): FrontendBridge),
|
2019-07-21 05:08:23 +08:00
|
|
|
);
|
2019-02-05 01:49:30 +08:00
|
|
|
BridgeContext.displayName = 'BridgeContext';
|
|
|
|
|
|
2019-01-24 00:45:19 +08:00
|
|
|
export const StoreContext = createContext<Store>(((null: any): Store));
|
2019-02-02 01:25:54 +08:00
|
|
|
StoreContext.displayName = 'StoreContext';
|
2019-12-19 04:12:34 +08:00
|
|
|
|
|
|
|
|
export type ContextMenuContextType = {|
|
|
|
|
|
isEnabledForInspectedElement: boolean,
|
2020-03-04 04:46:24 +08:00
|
|
|
viewAttributeSourceFunction: ViewAttributeSource | null,
|
2019-12-19 04:12:34 +08:00
|
|
|
|};
|
|
|
|
|
|
|
|
|
|
export const ContextMenuContext = createContext<ContextMenuContextType>({
|
|
|
|
|
isEnabledForInspectedElement: false,
|
|
|
|
|
viewAttributeSourceFunction: null,
|
|
|
|
|
});
|
|
|
|
|
ContextMenuContext.displayName = 'ContextMenuContext';
|