import { IUiSettingsClient } from 'src/core/public' ; import { IStorageWrapper } from 'src/plugins/opensearch_dashboards_utils/public' ; import { Query } from '../../../common' ; import { getQueryLog } from './get_query_log' ; interface AddToQueryLogDependencies { uiSettings : IUiSettingsClient ; storage : IStorageWrapper ; } export function createAddToQueryLog ( { storage , uiSettings } ) { param appName param query return function addToQueryLog ( appName , { language , query } ) { const persistedLog = getQueryLog ( uiSettings , storage , appName , language ) ; persistedLog . add ( query ) ; } ; }