akanjs 2.3.13-rc.3 → 2.3.13
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
CHANGED
package/signal/guard.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Cls
|
|
1
|
+
import type { Cls } from "akanjs/base";
|
|
2
2
|
import type { SignalContext } from "./signalContext";
|
|
3
3
|
|
|
4
4
|
export interface Guard {
|
|
5
|
-
canPass(context: SignalContext):
|
|
5
|
+
canPass(context: SignalContext): 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):
|
|
14
|
+
canPass(context: SignalContext): boolean {
|
|
15
15
|
return true;
|
|
16
16
|
}
|
|
17
17
|
};
|
package/signal/signalContext.ts
CHANGED
|
@@ -99,11 +99,6 @@ export class SignalContext<
|
|
|
99
99
|
}
|
|
100
100
|
return instance as T;
|
|
101
101
|
}
|
|
102
|
-
getService<T>(refName: string): T {
|
|
103
|
-
const service = this.#live.service.get(refName);
|
|
104
|
-
if (!service) throw new Exception.Error(`Service "${refName}" not found in live registry`);
|
|
105
|
-
return service as T;
|
|
106
|
-
}
|
|
107
102
|
async init() {
|
|
108
103
|
if (this.trace) {
|
|
109
104
|
const start = performance.now();
|
package/types/signal/guard.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Cls
|
|
1
|
+
import type { Cls } from "akanjs/base";
|
|
2
2
|
import type { SignalContext } from "./signalContext.d.ts";
|
|
3
3
|
export interface Guard {
|
|
4
|
-
canPass(context: SignalContext):
|
|
4
|
+
canPass(context: SignalContext): boolean;
|
|
5
5
|
}
|
|
6
6
|
export type GuardCls<Name extends string = string> = Cls<Guard, {
|
|
7
7
|
readonly name: Name;
|
|
@@ -30,7 +30,6 @@ export declare class SignalContext<Ctx extends HttpExecutionContext | WebSocketE
|
|
|
30
30
|
middleware: Map<string, MiddlewareCls>;
|
|
31
31
|
});
|
|
32
32
|
getAdaptor<T extends Adaptor>(adaptorCls: AdaptorCls<T>): T;
|
|
33
|
-
getService<T>(refName: string): T;
|
|
34
33
|
init(): Promise<this>;
|
|
35
34
|
exec(): Promise<Response | undefined>;
|
|
36
35
|
static try(endpoint: Adaptor, endpointInfo: EndpointInfo, key: string, fn: () => Promise<Response | undefined>): Promise<Response | undefined>;
|
package/types/ui/Load/Units.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ interface DefaultProps<L extends {
|
|
|
13
13
|
loading?: ReactNode;
|
|
14
14
|
filter?: (item: L, idx: number) => boolean;
|
|
15
15
|
sort?: (a: L, b: L) => number;
|
|
16
|
-
renderEmpty?: null | (() => ReactNode)
|
|
16
|
+
renderEmpty?: null | (() => ReactNode);
|
|
17
17
|
renderItem?: (item: L, idx: number) => ReactNode;
|
|
18
18
|
renderList?: (list: DataList<L>) => ReactNode;
|
|
19
19
|
reverse?: boolean;
|
package/ui/Load/Units.tsx
CHANGED
|
@@ -23,7 +23,7 @@ interface DefaultProps<L extends { id: string }> {
|
|
|
23
23
|
loading?: ReactNode;
|
|
24
24
|
filter?: (item: L, idx: number) => boolean;
|
|
25
25
|
sort?: (a: L, b: L) => number;
|
|
26
|
-
renderEmpty?: null | (() => ReactNode)
|
|
26
|
+
renderEmpty?: null | (() => ReactNode);
|
|
27
27
|
renderItem?: (item: L, idx: number) => ReactNode;
|
|
28
28
|
renderList?: (list: DataList<L>) => ReactNode;
|
|
29
29
|
reverse?: boolean;
|
|
@@ -172,7 +172,7 @@ function Render<RefName extends string, Light extends { id: string }>({
|
|
|
172
172
|
if (renderList)
|
|
173
173
|
return (
|
|
174
174
|
<>
|
|
175
|
-
{modelDataList.length
|
|
175
|
+
{modelDataList.length ? (
|
|
176
176
|
<ContainerWrapper
|
|
177
177
|
containerRef={containerRef}
|
|
178
178
|
className={clsx(className, {
|