1 | import type * as React from 'react';
|
2 |
|
3 | export type Font = {
|
4 | fontFamily: string;
|
5 | fontWeight?:
|
6 | | 'normal'
|
7 | | 'bold'
|
8 | | '100'
|
9 | | '200'
|
10 | | '300'
|
11 | | '400'
|
12 | | '500'
|
13 | | '600'
|
14 | | '700'
|
15 | | '800'
|
16 | | '900';
|
17 | };
|
18 |
|
19 | export type Fonts = {
|
20 | regular: Font;
|
21 | medium: Font;
|
22 | light: Font;
|
23 | thin: Font;
|
24 | };
|
25 |
|
26 | type Mode = 'adaptive' | 'exact';
|
27 |
|
28 | export type Theme = {
|
29 | dark: boolean;
|
30 | mode?: Mode;
|
31 | roundness: number;
|
32 | colors: {
|
33 | primary: string;
|
34 | background: string;
|
35 | surface: string;
|
36 | accent: string;
|
37 | error: string;
|
38 | text: string;
|
39 | onSurface: string;
|
40 | disabled: string;
|
41 | placeholder: string;
|
42 | backdrop: string;
|
43 | notification: string;
|
44 | };
|
45 | fonts: Fonts;
|
46 | animation: {
|
47 | scale: number;
|
48 | };
|
49 | };
|
50 |
|
51 | export type $Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
|
52 | export type $RemoveChildren<T extends React.ComponentType<any>> = $Omit<
|
53 | React.ComponentPropsWithoutRef<T>,
|
54 | 'children'
|
55 | >;
|
56 |
|
57 | export type EllipsizeProp = 'head' | 'middle' | 'tail' | 'clip';
|
58 |
|
59 | declare global {
|
60 | namespace ReactNativePaper {
|
61 | interface ThemeFont {
|
62 | fontFamily: string;
|
63 | fontWeight?:
|
64 | | 'normal'
|
65 | | 'bold'
|
66 | | '100'
|
67 | | '200'
|
68 | | '300'
|
69 | | '400'
|
70 | | '500'
|
71 | | '600'
|
72 | | '700'
|
73 | | '800'
|
74 | | '900';
|
75 | }
|
76 | interface ThemeFonts {
|
77 | regular: ThemeFont;
|
78 | medium: ThemeFont;
|
79 | light: ThemeFont;
|
80 | thin: ThemeFont;
|
81 | }
|
82 | interface ThemeColors {
|
83 | primary: string;
|
84 | background: string;
|
85 | surface: string;
|
86 | accent: string;
|
87 | error: string;
|
88 | text: string;
|
89 | onSurface: string;
|
90 | disabled: string;
|
91 | placeholder: string;
|
92 | backdrop: string;
|
93 | notification: string;
|
94 | }
|
95 |
|
96 | interface ThemeAnimation {
|
97 | scale: number;
|
98 | }
|
99 |
|
100 | interface Theme {
|
101 | dark: boolean;
|
102 | mode?: Mode;
|
103 | roundness: number;
|
104 | colors: ThemeColors;
|
105 | fonts: ThemeFonts;
|
106 | animation: ThemeAnimation;
|
107 | }
|
108 | }
|
109 | }
|