Documentation should be done

This commit is contained in:
Daniel Kluge
2023-11-02 18:29:04 +01:00
parent 591cf6662b
commit 819a0b1a72
21 changed files with 571 additions and 29 deletions
+18 -1
View File
@@ -6,18 +6,25 @@ import type { OnRequestCallback } from "./types/requests";
* This should be used as base class for your own interface servers!
*
* @typeParam ConfigInterface - The config interface for your interface server.
* @public
*/
export default abstract class AASInterfaceServer<ConfigInterface> {
/**
* A name for your interface server.
* @remarks
* Currently unused
* @public
* @readonly
* @virtual
*/
public static readonly serverInterfaceName: string;
/**
* Whether your interface server supports subscriptions.
* @remarks
* Currently unused
* @public
* @readonly
* @virtual
*/
public static readonly supportsSubscriptions: boolean;
@@ -26,8 +33,10 @@ export default abstract class AASInterfaceServer<ConfigInterface> {
* @param config Interface server config
* @param aas AAS Environment for the server
* @param onRequestCallback Callback when a request is received and parsed
* @public
* @sealed
*/
constructor(
public constructor(
protected readonly config: ConfigInterface,
protected readonly aas: types.Environment,
protected readonly onRequestCallback: OnRequestCallback) {}
@@ -36,19 +45,27 @@ export default abstract class AASInterfaceServer<ConfigInterface> {
* Prepare the interface server.
* @remarks
* Here you can create routes, listeners, callbacks,...
* @virtual
* @public
*/
public abstract prepare(): void;
/**
* Run the interface server.
* @public
* @virtual
*/
public abstract run(): void;
/**
* Stop the interface server.
* @public
* @virtual
*/
public abstract stop(): void;
/**
* Notify observers/subscribers about an event.
* @param event Event to notify the interface server about
* @public
* @virtual
*/
public abstract notify(event: any): void;