@razaman2/reactive-view 0.1.0-beta.15 → 0.1.0-beta.17

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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2021 razamvmt
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2021 razamvmt
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1 +1 @@
1
- # reactive-view
1
+ # reactive-view
@@ -0,0 +1,48 @@
1
+ import { type ComponentPublicInstance, type SetupContext } from "vue";
2
+ export declare const setup: {
3
+ type: FunctionConstructor;
4
+ default: (_parent?: {}, self?: {}) => {};
5
+ ReactiveView: boolean;
6
+ };
7
+ declare const _default: {
8
+ props: {
9
+ setup: {};
10
+ beta: (BooleanConstructor | StringConstructor)[];
11
+ ReactiveView: {
12
+ type: BooleanConstructor;
13
+ default: boolean;
14
+ };
15
+ instance: {
16
+ default: import("vue").Ref<any, any>;
17
+ };
18
+ notifications: ObjectConstructor;
19
+ subscriptions: ObjectConstructor;
20
+ beforeSetData: FunctionConstructor;
21
+ data: {
22
+ default: {};
23
+ };
24
+ defaultData: {};
25
+ getDefaultData: {
26
+ type: FunctionConstructor;
27
+ default: (data: any) => any;
28
+ };
29
+ model: {};
30
+ defer: {};
31
+ logging: {
32
+ validator: (logging: boolean) => boolean;
33
+ };
34
+ modelName: {
35
+ type: StringConstructor;
36
+ default: string;
37
+ };
38
+ debug: {
39
+ type: BooleanConstructor;
40
+ default: boolean;
41
+ };
42
+ state: {
43
+ default: {};
44
+ };
45
+ };
46
+ setup(props: Record<string, any>, context: SetupContext): (vue: ComponentPublicInstance) => any;
47
+ };
48
+ export default _default;
@@ -0,0 +1,17 @@
1
+ import { SubscriptionItem } from "./Types";
2
+ export default class Subscription {
3
+ private subscriptions;
4
+ private data;
5
+ static create(): Subscription;
6
+ subscribe(name: string, handler: () => void, data?: any): Subscription;
7
+ replace(name: string, handler: () => void, data?: any): Subscription;
8
+ unsubscribe(subscription?: string): Subscription;
9
+ unsubscribe(subscriptions?: Array<string>): Subscription;
10
+ size(): number;
11
+ hasSubscription(name: string): boolean;
12
+ private remove;
13
+ private find;
14
+ private isNameAvailable;
15
+ registrations(): Array<SubscriptionItem>;
16
+ get(name: string): SubscriptionItem;
17
+ }
@@ -0,0 +1,5 @@
1
+ import Subscription from "./Subscription";
2
+ export default class Subscriptions extends Subscription {
3
+ protected static subscriptions: Subscription;
4
+ static get(): Subscription;
5
+ }
@@ -0,0 +1,28 @@
1
+ import { WatchOptions } from "vue";
2
+ export type StateUpdate = {
3
+ callback: (...args: any[]) => any;
4
+ beforeStateUpdate?: (...args: any[]) => any;
5
+ options?: WatchOptions;
6
+ };
7
+ export type ComponentExtension = {
8
+ parent?: ComponentExtension;
9
+ self?: Record<string | symbol, any>;
10
+ access?: () => ComponentExtension;
11
+ value?: ComponentExtension;
12
+ };
13
+ export type PropOptions = {
14
+ exclude: string | Array<string>;
15
+ include: Record<string, any>;
16
+ };
17
+ export type SubscriptionItem = {
18
+ name: string;
19
+ handler: () => void;
20
+ data?: any;
21
+ };
22
+ export type PropType = {
23
+ default: any;
24
+ required: boolean;
25
+ validator: (value: any) => boolean;
26
+ type: any | Array<any>;
27
+ };
28
+ export type PropExclusions = Array<string> | string;
@@ -0,0 +1,47 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ setup: {
5
+ type: FunctionConstructor;
6
+ default: (_parent?: {}, self?: {}) => {};
7
+ ReactiveView: boolean;
8
+ };
9
+ title: {
10
+ type: StringConstructor;
11
+ };
12
+ description: {
13
+ type: StringConstructor;
14
+ };
15
+ close: {
16
+ type: BooleanConstructor;
17
+ default: boolean;
18
+ };
19
+ timeout: {
20
+ default: number;
21
+ validator: (type: unknown) => type is number | false;
22
+ };
23
+ }>, ($vue: any) => any, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
24
+ setup: {
25
+ type: FunctionConstructor;
26
+ default: (_parent?: {}, self?: {}) => {};
27
+ ReactiveView: boolean;
28
+ };
29
+ title: {
30
+ type: StringConstructor;
31
+ };
32
+ description: {
33
+ type: StringConstructor;
34
+ };
35
+ close: {
36
+ type: BooleanConstructor;
37
+ default: boolean;
38
+ };
39
+ timeout: {
40
+ default: number;
41
+ validator: (type: unknown) => type is number | false;
42
+ };
43
+ }>> & Readonly<{}>, {
44
+ setup: Function;
45
+ close: boolean;
46
+ timeout: number;
47
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,3 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: any;
@@ -0,0 +1,3 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: any;
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ message?: string;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
package/dist/index.d.ts CHANGED
@@ -1,94 +1,10 @@
1
- import * as vue from 'vue';
2
- import { SetupContext, ComponentPublicInstance, UnwrapRef, defineComponent } from 'vue';
3
-
4
- type ComponentExtension = {
5
- parent?: ComponentExtension;
6
- self?: Record<string | symbol, any>;
7
- access?: () => ComponentExtension;
8
- value?: ComponentExtension;
9
- };
10
- type PropOptions = {
11
- exclude: string | Array<string>;
12
- include: Record<string, any>;
13
- };
14
- type SubscriptionItem = {
15
- name: string;
16
- handler: Function;
17
- data?: any;
18
- };
19
- type PropType = {
20
- default: any;
21
- required: boolean;
22
- validator: ((value: any) => boolean);
23
- type: any | Array<any>;
24
- };
25
- type PropExclusions = Array<string> | string;
26
-
27
- declare class Subscription {
28
- private subscriptions;
29
- private data;
30
- static create(): Subscription;
31
- subscribe(name: string, handler: Function, data?: any): Subscription;
32
- replace(name: string, handler: Function, data?: any): Subscription;
33
- unsubscribe(subscription?: string): Subscription;
34
- unsubscribe(subscriptions?: Array<string>): Subscription;
35
- size(): number;
36
- hasSubscription(name: string): boolean;
37
- private remove;
38
- private find;
39
- private isNameAvailable;
40
- registrations(): Array<SubscriptionItem>;
41
- get(name: string): SubscriptionItem;
42
- }
43
-
44
- declare const setup: {
45
- type: FunctionConstructor;
46
- default: (parent?: {}, self?: {}) => {};
47
- ReactiveView: boolean;
48
- };
49
- declare const _default: {
50
- props: {
51
- setup: {};
52
- beta: (BooleanConstructor | StringConstructor)[];
53
- ReactiveView: {
54
- type: BooleanConstructor;
55
- default: boolean;
56
- };
57
- instance: {
58
- default: vue.Ref<any, any>;
59
- };
60
- notifications: ObjectConstructor;
61
- subscriptions: ObjectConstructor;
62
- beforeSetData: FunctionConstructor;
63
- data: {
64
- default: {};
65
- };
66
- defaultData: {};
67
- getDefaultData: {
68
- type: FunctionConstructor;
69
- default: (data: any) => any;
70
- };
71
- model: {};
72
- defer: {};
73
- logging: {
74
- validator: (logging: boolean) => boolean;
75
- };
76
- modelName: {
77
- type: StringConstructor;
78
- default: string;
79
- };
80
- debug: {
81
- type: BooleanConstructor;
82
- default: boolean;
83
- };
84
- state: {
85
- default: {};
86
- };
87
- };
88
- setup(props: Record<string, any>, context: SetupContext): (vue: ComponentPublicInstance) => any;
89
- };
90
-
91
- declare function safeRequest(request: {
1
+ import { PropExclusions, PropOptions, PropType, ComponentExtension } from "./Types";
2
+ import ReactiveView, { setup } from "./ReactiveView";
3
+ import { defineComponent, UnwrapRef } from "vue";
4
+ import showComponent from "./showComponent";
5
+ export default ReactiveView;
6
+ export { setup, showComponent };
7
+ export declare function safeRequest(request: {
92
8
  try: () => Promise<any> | any;
93
9
  catch?: ((error: any) => Promise<any> | any) | false;
94
10
  finally?: () => Promise<any> | any;
@@ -100,49 +16,45 @@ declare function safeRequest(request: {
100
16
  message?: string;
101
17
  alternative?: boolean;
102
18
  }): Promise<any>;
103
- declare function getProps(props: Record<string, any>, exclude: PropExclusions): Record<string, any>;
104
- declare function getProps(props: Record<string, any>, options: PropOptions): Record<string, any>;
105
- declare function getReactiveViewComponent(component: any, options?: Record<string, any>): vue.VNode<vue.RendererNode, vue.RendererElement, {
19
+ export declare function getProps(props: Record<string, any>, exclude: PropExclusions): Record<string, any>;
20
+ export declare function getProps(props: Record<string, any>, options: PropOptions): Record<string, any>;
21
+ export declare function getReactiveViewComponent(component: any, options?: Record<string, any>): import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
106
22
  [key: string]: any;
107
23
  }>;
108
- declare function getDate(timestamp: {
24
+ export declare function getDate(timestamp: {
109
25
  toDate: () => Date;
110
26
  } | Date, format?: string): string;
111
- declare function getDate(timestamp: {
27
+ export declare function getDate(timestamp: {
112
28
  toDate: () => Date;
113
29
  } | Date, options?: {
114
30
  format?: string;
115
31
  timezone?: string;
116
32
  }): string;
117
- declare function access(view?: ComponentExtension | UnwrapRef<any> | (() => ComponentExtension), alternative?: any): any;
118
- declare function useSubscription(): {
119
- addSubscription(name: string, handler?: () => boolean, data?: any): void;
120
- replaceSubscription(name: string, handler?: () => boolean, data?: any): void;
33
+ export declare function access(view?: ComponentExtension | UnwrapRef<any> | (() => ComponentExtension), alternative?: any): any;
34
+ export declare function useSubscription(): {
35
+ addSubscription(name: string, handler: () => void, data?: any): void;
36
+ replaceSubscription(name: string, handler: () => void, data?: any): void;
121
37
  removeSubscriptions(): void;
122
38
  removeSubscription(name: string): void;
123
39
  hasSubscription(name: string): boolean;
124
40
  subscriptions: any[];
125
- subscription: Subscription;
41
+ subscription: import("./Subscription").default;
126
42
  };
127
- declare const Prop: ({ default: value, type, validator, required }?: Partial<PropType>) => {
43
+ export declare const Prop: ({ default: value, type, validator, required }?: Partial<PropType>) => {
128
44
  required: boolean | undefined;
129
45
  validator: (value: any) => boolean;
130
46
  default?: any;
131
47
  };
132
- declare function StyleParser(styles?: Array<string> | Record<string, boolean> | string): {};
133
- declare function MergeStyles(...params: any): any;
134
- declare const extendVnode: (component: Record<string, any>, element: any) => Record<string, (props?: Record<string, any>, slots?: Record<string, any> | ((slots: Record<string, any>) => Record<string, any>)) => any>;
135
- declare function defineReactiveView(): ReturnType<typeof defineComponent>;
136
- declare function defineReactiveView(options: Record<string, any>): ReturnType<typeof defineComponent>;
137
- declare function defineReactiveView(options: Record<string, any>, component: typeof _default): ReturnType<typeof defineComponent>;
138
- declare function showComponent(component: any, options?: {
139
- container?: string;
140
- key?: string;
141
- router?: any;
142
- plugins?: Array<any>;
143
- }): any;
144
- declare const getData: (component: any, path: number | string, alternative: any) => any;
145
- declare const setData: (component: any, data: any, path?: string) => any;
146
- declare const dataPath: (component: any, path: string | number) => any;
147
-
148
- export { MergeStyles, Prop, StyleParser, access, dataPath, _default as default, defineReactiveView, extendVnode, getData, getDate, getProps, getReactiveViewComponent, safeRequest, setData, setup, showComponent, useSubscription };
48
+ export declare function StyleParser(styles?: Array<string> | Record<string, boolean> | string): {};
49
+ export declare function MergeStyles(...params: any): any;
50
+ export declare const extendVnode: (component: Record<string, any>, element: any) => Record<string, (props?: Record<string, any>, slots?: Record<string, any> | ((slots: Record<string, any>) => Record<string, any>)) => any>;
51
+ export declare function defineReactiveView(): ReturnType<typeof defineComponent>;
52
+ export declare function defineReactiveView(options: Record<string, any>): ReturnType<typeof defineComponent>;
53
+ export declare function defineReactiveView(options: Record<string, any>, component: typeof ReactiveView): ReturnType<typeof defineComponent>;
54
+ export declare const getData: (component: any, path: number | string, alternative: any) => any;
55
+ import CustomButton from "./components/CustomButton.vue";
56
+ import CustomModal from "./components/CustomModal.vue";
57
+ import CustomAlert from "./components/CustomAlert.vue";
58
+ export { CustomButton, CustomModal, CustomAlert };
59
+ export declare const setData: (component: any, data: any, path?: string) => any;
60
+ export declare const dataPath: (component: any, path: string | number) => any;