ivue 1.0.3 → 1.0.4

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 (101) hide show
  1. package/README.md +23 -7
  2. package/coverage/clover.xml +156 -156
  3. package/coverage/coverage-final.json +1 -1
  4. package/coverage/index.html +17 -17
  5. package/coverage/index.ts.html +70 -85
  6. package/dist/index.es.js +74 -90
  7. package/dist/index.umd.js +1 -1
  8. package/dist/src/index.d.ts +1 -199
  9. package/dist/src/ivue.d.ts +218 -0
  10. package/docs/docs/.vitepress/config.ts +94 -29
  11. package/docs/docs/.vitepress/dist/404.html +4 -4
  12. package/docs/docs/.vitepress/dist/api/ivue.html +6 -6
  13. package/docs/docs/.vitepress/dist/api/propsWithDefaults.html +6 -6
  14. package/docs/docs/.vitepress/dist/assets/{app.CbDr3eFe.js → app.ConZRsN0.js} +1 -1
  15. package/docs/docs/.vitepress/dist/assets/chunks/@localSearchIndexroot.CGLWArGd.js +1 -0
  16. package/docs/docs/.vitepress/dist/assets/chunks/{VPLocalSearchBox.C1TPvqwb.js → VPLocalSearchBox.C7VDyivS.js} +1 -1
  17. package/docs/docs/.vitepress/dist/assets/chunks/index.es.DnWLDAUc.js +1 -0
  18. package/docs/docs/.vitepress/dist/assets/chunks/{theme.DSY3Mj9W.js → theme.B7n-r1TY.js} +2 -2
  19. package/docs/docs/.vitepress/dist/assets/index.md.wPLoTLBY.js +1 -0
  20. package/docs/docs/.vitepress/dist/assets/index.md.wPLoTLBY.lean.js +1 -0
  21. package/docs/docs/.vitepress/dist/assets/pages_advanced-usage.md.BZgX-VP7.js +1 -0
  22. package/docs/docs/.vitepress/dist/assets/pages_advanced-usage.md.BZgX-VP7.lean.js +1 -0
  23. package/docs/docs/.vitepress/dist/assets/pages_api.md.C_PvCZns.js +7 -0
  24. package/docs/docs/.vitepress/dist/assets/pages_api.md.C_PvCZns.lean.js +7 -0
  25. package/docs/docs/.vitepress/dist/assets/pages_browse-code.md.CPluoaap.js +1 -0
  26. package/docs/docs/.vitepress/dist/assets/pages_browse-code.md.CPluoaap.lean.js +1 -0
  27. package/docs/docs/.vitepress/dist/assets/pages_getting-started.md.knQcOZyP.js +8 -0
  28. package/docs/docs/.vitepress/dist/assets/pages_getting-started.md.knQcOZyP.lean.js +1 -0
  29. package/docs/docs/.vitepress/dist/assets/pages_guidelines.md.DddPdPom.js +101 -0
  30. package/docs/docs/.vitepress/dist/assets/pages_guidelines.md.DddPdPom.lean.js +101 -0
  31. package/docs/docs/.vitepress/dist/assets/pages_how-it-works.md.OJGcGEXF.js +4 -0
  32. package/docs/docs/.vitepress/dist/assets/pages_how-it-works.md.OJGcGEXF.lean.js +4 -0
  33. package/docs/docs/.vitepress/dist/assets/pages_how-its-made.md.Vv9Z9TEi.js +1 -0
  34. package/docs/docs/.vitepress/dist/assets/pages_how-its-made.md.Vv9Z9TEi.lean.js +1 -0
  35. package/docs/docs/.vitepress/dist/assets/pages_introduction.md.DrDm-R8F.js +1 -0
  36. package/docs/docs/.vitepress/dist/assets/pages_introduction.md.DrDm-R8F.lean.js +1 -0
  37. package/docs/docs/.vitepress/dist/assets/pages_usage.md.zSOVjtFF.js +430 -0
  38. package/docs/docs/.vitepress/dist/assets/pages_usage.md.zSOVjtFF.lean.js +430 -0
  39. package/docs/docs/.vitepress/dist/assets/style.Fgx7OB_D.css +1 -0
  40. package/docs/docs/.vitepress/dist/hashmap.json +1 -1
  41. package/docs/docs/.vitepress/dist/index.html +7 -7
  42. package/docs/docs/.vitepress/dist/pages/advanced-usage.html +24 -0
  43. package/docs/docs/.vitepress/dist/pages/api.html +30 -0
  44. package/docs/docs/.vitepress/dist/pages/browse-code.html +24 -0
  45. package/docs/docs/.vitepress/dist/pages/getting-started.html +8 -8
  46. package/docs/docs/.vitepress/dist/pages/guidelines.html +125 -0
  47. package/docs/docs/.vitepress/dist/pages/how-it-works.html +10 -7
  48. package/docs/docs/.vitepress/dist/pages/how-its-made.html +24 -0
  49. package/docs/docs/.vitepress/dist/pages/introduction.html +7 -7
  50. package/docs/docs/.vitepress/dist/pages/usage.html +230 -74
  51. package/docs/docs/.vitepress/theme/index.js +5 -0
  52. package/docs/docs/.vitepress/theme/main.css +29 -0
  53. package/docs/docs/components/Button.vue +1 -1
  54. package/docs/docs/components/guidelines/CounterExternalRefsDetailed.vue +41 -0
  55. package/docs/docs/components/{examples → usage}/CounterBasic.vue +1 -1
  56. package/docs/docs/components/{examples → usage}/CounterComposables.vue +4 -5
  57. package/docs/docs/components/usage/CounterComposablesDestructuring.vue +46 -0
  58. package/docs/docs/components/usage/CounterComputeds.vue +25 -0
  59. package/docs/docs/components/usage/CounterComputedsDisabled.vue +32 -0
  60. package/docs/docs/components/{examples → usage}/CounterDefineExpose.vue +1 -1
  61. package/docs/docs/components/usage/CounterDefineExposeAdvanced.vue +25 -0
  62. package/docs/docs/components/{examples → usage}/CounterExternalRefs.vue +2 -2
  63. package/docs/docs/components/usage/CounterInsideComposables.vue +27 -0
  64. package/docs/docs/components/{examples → usage}/CounterInternalRefs.vue +1 -1
  65. package/docs/docs/components/usage/CounterLifecycleHooks.vue +22 -0
  66. package/docs/docs/components/usage/CounterWatch.vue +25 -0
  67. package/docs/docs/components/{examples → usage}/CounterWithProps.vue +1 -1
  68. package/docs/docs/components/{examples → usage}/CounterWithPropsAndEmits.vue +1 -1
  69. package/docs/docs/components/usage/functions/useMouse.ts +22 -0
  70. package/docs/docs/index.md +7 -6
  71. package/docs/docs/pages/advanced-usage.md +11 -0
  72. package/docs/docs/pages/api.md +106 -0
  73. package/docs/docs/pages/browse-code.md +18 -0
  74. package/docs/docs/pages/getting-started.md +14 -0
  75. package/docs/docs/pages/guidelines.md +128 -0
  76. package/docs/docs/pages/how-it-works.md +71 -0
  77. package/docs/docs/pages/how-its-made.md +32 -0
  78. package/docs/docs/pages/introduction.md +30 -21
  79. package/docs/docs/pages/usage.md +178 -50
  80. package/docs/package.json +2 -2
  81. package/package.json +4 -2
  82. package/src/__tests__/ivue.vitest.spec.ts +228 -132
  83. package/src/index.ts +1 -461
  84. package/src/ivue.ts +495 -0
  85. package/vite.config.ts +4 -0
  86. package/docs/.env +0 -1
  87. package/docs/docs/.vitepress/dist/assets/chunks/@localSearchIndexroot.xSEJiuF6.js +0 -1
  88. package/docs/docs/.vitepress/dist/assets/index.md.CktQD561.js +0 -1
  89. package/docs/docs/.vitepress/dist/assets/index.md.CktQD561.lean.js +0 -1
  90. package/docs/docs/.vitepress/dist/assets/pages_getting-started.md.COGFS1PH.js +0 -8
  91. package/docs/docs/.vitepress/dist/assets/pages_getting-started.md.COGFS1PH.lean.js +0 -1
  92. package/docs/docs/.vitepress/dist/assets/pages_how-it-works.md.DEn1nBQc.js +0 -1
  93. package/docs/docs/.vitepress/dist/assets/pages_how-it-works.md.DEn1nBQc.lean.js +0 -1
  94. package/docs/docs/.vitepress/dist/assets/pages_introduction.md.UHEKhynF.js +0 -1
  95. package/docs/docs/.vitepress/dist/assets/pages_introduction.md.UHEKhynF.lean.js +0 -1
  96. package/docs/docs/.vitepress/dist/assets/pages_usage.md.B75xObUi.js +0 -275
  97. package/docs/docs/.vitepress/dist/assets/pages_usage.md.B75xObUi.lean.js +0 -275
  98. package/docs/docs/.vitepress/dist/assets/style.DamVQLpl.css +0 -1
  99. package/docs/docs/components/examples/CounterComposablesDestructuring.vue +0 -66
  100. package/vitest.config.ts.timestamp-1723424289354-74cf8d2d72cb7.mjs +0 -162
  101. /package/docs/docs/components/{examples → usage}/CounterDefineExposeClass.ts +0 -0
package/src/ivue.ts ADDED
@@ -0,0 +1,495 @@
1
+ /* eslint-disable @typescript-eslint/ban-types */
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
+ import type {
4
+ ComputedRef,
5
+ ExtractPropTypes,
6
+ ToRef,
7
+ UnwrapNestedRefs,
8
+ } from 'vue';
9
+ import { UnwrapRef, computed, reactive, ref, toRef } from 'vue';
10
+
11
+ /** Types */
12
+ /**
13
+ * IVue core reactive instance type with an extended .toRefs() method added.
14
+ */
15
+ export type IVue<T extends AnyClass> = InstanceType<T> & ExtendWithToRefs<T>;
16
+
17
+ /**
18
+ * Extend with .toRefs() method, so that a reactive class can be converted to a composable definition.
19
+ */
20
+ export interface ExtendWithToRefs<T extends AnyClass> {
21
+ toRefs: IVueToRefsFn<T>;
22
+ }
23
+
24
+ /**
25
+ * .toRefs() method type definition converts reactive class properties to composable .value properties.
26
+ */
27
+ export type IVueToRefsFn<T extends AnyClass> = (
28
+ props?: (keyof InstanceType<T>)[]
29
+ ) => IVueRefs<InstanceType<T>>;
30
+
31
+ /**
32
+ * Converts a class properties to a composable .value Refs using ToRef vue type,
33
+ * also knows NOT to convert functions to .value Refs but to leave them as is.
34
+ */
35
+ export type IVueRefs<T = any> = {
36
+ [K in keyof T]: T[K] extends Function ? T[K] : ToRef<T[K]>;
37
+ };
38
+
39
+ /**
40
+ * Unwraps the returned Refs of composable method T to a reactive type definition.
41
+ */
42
+ export type UseComposableReturn<T extends Object> = {
43
+ [K in keyof T]: T[K] extends { value: any }
44
+ ? T[K]['value'] // Handle Ref
45
+ : T[K]; // Handle property
46
+ };
47
+
48
+ export type UseComposable<T extends (...args: any[]) => any> =
49
+ UseComposableReturn<ReturnType<T>>;
50
+
51
+ /**
52
+ * Extracts object defined emit types by converting them to a plain interface
53
+ */
54
+ export type ExtractEmitTypes<T extends Record<string, any>> =
55
+ UnionToIntersection<
56
+ RecordToUnion<{
57
+ [K in keyof T]: (evt: K, ...args: Parameters<T[K]>) => void;
58
+ }>
59
+ >;
60
+
61
+ /**
62
+ * Extract properties as all assigned properties because they have defaults.
63
+ */
64
+ export type ExtractPropDefaultTypes<O> = {
65
+ [K in keyof O]: ValueOf<ExtractPropTypes<O>, K>;
66
+ };
67
+
68
+ /**
69
+ * Extend slots interface T with prefixed 'before--' & 'after--' slots to create fully extensible flexible slots.
70
+ */
71
+ export type ExtendSlots<T> = PrefixKeys<T, 'before--'> &
72
+ T &
73
+ PrefixKeys<T, 'after--'>;
74
+
75
+ /** Helper Types. */
76
+ /**
77
+ * Any JavaScript class of any type.
78
+ */
79
+ export type AnyClass = abstract new (...args: any[]) => any;
80
+
81
+ /**
82
+ * Descriptors map.
83
+ */
84
+ export type Descriptors = Map<string, PropertyDescriptor>;
85
+
86
+ /**
87
+ * Computeds hash map.
88
+ */
89
+ export type Computeds = Record<string, ComputedRef>;
90
+
91
+ /**
92
+ * Infer paramaters of a constructor function of a Class.
93
+ */
94
+ export type InferredArgs<T> = T extends { new (...args: infer P): any }
95
+ ? P
96
+ : never[];
97
+
98
+ /**
99
+ * Prefix keys of an interface T with a prefix P.
100
+ */
101
+ export type PrefixKeys<T, P extends string | undefined = undefined> = {
102
+ [K in Extract<keyof T, string> as P extends string ? `${P}${K}` : K]: T[K];
103
+ };
104
+
105
+ /**
106
+ * Get Interface's property's function arguments Parmeters<F>
107
+ */
108
+ export type IFnParameters<
109
+ T extends Record<any, any>,
110
+ K extends string
111
+ > = Parameters<Required<Pick<T, K>>[K]>;
112
+
113
+ /**
114
+ * Get Interface's [T] property's [P] function arguments Parmeters<F> parameter by key [K]
115
+ */
116
+ export type IFnParameter<
117
+ T extends Record<any, any>,
118
+ P extends keyof T,
119
+ K extends number
120
+ > = FnParameter<ValueOf<T, P>, K>;
121
+
122
+ /**
123
+ * Get function arguments Parmeters<F> parameter by key K
124
+ */
125
+ export type FnParameter<
126
+ F extends (...args: any[]) => any,
127
+ K extends number
128
+ > = Parameters<F>[K];
129
+
130
+ /**
131
+ * Convert Union Type to Intersection Type.
132
+ */
133
+ export type UnionToIntersection<U> = (
134
+ U extends any ? (k: U) => void : never
135
+ ) extends (k: infer I) => void
136
+ ? I
137
+ : never;
138
+
139
+ /**
140
+ * Convert Record to Union Type.
141
+ */
142
+ export type RecordToUnion<T extends Record<string, any>> = T[keyof T];
143
+
144
+ /**
145
+ * Gets object T property by key [K].
146
+ */
147
+ export type ValueOf<T extends Record<any, any>, K> = T[K];
148
+ /** Types End. */
149
+
150
+ /**
151
+ * Store all descriptors for each class prototype processed by
152
+ * @see {getAllClassDescriptors}
153
+ */
154
+ export const descriptorsMap = new Map();
155
+
156
+ /**
157
+ * Get descriptors of an entire class prototype chain as a Map.
158
+ * Completely emulates JavaScript class inheritance chain for getters and setters.
159
+ *
160
+ * @param className
161
+ * @return {Descriptors}
162
+ */
163
+ export function getAllClassDescriptors(className: AnyClass): Descriptors {
164
+ /* Retrieve descriptors from cache */
165
+ if (descriptorsMap.has(className)) {
166
+ return descriptorsMap.get(className);
167
+ }
168
+
169
+ const savedDescriptors: Descriptors = new Map();
170
+
171
+ let prototype = className.prototype;
172
+ while (prototype.constructor !== Object) {
173
+ Object.entries(Object.getOwnPropertyDescriptors(prototype)).forEach(
174
+ ([propertyName, currentDescriptor]) => {
175
+ const savedDescriptor = savedDescriptors.get(propertyName);
176
+ /** Emulate inheritance chain of getters and setters. */
177
+ if (
178
+ savedDescriptor !== currentDescriptor &&
179
+ (currentDescriptor?.get || currentDescriptor?.set)
180
+ ) {
181
+ /** Overwrite descriptors if they were already set. */
182
+ if (savedDescriptor?.get)
183
+ currentDescriptor.get = savedDescriptor?.get;
184
+ if (savedDescriptor?.set)
185
+ currentDescriptor.set = savedDescriptor?.set;
186
+
187
+ /** Store descriptors. */
188
+ savedDescriptors.set(propertyName, currentDescriptor);
189
+ }
190
+ }
191
+ );
192
+ /** Walk up the prototype chain. */
193
+ prototype = Object.getPrototypeOf(prototype);
194
+ }
195
+
196
+ /** Save descriptors in the descriptors map for each class. */
197
+ descriptorsMap.set(className, savedDescriptors);
198
+
199
+ return savedDescriptors;
200
+ }
201
+
202
+ /**
203
+ * Infinite Vue (ivue) class reactive initializer.
204
+ *
205
+ * Converts class instance to a reactive object,
206
+ * where descriptors are converted to computeds.
207
+ *
208
+ * You can turn off computed behaviour by adding static
209
+ * ivue object and setting the getter props to false.
210
+ * class ClassName {
211
+ * static ivue = {
212
+ * getter: false
213
+ * }
214
+ * // .getter -> will be a standard JS non-computed getter
215
+ * get getter () { return 'hello world'; }
216
+ * }
217
+ *
218
+ * @param className Any Class
219
+ * @param args Class constructor arguments that you would pass to a `new AnyClass(args...)`
220
+ * @returns {IVue<T>}
221
+ */
222
+ export function ivue<T extends AnyClass>(
223
+ className: T,
224
+ ...args: InferredArgs<T>
225
+ ): IVue<T> {
226
+ const descriptors: Descriptors = getAllClassDescriptors(className);
227
+ const computeds: Computeds | any = descriptors?.size ? {} : null;
228
+
229
+ // @ts-expect-error Abstract class initialization
230
+ const vue = reactive(new className(...args));
231
+
232
+ /** Setup descriptors as computeds. */
233
+ for (const [prop, descriptor] of descriptors) {
234
+ /* If prop exists on static getter className.ivue[prop]
235
+ * We do not convert it to computed. Because sometimes
236
+ * we want a normal getter. */
237
+ if ((className as any)?.ivue?.[prop] === false) continue;
238
+ /** Convert descriptor to computed. */
239
+ Object.defineProperty(vue, prop, {
240
+ get: descriptor.get
241
+ ? () =>
242
+ prop in computeds
243
+ ? /** Get the existing computed, because we are in reactive scope, .value will auto unwrap itself. */
244
+ computeds[prop]
245
+ : /** Create the computed and return it, because we are in reactive scope, .value will auto unwrap itself. */
246
+ (computeds[prop] = computed({
247
+ get: descriptor.get?.bind(vue) as any,
248
+ set: descriptor.set?.bind(vue),
249
+ } as any))
250
+ : undefined,
251
+ set: descriptor.set?.bind(vue),
252
+ enumerable: false,
253
+ });
254
+ }
255
+
256
+ Object.defineProperty(vue, 'toRefs', {
257
+ get: () => ivueToRefs(vue, descriptors as Descriptors, computeds),
258
+ enumerable: false,
259
+ });
260
+
261
+ /** Run ivue .init() initializer method, if it exists in the class. */
262
+ if ('init' in vue) vue.init();
263
+
264
+ return vue;
265
+ }
266
+
267
+ /**
268
+ * Store all props for each class prototype processed by:
269
+ * @see {getAllClassProperties}
270
+ */
271
+ export const propsMap: Map<object, Set<string> | any> = new Map();
272
+
273
+ /**
274
+ * Get properties of an entire class prototype chain as a Map.
275
+ */
276
+ export function getAllClassProperties(obj: object): Set<string> {
277
+ /* Retrieve props from cache */
278
+ if (propsMap.has(obj.constructor)) {
279
+ return propsMap.get(obj.constructor);
280
+ }
281
+
282
+ const originalConstructor = obj.constructor;
283
+
284
+ const allProps: Set<string> = new Set();
285
+ do {
286
+ Object.getOwnPropertyNames(obj).forEach((prop) => {
287
+ /* 'caller', 'callee', 'arguments', 'constructor' are
288
+ * special object properties, so should be skipped. */
289
+ if (!['caller', 'callee', 'arguments', 'constructor'].includes(prop)) {
290
+ allProps.add(prop);
291
+ }
292
+ });
293
+ obj = Object.getPrototypeOf(obj);
294
+ } while (obj.constructor !== Object);
295
+
296
+ /** Save props in the props map. */
297
+ propsMap.set(originalConstructor, allProps);
298
+
299
+ return allProps;
300
+ }
301
+
302
+ /**
303
+ * `iref` is an unwrapped type alias for Vue ref() function.
304
+ * `iref` does not alter the behavior of ref(), but simply
305
+ * transforms the type to an unwrapped ref value.
306
+ * @param val
307
+ * @returns
308
+ */
309
+ export function iref<T>(val?: T): UnwrapRef<T> {
310
+ return ref(val) as unknown as UnwrapRef<T>;
311
+ }
312
+
313
+ /**
314
+ * `iuse` stands for composable.
315
+ * Returns unwrapped composable type definition without the Refs.
316
+ */
317
+ export function iuse<T extends Object>(
318
+ val?: T
319
+ ): UseComposableReturn<UnwrapNestedRefs<T>> {
320
+ return val as unknown as UseComposableReturn<UnwrapNestedRefs<T>>;
321
+ }
322
+
323
+ /**
324
+ * Convert reactive ivue class to Vue 3 refs.
325
+ *
326
+ * @param vue @see IVue
327
+ * @param descriptors @see Descriptors
328
+ * @param computeds @see Computeds
329
+ * @returns {ExtendWithToRefs<T>['toRefs']}
330
+ */
331
+ export function ivueToRefs<T extends AnyClass>(
332
+ vue: IVue<T>,
333
+ descriptors: Descriptors,
334
+ computeds: Computeds
335
+ ): ExtendWithToRefs<T>['toRefs'] {
336
+ return function (
337
+ props?: (keyof InstanceType<T>)[]
338
+ ): IVueRefs<InstanceType<T>> {
339
+ /** Resulting refs store. */
340
+ const result: Record<string | number | symbol, any> = {};
341
+
342
+ /** Output specific props only, if props are specified. */
343
+ if (Array.isArray(props) && props.length) {
344
+ for (let i = 0; i < props.length; i++) {
345
+ const prop = props[i] as any;
346
+ /** Handle descriptors. */
347
+ if (descriptors.has(prop)) {
348
+ if (prop in computeds) {
349
+ /** Return vue computed with .value from computeds store. */
350
+ result[prop] = computeds[prop];
351
+ } else {
352
+ /** Initialize & store vue computed. */
353
+ const descriptor = descriptors.get(prop);
354
+ result[prop] = computeds[prop] = computed({
355
+ get: descriptor?.get?.bind(vue) as any,
356
+ set: descriptor?.set?.bind(vue),
357
+ } as any);
358
+ }
359
+ } else {
360
+ /** Handle methods. */
361
+ if (typeof vue[prop] === 'function') {
362
+ /** Bind method to vue, makes method destructuring point to right instance. */
363
+ result[prop] = vue[prop].bind(vue);
364
+ } else {
365
+ /** Convert simple reactive prop to a Ref. */
366
+ result[prop] = toRef(vue, prop);
367
+ }
368
+ }
369
+ }
370
+ } else {
371
+ /** Convert all props to refs and leave functions as is. */
372
+ let allProps: null | Set<string> = new Set(getAllClassProperties(vue));
373
+
374
+ /** Convert descriptors (non enumerable by default in JS). */
375
+ descriptors.forEach((descriptor, prop) => {
376
+ if (prop in computeds) {
377
+ /** Return vue computed with .value from computeds store. */
378
+ result[prop] = computeds[prop];
379
+ } else {
380
+ /** Initialize vue computed ref & store it in result. */
381
+ result[prop] = computeds[prop] = computed({
382
+ get: descriptor.get?.bind(vue) as any,
383
+ set: descriptor.set?.bind(vue),
384
+ } as any);
385
+ }
386
+ /** Delete descriptor from props as it was already processed. */
387
+ allProps?.delete(prop as string);
388
+ });
389
+
390
+ allProps.forEach((prop) => {
391
+ if (typeof vue[prop] === 'function') {
392
+ /** Bind method to vue, makes method destructuring point to right instance. */
393
+ result[prop] = vue[prop].bind(vue);
394
+ } else {
395
+ /** Convert simple reactive prop to a Ref. */
396
+ result[prop] = toRef(vue, prop);
397
+ }
398
+ });
399
+
400
+ /** Memory optimization. */
401
+ allProps = null;
402
+ }
403
+
404
+ return result as IVueRefs<InstanceType<T>>;
405
+ };
406
+ }
407
+
408
+ /**
409
+ * Vue props interface in defineComponent() style.
410
+ */
411
+ export type VuePropsObject = Record<
412
+ string,
413
+ { type: any; default?: any; required?: boolean }
414
+ >;
415
+
416
+ /**
417
+ * Vue Props with default properties declared as existing and having values.
418
+ */
419
+ export type VuePropsWithDefaults<T extends VuePropsObject> = {
420
+ [K in keyof T]: {
421
+ type: T[K]['type'];
422
+ default: T[K]['default'];
423
+ required?: boolean;
424
+ };
425
+ };
426
+
427
+ /**
428
+ * Determines if the value is a JavaScript Class.
429
+ * Note that class is a class function in JavaScript.
430
+ *
431
+ * @param val Any value
432
+ * @returns boolean If it's a JavaScript Class returns true
433
+ */
434
+ export function isClass(val: any): boolean {
435
+ if (typeof val !== 'function') return false; // Not a function, so not a class function either
436
+
437
+ if (!val.prototype) return false; // Arrow function, so not a class
438
+
439
+ // Finally -> distinguish between a normal function and a class function
440
+ if (Object.getOwnPropertyDescriptor(val, 'prototype')?.writable) {
441
+ // Has writable prototype
442
+ return false; // Normal function
443
+ } else {
444
+ return true; // Class -> Not a function
445
+ }
446
+ }
447
+
448
+ /**
449
+ * Creates props with defaults in defineComponent() style.
450
+ *
451
+ * Merge defaults regular object with Vue types object
452
+ * declared in defineComponent() style.
453
+ *
454
+ * This is made so that the defaults can be declared "as they are"
455
+ * without requiring objects to be function callbacks returning an object.
456
+ *
457
+ * // You don't need to wrap objects in () => ({ nest: { nest :{} } })
458
+ * // You can just delcare them normally.
459
+ * const defaults = {
460
+ * nest: {
461
+ * nest
462
+ * }
463
+ * }
464
+ *
465
+ * This function will create the Vue expected callbacks for Objects, Arrays & Classes
466
+ * but leave primitive properties and functions intact so that
467
+ * the final object is fully defineComponent() style compatible.
468
+ *
469
+ * @param defaults Regular object of default key -> values
470
+ * @param typedProps Props declared in defineComponent() style with type and possibly required declared, but without default
471
+ * @returns Props declared in defineComponent() style with all properties having default property declared.
472
+ */
473
+ export function propsWithDefaults<T extends VuePropsObject>(
474
+ defaults: Record<string, any>,
475
+ typedProps: T
476
+ ): VuePropsWithDefaults<T> {
477
+ for (const prop in typedProps) {
478
+ if (typeof defaults?.[prop] === 'object' && defaults?.[prop] !== null) {
479
+ /** Handle Arrays & Objects -> wrap them with an arrow function. */
480
+ typedProps[prop].default = () => defaults?.[prop];
481
+ } else {
482
+ if (isClass(defaults?.[prop])) {
483
+ /** Handle JavaScript Classes -> wrap them with an arrow function */
484
+ typedProps[prop].default = () => defaults?.[prop];
485
+ } else {
486
+ /** Handle JavaScript Function And All primitive properties -> output directly */
487
+ typedProps[prop].default = defaults?.[prop];
488
+ }
489
+ }
490
+ }
491
+ return typedProps as VuePropsWithDefaults<T>;
492
+ }
493
+
494
+ /** Necessary ivue.ts to be treated as a module. */
495
+ export {};
package/vite.config.ts CHANGED
@@ -5,6 +5,7 @@ import vue from '@vitejs/plugin-vue'
5
5
  import dts from "vite-plugin-dts";
6
6
  import pkg from "./package.json";
7
7
  import libCss from 'vite-plugin-libcss';
8
+ import { terser } from 'rollup-plugin-terser';
8
9
 
9
10
  export const vueDocsPlugin = () => ({
10
11
  name: "vue-docs",
@@ -45,6 +46,9 @@ export default defineConfig({
45
46
  },
46
47
  rollupOptions: {
47
48
  external: ["vue"],
49
+ plugins:[
50
+ terser()
51
+ ],
48
52
  output: {
49
53
  globals: {
50
54
  vue: "Vue"
package/docs/.env DELETED
@@ -1 +0,0 @@
1
- BASE="/ivue/"
@@ -1 +0,0 @@
1
- const e='{"documentCount":29,"nextId":29,"documentIds":{"0":"/ivue/#documentation","1":"/ivue/#about","2":"/ivue/#features","3":"/ivue/#next-step","4":"/ivue/pages/getting-started.html#getting-started","5":"/ivue/pages/getting-started.html#install","6":"/ivue/pages/introduction.html#what-is-infinite-vue-ivue","7":"/ivue/pages/introduction.html#the-problem-ivue-aims-to-solve","8":"/ivue/pages/introduction.html#classes-are-back-with-full-vue-3-compatibility-beyond","9":"/ivue/pages/introduction.html#infinite-vue-achitecture","10":"/ivue/pages/introduction.html#when-to-use-infinite-vue","11":"/ivue/pages/usage.html#example-usage","12":"/ivue/pages/usage.html#basic-usage","13":"/ivue/pages/usage.html#result","14":"/ivue/pages/usage.html#using-props","15":"/ivue/pages/usage.html#result-1","16":"/ivue/pages/usage.html#using-emits","17":"/ivue/pages/usage.html#result-2","18":"/ivue/pages/usage.html#using-refs","19":"/ivue/pages/usage.html#refs-defined-outside-of-ivue","20":"/ivue/pages/usage.html#result-3","21":"/ivue/pages/usage.html#refs-defined-inside-of-ivue-class","22":"/ivue/pages/usage.html#result-4","23":"/ivue/pages/usage.html#using-define-expose","24":"/ivue/pages/usage.html#result-5","25":"/ivue/pages/usage.html#using-composables","26":"/ivue/pages/usage.html#result-6","27":"/ivue/pages/usage.html#destructuring-composable-into-the-class","28":"/ivue/pages/usage.html#result-7"},"fieldIds":{"title":0,"titles":1,"text":2},"fieldLength":{"0":[1,1,1],"1":[1,1,30],"2":[1,1,53],"3":[2,1,3],"4":[2,1,1],"5":[1,2,26],"6":[6,1,1],"7":[6,6,136],"8":[10,6,68],"9":[3,6,84],"10":[6,6,34],"11":[2,1,22],"12":[2,2,47],"13":[2,3,53],"14":[2,2,70],"15":[2,4,1],"16":[2,2,89],"17":[2,4,1],"18":[2,2,1],"19":[5,4,62],"20":[2,4,1],"21":[6,4,76],"22":[2,4,1],"23":[3,2,67],"24":[2,5,8],"25":[2,2,65],"26":[2,4,1],"27":[5,4,128],"28":[2,4,1]},"averageFieldLength":[2.9655172413793105,3.0689655172413794,39],"storedFields":{"0":{"title":"Documentation","titles":[]},"1":{"title":"About","titles":["Documentation"]},"2":{"title":"Features","titles":["Documentation"]},"3":{"title":"Next Step","titles":["Documentation"]},"4":{"title":"Getting Started","titles":[]},"5":{"title":"Install","titles":["Getting Started"]},"6":{"title":"What is Infinite Vue (ivue) ?","titles":[]},"7":{"title":"The Problem ivue Aims to Solve","titles":["What is Infinite Vue (ivue) ?"]},"8":{"title":"Classes are Back with Full Vue 3 Compatibility &amp; Beyond","titles":["What is Infinite Vue (ivue) ?"]},"9":{"title":"Infinite Vue Achitecture","titles":["What is Infinite Vue (ivue) ?"]},"10":{"title":"When to use Infinite Vue?","titles":["What is Infinite Vue (ivue) ?"]},"11":{"title":"Example Usage","titles":[]},"12":{"title":"Basic Usage","titles":["Example Usage"]},"13":{"title":"Result:","titles":["Example Usage","Basic Usage"]},"14":{"title":"Using Props","titles":["Example Usage"]},"15":{"title":"Result:","titles":["Example Usage","Using Props"]},"16":{"title":"Using Emits","titles":["Example Usage"]},"17":{"title":"Result:","titles":["Example Usage","Using Emits"]},"18":{"title":"Using Refs","titles":["Example Usage"]},"19":{"title":"Refs Defined Outside of ivue","titles":["Example Usage","Using Refs"]},"20":{"title":"Result:","titles":["Example Usage","Using Refs"]},"21":{"title":"Refs Defined Inside of ivue class","titles":["Example Usage","Using Refs"]},"22":{"title":"Result:","titles":["Example Usage","Using Refs"]},"23":{"title":"Using Define Expose","titles":["Example Usage"]},"24":{"title":"Result:","titles":["Example Usage","Using Define Expose"]},"25":{"title":"Using Composables","titles":["Example Usage"]},"26":{"title":"Result:","titles":["Example Usage","Using Composables"]},"27":{"title":"Destructuring composable into the class","titles":["Example Usage","Using Composables"]},"28":{"title":"Result:","titles":["Example Usage","Using Composables"]}},"dirtCount":0,"index":[["keyof",{"2":{"27":1}}],["k",{"2":{"27":4}}],["know",{"2":{"7":1,"13":1}}],["x",{"2":{"25":2,"27":11}}],["x3c",{"2":{"12":6,"14":7,"16":13,"19":13,"21":11,"23":16,"25":11,"27":26}}],["`",{"2":{"21":2}}],["`const",{"2":{"21":2}}],["|",{"2":{"19":1,"21":1,"23":1}}],["5",{"2":{"16":1}}],["+",{"2":{"16":1,"19":1,"21":1,"27":2}}],[">click",{"2":{"27":1}}],[">",{"2":{"16":2,"19":2,"21":2,"23":6,"25":2,"27":6}}],[">increment",{"2":{"12":1,"14":1,"16":1,"19":1,"21":1,"25":1,"27":1}}],["0",{"2":{"12":2,"14":2,"16":2,"19":2,"21":2,"23":1,"25":2,"27":3}}],["=>",{"2":{"12":1,"14":1,"16":1,"19":1,"21":1,"25":1,"27":4}}],["=",{"2":{"12":2,"13":2,"14":4,"16":5,"19":5,"21":7,"23":3,"25":3,"27":9}}],["just",{"2":{"9":1}}],["javascript",{"2":{"9":1,"12":1,"13":1,"14":1,"16":1,"19":1,"21":1,"25":1,"27":1}}],["looping",{"2":{"21":1}}],["latter",{"2":{"13":1}}],["lang=",{"2":{"12":1,"14":1,"16":2,"19":1,"21":1,"23":2,"25":1,"27":1}}],["lack",{"2":{"8":1}}],["leaving",{"2":{"9":1}}],["like",{"2":{"8":1,"12":1,"14":1,"16":1,"19":1,"21":1,"23":1,"25":1,"27":1}}],["2",{"2":{"8":1}}],["rather",{"2":{"7":1}}],["return",{"2":{"27":2}}],["returntype",{"2":{"27":4}}],["returns",{"2":{"9":1}}],["related",{"2":{"14":1,"16":1,"23":1,"25":1,"27":1}}],["resulting",{"2":{"27":1}}],["result",{"0":{"13":1,"15":1,"17":1,"20":1,"22":1,"24":1,"26":1,"28":1}}],["rest",{"2":{"9":1}}],["ref=",{"2":{"19":1,"21":1}}],["ref",{"2":{"12":2,"14":2,"16":2,"19":3,"21":3,"23":5,"24":2,"25":2,"27":5}}],["refs",{"0":{"18":1,"19":1,"21":1},"1":{"19":1,"20":1,"21":1,"22":1},"2":{"10":1,"27":1}}],["refer",{"2":{"7":1,"13":1}}],["readable",{"2":{"13":1}}],["read",{"2":{"9":1}}],["ready",{"2":{"2":1}}],["reaches",{"2":{"7":1}}],["reactivity",{"2":{"7":1}}],["reactive",{"2":{"7":1,"9":2,"10":1}}],["reactvity",{"2":{"7":1}}],["react",{"2":{"7":1,"8":1}}],["regular",{"2":{"1":1}}],["method",{"2":{"9":1,"13":2,"27":2}}],["minimum",{"2":{"9":1}}],["minimal",{"2":{"9":1}}],["mimicks",{"2":{"9":1}}],["mitigates",{"2":{"7":1}}],["mitigate",{"2":{"7":1}}],["mdash",{"2":{"7":3,"8":4}}],["main",{"2":{"9":1}}],["make",{"2":{"7":1}}],["makes",{"2":{"7":1}}],["macros",{"2":{"7":1}}],["may",{"2":{"7":1}}],["mouse",{"2":{"25":4,"27":1}}],["more",{"2":{"7":2,"9":1,"13":1,"21":1}}],["moved",{"2":{"7":1,"8":1}}],["model",{"2":{"2":1}}],["he",{"2":{"27":1}}],["href=",{"2":{"12":1,"14":1,"16":1,"19":1,"21":1,"25":1,"27":1}}],["highlighted",{"2":{"14":1,"16":1,"23":1,"25":1,"27":1}}],["high",{"2":{"10":1}}],["htmlelement",{"2":{"19":2,"21":2}}],["html",{"2":{"7":1}}],["https",{"2":{"7":1}}],["handle",{"2":{"27":2}}],["have",{"2":{"13":1}}],["having",{"2":{"7":1}}],["has",{"2":{"7":2,"8":1,"13":1}}],["hooks",{"2":{"7":1}}],["performant",{"2":{"21":1}}],["public",{"2":{"14":1,"16":2,"19":1}}],["pure",{"2":{"8":1}}],["preferred",{"2":{"13":1}}],["principle",{"2":{"11":1}}],["principles",{"2":{"11":1}}],["properties",{"2":{"27":2}}],["property",{"2":{"21":1,"27":1}}],["props",{"0":{"14":1},"1":{"15":1},"2":{"2":1,"7":1,"14":5,"16":4}}],["prototype",{"2":{"9":1}}],["procedural",{"2":{"8":2}}],["process",{"2":{"7":1}}],["programming",{"2":{"7":1,"8":1}}],["providing",{"2":{"7":1}}],["provides",{"2":{"2":1}}],["problem",{"0":{"7":1}}],["production",{"2":{"2":1}}],["parent",{"2":{"23":2,"24":2}}],["page",{"2":{"9":1}}],["pass",{"2":{"9":1,"14":1,"16":1}}],["possible",{"2":{"7":1}}],["pnpm",{"2":{"5":2}}],["y",{"2":{"25":2,"27":11}}],["yarn",{"2":{"5":2}}],["yourcomposablefunctionname>",{"2":{"27":1}}],["your",{"2":{"5":1,"10":1}}],["you",{"2":{"1":1,"7":2,"8":1,"9":1,"11":1,"13":2,"14":1,"16":1,"21":1}}],["gt",{"2":{"13":2}}],["guide",{"2":{"7":1}}],["greater",{"2":{"7":1}}],["getters",{"2":{"9":2}}],["getting",{"0":{"4":1},"1":{"5":1}}],["get",{"2":{"5":1,"27":1}}],["gzipped",{"2":{"2":1}}],["opaque",{"2":{"9":1}}],["options",{"2":{"7":3}}],["objectives",{"2":{"8":1}}],["object",{"2":{"7":1,"9":4,"10":1,"13":1,"27":1}}],["outside",{"0":{"19":1}}],["out",{"2":{"7":1}}],["onincrement",{"2":{"16":2}}],["on",{"2":{"11":1,"27":2}}],["one",{"2":{"7":1}}],["only",{"2":{"2":1,"5":1,"7":1,"21":1}}],["own",{"2":{"7":1,"8":1}}],["offers",{"2":{"7":1}}],["of",{"0":{"19":1,"21":1},"2":{"7":8,"8":2,"9":1,"10":2,"13":1,"21":2}}],["oriented",{"2":{"7":1}}],["org",{"2":{"7":1}}],["or",{"2":{"3":1,"10":1,"13":1,"21":1}}],["null>",{"2":{"23":1}}],["null",{"2":{"19":1,"21":2,"23":1}}],["number>",{"2":{"27":2}}],["number",{"2":{"12":1,"14":2,"16":4,"19":1,"21":1,"23":1,"25":1,"27":3}}],["now",{"2":{"16":1}}],["notice",{"2":{"13":1,"14":1,"16":1}}],["not",{"2":{"7":1,"8":4,"13":1}}],["natural",{"2":{"10":1}}],["native",{"2":{"9":2}}],["need",{"2":{"11":1,"14":1,"16":1}}],["needed",{"2":{"9":1}}],["next",{"0":{"3":1}}],["npm",{"2":{"5":2}}],["nbsp",{"2":{"3":2,"7":3,"8":4}}],["ndash",{"2":{"1":1,"2":13}}],["1234567891011",{"2":{"23":1}}],["123456789101112tsimport",{"2":{"23":1}}],["1234567891011121314151617181920",{"2":{"25":1}}],["1234567891011121314151617181920212223242526",{"2":{"21":1}}],["12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273",{"2":{"27":1}}],["123456789101112131415161718192021222324252627282930313233343536",{"2":{"16":1}}],["1234567891011121314151617181920212223242526272829",{"2":{"14":1}}],["12345678910111213141516171819202122232425",{"2":{"19":1}}],["1234567891011121314151617",{"2":{"12":1}}],["1",{"2":{"19":1,"21":2}}],["1kb",{"2":{"2":1}}],["100",{"2":{"2":1}}],["zero",{"2":{"2":1}}],["up",{"2":{"9":1}}],["utility",{"2":{"7":1,"27":1}}],["unwrap",{"2":{"27":1}}],["unwrapref",{"2":{"27":4}}],["unwrapcomposable",{"2":{"25":2,"27":3}}],["unwrapped",{"2":{"10":1,"27":3}}],["unknown",{"2":{"12":1,"14":1,"16":1,"19":2,"21":2,"23":1,"25":2,"27":2}}],["understand",{"2":{"11":1}}],["underlying",{"2":{"8":1}}],["unifies",{"2":{"7":1}}],["unlocks",{"2":{"1":1}}],["usage",{"0":{"11":1,"12":1},"1":{"12":1,"13":2,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1},"2":{"25":1,"27":1}}],["usemouse>",{"2":{"25":1,"27":1}}],["usemouse",{"2":{"25":2,"27":11}}],["uses",{"2":{"7":1,"14":1,"16":1}}],["use",{"0":{"10":1},"2":{"7":2,"8":1,"13":3,"21":1,"27":1}}],["used",{"2":{"2":1}}],["using",{"0":{"14":1,"16":1,"18":1,"23":1,"25":1},"1":{"15":1,"17":1,"19":1,"20":1,"21":1,"22":1,"24":1,"26":1,"27":1,"28":1},"2":{"5":1,"8":1,"9":2,"10":1,"11":1}}],["verbose",{"2":{"13":1}}],["very",{"2":{"10":1,"11":1}}],["void",{"2":{"12":1,"14":1,"16":2,"19":1,"21":1,"25":1,"27":1}}],["via",{"2":{"7":1,"23":2,"24":2}}],["view",{"2":{"2":1}}],["variables",{"2":{"7":1}}],["value",{"2":{"2":1,"7":1,"10":1,"16":2,"23":2,"27":4}}],["vueuse",{"2":{"25":1,"27":1}}],["vuecounterdefineexposeclass",{"2":{"23":1}}],["vuejs",{"2":{"7":1}}],["vue",{"0":{"6":1,"8":1,"9":1,"10":1},"1":{"7":1,"8":1,"9":1,"10":1},"2":{"1":4,"2":1,"5":1,"7":2,"8":2,"9":1,"12":3,"14":3,"16":4,"19":4,"21":4,"23":3,"25":4,"27":4}}],["big",{"2":{"27":1}}],["bind",{"2":{"13":1}}],["br",{"2":{"23":1,"25":1,"27":3}}],["brings",{"2":{"7":1}}],["bound",{"2":{"13":1}}],["both",{"2":{"2":1,"7":1}}],["built",{"2":{"12":1}}],["build",{"2":{"8":1}}],["button>",{"2":{"23":1,"27":1}}],["button",{"2":{"23":3,"27":3}}],["but",{"2":{"7":1,"11":1,"13":1,"21":1}}],["below",{"2":{"11":1}}],["because",{"2":{"10":1,"13":1,"21":1}}],["become",{"2":{"10":1}}],["becomes",{"2":{"10":1,"27":2}}],["behavior",{"2":{"8":1}}],["beyond",{"0":{"8":1}}],["be",{"2":{"2":1,"9":3,"13":1,"27":3}}],["bad",{"2":{"8":1}}],["back",{"0":{"8":1},"2":{"7":1}}],["background",{"2":{"2":1}}],["basic",{"0":{"12":1},"1":{"13":1}}],["base",{"2":{"8":1}}],["based",{"2":{"1":2,"7":1}}],["bash",{"2":{"5":1}}],["by",{"2":{"2":1,"9":2}}],["different",{"2":{"8":1}}],["discontinued",{"2":{"7":1}}],["doing",{"2":{"9":1}}],["does",{"2":{"7":1,"8":3}}],["downsides",{"2":{"7":2}}],["documentation",{"0":{"0":1},"1":{"1":1,"2":1,"3":1}}],["dx",{"2":{"2":1}}],["default",{"2":{"23":1}}],["defaults",{"2":{"2":1,"7":1}}],["define",{"0":{"23":1},"1":{"24":1}}],["defineemits",{"2":{"16":1}}],["defineexposeref",{"2":{"23":3}}],["defineexpose",{"2":{"16":1,"19":1,"23":2}}],["defineprops",{"2":{"14":1,"16":1}}],["defined",{"0":{"19":1,"21":1},"2":{"13":1}}],["deal",{"2":{"10":1}}],["dealing",{"2":{"2":1}}],["destructured",{"2":{"27":3}}],["destructuring",{"0":{"27":1},"2":{"27":1}}],["descriptors",{"2":{"9":1}}],["designs",{"2":{"8":1}}],["design",{"2":{"2":1}}],["decrement",{"2":{"23":5,"24":1}}],["decorators",{"2":{"8":1}}],["decided",{"2":{"8":1}}],["development",{"2":{"7":3}}],["dependency",{"2":{"5":1}}],["dependencies",{"2":{"2":1}}],["will",{"2":{"27":3}}],["with",{"0":{"8":1},"2":{"2":2,"7":4,"8":3,"9":1,"10":1,"12":1}}],["would",{"2":{"13":1}}],["work",{"2":{"7":1}}],["we",{"2":{"9":1,"12":1,"14":1,"16":1,"19":1,"21":2,"23":1,"25":1,"27":1}}],["weaknesses",{"2":{"8":1}}],["were",{"2":{"7":1}}],["was",{"2":{"7":1,"13":1}}],["way",{"2":{"1":1,"13":1}}],["whole",{"2":{"9":1}}],["when",{"0":{"10":1},"2":{"7":1,"10":1,"13":1}}],["which",{"2":{"7":2}}],["while",{"2":{"7":1,"8":1}}],["what",{"0":{"6":1},"1":{"7":1,"8":1,"9":1,"10":1}}],["few",{"2":{"11":1}}],["features",{"0":{"2":1}}],["failed",{"2":{"8":2}}],["function",{"2":{"9":3,"13":1,"16":1,"23":2,"27":4}}],["functions",{"2":{"7":1,"27":1}}],["fully",{"2":{"7":1}}],["full",{"0":{"8":1},"2":{"2":1}}],["flexibility",{"2":{"7":1}}],["from",{"2":{"7":1,"8":1,"12":2,"14":2,"16":2,"19":2,"21":2,"23":5,"24":2,"25":3,"27":3}}],["footsteps",{"2":{"7":1}}],["following",{"2":{"7":1}}],["for",{"2":{"1":2,"2":1,"5":1,"12":1,"14":1,"16":1,"19":1,"21":1,"23":1,"25":1,"27":1}}],["emit",{"2":{"16":4}}],["emits",{"0":{"16":1},"1":{"17":1},"2":{"2":1,"7":1}}],["e",{"2":{"16":1}}],["either",{"2":{"13":1}}],["each",{"2":{"11":1}}],["easy",{"2":{"5":1}}],["everything",{"2":{"10":1}}],["even",{"2":{"7":1}}],["ecosystems",{"2":{"7":1}}],["ecosystem",{"2":{"7":1,"8":1}}],["export",{"2":{"23":1}}],["exportable",{"2":{"7":1}}],["expose",{"0":{"23":1},"1":{"24":1}}],["expanding",{"2":{"11":1}}],["examples",{"2":{"11":1}}],["example",{"0":{"11":1},"1":{"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1},"2":{"12":2,"13":1,"14":1,"16":1,"19":1,"21":1,"23":1,"25":1,"27":1}}],["extras",{"2":{"7":1}}],["extensible",{"2":{"2":5,"7":3}}],["extends",{"2":{"27":2}}],["extending",{"2":{"9":1}}],["extend",{"2":{"1":1}}],["except",{"2":{"2":1}}],["elegantly",{"2":{"2":1}}],["elegant",{"2":{"1":1,"2":1}}],["sum",{"2":{"27":12}}],["supporting",{"2":{"9":1}}],["support",{"2":{"2":1}}],["span>",{"2":{"19":1,"21":1}}],["span",{"2":{"19":6,"21":9}}],["spanref>",{"2":{"19":1}}],["spanref",{"2":{"19":3}}],["script>",{"2":{"12":1,"14":1,"16":2,"19":1,"21":1,"23":2,"25":1,"27":1}}],["script",{"2":{"12":1,"14":1,"16":2,"19":1,"21":1,"23":2,"25":1,"27":1}}],["scallable",{"2":{"7":1}}],["scalability",{"2":{"1":1}}],["same",{"2":{"8":1}}],["sections",{"2":{"14":1,"16":1,"23":1,"25":1,"27":1}}],["setup",{"2":{"16":1,"23":1}}],["setup>",{"2":{"12":1,"14":1,"16":1,"19":1,"21":1,"23":1,"25":1,"27":1}}],["setters",{"2":{"9":1}}],["set",{"2":{"7":1}}],["seamlessly",{"2":{"7":1}}],["see",{"2":{"7":1,"11":1,"13":1,"14":1,"16":1,"23":1,"25":1,"27":1}}],["some",{"2":{"7":1}}],["solve",{"0":{"7":1}}],["so",{"2":{"5":1,"7":1,"9":1,"13":1}}],["string",{"2":{"19":1,"21":1}}],["structure",{"2":{"9":1}}],["strength",{"2":{"8":1}}],["strengths",{"2":{"7":1}}],["started",{"0":{"4":1},"1":{"5":1},"2":{"5":1}}],["step",{"0":{"3":1}}],["store",{"2":{"2":1}}],["simply",{"2":{"10":1,"13":1}}],["simple",{"2":{"1":1,"2":1,"11":1}}],["size",{"2":{"2":1,"7":1}}],["slots",{"2":{"2":1,"7":1}}],["t>>",{"2":{"27":3}}],["t>",{"2":{"27":1}}],["t",{"2":{"27":1}}],["typeof",{"2":{"25":1,"27":2}}],["type",{"2":{"19":1,"27":3}}],["types",{"2":{"7":1,"14":1,"16":1}}],["typescript",{"2":{"2":2,"9":2,"14":1,"16":1}}],["ts",{"2":{"12":1,"14":1,"16":2,"19":1,"21":1,"23":3,"25":1,"27":1}}],["true",{"2":{"8":1}}],["transform",{"2":{"7":2}}],["turned",{"2":{"7":1}}],["template>",{"2":{"12":2,"14":2,"16":4,"19":4,"21":4,"23":4,"25":4,"27":4}}],["terminal",{"2":{"5":1}}],["tested",{"2":{"2":1}}],["through",{"2":{"21":1}}],["this",{"2":{"12":3,"14":5,"16":7,"19":5,"21":5,"23":4,"25":3,"27":11}}],["thus",{"2":{"9":1}}],["though",{"2":{"8":1}}],["those",{"2":{"7":1}}],["their",{"2":{"7":1}}],["them",{"2":{"7":1,"21":1}}],["the",{"0":{"7":1,"27":1},"2":{"1":1,"2":1,"5":1,"7":8,"8":2,"9":9,"11":1,"12":1,"13":3,"14":4,"16":4,"19":1,"21":1,"23":2,"25":2,"27":5}}],["that",{"2":{"1":1,"8":1,"10":1,"13":2,"14":2,"16":2,"27":3}}],["total",{"2":{"27":10}}],["too",{"2":{"13":1}}],["torefs",{"2":{"9":2,"21":3}}],["to",{"0":{"7":1,"10":1},"2":{"1":1,"5":1,"7":7,"8":2,"9":10,"10":1,"11":1,"13":6,"14":4,"16":4,"23":1,"25":1,"27":3}}],["3",{"0":{"8":1},"2":{"1":3,"2":1,"5":1,"7":1,"8":2,"9":1}}],["choice",{"2":{"10":1}}],["chain",{"2":{"9":1}}],["caveat",{"2":{"13":1}}],["called",{"2":{"9":1}}],["cannot",{"2":{"13":1}}],["can",{"2":{"2":1,"7":1,"8":1,"9":2,"10":1,"21":1}}],["core",{"2":{"25":1,"27":1}}],["correct",{"2":{"14":1,"16":1}}],["count=",{"2":{"16":1}}],["count++",{"2":{"12":1,"14":1,"16":1,"19":1,"21":1,"23":1,"25":1,"27":1}}],["count",{"2":{"12":3,"14":4,"16":7,"19":4,"21":4,"23":4,"25":3,"27":3}}],["countercomposablesdestructuring",{"2":{"27":2}}],["countercomposables",{"2":{"25":2}}],["counterdefineexposeclass",{"2":{"23":2}}],["counterdefineexpose",{"2":{"23":2}}],["counterinternalrefs",{"2":{"21":2}}],["counter>",{"2":{"19":1,"23":1}}],["counterexternalrefs",{"2":{"19":2}}],["counteremits>",{"2":{"16":1}}],["counteremits",{"2":{"16":2}}],["counterprops>",{"2":{"14":1,"16":1}}],["counterprops",{"2":{"14":2,"16":2}}],["counterwithpropsandemits",{"2":{"16":2}}],["counterwithprops",{"2":{"14":1}}],["counterbasic",{"2":{"12":1}}],["counter",{"2":{"12":6,"13":6,"14":5,"16":5,"19":6,"21":8,"23":6,"25":7,"27":9}}],["construct",{"2":{"27":2}}],["constructor",{"2":{"9":1,"14":2,"16":2,"19":1,"27":1}}],["const",{"2":{"12":1,"14":2,"16":3,"19":2,"21":2,"23":2,"25":1,"27":4}}],["convert",{"2":{"9":1}}],["converted",{"2":{"9":2}}],["comes",{"2":{"8":1}}],["computed",{"2":{"27":3}}],["computeds",{"2":{"9":1}}],["compatibility",{"0":{"8":1}}],["complexity",{"2":{"10":2}}],["complex",{"2":{"7":1}}],["component",{"2":{"12":1,"14":1,"16":1,"19":1,"21":1,"23":5,"24":4,"25":1,"27":1}}],["components",{"2":{"2":2,"8":3,"10":1}}],["composability",{"2":{"7":1}}],["composables",{"0":{"25":1},"1":{"26":1,"27":1,"28":1},"2":{"7":1}}],["composable",{"0":{"27":1},"2":{"1":1,"9":2,"25":1,"27":2}}],["composition",{"2":{"7":5,"8":1,"9":1}}],["create",{"2":{"7":1}}],["certain",{"2":{"7":1}}],["click=",{"2":{"12":1,"14":1,"16":1,"19":1,"21":1,"23":2,"25":1,"27":2}}],["clunky",{"2":{"7":1}}],["class=",{"2":{"27":1}}],["classname",{"2":{"14":1,"16":1}}],["classic",{"2":{"12":1}}],["classical",{"2":{"9":1}}],["classes",{"0":{"8":1},"2":{"2":1,"8":2}}],["class",{"0":{"21":1,"27":1},"2":{"1":1,"2":1,"7":1,"8":3,"9":2,"12":1,"13":2,"14":1,"16":1,"19":1,"21":1,"23":1,"25":1,"27":4}}],["a>",{"2":{"12":1,"14":1,"16":1,"19":1,"21":1,"25":1,"27":1}}],["abstracted",{"2":{"10":1}}],["able",{"2":{"9":1}}],["about",{"0":{"1":1},"2":{"9":1}}],["achitecture",{"0":{"9":1}}],["achieve",{"2":{"8":1}}],["argument",{"2":{"14":1,"16":1}}],["arguments",{"2":{"9":2}}],["args",{"2":{"14":1,"16":1,"27":1}}],["arrow",{"2":{"13":1}}],["are",{"0":{"8":1},"2":{"8":1,"9":1,"21":1,"27":1}}],["architecture",{"2":{"1":1,"2":1,"7":1,"9":1}}],["against",{"2":{"7":1}}],["amp",{"0":{"8":1},"2":{"7":2}}],["attempt",{"2":{"7":1}}],["any>",{"2":{"27":1}}],["any",{"2":{"27":1}}],["an",{"2":{"7":1,"9":1,"13":1}}],["and",{"2":{"1":1,"2":1,"7":9,"8":3,"9":4,"27":1}}],["away",{"2":{"7":1,"10":1}}],["app",{"2":{"7":1,"10":1}}],["apps",{"2":{"1":1,"7":1}}],["api",{"2":{"7":7,"9":1}}],["aims",{"0":{"7":1},"2":{"9":1}}],["adds",{"2":{"9":1}}],["add",{"2":{"5":1}}],["as",{"2":{"2":1,"7":1,"8":1,"9":1,"12":2,"13":1,"14":2,"16":2,"19":5,"21":5,"23":2,"25":4,"27":5}}],["alert",{"2":{"16":1}}],["alter",{"2":{"8":1}}],["also",{"2":{"7":1,"8":2}}],["all",{"2":{"7":1,"21":1}}],["allow",{"2":{"7":1}}],["allows",{"2":{"1":1,"9":1}}],["aligned",{"2":{"2":1}}],["a",{"2":{"1":2,"2":2,"7":2,"8":1,"9":4,"10":2,"11":1,"12":1,"13":2,"14":1,"16":1,"19":1,"21":1,"25":1,"27":1}}],["if",{"2":{"9":1}}],["import",{"2":{"12":2,"14":2,"16":2,"19":2,"21":2,"23":2,"25":3,"27":3}}],["implemented",{"2":{"9":1}}],["implementation",{"2":{"9":1}}],["implementations",{"2":{"8":2}}],["improves",{"2":{"2":1}}],["i",{"2":{"5":2}}],["innerhtml",{"2":{"19":1,"21":1}}],["increment=",{"2":{"16":1}}],["increment",{"2":{"12":2,"13":4,"14":2,"16":4,"19":2,"21":2,"23":5,"24":1,"25":2,"27":2}}],["initial",{"2":{"16":1}}],["initialcount",{"2":{"14":2,"16":2}}],["initialize",{"2":{"12":1,"14":1,"16":1,"19":1,"21":1,"23":1,"25":1,"27":1}}],["initializer",{"2":{"9":3}}],["init",{"2":{"9":1}}],["instead",{"2":{"21":1}}],["install",{"0":{"5":1},"2":{"5":1}}],["inside",{"0":{"21":1},"2":{"9":1,"27":1}}],["infer",{"2":{"9":1,"14":1,"16":1}}],["infinite",{"0":{"6":1,"9":1,"10":1},"1":{"7":1,"8":1,"9":1,"10":1},"2":{"1":2}}],["inherit",{"2":{"8":1}}],["inheritance",{"2":{"8":1,"9":1}}],["into",{"0":{"27":1},"2":{"27":3}}],["interface",{"2":{"14":1,"16":2}}],["internal",{"2":{"9":1}}],["interoperate",{"2":{"9":1}}],["interoperable",{"2":{"7":1}}],["introduction",{"2":{"7":1}}],["in",{"2":{"1":1,"2":2,"5":1,"7":1,"8":2,"9":1,"10":1,"27":1}}],["its",{"2":{"7":2,"8":3}}],["it",{"2":{"1":1,"5":1,"7":2,"8":2,"9":1,"13":2}}],["issues",{"2":{"7":2}}],["is",{"0":{"6":1},"1":{"7":1,"8":1,"9":1,"10":1},"2":{"1":1,"5":2,"7":2,"8":2,"10":2,"11":1,"13":2,"16":1,"21":1}}],["ivue",{"0":{"6":1,"7":1,"19":1,"21":1},"1":{"7":1,"8":1,"9":1,"10":1},"2":{"1":1,"5":5,"7":4,"8":5,"9":5,"10":2,"11":1,"12":4,"14":4,"16":4,"19":3,"21":3,"23":3,"25":3,"27":3}}]],"serializationVersion":2}';export{e as default};
@@ -1 +0,0 @@
1
- import{_ as e}from"./chunks/Button.vue_vue_type_script_setup_true_lang.P7niV-n8.js";import{d as a,c as n,I as t,a as r,a5 as o,o as i}from"./chunks/framework.CNtPHGsN.js";const s=o('<h1 id="documentation" tabindex="-1">Documentation <a class="header-anchor" href="#documentation" aria-label="Permalink to &quot;Documentation&quot;">​</a></h1><h2 id="about" tabindex="-1">About <a class="header-anchor" href="#about" aria-label="Permalink to &quot;About&quot;">​</a></h2><p><strong>Infinite Vue – ivue</strong> is a class based composable architecture for Vue 3, that unlocks infinite scalability for Vue 3 based apps. It allows you to extend the regular Vue 3 in a simple and elegant way.</p><h2 id="features" tabindex="-1">Features <a class="header-anchor" href="#features" aria-label="Permalink to &quot;Features&quot;">​</a></h2><div style="padding-left:20px;"> – Simple &amp; Elegant Architecture<br> – Extensible Classes aligned with TypeScript Class design<br> – Extensible Props Defaults<br> – Extensible Emits<br> – Extensible Slots<br> – Extensible Components<br> – Improves DX by elegantly dealing with .value in the background<br> – Can be used both as a Store and a View Model for Components<br> – Provides Full TypeScript Support<br> – 100% Tested<br> – Zero dependencies except Vue 3<br> – Only 1kb(gzipped) in size!<br> – Production Ready<br></div><h2 id="next-step" tabindex="-1">Next Step <a class="header-anchor" href="#next-step" aria-label="Permalink to &quot;Next Step&quot;">​</a></h2>',6),h=JSON.parse('{"title":"Documentation","description":"","frontmatter":{},"headers":[],"relativePath":"index.md","filePath":"index.md"}'),l={name:"index.md"},m=a({...l,setup(d){return(c,u)=>(i(),n("div",null,[s,t(e,{href:"/pages/getting-started.html",label:"Geting Started"}),r("   or   "),t(e,{href:"/pages/introduction.html",label:"Read Introduction"})]))}});export{h as __pageData,m as default};
@@ -1 +0,0 @@
1
- import{_ as e}from"./chunks/Button.vue_vue_type_script_setup_true_lang.P7niV-n8.js";import{d as a,c as n,I as t,a as r,a5 as o,o as i}from"./chunks/framework.CNtPHGsN.js";const s=o('<h1 id="documentation" tabindex="-1">Documentation <a class="header-anchor" href="#documentation" aria-label="Permalink to &quot;Documentation&quot;">​</a></h1><h2 id="about" tabindex="-1">About <a class="header-anchor" href="#about" aria-label="Permalink to &quot;About&quot;">​</a></h2><p><strong>Infinite Vue – ivue</strong> is a class based composable architecture for Vue 3, that unlocks infinite scalability for Vue 3 based apps. It allows you to extend the regular Vue 3 in a simple and elegant way.</p><h2 id="features" tabindex="-1">Features <a class="header-anchor" href="#features" aria-label="Permalink to &quot;Features&quot;">​</a></h2><div style="padding-left:20px;"> – Simple &amp; Elegant Architecture<br> – Extensible Classes aligned with TypeScript Class design<br> – Extensible Props Defaults<br> – Extensible Emits<br> – Extensible Slots<br> – Extensible Components<br> – Improves DX by elegantly dealing with .value in the background<br> – Can be used both as a Store and a View Model for Components<br> – Provides Full TypeScript Support<br> – 100% Tested<br> – Zero dependencies except Vue 3<br> – Only 1kb(gzipped) in size!<br> – Production Ready<br></div><h2 id="next-step" tabindex="-1">Next Step <a class="header-anchor" href="#next-step" aria-label="Permalink to &quot;Next Step&quot;">​</a></h2>',6),h=JSON.parse('{"title":"Documentation","description":"","frontmatter":{},"headers":[],"relativePath":"index.md","filePath":"index.md"}'),l={name:"index.md"},m=a({...l,setup(d){return(c,u)=>(i(),n("div",null,[s,t(e,{href:"/pages/getting-started.html",label:"Geting Started"}),r("   or   "),t(e,{href:"/pages/introduction.html",label:"Read Introduction"})]))}});export{h as __pageData,m as default};
@@ -1,8 +0,0 @@
1
- import{_ as s,c as a,o as i,a5 as t}from"./chunks/framework.CNtPHGsN.js";const _=JSON.parse('{"title":"Getting Started","description":"","frontmatter":{},"headers":[],"relativePath":"pages/getting-started.md","filePath":"pages/getting-started.md"}'),e={name:"pages/getting-started.md"},n=t(`<h1 id="getting-started" tabindex="-1">Getting Started <a class="header-anchor" href="#getting-started" aria-label="Permalink to &quot;Getting Started&quot;">​</a></h1><h2 id="install" tabindex="-1">Install <a class="header-anchor" href="#install" aria-label="Permalink to &quot;Install&quot;">​</a></h2><p>The only dependency for <code>ivue</code> is Vue 3, so it is easy to get started.</p><p>In your terminal install <code>ivue</code> using:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># yarn</span></span>
2
- <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">yarn</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> add</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ivue</span></span>
3
- <span class="line"></span>
4
- <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># npm</span></span>
5
- <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">npm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> i</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ivue</span></span>
6
- <span class="line"></span>
7
- <span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># pnpm</span></span>
8
- <span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">pnpm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> i</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ivue</span></span></code></pre></div>`,5),l=[n];function p(h,r,d,o,c,k){return i(),a("div",null,l)}const F=s(e,[["render",p]]);export{_ as __pageData,F as default};
@@ -1 +0,0 @@
1
- import{_ as s,c as a,o as i,a5 as t}from"./chunks/framework.CNtPHGsN.js";const _=JSON.parse('{"title":"Getting Started","description":"","frontmatter":{},"headers":[],"relativePath":"pages/getting-started.md","filePath":"pages/getting-started.md"}'),e={name:"pages/getting-started.md"},n=t("",5),l=[n];function p(h,r,d,o,c,k){return i(),a("div",null,l)}const F=s(e,[["render",p]]);export{_ as __pageData,F as default};
@@ -1 +0,0 @@
1
- import{_ as e,c as t,o}from"./chunks/framework.CNtPHGsN.js";const m=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"pages/how-it-works.md","filePath":"pages/how-it-works.md"}'),a={name:"pages/how-it-works.md"};function s(r,c,n,p,i,_){return o(),t("div")}const f=e(a,[["render",s]]);export{m as __pageData,f as default};
@@ -1 +0,0 @@
1
- import{_ as e,c as t,o}from"./chunks/framework.CNtPHGsN.js";const m=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"pages/how-it-works.md","filePath":"pages/how-it-works.md"}'),a={name:"pages/how-it-works.md"};function s(r,c,n,p,i,_){return o(),t("div")}const f=e(a,[["render",s]]);export{m as __pageData,f as default};