@octane-xplat/ui 0.2.1 → 0.3.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.
- package/dist/native/octane-client-build.json +1 -1
- package/dist/native/ui.js +40 -19
- package/dist/native/ui10.js +19 -48
- package/dist/native/ui11.js +118 -56
- package/dist/native/ui12.js +114 -16
- package/dist/native/ui13.js +54 -18
- package/dist/native/ui14.js +76 -13
- package/dist/native/ui15.js +128 -18
- package/dist/native/ui16.js +48 -136
- package/dist/native/ui17.js +42 -19
- package/dist/native/ui18.js +50 -9
- package/dist/native/ui19.js +34 -12
- package/dist/native/ui2.js +10 -48
- package/dist/native/ui20.js +17 -0
- package/dist/native/ui21.js +93 -0
- package/dist/native/ui22.js +124 -0
- package/dist/native/ui23.js +103 -0
- package/dist/native/ui24.js +58 -0
- package/dist/native/ui25.js +19 -0
- package/dist/native/ui26.js +27 -0
- package/dist/native/ui27.js +35 -0
- package/dist/native/ui28.js +146 -0
- package/dist/native/ui29.js +28 -0
- package/dist/native/ui3.js +17 -20
- package/dist/native/ui30.js +35 -0
- package/dist/native/ui31.js +39 -0
- package/dist/native/ui32.js +70 -0
- package/dist/native/ui33.js +30 -0
- package/dist/native/ui34.js +10 -0
- package/dist/native/ui35.js +27 -0
- package/dist/native/ui36.js +34 -0
- package/dist/native/ui37.js +17 -0
- package/dist/native/ui38.js +68 -0
- package/dist/native/ui39.js +33 -0
- package/dist/native/ui4.js +21 -48
- package/dist/native/ui40.js +14 -0
- package/dist/native/ui41.js +104 -0
- package/dist/native/ui42.js +148 -0
- package/dist/native/ui43.js +22 -0
- package/dist/native/ui44.js +8 -0
- package/dist/native/ui5.js +70 -27
- package/dist/native/ui6.js +36 -20
- package/dist/native/ui7.js +24 -61
- package/dist/native/ui8.js +16 -18
- package/dist/native/ui9.js +16 -13
- package/dist/web/octane-client-build.json +1 -1
- package/dist/web/ui.js +40 -19
- package/dist/web/ui10.js +187 -31
- package/dist/web/ui11.js +419 -53
- package/dist/web/ui12.js +83 -15
- package/dist/web/ui13.js +107 -19
- package/dist/web/ui14.js +98 -18
- package/dist/web/ui15.js +83 -47
- package/dist/web/ui16.js +100 -93
- package/dist/web/ui17.js +36 -22
- package/dist/web/ui18.js +29 -15
- package/dist/web/ui19.js +9 -7
- package/dist/web/ui2.js +15 -103
- package/dist/web/ui20.js +114 -0
- package/dist/web/ui21.js +82 -0
- package/dist/web/ui22.js +68 -0
- package/dist/web/ui23.js +57 -0
- package/dist/web/ui24.js +16 -0
- package/dist/web/ui25.js +22 -0
- package/dist/web/ui26.js +39 -0
- package/dist/web/ui27.js +127 -0
- package/dist/web/ui28.js +112 -0
- package/dist/web/ui29.js +108 -0
- package/dist/web/ui3.js +19 -27
- package/dist/web/ui30.js +43 -0
- package/dist/web/ui31.js +42 -0
- package/dist/web/ui32.js +77 -0
- package/dist/web/ui33.js +43 -0
- package/dist/web/ui34.js +67 -0
- package/dist/web/ui35.js +9 -0
- package/dist/web/ui36.js +45 -0
- package/dist/web/ui37.js +47 -0
- package/dist/web/ui38.js +17 -0
- package/dist/web/ui39.js +100 -0
- package/dist/web/ui4.js +145 -17
- package/dist/web/ui40.js +41 -0
- package/dist/web/ui41.js +17 -0
- package/dist/web/ui42.js +9 -0
- package/dist/web/ui43.js +22 -0
- package/dist/web/ui44.js +8 -0
- package/dist/web/ui5.js +54 -52
- package/dist/web/ui6.js +43 -16
- package/dist/web/ui7.js +29 -46
- package/dist/web/ui8.js +29 -18
- package/dist/web/ui9.js +24 -16
- package/package.json +6 -3
- package/src/theme/tokens.css +166 -0
- package/types/index.d.ts +108 -1
- package/types/props.d.ts +333 -8
package/types/index.d.ts
CHANGED
|
@@ -9,43 +9,99 @@
|
|
|
9
9
|
import type { UniversalComponent } from 'octane/universal';
|
|
10
10
|
import type {
|
|
11
11
|
AnimatedValue,
|
|
12
|
+
AbsoluteProps,
|
|
13
|
+
ActivityIndicatorProps,
|
|
12
14
|
ColorScheme,
|
|
15
|
+
DrawerProps,
|
|
16
|
+
GridProps,
|
|
17
|
+
HeadingProps,
|
|
18
|
+
IconGlyph,
|
|
19
|
+
IconProps,
|
|
13
20
|
ImageProps,
|
|
21
|
+
KeyboardAvoidingProps,
|
|
22
|
+
LayoutChildProps,
|
|
14
23
|
ListProps,
|
|
15
24
|
ModalProps,
|
|
25
|
+
ModalOpenOptions,
|
|
26
|
+
ModalOpenResult,
|
|
27
|
+
OpenModal,
|
|
28
|
+
OverlayProps,
|
|
29
|
+
PopoverPlacement,
|
|
30
|
+
PopoverProps,
|
|
16
31
|
PlatformBadgeProps,
|
|
17
32
|
PressableProps,
|
|
33
|
+
ReadableStore,
|
|
18
34
|
Route,
|
|
35
|
+
RouteManifest,
|
|
36
|
+
RouteMeta,
|
|
19
37
|
RowProps,
|
|
20
38
|
ScreenProps,
|
|
39
|
+
SafeAreaProps,
|
|
40
|
+
ScreenTable,
|
|
21
41
|
ScrollViewProps,
|
|
42
|
+
SliderProps,
|
|
43
|
+
Store,
|
|
44
|
+
SpacerProps,
|
|
45
|
+
StackProps,
|
|
22
46
|
SwitchProps,
|
|
23
47
|
TabSpec,
|
|
24
48
|
TabsProps,
|
|
49
|
+
TextAreaProps,
|
|
25
50
|
TextInputProps,
|
|
26
51
|
TextProps,
|
|
52
|
+
ToastContent,
|
|
53
|
+
ToastOptions,
|
|
54
|
+
ToastPosition,
|
|
27
55
|
ViewProps,
|
|
28
56
|
} from './props';
|
|
29
57
|
|
|
30
58
|
export type {
|
|
59
|
+
AbsoluteProps,
|
|
31
60
|
AnimatedValue,
|
|
61
|
+
ActivityIndicatorProps,
|
|
32
62
|
ColorScheme,
|
|
63
|
+
DrawerProps,
|
|
64
|
+
GridProps,
|
|
65
|
+
HeadingProps,
|
|
66
|
+
IconGlyph,
|
|
67
|
+
IconProps,
|
|
33
68
|
ImageProps,
|
|
69
|
+
KeyboardAvoidingProps,
|
|
70
|
+
LayoutChildProps,
|
|
34
71
|
ListProps,
|
|
35
72
|
ModalProps,
|
|
73
|
+
ModalOpenOptions,
|
|
74
|
+
ModalOpenResult,
|
|
75
|
+
OpenModal,
|
|
76
|
+
OverlayProps,
|
|
77
|
+
PopoverPlacement,
|
|
78
|
+
PopoverProps,
|
|
36
79
|
PanEvent,
|
|
37
80
|
PlatformBadgeProps,
|
|
38
81
|
PressableProps,
|
|
82
|
+
ReadableStore,
|
|
39
83
|
Route,
|
|
84
|
+
RouteManifest,
|
|
85
|
+
RouteMeta,
|
|
40
86
|
RowProps,
|
|
41
87
|
ScreenProps,
|
|
88
|
+
SafeAreaProps,
|
|
89
|
+
ScreenTable,
|
|
42
90
|
ScrollViewProps,
|
|
91
|
+
SliderProps,
|
|
92
|
+
Store,
|
|
93
|
+
SpacerProps,
|
|
94
|
+
StackProps,
|
|
43
95
|
SwipeEvent,
|
|
44
96
|
SwitchProps,
|
|
45
97
|
TabSpec,
|
|
46
98
|
TabsProps,
|
|
99
|
+
TextAreaProps,
|
|
47
100
|
TextInputProps,
|
|
48
101
|
TextProps,
|
|
102
|
+
ToastContent,
|
|
103
|
+
ToastOptions,
|
|
104
|
+
ToastPosition,
|
|
49
105
|
ViewProps,
|
|
50
106
|
} from './props';
|
|
51
107
|
|
|
@@ -55,19 +111,38 @@ export declare const View: UniversalComponent<ViewProps>;
|
|
|
55
111
|
/** Column-direction alias of View. */
|
|
56
112
|
export declare const Column: UniversalComponent<ViewProps>;
|
|
57
113
|
export declare const Row: UniversalComponent<RowProps>;
|
|
114
|
+
export declare const Grid: UniversalComponent<GridProps>;
|
|
115
|
+
export declare const Stack: UniversalComponent<StackProps>;
|
|
116
|
+
export declare const Absolute: UniversalComponent<AbsoluteProps>;
|
|
117
|
+
export declare const Spacer: UniversalComponent<SpacerProps>;
|
|
58
118
|
export declare const Text: UniversalComponent<TextProps>;
|
|
59
119
|
export declare const Pressable: UniversalComponent<PressableProps>;
|
|
60
120
|
export declare const TextInput: UniversalComponent<TextInputProps>;
|
|
121
|
+
export declare const TextArea: UniversalComponent<TextAreaProps>;
|
|
61
122
|
export declare const List: UniversalComponent<ListProps>;
|
|
62
123
|
export declare const ScrollView: UniversalComponent<ScrollViewProps>;
|
|
63
124
|
export declare const Image: UniversalComponent<ImageProps>;
|
|
64
125
|
export declare const Screen: UniversalComponent<ScreenProps>;
|
|
126
|
+
export declare const SafeArea: UniversalComponent<SafeAreaProps>;
|
|
127
|
+
export declare const KeyboardAvoiding: UniversalComponent<KeyboardAvoidingProps>;
|
|
128
|
+
export declare const Drawer: UniversalComponent<DrawerProps>;
|
|
65
129
|
export declare const Switch: UniversalComponent<SwitchProps>;
|
|
130
|
+
export declare const ActivityIndicator: UniversalComponent<ActivityIndicatorProps>;
|
|
131
|
+
export declare const Slider: UniversalComponent<SliderProps>;
|
|
132
|
+
export declare const Icon: UniversalComponent<IconProps>;
|
|
133
|
+
export declare const Heading: UniversalComponent<HeadingProps>;
|
|
66
134
|
export declare const PlatformBadge: UniversalComponent<PlatformBadgeProps>;
|
|
67
135
|
|
|
136
|
+
export declare function registerIcon(name: string, glyph: IconGlyph): void;
|
|
137
|
+
export declare function registerIcons(record: Record<string, IconGlyph>): void;
|
|
138
|
+
|
|
68
139
|
// ---------- overlays / shells ----------
|
|
69
140
|
|
|
70
141
|
export declare const Modal: UniversalComponent<ModalProps>;
|
|
142
|
+
export declare const openModal: OpenModal;
|
|
143
|
+
export declare const Overlay: UniversalComponent<OverlayProps>;
|
|
144
|
+
export declare const Popover: UniversalComponent<PopoverProps>;
|
|
145
|
+
export declare function showToast(content: ToastContent, options?: ToastOptions): void;
|
|
71
146
|
export declare const Tabs: UniversalComponent<TabsProps>;
|
|
72
147
|
|
|
73
148
|
// ---------- stacks (native registry; no-op on web) ----------
|
|
@@ -76,18 +151,44 @@ export declare function registerStack(name: string, frame: any): void;
|
|
|
76
151
|
export declare function getStack(name: string): any;
|
|
77
152
|
export declare function stackEntries(): IterableIterator<[string, any]>;
|
|
78
153
|
|
|
79
|
-
// ---------- routes (
|
|
154
|
+
// ---------- routes (real on both: URL store on web, Frame stacks on native) ----------
|
|
80
155
|
|
|
81
156
|
export declare function pushRoute(r: Route): void;
|
|
157
|
+
export declare function popRoute(stack?: string): void;
|
|
82
158
|
export declare function routeFor(stack: string): Route | null;
|
|
83
159
|
export declare function currentRoute(): Route | null;
|
|
84
160
|
export declare function useRoute(stack: string): Route | null;
|
|
161
|
+
/** name → screen table; native pushRoute resolves `route.name` through
|
|
162
|
+
* it, web outlets fall back to it via `screenFor`. `manifest` (from
|
|
163
|
+
* deriveRouteManifest) enables path-param URL matching on web. Call
|
|
164
|
+
* once at boot. */
|
|
165
|
+
export declare function registerScreens(table: ScreenTable, manifest?: RouteMeta[]): void;
|
|
166
|
+
/** One-call registration for route-dir apps — screens + URL patterns +
|
|
167
|
+
* layouts all come from deriveRouteManifest. */
|
|
168
|
+
export declare function registerRoutes(manifest: RouteManifest): void;
|
|
169
|
+
export declare function screenFor(name: string): any;
|
|
170
|
+
/** Canonical /<stack>/<path> for a Route — Link's href on web. */
|
|
171
|
+
export declare function hrefFor(r: Route): string;
|
|
172
|
+
|
|
173
|
+
// ---------- route dir (file → route manifest; docs/navigation-notes.md) ----------
|
|
174
|
+
|
|
175
|
+
/** Turn an `import.meta.glob` module map of the route dir into
|
|
176
|
+
* {screens, routes, layouts}: `demo/[id].tsrx` → 'demo/:id',
|
|
177
|
+
* `_layout.tsrx` → layouts[''], platform suffixes deduped by `prefer`
|
|
178
|
+
* rank (web: ['web']; native: ['ios'|'android','native']). */
|
|
179
|
+
export declare function deriveRouteManifest(
|
|
180
|
+
files: Record<string, any>,
|
|
181
|
+
prefer: readonly string[],
|
|
182
|
+
dir?: string,
|
|
183
|
+
): RouteManifest;
|
|
85
184
|
|
|
86
185
|
// ---------- animation / theme ----------
|
|
87
186
|
|
|
88
187
|
export declare function useAnimation(initial?: number, prop?: string): AnimatedValue;
|
|
89
188
|
export declare function getColorScheme(): ColorScheme;
|
|
90
189
|
export declare function useColorScheme(): ColorScheme;
|
|
190
|
+
export interface SafeAreaInsets { top: number; right: number; bottom: number; left: number; }
|
|
191
|
+
export declare function useSafeAreaInsets(): SafeAreaInsets;
|
|
91
192
|
|
|
92
193
|
// ---------- styled ----------
|
|
93
194
|
|
|
@@ -95,3 +196,9 @@ export declare function styled<P extends { className?: any }, V extends Record<s
|
|
|
95
196
|
Base: (props: P) => any,
|
|
96
197
|
def: { base?: any; variants?: V },
|
|
97
198
|
): UniversalComponent<P & { [K in keyof V]?: boolean }>;
|
|
199
|
+
|
|
200
|
+
// ---------- stores ----------
|
|
201
|
+
|
|
202
|
+
export declare function createStore<T>(initial: T): Store<T>;
|
|
203
|
+
export declare function useStore<T>(store: ReadableStore<T>): T;
|
|
204
|
+
export declare function useStore<T, S>(store: ReadableStore<T>, select: (state: T) => S): S;
|
package/types/props.d.ts
CHANGED
|
@@ -17,7 +17,56 @@ export interface PanEvent {
|
|
|
17
17
|
export interface SwipeEvent {
|
|
18
18
|
direction: number;
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
/** Metadata read by parent layouts. Native forwards NativeScript attached
|
|
21
|
+
* attributes; web folds the CSS equivalents into the child's style. */
|
|
22
|
+
export interface LayoutChildProps {
|
|
23
|
+
row?: number;
|
|
24
|
+
col?: number;
|
|
25
|
+
rowSpan?: number;
|
|
26
|
+
colSpan?: number;
|
|
27
|
+
dock?: 'left' | 'top' | 'right' | 'bottom';
|
|
28
|
+
left?: number;
|
|
29
|
+
top?: number;
|
|
30
|
+
flexGrow?: number;
|
|
31
|
+
flexShrink?: number;
|
|
32
|
+
alignSelf?: string;
|
|
33
|
+
order?: number;
|
|
34
|
+
}
|
|
35
|
+
export interface GridProps {
|
|
36
|
+
className?: any;
|
|
37
|
+
style?: any;
|
|
38
|
+
children?: any;
|
|
39
|
+
rows?: string;
|
|
40
|
+
columns?: string;
|
|
41
|
+
gap?: number | string;
|
|
42
|
+
ios?: Record<string, any>;
|
|
43
|
+
android?: Record<string, any>;
|
|
44
|
+
web?: Record<string, any>;
|
|
45
|
+
}
|
|
46
|
+
export interface StackProps {
|
|
47
|
+
className?: any;
|
|
48
|
+
style?: any;
|
|
49
|
+
children?: any;
|
|
50
|
+
ios?: Record<string, any>;
|
|
51
|
+
android?: Record<string, any>;
|
|
52
|
+
web?: Record<string, any>;
|
|
53
|
+
}
|
|
54
|
+
export interface AbsoluteProps {
|
|
55
|
+
className?: any;
|
|
56
|
+
style?: any;
|
|
57
|
+
children?: any;
|
|
58
|
+
ios?: Record<string, any>;
|
|
59
|
+
android?: Record<string, any>;
|
|
60
|
+
web?: Record<string, any>;
|
|
61
|
+
}
|
|
62
|
+
export interface SpacerProps {
|
|
63
|
+
className?: any;
|
|
64
|
+
style?: any;
|
|
65
|
+
ios?: Record<string, any>;
|
|
66
|
+
android?: Record<string, any>;
|
|
67
|
+
web?: Record<string, any>;
|
|
68
|
+
}
|
|
69
|
+
export interface ViewProps extends LayoutChildProps {
|
|
21
70
|
className?: any;
|
|
22
71
|
style?: any;
|
|
23
72
|
children?: any;
|
|
@@ -27,18 +76,45 @@ export interface ViewProps {
|
|
|
27
76
|
bind?: (el: any) => void;
|
|
28
77
|
onPan?: (e: PanEvent) => void;
|
|
29
78
|
onSwipe?: (e: SwipeEvent) => void;
|
|
79
|
+
/** Platform-specific properties are applied after shared props. */
|
|
80
|
+
ios?: any;
|
|
81
|
+
android?: any;
|
|
82
|
+
web?: any;
|
|
30
83
|
}
|
|
31
|
-
export interface RowProps {
|
|
84
|
+
export interface RowProps extends LayoutChildProps {
|
|
32
85
|
className?: any;
|
|
33
86
|
style?: any;
|
|
34
87
|
children?: any;
|
|
88
|
+
/** Platform-specific properties are applied after shared props. */
|
|
89
|
+
ios?: any;
|
|
90
|
+
android?: any;
|
|
91
|
+
web?: any;
|
|
35
92
|
}
|
|
36
|
-
export interface TextProps {
|
|
93
|
+
export interface TextProps extends LayoutChildProps {
|
|
37
94
|
className?: any;
|
|
38
95
|
style?: any;
|
|
39
96
|
children?: any;
|
|
97
|
+
numberOfLines?: number;
|
|
98
|
+
/** Native Label does not expose text selection; implemented with CSS on web. */
|
|
99
|
+
selectable?: boolean;
|
|
100
|
+
ellipsize?: boolean;
|
|
101
|
+
accessibilityHint?: string;
|
|
102
|
+
accessibilityValue?: string;
|
|
103
|
+
/** NativeScript supports one state at a time (disabled/selected/checked); busy and expanded are web-only. */
|
|
104
|
+
accessibilityState?: {
|
|
105
|
+
disabled?: boolean;
|
|
106
|
+
selected?: boolean;
|
|
107
|
+
checked?: boolean;
|
|
108
|
+
busy?: boolean;
|
|
109
|
+
expanded?: boolean;
|
|
110
|
+
};
|
|
111
|
+
accessibilityLiveRegion?: 'none' | 'polite' | 'assertive';
|
|
112
|
+
/** Platform-specific properties are applied after shared props. */
|
|
113
|
+
ios?: any;
|
|
114
|
+
android?: any;
|
|
115
|
+
web?: any;
|
|
40
116
|
}
|
|
41
|
-
export interface PressableProps {
|
|
117
|
+
export interface PressableProps extends LayoutChildProps {
|
|
42
118
|
className?: any;
|
|
43
119
|
style?: any;
|
|
44
120
|
children?: any;
|
|
@@ -50,42 +126,149 @@ export interface PressableProps {
|
|
|
50
126
|
accessible?: boolean;
|
|
51
127
|
accessibilityLabel?: string;
|
|
52
128
|
accessibilityRole?: string;
|
|
129
|
+
onPressIn?: () => void;
|
|
130
|
+
onPressOut?: () => void;
|
|
131
|
+
onDoublePress?: () => void;
|
|
132
|
+
hitSlop?: number;
|
|
133
|
+
/** NativeScript supports a per-view TouchManager animation opt-out; web has no press scaling. */
|
|
134
|
+
ignoreTouchAnimation?: boolean;
|
|
135
|
+
accessibilityHint?: string;
|
|
136
|
+
accessibilityValue?: string;
|
|
137
|
+
/** NativeScript supports one state at a time (disabled/selected/checked); busy and expanded are web-only. */
|
|
138
|
+
accessibilityState?: {
|
|
139
|
+
disabled?: boolean;
|
|
140
|
+
selected?: boolean;
|
|
141
|
+
checked?: boolean;
|
|
142
|
+
busy?: boolean;
|
|
143
|
+
expanded?: boolean;
|
|
144
|
+
};
|
|
145
|
+
accessibilityLiveRegion?: 'none' | 'polite' | 'assertive';
|
|
146
|
+
/** Platform-specific properties are applied after shared props. */
|
|
147
|
+
ios?: any;
|
|
148
|
+
android?: any;
|
|
149
|
+
web?: any;
|
|
150
|
+
}
|
|
151
|
+
export interface TextInputHandle {
|
|
152
|
+
focus(): void;
|
|
153
|
+
blur(): void;
|
|
154
|
+
native: any;
|
|
53
155
|
}
|
|
54
156
|
export interface TextInputProps {
|
|
55
157
|
className?: any;
|
|
56
158
|
style?: any;
|
|
159
|
+
id?: string;
|
|
57
160
|
value?: string;
|
|
58
161
|
placeholder?: string;
|
|
59
162
|
/** NativeScript's term for placeholder — web maps hint → placeholder. */
|
|
60
163
|
hint?: string;
|
|
61
164
|
onChange?: (value: string) => void;
|
|
165
|
+
bind?: (h: TextInputHandle) => void;
|
|
166
|
+
secure?: boolean;
|
|
167
|
+
keyboardType?: 'default' | 'email' | 'number' | 'decimal' | 'phone' | 'url';
|
|
168
|
+
returnKeyType?: 'done' | 'next' | 'go' | 'search' | 'send';
|
|
169
|
+
onSubmit?: () => void;
|
|
170
|
+
onFocus?: () => void;
|
|
171
|
+
onBlur?: () => void;
|
|
172
|
+
editable?: boolean;
|
|
173
|
+
placeholderTextColor?: string;
|
|
174
|
+
/** Platform-specific properties are applied after shared props. */
|
|
175
|
+
ios?: any;
|
|
176
|
+
android?: any;
|
|
177
|
+
web?: any;
|
|
178
|
+
}
|
|
179
|
+
export interface TextAreaProps extends TextInputProps {
|
|
180
|
+
/** Height in text rows. Web: the `rows` attr (fixed box); native:
|
|
181
|
+
* minHeight at the widget's measured line height. With `autoGrow` it
|
|
182
|
+
* becomes the starting height instead of a fixed one. */
|
|
183
|
+
rows?: number;
|
|
184
|
+
/** Grow to fit content, capped by `maxRows`. Native TextView grows by
|
|
185
|
+
* default — this prop exists so web (<textarea> is fixed-rows) matches;
|
|
186
|
+
* without it, native gets a fixed `rows`-high box like web. */
|
|
187
|
+
autoGrow?: boolean;
|
|
188
|
+
/** Growth cap in rows — past it the field scrolls internally. Native:
|
|
189
|
+
* maxHeight at measured line height (TextView's own `maxLines` only
|
|
190
|
+
* sets truncation on iOS — not a cap). */
|
|
191
|
+
maxRows?: number;
|
|
62
192
|
}
|
|
63
193
|
export interface ListProps {
|
|
64
194
|
className?: any;
|
|
65
195
|
style?: any;
|
|
66
196
|
id?: string;
|
|
67
197
|
items: any[];
|
|
68
|
-
renderItem: (item: any) => any;
|
|
198
|
+
renderItem: (item: any, index: number) => any;
|
|
69
199
|
renderEmpty?: () => any;
|
|
200
|
+
/** Stable item key for web reconciliation. Falls back to `item.id`; native
|
|
201
|
+
* ListView recycles by index and does not consume keys. */
|
|
202
|
+
keyFor?: (item: any) => string | number;
|
|
203
|
+
/** Metadata hint only in v1. Switch heterogeneous row markup in renderItem;
|
|
204
|
+
* the current renderers do not consume this value. */
|
|
205
|
+
kindFor?: (item: any) => string;
|
|
206
|
+
/** Native iOS row-height estimate. Web virtualization is not enabled in v1. */
|
|
207
|
+
estimatedItemHeight?: number;
|
|
208
|
+
/** Called when the list approaches its end. */
|
|
209
|
+
onEndReached?: () => void;
|
|
210
|
+
/** Platform escape hatches, applied after the shared props. */
|
|
211
|
+
ios?: Record<string, any>;
|
|
212
|
+
android?: Record<string, any>;
|
|
213
|
+
web?: Record<string, any>;
|
|
70
214
|
}
|
|
71
|
-
export interface ScrollViewProps {
|
|
215
|
+
export interface ScrollViewProps extends LayoutChildProps {
|
|
72
216
|
className?: any;
|
|
73
217
|
style?: any;
|
|
74
218
|
id?: string;
|
|
75
219
|
horizontal?: boolean;
|
|
76
220
|
children?: any;
|
|
221
|
+
/** Platform-specific properties are applied after shared props. */
|
|
222
|
+
ios?: any;
|
|
223
|
+
android?: any;
|
|
224
|
+
web?: any;
|
|
77
225
|
}
|
|
78
|
-
export interface ImageProps {
|
|
226
|
+
export interface ImageProps extends LayoutChildProps {
|
|
79
227
|
className?: any;
|
|
80
228
|
style?: any;
|
|
81
229
|
id?: string;
|
|
82
230
|
src: string;
|
|
83
231
|
alt?: string;
|
|
232
|
+
/** Platform-specific properties are applied after shared props. */
|
|
233
|
+
ios?: any;
|
|
234
|
+
android?: any;
|
|
235
|
+
web?: any;
|
|
84
236
|
}
|
|
85
237
|
export interface ScreenProps {
|
|
86
238
|
className?: any;
|
|
87
239
|
style?: any;
|
|
88
240
|
children?: any;
|
|
241
|
+
/** Platform-specific properties are applied after shared props. */
|
|
242
|
+
ios?: any;
|
|
243
|
+
android?: any;
|
|
244
|
+
web?: any;
|
|
245
|
+
}
|
|
246
|
+
export interface SafeAreaProps {
|
|
247
|
+
className?: any;
|
|
248
|
+
style?: any;
|
|
249
|
+
children?: any;
|
|
250
|
+
/** NativeScript props applied to the host after shared props. */
|
|
251
|
+
ios?: Record<string, any>;
|
|
252
|
+
android?: Record<string, any>;
|
|
253
|
+
web?: Record<string, any>;
|
|
254
|
+
}
|
|
255
|
+
export interface KeyboardAvoidingProps {
|
|
256
|
+
className?: any;
|
|
257
|
+
style?: any;
|
|
258
|
+
children?: any;
|
|
259
|
+
ios?: Record<string, any>;
|
|
260
|
+
android?: Record<string, any>;
|
|
261
|
+
web?: Record<string, any>;
|
|
262
|
+
}
|
|
263
|
+
export interface DrawerProps {
|
|
264
|
+
className?: any;
|
|
265
|
+
style?: any;
|
|
266
|
+
main?: any;
|
|
267
|
+
drawer?: any;
|
|
268
|
+
open?: boolean;
|
|
269
|
+
ios?: Record<string, any>;
|
|
270
|
+
android?: Record<string, any>;
|
|
271
|
+
web?: Record<string, any>;
|
|
89
272
|
}
|
|
90
273
|
export interface SwitchProps {
|
|
91
274
|
className?: any;
|
|
@@ -93,16 +276,126 @@ export interface SwitchProps {
|
|
|
93
276
|
id?: string;
|
|
94
277
|
checked?: boolean;
|
|
95
278
|
onCheckedChange?: (checked: boolean) => void;
|
|
279
|
+
/** Platform-specific properties are applied after shared props. */
|
|
280
|
+
ios?: any;
|
|
281
|
+
android?: any;
|
|
282
|
+
web?: any;
|
|
283
|
+
}
|
|
284
|
+
export interface ActivityIndicatorProps {
|
|
285
|
+
className?: any;
|
|
286
|
+
style?: any;
|
|
287
|
+
id?: string;
|
|
288
|
+
busy?: boolean;
|
|
289
|
+
ios?: Record<string, any>;
|
|
290
|
+
android?: Record<string, any>;
|
|
291
|
+
web?: Record<string, any>;
|
|
292
|
+
}
|
|
293
|
+
export interface SliderProps {
|
|
294
|
+
className?: any;
|
|
295
|
+
style?: any;
|
|
296
|
+
id?: string;
|
|
297
|
+
value: number;
|
|
298
|
+
minValue?: number;
|
|
299
|
+
maxValue?: number;
|
|
300
|
+
disabled?: boolean;
|
|
301
|
+
onValueChange?: (value: number) => void;
|
|
302
|
+
ios?: Record<string, any>;
|
|
303
|
+
android?: Record<string, any>;
|
|
304
|
+
web?: Record<string, any>;
|
|
305
|
+
}
|
|
306
|
+
export interface IconProps {
|
|
307
|
+
className?: any;
|
|
308
|
+
id?: string;
|
|
309
|
+
name: string;
|
|
310
|
+
size?: number;
|
|
311
|
+
color?: string;
|
|
312
|
+
ios?: Record<string, any>;
|
|
313
|
+
android?: Record<string, any>;
|
|
314
|
+
web?: Record<string, any>;
|
|
315
|
+
}
|
|
316
|
+
/** One registered icon representation. `svg` contains path `d` data. */
|
|
317
|
+
export interface IconGlyph {
|
|
318
|
+
svg?: string;
|
|
319
|
+
font?: {
|
|
320
|
+
family: string;
|
|
321
|
+
glyph: string;
|
|
322
|
+
};
|
|
323
|
+
src?: string;
|
|
324
|
+
}
|
|
325
|
+
export interface HeadingProps {
|
|
326
|
+
className?: any;
|
|
327
|
+
style?: any;
|
|
328
|
+
children?: any;
|
|
329
|
+
id?: string;
|
|
330
|
+
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
331
|
+
ios?: Record<string, any>;
|
|
332
|
+
android?: Record<string, any>;
|
|
333
|
+
web?: Record<string, any>;
|
|
96
334
|
}
|
|
97
335
|
export interface PlatformBadgeProps {
|
|
98
336
|
className?: any;
|
|
99
337
|
}
|
|
338
|
+
export interface OverlayProps {
|
|
339
|
+
open?: boolean;
|
|
340
|
+
onDismiss?: () => void;
|
|
341
|
+
/** Enables a RootLayout shade that dismisses when tapped. */
|
|
342
|
+
shadeCover?: boolean;
|
|
343
|
+
className?: any;
|
|
344
|
+
style?: any;
|
|
345
|
+
children?: any;
|
|
346
|
+
ios?: Record<string, any>;
|
|
347
|
+
android?: Record<string, any>;
|
|
348
|
+
web?: Record<string, any>;
|
|
349
|
+
}
|
|
350
|
+
export type PopoverPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
351
|
+
export interface PopoverProps {
|
|
352
|
+
/** Native view or web element, commonly a ref object populated by `bind`. */
|
|
353
|
+
anchor?: any;
|
|
354
|
+
open?: boolean;
|
|
355
|
+
placement?: PopoverPlacement;
|
|
356
|
+
className?: any;
|
|
357
|
+
style?: any;
|
|
358
|
+
children?: any;
|
|
359
|
+
ios?: Record<string, any>;
|
|
360
|
+
android?: Record<string, any>;
|
|
361
|
+
web?: Record<string, any>;
|
|
362
|
+
}
|
|
363
|
+
export type ToastContent = string | (() => any);
|
|
364
|
+
export type ToastPosition = 'top' | 'bottom';
|
|
365
|
+
export interface ToastOptions {
|
|
366
|
+
duration?: number;
|
|
367
|
+
position?: ToastPosition;
|
|
368
|
+
ios?: Record<string, any>;
|
|
369
|
+
android?: Record<string, any>;
|
|
370
|
+
web?: Record<string, any>;
|
|
371
|
+
}
|
|
100
372
|
export interface ModalProps {
|
|
101
373
|
open?: boolean;
|
|
102
|
-
onClose?: () => void;
|
|
374
|
+
onClose?: (result?: ModalOpenResult) => void;
|
|
103
375
|
fullscreen?: boolean;
|
|
376
|
+
/** Native: sheet uses fullscreen=false (iOS form sheet; Android centered
|
|
377
|
+
* dialog), fullscreen uses fullscreen=true. Web: dialog is a centered
|
|
378
|
+
* card, sheet is bottom-anchored, fullscreen is the default dialog size. */
|
|
379
|
+
presentation?: 'sheet' | 'fullscreen' | 'dialog';
|
|
380
|
+
/** Component reference rendered inside the modal's separate root. When
|
|
381
|
+
* both component and children are set, component takes precedence. */
|
|
382
|
+
component?: any;
|
|
383
|
+
/** Props passed to component. Context and theme do not cross modal roots. */
|
|
384
|
+
params?: any;
|
|
104
385
|
children?: any;
|
|
105
386
|
}
|
|
387
|
+
/** Options for `openModal`. `fullscreen` is retained for callers using the
|
|
388
|
+
* NativeScript option directly; `presentation` takes precedence when set.
|
|
389
|
+
* Android's non-fullscreen modal is a centered dialog, not a bottom sheet. */
|
|
390
|
+
export interface ModalOpenOptions {
|
|
391
|
+
presentation?: 'sheet' | 'fullscreen' | 'dialog';
|
|
392
|
+
fullscreen?: boolean;
|
|
393
|
+
animated?: boolean;
|
|
394
|
+
}
|
|
395
|
+
/** Value supplied to a modal close callback and returned by `openModal`. */
|
|
396
|
+
export type ModalOpenResult = unknown;
|
|
397
|
+
/** Public function shape of the imperative modal service. */
|
|
398
|
+
export type OpenModal = (component: any, params?: any, options?: ModalOpenOptions) => Promise<ModalOpenResult>;
|
|
106
399
|
export interface TabSpec {
|
|
107
400
|
title: string;
|
|
108
401
|
render: () => any;
|
|
@@ -127,6 +420,30 @@ export interface Route {
|
|
|
127
420
|
name: string;
|
|
128
421
|
params: Record<string, unknown>;
|
|
129
422
|
}
|
|
423
|
+
/** name → screen component table for `registerScreens` — the app owns the
|
|
424
|
+
* route table; native `pushRoute` resolves `route.name` through it and
|
|
425
|
+
* web outlets fall back to it via `screenFor`. Values are component
|
|
426
|
+
* functions (`() => Element` / UniversalComponent shapes both fit). */
|
|
427
|
+
export type ScreenTable = Record<string, any>;
|
|
428
|
+
/** One route file's entry in the derived manifest. `name` is the file
|
|
429
|
+
* path under the route dir with `[param]` segments normalized to
|
|
430
|
+
* `:param` (`app/demo/[id].tsrx` → `demo/:id`); `segments` is the URL
|
|
431
|
+
* pattern used for web path matching/substitution. */
|
|
432
|
+
export interface RouteMeta {
|
|
433
|
+
name: string;
|
|
434
|
+
segments: string[];
|
|
435
|
+
params: string[];
|
|
436
|
+
/** Source file (glob key) — diagnostics only. */
|
|
437
|
+
file: string;
|
|
438
|
+
}
|
|
439
|
+
/** Output of `deriveRouteManifest` — `screens` feeds `registerScreens`
|
|
440
|
+
* (native pushRoute + web outlet fallback), `routes` feeds web URL
|
|
441
|
+
* matching, `layouts` catalogs `_layout` files by directory ('' = root). */
|
|
442
|
+
export interface RouteManifest {
|
|
443
|
+
screens: ScreenTable;
|
|
444
|
+
routes: RouteMeta[];
|
|
445
|
+
layouts: Record<string, any>;
|
|
446
|
+
}
|
|
130
447
|
export interface AnimatedValue {
|
|
131
448
|
readonly value: number;
|
|
132
449
|
bind(el: any): void;
|
|
@@ -140,3 +457,11 @@ export interface AnimatedValue {
|
|
|
140
457
|
stop(): void;
|
|
141
458
|
}
|
|
142
459
|
export type ColorScheme = 'light' | 'dark';
|
|
460
|
+
/** Minimal external-store contract `useStore` subscribes to. */
|
|
461
|
+
export interface ReadableStore<T> {
|
|
462
|
+
get(): T;
|
|
463
|
+
subscribe(notify: () => void): () => void;
|
|
464
|
+
}
|
|
465
|
+
export interface Store<T> extends ReadableStore<T> {
|
|
466
|
+
set(next: T | ((prev: T) => T)): void;
|
|
467
|
+
}
|