npm.io
1.1.4 • Published 3 years ago

@types/use-color-scheme

Licence
MIT
Version
1.1.4
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
51.5K

Installation

npm install --save @types/use-color-scheme

Summary

This package contains type definitions for use-color-scheme (https://github.com/mujo-code/use-color-scheme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/use-color-scheme.

index.d.ts

type Preference = typeof PREFERENCES[keyof typeof PREFERENCES];

export const PREFERENCES: {
    DARK: "dark";
    LIGHT: "light";
    NONE: "no-preference";
};

export const values: Array<typeof PREFERENCES[keyof typeof PREFERENCES]>;

export function makeQuery(pref: Preference): string;
export function matchPreference(pref: Preference): MediaQueryList;
export function getPreference(preferences: Preference[]): Preference;
export function attachListener(pref: Preference, setScheme: (pref: Preference) => void): () => void;
export function useColorScheme(): { scheme: Preference };

export {};

Additional Details

  • Last updated: Tue, 07 Nov 2023 1536 GMT
  • Dependencies: none

Credits

These definitions were written by Marton Lederer.