vue-fn 0.1.0-beta.1 → 0.1.0-rc.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/domain/agg.d.ts +1 -1
- package/domain/common.d.ts +0 -8
- package/domain/event.d.ts +34 -24
- package/domain/index.mjs +250 -263
- package/domain/index.mjs.map +1 -1
- package/domain/plugin.d.ts +16 -38
- package/domain-server/agg.d.ts +1 -1
- package/domain-server/common.d.ts +0 -8
- package/domain-server/event.d.ts +34 -24
- package/domain-server/index.mjs +250 -263
- package/domain-server/index.mjs.map +1 -1
- package/domain-server/plugin.d.ts +16 -38
- package/index.browser-DzRLzC85.js +38 -0
- package/index.browser-DzRLzC85.js.map +1 -0
- package/package.json +4 -2
- package/pure-domain/agg.d.ts +0 -0
- package/pure-domain/event.d.ts +42 -0
- package/pure-domain/index.d.ts +0 -0
- package/pure-domain/index.mjs +2 -0
- package/pure-domain/index.mjs.map +1 -0
- package/pure-domain/package.json +5 -0
- package/pure-domain/state.d.ts +7 -0
- package/shared-domain/index.mjs +10 -3
- package/shared-domain/index.mjs.map +1 -1
- package/timer/index.mjs.map +1 -1
- package/index.browser-CWCjzKuA.js +0 -11
- package/index.browser-CWCjzKuA.js.map +0 -1
package/domain/agg.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ type AddDestroyedEventApi<T extends object, K = 'destroyed'> = keyof T extends n
|
|
|
7
7
|
} & {
|
|
8
8
|
destroyed: DomainDestroyedEventApi;
|
|
9
9
|
};
|
|
10
|
-
type InferDomainEvent<EVENT extends DomainEvent<any, any>> = EVENT extends DomainBroadcastEvent<infer DATA> ? DomainBroadcastEvent<DATA> : EVENT extends DomainRequestEvent<infer DATA, infer
|
|
10
|
+
type InferDomainEvent<EVENT extends DomainEvent<any, any>> = EVENT extends DomainBroadcastEvent<infer DATA> ? DomainBroadcastEvent<DATA> : EVENT extends DomainRequestEvent<infer DATA, infer REPLY_DATA> ? DomainRequestEvent<DATA, REPLY_DATA> : never;
|
|
11
11
|
type InferDomainEventApi<EVENT extends DomainEvent<any, any>> = InferDomainEvent<EVENT>['api'];
|
|
12
12
|
type CustomerStateRecords<T> = keyof T extends never ? {} : Record<string, object>;
|
|
13
13
|
type CustomerCommandRecords<T> = keyof T extends never ? {} : Record<string, Function>;
|
package/domain/common.d.ts
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
import { ComputedRef } from 'vue';
|
|
2
|
-
export declare function createPromiseCallback<CALLBACK extends (...args: any[]) => Error | void>(callback: CALLBACK, finishOnError?: boolean, timeoutMs?: number | false): {
|
|
3
|
-
promise: Promise<void>;
|
|
4
|
-
callback: CALLBACK;
|
|
5
|
-
onError: (e: Error) => void;
|
|
6
|
-
resolved: ComputedRef<boolean>;
|
|
7
|
-
error: ComputedRef<Error | undefined>;
|
|
8
|
-
};
|
|
9
1
|
export declare function genId(): string;
|
package/domain/event.d.ts
CHANGED
|
@@ -1,33 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export type
|
|
3
|
-
|
|
1
|
+
import { DeepReadonly, UnwrapNestedRefs } from 'vue';
|
|
2
|
+
export type DomainRequestEventOptions<DATA, ON_REPLY extends (data: any) => void> = {
|
|
3
|
+
dataType?: DATA;
|
|
4
|
+
onReply: ON_REPLY;
|
|
5
|
+
onError?: (e: Error) => void;
|
|
6
|
+
maxListenerCount?: number;
|
|
7
|
+
isTerminateOnError?: boolean;
|
|
8
|
+
timeoutMs?: number | false;
|
|
4
9
|
};
|
|
5
|
-
export type
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export type DomainRequestEvent<DATA extends DomainEventData, REPLY extends DomainRequestEventReply> = {
|
|
9
|
-
watchHandles: WatchHandle[];
|
|
10
|
-
publishRequest: (data: UnwrapNestedRefs<DATA>) => Promise<void>;
|
|
10
|
+
export type DomainRequestEvent<DATA, REPLY_DATA> = {
|
|
11
|
+
listeners: DomainRequestEventListener<DATA, REPLY_DATA>[];
|
|
12
|
+
publishRequest: (data: DeepReadonly<UnwrapNestedRefs<DATA>>) => Promise<REPLY_DATA>;
|
|
11
13
|
api: {
|
|
12
|
-
latestVersion:
|
|
13
|
-
|
|
14
|
-
data: DeepReadonly<UnwrapNestedRefs<DATA>>;
|
|
15
|
-
version: string;
|
|
16
|
-
reply: REPLY;
|
|
17
|
-
}) => void) => WatchHandle;
|
|
14
|
+
latestVersion: Readonly<string>;
|
|
15
|
+
listenAndReply: (replyFn: DomainRequestEventListener<DATA, REPLY_DATA>) => () => void;
|
|
18
16
|
};
|
|
19
17
|
};
|
|
20
|
-
export type
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
export type DomainRequestEventListener<DATA, REPLY_DATA> = (param: {
|
|
19
|
+
data: DeepReadonly<UnwrapNestedRefs<DATA>>;
|
|
20
|
+
version: string;
|
|
21
|
+
}) => REPLY_DATA;
|
|
22
|
+
export type DomainBroadcastEvent<DATA> = {
|
|
23
|
+
listeners: DomainBroadcastEventListener<DATA>[];
|
|
24
|
+
publish: (data: DeepReadonly<UnwrapNestedRefs<DATA>>) => void;
|
|
23
25
|
api: {
|
|
24
|
-
latestVersion:
|
|
25
|
-
|
|
26
|
+
latestVersion: Readonly<string>;
|
|
27
|
+
listen: (cb: (event: {
|
|
26
28
|
data: DeepReadonly<UnwrapNestedRefs<DATA>>;
|
|
27
29
|
version: string;
|
|
28
|
-
}) => void) =>
|
|
30
|
+
}) => void) => () => void;
|
|
29
31
|
};
|
|
30
32
|
};
|
|
31
|
-
export
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
export type DomainBroadcastEventListener<DATA> = (param: {
|
|
34
|
+
data: DeepReadonly<UnwrapNestedRefs<DATA>>;
|
|
35
|
+
version: string;
|
|
36
|
+
}) => void;
|
|
37
|
+
export type DomainDestroyedEventApi = DomainBroadcastEvent<{}>['api'];
|
|
38
|
+
export type DomainEvent<DATA, REPLY_DATA> = DomainRequestEvent<DATA, REPLY_DATA> | DomainBroadcastEvent<DATA>;
|
|
39
|
+
export declare function createRequestEvent<DATA extends object = {}>(_dataType?: DATA): {
|
|
40
|
+
options: <ON_REPLY extends (replyData: any) => void, REPLY_DATA = Parameters<ON_REPLY>[0]>(options: DomainRequestEventOptions<DATA, ON_REPLY>) => DomainRequestEvent<DATA, REPLY_DATA>;
|
|
41
|
+
};
|
|
42
|
+
export declare function createBroadcastEvent<DATA extends object = {}>(_?: DATA): DomainBroadcastEvent<DATA>;
|
|
43
|
+
export declare function largeNumberIncrease(num1: string): string;
|