Files
certd/packages/core/pipeline/src/access/api.ts
T

25 lines
608 B
TypeScript
Raw Normal View History

2022-10-26 09:02:47 +08:00
import { Registrable } from "../registry";
2022-10-27 09:26:32 +08:00
import { accessRegistry } from "./registry";
2022-10-31 21:27:32 +08:00
import { FormItemProps } from "../d.ts";
2022-11-07 23:31:20 +08:00
import { AbstractAccess } from "./abstract-access";
2022-10-26 09:02:47 +08:00
2022-10-31 21:27:32 +08:00
export type AccessInput = FormItemProps & {
title: string;
required?: boolean;
};
2022-10-26 09:02:47 +08:00
export type AccessDefine = Registrable & {
input: {
2022-10-31 21:27:32 +08:00
[key: string]: AccessInput;
2022-10-26 09:02:47 +08:00
};
};
export function IsAccess(define: AccessDefine) {
return function (target: any) {
2022-10-26 23:29:10 +08:00
target.prototype.define = define;
2022-10-27 09:26:32 +08:00
accessRegistry.install(target);
2022-10-26 09:02:47 +08:00
};
}
2022-11-07 23:31:20 +08:00
export interface IAccessService {
getById(id: any): Promise<AbstractAccess>;
}