30 lines
770 B
TypeScript
30 lines
770 B
TypeScript
import * as plugins from './sdk.plugins';
|
|
import { AuthInfo } from './sdk.classes.authinfo';
|
|
import { AgEnvironment } from './sdk.classes.agenvironment';
|
|
|
|
export interface IRequirementResult {
|
|
allOk: boolean;
|
|
reason: string;
|
|
}
|
|
|
|
export abstract class AAgHandler<TClaim> {
|
|
public agEnvironment: AgEnvironment;
|
|
|
|
/**
|
|
* a slug that separates the handler from other handlers
|
|
*/
|
|
public abstract slug: string;
|
|
public abstract typedrouter: plugins.typedrequest.TypedRouter;
|
|
public abstract checkRequirements(): Promise<IRequirementResult>;
|
|
|
|
constructor(agEnvironmentArg: AgEnvironment) {
|
|
this.agEnvironment = agEnvironmentArg;
|
|
}
|
|
|
|
/**
|
|
* start the ag-handler
|
|
*/
|
|
public abstract start(): Promise<any>;
|
|
public abstract stop(): Promise<any>;
|
|
}
|