-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
37 lines (31 loc) · 973 Bytes
/
types.ts
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
import { BaseTheme } from '@shopify/restyle'
import * as defaultColors from '@eva-design/material/themes/dark.json'
import { IconPack } from '@ui-kitten/components'
export type ThemeName = 'light' | 'dark'
export type Themes = Record<ThemeName, Record<string, string> | undefined>
export type ThemeContextValue = {
currentTheme: ThemeName
toggleTheme: () => void
isDarkMode: () => boolean
}
type IconsProp = IconPack<unknown> | IconPack<unknown>[]
export interface ThemeProviderProps {
iconPack?: IconsProp
appMappings?: Record<string, unknown>
appThemes?: Themes
restyle?: Theme
children: React.ReactNode
}
type Colors = typeof defaultColors
type Spacing = Record<
'xxs' | 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxl',
number
>
export interface Theme extends Exclude<BaseTheme, 'colors' | 'spacing'> {
colors: Colors
spacing: Spacing
}
export type ProvidersProps = {
theme?: Theme
children: React.ReactNode | React.ReactNode[]
}