datatype.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import { Observable } from "rxjs";
  2. import { LogSetting } from "../dependencies/log/type/datatype";
  3. import { BaseMessage } from "../dependencies/log/dependencies/msgutil/interface/export";
  4. type IncomingMessageSetting = LogSetting & {
  5. incomingObservable: Observable<BaseMessage>
  6. }
  7. // Incoming message Service Class
  8. export interface IncomingMessageServiceInterface {
  9. // Set default setting
  10. init(settings: IncomingMessageSetting): void;
  11. }
  12. // It can have an incoming and a target logging server. The tags are used to search for specific sets of messages from the logging server.
  13. export interface MessageSynchronisationServiceSetting {
  14. incomingSource: LogSettingwTags,
  15. target: LogSettingwTags,
  16. filters?: any
  17. }
  18. // Renew Structure To fix undefined issue at test3a.ts init()
  19. type LogSettingwTags = LogSetting & Tags & Filters
  20. interface Tags {
  21. tags: string[]
  22. }
  23. interface Filters {
  24. filters?: string[]
  25. }
  26. // Acknowledgement Service Class
  27. export interface MessageAuditorServiceInterface {
  28. // Set default setting
  29. init(settings: MessageSynchronisationServiceSetting): void;
  30. // Subscribe to trigger
  31. subscribe(obs: Observable<ErrorTrigger>): Observable<any>;
  32. }
  33. export interface ErrorTrigger {
  34. status: 0 | 1,
  35. message: any | string
  36. }