Begin request typing

This commit is contained in:
Daniel Kluge
2023-10-30 10:45:48 +01:00
parent 46d1a6e9a8
commit a38fcbe18a
2 changed files with 14 additions and 11 deletions
+4 -9
View File
@@ -11,15 +11,10 @@ export default abstract class InterfaceConnectionObject<ConfigInterface> {
protected abstract readonly connectionType: ConnectionType; protected abstract readonly connectionType: ConnectionType;
protected abstract readonly supportsSubscriptions: boolean; protected abstract readonly supportsSubscriptions: boolean;
protected readonly connectionParameter: ConfigInterface; public constructor(
protected readonly endpointMetadata: EndpointMetadata; protected readonly connectionParameter: ConfigInterface,
private readonly onResponseCallback: OnResponseCallback; protected readonly endpointMetadata: EndpointMetadata,
private readonly onResponseCallback: OnResponseCallback) {}
public constructor(connectionParameter: ConfigInterface, endpointMetadata: EndpointMetadata, onResponseCallback: OnResponseCallback) {
this.connectionParameter = connectionParameter;
this.endpointMetadata = endpointMetadata;
this.onResponseCallback = onResponseCallback;
}
public abstract connect(): boolean; public abstract connect(): boolean;
+9 -1
View File
@@ -1,3 +1,11 @@
export type Request = "TODO" import { types } from "@aas-core-works/aas-core3.0-typescript";
export type Request = {
type: RequestType;
target: types.Reference | types.Class | string[];
extraData?: any;
}
export type OnRequestCallback = (request: Request) => void export type OnRequestCallback = (request: Request) => void
type RequestType = "READ" | "WRITE" | "OBSERVE" | "CALL" | "CALL-ASYNC" | "GET-OP-STATE" | "GET-OP-RESULT" | "SUBSCRIBE" | "UNSUBSCRIBE"