@expo/html-elements 0.12.2 → 0.12.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/build/css/createSafeStyledView.native.d.ts +1 -1
- package/build/css/createSafeStyledView.native.d.ts.map +1 -1
- package/build/elements/Anchor.d.ts +2 -2
- package/build/elements/Anchor.d.ts.map +1 -1
- package/build/elements/Headings.d.ts.map +1 -1
- package/build/elements/Layout.d.ts.map +1 -1
- package/build/elements/Lists.d.ts +2 -2
- package/build/elements/Lists.d.ts.map +1 -1
- package/build/elements/Rules.d.ts +2 -2
- package/build/elements/Rules.d.ts.map +1 -1
- package/build/elements/Rules.web.d.ts +1 -2
- package/build/elements/Rules.web.d.ts.map +1 -1
- package/build/elements/Table.d.ts +9 -9
- package/build/elements/Table.d.ts.map +1 -1
- package/build/elements/Table.web.d.ts.map +1 -1
- package/build/elements/Text.d.ts +15 -15
- package/build/elements/Text.d.ts.map +1 -1
- package/build/primitives/RNWView.d.ts +4 -2
- package/build/primitives/RNWView.d.ts.map +1 -1
- package/build/primitives/createDevView.d.ts +1 -1
- package/build/primitives/createDevView.d.ts.map +1 -1
- package/jest-setup.js +1 -0
- package/package.json +13 -7
- package/{build/Elements.js → src/Elements.tsx} +0 -1
- package/src/css/__tests__/__snapshots__/createSafeStyledView.test.native.tsx.snap.android +31 -0
- package/src/css/__tests__/__snapshots__/createSafeStyledView.test.native.tsx.snap.ios +31 -0
- package/src/css/__tests__/createSafeStyledView.test.native.tsx +54 -0
- package/src/css/createSafeStyledView.native.tsx +12 -0
- package/src/css/createSafeStyledView.tsx +4 -0
- package/src/css/filterStyles.ts +92 -0
- package/src/css/units.ts +11 -0
- package/src/elements/Anchor.tsx +27 -0
- package/src/elements/Headings.tsx +81 -0
- package/src/elements/Layout.tsx +72 -0
- package/src/elements/Lists.tsx +45 -0
- package/src/elements/Rules.tsx +18 -0
- package/src/elements/Rules.web.tsx +7 -0
- package/src/elements/Table.tsx +59 -0
- package/src/elements/Table.web.tsx +38 -0
- package/src/elements/Text.tsx +111 -0
- package/src/elements/Text.types.ts +21 -0
- package/src/elements/__tests__/Anchor.test.ios.tsx +10 -0
- package/src/elements/__tests__/Anchor.test.web.tsx +11 -0
- package/src/elements/__tests__/Headings.test.ios.tsx +13 -0
- package/src/elements/__tests__/Layout.test.ios.tsx +40 -0
- package/src/elements/__tests__/Layout.test.web.tsx +50 -0
- package/src/elements/__tests__/Lists.test.native.tsx +17 -0
- package/src/elements/__tests__/Lists.test.web.tsx +41 -0
- package/src/elements/__tests__/Rules.test.native.tsx +10 -0
- package/src/elements/__tests__/Rules.test.web.tsx +8 -0
- package/src/elements/__tests__/Table.test.ios.tsx +45 -0
- package/src/elements/__tests__/Table.test.web.tsx +49 -0
- package/src/elements/__tests__/Text.test.ios.tsx +102 -0
- package/src/elements/__tests__/__snapshots__/Anchor-test.tsx.snap.android +8 -0
- package/src/elements/__tests__/__snapshots__/Anchor-test.tsx.snap.ios +8 -0
- package/src/elements/__tests__/__snapshots__/Anchor-test.tsx.snap.web +12 -0
- package/src/elements/__tests__/__snapshots__/Anchor.test.ios.tsx.snap.ios +8 -0
- package/src/elements/__tests__/__snapshots__/Anchor.test.tsx.snap.android +8 -0
- package/src/elements/__tests__/__snapshots__/Anchor.test.tsx.snap.ios +8 -0
- package/src/elements/__tests__/__snapshots__/Anchor.test.tsx.snap.web +12 -0
- package/src/elements/__tests__/__snapshots__/Headings-test.tsx.snap.android +79 -0
- package/src/elements/__tests__/__snapshots__/Headings-test.tsx.snap.ios +79 -0
- package/src/elements/__tests__/__snapshots__/Headings-test.tsx.snap.web +61 -0
- package/src/elements/__tests__/__snapshots__/Headings.test.ios.tsx.snap.ios +79 -0
- package/src/elements/__tests__/__snapshots__/Layout-test.tsx.snap.android +23 -0
- package/src/elements/__tests__/__snapshots__/Layout-test.tsx.snap.ios +23 -0
- package/src/elements/__tests__/__snapshots__/Layout-test.tsx.snap.web +64 -0
- package/src/elements/__tests__/__snapshots__/Layout.test.ios.tsx.snap.ios +23 -0
- package/src/elements/__tests__/__snapshots__/Layout.test.tsx.snap.android +23 -0
- package/src/elements/__tests__/__snapshots__/Layout.test.tsx.snap.ios +23 -0
- package/src/elements/__tests__/__snapshots__/Layout.test.tsx.snap.web +64 -0
- package/src/elements/__tests__/__snapshots__/Lists-test.tsx.snap.android +14 -0
- package/src/elements/__tests__/__snapshots__/Lists-test.tsx.snap.ios +14 -0
- package/src/elements/__tests__/__snapshots__/Lists-test.tsx.snap.web +34 -0
- package/src/elements/__tests__/__snapshots__/Lists.test.native.tsx.snap.android +14 -0
- package/src/elements/__tests__/__snapshots__/Lists.test.native.tsx.snap.ios +14 -0
- package/src/elements/__tests__/__snapshots__/Rules-test.tsx.snap.android +15 -0
- package/src/elements/__tests__/__snapshots__/Rules-test.tsx.snap.ios +15 -0
- package/src/elements/__tests__/__snapshots__/Rules-test.tsx.snap.web +7 -0
- package/src/elements/__tests__/__snapshots__/Rules.test.native.tsx.snap.android +15 -0
- package/src/elements/__tests__/__snapshots__/Rules.test.native.tsx.snap.ios +15 -0
- package/src/elements/__tests__/__snapshots__/Table-test.tsx.snap.android +60 -0
- package/src/elements/__tests__/__snapshots__/Table-test.tsx.snap.ios +60 -0
- package/src/elements/__tests__/__snapshots__/Table-test.tsx.snap.web +71 -0
- package/src/elements/__tests__/__snapshots__/Table.test.ios.tsx.snap.ios +60 -0
- package/src/elements/__tests__/__snapshots__/Table.test.tsx.snap.android +60 -0
- package/src/elements/__tests__/__snapshots__/Table.test.tsx.snap.ios +60 -0
- package/src/elements/__tests__/__snapshots__/Table.test.tsx.snap.web +71 -0
- package/src/elements/__tests__/__snapshots__/Text-test.tsx.snap.android +174 -0
- package/src/elements/__tests__/__snapshots__/Text-test.tsx.snap.ios +174 -0
- package/src/elements/__tests__/__snapshots__/Text-test.tsx.snap.web +149 -0
- package/src/elements/__tests__/__snapshots__/Text.test.ios.tsx.snap.ios +174 -0
- package/src/primitives/Image.tsx +30 -0
- package/src/primitives/RNWView.tsx +178 -0
- package/src/primitives/Table.ts +14 -0
- package/src/primitives/Text.tsx +68 -0
- package/src/primitives/View.tsx +145 -0
- package/src/primitives/__tests__/__snapshots__/createDevView.test.ios.tsx.snap.ios +35 -0
- package/src/primitives/__tests__/__snapshots__/createDevView.test.tsx.snap.android +35 -0
- package/src/primitives/__tests__/__snapshots__/createDevView.test.tsx.snap.ios +35 -0
- package/src/primitives/__tests__/__snapshots__/createDevView.test.tsx.snap.web +30 -0
- package/src/primitives/__tests__/__snapshots__/createDevView.test.web.tsx.snap.web +27 -0
- package/src/primitives/__tests__/createDevView.test.tsx +53 -0
- package/src/primitives/createDevView.tsx +48 -0
- package/src/ts-declarations/process.d.ts +7 -0
- package/src/ts-declarations/react-native-web.d.ts +1016 -0
- package/tsconfig.json +2 -2
- package/build/Elements.js.map +0 -1
- package/build/css/createSafeStyledView.js +0 -5
- package/build/css/createSafeStyledView.js.map +0 -1
- package/build/css/createSafeStyledView.native.js +0 -10
- package/build/css/createSafeStyledView.native.js.map +0 -1
- package/build/css/filterStyles.js +0 -83
- package/build/css/filterStyles.js.map +0 -1
- package/build/css/units.js +0 -12
- package/build/css/units.js.map +0 -1
- package/build/elements/Anchor.js +0 -25
- package/build/elements/Anchor.js.map +0 -1
- package/build/elements/Headings.js +0 -78
- package/build/elements/Headings.js.map +0 -1
- package/build/elements/Layout.js +0 -46
- package/build/elements/Layout.js.map +0 -1
- package/build/elements/Lists.js +0 -33
- package/build/elements/Lists.js.map +0 -1
- package/build/elements/Rules.js +0 -16
- package/build/elements/Rules.js.map +0 -1
- package/build/elements/Rules.web.js +0 -6
- package/build/elements/Rules.web.js.map +0 -1
- package/build/elements/Table.js +0 -50
- package/build/elements/Table.js.map +0 -1
- package/build/elements/Table.web.js +0 -27
- package/build/elements/Table.web.js.map +0 -1
- package/build/elements/Text.js +0 -92
- package/build/elements/Text.js.map +0 -1
- package/build/elements/Text.types.js +0 -2
- package/build/elements/Text.types.js.map +0 -1
- package/build/primitives/Image.js +0 -5
- package/build/primitives/Image.js.map +0 -1
- package/build/primitives/RNWView.js +0 -122
- package/build/primitives/RNWView.js.map +0 -1
- package/build/primitives/Table.js +0 -3
- package/build/primitives/Table.js.map +0 -1
- package/build/primitives/Text.js +0 -5
- package/build/primitives/Text.js.map +0 -1
- package/build/primitives/View.js +0 -10
- package/build/primitives/View.js.map +0 -1
- package/build/primitives/createDevView.js +0 -43
- package/build/primitives/createDevView.js.map +0 -1
|
@@ -0,0 +1,1016 @@
|
|
|
1
|
+
// See: https://github.com/necolas/react-native-web/blob/0.20.0/packages/react-native-web/src/exports/createElement/index.js
|
|
2
|
+
declare module 'react-native-web/dist/exports/createElement' {
|
|
3
|
+
export { createElement as default } from 'react';
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
// See: https://github.com/necolas/react-native-web/blob/0.20.0/packages/react-native-web/src/exports/StyleSheet/index.js
|
|
7
|
+
declare module 'react-native-web/dist/exports/StyleSheet' {
|
|
8
|
+
type StyleProps = [string, { [key: string]: any } | null];
|
|
9
|
+
type Options = {
|
|
10
|
+
shadow?: boolean;
|
|
11
|
+
textShadow?: boolean;
|
|
12
|
+
writingDirection: 'ltr' | 'rtl';
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type IStyleSheet = {
|
|
16
|
+
(styles: readonly any[], options?: Options): StyleProps;
|
|
17
|
+
absoluteFill: object;
|
|
18
|
+
absoluteFillObject: object;
|
|
19
|
+
create: typeof create;
|
|
20
|
+
compose: typeof compose;
|
|
21
|
+
flatten: typeof flatten;
|
|
22
|
+
getSheet: typeof getSheet;
|
|
23
|
+
hairlineWidth: number;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const stylesheet: IStyleSheet;
|
|
27
|
+
export default stylesheet;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// See: https://github.com/necolas/react-native-web/blob/0.20.0/packages/react-native-web/src/exports/Text/TextAncestorContext.js
|
|
31
|
+
declare module 'react-native-web/dist/exports/Text/TextAncestorContext' {
|
|
32
|
+
import type { Context } from 'react';
|
|
33
|
+
const textAncestorContext: Context<boolean>;
|
|
34
|
+
export default textAncestorContext;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// See: https://github.com/necolas/react-native-web/blob/0.20.0/packages/react-native-web/src/exports/View/index.js
|
|
38
|
+
declare module 'react-native-web/dist/exports/View' {
|
|
39
|
+
export type { ViewProps } from 'react-native-web/dist/exports/View/types';
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// See: https://github.com/necolas/react-native-web/blob/0.20.0/packages/react-native-web/src/exports/View/types.js
|
|
43
|
+
declare module 'react-native-web/dist/exports/View/types' {
|
|
44
|
+
import type { ColorValue, GenericStyleProp, LayoutEvent } from 'react-native-web/dist/types';
|
|
45
|
+
|
|
46
|
+
import type {
|
|
47
|
+
AnimationStyles,
|
|
48
|
+
BorderStyles,
|
|
49
|
+
InteractionStyles,
|
|
50
|
+
LayoutStyles,
|
|
51
|
+
ShadowStyles,
|
|
52
|
+
TransformStyles,
|
|
53
|
+
} from 'react-native-web/dist/types/styles';
|
|
54
|
+
|
|
55
|
+
type NumberOrString = number | string;
|
|
56
|
+
type OverscrollBehaviorValue = 'auto' | 'contain' | 'none';
|
|
57
|
+
type idRef = string;
|
|
58
|
+
type idRefList = idRef | idRef[];
|
|
59
|
+
|
|
60
|
+
export type AccessibilityProps = {
|
|
61
|
+
'aria-activedescendant'?: idRef | null;
|
|
62
|
+
'aria-atomic'?: boolean | null;
|
|
63
|
+
'aria-autocomplete'?: 'none' | 'list' | 'inline' | 'both' | null;
|
|
64
|
+
'aria-busy'?: boolean | null;
|
|
65
|
+
'aria-checked'?: boolean | 'mixed' | null;
|
|
66
|
+
'aria-colcount'?: number | null;
|
|
67
|
+
'aria-colindex'?: number | null;
|
|
68
|
+
'aria-colspan'?: number | null;
|
|
69
|
+
'aria-controls'?: idRef | null;
|
|
70
|
+
'aria-current'?: boolean | 'page' | 'step' | 'location' | 'date' | 'time' | null;
|
|
71
|
+
'aria-describedby'?: idRef | null;
|
|
72
|
+
'aria-details'?: idRef | null;
|
|
73
|
+
'aria-disabled'?: boolean | null;
|
|
74
|
+
'aria-errormessage'?: idRef | null;
|
|
75
|
+
'aria-expanded'?: boolean | null;
|
|
76
|
+
'aria-flowto'?: idRef | null;
|
|
77
|
+
'aria-haspopup'?: 'dialog' | 'grid' | 'listbox' | 'menu' | 'tree' | false | null;
|
|
78
|
+
'aria-hidden'?: boolean | null;
|
|
79
|
+
'aria-invalid'?: boolean | null;
|
|
80
|
+
'aria-keyshortcuts'?: string[] | null;
|
|
81
|
+
'aria-label'?: string | null;
|
|
82
|
+
'aria-labelledby'?: idRef | null;
|
|
83
|
+
'aria-level'?: number | null;
|
|
84
|
+
'aria-live'?: 'assertive' | 'none' | 'polite' | null;
|
|
85
|
+
'aria-modal'?: boolean | null;
|
|
86
|
+
'aria-multiline'?: boolean | null;
|
|
87
|
+
'aria-multiselectable'?: boolean | null;
|
|
88
|
+
'aria-orientation'?: 'horizontal' | 'vertical' | null;
|
|
89
|
+
'aria-owns'?: idRef | null;
|
|
90
|
+
'aria-placeholder'?: string | null;
|
|
91
|
+
'aria-posinset'?: number | null;
|
|
92
|
+
'aria-pressed'?: (boolean | 'mixed') | null;
|
|
93
|
+
'aria-readonly'?: boolean | null;
|
|
94
|
+
'aria-required'?: boolean | null;
|
|
95
|
+
'aria-roledescription'?: string | null;
|
|
96
|
+
'aria-rowcount'?: number | null;
|
|
97
|
+
'aria-rowindex'?: number | null;
|
|
98
|
+
'aria-rowspan'?: number | null;
|
|
99
|
+
'aria-selected'?: boolean | null;
|
|
100
|
+
'aria-setsize'?: number | null;
|
|
101
|
+
'aria-sort'?: 'ascending' | 'descending' | 'none' | 'other' | null;
|
|
102
|
+
'aria-valuemax'?: number | null;
|
|
103
|
+
'aria-valuemin'?: number | null;
|
|
104
|
+
'aria-valuenow'?: number | null;
|
|
105
|
+
'aria-valuetext'?: string | null;
|
|
106
|
+
role?: string | null;
|
|
107
|
+
|
|
108
|
+
// @deprecated
|
|
109
|
+
accessibilityActiveDescendant?: idRef | null;
|
|
110
|
+
accessibilityAtomic?: boolean | null;
|
|
111
|
+
accessibilityAutoComplete?: ('none' | 'list' | 'inline' | 'both') | null;
|
|
112
|
+
accessibilityBusy?: boolean | null;
|
|
113
|
+
accessibilityChecked?: boolean | 'mixed' | null;
|
|
114
|
+
accessibilityColumnCount?: number | null;
|
|
115
|
+
accessibilityColumnIndex?: number | null;
|
|
116
|
+
accessibilityColumnSpan?: number | null;
|
|
117
|
+
accessibilityControls?: idRefList | null;
|
|
118
|
+
accessibilityCurrent?: boolean | 'page' | 'step' | 'location' | 'date' | 'time' | null;
|
|
119
|
+
accessibilityDescribedBy?: idRefList | null;
|
|
120
|
+
accessibilityDetails?: idRef | null;
|
|
121
|
+
accessibilityDisabled?: boolean | null;
|
|
122
|
+
accessibilityErrorMessage?: idRef | null;
|
|
123
|
+
accessibilityExpanded?: boolean | null;
|
|
124
|
+
accessibilityFlowTo?: idRefList | null;
|
|
125
|
+
accessibilityHasPopup?: 'dialog' | 'grid' | 'listbox' | 'menu' | 'tree' | false | null;
|
|
126
|
+
accessibilityHidden?: boolean | null;
|
|
127
|
+
accessibilityInvalid?: boolean | null;
|
|
128
|
+
accessibilityKeyShortcuts?: string[] | null;
|
|
129
|
+
accessibilityLabel?: string | null;
|
|
130
|
+
accessibilityLabelledBy?: idRefList | null;
|
|
131
|
+
accessibilityLevel?: number | null;
|
|
132
|
+
accessibilityLiveRegion?: 'assertive' | 'none' | 'polite' | null;
|
|
133
|
+
accessibilityModal?: boolean | null;
|
|
134
|
+
accessibilityMultiline?: boolean | null;
|
|
135
|
+
accessibilityMultiSelectable?: boolean | null;
|
|
136
|
+
accessibilityOrientation?: 'horizontal' | 'vertical' | null;
|
|
137
|
+
accessibilityOwns?: idRefList | null;
|
|
138
|
+
accessibilityPlaceholder?: string | null;
|
|
139
|
+
accessibilityPosInSet?: number | null;
|
|
140
|
+
accessibilityPressed?: (boolean | 'mixed') | null;
|
|
141
|
+
accessibilityReadOnly?: boolean | null;
|
|
142
|
+
accessibilityRequired?: boolean | null;
|
|
143
|
+
accessibilityRole?: string | null;
|
|
144
|
+
accessibilityRoleDescription?: string | null;
|
|
145
|
+
accessibilityRowCount?: number | null;
|
|
146
|
+
accessibilityRowIndex?: number | null;
|
|
147
|
+
accessibilityRowSpan?: number | null;
|
|
148
|
+
accessibilitySelected?: boolean | null;
|
|
149
|
+
accessibilitySetSize?: number | null;
|
|
150
|
+
accessibilitySort?: 'ascending' | 'descending' | 'none' | 'other' | null;
|
|
151
|
+
accessibilityValueMax?: number | null;
|
|
152
|
+
accessibilityValueMin?: number | null;
|
|
153
|
+
accessibilityValueNow?: number | null;
|
|
154
|
+
accessibilityValueText?: string | null;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
export type EventProps = {
|
|
158
|
+
onAuxClick?: (e: any) => void;
|
|
159
|
+
onBlur?: (e: any) => void;
|
|
160
|
+
onClick?: (e: any) => void;
|
|
161
|
+
onContextMenu?: (e: any) => void;
|
|
162
|
+
onFocus?: (e: any) => void;
|
|
163
|
+
onGotPointerCapture?: (e: any) => void;
|
|
164
|
+
onKeyDown?: (e: any) => void;
|
|
165
|
+
onKeyUp?: (e: any) => void;
|
|
166
|
+
onLayout?: (e: LayoutEvent) => void;
|
|
167
|
+
onLostPointerCapture?: (e: any) => void;
|
|
168
|
+
onMoveShouldSetResponder?: (e: any) => boolean;
|
|
169
|
+
onMoveShouldSetResponderCapture?: (e: any) => boolean;
|
|
170
|
+
onPointerCancel?: (e: any) => void;
|
|
171
|
+
onPointerDown?: (e: any) => void;
|
|
172
|
+
onPointerEnter?: (e: any) => void;
|
|
173
|
+
onPointerMove?: (e: any) => void;
|
|
174
|
+
onPointerLeave?: (e: any) => void;
|
|
175
|
+
onPointerOut?: (e: any) => void;
|
|
176
|
+
onPointerOver?: (e: any) => void;
|
|
177
|
+
onPointerUp?: (e: any) => void;
|
|
178
|
+
onResponderEnd?: (e: any) => void;
|
|
179
|
+
onResponderGrant?: (e: any) => void | boolean;
|
|
180
|
+
onResponderMove?: (e: any) => void;
|
|
181
|
+
onResponderReject?: (e: any) => void;
|
|
182
|
+
onResponderRelease?: (e: any) => void;
|
|
183
|
+
onResponderStart?: (e: any) => void;
|
|
184
|
+
onResponderTerminate?: (e: any) => void;
|
|
185
|
+
onResponderTerminationRequest?: (e: any) => boolean;
|
|
186
|
+
onScrollShouldSetResponder?: (e: any) => boolean;
|
|
187
|
+
onScrollShouldSetResponderCapture?: (e: any) => boolean;
|
|
188
|
+
onSelectionChangeShouldSetResponder?: (e: any) => boolean;
|
|
189
|
+
onSelectionChangeShouldSetResponderCapture?: (e: any) => boolean;
|
|
190
|
+
onStartShouldSetResponder?: (e: any) => boolean;
|
|
191
|
+
onStartShouldSetResponderCapture?: (e: any) => boolean;
|
|
192
|
+
// unstable
|
|
193
|
+
onMouseDown?: (e: any) => void;
|
|
194
|
+
onMouseEnter?: (e: any) => void;
|
|
195
|
+
onMouseLeave?: (e: any) => void;
|
|
196
|
+
onMouseMove?: (e: any) => void;
|
|
197
|
+
onMouseOver?: (e: any) => void;
|
|
198
|
+
onMouseOut?: (e: any) => void;
|
|
199
|
+
onMouseUp?: (e: any) => void;
|
|
200
|
+
onScroll?: (e: any) => void;
|
|
201
|
+
onTouchCancel?: (e: any) => void;
|
|
202
|
+
onTouchCancelCapture?: (e: any) => void;
|
|
203
|
+
onTouchEnd?: (e: any) => void;
|
|
204
|
+
onTouchEndCapture?: (e: any) => void;
|
|
205
|
+
onTouchMove?: (e: any) => void;
|
|
206
|
+
onTouchMoveCapture?: (e: any) => void;
|
|
207
|
+
onTouchStart?: (e: any) => void;
|
|
208
|
+
onTouchStartCapture?: (e: any) => void;
|
|
209
|
+
onWheel?: (e: any) => void;
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
export type ViewStyle = AnimationStyles &
|
|
213
|
+
BorderStyles &
|
|
214
|
+
InteractionStyles &
|
|
215
|
+
LayoutStyles &
|
|
216
|
+
ShadowStyles &
|
|
217
|
+
TransformStyles & {
|
|
218
|
+
backdropFilter?: string | null;
|
|
219
|
+
backgroundAttachment?: string | null;
|
|
220
|
+
backgroundBlendMode?: string | null;
|
|
221
|
+
backgroundClip?: string | null;
|
|
222
|
+
backgroundColor?: ColorValue | null;
|
|
223
|
+
backgroundImage?: string | null;
|
|
224
|
+
backgroundOrigin?: 'border-box' | 'content-box' | 'padding-box';
|
|
225
|
+
backgroundPosition?: string | null;
|
|
226
|
+
backgroundRepeat?: string | null;
|
|
227
|
+
backgroundSize?: string | null;
|
|
228
|
+
boxShadow?: string | null;
|
|
229
|
+
clip?: string | null;
|
|
230
|
+
filter?: string | null;
|
|
231
|
+
opacity?: number | null;
|
|
232
|
+
outlineColor?: ColorValue | null;
|
|
233
|
+
outlineOffset?: NumberOrString | null;
|
|
234
|
+
outlineStyle?: string | null;
|
|
235
|
+
outlineWidth?: NumberOrString | null;
|
|
236
|
+
overscrollBehavior?: OverscrollBehaviorValue | null;
|
|
237
|
+
overscrollBehaviorX?: OverscrollBehaviorValue | null;
|
|
238
|
+
overscrollBehaviorY?: OverscrollBehaviorValue | null;
|
|
239
|
+
pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto';
|
|
240
|
+
scrollbarWidth?: 'auto' | 'none' | 'thin';
|
|
241
|
+
scrollSnapAlign?: string | null;
|
|
242
|
+
scrollSnapType?: string | null;
|
|
243
|
+
WebkitMaskImage?: string | null;
|
|
244
|
+
WebkitOverflowScrolling?: 'auto' | 'touch';
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
export type ViewProps = AccessibilityProps &
|
|
248
|
+
EventProps & {
|
|
249
|
+
children?: any | null;
|
|
250
|
+
dataSet?: object;
|
|
251
|
+
dir?: 'ltr' | 'rtl';
|
|
252
|
+
id?: string | null;
|
|
253
|
+
lang?: string;
|
|
254
|
+
style?: GenericStyleProp<ViewStyle>;
|
|
255
|
+
tabIndex?: 0 | -1 | null;
|
|
256
|
+
testID?: string | null;
|
|
257
|
+
// unstable
|
|
258
|
+
href?: string | null;
|
|
259
|
+
hrefAttrs?: { download?: boolean | null; rel?: string | null; target?: string | null } | null;
|
|
260
|
+
// @deprecated
|
|
261
|
+
focusable?: boolean | null;
|
|
262
|
+
pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto';
|
|
263
|
+
nativeID?: string | null;
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// See: https://github.com/necolas/react-native-web/blob/0.20.0/packages/react-native-web/src/modules/forwardedProps/index.js
|
|
268
|
+
declare module 'react-native-web/dist/modules/forwardedProps' {
|
|
269
|
+
export const defaultProps = {
|
|
270
|
+
children: true,
|
|
271
|
+
dataSet: true,
|
|
272
|
+
dir: true,
|
|
273
|
+
id: true,
|
|
274
|
+
ref: true,
|
|
275
|
+
suppressHydrationWarning: true,
|
|
276
|
+
tabIndex: true,
|
|
277
|
+
testID: true,
|
|
278
|
+
// @deprecated
|
|
279
|
+
focusable: true,
|
|
280
|
+
nativeID: true,
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
export const accessibilityProps = {
|
|
284
|
+
'aria-activedescendant': true,
|
|
285
|
+
'aria-atomic': true,
|
|
286
|
+
'aria-autocomplete': true,
|
|
287
|
+
'aria-busy': true,
|
|
288
|
+
'aria-checked': true,
|
|
289
|
+
'aria-colcount': true,
|
|
290
|
+
'aria-colindex': true,
|
|
291
|
+
'aria-colspan': true,
|
|
292
|
+
'aria-controls': true,
|
|
293
|
+
'aria-current': true,
|
|
294
|
+
'aria-describedby': true,
|
|
295
|
+
'aria-details': true,
|
|
296
|
+
'aria-disabled': true,
|
|
297
|
+
'aria-errormessage': true,
|
|
298
|
+
'aria-expanded': true,
|
|
299
|
+
'aria-flowto': true,
|
|
300
|
+
'aria-haspopup': true,
|
|
301
|
+
'aria-hidden': true,
|
|
302
|
+
'aria-invalid': true,
|
|
303
|
+
'aria-keyshortcuts': true,
|
|
304
|
+
'aria-label': true,
|
|
305
|
+
'aria-labelledby': true,
|
|
306
|
+
'aria-level': true,
|
|
307
|
+
'aria-live': true,
|
|
308
|
+
'aria-modal': true,
|
|
309
|
+
'aria-multiline': true,
|
|
310
|
+
'aria-multiselectable': true,
|
|
311
|
+
'aria-orientation': true,
|
|
312
|
+
'aria-owns': true,
|
|
313
|
+
'aria-placeholder': true,
|
|
314
|
+
'aria-posinset': true,
|
|
315
|
+
'aria-pressed': true,
|
|
316
|
+
'aria-readonly': true,
|
|
317
|
+
'aria-required': true,
|
|
318
|
+
role: true,
|
|
319
|
+
'aria-roledescription': true,
|
|
320
|
+
'aria-rowcount': true,
|
|
321
|
+
'aria-rowindex': true,
|
|
322
|
+
'aria-rowspan': true,
|
|
323
|
+
'aria-selected': true,
|
|
324
|
+
'aria-setsize': true,
|
|
325
|
+
'aria-sort': true,
|
|
326
|
+
'aria-valuemax': true,
|
|
327
|
+
'aria-valuemin': true,
|
|
328
|
+
'aria-valuenow': true,
|
|
329
|
+
'aria-valuetext': true,
|
|
330
|
+
// @deprecated
|
|
331
|
+
accessibilityActiveDescendant: true,
|
|
332
|
+
accessibilityAtomic: true,
|
|
333
|
+
accessibilityAutoComplete: true,
|
|
334
|
+
accessibilityBusy: true,
|
|
335
|
+
accessibilityChecked: true,
|
|
336
|
+
accessibilityColumnCount: true,
|
|
337
|
+
accessibilityColumnIndex: true,
|
|
338
|
+
accessibilityColumnSpan: true,
|
|
339
|
+
accessibilityControls: true,
|
|
340
|
+
accessibilityCurrent: true,
|
|
341
|
+
accessibilityDescribedBy: true,
|
|
342
|
+
accessibilityDetails: true,
|
|
343
|
+
accessibilityDisabled: true,
|
|
344
|
+
accessibilityErrorMessage: true,
|
|
345
|
+
accessibilityExpanded: true,
|
|
346
|
+
accessibilityFlowTo: true,
|
|
347
|
+
accessibilityHasPopup: true,
|
|
348
|
+
accessibilityHidden: true,
|
|
349
|
+
accessibilityInvalid: true,
|
|
350
|
+
accessibilityKeyShortcuts: true,
|
|
351
|
+
accessibilityLabel: true,
|
|
352
|
+
accessibilityLabelledBy: true,
|
|
353
|
+
accessibilityLevel: true,
|
|
354
|
+
accessibilityLiveRegion: true,
|
|
355
|
+
accessibilityModal: true,
|
|
356
|
+
accessibilityMultiline: true,
|
|
357
|
+
accessibilityMultiSelectable: true,
|
|
358
|
+
accessibilityOrientation: true,
|
|
359
|
+
accessibilityOwns: true,
|
|
360
|
+
accessibilityPlaceholder: true,
|
|
361
|
+
accessibilityPosInSet: true,
|
|
362
|
+
accessibilityPressed: true,
|
|
363
|
+
accessibilityReadOnly: true,
|
|
364
|
+
accessibilityRequired: true,
|
|
365
|
+
accessibilityRole: true,
|
|
366
|
+
accessibilityRoleDescription: true,
|
|
367
|
+
accessibilityRowCount: true,
|
|
368
|
+
accessibilityRowIndex: true,
|
|
369
|
+
accessibilityRowSpan: true,
|
|
370
|
+
accessibilitySelected: true,
|
|
371
|
+
accessibilitySetSize: true,
|
|
372
|
+
accessibilitySort: true,
|
|
373
|
+
accessibilityValueMax: true,
|
|
374
|
+
accessibilityValueMin: true,
|
|
375
|
+
accessibilityValueNow: true,
|
|
376
|
+
accessibilityValueText: true,
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
export const clickProps = {
|
|
380
|
+
onClick: true,
|
|
381
|
+
onAuxClick: true,
|
|
382
|
+
onContextMenu: true,
|
|
383
|
+
onGotPointerCapture: true,
|
|
384
|
+
onLostPointerCapture: true,
|
|
385
|
+
onPointerCancel: true,
|
|
386
|
+
onPointerDown: true,
|
|
387
|
+
onPointerEnter: true,
|
|
388
|
+
onPointerMove: true,
|
|
389
|
+
onPointerLeave: true,
|
|
390
|
+
onPointerOut: true,
|
|
391
|
+
onPointerOver: true,
|
|
392
|
+
onPointerUp: true,
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
export const focusProps = {
|
|
396
|
+
onBlur: true,
|
|
397
|
+
onFocus: true,
|
|
398
|
+
};
|
|
399
|
+
|
|
400
|
+
export const keyboardProps = {
|
|
401
|
+
onKeyDown: true,
|
|
402
|
+
onKeyDownCapture: true,
|
|
403
|
+
onKeyUp: true,
|
|
404
|
+
onKeyUpCapture: true,
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
export const mouseProps = {
|
|
408
|
+
onMouseDown: true,
|
|
409
|
+
onMouseEnter: true,
|
|
410
|
+
onMouseLeave: true,
|
|
411
|
+
onMouseMove: true,
|
|
412
|
+
onMouseOver: true,
|
|
413
|
+
onMouseOut: true,
|
|
414
|
+
onMouseUp: true,
|
|
415
|
+
};
|
|
416
|
+
|
|
417
|
+
export const touchProps = {
|
|
418
|
+
onTouchCancel: true,
|
|
419
|
+
onTouchCancelCapture: true,
|
|
420
|
+
onTouchEnd: true,
|
|
421
|
+
onTouchEndCapture: true,
|
|
422
|
+
onTouchMove: true,
|
|
423
|
+
onTouchMoveCapture: true,
|
|
424
|
+
onTouchStart: true,
|
|
425
|
+
onTouchStartCapture: true,
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
export const styleProps = {
|
|
429
|
+
style: true,
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
// See: https://github.com/necolas/react-native-web/blob/0.20.0/packages/react-native-web/src/modules/mergeRefs/index.js
|
|
434
|
+
declare module 'react-native-web/dist/modules/mergeRefs' {
|
|
435
|
+
export default function mergeRefs(
|
|
436
|
+
...args: readonly React.ElementRef<any>[]
|
|
437
|
+
): (node: HTMLElement | null) => void;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
// See: https://github.com/necolas/react-native-web/blob/0.20.0/packages/react-native-web/src/modules/pick/index.js
|
|
441
|
+
declare module 'react-native-web/dist/modules/pick' {
|
|
442
|
+
export default function pick<T extends Record<string, any>, L extends Record<string, boolean>>(
|
|
443
|
+
obj: T,
|
|
444
|
+
list: L
|
|
445
|
+
): { [K in Extract<keyof T, keyof L> as L[K] extends true ? K : never]: T[K] };
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
// See: https://github.com/necolas/react-native-web/blob/0.20.0/packages/react-native-web/src/modules/useElementLayout/index.js
|
|
449
|
+
declare module 'react-native-web/dist/modules/useElementLayout' {
|
|
450
|
+
import type { ElementType } from 'react';
|
|
451
|
+
import type { LayoutEvent } from 'react-native-web/dist/types';
|
|
452
|
+
|
|
453
|
+
export default function useElementLayout(
|
|
454
|
+
ref: ElementRef<any>,
|
|
455
|
+
onLayout?: ?((e: LayoutEvent) => void)
|
|
456
|
+
): void;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
// See: https://github.com/necolas/react-native-web/blob/0.20.0/packages/react-native-web/src/modules/useLocale/index.js
|
|
460
|
+
declare module 'react-native-web/dist/modules/useLocale' {
|
|
461
|
+
import type { PropsWithChildren } from 'react';
|
|
462
|
+
|
|
463
|
+
type Locale = string;
|
|
464
|
+
type WritingDirection = 'ltr' | 'rtl';
|
|
465
|
+
type LocaleValue = {
|
|
466
|
+
/** Locale writing direction. */
|
|
467
|
+
direction: WritingDirection;
|
|
468
|
+
/** Locale BCP47 language code: https://www.ietf.org/rfc/bcp/bcp47.txt */
|
|
469
|
+
locale?: Locale;
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
export function getLocaleDirection(locale: Locale): WritingDirection;
|
|
473
|
+
export function LocaleProvider(props: PropsWithChildren<ProviderProps>): Node;
|
|
474
|
+
export function useLocaleContext(): LocaleValue;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
// See: https://github.com/necolas/react-native-web/blob/0.20.0/packages/react-native-web/src/modules/useMergeRefs/index.js
|
|
478
|
+
declare module 'react-native-web/dist/modules/useMergeRefs' {
|
|
479
|
+
export { default } from 'react-native-web/dist/modules/mergeRefs';
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
// See: https://github.com/necolas/react-native-web/blob/0.20.0/packages/react-native-web/src/modules/usePlatformMethods/index.js
|
|
483
|
+
declare module 'react-native-web/dist/modules/usePlatformMethods' {
|
|
484
|
+
import type { GenericStyleProp } from 'react-native-web/dist/types';
|
|
485
|
+
import type { ViewProps } from 'react-native-web/dist/exports/View/types';
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* Adds non-standard methods to the hode element. This is temporarily until an
|
|
489
|
+
* API like `ReactNative.measure(hostRef, callback)` is added to React Native.
|
|
490
|
+
*/
|
|
491
|
+
export default function usePlatformMethods(methods: {
|
|
492
|
+
style?: GenericStyleProp<any>;
|
|
493
|
+
pointerEvents?: ViewProps['pointerEvents'];
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
// See: https://github.com/necolas/react-native-web/blob/0.20.0/packages/react-native-web/src/modules/useResponderEvents/index.js
|
|
498
|
+
declare module 'react-native-web/dist/modules/useResponderEvents' {
|
|
499
|
+
import type { ResponderConfig } from 'react-native-web/dist/modules/useResponderEvents/ResponderSystem';
|
|
500
|
+
|
|
501
|
+
export default function useResponderEvents(hostRef: any, config?: ResponderConfig): void;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
// See: https://github.com/necolas/react-native-web/blob/0.20.0/packages/react-native-web/src/modules/useResponderEvents/createResponderEvent.js
|
|
505
|
+
declare module 'react-native-web/dist/modules/useResponderEvents/createResponderEvent' {
|
|
506
|
+
import type { TouchHistory } from 'react-native-web/src/modules/useResponderEvents/ResponderTouchHistoryStore';
|
|
507
|
+
import type { TouchEvent } from 'react-native-web/src/modules/useResponderEvents/ResponderEventTypes';
|
|
508
|
+
|
|
509
|
+
export type ResponderEvent = {
|
|
510
|
+
bubbles: boolean;
|
|
511
|
+
cancelable: boolean;
|
|
512
|
+
currentTarget: any;
|
|
513
|
+
defaultPrevented: boolean | null;
|
|
514
|
+
dispatchConfig: {
|
|
515
|
+
registrationName?: string;
|
|
516
|
+
phasedRegistrationNames?: {
|
|
517
|
+
bubbled: string;
|
|
518
|
+
captured: string;
|
|
519
|
+
};
|
|
520
|
+
};
|
|
521
|
+
eventPhase: number | null;
|
|
522
|
+
isDefaultPrevented: () => boolean;
|
|
523
|
+
isPropagationStopped: () => boolean;
|
|
524
|
+
isTrusted: boolean | null;
|
|
525
|
+
preventDefault: () => void;
|
|
526
|
+
stopPropagation: () => void;
|
|
527
|
+
nativeEvent: TouchEvent;
|
|
528
|
+
persist: () => void;
|
|
529
|
+
target: any | null;
|
|
530
|
+
timeStamp: number;
|
|
531
|
+
touchHistory: TouchHistory;
|
|
532
|
+
};
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
// See: https://github.com/necolas/react-native-web/blob/0.20.0/packages/react-native-web/src/modules/useResponderEvents/ResponderEventTypes.js
|
|
536
|
+
declare module 'react-native-web/src/modules/useResponderEvents/ResponderEventTypes' {
|
|
537
|
+
export type Touch = {
|
|
538
|
+
force: number;
|
|
539
|
+
identifier: number;
|
|
540
|
+
// The locationX and locationY properties are non-standard additions
|
|
541
|
+
locationX: any;
|
|
542
|
+
locationY: any;
|
|
543
|
+
pageX: number;
|
|
544
|
+
pageY: number;
|
|
545
|
+
target: any;
|
|
546
|
+
// Touches in a list have a timestamp property
|
|
547
|
+
timestamp: number;
|
|
548
|
+
};
|
|
549
|
+
|
|
550
|
+
export type TouchEvent = {
|
|
551
|
+
altKey: boolean;
|
|
552
|
+
ctrlKey: boolean;
|
|
553
|
+
metaKey: boolean;
|
|
554
|
+
shiftKey: boolean;
|
|
555
|
+
// TouchList is an array in the Responder system
|
|
556
|
+
changedTouches: Touch[];
|
|
557
|
+
force: number;
|
|
558
|
+
// React Native adds properties to the "nativeEvent that are usually only found on W3C Touches ‾\_(ツ)_/‾
|
|
559
|
+
identifier: number;
|
|
560
|
+
locationX: any;
|
|
561
|
+
locationY: any;
|
|
562
|
+
pageX: number;
|
|
563
|
+
pageY: number;
|
|
564
|
+
target: any;
|
|
565
|
+
// The timestamp has a lowercase "s" in the Responder system
|
|
566
|
+
timestamp: number;
|
|
567
|
+
// TouchList is an array in the Responder system
|
|
568
|
+
touches: Touch[];
|
|
569
|
+
};
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
// See: https://github.com/necolas/react-native-web/blob/0.20.0/packages/react-native-web/src/modules/useResponderEvents/ResponderSystem.js
|
|
573
|
+
declare module 'react-native-web/dist/modules/useResponderEvents/ResponderSystem' {
|
|
574
|
+
import type { ResponderEvent } from 'react-native-web/dist/modules/useResponderEvents/createResponderEvent';
|
|
575
|
+
|
|
576
|
+
export type ResponderConfig = {
|
|
577
|
+
// Direct responder events dispatched directly to responder. Do not bubble.
|
|
578
|
+
onResponderEnd?: (e: ResponderEvent) => void | null;
|
|
579
|
+
onResponderGrant?: (e: ResponderEvent) => void | boolean | null;
|
|
580
|
+
onResponderMove?: (e: ResponderEvent) => void | null;
|
|
581
|
+
onResponderRelease?: (e: ResponderEvent) => void | null;
|
|
582
|
+
onResponderReject?: (e: ResponderEvent) => void | null;
|
|
583
|
+
onResponderStart?: (e: ResponderEvent) => void | null;
|
|
584
|
+
onResponderTerminate?: (e: ResponderEvent) => void | null;
|
|
585
|
+
onResponderTerminationRequest?: (e: ResponderEvent) => boolean | null;
|
|
586
|
+
// On pointer down, should this element become the responder?
|
|
587
|
+
onStartShouldSetResponder?: (e: ResponderEvent) => boolean | null;
|
|
588
|
+
onStartShouldSetResponderCapture?: (e: ResponderEvent) => boolean | null;
|
|
589
|
+
// On pointer move, should this element become the responder?
|
|
590
|
+
onMoveShouldSetResponder?: (e: ResponderEvent) => boolean | null;
|
|
591
|
+
onMoveShouldSetResponderCapture?: (e: ResponderEvent) => boolean | null;
|
|
592
|
+
// On scroll, should this element become the responder? Do no bubble
|
|
593
|
+
onScrollShouldSetResponder?: (e: ResponderEvent) => boolean | null;
|
|
594
|
+
onScrollShouldSetResponderCapture?: (e: ResponderEvent) => boolean | null;
|
|
595
|
+
// On text selection change, should this element become the responder?
|
|
596
|
+
onSelectionChangeShouldSetResponder?: (e: ResponderEvent) => boolean | null;
|
|
597
|
+
onSelectionChangeShouldSetResponderCapture?: (e: ResponderEvent) => booleam | null;
|
|
598
|
+
};
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
// See: https://github.com/necolas/react-native-web/blob/0.20.0/packages/react-native-web/src/modules/useResponderEvents/ResponderTouchHistoryStore.js
|
|
602
|
+
declare module 'react-native-web/src/modules/useResponderEvents/ResponderTouchHistoryStore' {
|
|
603
|
+
type TouchRecord = {
|
|
604
|
+
currentPageX: number;
|
|
605
|
+
currentPageY: number;
|
|
606
|
+
currentTimeStamp: number;
|
|
607
|
+
previousPageX: number;
|
|
608
|
+
previousPageY: number;
|
|
609
|
+
previousTimeStamp: number;
|
|
610
|
+
startPageX: number;
|
|
611
|
+
startPageY: number;
|
|
612
|
+
startTimeStamp: number;
|
|
613
|
+
touchActive: boolean;
|
|
614
|
+
};
|
|
615
|
+
|
|
616
|
+
export type TouchHistory = Readonly<{
|
|
617
|
+
indexOfSingleActiveTouch: number;
|
|
618
|
+
mostRecentTimeStamp: number;
|
|
619
|
+
numberActiveTouches: number;
|
|
620
|
+
touchBank: TouchRecord[];
|
|
621
|
+
}>;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
// See: https://github.com/necolas/react-native-web/blob/0.20.0/packages/react-native-web/src/types/index.js
|
|
625
|
+
declare module 'react-native-web/dist/types' {
|
|
626
|
+
export type ColorValue = null | string;
|
|
627
|
+
|
|
628
|
+
export type DimensionValue = null | number | string;
|
|
629
|
+
|
|
630
|
+
export type EdgeInsetsValue = {
|
|
631
|
+
top: number;
|
|
632
|
+
left: number;
|
|
633
|
+
right: number;
|
|
634
|
+
bottom: number;
|
|
635
|
+
};
|
|
636
|
+
|
|
637
|
+
export type GenericStyleProp<T> =
|
|
638
|
+
| null
|
|
639
|
+
| void
|
|
640
|
+
| $ReadOnly<T>
|
|
641
|
+
| false
|
|
642
|
+
| ''
|
|
643
|
+
| $ReadOnlyArray<GenericStyleProp<T>>;
|
|
644
|
+
|
|
645
|
+
export type LayoutValue = {
|
|
646
|
+
x: number;
|
|
647
|
+
y: number;
|
|
648
|
+
width: number;
|
|
649
|
+
height: number;
|
|
650
|
+
};
|
|
651
|
+
|
|
652
|
+
export type LayoutEvent = {
|
|
653
|
+
nativeEvent: {
|
|
654
|
+
layout: LayoutValue;
|
|
655
|
+
target: any;
|
|
656
|
+
};
|
|
657
|
+
timeStamp: number;
|
|
658
|
+
};
|
|
659
|
+
|
|
660
|
+
export type PointValue = {
|
|
661
|
+
x: number;
|
|
662
|
+
y: number;
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
type LayoutCallback = (
|
|
666
|
+
x: number,
|
|
667
|
+
y: number,
|
|
668
|
+
width: number,
|
|
669
|
+
height: number,
|
|
670
|
+
left: number,
|
|
671
|
+
top: number
|
|
672
|
+
) => void;
|
|
673
|
+
|
|
674
|
+
type MeasureInWindowCallback = (left: number, top: number, width: number, height: number) => void;
|
|
675
|
+
|
|
676
|
+
// Mixin to HTMLElement that represents additions from the `usePlatformMethods` hook
|
|
677
|
+
export interface PlatformMethods {
|
|
678
|
+
blur: () => void;
|
|
679
|
+
focus: () => void;
|
|
680
|
+
measure: (callback: LayoutCallback) => void;
|
|
681
|
+
measureInWindow: (callback: MeasureInWindowCallback) => void;
|
|
682
|
+
measureLayout: (
|
|
683
|
+
relativeToNativeNode: object,
|
|
684
|
+
onSuccess: LayoutCallback,
|
|
685
|
+
onFail: () => void
|
|
686
|
+
) => void;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
// See: https://github.com/necolas/react-native-web/blob/0.20.0/packages/react-native-web/src/types/styles.js
|
|
691
|
+
declare module 'react-native-web/dist/types/styles' {
|
|
692
|
+
import type { ColorValue, DimensionValue } from 'react-native-web/dist/types';
|
|
693
|
+
|
|
694
|
+
type NumberOrString = number | string;
|
|
695
|
+
|
|
696
|
+
/**
|
|
697
|
+
* Animations and transitions
|
|
698
|
+
*/
|
|
699
|
+
|
|
700
|
+
type AnimationDirection = 'alternate' | 'alternate-reverse' | 'normal' | 'reverse';
|
|
701
|
+
type AnimationFillMode = 'none' | 'forwards' | 'backwards' | 'both';
|
|
702
|
+
type AnimationIterationCount = number | 'infinite';
|
|
703
|
+
type AnimationKeyframes = string | object;
|
|
704
|
+
type AnimationPlayState = 'paused' | 'running';
|
|
705
|
+
|
|
706
|
+
export type AnimationStyles = {
|
|
707
|
+
animationDelay?: string | string[] | null;
|
|
708
|
+
animationDirection?: AnimationDirection | AnimationDirection[] | null;
|
|
709
|
+
animationDuration?: string | string[] | null;
|
|
710
|
+
animationFillMode?: AnimationFillMode | AnimationFillMode[] | null;
|
|
711
|
+
animationIterationCount?: AnimationIterationCount | AnimationIterationCount[] | null;
|
|
712
|
+
animationKeyframes?: AnimationKeyframes | AnimationKeyframes[] | null;
|
|
713
|
+
animationPlayState?: AnimationPlayState | AnimationPlayState[] | null;
|
|
714
|
+
animationTimingFunction?: string | string[] | null;
|
|
715
|
+
transitionDelay?: string | string[] | null;
|
|
716
|
+
transitionDuration?: string | string[] | null;
|
|
717
|
+
transitionProperty?: string | string[] | null;
|
|
718
|
+
transitionTimingFunction?: string | string[] | null;
|
|
719
|
+
};
|
|
720
|
+
|
|
721
|
+
/**
|
|
722
|
+
* Border
|
|
723
|
+
*/
|
|
724
|
+
|
|
725
|
+
type BorderRadiusValue = number | string;
|
|
726
|
+
type BorderStyleValue = 'solid' | 'dotted' | 'dashed';
|
|
727
|
+
|
|
728
|
+
export type BorderStyles = {
|
|
729
|
+
// color
|
|
730
|
+
borderColor?: ColorValue | null;
|
|
731
|
+
borderBlockColor?: ColorValue | null;
|
|
732
|
+
borderBlockEndColor?: ColorValue | null;
|
|
733
|
+
borderBlockStartColor?: ColorValue | null;
|
|
734
|
+
borderBottomColor?: ColorValue | null;
|
|
735
|
+
borderInlineColor?: ColorValue | null;
|
|
736
|
+
borderInlineEndColor?: ColorValue | null;
|
|
737
|
+
borderInlineStartColor?: ColorValue | null;
|
|
738
|
+
borderLeftColor?: ColorValue | null;
|
|
739
|
+
borderRightColor?: ColorValue | null;
|
|
740
|
+
borderTopColor?: ColorValue | null;
|
|
741
|
+
// radius
|
|
742
|
+
borderRadius?: BorderRadiusValue | null;
|
|
743
|
+
borderEndEndRadius?: BorderRadiusValue | null;
|
|
744
|
+
borderEndStartRadius?: BorderRadiusValue | null;
|
|
745
|
+
borderStartEndRadius?: BorderRadiusValue | null;
|
|
746
|
+
borderStartStartRadius?: BorderRadiusValue | null;
|
|
747
|
+
borderBottomLeftRadius?: BorderRadiusValue | null;
|
|
748
|
+
borderBottomRightRadius?: BorderRadiusValue | null;
|
|
749
|
+
borderTopLeftRadius?: BorderRadiusValue | null;
|
|
750
|
+
borderTopRightRadius?: BorderRadiusValue | null;
|
|
751
|
+
// style
|
|
752
|
+
borderStyle?: BorderStyleValue | null;
|
|
753
|
+
borderBlockStyle?: BorderStyleValue | null;
|
|
754
|
+
borderBlockEndStyle?: BorderStyleValue | null;
|
|
755
|
+
borderBlockStartStyle?: BorderStyleValue | null;
|
|
756
|
+
borderBottomStyle?: BorderStyleValue | null;
|
|
757
|
+
borderInlineStyle?: BorderStyleValue | null;
|
|
758
|
+
borderInlineEndStyle?: BorderStyleValue | null;
|
|
759
|
+
borderInlineStartStyle?: BorderStyleValue | null;
|
|
760
|
+
borderLeftStyle?: BorderStyleValue | null;
|
|
761
|
+
borderRightStyle?: BorderStyleValue | null;
|
|
762
|
+
borderTopStyle?: BorderStyleValue | null;
|
|
763
|
+
// deprecated
|
|
764
|
+
borderEndColor?: ColorValue | null;
|
|
765
|
+
borderStartColor?: ColorValue | null;
|
|
766
|
+
borderEndStyle?: BorderStyleValue | null;
|
|
767
|
+
borderStartStyle?: BorderStyleValue | null;
|
|
768
|
+
borderBottomEndRadius?: BorderRadiusValue | null;
|
|
769
|
+
borderBottomStartRadius?: BorderRadiusValue | null;
|
|
770
|
+
borderTopEndRadius?: BorderRadiusValue | null;
|
|
771
|
+
borderTopStartRadius?: BorderRadiusValue | null;
|
|
772
|
+
};
|
|
773
|
+
|
|
774
|
+
/**
|
|
775
|
+
* Interactions
|
|
776
|
+
*/
|
|
777
|
+
|
|
778
|
+
type CursorValue =
|
|
779
|
+
| 'alias'
|
|
780
|
+
| 'all-scroll'
|
|
781
|
+
| 'auto'
|
|
782
|
+
| 'cell'
|
|
783
|
+
| 'context-menu'
|
|
784
|
+
| 'copy'
|
|
785
|
+
| 'crosshair'
|
|
786
|
+
| 'default'
|
|
787
|
+
| 'grab'
|
|
788
|
+
| 'grabbing'
|
|
789
|
+
| 'help'
|
|
790
|
+
| 'pointer'
|
|
791
|
+
| 'progress'
|
|
792
|
+
| 'wait'
|
|
793
|
+
| 'text'
|
|
794
|
+
| 'vertical-text'
|
|
795
|
+
| 'move'
|
|
796
|
+
| 'none'
|
|
797
|
+
| 'no-drop'
|
|
798
|
+
| 'not-allowed'
|
|
799
|
+
| 'zoom-in'
|
|
800
|
+
| 'zoom-out'
|
|
801
|
+
// resize
|
|
802
|
+
| 'col-resize'
|
|
803
|
+
| 'e-resize'
|
|
804
|
+
| 'ew-resize'
|
|
805
|
+
| 'n-resize'
|
|
806
|
+
| 'ne-resize'
|
|
807
|
+
| 'ns-resize'
|
|
808
|
+
| 'nw-resize'
|
|
809
|
+
| 'row-resize'
|
|
810
|
+
| 's-resize'
|
|
811
|
+
| 'se-resize'
|
|
812
|
+
| 'sw-resize'
|
|
813
|
+
| 'w-resize'
|
|
814
|
+
| 'nesw-resize'
|
|
815
|
+
| 'nwse-resize';
|
|
816
|
+
|
|
817
|
+
type TouchActionValue =
|
|
818
|
+
| 'auto'
|
|
819
|
+
| 'inherit'
|
|
820
|
+
| 'manipulation'
|
|
821
|
+
| 'none'
|
|
822
|
+
| 'pan-down'
|
|
823
|
+
| 'pan-left'
|
|
824
|
+
| 'pan-right'
|
|
825
|
+
| 'pan-up'
|
|
826
|
+
| 'pan-x'
|
|
827
|
+
| 'pan-y'
|
|
828
|
+
| 'pinch-zoom';
|
|
829
|
+
|
|
830
|
+
type UserSelect = 'all' | 'auto' | 'contain' | 'none' | 'text';
|
|
831
|
+
|
|
832
|
+
export type InteractionStyles = {
|
|
833
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/cursor#Formal_syntax
|
|
834
|
+
cursor?: CursorValue | null;
|
|
835
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action#Formal_syntax
|
|
836
|
+
touchAction?: TouchActionValue | null;
|
|
837
|
+
// https://developer.mozilla.org/en-US/docs/Web/CSS/user-select#Formal_syntax_2
|
|
838
|
+
userSelect?: UserSelect | null;
|
|
839
|
+
willChange?: string | null;
|
|
840
|
+
};
|
|
841
|
+
|
|
842
|
+
/**
|
|
843
|
+
* Layout
|
|
844
|
+
*/
|
|
845
|
+
|
|
846
|
+
type OverflowValue = 'auto' | 'hidden' | 'scroll' | 'visible';
|
|
847
|
+
type VisiblilityValue = 'hidden' | 'visible';
|
|
848
|
+
|
|
849
|
+
export type LayoutStyles = {
|
|
850
|
+
alignContent?:
|
|
851
|
+
| 'center'
|
|
852
|
+
| 'flex-end'
|
|
853
|
+
| 'flex-start'
|
|
854
|
+
| 'space-around'
|
|
855
|
+
| 'space-between'
|
|
856
|
+
| 'stretch';
|
|
857
|
+
alignItems?: 'baseline' | 'center' | 'flex-end' | 'flex-start' | 'stretch' | null;
|
|
858
|
+
alignSelf?: 'auto' | 'baseline' | 'center' | 'flex-end' | 'flex-start' | 'stretch' | null;
|
|
859
|
+
aspectRatio?: NumberOrString | null;
|
|
860
|
+
backfaceVisibility?: VisiblilityValue | null;
|
|
861
|
+
borderWidth?: DimensionValue | null;
|
|
862
|
+
borderBlockWidth?: DimensionValue | null;
|
|
863
|
+
borderBlockEndWidth?: DimensionValue | null;
|
|
864
|
+
borderBlockStartWidth?: DimensionValue | null;
|
|
865
|
+
borderBottomWidth?: DimensionValue | null;
|
|
866
|
+
borderInlineWidth?: DimensionValue | null;
|
|
867
|
+
borderInlineEndWidth?: DimensionValue | null;
|
|
868
|
+
borderInlineStartWidth?: DimensionValue | null;
|
|
869
|
+
borderLeftWidth?: DimensionValue | null;
|
|
870
|
+
borderRightWidth?: DimensionValue | null;
|
|
871
|
+
borderTopWidth?: DimensionValue | null;
|
|
872
|
+
bottom?: DimensionValue | null;
|
|
873
|
+
boxSizing?: ('border-box' | 'content-box' | 'padding-box') | null;
|
|
874
|
+
columnGap?: DimensionValue | null;
|
|
875
|
+
direction?: ('inherit' | 'ltr' | 'rtl') | null;
|
|
876
|
+
display?: string | null;
|
|
877
|
+
flex?: number | null;
|
|
878
|
+
flexBasis?: DimensionValue | null;
|
|
879
|
+
flexDirection?: ('column' | 'column-reverse' | 'row' | 'row-reverse') | null;
|
|
880
|
+
flexGrow?: number | null;
|
|
881
|
+
flexShrink?: number | null;
|
|
882
|
+
flexWrap?: ('nowrap' | 'wrap' | 'wrap-reverse') | null;
|
|
883
|
+
gap?: DimensionValue | null;
|
|
884
|
+
height?: DimensionValue | null;
|
|
885
|
+
inset?: DimensionValue | null;
|
|
886
|
+
insetBlock?: DimensionValue | null;
|
|
887
|
+
insetBlockEnd?: DimensionValue | null;
|
|
888
|
+
insetBlockStart?: DimensionValue | null;
|
|
889
|
+
insetInline?: DimensionValue | null;
|
|
890
|
+
insetInlineEnd?: DimensionValue | null;
|
|
891
|
+
insetInlineStart?: DimensionValue | null;
|
|
892
|
+
justifyContent?:
|
|
893
|
+
| 'center'
|
|
894
|
+
| 'flex-end'
|
|
895
|
+
| 'flex-start'
|
|
896
|
+
| 'space-around'
|
|
897
|
+
| 'space-between'
|
|
898
|
+
| 'space-evenly'
|
|
899
|
+
| null;
|
|
900
|
+
left?: DimensionValue | null;
|
|
901
|
+
margin?: DimensionValue | null;
|
|
902
|
+
marginBlock?: DimensionValue | null;
|
|
903
|
+
marginBlockEnd?: DimensionValue | null;
|
|
904
|
+
marginBlockStart?: DimensionValue | null;
|
|
905
|
+
marginBottom?: DimensionValue | null;
|
|
906
|
+
marginInline?: DimensionValue | null;
|
|
907
|
+
marginInlineEnd?: DimensionValue | null;
|
|
908
|
+
marginInlineStart?: DimensionValue | null;
|
|
909
|
+
marginLeft?: DimensionValue | null;
|
|
910
|
+
marginRight?: DimensionValue | null;
|
|
911
|
+
marginTop?: DimensionValue | null;
|
|
912
|
+
maxHeight?: DimensionValue | null;
|
|
913
|
+
maxWidth?: DimensionValue | null;
|
|
914
|
+
minHeight?: DimensionValue | null;
|
|
915
|
+
minWidth?: DimensionValue | null;
|
|
916
|
+
order?: number | null;
|
|
917
|
+
overflow?: OverflowValue | null;
|
|
918
|
+
overflowX?: OverflowValue | null;
|
|
919
|
+
overflowY?: OverflowValue | null;
|
|
920
|
+
padding?: DimensionValue | null;
|
|
921
|
+
paddingBlock?: DimensionValue | null;
|
|
922
|
+
paddingBlockEnd?: DimensionValue | null;
|
|
923
|
+
paddingBlockStart?: DimensionValue | null;
|
|
924
|
+
paddingBottom?: DimensionValue | null;
|
|
925
|
+
paddingInline?: DimensionValue | null;
|
|
926
|
+
paddingInlineEnd?: DimensionValue | null;
|
|
927
|
+
paddingInlineStart?: DimensionValue | null;
|
|
928
|
+
paddingLeft?: DimensionValue | null;
|
|
929
|
+
paddingRight?: DimensionValue | null;
|
|
930
|
+
paddingTop?: DimensionValue | null;
|
|
931
|
+
position?: 'absolute' | 'fixed' | 'relative' | 'static' | 'sticky' | null;
|
|
932
|
+
right?: DimensionValue | null;
|
|
933
|
+
rowGap?: DimensionValue | null;
|
|
934
|
+
top?: DimensionValue | null;
|
|
935
|
+
visibility?: VisiblilityValue | null;
|
|
936
|
+
width?: DimensionValue | null;
|
|
937
|
+
zIndex?: number | null;
|
|
938
|
+
/**
|
|
939
|
+
* @platform web
|
|
940
|
+
*/
|
|
941
|
+
gridAutoColumns?: string | null;
|
|
942
|
+
gridAutoFlow?: string | null;
|
|
943
|
+
gridAutoRows?: string | null;
|
|
944
|
+
gridColumnEnd?: string | null;
|
|
945
|
+
gridColumnGap?: string | null;
|
|
946
|
+
gridColumnStart?: string | null;
|
|
947
|
+
gridRowEnd?: string | null;
|
|
948
|
+
gridRowGap?: string | null;
|
|
949
|
+
gridRowStart?: string | null;
|
|
950
|
+
gridTemplateColumns?: string | null;
|
|
951
|
+
gridTemplateRows?: string | null;
|
|
952
|
+
gridTemplateAreas?: string | null;
|
|
953
|
+
/**
|
|
954
|
+
* @deprecated
|
|
955
|
+
*/
|
|
956
|
+
borderEndWidth?: DimensionValue | null;
|
|
957
|
+
borderStartWidth?: DimensionValue | null;
|
|
958
|
+
end?: DimensionValue | null;
|
|
959
|
+
marginHorizontal?: DimensionValue | null;
|
|
960
|
+
marginEnd?: DimensionValue | null;
|
|
961
|
+
marginStart?: DimensionValue | null;
|
|
962
|
+
marginVertical?: DimensionValue | null;
|
|
963
|
+
paddingHorizontal?: DimensionValue | null;
|
|
964
|
+
paddingStart?: DimensionValue | null;
|
|
965
|
+
paddingEnd?: DimensionValue | null;
|
|
966
|
+
paddingVertical?: DimensionValue | null;
|
|
967
|
+
start?: DimensionValue | null;
|
|
968
|
+
};
|
|
969
|
+
|
|
970
|
+
/**
|
|
971
|
+
* Shadows
|
|
972
|
+
*/
|
|
973
|
+
|
|
974
|
+
export type ShadowStyles = {
|
|
975
|
+
// @deprecated
|
|
976
|
+
shadowColor?: ColorValue | null;
|
|
977
|
+
shadowOffset?: {
|
|
978
|
+
width?: DimensionValue;
|
|
979
|
+
height?: DimensionValue;
|
|
980
|
+
} | null;
|
|
981
|
+
shadowOpacity?: number | null;
|
|
982
|
+
shadowRadius?: DimensionValue | null;
|
|
983
|
+
};
|
|
984
|
+
|
|
985
|
+
/**
|
|
986
|
+
* Transforms
|
|
987
|
+
*/
|
|
988
|
+
|
|
989
|
+
export type TransformStyles = {
|
|
990
|
+
perspective?: NumberOrString | null;
|
|
991
|
+
perspectiveOrigin?: string | null;
|
|
992
|
+
transform?:
|
|
993
|
+
| string
|
|
994
|
+
| null
|
|
995
|
+
| (
|
|
996
|
+
| { perspective: NumberOrString }
|
|
997
|
+
| { rotate: string }
|
|
998
|
+
| { rotateX: string }
|
|
999
|
+
| { rotateY: string }
|
|
1000
|
+
| { rotateZ: string }
|
|
1001
|
+
| { scale: number }
|
|
1002
|
+
| { scaleX: number }
|
|
1003
|
+
| { scaleY: number }
|
|
1004
|
+
| { scaleZ: number }
|
|
1005
|
+
| { scale3d: string }
|
|
1006
|
+
| { skewX: string }
|
|
1007
|
+
| { skewY: string }
|
|
1008
|
+
| { translateX: NumberOrString }
|
|
1009
|
+
| { translateY: NumberOrString }
|
|
1010
|
+
| { translateZ: NumberOrString }
|
|
1011
|
+
| { translate3d: string }
|
|
1012
|
+
)[];
|
|
1013
|
+
transformOrigin?: ?(string | NumberOrString[]);
|
|
1014
|
+
transformStyle?: ?('flat' | 'preserve-3d');
|
|
1015
|
+
};
|
|
1016
|
+
}
|