@use-voltra/ios 2.3.2 → 2.4.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 (47) hide show
  1. package/build/commonjs/index.js +12 -0
  2. package/build/commonjs/index.js.map +1 -1
  3. package/build/commonjs/jsx/primitives.js +36 -0
  4. package/build/commonjs/jsx/primitives.js.map +1 -1
  5. package/build/commonjs/modifiers/createIosModifier.js +19 -0
  6. package/build/commonjs/modifiers/createIosModifier.js.map +1 -0
  7. package/build/commonjs/modifiers/index.js +334 -0
  8. package/build/commonjs/modifiers/index.js.map +1 -0
  9. package/build/module/index.js +1 -1
  10. package/build/module/index.js.map +1 -1
  11. package/build/module/jsx/primitives.js +1 -0
  12. package/build/module/jsx/primitives.js.map +1 -1
  13. package/build/module/modifiers/createIosModifier.js +14 -0
  14. package/build/module/modifiers/createIosModifier.js.map +1 -0
  15. package/build/module/modifiers/index.js +299 -0
  16. package/build/module/modifiers/index.js.map +1 -0
  17. package/build/typescript/commonjs/index.d.ts +2 -2
  18. package/build/typescript/commonjs/index.d.ts.map +1 -1
  19. package/build/typescript/commonjs/jsx/baseProps.d.ts +8 -0
  20. package/build/typescript/commonjs/jsx/baseProps.d.ts.map +1 -1
  21. package/build/typescript/commonjs/jsx/primitives.d.ts +1 -0
  22. package/build/typescript/commonjs/jsx/primitives.d.ts.map +1 -1
  23. package/build/typescript/commonjs/live-activity/types.d.ts +1 -1
  24. package/build/typescript/commonjs/live-activity/types.d.ts.map +1 -1
  25. package/build/typescript/commonjs/modifiers/createIosModifier.d.ts +12 -0
  26. package/build/typescript/commonjs/modifiers/createIosModifier.d.ts.map +1 -0
  27. package/build/typescript/commonjs/modifiers/index.d.ts +290 -0
  28. package/build/typescript/commonjs/modifiers/index.d.ts.map +1 -0
  29. package/build/typescript/module/index.d.ts +2 -2
  30. package/build/typescript/module/index.d.ts.map +1 -1
  31. package/build/typescript/module/jsx/baseProps.d.ts +8 -0
  32. package/build/typescript/module/jsx/baseProps.d.ts.map +1 -1
  33. package/build/typescript/module/jsx/primitives.d.ts +1 -0
  34. package/build/typescript/module/jsx/primitives.d.ts.map +1 -1
  35. package/build/typescript/module/live-activity/types.d.ts +1 -1
  36. package/build/typescript/module/live-activity/types.d.ts.map +1 -1
  37. package/build/typescript/module/modifiers/createIosModifier.d.ts +12 -0
  38. package/build/typescript/module/modifiers/createIosModifier.d.ts.map +1 -0
  39. package/build/typescript/module/modifiers/index.d.ts +290 -0
  40. package/build/typescript/module/modifiers/index.d.ts.map +1 -0
  41. package/package.json +2 -2
  42. package/src/index.ts +9 -2
  43. package/src/jsx/baseProps.tsx +8 -0
  44. package/src/jsx/primitives.ts +1 -0
  45. package/src/live-activity/types.ts +13 -1
  46. package/src/modifiers/createIosModifier.ts +20 -0
  47. package/src/modifiers/index.ts +306 -0
@@ -0,0 +1,290 @@
1
+ export type { IosModifier } from './createIosModifier.js';
2
+ export type ClipShape = 'rectangle' | 'roundedRectangle' | 'circle' | 'capsule' | 'ellipse';
3
+ export type ClipShapeOptions = {
4
+ /** Corner radius for `roundedRectangle`. */
5
+ cornerRadius?: number;
6
+ /** Corner style for `roundedRectangle` and `capsule`. Defaults to `circular`. */
7
+ cornerStyle?: 'circular' | 'continuous';
8
+ };
9
+ export type RedactionReason = 'placeholder' | 'privacy' | 'invalidated';
10
+ export type ContentTransition = 'identity' | 'opacity' | 'interpolate' | 'numericText' | 'symbolEffect';
11
+ export type Transition = 'identity' | 'opacity' | 'scale' | 'slide' | 'push' | 'move';
12
+ export type Edge = 'top' | 'bottom' | 'leading' | 'trailing';
13
+ export type AnimationCurve = 'default' | 'linear' | 'easeIn' | 'easeOut' | 'easeInOut' | 'spring' | 'bouncy' | 'smooth' | 'snappy';
14
+ export type DynamicTypeSize = 'xSmall' | 'small' | 'medium' | 'large' | 'xLarge' | 'xxLarge' | 'xxxLarge' | 'accessibility1' | 'accessibility2' | 'accessibility3' | 'accessibility4' | 'accessibility5';
15
+ export type BlendMode = 'normal' | 'multiply' | 'screen' | 'overlay' | 'darken' | 'lighten' | 'colorDodge' | 'colorBurn' | 'softLight' | 'hardLight' | 'difference' | 'exclusion' | 'hue' | 'saturation' | 'color' | 'luminosity' | 'sourceAtop' | 'destinationOver' | 'destinationOut' | 'plusDarker' | 'plusLighter';
16
+ export type SymbolEffect = 'pulse' | 'variableColor' | 'breathe' | 'rotate' | 'wiggle';
17
+ /**
18
+ * Opens the URL in the app when the widget or Live Activity is tapped. Takes an absolute URL or a
19
+ * path, which gets the app's URL scheme like `deepLinkUrl`. Use it once per widget, or once per
20
+ * Live Activity presentation. It replaces Voltra's default widget link, but a `deepLinkUrl`
21
+ * configured for the widget or Live Activity takes precedence. A tap on the compact or minimal
22
+ * Dynamic Island ignores it: pass `deepLinkUrl` when starting the Live Activity instead.
23
+ *
24
+ * @since iOS 14.0
25
+ */
26
+ export declare const widgetURL: (url: string) => import("./createIosModifier.js").IosModifier & Readonly<{
27
+ url: string;
28
+ }>;
29
+ /**
30
+ * Sets the widget's container background, which the system removes in contexts such as StandBy
31
+ * and tinted Home Screens. Use it on the widget's outermost component.
32
+ *
33
+ * @since iOS 17.0
34
+ */
35
+ export declare const containerBackground: (color: string) => import("./createIosModifier.js").IosModifier & Readonly<{
36
+ color: string;
37
+ }>;
38
+ /**
39
+ * Adds the component to the accent group when the widget renders in accented mode.
40
+ *
41
+ * @since iOS 16.0
42
+ */
43
+ export declare const widgetAccentable: (accentable?: boolean) => import("./createIosModifier.js").IosModifier & Readonly<{
44
+ accentable: boolean;
45
+ }>;
46
+ /**
47
+ * Redacts the view when the widget is shown on a locked device.
48
+ *
49
+ * @since iOS 15.0
50
+ */
51
+ export declare const privacySensitive: (sensitive?: boolean) => import("./createIosModifier.js").IosModifier & Readonly<{
52
+ sensitive: boolean;
53
+ }>;
54
+ /**
55
+ * Renders the component redacted, for example as a placeholder.
56
+ *
57
+ * @since iOS 14.0
58
+ */
59
+ export declare const redacted: (reason: RedactionReason) => import("./createIosModifier.js").IosModifier & Readonly<{
60
+ reason: RedactionReason;
61
+ }>;
62
+ /**
63
+ * Keeps the component visible inside a redacted container.
64
+ *
65
+ * @since iOS 14.0
66
+ */
67
+ export declare const unredacted: () => import("./createIosModifier.js").IosModifier & Readonly<Record<string, unknown>>;
68
+ /**
69
+ * Marks content that goes stale while an interactive widget performs an update.
70
+ *
71
+ * @since iOS 17.0
72
+ */
73
+ export declare const invalidatableContent: (invalidatable?: boolean) => import("./createIosModifier.js").IosModifier & Readonly<{
74
+ invalidatable: boolean;
75
+ }>;
76
+ /**
77
+ * Tints the Live Activity's Lock Screen background. `null` uses the system default. It has no
78
+ * effect in the Dynamic Island or in widgets, and an `activityBackgroundTint` passed when starting
79
+ * or updating the Live Activity takes precedence.
80
+ *
81
+ * @since iOS 16.1
82
+ */
83
+ export declare const activityBackgroundTint: (color: string | null) => import("./createIosModifier.js").IosModifier & Readonly<{
84
+ color: string | null;
85
+ }>;
86
+ /**
87
+ * Sets the color of the system action button shown next to the Live Activity. `null` uses the
88
+ * system default.
89
+ *
90
+ * @since iOS 16.1
91
+ */
92
+ export declare const activitySystemActionForegroundColor: (color: string | null) => import("./createIosModifier.js").IosModifier & Readonly<{
93
+ color: string | null;
94
+ }>;
95
+ /**
96
+ * Animates changes to the content between updates: timeline entries, activity states, or renders
97
+ * of an in-app preview. Pair it with `animation` on the same component.
98
+ *
99
+ * @since iOS 16.0. `symbolEffect` requires iOS 17.0.
100
+ */
101
+ export declare const contentTransition: (transition: ContentTransition, options?: {
102
+ countsDown?: boolean;
103
+ }) => import("./createIosModifier.js").IosModifier & Readonly<{
104
+ transition: ContentTransition;
105
+ countsDown: boolean | undefined;
106
+ }>;
107
+ /**
108
+ * Animates the component in or out when it appears or disappears between two updates. It has no
109
+ * effect on a component that is present in both. The insertion is animated by the parent, so put
110
+ * `animation` with the value that toggles the component on a parent that stays, and give the
111
+ * siblings an `id` so SwiftUI can tell which one appeared.
112
+ *
113
+ * @since iOS 16.0
114
+ */
115
+ export declare const transition: (transition: Transition, options?: {
116
+ edge?: Edge;
117
+ }) => import("./createIosModifier.js").IosModifier & Readonly<{
118
+ transition: Transition;
119
+ edge: Edge | undefined;
120
+ }>;
121
+ /**
122
+ * Animates the component when `value` changes between updates. `duration` applies to `linear`,
123
+ * `easeIn`, `easeOut`, `easeInOut`, `bouncy`, `smooth` and `snappy`; `default` and `spring` use
124
+ * the system timing.
125
+ *
126
+ * @since iOS 13.0. `bouncy`, `smooth` and `snappy` require iOS 17.0.
127
+ */
128
+ export declare const animation: (curve: AnimationCurve, options: {
129
+ value: string | number | boolean;
130
+ duration?: number;
131
+ }) => import("./createIosModifier.js").IosModifier & Readonly<{
132
+ curve: AnimationCurve;
133
+ value: string | number | boolean;
134
+ duration: number | undefined;
135
+ }>;
136
+ /**
137
+ * Applies an indefinite SF Symbol effect to `Symbol` components inside. The system decides whether
138
+ * it animates: in-app previews play it, while widgets and Live Activities may show a still frame.
139
+ *
140
+ * @since iOS 17.0. `breathe`, `rotate` and `wiggle` require iOS 18.0.
141
+ */
142
+ export declare const symbolEffect: (effect: SymbolEffect) => import("./createIosModifier.js").IosModifier & Readonly<{
143
+ effect: SymbolEffect;
144
+ }>;
145
+ /**
146
+ * Clips the finished component, background included, to a shape.
147
+ *
148
+ * @since iOS 13.0
149
+ */
150
+ export declare const clipShape: (shape: ClipShape, options?: ClipShapeOptions) => import("./createIosModifier.js").IosModifier & Readonly<{
151
+ shape: ClipShape;
152
+ cornerRadius: number | undefined;
153
+ cornerStyle: "circular" | "continuous" | undefined;
154
+ }>;
155
+ /**
156
+ * Applies a Gaussian blur.
157
+ *
158
+ * @since iOS 13.0
159
+ */
160
+ export declare const blur: (radius: number, options?: {
161
+ opaque?: boolean;
162
+ }) => import("./createIosModifier.js").IosModifier & Readonly<{
163
+ radius: number;
164
+ opaque: boolean | undefined;
165
+ }>;
166
+ /** @since iOS 13.0 */
167
+ export declare const grayscale: (amount: number) => import("./createIosModifier.js").IosModifier & Readonly<{
168
+ amount: number;
169
+ }>;
170
+ /** @since iOS 13.0 */
171
+ export declare const saturation: (amount: number) => import("./createIosModifier.js").IosModifier & Readonly<{
172
+ amount: number;
173
+ }>;
174
+ /** @since iOS 13.0 */
175
+ export declare const brightness: (amount: number) => import("./createIosModifier.js").IosModifier & Readonly<{
176
+ amount: number;
177
+ }>;
178
+ /** @since iOS 13.0 */
179
+ export declare const contrast: (amount: number) => import("./createIosModifier.js").IosModifier & Readonly<{
180
+ amount: number;
181
+ }>;
182
+ /**
183
+ * Sets how the component composites with the content behind it.
184
+ *
185
+ * @since iOS 13.0
186
+ */
187
+ export declare const blendMode: (mode: BlendMode) => import("./createIosModifier.js").IosModifier & Readonly<{
188
+ mode: BlendMode;
189
+ }>;
190
+ /**
191
+ * Rotates the rendered component around its center without changing its layout.
192
+ *
193
+ * @since iOS 13.0
194
+ */
195
+ export declare const rotationEffect: (degrees: number) => import("./createIosModifier.js").IosModifier & Readonly<{
196
+ degrees: number;
197
+ }>;
198
+ /**
199
+ * Scales the rendered component around its center without changing its layout.
200
+ *
201
+ * @since iOS 13.0
202
+ */
203
+ export declare const scaleEffect: (scale: number | {
204
+ x?: number;
205
+ y?: number;
206
+ }) => import("./createIosModifier.js").IosModifier & Readonly<{
207
+ x: number | undefined;
208
+ y: number | undefined;
209
+ }>;
210
+ /**
211
+ * Moves the rendered component without changing its layout.
212
+ *
213
+ * @since iOS 13.0
214
+ */
215
+ export declare const offset: (value: {
216
+ x?: number;
217
+ y?: number;
218
+ }) => import("./createIosModifier.js").IosModifier & Readonly<{
219
+ x: number | undefined;
220
+ y: number | undefined;
221
+ }>;
222
+ /**
223
+ * Keeps the component at its ideal size on the given axes instead of letting the parent shrink it.
224
+ *
225
+ * @since iOS 13.0
226
+ */
227
+ export declare const fixedSize: (axes?: {
228
+ horizontal?: boolean;
229
+ vertical?: boolean;
230
+ }) => import("./createIosModifier.js").IosModifier & Readonly<{
231
+ horizontal: boolean | undefined;
232
+ vertical: boolean | undefined;
233
+ }>;
234
+ /**
235
+ * Gives the component a larger or smaller share of space in its stack.
236
+ *
237
+ * @since iOS 13.0
238
+ */
239
+ export declare const layoutPriority: (priority: number) => import("./createIosModifier.js").IosModifier & Readonly<{
240
+ priority: number;
241
+ }>;
242
+ /**
243
+ * Sizes the component relative to its nearest container, such as the widget.
244
+ *
245
+ * @since iOS 17.0
246
+ */
247
+ export declare const containerRelativeFrame: (axes: "horizontal" | "vertical" | "both") => import("./createIosModifier.js").IosModifier & Readonly<{
248
+ axes: "horizontal" | "vertical" | "both";
249
+ }>;
250
+ /**
251
+ * Uses a fixed Dynamic Type size for content inside the component, regardless of the system
252
+ * setting. Voltra `Text` uses fixed font sizes, so it does not change.
253
+ *
254
+ * @since iOS 15.0
255
+ */
256
+ export declare const dynamicTypeSize: (size: DynamicTypeSize) => import("./createIosModifier.js").IosModifier & Readonly<{
257
+ size: DynamicTypeSize;
258
+ }>;
259
+ /**
260
+ * Lets text inside shrink down to this fraction of its font size to fit.
261
+ *
262
+ * @since iOS 13.0
263
+ */
264
+ export declare const minimumScaleFactor: (factor: number) => import("./createIosModifier.js").IosModifier & Readonly<{
265
+ factor: number;
266
+ }>;
267
+ /**
268
+ * Sets where text inside is truncated when it does not fit.
269
+ *
270
+ * @since iOS 13.0
271
+ */
272
+ export declare const truncationMode: (mode: "head" | "middle" | "tail") => import("./createIosModifier.js").IosModifier & Readonly<{
273
+ mode: "head" | "middle" | "tail";
274
+ }>;
275
+ /**
276
+ * Aligns the lines of multi-line text inside. A `Text` with `style.textAlign` or its own
277
+ * `multilineTextAlignment` prop keeps that value.
278
+ *
279
+ * @since iOS 13.0
280
+ */
281
+ export declare const multilineTextAlignment: (alignment: "leading" | "center" | "trailing") => import("./createIosModifier.js").IosModifier & Readonly<{
282
+ alignment: "center" | "leading" | "trailing";
283
+ }>;
284
+ /**
285
+ * Uses fixed-width digits for text inside, so changing numbers do not shift.
286
+ *
287
+ * @since iOS 16.0
288
+ */
289
+ export declare const monospacedDigit: () => import("./createIosModifier.js").IosModifier & Readonly<Record<string, unknown>>;
290
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modifiers/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEzD,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG,kBAAkB,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAA;AAE3F,MAAM,MAAM,gBAAgB,GAAG;IAC7B,4CAA4C;IAC5C,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,iFAAiF;IACjF,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,CAAA;CACxC,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,SAAS,GAAG,aAAa,CAAA;AAEvE,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,SAAS,GAAG,aAAa,GAAG,aAAa,GAAG,cAAc,CAAA;AAEvG,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;AAErF,MAAM,MAAM,IAAI,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAA;AAE5D,MAAM,MAAM,cAAc,GACtB,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,WAAW,GACX,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,QAAQ,CAAA;AAEZ,MAAM,MAAM,eAAe,GACvB,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,SAAS,GACT,UAAU,GACV,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,CAAA;AAEpB,MAAM,MAAM,SAAS,GACjB,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,SAAS,GACT,YAAY,GACZ,WAAW,G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U,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAO;;;EACS,CAAA;AAE1F;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU,MAAM;;EAAsD,CAAA;AAErG;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAI,MAAM,YAAY,GAAG,UAAU,GAAG,MAAM;;EACxB,CAAA;AAEvD;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,eAAe;;EAAmD,CAAA;AAIxG;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,MAAM;;EAAwD,CAAA;AAEzG;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,GAAG,QAAQ,GAAG,MAAM;;EAAkD,CAAA;AAEjH;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GAAI,WAAW,SAAS,GAAG,QAAQ,GAAG,UAAU;;EACvB,CAAA;AAE5D;;;;GAIG;AACH,eAAO,MAAM,eAAe,wFAA6C,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@use-voltra/ios",
3
- "version": "2.3.2",
3
+ "version": "2.4.0",
4
4
  "description": "Voltra for iOS",
5
5
  "main": "build/commonjs/index.js",
6
6
  "module": "build/module/index.js",
@@ -38,7 +38,7 @@
38
38
  "README.md"
39
39
  ],
40
40
  "dependencies": {
41
- "@use-voltra/core": "^2.3.2"
41
+ "@use-voltra/core": "^2.4.0"
42
42
  },
43
43
  "keywords": [
44
44
  "react-native",
package/src/index.ts CHANGED
@@ -43,5 +43,12 @@ export type {
43
43
  } from './types.js'
44
44
  export { renderWidgetToJson, renderWidgetToString } from './widgets/renderer.js'
45
45
  export type { ScheduledWidgetEntry, WidgetFamily, WidgetInfo, WidgetVariants } from './widgets/types.js'
46
- export { getFastRefreshHub, isAndroidEnv, isIosEnv, useUpdateOnHMR } from '@use-voltra/core'
47
- export type { FastRefreshHub, WidgetBuildEnvironment, WidgetEnvironment } from '@use-voltra/core'
46
+ export {
47
+ getFastRefreshHub,
48
+ isAndroidEnv,
49
+ isIosEnv,
50
+ pickLocalizedValue,
51
+ resolveLocale,
52
+ useUpdateOnHMR,
53
+ } from '@use-voltra/core'
54
+ export type { FastRefreshHub, LocaleEnvironment, WidgetBuildEnvironment, WidgetEnvironment } from '@use-voltra/core'
@@ -1,9 +1,17 @@
1
+ import type { NativeModifiersProp } from '@use-voltra/core'
1
2
  import { ReactNode } from 'react'
2
3
 
4
+ import type { IosModifier } from '../modifiers/createIosModifier.js'
3
5
  import type { VoltraStyleProp } from '../styles/index.js'
4
6
 
5
7
  export type VoltraBaseProps = {
6
8
  id?: string
7
9
  style?: VoltraStyleProp
10
+ /**
11
+ * SwiftUI modifiers from `Voltra.modifiers`, applied on top of the styled component in array
12
+ * order: the first entry is innermost. Falsy entries, such as `count && modifier` with `count = 0`,
13
+ * mean no modifier.
14
+ */
15
+ modifiers?: NativeModifiersProp<IosModifier>
8
16
  children?: ReactNode
9
17
  }
@@ -27,3 +27,4 @@ export * from './Toggle.js'
27
27
  export * from './View.js'
28
28
  export * from './VStack.js'
29
29
  export * from './ZStack.js'
30
+ export * as modifiers from '../modifiers/index.js'
@@ -12,7 +12,19 @@ import type { VoltraNodeJson } from '../types.js'
12
12
  */
13
13
  export type LiveActivityEnvironment = Pick<
14
14
  WidgetEnvironment,
15
- 'date' | 'colorScheme' | 'locale' | 'widgetRenderingMode' | 'build'
15
+ | 'date'
16
+ | 'colorScheme'
17
+ | 'locale'
18
+ | 'preferredLanguages'
19
+ | 'appLocale'
20
+ | 'layoutDirection'
21
+ | 'hourCycle'
22
+ | 'timeZone'
23
+ | 'measurementSystem'
24
+ | 'calendar'
25
+ | 'firstDayOfWeek'
26
+ | 'widgetRenderingMode'
27
+ | 'build'
16
28
  > & {
17
29
  /** Whether ActivityKit currently considers this activity stale. */
18
30
  isStale: boolean
@@ -0,0 +1,20 @@
1
+ declare const IOS_MODIFIER_BRAND: unique symbol
2
+
3
+ /**
4
+ * A SwiftUI modifier descriptor produced by a `Voltra.modifiers` factory. The brand exists only
5
+ * in the type system, so an Android modifier cannot be passed to a `Voltra` component.
6
+ */
7
+ export type IosModifier = {
8
+ readonly $type: string
9
+ readonly [IOS_MODIFIER_BRAND]: 'ios'
10
+ }
11
+
12
+ export const createIosModifier = <Params extends Record<string, unknown>>(
13
+ type: string,
14
+ params?: Params
15
+ ): IosModifier & Readonly<Params> =>
16
+ // Omitted options stay out of the descriptor instead of appearing as `undefined` keys.
17
+ Object.freeze({
18
+ ...Object.fromEntries(Object.entries(params ?? {}).filter(([, value]) => value !== undefined)),
19
+ $type: type,
20
+ }) as unknown as IosModifier & Readonly<Params>