UNPKG

theme-selector

Version:

A simple Svelte store library that lets you switch between light and dark themes, with support for system theme by default.

16 lines (15 loc) 691 B
import { type Readable, type Subscriber, type Unsubscriber } from 'svelte/store'; type themeSelect = 'system' | 'light' | 'dark'; declare class Theme implements Readable<'light' | 'dark'> { #private; onThemeChange?: (theme: 'light' | 'dark') => void; value: themeSelect; constructor(onThemeChange?: (theme: 'light' | 'dark') => void); private initialize; get(): 'light' | 'dark'; set(value: themeSelect): void; subscribe(run: Subscriber<'light' | 'dark'>, invalidate?: Subscriber<'light' | 'dark'>): Unsubscriber; } export declare const createThemeStore: (calledFunc: (theme: "light" | "dark") => void) => Theme; export declare const theme: Theme; export {};