More setup and an example componente
This commit is contained in:
+18
-7
@@ -1,12 +1,23 @@
|
||||
type ServerConfig = {
|
||||
bindName: string;
|
||||
bindPort: number;
|
||||
}
|
||||
import { types } from "@aas-core-works/aas-core3.0rc02-typescript";
|
||||
|
||||
export abstract class AASInterfaceServer {
|
||||
public abstract readonly name: string;
|
||||
public abstract config: ServerConfig;
|
||||
export type PossibleRequests = "TODO";
|
||||
|
||||
export type OnRequestCallback = (request: PossibleRequests) => void
|
||||
|
||||
export default abstract class AASInterfaceServer<ConfigInterface> {
|
||||
protected abstract readonly name: string;
|
||||
protected config: ConfigInterface;
|
||||
private onRequestCallback: OnRequestCallback;
|
||||
|
||||
constructor(config: ConfigInterface, aas: types.Environment, onRequestCallback: OnRequestCallback) {
|
||||
this.config = config;
|
||||
this.onRequestCallback = onRequestCallback;
|
||||
}
|
||||
|
||||
public abstract prepare(): void;
|
||||
public abstract run(): void;
|
||||
public abstract stop(): void;
|
||||
public abstract notify(event: any): void;
|
||||
|
||||
protected abstract findElementByRequest(request: PossibleRequests): any | null;
|
||||
}
|
||||
Reference in New Issue
Block a user