mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-19 05:53:47 +00:00
17 lines
656 B
TypeScript
17 lines
656 B
TypeScript
import type Bottle from 'bottlejs';
|
|
import { csvToJson, jsonToCsv } from '../helpers/csvjson';
|
|
import { useTimeoutToggle } from '../helpers/hooks';
|
|
import { LocalStorage } from './LocalStorage';
|
|
|
|
export const provideServices = (bottle: Bottle) => {
|
|
bottle.constant('localStorage', window.localStorage);
|
|
bottle.service('Storage', LocalStorage, 'localStorage');
|
|
|
|
bottle.constant('csvToJson', csvToJson);
|
|
bottle.constant('jsonToCsv', jsonToCsv);
|
|
|
|
bottle.constant('setTimeout', window.setTimeout);
|
|
bottle.constant('clearTimeout', window.clearTimeout);
|
|
bottle.serviceFactory('useTimeoutToggle', useTimeoutToggle, 'setTimeout', 'clearTimeout');
|
|
};
|