akanjs 2.3.13-rc.1 → 2.3.13-rc.2
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/package.json +1 -1
- package/signal/guard.ts +3 -3
- package/types/signal/guard.d.ts +2 -2
package/package.json
CHANGED
package/signal/guard.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Cls } from "akanjs/base";
|
|
1
|
+
import type { Cls, PromiseOrObject } from "akanjs/base";
|
|
2
2
|
import type { SignalContext } from "./signalContext";
|
|
3
3
|
|
|
4
4
|
export interface Guard {
|
|
5
|
-
canPass(context: SignalContext): boolean
|
|
5
|
+
canPass(context: SignalContext): PromiseOrObject<boolean>;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
export type GuardCls<Name extends string = string> = Cls<Guard, { readonly name: Name }>;
|
|
@@ -11,7 +11,7 @@ export type GuardCls<Name extends string = string> = Cls<Guard, { readonly name:
|
|
|
11
11
|
export const guard = <T extends string>(name: T): GuardCls<T> => {
|
|
12
12
|
return class Guard {
|
|
13
13
|
static name = name;
|
|
14
|
-
canPass(context: SignalContext): boolean {
|
|
14
|
+
canPass(context: SignalContext): PromiseOrObject<boolean> {
|
|
15
15
|
return true;
|
|
16
16
|
}
|
|
17
17
|
};
|
package/types/signal/guard.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Cls } from "akanjs/base";
|
|
1
|
+
import type { Cls, PromiseOrObject } from "akanjs/base";
|
|
2
2
|
import type { SignalContext } from "./signalContext.d.ts";
|
|
3
3
|
export interface Guard {
|
|
4
|
-
canPass(context: SignalContext): boolean
|
|
4
|
+
canPass(context: SignalContext): PromiseOrObject<boolean>;
|
|
5
5
|
}
|
|
6
6
|
export type GuardCls<Name extends string = string> = Cls<Guard, {
|
|
7
7
|
readonly name: Name;
|