@razaman2/reactive-view 0.0.1

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 ADDED
@@ -0,0 +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.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # reactive-view
@@ -0,0 +1,176 @@
1
+ import * as vue from 'vue';
2
+ import { SetupContext, ComponentPublicInstance, UnwrapRef } from 'vue';
3
+
4
+ type SubscriptionItem = {
5
+ name: string;
6
+ handler: Function;
7
+ data?: any;
8
+ };
9
+ declare class Subscription {
10
+ private subscriptions;
11
+ private data;
12
+ static create(): Subscription;
13
+ subscribe(name: string, handler: Function, data?: any): Subscription;
14
+ replace(name: string, handler: Function, data?: any): Subscription;
15
+ unsubscribe(subscription?: string): Subscription;
16
+ unsubscribe(subscriptions?: Array<string>): Subscription;
17
+ size(): number;
18
+ hasSubscription(name: string): boolean;
19
+ private remove;
20
+ private find;
21
+ private isNameAvailable;
22
+ registrations(): Array<SubscriptionItem>;
23
+ get(name: string): SubscriptionItem;
24
+ }
25
+
26
+ declare const setup: {
27
+ setup: {
28
+ type: FunctionConstructor;
29
+ default: (param1?: {}, param2?: {}) => {};
30
+ };
31
+ };
32
+ declare const _default$1: {
33
+ props: {
34
+ defaultData: {};
35
+ getDefaultData: {
36
+ type: FunctionConstructor;
37
+ default: (data?: {}) => {};
38
+ };
39
+ logging: {
40
+ validator: (logging: unknown) => boolean;
41
+ };
42
+ model: {};
43
+ modelName: {
44
+ type: StringConstructor;
45
+ default: string;
46
+ };
47
+ notifications: {
48
+ type: ObjectConstructor;
49
+ };
50
+ root: {
51
+ type: FunctionConstructor;
52
+ };
53
+ state: {};
54
+ subscriptions: {
55
+ type: ObjectConstructor;
56
+ default: {
57
+ addSubscription(name: string, handler?: () => boolean, data?: any): void;
58
+ replaceSubscription(name: string, handler?: () => boolean, data?: any): void;
59
+ removeSubscriptions(): void;
60
+ removeSubscription(name: string): void;
61
+ hasSubscription(name: string): boolean;
62
+ subscriptions: any[];
63
+ subscription: Subscription;
64
+ };
65
+ };
66
+ setup: {
67
+ type: FunctionConstructor;
68
+ default: (param1?: {}, param2?: {}) => {};
69
+ };
70
+ };
71
+ setup(props: Record<string, any>, context: SetupContext): ($vue: ComponentPublicInstance & any) => any;
72
+ };
73
+
74
+ declare const _default: {
75
+ props: {
76
+ resolve: {
77
+ required: boolean;
78
+ };
79
+ delay: {
80
+ type: NumberConstructor;
81
+ default: number;
82
+ };
83
+ timeout: {
84
+ type: NumberConstructor;
85
+ default: number;
86
+ };
87
+ loading: {
88
+ default: vue.VNode<vue.RendererNode, vue.RendererElement, {
89
+ [key: string]: any;
90
+ }>;
91
+ };
92
+ options: {
93
+ type: ObjectConstructor;
94
+ };
95
+ error: {
96
+ required: boolean;
97
+ };
98
+ setup: {
99
+ type: FunctionConstructor;
100
+ default: (param1?: {}, param2?: {}) => {};
101
+ };
102
+ };
103
+ setup(): ($vue: any) => vue.VNode<vue.RendererNode, vue.RendererElement, {
104
+ [key: string]: any;
105
+ }>;
106
+ };
107
+
108
+ /**
109
+ * uppercase the first character of each word in the input string.
110
+ * @description
111
+ * (test -> Test), (TEST -> Test), (test test -> Test Test)
112
+ */
113
+ declare function ucf(string: string): string;
114
+ /**
115
+ * uppercase the first character of each word that follows a specified token
116
+ * @description
117
+ * (test-test -> test-Test), (TEST-TEST -> TEST-Test), (test/test -> test/Test)
118
+ */
119
+ declare function ucfat(string: string, tokens: Array<string>): string;
120
+ declare function safeRequest(request: {
121
+ try: () => Promise<any> | any;
122
+ catch?: ((error: any) => Promise<any> | any) | false;
123
+ finally?: () => Promise<any> | any;
124
+ complete?: () => Promise<any> | any;
125
+ loading?: {
126
+ status: boolean;
127
+ message?: string;
128
+ };
129
+ message?: string;
130
+ alternative?: boolean;
131
+ }): Promise<any>;
132
+ declare function getRoot(vue: ComponentPublicInstance): any;
133
+ type PropOptions = {
134
+ exclude: string | Array<string>;
135
+ include: Record<string, any>;
136
+ };
137
+ type PropExclusions = Array<string> | string;
138
+ declare function getProps(props: Record<string, any>, exclude: PropExclusions): Record<string, any>;
139
+ declare function getProps(props: Record<string, any>, options: PropOptions): Record<string, any>;
140
+ declare function getDate(timestamp: {
141
+ toDate: () => Date;
142
+ } | Date, format?: string): string;
143
+ declare function getDate(timestamp: {
144
+ toDate: () => Date;
145
+ } | Date, options?: {
146
+ format?: string;
147
+ timezone?: string;
148
+ }): string;
149
+ declare function getRef(component: ComponentPublicInstance, ref: UnwrapRef<any>): ComponentPublicInstance;
150
+ declare function expose(vue: any, props: Record<string, any>): Record<string, any>;
151
+ declare function getSubscription(): {
152
+ addSubscription(name: string, handler?: () => boolean, data?: any): void;
153
+ replaceSubscription(name: string, handler?: () => boolean, data?: any): void;
154
+ removeSubscriptions(): void;
155
+ removeSubscription(name: string): void;
156
+ hasSubscription(name: string): boolean;
157
+ subscriptions: any[];
158
+ subscription: Subscription;
159
+ };
160
+ type Accessible = {
161
+ parent: {
162
+ self: Record<string | symbol, any>;
163
+ };
164
+ self: Record<string | symbol, any>;
165
+ access?: Function;
166
+ value?: {
167
+ parent: {
168
+ self: Record<string | symbol, any>;
169
+ };
170
+ self: Record<string | symbol, any>;
171
+ access?: Function;
172
+ };
173
+ };
174
+ declare function access<T extends ComponentPublicInstance & Accessible>($vue?: T): any;
175
+
176
+ export { _default as AsyncComponent, access, _default$1 as default, expose, getDate, getProps, getRef, getRoot, getSubscription, safeRequest, setup, ucf, ucfat };
@@ -0,0 +1,176 @@
1
+ import * as vue from 'vue';
2
+ import { SetupContext, ComponentPublicInstance, UnwrapRef } from 'vue';
3
+
4
+ type SubscriptionItem = {
5
+ name: string;
6
+ handler: Function;
7
+ data?: any;
8
+ };
9
+ declare class Subscription {
10
+ private subscriptions;
11
+ private data;
12
+ static create(): Subscription;
13
+ subscribe(name: string, handler: Function, data?: any): Subscription;
14
+ replace(name: string, handler: Function, data?: any): Subscription;
15
+ unsubscribe(subscription?: string): Subscription;
16
+ unsubscribe(subscriptions?: Array<string>): Subscription;
17
+ size(): number;
18
+ hasSubscription(name: string): boolean;
19
+ private remove;
20
+ private find;
21
+ private isNameAvailable;
22
+ registrations(): Array<SubscriptionItem>;
23
+ get(name: string): SubscriptionItem;
24
+ }
25
+
26
+ declare const setup: {
27
+ setup: {
28
+ type: FunctionConstructor;
29
+ default: (param1?: {}, param2?: {}) => {};
30
+ };
31
+ };
32
+ declare const _default$1: {
33
+ props: {
34
+ defaultData: {};
35
+ getDefaultData: {
36
+ type: FunctionConstructor;
37
+ default: (data?: {}) => {};
38
+ };
39
+ logging: {
40
+ validator: (logging: unknown) => boolean;
41
+ };
42
+ model: {};
43
+ modelName: {
44
+ type: StringConstructor;
45
+ default: string;
46
+ };
47
+ notifications: {
48
+ type: ObjectConstructor;
49
+ };
50
+ root: {
51
+ type: FunctionConstructor;
52
+ };
53
+ state: {};
54
+ subscriptions: {
55
+ type: ObjectConstructor;
56
+ default: {
57
+ addSubscription(name: string, handler?: () => boolean, data?: any): void;
58
+ replaceSubscription(name: string, handler?: () => boolean, data?: any): void;
59
+ removeSubscriptions(): void;
60
+ removeSubscription(name: string): void;
61
+ hasSubscription(name: string): boolean;
62
+ subscriptions: any[];
63
+ subscription: Subscription;
64
+ };
65
+ };
66
+ setup: {
67
+ type: FunctionConstructor;
68
+ default: (param1?: {}, param2?: {}) => {};
69
+ };
70
+ };
71
+ setup(props: Record<string, any>, context: SetupContext): ($vue: ComponentPublicInstance & any) => any;
72
+ };
73
+
74
+ declare const _default: {
75
+ props: {
76
+ resolve: {
77
+ required: boolean;
78
+ };
79
+ delay: {
80
+ type: NumberConstructor;
81
+ default: number;
82
+ };
83
+ timeout: {
84
+ type: NumberConstructor;
85
+ default: number;
86
+ };
87
+ loading: {
88
+ default: vue.VNode<vue.RendererNode, vue.RendererElement, {
89
+ [key: string]: any;
90
+ }>;
91
+ };
92
+ options: {
93
+ type: ObjectConstructor;
94
+ };
95
+ error: {
96
+ required: boolean;
97
+ };
98
+ setup: {
99
+ type: FunctionConstructor;
100
+ default: (param1?: {}, param2?: {}) => {};
101
+ };
102
+ };
103
+ setup(): ($vue: any) => vue.VNode<vue.RendererNode, vue.RendererElement, {
104
+ [key: string]: any;
105
+ }>;
106
+ };
107
+
108
+ /**
109
+ * uppercase the first character of each word in the input string.
110
+ * @description
111
+ * (test -> Test), (TEST -> Test), (test test -> Test Test)
112
+ */
113
+ declare function ucf(string: string): string;
114
+ /**
115
+ * uppercase the first character of each word that follows a specified token
116
+ * @description
117
+ * (test-test -> test-Test), (TEST-TEST -> TEST-Test), (test/test -> test/Test)
118
+ */
119
+ declare function ucfat(string: string, tokens: Array<string>): string;
120
+ declare function safeRequest(request: {
121
+ try: () => Promise<any> | any;
122
+ catch?: ((error: any) => Promise<any> | any) | false;
123
+ finally?: () => Promise<any> | any;
124
+ complete?: () => Promise<any> | any;
125
+ loading?: {
126
+ status: boolean;
127
+ message?: string;
128
+ };
129
+ message?: string;
130
+ alternative?: boolean;
131
+ }): Promise<any>;
132
+ declare function getRoot(vue: ComponentPublicInstance): any;
133
+ type PropOptions = {
134
+ exclude: string | Array<string>;
135
+ include: Record<string, any>;
136
+ };
137
+ type PropExclusions = Array<string> | string;
138
+ declare function getProps(props: Record<string, any>, exclude: PropExclusions): Record<string, any>;
139
+ declare function getProps(props: Record<string, any>, options: PropOptions): Record<string, any>;
140
+ declare function getDate(timestamp: {
141
+ toDate: () => Date;
142
+ } | Date, format?: string): string;
143
+ declare function getDate(timestamp: {
144
+ toDate: () => Date;
145
+ } | Date, options?: {
146
+ format?: string;
147
+ timezone?: string;
148
+ }): string;
149
+ declare function getRef(component: ComponentPublicInstance, ref: UnwrapRef<any>): ComponentPublicInstance;
150
+ declare function expose(vue: any, props: Record<string, any>): Record<string, any>;
151
+ declare function getSubscription(): {
152
+ addSubscription(name: string, handler?: () => boolean, data?: any): void;
153
+ replaceSubscription(name: string, handler?: () => boolean, data?: any): void;
154
+ removeSubscriptions(): void;
155
+ removeSubscription(name: string): void;
156
+ hasSubscription(name: string): boolean;
157
+ subscriptions: any[];
158
+ subscription: Subscription;
159
+ };
160
+ type Accessible = {
161
+ parent: {
162
+ self: Record<string | symbol, any>;
163
+ };
164
+ self: Record<string | symbol, any>;
165
+ access?: Function;
166
+ value?: {
167
+ parent: {
168
+ self: Record<string | symbol, any>;
169
+ };
170
+ self: Record<string | symbol, any>;
171
+ access?: Function;
172
+ };
173
+ };
174
+ declare function access<T extends ComponentPublicInstance & Accessible>($vue?: T): any;
175
+
176
+ export { _default as AsyncComponent, access, _default$1 as default, expose, getDate, getProps, getRef, getRoot, getSubscription, safeRequest, setup, ucf, ucfat };