vue-fn 0.1.0-rc.4 → 0.1.0-rc.5
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/domain/agg.d.ts +3 -3
- package/domain/bind.d.ts +7 -5
- package/domain/common.d.ts +2 -0
- package/domain/index.d.ts +1 -1
- package/domain/index.mjs +314 -253
- package/domain/index.mjs.map +1 -1
- package/domain-server/agg.d.ts +3 -3
- package/domain-server/bind.d.ts +7 -5
- package/domain-server/common.d.ts +2 -0
- package/domain-server/index.d.ts +1 -1
- package/domain-server/index.mjs +314 -253
- package/domain-server/index.mjs.map +1 -1
- package/package.json +1 -1
package/domain/agg.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type DomainBroadcastEvent, type DomainDestroyedEventApi, DomainEvent, DomainRequestEvent } from './event';
|
|
1
|
+
import { type DeepReadonly, type EffectScope, type ComputedRef } from 'vue';
|
|
2
|
+
import { type DomainBroadcastEvent, type DomainDestroyedEventApi, type DomainEvent, type DomainRequestEvent } from './event';
|
|
3
3
|
type AddDestroyedEventApi<T extends object, K = 'destroyed'> = keyof T extends never ? {
|
|
4
4
|
destroyed: DomainDestroyedEventApi;
|
|
5
5
|
} : {
|
|
@@ -16,7 +16,7 @@ type CustomerEventRecords<T> = keyof T extends never ? {} : {
|
|
|
16
16
|
};
|
|
17
17
|
export type DomainDestroyFunction = (...args: any[]) => void;
|
|
18
18
|
export type DomainStatesApi<STATES extends CustomerStateRecords<any>> = Readonly<{
|
|
19
|
-
[K in keyof STATES]: DeepReadonly<
|
|
19
|
+
[K in keyof STATES]: DeepReadonly<STATES[K]>;
|
|
20
20
|
}>;
|
|
21
21
|
export type DomainCommandsApi<COMMANDS extends CustomerCommandRecords<any>> = Readonly<{
|
|
22
22
|
[K in keyof COMMANDS]: COMMANDS[K] extends Function ? COMMANDS[K] : never;
|
package/domain/bind.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { Ref, ShallowRef, Reactive, ShallowReactive, WatchCallback } from 'vue';
|
|
1
|
+
import { Ref, ShallowRef, Reactive, ShallowReactive, WatchCallback, WatchOptions } from 'vue';
|
|
2
2
|
type DomainAggState = DomainAggRefState | DomainAggReactiveState;
|
|
3
3
|
type DomainAggRefState = Readonly<Ref<any>> | Readonly<ShallowRef<any>>;
|
|
4
|
-
type DomainAggReactiveState = Readonly<Reactive<
|
|
4
|
+
type DomainAggReactiveState = Readonly<Reactive<object>> | Readonly<ShallowReactive<object>>;
|
|
5
|
+
type SingleFieldRef = () => any;
|
|
5
6
|
type DeepMutable<T> = {
|
|
6
7
|
-readonly [P in keyof T]: T[P] extends object ? DeepMutable<T[P]> : T[P];
|
|
7
8
|
};
|
|
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
|
|
10
|
-
|
|
9
|
+
type InferValue<T> = T extends () => infer R ? R : T extends Readonly<Ref<any>> | Readonly<ShallowRef<any>> | Ref<any> | ShallowRef<any> ? DeepMutable<T['value']> : T extends Readonly<Reactive<infer R>> | Readonly<ShallowReactive<infer R>> | Reactive<infer R> ? DeepMutable<R> : never;
|
|
10
|
+
export declare function bindRef<STATE extends DomainAggState | SingleFieldRef, T extends InferValue<STATE>>(aggState: STATE, onChange: WatchCallback<T>, watchOptions?: WatchOptions & {
|
|
11
|
+
forceSync?: boolean;
|
|
12
|
+
}): Ref<T>;
|
|
11
13
|
export {};
|
package/domain/common.d.ts
CHANGED
package/domain/index.d.ts
CHANGED
|
@@ -4,5 +4,5 @@ export type { DomainPlugin, DomainHotSwapPlugin, DomainSetupPlugin } from './plu
|
|
|
4
4
|
export { createPluginHelperByAgg, createPluginHelperByAggCreator } from './plugin';
|
|
5
5
|
export type { DomainSingletonAgg, DomainMultiInstanceAgg } from './agg';
|
|
6
6
|
export { createSingletonAgg, createMultiInstanceAgg } from './agg';
|
|
7
|
-
export { bindRef
|
|
7
|
+
export { bindRef } from './bind';
|
|
8
8
|
export * as Utils from './common';
|