import { HistorySinks, HistorySources } from './types'; import { IOComponent } from '@motorcycle/types'; /** * Given implementations of the `Location` and `History` interfaces, it returns * an IOComponent function which facilitates performing side-effects with * the history API. * @name makeHistoryComponent(location: Location, history: History): IOComponent> * @example * import { run } from '@motorcycle/run' * import { makeDomComponent, makeHistoryComponent } from '@motorcycle/dom' * import { UI } from './ui' * * const rootElementSelector = '#app' * const element = document.querySelector(rootElementSelector) * * if (!element) throw new Error(`Unable to find element by '${rootElementSelector}'`) * * const Dom = makeDomComponent(element) * const History = makeHistoryComponent(location, history) * * function IO(sinks) { * return { * ...Dom(sinks), * ...History(sinks), * } * } * * run(UI, IO) */ export declare function makeHistoryComponent(location: Location, history: History): IOComponent>;