@vnejs/shared 0.0.16 → 0.1.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.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type { VneModule, VneModuleClass, VneNamespace, VnePluginConstants, VnePluginConstantsMap, VnePluginConstantsMapRegistry, VnePluginConstantsRegistry, VnePluginEvents, VnePluginEventsMap, VnePluginEventsMapRegistry, VnePluginEventsRegistry, VnePluginParams, VnePluginParamsMap, VnePluginParamsMapRegistry, VnePluginParamsRegistry, VnePluginSettings, VnePluginSettingsMap, VnePluginSettingsMapRegistry, VnePluginSettingsRegistry, VnePluginShape, VneRegistry, } from "./types.js";
1
+ export type { VneModule, VneModuleClass, VneNamespace, VnePluginConstants, VnePluginConstantsMap, VnePluginConstantsMapRegistry, VnePluginConstantsRegistry, VnePluginEvents, VnePluginEventsMap, VnePluginEventsMapRegistry, VnePluginEventsRegistry, VnePluginParams, VnePluginParamsMap, VnePluginParamsMapRegistry, VnePluginParamsRegistry, VnePluginSettings, VnePluginSettingsMap, VnePluginSettingsMapRegistry, VnePluginSettingsRegistry, VnePluginShape, VneRegistry, Widen, } from "./types.js";
2
2
  import type { VneModuleClass, VneNamespace, VnePluginShape, VneRegistry } from "./types.js";
3
3
  export declare const VNE_MODULES: VneModuleClass[];
4
4
  export declare const VNE: VneRegistry;
package/dist/types.d.ts CHANGED
@@ -17,6 +17,10 @@
17
17
  * // Namespace and event keys may be unset until regPlugin runs:
18
18
  * VNE.EVENTS.STORAGE?.CLEAR
19
19
  */
20
+ /** Makes PARAMS default values mutable at runtime; numbers and booleans keep a wide primitive type. */
21
+ export type Widen<T> = T extends (...args: infer A) => infer R ? (...args: A) => R : T extends number ? number : T extends boolean ? boolean : T extends readonly (infer U)[] ? Widen<U>[] : T extends object ? {
22
+ -readonly [K in keyof T]: Widen<T[K]>;
23
+ } : T;
20
24
  export interface VnePluginConstantsMap {
21
25
  }
22
26
  export interface VnePluginEventsMap {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/shared",
3
- "version": "0.0.16",
3
+ "version": "0.1.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -20,6 +20,7 @@ export type {
20
20
  VnePluginSettingsRegistry,
21
21
  VnePluginShape,
22
22
  VneRegistry,
23
+ Widen,
23
24
  } from "./types.js";
24
25
 
25
26
  import type { VneModuleClass, VneNamespace, VnePluginShape, VneRegistry } from "./types.js";
package/src/types.ts CHANGED
@@ -17,6 +17,19 @@
17
17
  * // Namespace and event keys may be unset until regPlugin runs:
18
18
  * VNE.EVENTS.STORAGE?.CLEAR
19
19
  */
20
+ /** Makes PARAMS default values mutable at runtime; numbers and booleans keep a wide primitive type. */
21
+ export type Widen<T> = T extends (...args: infer A) => infer R
22
+ ? (...args: A) => R
23
+ : T extends number
24
+ ? number
25
+ : T extends boolean
26
+ ? boolean
27
+ : T extends readonly (infer U)[]
28
+ ? Widen<U>[]
29
+ : T extends object
30
+ ? { -readonly [K in keyof T]: Widen<T[K]> }
31
+ : T;
32
+
20
33
  export interface VnePluginConstantsMap {}
21
34
  export interface VnePluginEventsMap {}
22
35
  export interface VnePluginSettingsMap {}