diff --git a/assortment__darkmodejs.d.ts b/assortment__darkmodejs.d.ts deleted file mode 100644 index c1e4052..0000000 --- a/assortment__darkmodejs.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -declare module "@assortment/darkmodejs" { - export = assortment__darkmodejs; - - declare function assortment__darkmodejs({ onChange = () => {} }: any): any; -} diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..2794e7b --- /dev/null +++ b/index.d.ts @@ -0,0 +1,18 @@ +declare enum Theme { + DARK = 'dark', + LIGHT = 'light', + NO_PREF = 'no-preference', + NO_SUPP = 'no-support' +} + +interface Config { + onChange: (activeTheme: Theme, themes: typeof Theme) => void; +} + +interface DarkModeJS { + removeListeners: () => void; +} + +declare function darkmodejs(config: Config): DarkModeJS; + +export = darkmodejs;