@felipe-software/react-native-gpui 0.0.0-placeholder → 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 +658 -1
- 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 +177 -1
- 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,102 @@
|
|
|
1
|
+
import ReactReconciler from "react-reconciler";
|
|
2
|
+
import type { SerializedNode } from "./runtime";
|
|
3
|
+
export interface Instance {
|
|
4
|
+
id: number;
|
|
5
|
+
type: string;
|
|
6
|
+
props: Record<string, unknown>;
|
|
7
|
+
children: Array<Instance | TextInstance>;
|
|
8
|
+
parent: Instance | null;
|
|
9
|
+
dirty: boolean;
|
|
10
|
+
cached: SerializedNode | undefined;
|
|
11
|
+
cachedListGroup: string | undefined;
|
|
12
|
+
layoutSnapshot: LayoutSnapshot | undefined;
|
|
13
|
+
layoutDirty: boolean;
|
|
14
|
+
preparedStyle: Record<string, unknown> | undefined;
|
|
15
|
+
hasPreparedStyle: boolean;
|
|
16
|
+
hasPortal: boolean;
|
|
17
|
+
measure: (callback: MeasureCallback) => void;
|
|
18
|
+
measureInWindow: (callback: MeasureInWindowCallback) => void;
|
|
19
|
+
measureLayout: (relativeToNativeNode: Instance | number | null, onSuccess: (left: number, top: number, width: number, height: number) => void, onFail?: () => void) => void;
|
|
20
|
+
__nativeTag: number;
|
|
21
|
+
__internalInstanceHandle: {
|
|
22
|
+
stateNode: {
|
|
23
|
+
node: number;
|
|
24
|
+
};
|
|
25
|
+
type: string;
|
|
26
|
+
};
|
|
27
|
+
_viewConfig: {
|
|
28
|
+
uiViewClassName: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export interface TextInstance {
|
|
32
|
+
id: number;
|
|
33
|
+
text: string;
|
|
34
|
+
parent: Instance | null;
|
|
35
|
+
}
|
|
36
|
+
export interface Container {
|
|
37
|
+
rootID: number;
|
|
38
|
+
width: number;
|
|
39
|
+
height: number;
|
|
40
|
+
children: Array<Instance | TextInstance>;
|
|
41
|
+
windowId?: number;
|
|
42
|
+
rootGlobalId?: number;
|
|
43
|
+
}
|
|
44
|
+
export type ReconcilerCommitDiagnostics = {
|
|
45
|
+
mutationMs: number;
|
|
46
|
+
serializeMs: number;
|
|
47
|
+
updates: number;
|
|
48
|
+
creates: number;
|
|
49
|
+
serializeHits: number;
|
|
50
|
+
serializeMisses: number;
|
|
51
|
+
};
|
|
52
|
+
export declare function createWindowContainer(windowId: number, width: number, height: number): Container;
|
|
53
|
+
export declare function registerWindowContainer(container: Container, push: (tree: SerializedNode) => void): void;
|
|
54
|
+
export declare function unregisterWindowContainer(windowId: number): void;
|
|
55
|
+
export declare function pushWindowTree(windowId: number): void;
|
|
56
|
+
export declare function windowContainers(): Container[];
|
|
57
|
+
export declare function invalidateSerializeCaches(container: Container): void;
|
|
58
|
+
type LayoutSnapshot = Pick<SerializedNode, "type" | "style" | "text" | "runs" | "numberOfLines" | "placeholder" | "value" | "src" | "nativeLayoutKey" | "nativeResize" | "wordDiff" | "collapsedPaths" | "diffScroll" | "maxLines">;
|
|
59
|
+
type MeasureCallback = (x: number, y: number, width: number, height: number, pageX: number, pageY: number) => void;
|
|
60
|
+
type MeasureInWindowCallback = (x: number, y: number, width: number, height: number) => void;
|
|
61
|
+
/** The platform driver opts a node into (or out of) the renderer→JS pseudo lane by
|
|
62
|
+
* globalId. Toggles `pseudoEvents` in the serializer's side set, marks the node dirty,
|
|
63
|
+
* and recommits so the host learns the flag without a React render. */
|
|
64
|
+
export declare function setPseudoEvents(id: number, on: boolean): void;
|
|
65
|
+
/** Called by the render layer when the bridge reports a native event. */
|
|
66
|
+
export declare function dispatchEvent(id: number, event: string, payload: {
|
|
67
|
+
value?: string;
|
|
68
|
+
key?: string;
|
|
69
|
+
shiftKey?: boolean;
|
|
70
|
+
ctrlKey?: boolean;
|
|
71
|
+
altKey?: boolean;
|
|
72
|
+
metaKey?: boolean;
|
|
73
|
+
isComposing?: boolean;
|
|
74
|
+
eventCount?: number;
|
|
75
|
+
button?: number;
|
|
76
|
+
buttons?: number;
|
|
77
|
+
pressDrag?: boolean;
|
|
78
|
+
pageX?: number;
|
|
79
|
+
pageY?: number;
|
|
80
|
+
locationX?: number;
|
|
81
|
+
locationY?: number;
|
|
82
|
+
scrollX?: number;
|
|
83
|
+
scrollY?: number;
|
|
84
|
+
scrollWidth?: number;
|
|
85
|
+
scrollHeight?: number;
|
|
86
|
+
scrollContentWidth?: number;
|
|
87
|
+
scrollContentHeight?: number;
|
|
88
|
+
layout?: unknown;
|
|
89
|
+
cols?: number;
|
|
90
|
+
rows?: number;
|
|
91
|
+
oldLine?: number;
|
|
92
|
+
newLine?: number;
|
|
93
|
+
chat?: unknown;
|
|
94
|
+
}): void;
|
|
95
|
+
export declare function findHostNodeId(ref: unknown): number | null;
|
|
96
|
+
export declare function measureHostNode(node: Instance | number | null | undefined, callback: MeasureCallback): void;
|
|
97
|
+
export declare function measureHostNodeInWindow(node: Instance | number | null | undefined, callback: MeasureInWindowCallback): void;
|
|
98
|
+
export declare function measureHostNodeLayout(node: Instance | number | null | undefined, relativeToNativeNode: Instance | number | null | undefined, onSuccess: (left: number, top: number, width: number, height: number) => void, onFail?: () => void): void;
|
|
99
|
+
export declare function serializeContainer(c: Container): SerializedNode;
|
|
100
|
+
export declare function setCommitSink(fn: (tree: SerializedNode, diagnostics?: ReconcilerCommitDiagnostics) => void): void;
|
|
101
|
+
declare const Reconciler: ReactReconciler.Reconciler<unknown, unknown, unknown, unknown, unknown>;
|
|
102
|
+
export default Reconciler;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function installRefreshRuntime(): void;
|
package/dist/render.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The render entry point. Drives react-reconciler into the GPUI bridge:
|
|
3
|
+
* React tree → reconciler → serialized node tree → startBridge → GPUI window.
|
|
4
|
+
* Native events (press / changeText / layout / resize) flow back the other way.
|
|
5
|
+
*/
|
|
6
|
+
import { type ReactElement, type ComponentType } from "react";
|
|
7
|
+
export type DevtoolsOptions = {
|
|
8
|
+
/** hold Option to inspect native GPUI nodes; Option-click copies a node snapshot. */
|
|
9
|
+
inspector?: boolean;
|
|
10
|
+
/** show native frame, commit, and bridge timing in the app window. */
|
|
11
|
+
performanceHud?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export interface RootOptions {
|
|
14
|
+
/** initial window size; defaults to the current Dimensions window */
|
|
15
|
+
width?: number;
|
|
16
|
+
height?: number;
|
|
17
|
+
/** optional native development tools for this root */
|
|
18
|
+
devtools?: boolean | DevtoolsOptions;
|
|
19
|
+
}
|
|
20
|
+
export interface Root {
|
|
21
|
+
render(element: ReactElement): void;
|
|
22
|
+
unmount(): void;
|
|
23
|
+
}
|
|
24
|
+
export declare function createRoot(options?: RootOptions): Root;
|
|
25
|
+
/** Convenience entry point for the process's single native window. */
|
|
26
|
+
export declare function render(element: ReactElement, options?: RootOptions): Root;
|
|
27
|
+
export declare function unstable_batchedUpdates<T>(fn: (arg?: T) => unknown, arg?: T): unknown;
|
|
28
|
+
type ComponentProvider = () => ComponentType<any>;
|
|
29
|
+
export interface RunApplicationOptions extends RootOptions {
|
|
30
|
+
initialProps?: Record<string, unknown>;
|
|
31
|
+
}
|
|
32
|
+
export declare const AppRegistry: {
|
|
33
|
+
registerComponent(appKey: string, provider: ComponentProvider): string;
|
|
34
|
+
runApplication(appKey: string, options?: RunApplicationOptions): Root;
|
|
35
|
+
getAppKeys(): string[];
|
|
36
|
+
};
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime bridge — in-process host calls to the embedded JavaScriptCore host (rust/src/jsc.rs).
|
|
3
|
+
*
|
|
4
|
+
* Single-process model: this code runs inside JavaScriptCore on the JS thread; the Rust binary owns
|
|
5
|
+
* the GPUI/Metal main thread. Instead of spawning a service and streaming NDJSON over pipes,
|
|
6
|
+
* every committed tree is handed to the host fn `globalThis.__rngpui_applyTree(json)`, and
|
|
7
|
+
* native events arrive by the host calling `globalThis.__rngpui_onHostEvent(json)`.
|
|
8
|
+
*
|
|
9
|
+
* The JSON tree/event protocol is unchanged from the old stdio bridge — only the transport.
|
|
10
|
+
*/
|
|
11
|
+
export type SerializedNode = {
|
|
12
|
+
globalId: number;
|
|
13
|
+
/** delta wire only: a `{ globalId, ref: true }` node tells the host to reuse the prior
|
|
14
|
+
* commit's subtree for this id unchanged (emitted by toWireDelta in render.ts). Full
|
|
15
|
+
* nodes omit it and always carry `type`; refs carry only globalId + ref. */
|
|
16
|
+
ref?: boolean;
|
|
17
|
+
type?: string;
|
|
18
|
+
style?: Record<string, unknown>;
|
|
19
|
+
/** opt-in renderer→JS pseudo lane: when true, the host emits a coalesced `pseudo`
|
|
20
|
+
* event ({hovered, pressed}) on every native hover/press flip of this node's hitbox,
|
|
21
|
+
* routed by the pseudo registry (platform-driver.ts) to a renderer-platform driver
|
|
22
|
+
* (tamagui). Set imperatively via `platformDriver.pseudo.subscribe`, not a React prop. */
|
|
23
|
+
pseudoEvents?: boolean;
|
|
24
|
+
/** internal authored JSX source location. toWireDelta interns this before transport. */
|
|
25
|
+
source?: string;
|
|
26
|
+
/** compact wire tuple: [source-file id, line, column]. */
|
|
27
|
+
sourceId?: [number, number, number];
|
|
28
|
+
/** root-only source-file definitions first referenced by this tree update. */
|
|
29
|
+
sources?: Record<string, string>;
|
|
30
|
+
accessibility?: SerializedAccessibility;
|
|
31
|
+
text?: string;
|
|
32
|
+
numberOfLines?: number;
|
|
33
|
+
/** RN Text `selectable`: opts into the native drag selection + Cmd+C copy. */
|
|
34
|
+
selectable?: boolean;
|
|
35
|
+
value?: string;
|
|
36
|
+
defaultValue?: string;
|
|
37
|
+
editable?: boolean;
|
|
38
|
+
secureTextEntry?: boolean;
|
|
39
|
+
autoFocus?: boolean;
|
|
40
|
+
mostRecentEventCount?: number;
|
|
41
|
+
src?: string;
|
|
42
|
+
/** `<Image resizeMode>` — how the picture fills the box layout gave the element. */
|
|
43
|
+
resizeMode?: string;
|
|
44
|
+
/** `<Image dragOut>` — opt into macOS file drag-out. A string is the dropped filename. */
|
|
45
|
+
dragOut?: boolean | string;
|
|
46
|
+
dragFileName?: string;
|
|
47
|
+
/** `<Diff>` options. The patch itself uses `text` so large-field interning applies. */
|
|
48
|
+
wordDiff?: boolean;
|
|
49
|
+
collapsedPaths?: string[];
|
|
50
|
+
diffScroll?: boolean;
|
|
51
|
+
maxLines?: number;
|
|
52
|
+
chatList?: Record<string, unknown>;
|
|
53
|
+
/** delta wire only: this (changed) node's large `text`/`src` is byte-identical to
|
|
54
|
+
* what the host already holds for this globalId, so it was omitted — the host reuses
|
|
55
|
+
* its prior value (parse_json_tree, same PRIOR_TREE_INDEX the node-level `ref` uses).
|
|
56
|
+
* Emitted by toWireDelta's big-field interning; never set on a first/changed send. */
|
|
57
|
+
textRef?: boolean;
|
|
58
|
+
srcRef?: boolean;
|
|
59
|
+
name?: string;
|
|
60
|
+
placeholder?: string;
|
|
61
|
+
placeholderTextColor?: string;
|
|
62
|
+
/** RN ScrollView overlay-scroller visibility. Scrolling stays enabled when false. */
|
|
63
|
+
showsVerticalScrollIndicator?: boolean;
|
|
64
|
+
showsHorizontalScrollIndicator?: boolean;
|
|
65
|
+
/** `<SystemView>` NSVisualEffectView material name */
|
|
66
|
+
systemMaterial?: string;
|
|
67
|
+
/** `<SystemView>` NSGlassEffectView liquid-glass variant name (macOS 26+) */
|
|
68
|
+
systemGlassVariant?: string;
|
|
69
|
+
/** `<SystemView>` optional tint overlay, as a CSS color string */
|
|
70
|
+
systemTint?: string;
|
|
71
|
+
/** `<SystemView>` optional native outer drop shadow */
|
|
72
|
+
systemShadow?: {
|
|
73
|
+
color?: string;
|
|
74
|
+
radius?: number;
|
|
75
|
+
offsetX?: number;
|
|
76
|
+
offsetY?: number;
|
|
77
|
+
opacity?: number;
|
|
78
|
+
};
|
|
79
|
+
/** `<SystemView>` horizontal native alpha fade at the left/right edges, 0..0.5 */
|
|
80
|
+
systemEdgeFade?: number;
|
|
81
|
+
/** `<SystemView>` vertical native alpha fade start, 0..1 from top to bottom */
|
|
82
|
+
systemTopFadeStart?: number;
|
|
83
|
+
/** in-app liquid-glass backdrop blur radius (logical-px gaussian sigma) for a `<View>` */
|
|
84
|
+
backdropBlur?: number;
|
|
85
|
+
/** tint composited over the blurred backdrop, as a CSS color string */
|
|
86
|
+
backdropTint?: string;
|
|
87
|
+
events?: string[];
|
|
88
|
+
children?: SerializedNode[];
|
|
89
|
+
/** inline styled runs for `<Text>` with nested `<Text>` children */
|
|
90
|
+
runs?: Array<{
|
|
91
|
+
text: string;
|
|
92
|
+
fontWeight?: string;
|
|
93
|
+
color?: string;
|
|
94
|
+
fontStyle?: string;
|
|
95
|
+
}>;
|
|
96
|
+
/** native-only layout override key, used by the gpui runtime without React commits */
|
|
97
|
+
nativeLayoutKey?: string;
|
|
98
|
+
/** native-only resize gesture, applied to a keyed native layout target */
|
|
99
|
+
nativeResize?: SerializedNativeResize;
|
|
100
|
+
/** native-only press-drag selection group */
|
|
101
|
+
nativeListGroup?: string;
|
|
102
|
+
};
|
|
103
|
+
export type SerializedNativeResize = {
|
|
104
|
+
target: string;
|
|
105
|
+
edge: "left" | "right" | "top" | "bottom";
|
|
106
|
+
min?: number;
|
|
107
|
+
max?: number;
|
|
108
|
+
};
|
|
109
|
+
export type SerializedAccessibility = {
|
|
110
|
+
accessible?: boolean;
|
|
111
|
+
hidden?: boolean;
|
|
112
|
+
label?: string;
|
|
113
|
+
role?: string;
|
|
114
|
+
hint?: string;
|
|
115
|
+
value?: string;
|
|
116
|
+
identifier?: string;
|
|
117
|
+
identifierSource?: "nativeID" | "testID" | "id";
|
|
118
|
+
nativeID?: string;
|
|
119
|
+
testID?: string;
|
|
120
|
+
propID?: string;
|
|
121
|
+
disabled?: boolean;
|
|
122
|
+
selected?: boolean;
|
|
123
|
+
checked?: boolean | "mixed";
|
|
124
|
+
expanded?: boolean;
|
|
125
|
+
};
|
|
126
|
+
export type BridgeEvent = {
|
|
127
|
+
type: "ready";
|
|
128
|
+
width: number;
|
|
129
|
+
height: number;
|
|
130
|
+
} | {
|
|
131
|
+
type: "resize";
|
|
132
|
+
width: number;
|
|
133
|
+
height: number;
|
|
134
|
+
} | {
|
|
135
|
+
type: "command";
|
|
136
|
+
id: string;
|
|
137
|
+
} | {
|
|
138
|
+
type: "appearance";
|
|
139
|
+
colorScheme: "light" | "dark";
|
|
140
|
+
} | {
|
|
141
|
+
type: "rendererProvenance";
|
|
142
|
+
requestId: number;
|
|
143
|
+
provenance: RendererProvenance;
|
|
144
|
+
} | {
|
|
145
|
+
type: "imagePrefetch";
|
|
146
|
+
requestId: number;
|
|
147
|
+
loaded: boolean;
|
|
148
|
+
} | {
|
|
149
|
+
type: "window";
|
|
150
|
+
windowId: number;
|
|
151
|
+
event: "open" | "resize" | "close" | "focus" | "blur";
|
|
152
|
+
width?: number;
|
|
153
|
+
height?: number;
|
|
154
|
+
reason?: "system" | "escape" | "blur" | "error";
|
|
155
|
+
} | {
|
|
156
|
+
type: "appState";
|
|
157
|
+
state: "active" | "inactive";
|
|
158
|
+
windowId: number | null;
|
|
159
|
+
} | {
|
|
160
|
+
type: "event";
|
|
161
|
+
id: number;
|
|
162
|
+
event: string;
|
|
163
|
+
value?: string;
|
|
164
|
+
key?: string;
|
|
165
|
+
shiftKey?: boolean;
|
|
166
|
+
ctrlKey?: boolean;
|
|
167
|
+
altKey?: boolean;
|
|
168
|
+
metaKey?: boolean;
|
|
169
|
+
isComposing?: boolean;
|
|
170
|
+
eventCount?: number;
|
|
171
|
+
button?: number;
|
|
172
|
+
buttons?: number;
|
|
173
|
+
pressDrag?: boolean;
|
|
174
|
+
pageX?: number;
|
|
175
|
+
pageY?: number;
|
|
176
|
+
locationX?: number;
|
|
177
|
+
locationY?: number;
|
|
178
|
+
scrollX?: number;
|
|
179
|
+
scrollY?: number;
|
|
180
|
+
scrollWidth?: number;
|
|
181
|
+
scrollHeight?: number;
|
|
182
|
+
scrollContentWidth?: number;
|
|
183
|
+
scrollContentHeight?: number;
|
|
184
|
+
layout?: {
|
|
185
|
+
x: number;
|
|
186
|
+
y: number;
|
|
187
|
+
width: number;
|
|
188
|
+
height: number;
|
|
189
|
+
};
|
|
190
|
+
oldLine?: number;
|
|
191
|
+
newLine?: number;
|
|
192
|
+
/** `pseudo` lane: absolute native hover/press state of the node's hitbox */
|
|
193
|
+
hovered?: boolean;
|
|
194
|
+
pressed?: boolean;
|
|
195
|
+
chat?: unknown;
|
|
196
|
+
};
|
|
197
|
+
export interface Bridge {
|
|
198
|
+
initialUpdate: BridgeUpdateDiagnostics;
|
|
199
|
+
update(tree: SerializedNode): BridgeUpdateDiagnostics;
|
|
200
|
+
/** send an imperative command (host → frame), e.g. a WebView eval/reload */
|
|
201
|
+
command(cmd: object): void;
|
|
202
|
+
onEvent(cb: (e: BridgeEvent) => void): void;
|
|
203
|
+
close(): void;
|
|
204
|
+
}
|
|
205
|
+
export type BridgeUpdateDiagnostics = {
|
|
206
|
+
bytes: number;
|
|
207
|
+
stringifyMs: number;
|
|
208
|
+
};
|
|
209
|
+
export interface BridgeOptions {
|
|
210
|
+
/** Enables the native Option-key element inspector in the host. */
|
|
211
|
+
inspector?: boolean;
|
|
212
|
+
/** Enables the native in-window frame/commit performance HUD. */
|
|
213
|
+
performanceHud?: boolean;
|
|
214
|
+
}
|
|
215
|
+
export type RendererProvenance = {
|
|
216
|
+
renderer: string;
|
|
217
|
+
rendererVersion: string;
|
|
218
|
+
gpuiRevision: string;
|
|
219
|
+
serviceVersion: string;
|
|
220
|
+
jsEngine: string;
|
|
221
|
+
jsEngineVersion: string;
|
|
222
|
+
bundleUrl: string | null;
|
|
223
|
+
development: boolean;
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* Send one `$cmd` envelope to the host without a bridge.
|
|
227
|
+
*
|
|
228
|
+
* `startBridge` does not run until the first commit, so anything the host needs
|
|
229
|
+
* *before* React has rendered has no bridge to travel on. The host fns are
|
|
230
|
+
* installed before this bundle is even evaluated, so the channel itself is ready
|
|
231
|
+
* long before the bridge is.
|
|
232
|
+
*/
|
|
233
|
+
export declare function sendHostCommand(cmd: object): void;
|
|
234
|
+
export declare function setEventBatcher(fn: ((run: () => void) => void) | undefined): void;
|
|
235
|
+
export declare function startBridge(initial: SerializedNode, options?: BridgeOptions): Bridge;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type SystemViewGlassVariant, type SystemViewMaterial, type SystemViewShadow } from "./components";
|
|
3
|
+
import type { ColorValue, StyleProp, ViewProps, ViewStyle } from "./types";
|
|
4
|
+
export type LiquidGlassChrome = false | {
|
|
5
|
+
fill?: ColorValue;
|
|
6
|
+
borderColor?: ColorValue;
|
|
7
|
+
borderWidth?: number;
|
|
8
|
+
};
|
|
9
|
+
export interface LiquidGlassBackgroundProps {
|
|
10
|
+
radius?: number;
|
|
11
|
+
material?: SystemViewMaterial;
|
|
12
|
+
glassVariant?: SystemViewGlassVariant;
|
|
13
|
+
tint?: ColorValue;
|
|
14
|
+
shadow?: SystemViewShadow;
|
|
15
|
+
edgeFade?: number;
|
|
16
|
+
topFadeStart?: number;
|
|
17
|
+
chrome?: LiquidGlassChrome;
|
|
18
|
+
style?: StyleProp<ViewStyle>;
|
|
19
|
+
}
|
|
20
|
+
export interface LiquidGlassViewProps extends Omit<ViewProps, "style">, Omit<LiquidGlassBackgroundProps, "style"> {
|
|
21
|
+
style?: StyleProp<ViewStyle>;
|
|
22
|
+
backgroundStyle?: StyleProp<ViewStyle>;
|
|
23
|
+
children?: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export type SmokeEffect = {
|
|
26
|
+
type: "smoke";
|
|
27
|
+
color?: ColorValue;
|
|
28
|
+
fadedColor?: ColorValue;
|
|
29
|
+
alpha?: number;
|
|
30
|
+
reach?: number;
|
|
31
|
+
topClear?: number;
|
|
32
|
+
};
|
|
33
|
+
export type BackgroundImageEffect = {
|
|
34
|
+
type: "backgroundImage";
|
|
35
|
+
backgroundImage: string;
|
|
36
|
+
};
|
|
37
|
+
export type EffectSurfaceEffect = SmokeEffect | BackgroundImageEffect;
|
|
38
|
+
export interface EffectSurfaceProps extends Omit<ViewProps, "style" | "backgroundImage" | "experimental_backgroundImage"> {
|
|
39
|
+
effect: EffectSurfaceEffect;
|
|
40
|
+
radius?: number;
|
|
41
|
+
style?: StyleProp<ViewStyle>;
|
|
42
|
+
children?: ReactNode;
|
|
43
|
+
}
|
|
44
|
+
export interface SmokeEffectSurfaceProps extends Omit<EffectSurfaceProps, "effect">, Omit<SmokeEffect, "type"> {
|
|
45
|
+
}
|
|
46
|
+
export declare function LiquidGlassBackground({ radius, material, glassVariant, tint, shadow, edgeFade, topFadeStart, chrome, style, }: LiquidGlassBackgroundProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export declare function LiquidGlassView({ children, style, backgroundStyle, radius, material, glassVariant, tint, shadow, edgeFade, topFadeStart, chrome, ...viewProps }: LiquidGlassViewProps): import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
export declare function EffectSurface({ effect, radius, style, children, ...viewProps }: EffectSurfaceProps): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
export declare function SmokeEffectSurface({ color, fadedColor, alpha, reach, topClear, ...props }: SmokeEffectSurfaceProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
export declare function effectBackgroundImage(effect: EffectSurfaceEffect): string;
|
|
51
|
+
export declare function smokeEffectBackgroundImage(effect: Omit<SmokeEffect, "type">): string;
|