More setup and an example componente

This commit is contained in:
Daniel Kluge
2023-10-16 18:29:16 +02:00
parent 2bf455b44a
commit 99fd86ff95
11 changed files with 1692 additions and 74 deletions
+18 -7
View File
@@ -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;
}