vue-fn 0.1.0-rc.2 → 0.1.0-rc.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.
@@ -0,0 +1,11 @@
1
+ import { Ref, ShallowRef, Reactive, ShallowReactive, WatchCallback } from 'vue';
2
+ type DomainAggState = DomainAggRefState | DomainAggReactiveState;
3
+ type DomainAggRefState = Readonly<Ref<any>> | Readonly<ShallowRef<any>>;
4
+ type DomainAggReactiveState = Readonly<Reactive<any>> | Readonly<ShallowReactive<any>>;
5
+ type DeepMutable<T> = {
6
+ -readonly [P in keyof T]: T[P] extends object ? DeepMutable<T[P]> : T[P];
7
+ };
8
+ type InferValue<T> = T extends Readonly<Ref<any>> | Readonly<ShallowRef<any>> ? DeepMutable<T['value']> : T extends Readonly<Reactive<infer R>> | Readonly<ShallowReactive<infer R>> ? DeepMutable<R> : never;
9
+ export declare function bindRef<STATE extends DomainAggState, T = InferValue<STATE>>(aggState: STATE, onChange: WatchCallback<T, T>, forceSync?: boolean): Ref<T>;
10
+ export declare function bindDeepRef<STATE extends DomainAggState, T = InferValue<STATE>>(aggState: STATE, onChange: WatchCallback<T, T>, forceSync?: boolean): Ref<T>;
11
+ export {};
@@ -0,0 +1,11 @@
1
+ import { Ref, ShallowRef, Reactive, ShallowReactive, WatchCallback } from '@vue/reactivity';
2
+ type DomainAggState = DomainAggRefState | DomainAggReactiveState;
3
+ type DomainAggRefState = Readonly<Ref<any>> | Readonly<ShallowRef<any>>;
4
+ type DomainAggReactiveState = Readonly<Reactive<any>> | Readonly<ShallowReactive<any>>;
5
+ type DeepMutable<T> = {
6
+ -readonly [P in keyof T]: T[P] extends object ? DeepMutable<T[P]> : T[P];
7
+ };
8
+ type InferValue<T> = T extends Readonly<Ref<any>> | Readonly<ShallowRef<any>> ? DeepMutable<T['value']> : T extends Readonly<Reactive<infer R>> | Readonly<ShallowReactive<infer R>> ? DeepMutable<R> : never;
9
+ export declare function bindRef<STATE extends DomainAggState, T = InferValue<STATE>>(aggState: STATE, onChange: WatchCallback<T, T>, forceSync?: boolean): Ref<T>;
10
+ export declare function bindDeepRef<STATE extends DomainAggState, T = InferValue<STATE>>(aggState: STATE, onChange: WatchCallback<T, T>, forceSync?: boolean): Ref<T>;
11
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-fn",
3
- "version": "0.1.0-rc.2",
3
+ "version": "0.1.0-rc.3",
4
4
  "description": "一个 vue3 的响应式函数工具包",
5
5
  "type": "module",
6
6
  "sideEffects": false,