1
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:
2021-08-04 19:16:33 -04:00
parent 1c2b15d70f
commit eedd0a96e0
10 changed files with 2411 additions and 984 deletions

6
src/index.d.ts vendored
View File

@@ -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;

View File

@@ -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 };