@thelacanians/vue-native-runtime 0.2.0 → 0.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.
package/dist/index.d.cts CHANGED
@@ -602,6 +602,10 @@ declare const VButton: _vue_runtime_core.DefineComponent<_vue_runtime_core.Extra
602
602
  * The component maps `modelValue` to the native `text` prop and listens
603
603
  * for `changetext` events from the native side to update the model.
604
604
  *
605
+ * Handles CJK IME composition correctly: during composition, model updates
606
+ * are deferred until the user commits the composed character to avoid
607
+ * v-model desync.
608
+ *
605
609
  * @example
606
610
  * ```vue
607
611
  * <VInput
@@ -845,6 +849,11 @@ declare const VScrollView: _vue_runtime_core.DefineComponent<_vue_runtime_core.E
845
849
  default: boolean;
846
850
  };
847
851
  contentContainerStyle: PropType<ViewStyle>;
852
+ /** Minimum interval in ms between scroll event emissions. Default: 16 (~60fps) */
853
+ scrollEventThrottle: {
854
+ type: NumberConstructor;
855
+ default: number;
856
+ };
848
857
  /** Whether the pull-to-refresh indicator is active */
849
858
  refreshing: {
850
859
  type: BooleanConstructor;
@@ -883,6 +892,11 @@ declare const VScrollView: _vue_runtime_core.DefineComponent<_vue_runtime_core.E
883
892
  default: boolean;
884
893
  };
885
894
  contentContainerStyle: PropType<ViewStyle>;
895
+ /** Minimum interval in ms between scroll event emissions. Default: 16 (~60fps) */
896
+ scrollEventThrottle: {
897
+ type: NumberConstructor;
898
+ default: number;
899
+ };
886
900
  /** Whether the pull-to-refresh indicator is active */
887
901
  refreshing: {
888
902
  type: BooleanConstructor;
@@ -903,6 +917,7 @@ declare const VScrollView: _vue_runtime_core.DefineComponent<_vue_runtime_core.E
903
917
  scrollEnabled: boolean;
904
918
  bounces: boolean;
905
919
  pagingEnabled: boolean;
920
+ scrollEventThrottle: number;
906
921
  refreshing: boolean;
907
922
  }, {}, {}, {}, string, _vue_runtime_core.ComponentProvideOptions, true, {}, any>;
908
923
 
@@ -912,6 +927,9 @@ declare const VScrollView: _vue_runtime_core.DefineComponent<_vue_runtime_core.E
912
927
  * Maps to UIImageView on iOS. Loads images from URIs asynchronously
913
928
  * with built-in caching. Supports various resize modes.
914
929
  *
930
+ * Exposes a reactive `loading` ref (via template ref) that is `true`
931
+ * while the image is being fetched and `false` once it loads or errors.
932
+ *
915
933
  * @example
916
934
  * ```vue
917
935
  * <VImage
@@ -1306,6 +1324,9 @@ interface WebViewSource {
1306
1324
  /**
1307
1325
  * Embedded web view component backed by WKWebView.
1308
1326
  *
1327
+ * URI sources are validated to block dangerous schemes such as `javascript:`
1328
+ * and `data:text/html` which could lead to XSS.
1329
+ *
1309
1330
  * @example
1310
1331
  * <VWebView :source="{ uri: 'https://example.com' }" style="flex: 1" @load="onLoad" />
1311
1332
  */
@@ -2179,6 +2200,8 @@ declare function useHaptics(): {
2179
2200
  * Async key-value storage composable backed by UserDefaults.
2180
2201
  *
2181
2202
  * All operations are Promise-based and run on a background thread.
2203
+ * Write operations (setItem, removeItem) are serialized per key to
2204
+ * prevent race conditions from concurrent access.
2182
2205
  *
2183
2206
  * @example
2184
2207
  * ```ts
@@ -3474,8 +3497,13 @@ declare class NativeBridgeImpl {
3474
3497
  private eventHandlers;
3475
3498
  /** Pending async callbacks from native module invocations */
3476
3499
  private pendingCallbacks;
3477
- /** Auto-incrementing callback ID for async native module calls */
3500
+ /** Auto-incrementing callback ID for async native module calls.
3501
+ * Wraps around at MAX_SAFE_CALLBACK_ID to prevent overflow. */
3478
3502
  private nextCallbackId;
3503
+ /** Maximum callback ID before wraparound (safe for 32-bit signed int) */
3504
+ private static readonly MAX_CALLBACK_ID;
3505
+ /** Maximum number of pending callbacks before evicting the oldest */
3506
+ private static readonly MAX_PENDING_CALLBACKS;
3479
3507
  /** Global event listeners: eventName -> Set of callbacks */
3480
3508
  private globalEventHandlers;
3481
3509
  /**
package/dist/index.d.ts CHANGED
@@ -602,6 +602,10 @@ declare const VButton: _vue_runtime_core.DefineComponent<_vue_runtime_core.Extra
602
602
  * The component maps `modelValue` to the native `text` prop and listens
603
603
  * for `changetext` events from the native side to update the model.
604
604
  *
605
+ * Handles CJK IME composition correctly: during composition, model updates
606
+ * are deferred until the user commits the composed character to avoid
607
+ * v-model desync.
608
+ *
605
609
  * @example
606
610
  * ```vue
607
611
  * <VInput
@@ -845,6 +849,11 @@ declare const VScrollView: _vue_runtime_core.DefineComponent<_vue_runtime_core.E
845
849
  default: boolean;
846
850
  };
847
851
  contentContainerStyle: PropType<ViewStyle>;
852
+ /** Minimum interval in ms between scroll event emissions. Default: 16 (~60fps) */
853
+ scrollEventThrottle: {
854
+ type: NumberConstructor;
855
+ default: number;
856
+ };
848
857
  /** Whether the pull-to-refresh indicator is active */
849
858
  refreshing: {
850
859
  type: BooleanConstructor;
@@ -883,6 +892,11 @@ declare const VScrollView: _vue_runtime_core.DefineComponent<_vue_runtime_core.E
883
892
  default: boolean;
884
893
  };
885
894
  contentContainerStyle: PropType<ViewStyle>;
895
+ /** Minimum interval in ms between scroll event emissions. Default: 16 (~60fps) */
896
+ scrollEventThrottle: {
897
+ type: NumberConstructor;
898
+ default: number;
899
+ };
886
900
  /** Whether the pull-to-refresh indicator is active */
887
901
  refreshing: {
888
902
  type: BooleanConstructor;
@@ -903,6 +917,7 @@ declare const VScrollView: _vue_runtime_core.DefineComponent<_vue_runtime_core.E
903
917
  scrollEnabled: boolean;
904
918
  bounces: boolean;
905
919
  pagingEnabled: boolean;
920
+ scrollEventThrottle: number;
906
921
  refreshing: boolean;
907
922
  }, {}, {}, {}, string, _vue_runtime_core.ComponentProvideOptions, true, {}, any>;
908
923
 
@@ -912,6 +927,9 @@ declare const VScrollView: _vue_runtime_core.DefineComponent<_vue_runtime_core.E
912
927
  * Maps to UIImageView on iOS. Loads images from URIs asynchronously
913
928
  * with built-in caching. Supports various resize modes.
914
929
  *
930
+ * Exposes a reactive `loading` ref (via template ref) that is `true`
931
+ * while the image is being fetched and `false` once it loads or errors.
932
+ *
915
933
  * @example
916
934
  * ```vue
917
935
  * <VImage
@@ -1306,6 +1324,9 @@ interface WebViewSource {
1306
1324
  /**
1307
1325
  * Embedded web view component backed by WKWebView.
1308
1326
  *
1327
+ * URI sources are validated to block dangerous schemes such as `javascript:`
1328
+ * and `data:text/html` which could lead to XSS.
1329
+ *
1309
1330
  * @example
1310
1331
  * <VWebView :source="{ uri: 'https://example.com' }" style="flex: 1" @load="onLoad" />
1311
1332
  */
@@ -2179,6 +2200,8 @@ declare function useHaptics(): {
2179
2200
  * Async key-value storage composable backed by UserDefaults.
2180
2201
  *
2181
2202
  * All operations are Promise-based and run on a background thread.
2203
+ * Write operations (setItem, removeItem) are serialized per key to
2204
+ * prevent race conditions from concurrent access.
2182
2205
  *
2183
2206
  * @example
2184
2207
  * ```ts
@@ -3474,8 +3497,13 @@ declare class NativeBridgeImpl {
3474
3497
  private eventHandlers;
3475
3498
  /** Pending async callbacks from native module invocations */
3476
3499
  private pendingCallbacks;
3477
- /** Auto-incrementing callback ID for async native module calls */
3500
+ /** Auto-incrementing callback ID for async native module calls.
3501
+ * Wraps around at MAX_SAFE_CALLBACK_ID to prevent overflow. */
3478
3502
  private nextCallbackId;
3503
+ /** Maximum callback ID before wraparound (safe for 32-bit signed int) */
3504
+ private static readonly MAX_CALLBACK_ID;
3505
+ /** Maximum number of pending callbacks before evicting the oldest */
3506
+ private static readonly MAX_PENDING_CALLBACKS;
3479
3507
  /** Global event listeners: eventName -> Set of callbacks */
3480
3508
  private globalEventHandlers;
3481
3509
  /**