@felipe-software/react-native-gpui 0.0.0-stage → 1.0.1
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/.reanimated-prebuilt/react-native-reanimated.mjs +29373 -0
- package/LICENSE +21 -0
- package/README.md +657 -2
- package/cli/bin.ts +379 -0
- package/cli/bundle.ts +32 -0
- package/cli/commands/do.ts +213 -0
- package/cli/commands/flow.ts +283 -0
- package/cli/commands/get.ts +584 -0
- package/cli/commands/shot.ts +312 -0
- package/cli/commands/trace.ts +293 -0
- package/cli/host.ts +714 -0
- package/cli/hotReload.ts +210 -0
- package/cli/run.ts +66 -0
- package/cli/selectors.ts +205 -0
- package/dist/Animated.d.ts +120 -0
- package/dist/ChatList.d.ts +28 -0
- package/dist/Dimensions.d.ts +31 -0
- package/dist/StyleSheet.d.ts +18 -0
- package/dist/Window.d.ts +33 -0
- package/dist/apis.d.ts +165 -0
- package/dist/app-state.d.ts +27 -0
- package/dist/chat-list-types.d.ts +136 -0
- package/dist/colors.d.ts +32 -0
- package/dist/commands.d.ts +230 -0
- package/dist/components.d.ts +419 -0
- package/dist/hotModules.d.ts +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.development.js +14876 -0
- package/dist/index.js +12 -0
- package/dist/keyboard.d.ts +140 -0
- package/dist/native-menu.d.ts +7 -0
- package/dist/platform-driver.d.ts +32 -0
- package/dist/platform-services.d.ts +35 -0
- package/dist/portal.d.ts +43 -0
- package/dist/raf.d.ts +4 -0
- package/dist/reanimated/colors-processor-shim.d.ts +10 -0
- package/dist/reanimated/reanimated-host.d.ts +10 -0
- package/dist/reanimated/seam.d.ts +34 -0
- package/dist/reanimated/ui-entry.d.ts +2 -0
- package/dist/reanimated/worklet-channel.d.ts +10 -0
- package/dist/reanimated/worklet-runtime.d.ts +466 -0
- package/dist/reanimated/worklets.d.ts +199 -0
- package/dist/reconciler.d.ts +102 -0
- package/dist/refresh.d.ts +1 -0
- package/dist/render.d.ts +37 -0
- package/dist/runtime.d.ts +235 -0
- package/dist/surfaces.d.ts +51 -0
- package/dist/types.d.ts +276 -0
- package/dist/ui-runtime.js +42276 -0
- package/dist/window-context.d.ts +7 -0
- package/dist/window-host.d.ts +41 -0
- package/dist/wire-delta.d.ts +20 -0
- package/package.json +176 -5
- package/scripts/bundle-app.mjs +88 -0
- package/scripts/conformance-utils.mjs +293 -0
- package/scripts/hot-update-alias-plugin.mjs +88 -0
- package/scripts/native-package-exports-plugin.mjs +235 -0
- package/scripts/pixel.mjs +152 -0
- package/scripts/png.mjs +198 -0
- package/scripts/react-refresh-swc.mjs +35 -0
- package/scripts/reanimated-bun-plugin.mjs +188 -0
- package/scripts/service-binary.d.mts +27 -0
- package/scripts/service-binary.mjs +100 -0
- package/src/reanimated/colors-processor-shim.ts +119 -0
- package/src/reanimated/reanimated-host.ts +69 -0
- package/src/reanimated/rngpui-reanimated-prebuilt.d.ts +7 -0
- package/src/reanimated/seam.ts +566 -0
- package/src/reanimated/ui-entry.ts +80 -0
- package/src/reanimated/worklet-channel.ts +64 -0
- package/src/reanimated/worklet-runtime.ts +2569 -0
- package/src/reanimated/worklets.ts +1334 -0
- package/src/refresh.ts +33 -0
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The component surface. Host primitives (View / Text / TextInput / Image / Svg /
|
|
3
|
+
* WebView / ScrollView) are string tags the reconciler maps to GPUI elements;
|
|
4
|
+
* everything else composes them, matching React Native's public components.
|
|
5
|
+
*/
|
|
6
|
+
import { type ReactNode, type FC, type MutableRefObject } from "react";
|
|
7
|
+
import type { ViewProps, TextStyle, ImageStyle, StyleProp, ViewStyle, ColorValue, GestureResponderEvent, LayoutChangeEvent, MouseResponderEvent, AccessibilityProps } from "./types";
|
|
8
|
+
export interface TextProps extends AccessibilityProps {
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
style?: StyleProp<TextStyle>;
|
|
11
|
+
numberOfLines?: number;
|
|
12
|
+
onPress?: (event: GestureResponderEvent) => void;
|
|
13
|
+
onLayout?: (event: LayoutChangeEvent) => void;
|
|
14
|
+
selectable?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const View: FC<ViewProps>;
|
|
17
|
+
export declare const Text: FC<TextProps>;
|
|
18
|
+
export interface TextInputProps extends AccessibilityProps {
|
|
19
|
+
value?: string;
|
|
20
|
+
defaultValue?: string;
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
placeholderTextColor?: ColorValue;
|
|
23
|
+
onChangeText?: (text: string) => void;
|
|
24
|
+
onChange?: (event: {
|
|
25
|
+
nativeEvent: {
|
|
26
|
+
text: string;
|
|
27
|
+
value: string;
|
|
28
|
+
isComposing: boolean;
|
|
29
|
+
eventCount: number;
|
|
30
|
+
};
|
|
31
|
+
}) => void;
|
|
32
|
+
onClick?: (event: MouseResponderEvent) => void;
|
|
33
|
+
onContextMenu?: (event: MouseResponderEvent) => void;
|
|
34
|
+
onMouseDown?: (event: MouseResponderEvent) => void;
|
|
35
|
+
onMouseUp?: (event: MouseResponderEvent) => void;
|
|
36
|
+
onMouseEnter?: (event: MouseResponderEvent) => void;
|
|
37
|
+
onMouseLeave?: (event: MouseResponderEvent) => void;
|
|
38
|
+
onTouchStart?: (event: MouseResponderEvent) => void;
|
|
39
|
+
onTouchMove?: (event: MouseResponderEvent) => void;
|
|
40
|
+
onTouchEnd?: (event: MouseResponderEvent) => void;
|
|
41
|
+
onTouchCancel?: (event: MouseResponderEvent) => void;
|
|
42
|
+
onStartShouldSetResponder?: (event: MouseResponderEvent) => boolean;
|
|
43
|
+
onResponderGrant?: (event: MouseResponderEvent) => void;
|
|
44
|
+
onResponderMove?: (event: MouseResponderEvent) => void;
|
|
45
|
+
onResponderRelease?: (event: MouseResponderEvent) => void;
|
|
46
|
+
onResponderTerminate?: (event: MouseResponderEvent) => void;
|
|
47
|
+
onSubmitEditing?: (event: {
|
|
48
|
+
nativeEvent: {
|
|
49
|
+
text: string;
|
|
50
|
+
value: string;
|
|
51
|
+
};
|
|
52
|
+
}) => void;
|
|
53
|
+
onKeyPress?: (event: {
|
|
54
|
+
key: string;
|
|
55
|
+
shiftKey: boolean;
|
|
56
|
+
ctrlKey: boolean;
|
|
57
|
+
altKey: boolean;
|
|
58
|
+
metaKey: boolean;
|
|
59
|
+
isComposing: boolean;
|
|
60
|
+
nativeEvent: {
|
|
61
|
+
key: string;
|
|
62
|
+
shiftKey: boolean;
|
|
63
|
+
ctrlKey: boolean;
|
|
64
|
+
altKey: boolean;
|
|
65
|
+
metaKey: boolean;
|
|
66
|
+
isComposing: boolean;
|
|
67
|
+
};
|
|
68
|
+
}) => void;
|
|
69
|
+
onFocus?: (event: unknown) => void;
|
|
70
|
+
onBlur?: (event: unknown) => void;
|
|
71
|
+
onLayout?: (event: LayoutChangeEvent) => void;
|
|
72
|
+
onDrop?: (event: {
|
|
73
|
+
nativeEvent: {
|
|
74
|
+
paths: string[];
|
|
75
|
+
};
|
|
76
|
+
}) => void;
|
|
77
|
+
multiline?: boolean;
|
|
78
|
+
secureTextEntry?: boolean;
|
|
79
|
+
editable?: boolean;
|
|
80
|
+
autoFocus?: boolean;
|
|
81
|
+
keyboardType?: "default" | "number-pad" | "decimal-pad" | "numeric" | "email-address" | "phone-pad";
|
|
82
|
+
returnKeyType?: string;
|
|
83
|
+
maxLength?: number;
|
|
84
|
+
style?: StyleProp<TextStyle>;
|
|
85
|
+
}
|
|
86
|
+
export interface TextInputHandle {
|
|
87
|
+
focus: () => void;
|
|
88
|
+
clear: () => void;
|
|
89
|
+
blur: () => void;
|
|
90
|
+
}
|
|
91
|
+
export declare const TextInput: import("react").ForwardRefExoticComponent<TextInputProps & import("react").RefAttributes<TextInputHandle>>;
|
|
92
|
+
export interface ImageProps extends AccessibilityProps {
|
|
93
|
+
source: {
|
|
94
|
+
uri: string;
|
|
95
|
+
} | string | number;
|
|
96
|
+
style?: StyleProp<ImageStyle>;
|
|
97
|
+
resizeMode?: "cover" | "contain" | "stretch" | "repeat" | "center";
|
|
98
|
+
onLoad?: () => void;
|
|
99
|
+
onLayout?: (event: LayoutChangeEvent) => void;
|
|
100
|
+
/** macOS: drag this image out to Finder as a file. A string is the dropped filename. */
|
|
101
|
+
dragOut?: boolean | string;
|
|
102
|
+
}
|
|
103
|
+
export declare const Image: FC<ImageProps>;
|
|
104
|
+
export interface SvgProps extends AccessibilityProps {
|
|
105
|
+
name: string;
|
|
106
|
+
style?: StyleProp<ViewStyle & {
|
|
107
|
+
color?: ColorValue;
|
|
108
|
+
}>;
|
|
109
|
+
}
|
|
110
|
+
/** `<Svg name="branch.svg" />` — a monochrome icon tinted by `style.color`. */
|
|
111
|
+
export declare const Svg: FC<SvgProps>;
|
|
112
|
+
/**
|
|
113
|
+
* The classic `NSVisualEffectView` semantic materials (the full AppKit set). Used for
|
|
114
|
+
* a `<SystemView>` backdrop blur on every macOS version.
|
|
115
|
+
*/
|
|
116
|
+
export type SystemViewMaterial = "titlebar" | "selection" | "menu" | "popover" | "sidebar" | "headerView" | "sheet" | "windowBackground" | "hudWindow" | "fullScreenUI" | "toolTip" | "contentBackground" | "underWindowBackground" | "underPageBackground";
|
|
117
|
+
/**
|
|
118
|
+
* macOS 26 `NSGlassEffectView` liquid-glass variants (the full set from the
|
|
119
|
+
* liquid-glass plugin's `GlassMaterialVariant`). Falls back to `material` below 26.
|
|
120
|
+
*/
|
|
121
|
+
export type SystemViewGlassVariant = "regular" | "clear" | "dock" | "appIcons" | "widgets" | "text" | "avplayer" | "facetime" | "controlCenter" | "notificationCenter" | "monogram" | "bubbles" | "identity" | "focusBorder" | "focusPlatter" | "keyboard" | "sidebar" | "abuttedSidebar" | "inspector" | "control" | "loupe" | "slider" | "camera" | "cartouchePopover";
|
|
122
|
+
/** a `<SystemView>` native outer drop shadow (drawn below the surface, spills outward). */
|
|
123
|
+
export interface SystemViewShadow {
|
|
124
|
+
/** shadow color — accepts hex `#RRGGBB` / `#RRGGBBAA` (alpha used if `opacity` omitted). */
|
|
125
|
+
color?: ColorValue;
|
|
126
|
+
/** blur radius in px. */
|
|
127
|
+
radius?: number;
|
|
128
|
+
/** horizontal offset in px (+x right). */
|
|
129
|
+
offsetX?: number;
|
|
130
|
+
/** vertical offset in px (+y down). */
|
|
131
|
+
offsetY?: number;
|
|
132
|
+
/** 0..1 shadow opacity (overrides any alpha baked into `color`). */
|
|
133
|
+
opacity?: number;
|
|
134
|
+
}
|
|
135
|
+
export interface SystemViewProps extends AccessibilityProps {
|
|
136
|
+
children?: ReactNode;
|
|
137
|
+
style?: StyleProp<ViewStyle>;
|
|
138
|
+
/**
|
|
139
|
+
* `NSVisualEffectView` backdrop material (the full AppKit semantic set). When
|
|
140
|
+
* omitted (and no `glassVariant`), the surface carries NO blur — only the optional
|
|
141
|
+
* tint and/or shadow. An unknown value falls back to the HUD material.
|
|
142
|
+
*/
|
|
143
|
+
material?: SystemViewMaterial;
|
|
144
|
+
/**
|
|
145
|
+
* macOS 26 `NSGlassEffectView` liquid-glass variant. When set and available
|
|
146
|
+
* (macOS 26+), the surface is a glass view with this variant; otherwise it falls
|
|
147
|
+
* back to `material` (or the HUD material). `blendingMode` is always BehindWindow.
|
|
148
|
+
*/
|
|
149
|
+
glassVariant?: SystemViewGlassVariant;
|
|
150
|
+
/** optional tint overlaid on the surface so foreground text stays legible. */
|
|
151
|
+
tint?: ColorValue;
|
|
152
|
+
/** optional native outer drop shadow (spills outside the rounded rect). */
|
|
153
|
+
shadow?: SystemViewShadow;
|
|
154
|
+
/** horizontal native alpha fade at the left/right edges, as a 0..0.5 width fraction. */
|
|
155
|
+
edgeFade?: number;
|
|
156
|
+
/** vertical native alpha fade: full opacity below this 0..1 height fraction, transparent at top. */
|
|
157
|
+
topFadeStart?: number;
|
|
158
|
+
onLayout?: (event: LayoutChangeEvent) => void;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* `<SystemView>` — a native macOS surface parked behind the (transparent) app window
|
|
162
|
+
* within just this element's rounded rect. It can composite a backdrop blur
|
|
163
|
+
* (`material` / `glassVariant`), a `tint`, and a true outer drop `shadow`, any of which
|
|
164
|
+
* are optional. Transparent window regions stay crisp; the surface follows the
|
|
165
|
+
* element's layout bounds and RN opacity animations. Place one absolutely-filling a
|
|
166
|
+
* card's background:
|
|
167
|
+
*
|
|
168
|
+
* <View style={{ borderRadius: 16, overflow: "hidden" }}>
|
|
169
|
+
* <SystemView
|
|
170
|
+
* material="hudWindow"
|
|
171
|
+
* tint="#ffffff14"
|
|
172
|
+
* shadow={{ color: "#000000", radius: 24, offsetY: 8, opacity: 0.35 }}
|
|
173
|
+
* style={[StyleSheet.absoluteFill, { borderRadius: 16 }]}
|
|
174
|
+
* />
|
|
175
|
+
* <Text>foreground stays crisp</Text>
|
|
176
|
+
* </View>
|
|
177
|
+
*/
|
|
178
|
+
export declare const SystemView: FC<SystemViewProps>;
|
|
179
|
+
export interface WebViewMessageEvent {
|
|
180
|
+
nativeEvent: {
|
|
181
|
+
data: string;
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
export interface WebViewProps extends AccessibilityProps {
|
|
185
|
+
source: {
|
|
186
|
+
uri: string;
|
|
187
|
+
} | {
|
|
188
|
+
html: string;
|
|
189
|
+
};
|
|
190
|
+
style?: StyleProp<ViewStyle>;
|
|
191
|
+
boxShadow?: ViewStyle["boxShadow"];
|
|
192
|
+
nativeHandleRef?: MutableRefObject<WebViewHandle | null>;
|
|
193
|
+
/** the page finished loading */
|
|
194
|
+
onLoad?: () => void;
|
|
195
|
+
/** the page posted a message via `window.ReactNativeWebView.postMessage(data)` */
|
|
196
|
+
onMessage?: (event: WebViewMessageEvent) => void;
|
|
197
|
+
onLayout?: (event: LayoutChangeEvent) => void;
|
|
198
|
+
}
|
|
199
|
+
/** imperative handle (host → frame) obtained via a `ref` on `<WebView>`. */
|
|
200
|
+
export interface WebViewHandle {
|
|
201
|
+
/** run arbitrary JS inside the page */
|
|
202
|
+
injectJavaScript: (js: string) => void;
|
|
203
|
+
/** deliver a message to the page; arrives as a `message` event on window & document */
|
|
204
|
+
postMessage: (data: string) => void;
|
|
205
|
+
/** reload the current document */
|
|
206
|
+
reload: () => void;
|
|
207
|
+
}
|
|
208
|
+
export declare function createHostCommandId(): number;
|
|
209
|
+
/**
|
|
210
|
+
* `<WebView source={{ uri | html }} />` — a native WebView child (native web scroll +
|
|
211
|
+
* selection). Two-way messaging: the page calls
|
|
212
|
+
* `window.ReactNativeWebView.postMessage(d)` → `onMessage`; the host calls
|
|
213
|
+
* `ref.injectJavaScript(js)` / `ref.postMessage(d)` / `ref.reload()` → the page.
|
|
214
|
+
*/
|
|
215
|
+
export declare const WebView: import("react").ForwardRefExoticComponent<WebViewProps & import("react").RefAttributes<WebViewHandle>>;
|
|
216
|
+
export interface ScrollViewProps extends ViewProps {
|
|
217
|
+
horizontal?: boolean;
|
|
218
|
+
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
219
|
+
showsVerticalScrollIndicator?: boolean;
|
|
220
|
+
showsHorizontalScrollIndicator?: boolean;
|
|
221
|
+
onScroll?: (event: unknown) => void;
|
|
222
|
+
}
|
|
223
|
+
export interface NativeHostHandle {
|
|
224
|
+
id?: number;
|
|
225
|
+
measure?: (callback: (x: number, y: number, width: number, height: number, pageX: number, pageY: number) => void) => void;
|
|
226
|
+
measureInWindow?: (callback: (x: number, y: number, width: number, height: number) => void) => void;
|
|
227
|
+
measureLayout?: (relativeToNativeNode: unknown, onSuccess: (left: number, top: number, width: number, height: number) => void, onFail?: () => void) => void;
|
|
228
|
+
}
|
|
229
|
+
export interface ScrollViewHandle extends NativeHostHandle {
|
|
230
|
+
scrollTo: (options?: {
|
|
231
|
+
x?: number;
|
|
232
|
+
y?: number;
|
|
233
|
+
animated?: boolean;
|
|
234
|
+
} | number) => void;
|
|
235
|
+
scrollToEnd: (options?: {
|
|
236
|
+
animated?: boolean;
|
|
237
|
+
}) => void;
|
|
238
|
+
getNativeScrollRef: () => NativeHostHandle | null;
|
|
239
|
+
getScrollableNode: () => NativeHostHandle | null;
|
|
240
|
+
getAnimatableRef: () => NativeHostHandle | null;
|
|
241
|
+
}
|
|
242
|
+
export declare const ScrollView: import("react").ForwardRefExoticComponent<ScrollViewProps & import("react").RefAttributes<ScrollViewHandle>>;
|
|
243
|
+
export interface RefreshControlProps {
|
|
244
|
+
refreshing: boolean;
|
|
245
|
+
onRefresh?: () => void;
|
|
246
|
+
progressViewOffset?: number;
|
|
247
|
+
tintColor?: ColorValue;
|
|
248
|
+
title?: string;
|
|
249
|
+
titleColor?: ColorValue;
|
|
250
|
+
colors?: ColorValue[];
|
|
251
|
+
enabled?: boolean;
|
|
252
|
+
style?: StyleProp<ViewStyle>;
|
|
253
|
+
}
|
|
254
|
+
export declare function RefreshControl(_props: RefreshControlProps): null;
|
|
255
|
+
type PressableStyle = StyleProp<ViewStyle> | ((state: {
|
|
256
|
+
pressed: boolean;
|
|
257
|
+
}) => StyleProp<ViewStyle>);
|
|
258
|
+
export interface PressableProps extends AccessibilityProps {
|
|
259
|
+
children?: ReactNode | ((state: {
|
|
260
|
+
pressed: boolean;
|
|
261
|
+
}) => ReactNode);
|
|
262
|
+
style?: PressableStyle;
|
|
263
|
+
onPress?: (event: GestureResponderEvent) => void;
|
|
264
|
+
onPressIn?: (event: GestureResponderEvent) => void;
|
|
265
|
+
onPressOut?: (event: GestureResponderEvent) => void;
|
|
266
|
+
onLongPress?: (event: GestureResponderEvent) => void;
|
|
267
|
+
onLayout?: (event: LayoutChangeEvent) => void;
|
|
268
|
+
disabled?: boolean;
|
|
269
|
+
hitSlop?: number;
|
|
270
|
+
nativeListGroup?: string;
|
|
271
|
+
}
|
|
272
|
+
export declare const Pressable: FC<PressableProps>;
|
|
273
|
+
export interface TouchableProps extends PressableProps {
|
|
274
|
+
activeOpacity?: number;
|
|
275
|
+
}
|
|
276
|
+
export declare const TouchableOpacity: FC<TouchableProps>;
|
|
277
|
+
export declare const TouchableHighlight: FC<TouchableProps & {
|
|
278
|
+
underlayColor?: ColorValue;
|
|
279
|
+
}>;
|
|
280
|
+
export declare const TouchableWithoutFeedback: FC<PressableProps>;
|
|
281
|
+
export interface ListGroupProps extends ViewProps {
|
|
282
|
+
id?: string;
|
|
283
|
+
disabled?: boolean;
|
|
284
|
+
}
|
|
285
|
+
export declare const ListGroup: FC<ListGroupProps>;
|
|
286
|
+
export interface ButtonProps extends AccessibilityProps {
|
|
287
|
+
title: string;
|
|
288
|
+
onPress?: (event: GestureResponderEvent) => void;
|
|
289
|
+
color?: ColorValue;
|
|
290
|
+
disabled?: boolean;
|
|
291
|
+
}
|
|
292
|
+
export declare const Button: FC<ButtonProps>;
|
|
293
|
+
export interface NativeButtonProps extends AccessibilityProps {
|
|
294
|
+
title: string;
|
|
295
|
+
onPress?: (event: GestureResponderEvent) => void;
|
|
296
|
+
disabled?: boolean;
|
|
297
|
+
style?: StyleProp<ViewStyle>;
|
|
298
|
+
}
|
|
299
|
+
/** `<NativeButton>` — a real AppKit `NSButton`. See note above on the chrome/forms tradeoff. */
|
|
300
|
+
export declare const NativeButton: FC<NativeButtonProps>;
|
|
301
|
+
/** `<NativeTextInput>` — a real AppKit `NSTextField`/`NSSecureTextField`. See note above. */
|
|
302
|
+
export declare const NativeTextInput: FC<TextInputProps>;
|
|
303
|
+
export type DiffEvent = {
|
|
304
|
+
nativeEvent: {
|
|
305
|
+
value?: string;
|
|
306
|
+
oldLine?: number;
|
|
307
|
+
newLine?: number;
|
|
308
|
+
};
|
|
309
|
+
};
|
|
310
|
+
export interface DiffProps extends AccessibilityProps {
|
|
311
|
+
/** unified git patch text. */
|
|
312
|
+
patch: string;
|
|
313
|
+
wordDiff?: boolean;
|
|
314
|
+
collapsedPaths?: string[];
|
|
315
|
+
/** use the native virtualized scroller. Requires a bounded height. */
|
|
316
|
+
scroll?: boolean;
|
|
317
|
+
maxLines?: number;
|
|
318
|
+
onToggleFile?: (event: DiffEvent) => void;
|
|
319
|
+
onShowMore?: (event: DiffEvent) => void;
|
|
320
|
+
onLineClick?: (event: DiffEvent) => void;
|
|
321
|
+
style?: StyleProp<TextStyle>;
|
|
322
|
+
}
|
|
323
|
+
/** native virtualized unified-diff leaf. */
|
|
324
|
+
export declare const Diff: FC<DiffProps>;
|
|
325
|
+
export declare const SafeAreaView: FC<ViewProps>;
|
|
326
|
+
export interface KeyboardAvoidingViewProps extends ViewProps {
|
|
327
|
+
behavior?: "height" | "position" | "padding";
|
|
328
|
+
keyboardVerticalOffset?: number;
|
|
329
|
+
}
|
|
330
|
+
export declare const KeyboardAvoidingView: FC<KeyboardAvoidingViewProps>;
|
|
331
|
+
export interface SwitchProps extends AccessibilityProps {
|
|
332
|
+
value?: boolean;
|
|
333
|
+
onValueChange?: (value: boolean) => void;
|
|
334
|
+
disabled?: boolean;
|
|
335
|
+
trackColor?: {
|
|
336
|
+
false?: ColorValue;
|
|
337
|
+
true?: ColorValue;
|
|
338
|
+
};
|
|
339
|
+
thumbColor?: ColorValue;
|
|
340
|
+
style?: StyleProp<ViewStyle>;
|
|
341
|
+
}
|
|
342
|
+
export declare const Switch: FC<SwitchProps>;
|
|
343
|
+
export interface FlatListProps<T> {
|
|
344
|
+
data?: ReadonlyArray<T>;
|
|
345
|
+
renderItem: (info: {
|
|
346
|
+
item: T;
|
|
347
|
+
index: number;
|
|
348
|
+
}) => ReactNode;
|
|
349
|
+
keyExtractor?: (item: T, index: number) => string;
|
|
350
|
+
ListHeaderComponent?: ReactNode;
|
|
351
|
+
ListFooterComponent?: ReactNode;
|
|
352
|
+
ListEmptyComponent?: ReactNode;
|
|
353
|
+
ItemSeparatorComponent?: FC<any>;
|
|
354
|
+
horizontal?: boolean;
|
|
355
|
+
numColumns?: number;
|
|
356
|
+
style?: StyleProp<ViewStyle>;
|
|
357
|
+
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
358
|
+
onLayout?: (event: LayoutChangeEvent) => void;
|
|
359
|
+
}
|
|
360
|
+
export declare function FlatList<T>({ data, renderItem, keyExtractor, ListHeaderComponent, ListFooterComponent, ListEmptyComponent, ItemSeparatorComponent, horizontal, style, contentContainerStyle, ...rest }: FlatListProps<T>): import("react").FunctionComponentElement<ScrollViewProps & import("react").RefAttributes<ScrollViewHandle>>;
|
|
361
|
+
export interface SectionListData<T> {
|
|
362
|
+
title?: string;
|
|
363
|
+
data: ReadonlyArray<T>;
|
|
364
|
+
}
|
|
365
|
+
export interface SectionListProps<T> {
|
|
366
|
+
sections: ReadonlyArray<SectionListData<T>>;
|
|
367
|
+
renderItem: (info: {
|
|
368
|
+
item: T;
|
|
369
|
+
index: number;
|
|
370
|
+
section: SectionListData<T>;
|
|
371
|
+
}) => ReactNode;
|
|
372
|
+
renderSectionHeader?: (info: {
|
|
373
|
+
section: SectionListData<T>;
|
|
374
|
+
}) => ReactNode;
|
|
375
|
+
keyExtractor?: (item: T, index: number) => string;
|
|
376
|
+
style?: StyleProp<ViewStyle>;
|
|
377
|
+
contentContainerStyle?: StyleProp<ViewStyle>;
|
|
378
|
+
}
|
|
379
|
+
export declare function SectionList<T>({ sections, renderItem, renderSectionHeader, keyExtractor, style, contentContainerStyle, }: SectionListProps<T>): import("react").FunctionComponentElement<ScrollViewProps & import("react").RefAttributes<ScrollViewHandle>>;
|
|
380
|
+
export interface ActivityIndicatorProps {
|
|
381
|
+
size?: "small" | "large" | number;
|
|
382
|
+
color?: ColorValue;
|
|
383
|
+
style?: StyleProp<ViewStyle>;
|
|
384
|
+
}
|
|
385
|
+
export declare const ActivityIndicator: FC<ActivityIndicatorProps>;
|
|
386
|
+
export interface StatusBarProps {
|
|
387
|
+
barStyle?: "default" | "light-content" | "dark-content";
|
|
388
|
+
hidden?: boolean;
|
|
389
|
+
backgroundColor?: ColorValue;
|
|
390
|
+
translucent?: boolean;
|
|
391
|
+
animated?: boolean;
|
|
392
|
+
}
|
|
393
|
+
declare function StatusBarComponent(_props: StatusBarProps): null;
|
|
394
|
+
export interface ModalProps {
|
|
395
|
+
visible?: boolean;
|
|
396
|
+
transparent?: boolean;
|
|
397
|
+
animationType?: "none" | "slide" | "fade";
|
|
398
|
+
onRequestClose?: () => void;
|
|
399
|
+
onShow?: () => void;
|
|
400
|
+
onDismiss?: () => void;
|
|
401
|
+
children?: ReactNode;
|
|
402
|
+
style?: StyleProp<ViewStyle>;
|
|
403
|
+
}
|
|
404
|
+
export declare const Modal: FC<ModalProps>;
|
|
405
|
+
export declare const StatusBar: typeof StatusBarComponent & {
|
|
406
|
+
currentHeight: number;
|
|
407
|
+
setBarStyle(_style: string, _animated?: boolean): void;
|
|
408
|
+
setHidden(_hidden: boolean, _animation?: string): void;
|
|
409
|
+
setBackgroundColor(_color: ColorValue, _animated?: boolean): void;
|
|
410
|
+
setTranslucent(_translucent: boolean): void;
|
|
411
|
+
setNetworkActivityIndicatorVisible(_visible: boolean): void;
|
|
412
|
+
pushStackEntry(props: StatusBarProps): StatusBarProps;
|
|
413
|
+
popStackEntry(_entry: StatusBarProps): void;
|
|
414
|
+
replaceStackEntry(_entry: StatusBarProps, props: StatusBarProps): StatusBarProps;
|
|
415
|
+
};
|
|
416
|
+
export declare function requireNativeComponent(name: string): import("react").ForwardRefExoticComponent<Omit<Record<string, unknown>, "ref"> & import("react").RefAttributes<unknown>>;
|
|
417
|
+
export declare function codegenNativeComponent(name: string): import("react").ForwardRefExoticComponent<Omit<Record<string, unknown>, "ref"> & import("react").RefAttributes<unknown>>;
|
|
418
|
+
export declare function codegenNativeCommands<T extends object = Record<string, never>>(): T;
|
|
419
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* react-native-gpui — write React Native components, render them natively with
|
|
3
|
+
* GPUI (Zed's GPU UI framework) instead of a mobile host.
|
|
4
|
+
*
|
|
5
|
+
* import { View, Text, StyleSheet, AppRegistry } from "react-native-gpui";
|
|
6
|
+
*/
|
|
7
|
+
import "./raf";
|
|
8
|
+
import "./hotModules";
|
|
9
|
+
export { createRoot, render, AppRegistry, unstable_batchedUpdates, type Root, type RootOptions, type DevtoolsOptions, type RunApplicationOptions, } from "./render";
|
|
10
|
+
export { View, Text, TextInput, Image, Svg, WebView, SystemView, ScrollView, RefreshControl, Pressable, TouchableOpacity, TouchableHighlight, TouchableWithoutFeedback, ListGroup, Button, NativeButton, NativeTextInput, Diff, SafeAreaView, KeyboardAvoidingView, Switch, FlatList, SectionList, ActivityIndicator, StatusBar, Modal, requireNativeComponent, codegenNativeComponent, codegenNativeCommands, } from "./components";
|
|
11
|
+
export type { TextProps, TextInputProps, TextInputHandle, ImageProps, SvgProps, WebViewProps, WebViewHandle, WebViewMessageEvent, SystemViewProps, SystemViewMaterial, SystemViewGlassVariant, SystemViewShadow, ScrollViewHandle, ScrollViewProps, RefreshControlProps, PressableProps, TouchableProps, ListGroupProps, ButtonProps, NativeButtonProps, DiffProps, DiffEvent, SwitchProps, FlatListProps, SectionListProps, KeyboardAvoidingViewProps, ActivityIndicatorProps, } from "./components";
|
|
12
|
+
export { Window, type WindowProps, type WindowHandle, type WindowCloseEvent } from "./Window";
|
|
13
|
+
export type { WindowCloseReason, WindowKind, WindowPosition } from "./window-host";
|
|
14
|
+
export { useAppState, useWindowFocused, type AppStateStatus, type AppStateEventType, type WindowFocusEvent } from "./app-state";
|
|
15
|
+
export { ChatList } from "./ChatList";
|
|
16
|
+
export type { ChatListBadgeElement, ChatListElement, ChatListEmoteElement, ChatListHandle, ChatListHoverEvent, ChatListMessage, ChatListMessagePatch, ChatListPressEvent, ChatListProps, ChatListRevealAlign, ChatListScrollState, ChatListTargetKind, ChatListTextElement, ChatListUserElement, } from "./chat-list-types";
|
|
17
|
+
export { StyleSheet, normalizeStyle } from "./StyleSheet";
|
|
18
|
+
export type { ColorValue, DimensionValue, FlexStyle, ShadowStyleIOS, ViewStyle, TextStyle, ImageStyle, StyleProp, ViewProps, LayoutRectangle, LayoutChangeEvent, GestureResponderEvent, MouseResponderEvent, NativeResizeEdge, NativeResizeSpec, KeyboardKeyEvent, } from "./types";
|
|
19
|
+
export { LiquidGlassBackground, LiquidGlassView, EffectSurface, SmokeEffectSurface, effectBackgroundImage, smokeEffectBackgroundImage, } from "./surfaces";
|
|
20
|
+
export type { LiquidGlassBackgroundProps, LiquidGlassChrome, LiquidGlassViewProps, EffectSurfaceEffect, EffectSurfaceProps, SmokeEffect, SmokeEffectSurfaceProps, } from "./surfaces";
|
|
21
|
+
export { Dimensions, type ScaledSize } from "./Dimensions";
|
|
22
|
+
export { useWindowDimensions, Platform, PixelRatio, useColorScheme, Appearance, DynamicColorIOS, PlatformColor, I18nManager, Alert, Keyboard, BackHandler, AppState, Linking, InteractionManager, LayoutAnimation, UIManager, NativeModules, findNodeHandle, processColor, resolveColorValue, PanResponder, Vibration, DeviceEventEmitter, NativeEventEmitter, AccessibilityInfo, LogBox, TurboModuleRegistry, FilePicker, VoiceRecorder, type ColorSchemeName, type DynamicColorIOSTuple, type FilePickerOptions, type VoiceRecording, } from "./apis";
|
|
23
|
+
export { Notifications, Sound, Processes, LocalStorage, getRandomValues, randomUUID, type NotificationOptions, type SoundOptions, type SoundSource, } from "./platform-services";
|
|
24
|
+
export { Animated, AnimatedValue, Easing } from "./Animated";
|
|
25
|
+
export { AppCommands, Dock, ImageCache, NativeClipboard, NativeLayout, NativeMenus, NativeWindow, PerformanceHUD, QuickLook, Renderer, type AppCommandBinding, type AppCommandConfig, type AppCommandMenu, type AppCommandMenuItem, type NativeMenuCommandItem, } from "./commands";
|
|
26
|
+
export { setupTamaguiNativeMenus } from "./native-menu";
|
|
27
|
+
export { KeyboardNavigationProvider, useKeyboardNavigation, useKeyboardNavigationController, useKeyboardNavigationState, useKeyboardNavigationTarget, useKeyboardNavigationKeyPress, useKeyboardNavigationWindowKeyboard, mergeRefs, enabledKeyboardNavigationTargets, firstKeyboardNavigationTarget, hasKeyboardNavigationModifier, nextKeyboardNavigationTarget, nextSequentialKeyboardNavigationTarget, } from "./keyboard";
|
|
28
|
+
export type { KeyboardNavigationChange, KeyboardNavigationController, KeyboardNavigationControllerOptions, KeyboardNavigationDirection, KeyboardNavigationEventLike, KeyboardNavigationFocusOptions, KeyboardNavigationKeyPressOptions, KeyboardNavigationModelOptions, KeyboardNavigationReason, KeyboardNavigationRect, KeyboardNavigationSequentialDirection, KeyboardNavigationState, KeyboardNavigationTarget, KeyboardNavigationTargetModel, KeyboardNavigationVerticalScope, } from "./keyboard";
|
|
29
|
+
export { Portal, PortalHost, PortalProvider, NativePortal, NativePortalHost, usePortal, setupTamaguiNativePortal, type PortalProps, type PortalHostProps, type PortalProviderProps, } from "./portal";
|
|
30
|
+
export { startBridge, type Bridge, type BridgeEvent, type BridgeOptions, type RendererProvenance, type SerializedNode } from "./runtime";
|
|
31
|
+
export { platformDriver, registerPseudoListener, type PseudoState, type PseudoListener } from "./platform-driver";
|