import React from 'react' ; import { useHistory } from 'react-router-dom' ; import { FieldIcon } from '@kbn/react-field' ; import { KibanaContextProvider , KibanaReactContextValue , useKibana , useUiSetting , useUiSetting$ , withKibana , reactRouterNavigate , } from '../../../../../../../src/plugins/kibana_react/public' ; import { StartServices } from '../../../types' ; export type KibanaContext = KibanaReactContextValue < StartServices > ; export interface WithKibanaProps { kibana : KibanaContext ; } const useTypedKibana = ( ) => useKibana < StartServices > ( ) ; const isModifiedEvent = ( event ) => ! ! ( event . metaKey || event . altKey || event . ctrlKey || event . shiftKey ) ; const isLeftClickEvent = ( event ) => event . button === 0 ; const useRouterNavigate = ( to , onClickCallback ? ) => { const history = useHistory ( ) ; return reactRouterNavigate ( history , to , onClickCallback ) ; } ; export { KibanaContextProvider , useRouterNavigate , isLeftClickEvent , isModifiedEvent , useTypedKibana as useKibana , useUiSetting , useUiSetting$ , withKibana , FieldIcon , } ;