@kaokei/use-vue-service 4.0.1 → 4.0.3
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/README.md +12 -9
- package/dist/constants.d.cts +1 -0
- package/dist/constants.d.ts +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +119 -113
- package/dist/raw.d.cts +4 -2
- package/dist/raw.d.ts +4 -2
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -17,15 +17,18 @@
|
|
|
17
17
|
|
|
18
18
|
本库通过类来声明服务,对 typescript 支持非常棒。
|
|
19
19
|
|
|
20
|
-
- [
|
|
20
|
+
- [快速开始](./docs/guide/index.md)
|
|
21
21
|
- [API 文档](./docs/api/index.md)
|
|
22
|
-
- [
|
|
23
|
-
- [
|
|
24
|
-
- [online demo](https://use-vue-service.vercel.app/)
|
|
22
|
+
- [示例代码(Example)](./docs/examples/index.md)
|
|
23
|
+
- [笔记文章](./docs/note/00.README.md)
|
|
25
24
|
|
|
26
25
|
## Todo List
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
3.
|
|
31
|
-
|
|
26
|
+
|
|
27
|
+
1. 改成tsdown来打包代码
|
|
28
|
+
2. 开发devtools工具-浏览器插件
|
|
29
|
+
3. 开发nuxt插件,自动导入API
|
|
30
|
+
4. 表格宽度应该限制在装饰器页面
|
|
31
|
+
|
|
32
|
+
4. 装饰器是否加小括号的表格
|
|
33
|
+
4. 装饰器是否加小括号的类型兼容
|
|
34
|
+
5. 整理note笔记
|
package/dist/constants.d.cts
CHANGED
|
@@ -4,4 +4,5 @@ import { FindChildService, FindChildrenServices } from './interface.ts';
|
|
|
4
4
|
export declare const FIND_CHILD_SERVICE: Token<FindChildService>;
|
|
5
5
|
export declare const FIND_CHILDREN_SERVICES: Token<FindChildrenServices>;
|
|
6
6
|
export declare const SCOPE_KEY: unique symbol;
|
|
7
|
+
export declare const RAW_CLASS_KEY = "__raw__";
|
|
7
8
|
export declare const CONTAINER_TOKEN: InjectionKey<Container>;
|
package/dist/constants.d.ts
CHANGED
|
@@ -4,4 +4,5 @@ import { FindChildService, FindChildrenServices } from './interface.ts';
|
|
|
4
4
|
export declare const FIND_CHILD_SERVICE: Token<FindChildService>;
|
|
5
5
|
export declare const FIND_CHILDREN_SERVICES: Token<FindChildrenServices>;
|
|
6
6
|
export declare const SCOPE_KEY: unique symbol;
|
|
7
|
+
export declare const RAW_CLASS_KEY = "__raw__";
|
|
7
8
|
export declare const CONTAINER_TOKEN: InjectionKey<Container>;
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@kaokei/di"),o=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@kaokei/di"),o=require("vue"),y=new c.Token("FIND_CHILD_SERVICE"),P=new c.Token("FIND_CHILDREN_SERVICES"),C=Symbol("SCOPE_KEY"),b="__raw__",a=Symbol("CONTAINER_TOKEN");function T(n){const e=n,t=o.effectScope(!0);return e[C]=t,t}function D(n){return n[C]}function V(n){const e=n;if(e){const t=D(e);t&&(t.stop(),delete e[C])}}function N(n){const e=D(n);return e||T(n)}function S(n,e,t,r){if(n){for(const i of n)if(i.isCurrentBound(e)&&(t.push(i.get(e)),r)||S(i.getChildren(),e,t,r))return!0}return!1}function F(n,e){const t=[];return S(e.getChildren(),n,t,!0),t[0]}function H(n,e){const t=[];return S(e.getChildren(),n,t,!1),t}function L(n,e,t){return c.isObject(e)?c.getOwnMetadata(b,t)?o.markRaw(e):o.reactive(e):e}function K(n){return V(n)}function W({container:n}){return e=>F(e,n)}function Y({container:n}){return e=>H(e,n)}function h(n){let e;return n?e=n.createChild():e=new c.Container,e.bind(y).toDynamicValue(W),e.bind(P).toDynamicValue(Y),e.onActivation(L),e.onDeactivation(K),e}const l=h();function s(n,e){if(typeof e=="function")e(n);else for(let t=0;t<e.length;t++)n.bind(e[t]).toSelf()}function A(){const n=o.getCurrentInstance();if(n){const e=a,t=n.provides,r=n.parent&&n.parent.provides;if(t&&t!==r&&c.hasOwn(t,e))return t[e]}}function j(n){if(!o.hasInjectionContext())throw new Error(`${n} must inside setup.`)}function g(){return o.inject(a,l)}function q(n){return j("useService"),(A()||g()).get(n)}function M(n){j("declareProviders");const e=A();if(e)s(e,n);else{const t=g(),r=h(t);s(r,n),o.provide(a,r),o.onUnmounted(()=>{r.destroy()})}}function U(n){return l.get(n)}function z(n){s(l,n)}function B(n,e){return e.runWithContext(()=>g().get(n))}function k(n,e){e.runWithContext(()=>{const t=o.inject(a,null);if(t)s(t,n);else{const r=h(l);s(r,n),e.provide(a,r),e.onUnmount(()=>{r.destroy()})}})}function G(n){return e=>k(n,e)}function _(n,e){const t=e.name;return function(){const r=this,i=o.toRaw(this),R=N(i),E=n;let p,f=Object.getPrototypeOf(i);for(;f;){const u=Object.getOwnPropertyDescriptor(f,t);if(u&&u.set){p=u.set;break}f=Object.getPrototypeOf(f)}const I=p?R.run(()=>o.computed({get:()=>E.call(r),set:u=>p.call(r,u)})):R.run(()=>o.computed(()=>E.call(r)));return Object.defineProperty(i,t,{value:I,writable:!0,configurable:!0,enumerable:!0}),I}}function $(n,e){return typeof n=="function"&&(e==null?void 0:e.kind)==="getter"?_(n,e):_}function d(n){return c.isObject(n)?o.markRaw(n):n}function m(n,e){const t=e.name;return e.addInitializer(function(){let r=this[t];Object.defineProperty(this,t,{configurable:!0,enumerable:!0,get(){return r},set(i){r=d(i)}})}),d}function O(n,e){return{get(){return n.get.call(o.toRaw(this))},set(t){n.set.call(o.toRaw(this),d(t))},init:d}}function v(n,e){e.metadata&&(e.metadata[b]=!0)}function J(n,e){return(e==null?void 0:e.kind)==="field"?m(n,e):(e==null?void 0:e.kind)==="accessor"?O(n):(e==null?void 0:e.kind)==="class"?v(n,e):(t,r)=>(r==null?void 0:r.kind)==="field"?m(t,r):(r==null?void 0:r.kind)==="accessor"?O(t):v(t,r)}function w(n,e){return function(...t){const i=N(this).run(()=>o.effectScope());return i.run(()=>n.call(this,...t)),i}}function Q(n,e){return typeof n=="function"&&(e==null?void 0:e.kind)==="method"?w(n):w}exports.Computed=$;exports.FIND_CHILDREN_SERVICES=P;exports.FIND_CHILD_SERVICE=y;exports.Raw=J;exports.RunInScope=Q;exports.declareAppProviders=k;exports.declareAppProvidersPlugin=G;exports.declareProviders=M;exports.declareRootProviders=z;exports.useAppService=B;exports.useRootService=U;exports.useService=q;Object.keys(c).forEach(n=>{n!=="default"&&!Object.prototype.hasOwnProperty.call(exports,n)&&Object.defineProperty(exports,n,{enumerable:!0,get:()=>c[n]})});
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from '@kaokei/di';
|
|
2
2
|
export { useService, declareProviders, useRootService, declareRootProviders, useAppService, declareAppProviders, declareAppProvidersPlugin, } from './core.ts';
|
|
3
3
|
export { FIND_CHILD_SERVICE, FIND_CHILDREN_SERVICES } from './constants.ts';
|
|
4
|
+
export type { FindChildService, FindChildrenServices } from './interface.ts';
|
|
4
5
|
export { Computed } from './computed.ts';
|
|
5
6
|
export { Raw } from './raw.ts';
|
|
6
7
|
export { RunInScope } from './effect-scope.ts';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from '@kaokei/di';
|
|
2
2
|
export { useService, declareProviders, useRootService, declareRootProviders, useAppService, declareAppProviders, declareAppProvidersPlugin, } from './core.ts';
|
|
3
3
|
export { FIND_CHILD_SERVICE, FIND_CHILDREN_SERVICES } from './constants.ts';
|
|
4
|
+
export type { FindChildService, FindChildrenServices } from './interface.ts';
|
|
4
5
|
export { Computed } from './computed.ts';
|
|
5
6
|
export { Raw } from './raw.ts';
|
|
6
7
|
export { RunInScope } from './effect-scope.ts';
|
package/dist/index.js
CHANGED
|
@@ -1,206 +1,212 @@
|
|
|
1
|
-
import { Token as
|
|
1
|
+
import { Token as D, Container as H, isObject as v, getOwnMetadata as j, hasOwn as K } from "@kaokei/di";
|
|
2
2
|
export * from "@kaokei/di";
|
|
3
|
-
import { effectScope as N, reactive as
|
|
4
|
-
const
|
|
3
|
+
import { effectScope as N, markRaw as P, reactive as L, inject as b, provide as W, onUnmounted as Y, hasInjectionContext as U, getCurrentInstance as z, toRaw as l, computed as E } from "vue";
|
|
4
|
+
const B = new D(
|
|
5
5
|
"FIND_CHILD_SERVICE"
|
|
6
|
-
),
|
|
6
|
+
), G = new D(
|
|
7
7
|
"FIND_CHILDREN_SERVICES"
|
|
8
|
-
),
|
|
9
|
-
function
|
|
8
|
+
), p = Symbol("SCOPE_KEY"), k = "__raw__", u = Symbol("CONTAINER_TOKEN");
|
|
9
|
+
function M(n) {
|
|
10
10
|
const e = n, t = N(!0);
|
|
11
|
-
return e[
|
|
11
|
+
return e[p] = t, t;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
return n[
|
|
13
|
+
function A(n) {
|
|
14
|
+
return n[p];
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function $(n) {
|
|
17
17
|
const e = n;
|
|
18
18
|
if (e) {
|
|
19
|
-
const t =
|
|
20
|
-
t && (t.stop(), delete e[
|
|
19
|
+
const t = A(e);
|
|
20
|
+
t && (t.stop(), delete e[p]);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
const e =
|
|
25
|
-
return e ||
|
|
23
|
+
function T(n) {
|
|
24
|
+
const e = A(n);
|
|
25
|
+
return e || M(n);
|
|
26
26
|
}
|
|
27
27
|
function C(n, e, t, r) {
|
|
28
28
|
if (n) {
|
|
29
|
-
for (const
|
|
30
|
-
if (
|
|
29
|
+
for (const i of n)
|
|
30
|
+
if (i.isCurrentBound(e) && (t.push(i.get(e)), r) || C(i.getChildren(), e, t, r))
|
|
31
31
|
return !0;
|
|
32
32
|
}
|
|
33
33
|
return !1;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function q(n, e) {
|
|
36
36
|
const t = [];
|
|
37
|
-
return C(e.
|
|
37
|
+
return C(e.getChildren(), n, t, !0), t[0];
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function J(n, e) {
|
|
40
40
|
const t = [];
|
|
41
|
-
return C(e.
|
|
41
|
+
return C(e.getChildren(), n, t, !1), t;
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
return
|
|
43
|
+
function Q(n, e, t) {
|
|
44
|
+
return v(e) ? j(k, t) ? P(e) : L(e) : e;
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
return
|
|
46
|
+
function X(n) {
|
|
47
|
+
return $(n);
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
return (e) =>
|
|
49
|
+
function Z({ container: n }) {
|
|
50
|
+
return (e) => q(e, n);
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function x({
|
|
53
53
|
container: n
|
|
54
54
|
}) {
|
|
55
|
-
return (e) =>
|
|
55
|
+
return (e) => J(e, n);
|
|
56
56
|
}
|
|
57
57
|
function S(n) {
|
|
58
58
|
let e;
|
|
59
|
-
return n ? e = n.createChild() : e = new
|
|
59
|
+
return n ? e = n.createChild() : e = new H(), e.bind(B).toDynamicValue(Z), e.bind(G).toDynamicValue(x), e.onActivation(Q), e.onDeactivation(X), e;
|
|
60
60
|
}
|
|
61
|
-
const
|
|
62
|
-
function
|
|
61
|
+
const f = S();
|
|
62
|
+
function c(n, e) {
|
|
63
63
|
if (typeof e == "function")
|
|
64
64
|
e(n);
|
|
65
65
|
else
|
|
66
66
|
for (let t = 0; t < e.length; t++)
|
|
67
67
|
n.bind(e[t]).toSelf();
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
const n =
|
|
69
|
+
function V() {
|
|
70
|
+
const n = z();
|
|
71
71
|
if (n) {
|
|
72
|
-
const e =
|
|
73
|
-
if (t && t !== r &&
|
|
72
|
+
const e = u, t = n.provides, r = n.parent && n.parent.provides;
|
|
73
|
+
if (t && t !== r && K(t, e))
|
|
74
74
|
return t[e];
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
if (
|
|
79
|
-
|
|
80
|
-
throw new Error("getProvideContainer 只能在 setup 中使用");
|
|
77
|
+
function F(n) {
|
|
78
|
+
if (!U())
|
|
79
|
+
throw new Error(`${n} must inside setup.`);
|
|
81
80
|
}
|
|
82
|
-
function
|
|
83
|
-
return (
|
|
81
|
+
function h() {
|
|
82
|
+
return b(u, f);
|
|
83
|
+
}
|
|
84
|
+
function re(n) {
|
|
85
|
+
return F("useService"), (V() || h()).get(n);
|
|
84
86
|
}
|
|
85
|
-
function
|
|
86
|
-
|
|
87
|
+
function ie(n) {
|
|
88
|
+
F("declareProviders");
|
|
89
|
+
const e = V();
|
|
87
90
|
if (e)
|
|
88
|
-
|
|
91
|
+
c(e, n);
|
|
89
92
|
else {
|
|
90
|
-
const t =
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
r.destroy(), r = null;
|
|
93
|
+
const t = h(), r = S(t);
|
|
94
|
+
c(r, n), W(u, r), Y(() => {
|
|
95
|
+
r.destroy();
|
|
94
96
|
});
|
|
95
97
|
}
|
|
96
98
|
}
|
|
97
|
-
function
|
|
98
|
-
return
|
|
99
|
+
function oe(n) {
|
|
100
|
+
return f.get(n);
|
|
99
101
|
}
|
|
100
|
-
function
|
|
101
|
-
|
|
102
|
+
function ue(n) {
|
|
103
|
+
c(f, n);
|
|
102
104
|
}
|
|
103
|
-
function
|
|
104
|
-
return e.runWithContext(() =>
|
|
105
|
+
function ce(n, e) {
|
|
106
|
+
return e.runWithContext(() => h().get(n));
|
|
105
107
|
}
|
|
106
|
-
function
|
|
108
|
+
function ee(n, e) {
|
|
107
109
|
e.runWithContext(() => {
|
|
108
|
-
const t =
|
|
110
|
+
const t = b(u, null);
|
|
109
111
|
if (t)
|
|
110
|
-
|
|
112
|
+
c(t, n);
|
|
111
113
|
else {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
r.destroy()
|
|
114
|
+
const r = S(f);
|
|
115
|
+
c(r, n), e.provide(u, r), e.onUnmount(() => {
|
|
116
|
+
r.destroy();
|
|
115
117
|
});
|
|
116
118
|
}
|
|
117
119
|
});
|
|
118
120
|
}
|
|
119
|
-
function
|
|
120
|
-
return (e) =>
|
|
121
|
+
function se(n) {
|
|
122
|
+
return (e) => ee(n, e);
|
|
121
123
|
}
|
|
122
|
-
function
|
|
124
|
+
function I(n, e) {
|
|
123
125
|
const t = e.name;
|
|
124
126
|
return function() {
|
|
125
|
-
const r =
|
|
126
|
-
let
|
|
127
|
+
const r = this, i = l(this), g = T(i), m = n;
|
|
128
|
+
let d, s = Object.getPrototypeOf(i);
|
|
127
129
|
for (; s; ) {
|
|
128
|
-
const
|
|
129
|
-
if (
|
|
130
|
-
|
|
130
|
+
const o = Object.getOwnPropertyDescriptor(s, t);
|
|
131
|
+
if (o && o.set) {
|
|
132
|
+
d = o.set;
|
|
131
133
|
break;
|
|
132
134
|
}
|
|
133
135
|
s = Object.getPrototypeOf(s);
|
|
134
136
|
}
|
|
135
|
-
const
|
|
136
|
-
() =>
|
|
137
|
-
get: () =>
|
|
138
|
-
set: (
|
|
137
|
+
const _ = d ? g.run(
|
|
138
|
+
() => E({
|
|
139
|
+
get: () => m.call(r),
|
|
140
|
+
set: (o) => d.call(r, o)
|
|
139
141
|
})
|
|
140
|
-
) :
|
|
141
|
-
return Object.defineProperty(
|
|
142
|
-
value:
|
|
142
|
+
) : g.run(() => E(() => m.call(r)));
|
|
143
|
+
return Object.defineProperty(i, t, {
|
|
144
|
+
value: _,
|
|
143
145
|
writable: !0,
|
|
144
146
|
configurable: !0,
|
|
145
147
|
enumerable: !0
|
|
146
|
-
}),
|
|
148
|
+
}), _;
|
|
147
149
|
};
|
|
148
150
|
}
|
|
149
|
-
function
|
|
150
|
-
return typeof n == "function" && (e == null ? void 0 : e.kind) === "getter" ?
|
|
151
|
+
function ae(n, e) {
|
|
152
|
+
return typeof n == "function" && (e == null ? void 0 : e.kind) === "getter" ? I(n, e) : I;
|
|
151
153
|
}
|
|
152
|
-
function
|
|
153
|
-
return
|
|
154
|
+
function a(n) {
|
|
155
|
+
return v(n) ? P(n) : n;
|
|
154
156
|
}
|
|
155
|
-
function
|
|
156
|
-
if (e.kind === "accessor")
|
|
157
|
-
return {
|
|
158
|
-
get() {
|
|
159
|
-
return n.get.call(p(this));
|
|
160
|
-
},
|
|
161
|
-
set(r) {
|
|
162
|
-
n.set.call(p(this), f(r));
|
|
163
|
-
},
|
|
164
|
-
init: f
|
|
165
|
-
};
|
|
157
|
+
function w(n, e) {
|
|
166
158
|
const t = e.name;
|
|
167
159
|
return e.addInitializer(function() {
|
|
168
|
-
let r;
|
|
160
|
+
let r = this[t];
|
|
169
161
|
Object.defineProperty(this, t, {
|
|
170
162
|
configurable: !0,
|
|
171
163
|
enumerable: !0,
|
|
172
164
|
get() {
|
|
173
165
|
return r;
|
|
174
166
|
},
|
|
175
|
-
set(
|
|
176
|
-
r =
|
|
167
|
+
set(i) {
|
|
168
|
+
r = a(i);
|
|
177
169
|
}
|
|
178
170
|
});
|
|
179
|
-
}),
|
|
171
|
+
}), a;
|
|
180
172
|
}
|
|
181
|
-
function
|
|
182
|
-
return
|
|
173
|
+
function O(n, e) {
|
|
174
|
+
return {
|
|
175
|
+
get() {
|
|
176
|
+
return n.get.call(l(this));
|
|
177
|
+
},
|
|
178
|
+
set(t) {
|
|
179
|
+
n.set.call(l(this), a(t));
|
|
180
|
+
},
|
|
181
|
+
init: a
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function R(n, e) {
|
|
185
|
+
e.metadata && (e.metadata[k] = !0);
|
|
186
|
+
}
|
|
187
|
+
function fe(n, e) {
|
|
188
|
+
return (e == null ? void 0 : e.kind) === "field" ? w(n, e) : (e == null ? void 0 : e.kind) === "accessor" ? O(n) : (e == null ? void 0 : e.kind) === "class" ? R(n, e) : (t, r) => (r == null ? void 0 : r.kind) === "field" ? w(t, r) : (r == null ? void 0 : r.kind) === "accessor" ? O(t) : R(t, r);
|
|
183
189
|
}
|
|
184
190
|
function y(n, e) {
|
|
185
191
|
return function(...t) {
|
|
186
|
-
const
|
|
187
|
-
return
|
|
192
|
+
const i = T(this).run(() => N());
|
|
193
|
+
return i.run(() => n.call(this, ...t)), i;
|
|
188
194
|
};
|
|
189
195
|
}
|
|
190
|
-
function
|
|
196
|
+
function de(n, e) {
|
|
191
197
|
return typeof n == "function" && (e == null ? void 0 : e.kind) === "method" ? y(n) : y;
|
|
192
198
|
}
|
|
193
199
|
export {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
200
|
+
ae as Computed,
|
|
201
|
+
G as FIND_CHILDREN_SERVICES,
|
|
202
|
+
B as FIND_CHILD_SERVICE,
|
|
203
|
+
fe as Raw,
|
|
204
|
+
de as RunInScope,
|
|
205
|
+
ee as declareAppProviders,
|
|
206
|
+
se as declareAppProvidersPlugin,
|
|
207
|
+
ie as declareProviders,
|
|
208
|
+
ue as declareRootProviders,
|
|
209
|
+
ce as useAppService,
|
|
210
|
+
oe as useRootService,
|
|
211
|
+
re as useService
|
|
206
212
|
};
|
package/dist/raw.d.cts
CHANGED
|
@@ -2,5 +2,7 @@
|
|
|
2
2
|
* 将值标记为 raw(如果是对象则调用 markRaw,否则原样返回)
|
|
3
3
|
*/
|
|
4
4
|
export declare function ensureRaw(val: unknown): unknown;
|
|
5
|
-
export declare function Raw(): (value: any, context: ClassFieldDecoratorContext | ClassAccessorDecoratorContext) => any;
|
|
6
|
-
export declare function Raw(value: any, context: ClassFieldDecoratorContext
|
|
5
|
+
export declare function Raw(): (value: any, context: ClassFieldDecoratorContext | ClassAccessorDecoratorContext | ClassDecoratorContext) => any;
|
|
6
|
+
export declare function Raw(value: any, context: ClassFieldDecoratorContext): void;
|
|
7
|
+
export declare function Raw(value: any, context: ClassAccessorDecoratorContext): ClassAccessorDecoratorResult<any, any>;
|
|
8
|
+
export declare function Raw(value: any, context: ClassDecoratorContext): void;
|
package/dist/raw.d.ts
CHANGED
|
@@ -2,5 +2,7 @@
|
|
|
2
2
|
* 将值标记为 raw(如果是对象则调用 markRaw,否则原样返回)
|
|
3
3
|
*/
|
|
4
4
|
export declare function ensureRaw(val: unknown): unknown;
|
|
5
|
-
export declare function Raw(): (value: any, context: ClassFieldDecoratorContext | ClassAccessorDecoratorContext) => any;
|
|
6
|
-
export declare function Raw(value: any, context: ClassFieldDecoratorContext
|
|
5
|
+
export declare function Raw(): (value: any, context: ClassFieldDecoratorContext | ClassAccessorDecoratorContext | ClassDecoratorContext) => any;
|
|
6
|
+
export declare function Raw(value: any, context: ClassFieldDecoratorContext): void;
|
|
7
|
+
export declare function Raw(value: any, context: ClassAccessorDecoratorContext): ClassAccessorDecoratorResult<any, any>;
|
|
8
|
+
export declare function Raw(value: any, context: ClassDecoratorContext): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaokei/use-vue-service",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Lightweight Vue 3 state management with dependency injection, inspired by Angular services.",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
"coverage": "vitest run --coverage",
|
|
44
44
|
"build": "vue-tsc -b tsconfig.app.json && vite build",
|
|
45
45
|
"clean": "rm -rf dist/*",
|
|
46
|
-
"public": "npm publish --access public",
|
|
47
46
|
"postpublish": "git push origin --follow-tags",
|
|
48
47
|
"prepublishOnly": "npm run clean && npm run build",
|
|
49
48
|
"release": "standard-version -r",
|
|
@@ -53,10 +52,10 @@
|
|
|
53
52
|
"docs:preview": "vitepress preview docs"
|
|
54
53
|
},
|
|
55
54
|
"peerDependencies": {
|
|
56
|
-
"@kaokei/di": "^5.0.
|
|
55
|
+
"@kaokei/di": "^5.0.8"
|
|
57
56
|
},
|
|
58
57
|
"devDependencies": {
|
|
59
|
-
"@kaokei/di": "^5.0.
|
|
58
|
+
"@kaokei/di": "^5.0.8",
|
|
60
59
|
"@types/node": "^22.15.17",
|
|
61
60
|
"@vitejs/plugin-vue": "^6.0.0",
|
|
62
61
|
"@vitest/coverage-v8": "^3.1.1",
|
|
@@ -79,5 +78,8 @@
|
|
|
79
78
|
"reflect-metadata": "^0.2.2",
|
|
80
79
|
"unplugin-swc": "^1.5.9"
|
|
81
80
|
},
|
|
81
|
+
"publishConfig": {
|
|
82
|
+
"access": "public"
|
|
83
|
+
},
|
|
82
84
|
"packageManager": "pnpm@9.9.0+sha512.60c18acd138bff695d339be6ad13f7e936eea6745660d4cc4a776d5247c540d0edee1a563695c183a66eb917ef88f2b4feb1fc25f32a7adcadc7aaf3438e99c1"
|
|
83
85
|
}
|