mirror of
https://github.com/jakejarvis/dark-mode.git
synced 2025-09-11 08:19:04 -04:00
much simpler bundling with rollup, also generate separate ESM and CJS files
This commit is contained in:
6
src/index.d.ts
vendored
6
src/index.d.ts
vendored
@@ -1,10 +1,8 @@
|
||||
export as namespace darkMode;
|
||||
|
||||
export interface DarkModeOptions {
|
||||
interface DarkModeOptions {
|
||||
toggle?: HTMLElement;
|
||||
classes?: { dark: string, light: string };
|
||||
default?: string;
|
||||
storageKey?: string;
|
||||
}
|
||||
|
||||
export function init(options?: Partial<DarkModeOptions>): void;
|
||||
export function init(options?: DarkModeOptions): void;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
"use strict";
|
||||
|
||||
const initializeDarkMode = function (options) {
|
||||
const init = function (options) {
|
||||
// { toggle, classes: { light, dark }, default, storageKey }
|
||||
options = options || {};
|
||||
|
||||
@@ -101,4 +101,4 @@ const isStorageAvailable = function () {
|
||||
}
|
||||
};
|
||||
|
||||
module.exports.init = initializeDarkMode;
|
||||
export { init };
|
||||
|
Reference in New Issue
Block a user