one 1.2.37 → 1.2.39-1766066124062
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/cjs/cli/build.cjs +16 -4
- package/dist/cjs/cli/build.js +18 -5
- package/dist/cjs/cli/build.js.map +1 -1
- package/dist/cjs/cli/build.native.js +27 -4
- package/dist/cjs/cli/build.native.js.map +1 -1
- package/dist/cjs/cli/buildPage.cjs +59 -14
- package/dist/cjs/cli/buildPage.js +56 -14
- package/dist/cjs/cli/buildPage.js.map +1 -1
- package/dist/cjs/cli/buildPage.native.js +66 -19
- package/dist/cjs/cli/buildPage.native.js.map +1 -1
- package/dist/cjs/cli/generateSitemap.test.cjs +10 -10
- package/dist/cjs/cli/generateSitemap.test.js +8 -8
- package/dist/cjs/cli/generateSitemap.test.js.map +1 -1
- package/dist/cjs/cli/generateSitemap.test.native.js +12 -12
- package/dist/cjs/cli/generateSitemap.test.native.js.map +1 -1
- package/dist/cjs/constants.cjs +1 -0
- package/dist/cjs/constants.js +1 -0
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/constants.native.js +1 -0
- package/dist/cjs/constants.native.js.map +1 -1
- package/dist/cjs/createApp.cjs +2 -1
- package/dist/cjs/createApp.js +2 -1
- package/dist/cjs/createApp.js.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/layouts/Stack.cjs +1 -6
- package/dist/cjs/layouts/Stack.js +2 -5
- package/dist/cjs/layouts/Stack.js.map +1 -1
- package/dist/cjs/layouts/Stack.native.js +1 -6
- package/dist/cjs/layouts/Stack.native.js.map +1 -1
- package/dist/cjs/server/ServerContextScript.cjs +3 -1
- package/dist/cjs/server/ServerContextScript.js +2 -1
- package/dist/cjs/server/ServerContextScript.js.map +1 -1
- package/dist/cjs/server/ServerContextScript.native.js +3 -1
- package/dist/cjs/server/ServerContextScript.native.js.map +1 -1
- package/dist/cjs/server/oneServe.cjs +3 -2
- package/dist/cjs/server/oneServe.js +4 -2
- package/dist/cjs/server/oneServe.js.map +2 -2
- package/dist/cjs/server/oneServe.native.js +3 -2
- package/dist/cjs/server/oneServe.native.js.map +1 -1
- package/dist/cjs/server-render.cjs +9 -1
- package/dist/cjs/server-render.js +9 -1
- package/dist/cjs/server-render.js.map +1 -1
- package/dist/cjs/server-render.native.js +12 -3
- package/dist/cjs/server-render.native.js.map +1 -1
- package/dist/cjs/setup.native.js.map +6 -1
- package/dist/cjs/ui/common.cjs +5 -15
- package/dist/cjs/ui/common.js +5 -8
- package/dist/cjs/ui/common.js.map +1 -1
- package/dist/cjs/ui/common.native.js +4 -12
- package/dist/cjs/ui/common.native.js.map +1 -1
- package/dist/esm/cli/build.js +18 -5
- package/dist/esm/cli/build.js.map +1 -1
- package/dist/esm/cli/build.mjs +16 -4
- package/dist/esm/cli/build.mjs.map +1 -1
- package/dist/esm/cli/build.native.js +27 -4
- package/dist/esm/cli/build.native.js.map +1 -1
- package/dist/esm/cli/buildPage.js +56 -14
- package/dist/esm/cli/buildPage.js.map +1 -1
- package/dist/esm/cli/buildPage.mjs +59 -14
- package/dist/esm/cli/buildPage.mjs.map +1 -1
- package/dist/esm/cli/buildPage.native.js +66 -19
- package/dist/esm/cli/buildPage.native.js.map +1 -1
- package/dist/esm/cli/generateSitemap.test.js +9 -9
- package/dist/esm/cli/generateSitemap.test.js.map +1 -1
- package/dist/esm/cli/generateSitemap.test.mjs +11 -11
- package/dist/esm/cli/generateSitemap.test.mjs.map +1 -1
- package/dist/esm/cli/generateSitemap.test.native.js +13 -13
- package/dist/esm/cli/generateSitemap.test.native.js.map +1 -1
- package/dist/esm/constants.js +1 -0
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/constants.mjs +1 -0
- package/dist/esm/constants.mjs.map +1 -1
- package/dist/esm/constants.native.js +1 -0
- package/dist/esm/constants.native.js.map +1 -1
- package/dist/esm/createApp.js +2 -1
- package/dist/esm/createApp.js.map +1 -1
- package/dist/esm/createApp.mjs +2 -1
- package/dist/esm/createApp.mjs.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/layouts/Stack.js +1 -5
- package/dist/esm/layouts/Stack.js.map +1 -1
- package/dist/esm/layouts/Stack.mjs +1 -6
- package/dist/esm/layouts/Stack.mjs.map +1 -1
- package/dist/esm/layouts/Stack.native.js +1 -6
- package/dist/esm/layouts/Stack.native.js.map +1 -1
- package/dist/esm/server/ServerContextScript.js +2 -1
- package/dist/esm/server/ServerContextScript.js.map +1 -1
- package/dist/esm/server/ServerContextScript.mjs +3 -1
- package/dist/esm/server/ServerContextScript.mjs.map +1 -1
- package/dist/esm/server/ServerContextScript.native.js +3 -1
- package/dist/esm/server/ServerContextScript.native.js.map +1 -1
- package/dist/esm/server/oneServe.js +4 -2
- package/dist/esm/server/oneServe.js.map +2 -2
- package/dist/esm/server/oneServe.mjs +3 -2
- package/dist/esm/server/oneServe.mjs.map +1 -1
- package/dist/esm/server/oneServe.native.js +3 -2
- package/dist/esm/server/oneServe.native.js.map +1 -1
- package/dist/esm/server-render.js +9 -1
- package/dist/esm/server-render.js.map +1 -1
- package/dist/esm/server-render.mjs +9 -1
- package/dist/esm/server-render.mjs.map +1 -1
- package/dist/esm/server-render.native.js +12 -3
- package/dist/esm/server-render.native.js.map +1 -1
- package/dist/esm/ui/common.js +3 -5
- package/dist/esm/ui/common.js.map +1 -1
- package/dist/esm/ui/common.mjs +3 -13
- package/dist/esm/ui/common.mjs.map +1 -1
- package/dist/esm/ui/common.native.js +1 -9
- package/dist/esm/ui/common.native.js.map +1 -1
- package/package.json +10 -10
- package/src/cli/build.ts +43 -6
- package/src/cli/buildPage.ts +88 -12
- package/src/cli/generateSitemap.test.ts +20 -10
- package/src/constants.ts +1 -0
- package/src/createApp.tsx +1 -0
- package/src/index.ts +0 -9
- package/src/layouts/Stack.tsx +1 -7
- package/src/server/ServerContextScript.tsx +2 -0
- package/src/server/oneServe.ts +3 -2
- package/src/server-render.tsx +29 -2
- package/src/types.ts +9 -0
- package/src/ui/common.tsx +2 -8
- package/src/vite/types.ts +21 -0
- package/types/cli/build.d.ts.map +1 -1
- package/types/cli/buildPage.d.ts +1 -1
- package/types/cli/buildPage.d.ts.map +1 -1
- package/types/constants.d.ts.map +1 -1
- package/types/createApp.d.ts.map +1 -1
- package/types/index.d.ts +0 -1
- package/types/index.d.ts.map +1 -1
- package/types/layouts/Stack.d.ts +0 -10
- package/types/layouts/Stack.d.ts.map +1 -1
- package/types/server/ServerContextScript.d.ts.map +1 -1
- package/types/server/oneServe.d.ts.map +1 -1
- package/types/server-render.d.ts +14 -2
- package/types/server-render.d.ts.map +1 -1
- package/types/types.d.ts +9 -0
- package/types/types.d.ts.map +1 -1
- package/types/ui/common.d.ts.map +1 -1
- package/types/vite/types.d.ts +20 -0
- package/types/vite/types.d.ts.map +1 -1
- package/dist/cjs/layouts/stack-utils/__tests__/composition.test.cjs +0 -189
- package/dist/cjs/layouts/stack-utils/__tests__/composition.test.js +0 -184
- package/dist/cjs/layouts/stack-utils/__tests__/composition.test.js.map +0 -6
- package/dist/cjs/layouts/stack-utils/__tests__/composition.test.native.js +0 -204
- package/dist/cjs/layouts/stack-utils/__tests__/composition.test.native.js.map +0 -1
- package/dist/cjs/vite/plugins/resolveIdScan.test.cjs +0 -47
- package/dist/cjs/vite/plugins/resolveIdScan.test.js +0 -42
- package/dist/cjs/vite/plugins/resolveIdScan.test.js.map +0 -6
- package/dist/cjs/vite/plugins/resolveIdScan.test.native.js +0 -58
- package/dist/cjs/vite/plugins/resolveIdScan.test.native.js.map +0 -1
- package/dist/esm/layouts/stack-utils/__tests__/composition.test.js +0 -197
- package/dist/esm/layouts/stack-utils/__tests__/composition.test.js.map +0 -6
- package/dist/esm/layouts/stack-utils/__tests__/composition.test.mjs +0 -190
- package/dist/esm/layouts/stack-utils/__tests__/composition.test.mjs.map +0 -1
- package/dist/esm/layouts/stack-utils/__tests__/composition.test.native.js +0 -202
- package/dist/esm/layouts/stack-utils/__tests__/composition.test.native.js.map +0 -1
- package/dist/esm/vite/plugins/resolveIdScan.test.js +0 -23
- package/dist/esm/vite/plugins/resolveIdScan.test.js.map +0 -6
- package/dist/esm/vite/plugins/resolveIdScan.test.mjs +0 -26
- package/dist/esm/vite/plugins/resolveIdScan.test.mjs.map +0 -1
- package/dist/esm/vite/plugins/resolveIdScan.test.native.js +0 -34
- package/dist/esm/vite/plugins/resolveIdScan.test.native.js.map +0 -1
- package/src/__mocks__/@react-navigation/native-stack.ts +0 -32
- package/src/__mocks__/@react-navigation/native.ts +0 -21
- package/src/__mocks__/expo-linking.ts +0 -6
- package/src/__mocks__/expo-modules-core.ts +0 -11
- package/src/__mocks__/react-native-screens.ts +0 -17
- package/src/__mocks__/react-native.ts +0 -20
- package/src/layouts/stack-utils/README.md +0 -211
- package/src/layouts/stack-utils/StackHeaderBackButton.tsx +0 -34
- package/src/layouts/stack-utils/StackHeaderComponent.tsx +0 -109
- package/src/layouts/stack-utils/StackHeaderLeft.tsx +0 -29
- package/src/layouts/stack-utils/StackHeaderRight.tsx +0 -29
- package/src/layouts/stack-utils/StackHeaderSearchBar.tsx +0 -21
- package/src/layouts/stack-utils/StackHeaderTitle.tsx +0 -61
- package/src/layouts/stack-utils/StackScreen.tsx +0 -65
- package/src/layouts/stack-utils/__tests__/composition.test.tsx +0 -267
- package/src/layouts/stack-utils/index.tsx +0 -35
- package/src/utils/children.ts +0 -47
- package/src/utils/style.ts +0 -17
- package/types/__mocks__/@react-navigation/native-stack.d.ts +0 -30
- package/types/__mocks__/@react-navigation/native.d.ts +0 -17
- package/types/__mocks__/expo-linking.d.ts +0 -9
- package/types/__mocks__/expo-modules-core.d.ts +0 -11
- package/types/__mocks__/react-native-screens.d.ts +0 -14
- package/types/__mocks__/react-native.d.ts +0 -12
- package/types/layouts/stack-utils/StackHeaderBackButton.d.ts +0 -17
- package/types/layouts/stack-utils/StackHeaderComponent.d.ts +0 -36
- package/types/layouts/stack-utils/StackHeaderLeft.d.ts +0 -13
- package/types/layouts/stack-utils/StackHeaderRight.d.ts +0 -13
- package/types/layouts/stack-utils/StackHeaderSearchBar.d.ts +0 -10
- package/types/layouts/stack-utils/StackHeaderTitle.d.ts +0 -26
- package/types/layouts/stack-utils/StackScreen.d.ts +0 -21
- package/types/layouts/stack-utils/index.d.ts +0 -20
- package/types/utils/children.d.ts +0 -15
- package/types/utils/style.d.ts +0 -7
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
|
|
4
|
-
import { StackHeaderTitle, appendStackHeaderTitlePropsToOptions } from '../StackHeaderTitle'
|
|
5
|
-
import { StackHeaderLeft, appendStackHeaderLeftPropsToOptions } from '../StackHeaderLeft'
|
|
6
|
-
import { StackHeaderRight, appendStackHeaderRightPropsToOptions } from '../StackHeaderRight'
|
|
7
|
-
import {
|
|
8
|
-
StackHeaderBackButton,
|
|
9
|
-
appendStackHeaderBackButtonPropsToOptions,
|
|
10
|
-
} from '../StackHeaderBackButton'
|
|
11
|
-
import {
|
|
12
|
-
StackHeaderSearchBar,
|
|
13
|
-
appendStackHeaderSearchBarPropsToOptions,
|
|
14
|
-
} from '../StackHeaderSearchBar'
|
|
15
|
-
import { StackHeaderComponent, appendStackHeaderPropsToOptions } from '../StackHeaderComponent'
|
|
16
|
-
import { appendScreenStackPropsToOptions } from '../StackScreen'
|
|
17
|
-
|
|
18
|
-
describe('Stack Header Composition', () => {
|
|
19
|
-
describe('StackHeaderTitle', () => {
|
|
20
|
-
it('sets title from children', () => {
|
|
21
|
-
const result = appendStackHeaderTitlePropsToOptions({}, { children: 'My Title' })
|
|
22
|
-
expect(result.title).toBe('My Title')
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
it('sets headerLargeTitle when large is true', () => {
|
|
26
|
-
const result = appendStackHeaderTitlePropsToOptions({}, { large: true })
|
|
27
|
-
expect(result.headerLargeTitle).toBe(true)
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
it('sets headerTitleAlign from style.textAlign', () => {
|
|
31
|
-
const result = appendStackHeaderTitlePropsToOptions(
|
|
32
|
-
{},
|
|
33
|
-
{
|
|
34
|
-
style: { textAlign: 'center' },
|
|
35
|
-
}
|
|
36
|
-
)
|
|
37
|
-
expect(result.headerTitleAlign).toBe('center')
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
it('converts numeric fontWeight to string', () => {
|
|
41
|
-
const result = appendStackHeaderTitlePropsToOptions(
|
|
42
|
-
{},
|
|
43
|
-
{
|
|
44
|
-
style: { fontWeight: '700' },
|
|
45
|
-
}
|
|
46
|
-
)
|
|
47
|
-
expect(result.headerTitleStyle).toMatchObject({ fontWeight: '700' })
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
it('preserves existing options', () => {
|
|
51
|
-
const result = appendStackHeaderTitlePropsToOptions(
|
|
52
|
-
{ animation: 'slide_from_right' },
|
|
53
|
-
{ children: 'Title' }
|
|
54
|
-
)
|
|
55
|
-
expect(result.animation).toBe('slide_from_right')
|
|
56
|
-
expect(result.title).toBe('Title')
|
|
57
|
-
})
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
describe('StackHeaderLeft', () => {
|
|
61
|
-
it('does not set headerLeft without asChild', () => {
|
|
62
|
-
const result = appendStackHeaderLeftPropsToOptions(
|
|
63
|
-
{},
|
|
64
|
-
{
|
|
65
|
-
children: <button>Back</button>,
|
|
66
|
-
}
|
|
67
|
-
)
|
|
68
|
-
expect(result.headerLeft).toBeUndefined()
|
|
69
|
-
})
|
|
70
|
-
|
|
71
|
-
it('sets headerLeft with asChild', () => {
|
|
72
|
-
const CustomButton = () => <button>Back</button>
|
|
73
|
-
const result = appendStackHeaderLeftPropsToOptions(
|
|
74
|
-
{},
|
|
75
|
-
{
|
|
76
|
-
asChild: true,
|
|
77
|
-
children: <CustomButton />,
|
|
78
|
-
}
|
|
79
|
-
)
|
|
80
|
-
expect(result.headerLeft).toBeDefined()
|
|
81
|
-
expect(typeof result.headerLeft).toBe('function')
|
|
82
|
-
})
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
describe('StackHeaderRight', () => {
|
|
86
|
-
it('does not set headerRight without asChild', () => {
|
|
87
|
-
const result = appendStackHeaderRightPropsToOptions(
|
|
88
|
-
{},
|
|
89
|
-
{
|
|
90
|
-
children: <button>Action</button>,
|
|
91
|
-
}
|
|
92
|
-
)
|
|
93
|
-
expect(result.headerRight).toBeUndefined()
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
it('sets headerRight with asChild', () => {
|
|
97
|
-
const CustomButton = () => <button>Action</button>
|
|
98
|
-
const result = appendStackHeaderRightPropsToOptions(
|
|
99
|
-
{},
|
|
100
|
-
{
|
|
101
|
-
asChild: true,
|
|
102
|
-
children: <CustomButton />,
|
|
103
|
-
}
|
|
104
|
-
)
|
|
105
|
-
expect(result.headerRight).toBeDefined()
|
|
106
|
-
expect(typeof result.headerRight).toBe('function')
|
|
107
|
-
})
|
|
108
|
-
})
|
|
109
|
-
|
|
110
|
-
describe('StackHeaderBackButton', () => {
|
|
111
|
-
it('sets headerBackTitle from children', () => {
|
|
112
|
-
const result = appendStackHeaderBackButtonPropsToOptions(
|
|
113
|
-
{},
|
|
114
|
-
{
|
|
115
|
-
children: 'Go Back',
|
|
116
|
-
}
|
|
117
|
-
)
|
|
118
|
-
expect(result.headerBackTitle).toBe('Go Back')
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
it('sets headerBackVisible to false when hidden', () => {
|
|
122
|
-
const result = appendStackHeaderBackButtonPropsToOptions(
|
|
123
|
-
{},
|
|
124
|
-
{
|
|
125
|
-
hidden: true,
|
|
126
|
-
}
|
|
127
|
-
)
|
|
128
|
-
expect(result.headerBackVisible).toBe(false)
|
|
129
|
-
})
|
|
130
|
-
|
|
131
|
-
it('sets headerBackButtonMenuEnabled', () => {
|
|
132
|
-
const result = appendStackHeaderBackButtonPropsToOptions(
|
|
133
|
-
{},
|
|
134
|
-
{
|
|
135
|
-
withMenu: true,
|
|
136
|
-
}
|
|
137
|
-
)
|
|
138
|
-
expect(result.headerBackButtonMenuEnabled).toBe(true)
|
|
139
|
-
})
|
|
140
|
-
|
|
141
|
-
it('sets headerBackButtonDisplayMode', () => {
|
|
142
|
-
const result = appendStackHeaderBackButtonPropsToOptions(
|
|
143
|
-
{},
|
|
144
|
-
{
|
|
145
|
-
displayMode: 'minimal',
|
|
146
|
-
}
|
|
147
|
-
)
|
|
148
|
-
expect(result.headerBackButtonDisplayMode).toBe('minimal')
|
|
149
|
-
})
|
|
150
|
-
})
|
|
151
|
-
|
|
152
|
-
describe('StackHeaderSearchBar', () => {
|
|
153
|
-
it('sets headerSearchBarOptions', () => {
|
|
154
|
-
const result = appendStackHeaderSearchBarPropsToOptions(
|
|
155
|
-
{},
|
|
156
|
-
{
|
|
157
|
-
placeholder: 'Search...',
|
|
158
|
-
autoCapitalize: 'none',
|
|
159
|
-
}
|
|
160
|
-
)
|
|
161
|
-
expect(result.headerSearchBarOptions).toMatchObject({
|
|
162
|
-
placeholder: 'Search...',
|
|
163
|
-
autoCapitalize: 'none',
|
|
164
|
-
})
|
|
165
|
-
})
|
|
166
|
-
})
|
|
167
|
-
|
|
168
|
-
describe('StackHeaderComponent', () => {
|
|
169
|
-
it('sets headerShown false when hidden', () => {
|
|
170
|
-
const result = appendStackHeaderPropsToOptions({}, { hidden: true })
|
|
171
|
-
expect(result.headerShown).toBe(false)
|
|
172
|
-
})
|
|
173
|
-
|
|
174
|
-
it('sets headerBlurEffect', () => {
|
|
175
|
-
const result = appendStackHeaderPropsToOptions({}, { blurEffect: 'regular' })
|
|
176
|
-
expect(result.headerBlurEffect).toBe('regular')
|
|
177
|
-
})
|
|
178
|
-
|
|
179
|
-
it('sets headerShadowVisible false when shadowColor is transparent', () => {
|
|
180
|
-
const result = appendStackHeaderPropsToOptions(
|
|
181
|
-
{},
|
|
182
|
-
{
|
|
183
|
-
style: { shadowColor: 'transparent' },
|
|
184
|
-
}
|
|
185
|
-
)
|
|
186
|
-
expect(result.headerShadowVisible).toBe(false)
|
|
187
|
-
})
|
|
188
|
-
|
|
189
|
-
it('processes child Title component', () => {
|
|
190
|
-
const result = appendStackHeaderPropsToOptions(
|
|
191
|
-
{},
|
|
192
|
-
{
|
|
193
|
-
children: <StackHeaderTitle large>Test Title</StackHeaderTitle>,
|
|
194
|
-
}
|
|
195
|
-
)
|
|
196
|
-
expect(result.title).toBe('Test Title')
|
|
197
|
-
expect(result.headerLargeTitle).toBe(true)
|
|
198
|
-
})
|
|
199
|
-
|
|
200
|
-
it('processes child BackButton component', () => {
|
|
201
|
-
const result = appendStackHeaderPropsToOptions(
|
|
202
|
-
{},
|
|
203
|
-
{
|
|
204
|
-
children: <StackHeaderBackButton hidden>Back</StackHeaderBackButton>,
|
|
205
|
-
}
|
|
206
|
-
)
|
|
207
|
-
expect(result.headerBackTitle).toBe('Back')
|
|
208
|
-
expect(result.headerBackVisible).toBe(false)
|
|
209
|
-
})
|
|
210
|
-
|
|
211
|
-
it('processes multiple children', () => {
|
|
212
|
-
const result = appendStackHeaderPropsToOptions(
|
|
213
|
-
{},
|
|
214
|
-
{
|
|
215
|
-
children: [
|
|
216
|
-
<StackHeaderTitle key="title" large>
|
|
217
|
-
My Screen
|
|
218
|
-
</StackHeaderTitle>,
|
|
219
|
-
<StackHeaderBackButton key="back" hidden />,
|
|
220
|
-
],
|
|
221
|
-
}
|
|
222
|
-
)
|
|
223
|
-
expect(result.title).toBe('My Screen')
|
|
224
|
-
expect(result.headerLargeTitle).toBe(true)
|
|
225
|
-
expect(result.headerBackVisible).toBe(false)
|
|
226
|
-
})
|
|
227
|
-
})
|
|
228
|
-
|
|
229
|
-
describe('StackScreen composition', () => {
|
|
230
|
-
it('merges options with Header composition', () => {
|
|
231
|
-
const result = appendScreenStackPropsToOptions(
|
|
232
|
-
{ animation: 'slide_from_right' },
|
|
233
|
-
{
|
|
234
|
-
options: { gestureEnabled: true },
|
|
235
|
-
children: (
|
|
236
|
-
<StackHeaderComponent blurEffect="regular">
|
|
237
|
-
<StackHeaderTitle large>Composed Title</StackHeaderTitle>
|
|
238
|
-
</StackHeaderComponent>
|
|
239
|
-
),
|
|
240
|
-
}
|
|
241
|
-
)
|
|
242
|
-
|
|
243
|
-
expect(result.animation).toBe('slide_from_right')
|
|
244
|
-
expect(result.gestureEnabled).toBe(true)
|
|
245
|
-
expect(result.headerBlurEffect).toBe('regular')
|
|
246
|
-
expect(result.title).toBe('Composed Title')
|
|
247
|
-
expect(result.headerLargeTitle).toBe(true)
|
|
248
|
-
})
|
|
249
|
-
|
|
250
|
-
it('composition overrides options prop', () => {
|
|
251
|
-
const result = appendScreenStackPropsToOptions(
|
|
252
|
-
{},
|
|
253
|
-
{
|
|
254
|
-
options: { title: 'Options Title' },
|
|
255
|
-
children: (
|
|
256
|
-
<StackHeaderComponent>
|
|
257
|
-
<StackHeaderTitle>Composed Title</StackHeaderTitle>
|
|
258
|
-
</StackHeaderComponent>
|
|
259
|
-
),
|
|
260
|
-
}
|
|
261
|
-
)
|
|
262
|
-
|
|
263
|
-
// Composition should override the options prop title
|
|
264
|
-
expect(result.title).toBe('Composed Title')
|
|
265
|
-
})
|
|
266
|
-
})
|
|
267
|
-
})
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { StackHeaderBackButton, type StackHeaderBackButtonProps } from './StackHeaderBackButton'
|
|
2
|
-
import { StackHeaderComponent, type StackHeaderProps } from './StackHeaderComponent'
|
|
3
|
-
import { StackHeaderLeft, type StackHeaderLeftProps } from './StackHeaderLeft'
|
|
4
|
-
import { StackHeaderRight, type StackHeaderRightProps } from './StackHeaderRight'
|
|
5
|
-
import { StackHeaderSearchBar, type StackHeaderSearchBarProps } from './StackHeaderSearchBar'
|
|
6
|
-
import { StackHeaderTitle, type StackHeaderTitleProps } from './StackHeaderTitle'
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Compound component for configuring stack headers.
|
|
10
|
-
* Attach to Stack as `Stack.Header`.
|
|
11
|
-
*/
|
|
12
|
-
export const StackHeader = Object.assign(StackHeaderComponent, {
|
|
13
|
-
Left: StackHeaderLeft,
|
|
14
|
-
Right: StackHeaderRight,
|
|
15
|
-
BackButton: StackHeaderBackButton,
|
|
16
|
-
Title: StackHeaderTitle,
|
|
17
|
-
SearchBar: StackHeaderSearchBar,
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
export {
|
|
21
|
-
StackHeaderBackButton,
|
|
22
|
-
type StackHeaderBackButtonProps,
|
|
23
|
-
StackHeaderComponent,
|
|
24
|
-
type StackHeaderProps,
|
|
25
|
-
StackHeaderLeft,
|
|
26
|
-
type StackHeaderLeftProps,
|
|
27
|
-
StackHeaderRight,
|
|
28
|
-
type StackHeaderRightProps,
|
|
29
|
-
StackHeaderSearchBar,
|
|
30
|
-
type StackHeaderSearchBarProps,
|
|
31
|
-
StackHeaderTitle,
|
|
32
|
-
type StackHeaderTitleProps,
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export { StackScreen, appendScreenStackPropsToOptions, type StackScreenProps } from './StackScreen'
|
package/src/utils/children.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
isValidElement,
|
|
3
|
-
type JSXElementConstructor,
|
|
4
|
-
type ReactElement,
|
|
5
|
-
type ReactNode,
|
|
6
|
-
} from 'react'
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Type-safe check if a React element is of a specific component type.
|
|
10
|
-
* Used for filtering children in compositional APIs.
|
|
11
|
-
*/
|
|
12
|
-
export function isChildOfType<ComponentT extends JSXElementConstructor<any>>(
|
|
13
|
-
element: ReactNode,
|
|
14
|
-
type: ComponentT
|
|
15
|
-
): element is ReactElement<React.ComponentProps<ComponentT>, ComponentT> {
|
|
16
|
-
return isValidElement(element) && element.type === type
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Get the first child element of a specific type.
|
|
21
|
-
*/
|
|
22
|
-
export function getFirstChildOfType<ComponentT extends JSXElementConstructor<any>>(
|
|
23
|
-
children: ReactNode,
|
|
24
|
-
type: ComponentT
|
|
25
|
-
): ReactElement<React.ComponentProps<ComponentT>, ComponentT> | undefined {
|
|
26
|
-
const childArray = Array.isArray(children) ? children : [children]
|
|
27
|
-
for (const child of childArray) {
|
|
28
|
-
if (isChildOfType(child, type)) {
|
|
29
|
-
return child
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return undefined
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Get all children of a specific type.
|
|
37
|
-
*/
|
|
38
|
-
export function getAllChildrenOfType<ComponentT extends JSXElementConstructor<any>>(
|
|
39
|
-
children: ReactNode,
|
|
40
|
-
type: ComponentT
|
|
41
|
-
): ReactElement<React.ComponentProps<ComponentT>, ComponentT>[] {
|
|
42
|
-
const childArray = Array.isArray(children) ? children : [children]
|
|
43
|
-
return childArray.filter(
|
|
44
|
-
(child): child is ReactElement<React.ComponentProps<ComponentT>, ComponentT> =>
|
|
45
|
-
isChildOfType(child, type)
|
|
46
|
-
)
|
|
47
|
-
}
|
package/src/utils/style.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { TextStyle } from 'react-native'
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Convert numeric font weights to string format for React Navigation compatibility.
|
|
5
|
-
* React Navigation only accepts string font weights, not numbers.
|
|
6
|
-
*/
|
|
7
|
-
export function convertFontWeightToStringFontWeight(
|
|
8
|
-
fontWeight: TextStyle['fontWeight']
|
|
9
|
-
): Exclude<TextStyle['fontWeight'], number> | undefined {
|
|
10
|
-
if (fontWeight === undefined) {
|
|
11
|
-
return undefined
|
|
12
|
-
}
|
|
13
|
-
if (typeof fontWeight === 'number') {
|
|
14
|
-
return String(fontWeight) as Exclude<TextStyle['fontWeight'], number>
|
|
15
|
-
}
|
|
16
|
-
return fontWeight
|
|
17
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export type NativeStackNavigationOptions = {
|
|
2
|
-
title?: string;
|
|
3
|
-
headerLargeTitle?: boolean;
|
|
4
|
-
headerTitleAlign?: 'left' | 'center';
|
|
5
|
-
headerTitleStyle?: any;
|
|
6
|
-
headerLargeTitleStyle?: any;
|
|
7
|
-
headerBackTitle?: string;
|
|
8
|
-
headerBackTitleStyle?: any;
|
|
9
|
-
headerBackImageSource?: any;
|
|
10
|
-
headerBackButtonDisplayMode?: string;
|
|
11
|
-
headerBackButtonMenuEnabled?: boolean;
|
|
12
|
-
headerBackVisible?: boolean;
|
|
13
|
-
headerSearchBarOptions?: any;
|
|
14
|
-
headerShown?: boolean;
|
|
15
|
-
headerBlurEffect?: string;
|
|
16
|
-
headerStyle?: any;
|
|
17
|
-
headerLargeStyle?: any;
|
|
18
|
-
headerShadowVisible?: boolean;
|
|
19
|
-
headerLargeTitleShadowVisible?: boolean;
|
|
20
|
-
headerLeft?: () => any;
|
|
21
|
-
headerRight?: () => any;
|
|
22
|
-
header?: () => any;
|
|
23
|
-
animation?: string;
|
|
24
|
-
gestureEnabled?: boolean;
|
|
25
|
-
};
|
|
26
|
-
export declare const createNativeStackNavigator: () => {
|
|
27
|
-
Navigator: () => null;
|
|
28
|
-
Screen: () => null;
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=native-stack.d.ts.map
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare const useNavigation: () => {
|
|
2
|
-
navigate: () => void;
|
|
3
|
-
goBack: () => void;
|
|
4
|
-
setOptions: () => void;
|
|
5
|
-
getParent: () => null;
|
|
6
|
-
};
|
|
7
|
-
export declare const NavigationContainer: ({ children }: any) => any;
|
|
8
|
-
export type NavigationProp<T = any> = {
|
|
9
|
-
navigate: (route: string, params?: any) => void;
|
|
10
|
-
goBack: () => void;
|
|
11
|
-
setOptions: (options: any) => void;
|
|
12
|
-
getParent: (id?: string) => any;
|
|
13
|
-
};
|
|
14
|
-
export type ParamListBase = Record<string, object | undefined>;
|
|
15
|
-
export type StackNavigationState<T> = any;
|
|
16
|
-
export type EventMapBase = any;
|
|
17
|
-
//# sourceMappingURL=native.d.ts.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const createURL: (path: string) => string;
|
|
2
|
-
export declare const parse: (url: string) => {
|
|
3
|
-
path: string;
|
|
4
|
-
};
|
|
5
|
-
export declare const addEventListener: () => {
|
|
6
|
-
remove: () => void;
|
|
7
|
-
};
|
|
8
|
-
export declare const getInitialURL: () => Promise<null>;
|
|
9
|
-
//# sourceMappingURL=expo-linking.d.ts.map
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const EventEmitter: {
|
|
2
|
-
new (): {
|
|
3
|
-
addListener(): void;
|
|
4
|
-
removeListener(): void;
|
|
5
|
-
emit(): void;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
export declare const NativeModulesProxy: {};
|
|
9
|
-
export declare const requireNativeModule: () => {};
|
|
10
|
-
export declare const requireOptionalNativeModule: () => null;
|
|
11
|
-
//# sourceMappingURL=expo-modules-core.d.ts.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const Screen = "Screen";
|
|
2
|
-
export declare const ScreenContainer = "ScreenContainer";
|
|
3
|
-
export type ScreenStackHeaderConfigProps = {
|
|
4
|
-
blurEffect?: string;
|
|
5
|
-
backgroundColor?: string;
|
|
6
|
-
largeTitleBackgroundColor?: string;
|
|
7
|
-
backButtonDisplayMode?: 'default' | 'minimal' | 'generic';
|
|
8
|
-
};
|
|
9
|
-
export type SearchBarProps = {
|
|
10
|
-
placeholder?: string;
|
|
11
|
-
onChangeText?: (text: string) => void;
|
|
12
|
-
autoCapitalize?: 'none' | 'sentences' | 'words' | 'characters';
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=react-native-screens.d.ts.map
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const StyleSheet: {
|
|
2
|
-
create: <T extends Record<string, any>>(styles: T) => T;
|
|
3
|
-
flatten: (style: any) => any;
|
|
4
|
-
};
|
|
5
|
-
export declare const Platform: {
|
|
6
|
-
OS: string;
|
|
7
|
-
select: (obj: any) => any;
|
|
8
|
-
};
|
|
9
|
-
export declare const View = "View";
|
|
10
|
-
export declare const Text = "Text";
|
|
11
|
-
export declare const Pressable = "Pressable";
|
|
12
|
-
//# sourceMappingURL=react-native.d.ts.map
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { NativeStackNavigationOptions } from '@react-navigation/native-stack';
|
|
2
|
-
import type { ImageSourcePropType } from 'react-native';
|
|
3
|
-
import type { ScreenStackHeaderConfigProps } from 'react-native-screens';
|
|
4
|
-
export interface StackHeaderBackButtonProps {
|
|
5
|
-
children?: string;
|
|
6
|
-
style?: NativeStackNavigationOptions['headerBackTitleStyle'];
|
|
7
|
-
withMenu?: boolean;
|
|
8
|
-
displayMode?: ScreenStackHeaderConfigProps['backButtonDisplayMode'];
|
|
9
|
-
hidden?: boolean;
|
|
10
|
-
src?: ImageSourcePropType;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Configuration component for the back button in stack headers.
|
|
14
|
-
*/
|
|
15
|
-
export declare function StackHeaderBackButton(_props: StackHeaderBackButtonProps): null;
|
|
16
|
-
export declare function appendStackHeaderBackButtonPropsToOptions(options: NativeStackNavigationOptions, props: StackHeaderBackButtonProps): NativeStackNavigationOptions;
|
|
17
|
-
//# sourceMappingURL=StackHeaderBackButton.d.ts.map
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { NativeStackNavigationOptions } from '@react-navigation/native-stack';
|
|
2
|
-
import { type ReactNode } from 'react';
|
|
3
|
-
import { type ColorValue, type StyleProp } from 'react-native';
|
|
4
|
-
import type { ScreenStackHeaderConfigProps } from 'react-native-screens';
|
|
5
|
-
export interface StackHeaderProps {
|
|
6
|
-
children?: ReactNode;
|
|
7
|
-
hidden?: boolean;
|
|
8
|
-
asChild?: boolean;
|
|
9
|
-
blurEffect?: ScreenStackHeaderConfigProps['blurEffect'];
|
|
10
|
-
style?: StyleProp<{
|
|
11
|
-
color?: ColorValue;
|
|
12
|
-
backgroundColor?: ScreenStackHeaderConfigProps['backgroundColor'];
|
|
13
|
-
shadowColor?: undefined | 'transparent';
|
|
14
|
-
}>;
|
|
15
|
-
largeStyle?: StyleProp<{
|
|
16
|
-
backgroundColor?: ScreenStackHeaderConfigProps['largeTitleBackgroundColor'];
|
|
17
|
-
shadowColor?: undefined | 'transparent';
|
|
18
|
-
}>;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Configuration component for stack headers.
|
|
22
|
-
* Use child components to configure different parts of the header.
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```tsx
|
|
26
|
-
* <Stack.Header blurEffect="regular">
|
|
27
|
-
* <Stack.Header.Title large>My Title</Stack.Header.Title>
|
|
28
|
-
* <Stack.Header.Right asChild>
|
|
29
|
-
* <Button>Action</Button>
|
|
30
|
-
* </Stack.Header.Right>
|
|
31
|
-
* </Stack.Header>
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
export declare function StackHeaderComponent(_props: StackHeaderProps): null;
|
|
35
|
-
export declare function appendStackHeaderPropsToOptions(options: NativeStackNavigationOptions, props: StackHeaderProps): NativeStackNavigationOptions;
|
|
36
|
-
//# sourceMappingURL=StackHeaderComponent.d.ts.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { NativeStackNavigationOptions } from '@react-navigation/native-stack';
|
|
2
|
-
import type { ReactNode } from 'react';
|
|
3
|
-
export interface StackHeaderLeftProps {
|
|
4
|
-
children?: ReactNode;
|
|
5
|
-
asChild?: boolean;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Configuration component for custom left header content.
|
|
9
|
-
* Use `asChild` to render custom components in the left header area.
|
|
10
|
-
*/
|
|
11
|
-
export declare function StackHeaderLeft(_props: StackHeaderLeftProps): null;
|
|
12
|
-
export declare function appendStackHeaderLeftPropsToOptions(options: NativeStackNavigationOptions, props: StackHeaderLeftProps): NativeStackNavigationOptions;
|
|
13
|
-
//# sourceMappingURL=StackHeaderLeft.d.ts.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { NativeStackNavigationOptions } from '@react-navigation/native-stack';
|
|
2
|
-
import type { ReactNode } from 'react';
|
|
3
|
-
export interface StackHeaderRightProps {
|
|
4
|
-
children?: ReactNode;
|
|
5
|
-
asChild?: boolean;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Configuration component for custom right header content.
|
|
9
|
-
* Use `asChild` to render custom components in the right header area.
|
|
10
|
-
*/
|
|
11
|
-
export declare function StackHeaderRight(_props: StackHeaderRightProps): null;
|
|
12
|
-
export declare function appendStackHeaderRightPropsToOptions(options: NativeStackNavigationOptions, props: StackHeaderRightProps): NativeStackNavigationOptions;
|
|
13
|
-
//# sourceMappingURL=StackHeaderRight.d.ts.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { NativeStackNavigationOptions } from '@react-navigation/native-stack';
|
|
2
|
-
import type { SearchBarProps } from 'react-native-screens';
|
|
3
|
-
export interface StackHeaderSearchBarProps extends SearchBarProps {
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Configuration component for adding a search bar to stack headers.
|
|
7
|
-
*/
|
|
8
|
-
export declare function StackHeaderSearchBar(_props: StackHeaderSearchBarProps): null;
|
|
9
|
-
export declare function appendStackHeaderSearchBarPropsToOptions(options: NativeStackNavigationOptions, props: StackHeaderSearchBarProps): NativeStackNavigationOptions;
|
|
10
|
-
//# sourceMappingURL=StackHeaderSearchBar.d.ts.map
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { NativeStackNavigationOptions } from '@react-navigation/native-stack';
|
|
2
|
-
import { type StyleProp, type TextStyle } from 'react-native';
|
|
3
|
-
export type StackHeaderTitleProps = {
|
|
4
|
-
children?: string;
|
|
5
|
-
style?: StyleProp<{
|
|
6
|
-
fontFamily?: TextStyle['fontFamily'];
|
|
7
|
-
fontSize?: TextStyle['fontSize'];
|
|
8
|
-
fontWeight?: Exclude<TextStyle['fontWeight'], number>;
|
|
9
|
-
color?: string;
|
|
10
|
-
textAlign?: 'left' | 'center';
|
|
11
|
-
}>;
|
|
12
|
-
largeStyle?: StyleProp<{
|
|
13
|
-
fontFamily?: TextStyle['fontFamily'];
|
|
14
|
-
fontSize?: TextStyle['fontSize'];
|
|
15
|
-
fontWeight?: Exclude<TextStyle['fontWeight'], number>;
|
|
16
|
-
color?: string;
|
|
17
|
-
}>;
|
|
18
|
-
large?: boolean;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Configuration component for stack header title.
|
|
22
|
-
* This component doesn't render anything - it's used to configure the header.
|
|
23
|
-
*/
|
|
24
|
-
export declare function StackHeaderTitle(_props: StackHeaderTitleProps): null;
|
|
25
|
-
export declare function appendStackHeaderTitlePropsToOptions(options: NativeStackNavigationOptions, props: StackHeaderTitleProps): NativeStackNavigationOptions;
|
|
26
|
-
//# sourceMappingURL=StackHeaderTitle.d.ts.map
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { NativeStackNavigationOptions } from '@react-navigation/native-stack';
|
|
2
|
-
import { type PropsWithChildren } from 'react';
|
|
3
|
-
export interface StackScreenProps extends PropsWithChildren {
|
|
4
|
-
name?: string;
|
|
5
|
-
options?: NativeStackNavigationOptions;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Stack screen component with support for compositional header configuration.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```tsx
|
|
12
|
-
* <Stack.Screen name="home" options={{ title: 'Home' }}>
|
|
13
|
-
* <Stack.Header>
|
|
14
|
-
* <Stack.Header.Title large>Welcome</Stack.Header.Title>
|
|
15
|
-
* </Stack.Header>
|
|
16
|
-
* </Stack.Screen>
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
export declare function StackScreen({ children, options, ...rest }: StackScreenProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
export declare function appendScreenStackPropsToOptions(options: NativeStackNavigationOptions, props: StackScreenProps): NativeStackNavigationOptions;
|
|
21
|
-
//# sourceMappingURL=StackScreen.d.ts.map
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { StackHeaderBackButton, type StackHeaderBackButtonProps } from './StackHeaderBackButton';
|
|
2
|
-
import { StackHeaderComponent, type StackHeaderProps } from './StackHeaderComponent';
|
|
3
|
-
import { StackHeaderLeft, type StackHeaderLeftProps } from './StackHeaderLeft';
|
|
4
|
-
import { StackHeaderRight, type StackHeaderRightProps } from './StackHeaderRight';
|
|
5
|
-
import { StackHeaderSearchBar, type StackHeaderSearchBarProps } from './StackHeaderSearchBar';
|
|
6
|
-
import { StackHeaderTitle, type StackHeaderTitleProps } from './StackHeaderTitle';
|
|
7
|
-
/**
|
|
8
|
-
* Compound component for configuring stack headers.
|
|
9
|
-
* Attach to Stack as `Stack.Header`.
|
|
10
|
-
*/
|
|
11
|
-
export declare const StackHeader: typeof StackHeaderComponent & {
|
|
12
|
-
Left: typeof StackHeaderLeft;
|
|
13
|
-
Right: typeof StackHeaderRight;
|
|
14
|
-
BackButton: typeof StackHeaderBackButton;
|
|
15
|
-
Title: typeof StackHeaderTitle;
|
|
16
|
-
SearchBar: typeof StackHeaderSearchBar;
|
|
17
|
-
};
|
|
18
|
-
export { StackHeaderBackButton, type StackHeaderBackButtonProps, StackHeaderComponent, type StackHeaderProps, StackHeaderLeft, type StackHeaderLeftProps, StackHeaderRight, type StackHeaderRightProps, StackHeaderSearchBar, type StackHeaderSearchBarProps, StackHeaderTitle, type StackHeaderTitleProps, };
|
|
19
|
-
export { StackScreen, appendScreenStackPropsToOptions, type StackScreenProps } from './StackScreen';
|
|
20
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { type JSXElementConstructor, type ReactElement, type ReactNode } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* Type-safe check if a React element is of a specific component type.
|
|
4
|
-
* Used for filtering children in compositional APIs.
|
|
5
|
-
*/
|
|
6
|
-
export declare function isChildOfType<ComponentT extends JSXElementConstructor<any>>(element: ReactNode, type: ComponentT): element is ReactElement<React.ComponentProps<ComponentT>, ComponentT>;
|
|
7
|
-
/**
|
|
8
|
-
* Get the first child element of a specific type.
|
|
9
|
-
*/
|
|
10
|
-
export declare function getFirstChildOfType<ComponentT extends JSXElementConstructor<any>>(children: ReactNode, type: ComponentT): ReactElement<React.ComponentProps<ComponentT>, ComponentT> | undefined;
|
|
11
|
-
/**
|
|
12
|
-
* Get all children of a specific type.
|
|
13
|
-
*/
|
|
14
|
-
export declare function getAllChildrenOfType<ComponentT extends JSXElementConstructor<any>>(children: ReactNode, type: ComponentT): ReactElement<React.ComponentProps<ComponentT>, ComponentT>[];
|
|
15
|
-
//# sourceMappingURL=children.d.ts.map
|
package/types/utils/style.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { TextStyle } from 'react-native';
|
|
2
|
-
/**
|
|
3
|
-
* Convert numeric font weights to string format for React Navigation compatibility.
|
|
4
|
-
* React Navigation only accepts string font weights, not numbers.
|
|
5
|
-
*/
|
|
6
|
-
export declare function convertFontWeightToStringFontWeight(fontWeight: TextStyle['fontWeight']): Exclude<TextStyle['fontWeight'], number> | undefined;
|
|
7
|
-
//# sourceMappingURL=style.d.ts.map
|