driver.js / src /config.ts
kamrify's picture
Add disallow close functionality
4c98241
raw
history blame
459 Bytes
export type Config = {
animate?: boolean;
allowClose?: boolean;
};
let currentConfig: Config = {};
export function configure(config: Config = {}) {
currentConfig = {
animate: true,
allowClose: true,
...config,
};
}
export function getConfig(): Config;
export function getConfig<K extends keyof Config>(key: K): Config[K];
export function getConfig<K extends keyof Config>(key?: K) {
return key ? currentConfig[key] : currentConfig;
}