-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
52 lines (44 loc) · 1.71 KB
/
index.d.ts
File metadata and controls
52 lines (44 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import * as React from 'react';
export type Theme = 'light' | 'dark';
export type HighContrast = 'normal' | 'high';
export type ColorBlindMode = 'deuteranopia' | 'protanopia' | 'tritanopia';
export type Adaptation = 'none' | 'darken' | 'lighten';
export interface MorphContextValue {
theme: Theme;
systemPreference: 'dark' | 'light' | 'no-preference';
timeOfDay: 'day' | 'night';
appBrightness: 'light' | 'dark' | null;
adaptation: Adaptation;
isAdapted: boolean;
wcag: { passing: boolean; violations: any[]; level: string };
highContrast: HighContrast;
forcedColors: boolean;
colorBlindMode: ColorBlindMode | null;
prefersReducedMotion: boolean;
language: string;
framework: string | null;
safeMode: boolean;
}
export interface MorphProviderProps {
children: React.ReactNode;
/** Force a specific color-blindness palette regardless of system signal. */
colorBlindMode?: ColorBlindMode;
/** Detect-only mode — no DOM mutation, no class injection, no CSS overrides. */
safeMode?: boolean;
}
export interface ThemeResult {
theme: Theme;
prefersReducedMotion: boolean;
}
export interface AccessibilityResult {
highContrast: HighContrast;
forcedColors: boolean;
colorBlindMode: ColorBlindMode | null;
}
export declare function MorphProvider(props: MorphProviderProps): React.JSX.Element;
export declare function useMorph(): MorphContextValue;
export declare function useTheme(): ThemeResult;
export declare function useAccessibility(options?: { colorBlindMode?: ColorBlindMode }): AccessibilityResult;
export declare const MorphContext: React.Context<MorphContextValue | null>;
/** Blocking script to inject in <head> to prevent flash of wrong theme. */
export declare const morphHeadScript: string;