forked from uber/baseweb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
95 lines (84 loc) · 2.58 KB
/
index.d.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
import * as React from 'react';
import {
StyleObject,
StyletronComponent,
WithStyleFn as StyletronWithStyleFn,
StyledFn as StyletronStyledFn,
} from 'styletron-react';
import {Override, Overrides} from './overrides';
import {Locale} from './locale';
import {Theme, ThemePrimitives} from './theme';
type UseStyletronFn<Theme> = () => [(arg: StyleObject) => string, Theme];
export function createThemedUseStyletron<Theme>(): UseStyletronFn<Theme>;
export const useStyletron: UseStyletronFn<Theme>;
export function createTheme<P extends object>(
primitives: ThemePrimitives,
overrides?: P,
): Theme & P;
export function mergeOverrides<T>(
target?: Overrides<T>,
source?: Overrides<T>,
): Overrides<T>;
export function styled<
P extends object,
C extends keyof JSX.IntrinsicElements | React.ComponentType<any>,
T = Theme
>(
component: C,
styledFn: StyleObject | ((props: {$theme: T} & P) => StyleObject),
): StyletronComponent<
Pick<
React.ComponentProps<C>,
Exclude<keyof React.ComponentProps<C>, {className: string}>
> &
P
>;
export const LightTheme: Theme;
export const LightThemeMove: Theme;
export const lightThemePrimitives: ThemePrimitives;
export const DarkTheme: Theme;
export const DarkThemeMove: Theme;
export const darkThemePrimitives: ThemePrimitives;
export interface BaseProviderOverrides {
AppContainer?: Override<any>;
LayersContainer?: Override<any>;
}
export interface BaseProviderProps {
children: React.ReactNode;
theme: Theme;
overrides?: BaseProviderOverrides;
}
export const BaseProvider: React.FC<BaseProviderProps>;
export interface LocaleProviderProps {
locale: Partial<Locale>;
children?: React.ReactNode;
}
export const LocaleProvider: React.FC<LocaleProviderProps>;
export interface ThemeProviderProps {
theme: Theme;
children?: React.ReactNode;
}
export const ThemeProvider: React.FC<ThemeProviderProps>;
export interface StyledFn<T> extends StyletronStyledFn {
<
C extends keyof JSX.IntrinsicElements | React.ComponentType<any>,
P extends object
>(
component: C,
style: (props: {$theme: T} & P) => StyleObject,
): StyletronComponent<
Pick<
React.ComponentProps<C>,
Exclude<keyof React.ComponentProps<C>, {className: string}>
> &
P
>;
}
export function createThemedStyled<Theme>(): StyledFn<Theme>;
export interface WithStyleFn<T = Theme> extends StyletronWithStyleFn {
<C extends StyletronComponent<any>, P extends object, T1 = T>(
component: C,
style: (props: P & {$theme: T1}) => StyleObject,
): StyletronComponent<React.ComponentProps<C> & P>;
}
export const withStyle: WithStyleFn;