@gjsify/react-native 0.44.0 → 0.46.0

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.
Files changed (142) hide show
  1. package/PROPS.md +525 -0
  2. package/README.md +49 -167
  3. package/SUPPORT.md +472 -0
  4. package/lib/esm/accessor.js +1 -0
  5. package/lib/esm/animated/brand.js +1 -0
  6. package/lib/esm/animated/easing.js +1 -0
  7. package/lib/esm/animated/index.js +1 -0
  8. package/lib/esm/animated/properties.js +1 -0
  9. package/lib/esm/animated/timing.js +1 -0
  10. package/lib/esm/animated/value.js +1 -0
  11. package/lib/esm/announce.js +1 -0
  12. package/lib/esm/app-registry.js +1 -1
  13. package/lib/esm/components.js +1 -1
  14. package/lib/esm/generated/own-exports.js +1 -0
  15. package/lib/esm/generated/unsupported-async-storage.js +0 -0
  16. package/lib/esm/generated/unsupported-expo-audio.js +1 -0
  17. package/lib/esm/generated/unsupported-expo-constants.js +1 -0
  18. package/lib/esm/generated/unsupported-expo-font.js +1 -0
  19. package/lib/esm/generated/unsupported-expo-image.js +1 -0
  20. package/lib/esm/generated/unsupported-expo-linking.js +1 -0
  21. package/lib/esm/generated/unsupported-expo-splash-screen.js +1 -0
  22. package/lib/esm/generated/unsupported-expo-status-bar.js +1 -0
  23. package/lib/esm/generated/unsupported-expo-system-ui.js +1 -0
  24. package/lib/esm/generated/unsupported-expo-video.js +1 -0
  25. package/lib/esm/generated/unsupported-expo-web-browser.js +1 -0
  26. package/lib/esm/generated/unsupported-nativewind.js +1 -0
  27. package/lib/esm/generated/unsupported-react-native-gesture-handler.js +1 -0
  28. package/lib/esm/generated/unsupported-react-native-safe-area-context.js +1 -0
  29. package/lib/esm/generated/unsupported-react-native-webview.js +1 -0
  30. package/lib/esm/generated/unsupported-react-native.js +1 -0
  31. package/lib/esm/generated/unsupported-router.js +1 -0
  32. package/lib/esm/generated/unsupported-vector-icons.js +1 -0
  33. package/lib/esm/index.js +1 -1
  34. package/lib/esm/lists/components.js +1 -1
  35. package/lib/esm/lists/controller.js +1 -1
  36. package/lib/esm/primitives/answers.js +1 -0
  37. package/lib/esm/primitives/defaults.js +1 -0
  38. package/lib/esm/primitives/errors.js +1 -1
  39. package/lib/esm/primitives/handles.js +1 -0
  40. package/lib/esm/primitives/index.js +1 -1
  41. package/lib/esm/primitives/intents.js +1 -1
  42. package/lib/esm/primitives/resolve.js +1 -1
  43. package/lib/esm/primitives/style.js +1 -1
  44. package/lib/esm/primitives/table.js +1 -1
  45. package/lib/esm/prop-table.js +1 -0
  46. package/lib/esm/router/href.js +1 -0
  47. package/lib/esm/router/index.js +1 -1
  48. package/lib/esm/router/navigation.js +1 -1
  49. package/lib/esm/router/tabs.js +1 -1
  50. package/lib/esm/solid/index.js +1 -1
  51. package/lib/esm/stylesheet.js +1 -1
  52. package/lib/esm/support-table.js +1 -1
  53. package/lib/esm/surfaces/async-storage.js +1 -0
  54. package/lib/esm/surfaces/expo-audio.js +1 -0
  55. package/lib/esm/surfaces/expo-constants.js +1 -0
  56. package/lib/esm/surfaces/expo-font.js +1 -0
  57. package/lib/esm/surfaces/expo-image.js +1 -0
  58. package/lib/esm/surfaces/expo-linking.js +1 -0
  59. package/lib/esm/surfaces/expo-splash-screen.js +1 -0
  60. package/lib/esm/surfaces/expo-status-bar.js +1 -0
  61. package/lib/esm/surfaces/expo-system-ui.js +1 -0
  62. package/lib/esm/surfaces/expo-video.js +1 -0
  63. package/lib/esm/surfaces/expo-web-browser.js +1 -0
  64. package/lib/esm/surfaces/icon-map.js +1 -0
  65. package/lib/esm/surfaces/nativewind.js +1 -0
  66. package/lib/esm/surfaces/react-native-gesture-handler.js +1 -0
  67. package/lib/esm/surfaces/react-native-safe-area-context.js +1 -0
  68. package/lib/esm/surfaces/react-native-webview.js +1 -0
  69. package/lib/esm/surfaces/vector-icons.js +1 -0
  70. package/lib/esm/unsupported.js +1 -1
  71. package/lib/types/accessor.d.ts +10 -0
  72. package/lib/types/animated/animated.spec.d.ts +2 -0
  73. package/lib/types/animated/brand.d.ts +8 -0
  74. package/lib/types/animated/easing.d.ts +70 -0
  75. package/lib/types/animated/easing.spec.d.ts +2 -0
  76. package/lib/types/animated/index.d.ts +55 -0
  77. package/lib/types/animated/properties.d.ts +33 -0
  78. package/lib/types/animated/timing.d.ts +37 -0
  79. package/lib/types/animated/value.d.ts +103 -0
  80. package/lib/types/announce.d.ts +18 -0
  81. package/lib/types/components.d.ts +82 -3
  82. package/lib/types/generated/own-exports.d.ts +1 -0
  83. package/lib/types/generated/unsupported-async-storage.d.ts +1 -0
  84. package/lib/types/generated/unsupported-expo-audio.d.ts +4 -0
  85. package/lib/types/generated/unsupported-expo-constants.d.ts +2 -0
  86. package/lib/types/generated/unsupported-expo-font.d.ts +4 -0
  87. package/lib/types/generated/unsupported-expo-image.d.ts +3 -0
  88. package/lib/types/generated/unsupported-expo-linking.d.ts +4 -0
  89. package/lib/types/generated/unsupported-expo-splash-screen.d.ts +5 -0
  90. package/lib/types/generated/unsupported-expo-status-bar.d.ts +5 -0
  91. package/lib/types/generated/unsupported-expo-system-ui.d.ts +2 -0
  92. package/lib/types/generated/unsupported-expo-video.d.ts +3 -0
  93. package/lib/types/generated/unsupported-expo-web-browser.d.ts +6 -0
  94. package/lib/types/generated/unsupported-nativewind.d.ts +5 -0
  95. package/lib/types/generated/unsupported-react-native-gesture-handler.d.ts +10 -0
  96. package/lib/types/generated/unsupported-react-native-safe-area-context.d.ts +4 -0
  97. package/lib/types/generated/unsupported-react-native-webview.d.ts +1 -0
  98. package/lib/types/generated/{unsupported-exports.d.ts → unsupported-react-native.d.ts} +0 -2
  99. package/lib/types/generated/unsupported-vector-icons.d.ts +11 -0
  100. package/lib/types/index.d.ts +6 -2
  101. package/lib/types/lists/controller.d.ts +14 -58
  102. package/lib/types/primitives/answers.d.ts +69 -0
  103. package/lib/types/primitives/defaults.d.ts +52 -0
  104. package/lib/types/primitives/defaults.spec.d.ts +2 -0
  105. package/lib/types/primitives/errors.d.ts +9 -0
  106. package/lib/types/primitives/handles.d.ts +56 -0
  107. package/lib/types/primitives/index.d.ts +8 -2
  108. package/lib/types/primitives/intents.d.ts +36 -0
  109. package/lib/types/primitives/resolve.d.ts +25 -1
  110. package/lib/types/primitives/table.d.ts +63 -1
  111. package/lib/types/prop-table.d.ts +56 -0
  112. package/lib/types/prop-table.spec.d.ts +2 -0
  113. package/lib/types/router/href.d.ts +58 -0
  114. package/lib/types/router/href.spec.d.ts +2 -0
  115. package/lib/types/router/index.d.ts +3 -1
  116. package/lib/types/router/navigation.d.ts +47 -5
  117. package/lib/types/router/tabs.d.ts +35 -0
  118. package/lib/types/solid/index.d.ts +15 -1
  119. package/lib/types/support-table.d.ts +95 -3
  120. package/lib/types/surfaces/async-storage.d.ts +57 -0
  121. package/lib/types/surfaces/expo-audio.d.ts +1 -0
  122. package/lib/types/surfaces/expo-constants.d.ts +11 -0
  123. package/lib/types/surfaces/expo-font.d.ts +34 -0
  124. package/lib/types/surfaces/expo-image.d.ts +1 -0
  125. package/lib/types/surfaces/expo-linking.d.ts +36 -0
  126. package/lib/types/surfaces/expo-splash-screen.d.ts +1 -0
  127. package/lib/types/surfaces/expo-status-bar.d.ts +16 -0
  128. package/lib/types/surfaces/expo-system-ui.d.ts +1 -0
  129. package/lib/types/surfaces/expo-video.d.ts +1 -0
  130. package/lib/types/surfaces/expo-web-browser.d.ts +21 -0
  131. package/lib/types/surfaces/icon-map.d.ts +14 -0
  132. package/lib/types/surfaces/nativewind.d.ts +1 -0
  133. package/lib/types/surfaces/react-native-gesture-handler.d.ts +10 -0
  134. package/lib/types/surfaces/react-native-safe-area-context.d.ts +60 -0
  135. package/lib/types/surfaces/react-native-webview.d.ts +4 -0
  136. package/lib/types/surfaces/surfaces.spec.d.ts +2 -0
  137. package/lib/types/surfaces/vector-icons.d.ts +15 -0
  138. package/lib/types/unsupported.d.ts +12 -3
  139. package/package.json +85 -14
  140. package/lib/esm/generated/unsupported-exports.js +0 -1
  141. package/lib/esm/generated/unsupported-router-exports.js +0 -1
  142. /package/lib/types/generated/{unsupported-router-exports.d.ts → unsupported-router.d.ts} +0 -0
@@ -0,0 +1,37 @@
1
+ import { type EasingFunction } from './easing.js';
2
+ import type { AnimatedValue } from './value.js';
3
+ /** What React Native calls an `EndCallback`. */
4
+ export type EndCallback = (result: {
5
+ readonly finished: boolean;
6
+ }) => void;
7
+ /** `Animated.timing`'s config, as far as this layer answers for it. */
8
+ export interface TimingConfig {
9
+ readonly toValue: number;
10
+ readonly duration?: number;
11
+ readonly easing?: EasingFunction;
12
+ /**
13
+ * Accepted and MEANINGLESS, which is a decision rather than an oversight.
14
+ *
15
+ * On a phone the flag chooses whether the JavaScript thread interpolates and ships
16
+ * each frame over the bridge, or the native side owns the whole run. There is no
17
+ * bridge here: this layer renders in-process onto GTK, `Adw.TimedAnimation` owns
18
+ * the frame clock either way, and React re-renders for a frame in neither case. So
19
+ * both values behave identically and the flag is honoured by being ignored — said
20
+ * out loud here and in the support table, because a config key that is silently
21
+ * dropped is indistinguishable from one that was misspelled.
22
+ */
23
+ readonly useNativeDriver?: boolean;
24
+ }
25
+ /** The handle `Animated.timing` returns. React Native calls it a `CompositeAnimation`. */
26
+ export interface CompositeAnimation {
27
+ start(callback?: EndCallback): void;
28
+ stop(): void;
29
+ reset(): void;
30
+ }
31
+ /**
32
+ * Animate `value` to `config.toValue` over `config.duration` milliseconds.
33
+ *
34
+ * Nothing starts until `.start()` — React Native's own shape, and here it is also
35
+ * what lets the run pick up a frame clock from whichever view binds the value.
36
+ */
37
+ export declare function timing(value: AnimatedValue, config: TimingConfig): CompositeAnimation;
@@ -0,0 +1,103 @@
1
+ import { ANIMATED_VALUE, type AnimatedValueLike } from './brand.js';
2
+ /**
3
+ * One place an animated number lands: a widget property this layer writes.
4
+ *
5
+ * `widget` is typed `object` rather than `Gtk.Widget` on purpose — see the module
6
+ * comment. It is here at all because an `Adw.Animation` needs a widget for its frame
7
+ * clock, and the only widgets this value knows about are the ones bound to it.
8
+ */
9
+ export interface ValueSink {
10
+ /** The widget whose frame clock an animation of this value can use. */
11
+ readonly widget: object;
12
+ /** Write the number where it belongs. */
13
+ write(value: number): void;
14
+ }
15
+ /**
16
+ * The half of a running animation this value drives, implemented in `timing.ts`.
17
+ *
18
+ * Three callbacks and no getters: the value tells the run what happened to its
19
+ * clock, and the run tells the value what the number is. Anything more would put
20
+ * frame state on both sides.
21
+ */
22
+ export interface ValueRun {
23
+ /** A sink arrived and this run has no clock yet — start now. */
24
+ clockAvailable(widget: object): void;
25
+ /** The sink that supplied the clock is gone. */
26
+ clockLost(): void;
27
+ /** `setValue`, or another animation, took this value over. */
28
+ interrupted(): void;
29
+ /**
30
+ * `resetAnimation`: put the value back to the number this run started from.
31
+ *
32
+ * `rewind` and not `reset`, because the handle `Animated.timing` returns has a
33
+ * PUBLIC `reset()` of its own that routes through the value — two methods called
34
+ * `reset` calling each other is a stack overflow, and it is one this name avoids
35
+ * rather than documents.
36
+ */
37
+ rewind(): void;
38
+ }
39
+ /**
40
+ * A number that animates, and the views bound to it.
41
+ *
42
+ * The subset ADR 0032's measured application uses — `new Animated.Value(n)`, handed
43
+ * to `Animated.timing` and read by an `<Animated.View>` style — plus `setValue`,
44
+ * `__getValue`, `stopAnimation` and `resetAnimation`, which are the four that cost
45
+ * nothing once the run bookkeeping exists. Everything else on React Native's
46
+ * `AnimatedValue` is a named refusal in `index.ts`, with its reason.
47
+ *
48
+ * The `__`-prefixed methods are React Native's own convention for a node's internals
49
+ * (`__getValue` is in its public type declarations), and they are how `timing.ts` and
50
+ * `Animated.View` reach the run and the sinks. They are not part of the surface a
51
+ * ported application should call.
52
+ */
53
+ export declare class AnimatedValue implements AnimatedValueLike {
54
+ #private;
55
+ readonly [ANIMATED_VALUE]: true;
56
+ /** Stable per instance. `Animated.View` puts it in an effect's dependency list. */
57
+ readonly id: number;
58
+ constructor(value: number);
59
+ /** The number right now. React Native's own spelling for this read. */
60
+ __getValue(): number;
61
+ /**
62
+ * Jump to a value, stopping whatever was animating it.
63
+ *
64
+ * Stopping first is React Native's own behaviour and it is not a detail: a
65
+ * `setValue` that left the animation running would be overwritten on the next
66
+ * frame, so the write would appear to do nothing for the rest of the run.
67
+ */
68
+ setValue(value: number): void;
69
+ /**
70
+ * Stop the running animation where it is; the callback gets the value it stopped at.
71
+ *
72
+ * React Native's signature is `stopAnimation(callback?: (value: number) => void)`,
73
+ * and the value it reports is the one the animation reached — which is why this
74
+ * cannot be written as `stop(); callback(0)`.
75
+ */
76
+ stopAnimation(callback?: (value: number) => void): void;
77
+ /**
78
+ * Stop and go back to where the run started.
79
+ *
80
+ * `Adw.Animation.reset()` does exactly this on its own side (measured: state
81
+ * returns to IDLE and `value` to `value-from`, with no `done`), and the run is
82
+ * what knows the starting number — so the reset is the run's, and this method is
83
+ * the value's way of asking for it.
84
+ */
85
+ resetAnimation(callback?: (value: number) => void): void;
86
+ /**
87
+ * Bind a widget property to this value; returns the unbind.
88
+ *
89
+ * The sink is written IMMEDIATELY, because a view that only hears about changes
90
+ * starts out disagreeing with the value — a `new Animated.Value(0)` behind an
91
+ * `opacity` must make the widget transparent on its first frame, not on the
92
+ * animation's.
93
+ */
94
+ __attach(sink: ValueSink): () => void;
95
+ /** The widget a new run can take its frame clock from, or null. */
96
+ __clockWidget(): object | null;
97
+ /** Take this value over. Any previous run is interrupted, as React Native's is. */
98
+ __claim(run: ValueRun): void;
99
+ /** The run finished on its own; nothing to interrupt. */
100
+ __release(run: ValueRun): void;
101
+ /** One frame. Called by the run's animation target. */
102
+ __publish(value: number): void;
103
+ }
@@ -0,0 +1,18 @@
1
+ import Gtk from 'gi://Gtk?version=4.0';
2
+ import type { ResolvedAnnouncement } from './primitives/resolve.js';
3
+ /**
4
+ * How many elements are currently reporting their content changes to a screen reader.
5
+ *
6
+ * `accessibilityLiveRegion="none"` and an absent prop must subscribe to NOTHING, and
7
+ * both render identically to one that does — only a count tells them apart.
8
+ */
9
+ export declare const liveRegionWatchCount: () => number;
10
+ /**
11
+ * Announce `widget`'s own text whenever `announcement.signal` says it changed.
12
+ *
13
+ * Returns the unsubscribe. AN EMPTY MESSAGE IS NOT ANNOUNCED: a `Gtk.Label` passes
14
+ * through `''` on its way between two strings when an application rebuilds its text,
15
+ * and "say nothing" is what a screen reader should do with it — announcing it would
16
+ * interrupt the user to say nothing at all.
17
+ */
18
+ export declare function onLiveRegion(widget: Gtk.Widget, announcement: ResolvedAnnouncement): () => void;
@@ -1,14 +1,22 @@
1
1
  import { type ReactElement, type ReactNode, type Ref } from 'react';
2
2
  import type { ClassNameInput } from './primitives/classes.js';
3
+ import { type TextInputHandle } from './primitives/handles.js';
3
4
  import { type ChildContext, type PrimitivePlan, type WidgetNode } from './primitives/resolve.js';
4
- import type { StyleInput } from './primitives/style.js';
5
+ import { type StyleInput } from './primitives/style.js';
5
6
  import type { StyleTokens } from '@gjsify/gtk-host/style';
6
7
  /** What every primitive accepts on top of its own props. */
7
8
  export interface CommonProps {
8
9
  className?: ClassNameInput;
9
10
  style?: StyleInput;
10
11
  children?: ReactNode;
11
- /** The `Gtk.Widget` itself — the host's `getPublicInstance` hands back the real widget. */
12
+ /**
13
+ * The `Gtk.Widget` itself — except where React Native documents an imperative
14
+ * handle, which is `<TextInput>` and its {@link TextInputHandle}.
15
+ *
16
+ * `unknown` rather than `Gtk.Widget`, because the two values are not one type and
17
+ * the primitive decides which arrives. A component that has a handle declares it:
18
+ * `useRef<TextInput>(null)` resolves to the handle's members.
19
+ */
12
20
  ref?: Ref<unknown>;
13
21
  testID?: string;
14
22
  }
@@ -51,6 +59,15 @@ export interface TextProps extends CommonProps {
51
59
  numberOfLines?: number;
52
60
  ellipsizeMode?: 'head' | 'middle' | 'tail';
53
61
  selectable?: boolean;
62
+ /**
63
+ * Announce this label's text when it changes — `Gtk.Accessible.announce()`.
64
+ *
65
+ * Declared on `Text` ALONE, and that is the whole of what GTK can answer: the
66
+ * announcement is imperative, so the layer needs both the moment and the message,
67
+ * and a `Gtk.Label` is the one widget whose content is a property. Every other
68
+ * primitive refuses the prop by name.
69
+ */
70
+ accessibilityLiveRegion?: 'none' | 'polite' | 'assertive';
54
71
  }
55
72
  export declare function Text(props: TextProps): ReactElement;
56
73
  /** What React Native hands a `Pressable`'s function child. */
@@ -92,7 +109,7 @@ export interface ActivityIndicatorProps extends CommonProps {
92
109
  hidesWhenStopped?: boolean;
93
110
  }
94
111
  export declare function ActivityIndicator(props: ActivityIndicatorProps): ReactElement;
95
- export interface TextInputProps extends CommonProps {
112
+ export interface TextInputProps extends Omit<CommonProps, 'ref'> {
96
113
  value?: string;
97
114
  defaultValue?: string;
98
115
  placeholder?: string;
@@ -104,6 +121,29 @@ export interface TextInputProps extends CommonProps {
104
121
  maxLength?: number;
105
122
  secureTextEntry?: boolean;
106
123
  keyboardType?: 'default' | 'email-address' | 'phone-pad' | 'number-pad' | 'numeric' | 'decimal-pad' | 'url';
124
+ /** A declared no-op: there is no autofill service on a GTK desktop. `keyboardType` is the hint that lands. */
125
+ autoComplete?: string;
126
+ /** `autoComplete`'s iOS spelling, and the same absent addressee. */
127
+ textContentType?: string;
128
+ /** A declared no-op: each widget has one Return behaviour, and `multiline` picks the widget. */
129
+ submitBehavior?: 'submit' | 'blurAndSubmit' | 'newline';
130
+ ref?: Ref<TextInputHandle>;
131
+ }
132
+ /**
133
+ * The INSTANCE type, because in React Native `TextInput` is a class.
134
+ *
135
+ * `useRef<TextInput>(null)` and `passwordRef.current?.focus()` are ordinary React
136
+ * Native code, and both were broken here: the name was a function, so it was a value
137
+ * and not a type, and the ref carried the bare `Gtk.Widget`. An interface merges with
138
+ * the function declaration below — they occupy different declaration spaces — so the
139
+ * name means the component in an expression and the handle in a type position,
140
+ * exactly as the class does upstream.
141
+ *
142
+ * What it does NOT copy is React Native's `TextInput extends React.Component`: the
143
+ * component here is a function, and nothing may read `props`/`state`/`setState` off
144
+ * a ref. Those are not part of the ref contract upstream either.
145
+ */
146
+ export interface TextInput extends TextInputHandle {
107
147
  }
108
148
  export declare function TextInput(props: TextInputProps): ReactElement;
109
149
  export interface SwitchProps extends CommonProps {
@@ -230,4 +270,43 @@ export interface StatusBarProps {
230
270
  * different question and refuse by name — see `StatusBarStatics`.
231
271
  */
232
272
  export declare function StatusBar(_props: StatusBarProps): null;
273
+ /** A `style` prop that may carry `Animated.Value`s. */
274
+ export type AnimatedStyleInput = StyleInput | Readonly<Record<string, unknown>>;
275
+ export interface AnimatedViewProps extends Omit<ViewProps, 'style'> {
276
+ style?: AnimatedStyleInput;
277
+ }
278
+ /**
279
+ * A `View` whose animated style entries drive GTK widget properties directly.
280
+ *
281
+ * NO RE-RENDER PER FRAME, and that is the design rather than an optimisation. An
282
+ * `Animated.Value` behind an `opacity` could have been React state, and then a 300 ms
283
+ * fade would be ~18 reconciler passes over the subtree for a property GTK can
284
+ * interpolate itself. So the value writes `Gtk.Widget:opacity` through the sink bound
285
+ * below, `Adw.TimedAnimation` owns the frame clock (`animated/timing.ts`), and React
286
+ * sees exactly two commits: the mount and the unmount.
287
+ *
288
+ * THE FIRST FRAME IS RENDERED, NOT BOUND. The sink is attached in an effect, which
289
+ * runs after the commit — so the initial number is ALSO written as a widget property
290
+ * in the render itself. Without it a `new Animated.Value(0)` behind an opacity paints
291
+ * one frame fully opaque before the effect makes it transparent, which is a flash on
292
+ * every mount of every faded-in screen.
293
+ */
294
+ export declare function AnimatedView(props: AnimatedViewProps): ReactElement;
295
+ /**
296
+ * A themed icon — `Gtk.Image` with an `icon-name`.
297
+ *
298
+ * NOT a React Native name and not exported from the package root: it is the widget
299
+ * ADR 0036's `@expo/vector-icons` surface renders, and it lives here rather than in
300
+ * that surface for the reason ADR 0032 § 1 gives — a component that named `GtkImage`
301
+ * itself would put a widget name in L3. `name` is a GTK icon name by the time it
302
+ * arrives; the Ionicons vocabulary is translated in `surfaces/icon-map.ts`.
303
+ */
304
+ export interface IconProps extends Omit<CommonProps, 'children'> {
305
+ /** A GTK icon name, e.g. `go-home-symbolic`. */
306
+ name: string;
307
+ /** `Gtk.Image:pixel-size`, in pixels. */
308
+ size?: number;
309
+ color?: string;
310
+ }
311
+ export declare function Icon(props: IconProps): ReactElement;
233
312
  export {};
@@ -0,0 +1 @@
1
+ export declare const OWN_EXPORT_NAMES: readonly string[];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare const useAudioPlayer: never;
2
+ export declare const useAudioRecorder: never;
3
+ export declare const AudioModule: never;
4
+ export declare const setAudioModeAsync: never;
@@ -0,0 +1,2 @@
1
+ export declare const ExecutionEnvironment: never;
2
+ export declare const AppOwnership: never;
@@ -0,0 +1,4 @@
1
+ export declare const loadAsync: never;
2
+ export declare const unloadAsync: never;
3
+ export declare const unloadAllAsync: never;
4
+ export declare const FontDisplay: never;
@@ -0,0 +1,3 @@
1
+ export declare const Image: never;
2
+ export declare const ImageBackground: never;
3
+ export declare const useImage: never;
@@ -0,0 +1,4 @@
1
+ export declare const createURL: never;
2
+ export declare const addEventListener: never;
3
+ export declare const openSettings: never;
4
+ export declare const sendIntent: never;
@@ -0,0 +1,5 @@
1
+ export declare const preventAutoHideAsync: never;
2
+ export declare const hideAsync: never;
3
+ export declare const hide: never;
4
+ export declare const preventAutoHide: never;
5
+ export declare const setOptions: never;
@@ -0,0 +1,5 @@
1
+ export declare const setStatusBarStyle: never;
2
+ export declare const setStatusBarHidden: never;
3
+ export declare const setStatusBarBackgroundColor: never;
4
+ export declare const setStatusBarTranslucent: never;
5
+ export declare const setStatusBarNetworkActivityIndicatorVisible: never;
@@ -0,0 +1,2 @@
1
+ export declare const setBackgroundColorAsync: never;
2
+ export declare const getBackgroundColorAsync: never;
@@ -0,0 +1,3 @@
1
+ export declare const VideoView: never;
2
+ export declare const useVideoPlayer: never;
3
+ export declare const VideoContentFit: never;
@@ -0,0 +1,6 @@
1
+ export declare const dismissBrowser: never;
2
+ export declare const openAuthSessionAsync: never;
3
+ export declare const dismissAuthSession: never;
4
+ export declare const maybeCompleteAuthSession: never;
5
+ export declare const warmUpAsync: never;
6
+ export declare const coolDownAsync: never;
@@ -0,0 +1,5 @@
1
+ export declare const cssInterop: never;
2
+ export declare const remapProps: never;
3
+ export declare const styled: never;
4
+ export declare const vars: never;
5
+ export declare const useColorScheme: never;
@@ -0,0 +1,10 @@
1
+ export declare const Gesture: never;
2
+ export declare const GestureDetector: never;
3
+ export declare const PanGestureHandler: never;
4
+ export declare const TapGestureHandler: never;
5
+ export declare const LongPressGestureHandler: never;
6
+ export declare const PinchGestureHandler: never;
7
+ export declare const Swipeable: never;
8
+ export declare const ScrollView: never;
9
+ export declare const Directions: never;
10
+ export declare const State: never;
@@ -0,0 +1,4 @@
1
+ export declare const SafeAreaInsetsContext: never;
2
+ export declare const SafeAreaFrameContext: never;
3
+ export declare const withSafeAreaInsets: never;
4
+ export declare const SafeAreaConsumer: never;
@@ -0,0 +1 @@
1
+ export declare const WebView: never;
@@ -4,8 +4,6 @@ export declare const AppState: never;
4
4
  export declare const PixelRatio: never;
5
5
  export declare const PlatformColor: never;
6
6
  export declare const AccessibilityInfo: never;
7
- export declare const Animated: never;
8
- export declare const Easing: never;
9
7
  export declare const LayoutAnimation: never;
10
8
  export declare const InteractionManager: never;
11
9
  export declare const useAnimatedValue: never;
@@ -0,0 +1,11 @@
1
+ export declare const MaterialIcons: never;
2
+ export declare const MaterialCommunityIcons: never;
3
+ export declare const FontAwesome: never;
4
+ export declare const Feather: never;
5
+ export declare const AntDesign: never;
6
+ export declare const Entypo: never;
7
+ export declare const Octicons: never;
8
+ export declare const SimpleLineIcons: never;
9
+ export declare const createIconSet: never;
10
+ export declare const createIconSetFromFontello: never;
11
+ export declare const createIconSetFromIcoMoon: never;
@@ -9,18 +9,22 @@ export type { FlatListProps, ListRenderItemInfo, ListSeparators, ListSlot, Secti
9
9
  export { Alert, Appearance, Dimensions, Keyboard, Linking, Platform, Share } from './apis/index.js';
10
10
  export type { AlertButton, AlertOptions, AppearancePreferences, ColorSchemeName, DimensionKey, DimensionsPayload, DisplayMetrics, PlatformOS, PlatformSelectSpec, ShareAction, ShareContent, } from './apis/index.js';
11
11
  export { useColorScheme, useWindowDimensions } from './hooks.js';
12
+ export { Animated, Easing } from './animated/index.js';
13
+ export type { CompositeAnimation, EasingFunction, EndCallback, TimingConfig } from './animated/index.js';
12
14
  export { StyleSheet } from './stylesheet.js';
13
15
  export type { NamedStyles } from './stylesheet.js';
14
16
  export { configureStyle, resetStyleConfig, styleConfig } from './style-config.js';
15
17
  export type { StyleConfig } from './style-config.js';
16
18
  export * as primitives from './primitives/index.js';
17
19
  export { PrimitiveError } from './primitives/errors.js';
20
+ export type { TextInputHandle } from './primitives/handles.js';
18
21
  /**
19
22
  * React 19 batches every update on its own, so this is the identity call it already
20
23
  * is upstream — kept because application code and libraries still wrap in it, and an
21
24
  * absent export would refuse something that costs nothing to honour.
22
25
  */
23
26
  export declare function unstable_batchedUpdates<T, R>(callback: (argument: T) => R, argument: T): R;
24
- export * from './generated/unsupported-exports.js';
25
- export { SUPPORT_TABLE, SUPPORTED_NAMES, explainUnsupported, isImportable, type SupportEntry, type SupportStatus, type SupportTier, } from './support-table.js';
27
+ export * from './generated/unsupported-react-native.js';
28
+ export { OWN_EXPORT_NAMES, SUPPORT_TABLE, SUPPORTED_NAMES, explainUnsupported, isImportable, isOwnExport, type SupportEntry, type SupportStatus, type SupportTier, } from './support-table.js';
29
+ export { PRIMITIVE_VARIANTS, acceptsProp, explainProp, propAnswer, propNames, propTable, type PropAnswer, type PropStatus, type PropVariant, } from './prop-table.js';
26
30
  export { UnsupportedError } from './unsupported.js';
@@ -1,4 +1,5 @@
1
- import Gtk from 'gi://Gtk?version=4.0';
1
+ import { ListController, onScrollNearEnd } from '@gjsify/gtk-host/list';
2
+ import { type ReactRoot } from '@gjsify/gtk-host/react';
2
3
  import { type ReactNode } from 'react';
3
4
  /** One row: an identity, and the React tree it renders to. */
4
5
  export interface ListRow {
@@ -7,13 +8,9 @@ export interface ListRow {
7
8
  /** Called on every bind, so it always reads the latest `data`. */
8
9
  render(): ReactNode;
9
10
  }
10
- /**
11
- * A `Gtk.ListView`'s model, factory and per-row React roots.
12
- *
13
- * Constructed by a component, attached to a view the host created, disposed from the
14
- * component's own cleanup. Nothing here is reactive: `setRows` is called with the
15
- * current rows and works out whether GTK has to hear about it.
16
- */
11
+ /** The controller a list component owns: the shared core, wearing React's row sink. */
12
+ export type ReactListController = ListController<ListRow, ReactRoot>;
13
+ /** What a list component may tell its controller, beyond the rows themselves. */
17
14
  export interface ListControllerOptions {
18
15
  /**
19
16
  * Where a row's own render error goes.
@@ -26,40 +23,8 @@ export interface ListControllerOptions {
26
23
  */
27
24
  readonly onRowError?: (error: Error) => void;
28
25
  }
29
- export declare class ListController {
30
- #private;
31
- constructor(options?: ListControllerOptions);
32
- /**
33
- * Give the view its model and factory.
34
- *
35
- * `Gtk.NoSelection` and not the store directly: `Gtk.ListView:model` is a
36
- * `Gtk.SelectionModel`, and a plain `Gio.ListModel` is not one. `NoSelection` is
37
- * the wrapper that says "no selection" — React Native's lists have no selection
38
- * concept, and `Gtk.SingleSelection` would give rows a selected state nothing
39
- * would ever clear.
40
- */
41
- attach(view: Gtk.ListView): void;
42
- /**
43
- * The rows GTK should be showing.
44
- *
45
- * The model is only touched when the KEYS changed. When they did not, every row's
46
- * tree is re-rendered instead — a row whose key is the same but whose data changed
47
- * has to repaint, and measurement 4 says GTK will not re-bind it for us. That is
48
- * strictly cheaper than a splice, which tears down every row's React root.
49
- */
50
- setRows(rows: readonly ListRow[]): void;
51
- /** How many rows GTK is currently holding a widget for. A spec seam and a leak detector. */
52
- get liveRows(): number;
53
- /**
54
- * Unmount every row, disconnect every handler, and let go of the view.
55
- *
56
- * Called from the component's cleanup, which runs while JS callbacks still work —
57
- * unlike GTK's own `teardown`, which fires during GC sweeping when the view is
58
- * collected and is BLOCKED there (measured, see the header). Idempotent, because a
59
- * component's cleanup and an explicit dispose both reach it.
60
- */
61
- dispose(): void;
62
- }
26
+ /** The list controller a React component owns. */
27
+ export declare function createListController(options?: ListControllerOptions): ReactListController;
63
28
  /**
64
29
  * `keyExtractor`, with React Native's own default.
65
30
  *
@@ -69,21 +34,12 @@ export declare class ListController {
69
34
  */
70
35
  export declare function rowKey(item: unknown, index: number, keyExtractor?: (item: unknown, index: number) => string): string;
71
36
  /**
72
- * Call `listener` when the scroller gets within `threshold` page-lengths of the end.
73
- *
74
- * `Gtk.Adjustment`, because that is where GTK keeps a scroll position: the scrolled
75
- * window has no scroll signal of its own, and `notify::value` on the adjustment behind
76
- * `hadjustment`/`vadjustment` is what `ScrollView`'s own `onScroll` refusal points at.
77
- * MEASURED: a `Gtk.ScrolledWindow` hands out its adjustments with no window anywhere,
78
- * and `set_value` on one raised `notify::value` — so this is drivable, and asserted, in
79
- * a spec that presents nothing.
80
- *
81
- * `upper` and `page-size` are subscribed too, and not for completeness: `upper` grows
82
- * when rows are added, which is the event that ARMS the next call — React Native fires
83
- * `onEndReached` once per arrival at the end, and a list that grew has a new end.
37
+ * The scroll edge behind `onEndReached`, re-exported rather than reimplemented.
84
38
  *
85
- * A list with nothing to scroll (`upper <= page-size`) never fires. That is the state
86
- * every list is in before it has been allocated, and firing there would call
87
- * `onEndReached` on mount for every list in the application.
39
+ * It lived here, and it was never React's: `Gtk.Adjustment` arithmetic with no React in
40
+ * it and no toolkit value import. `@gjsify/gtk-host/list` owns it now, so a Vue or Solid
41
+ * list gets the same measured behaviour instead of re-deriving it — which is the failure
42
+ * this whole extraction exists to prevent. `components.ts` imports it from here, so the
43
+ * move costs no consumer a rewrite.
88
44
  */
89
- export declare function onScrollNearEnd(scroller: Gtk.ScrolledWindow, axis: 'horizontal' | 'vertical', threshold: number, listener: (distanceFromEnd: number) => void): () => void;
45
+ export { onScrollNearEnd };
@@ -0,0 +1,69 @@
1
+ import type { PrimitiveSpec } from './table.js';
2
+ /**
3
+ * What this layer does about a prop.
4
+ *
5
+ * The first six are ACCEPTED — the prop reaches GTK, by the route the name says.
6
+ * `ignored` is accepted too and reaches nothing, deliberately. Only `refused` and
7
+ * `unknown` throw, and they are separate because they have different fixes: a
8
+ * refusal is a decision with a reason, an unknown prop is a name nobody recognised
9
+ * (usually a typo, sometimes a prop this table has not grown yet).
10
+ */
11
+ export type PropStatus =
12
+ /** Becomes one or more GTK widget properties. */
13
+ 'property'
14
+ /** Binds a GObject signal. */
15
+ | 'event'
16
+ /** Joins the normalised style record and goes through the style partition. */
17
+ | 'style'
18
+ /** Becomes a `Gio.File` on a widget property. */
19
+ | 'file'
20
+ /** Binds a `Gtk.GestureClick` signal through a controller. */
21
+ | 'gesture'
22
+ /** Calls `Gtk.Accessible.announce()` when a signal reports the content changed. */
23
+ | 'announcement'
24
+ /** Recognised and deliberately without effect on a desktop window. */
25
+ | 'ignored'
26
+ /** Refused by name, with a reason. Throws a `PrimitiveError` when rendered. */
27
+ | 'refused'
28
+ /** The framework's own (`children`, `key`, `ref`, `className`, `style`); never reaches a widget. */
29
+ | 'framework'
30
+ /** Not a name this primitive carries at all. Throws a `PrimitiveError` when rendered. */
31
+ | 'unknown';
32
+ /** What this layer does about one prop of one primitive. */
33
+ export interface PropAnswer {
34
+ readonly primitive: string;
35
+ readonly prop: string;
36
+ readonly status: PropStatus;
37
+ /**
38
+ * The reason, for every status that has one.
39
+ *
40
+ * For `refused` and `unknown` it is the DETAIL of the `PrimitiveError` the
41
+ * resolver throws — the same string, not a paraphrase. For `ignored` it is why
42
+ * the no-op is the right answer. Empty for a prop that simply lands.
43
+ */
44
+ readonly why: string;
45
+ /** What it reaches on the GTK side: property names, a signal, or nothing. */
46
+ readonly gtk: readonly string[];
47
+ }
48
+ /** Does this status let a render proceed? `ignored` counts — it is a declared no-op, not a refusal. */
49
+ export declare const isAccepted: (status: PropStatus) => boolean;
50
+ /** The detail of the refusal a prop no primitive row carries gets. `resolve.ts` throws exactly this. */
51
+ export declare const unknownPropDetail: (spec: PrimitiveSpec) => string;
52
+ /** The detail of the refusal an unknown PRIMITIVE gets. `resolve.ts` throws exactly this. */
53
+ export declare const unknownPrimitiveDetail: (names: readonly string[]) => string;
54
+ /**
55
+ * What `primitive` does about `prop`.
56
+ *
57
+ * `frameworkProps` and `spec` arrive as arguments rather than being imported — see
58
+ * the header: this module is loaded by a Node script that cannot follow a `./x.js`
59
+ * specifier into a `.ts` file.
60
+ */
61
+ export declare function answerFor(primitive: string, spec: PrimitiveSpec, prop: string, frameworkProps: ReadonlySet<string>): PropAnswer;
62
+ /**
63
+ * The props a primitive names, in the order a reader wants them: accepted first.
64
+ *
65
+ * Sorted within a status so the generated document is stable — an object's key order
66
+ * is the table's authoring order, which is not a promise anyone should read a diff
67
+ * against.
68
+ */
69
+ export declare function propNamesOf(spec: PrimitiveSpec): readonly string[];
@@ -0,0 +1,52 @@
1
+ /** What this layer does about one divergence. */
2
+ export type DefaultVerdict =
3
+ /** The two disagree and the primitive writes React Native's value. */
4
+ 'normalised'
5
+ /** Checked, and the two already agree. Recorded so the sweep is a sweep. */
6
+ | 'agrees'
7
+ /** They disagree and GTK's is KEPT on purpose — the reason says why. */
8
+ | 'kept'
9
+ /**
10
+ * Not a default question at all: the table writes this for ONE primitive's own
11
+ * layout.
12
+ *
13
+ * The distinction is worth a verdict because the closure check below cannot make
14
+ * it — every `widgetProps` entry looks the same from there — and conflating the
15
+ * two would let a real divergence hide behind "well, some primitive wanted it".
16
+ */
17
+ | 'primitive';
18
+ export interface DefaultRow {
19
+ /** The GType a primitive names. */
20
+ readonly gtype: string;
21
+ /** The property, in GTK's own kebab spelling. */
22
+ readonly property: string;
23
+ /** What a freshly constructed widget reports. Re-measured by the spec. */
24
+ readonly gtk: string | number | boolean;
25
+ /** React Native's own default, in words. */
26
+ readonly reactNative: string;
27
+ /** Where that is written down, or how it was observed. */
28
+ readonly source: string;
29
+ readonly verdict: DefaultVerdict;
30
+ /** The value the primitive writes. Present exactly when the verdict is `normalised`. */
31
+ readonly normalisedTo?: string | number | boolean;
32
+ readonly reason: string;
33
+ }
34
+ /**
35
+ * Every (widget, property) pair whose default this layer has looked at.
36
+ *
37
+ * ORDERED BY WIDGET, and the `agrees` rows are not padding: "we checked and they
38
+ * match" and "nobody has looked" are different states, and only one of them is safe.
39
+ * A property absent from this file is in the second state.
40
+ */
41
+ export declare const DEFAULT_ROWS: readonly DefaultRow[];
42
+ /** Every row this layer writes a value for, as `(gtype, property)`. Read by the spec. */
43
+ export declare const NORMALISED_DEFAULTS: readonly DefaultRow[];
44
+ /**
45
+ * The row for one `(gtype, property)`, or undefined.
46
+ *
47
+ * FALLS BACK TO `GtkWidget`, and that is not a convenience: `hexpand`, `opacity` and
48
+ * `halign` are `Gtk.Widget`'s properties, so a primitive writing one on a
49
+ * `Gtk.ScrolledWindow` is writing the same property this ledger records once. Keying
50
+ * a row per widget that inherits them would be twenty copies of one fact.
51
+ */
52
+ export declare const defaultRowFor: (gtype: string, property: string) => DefaultRow | undefined;
@@ -0,0 +1,2 @@
1
+ declare const _default: () => Promise<void>;
2
+ export default _default;