@platformatic/globals 3.6.0 → 3.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.d.ts +9 -3
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -14,14 +14,20 @@ export interface InvalidateHttpCacheOptions {
|
|
|
14
14
|
|
|
15
15
|
// This is purposely a copy of the one in @platformatic/itc to avoid the dependency
|
|
16
16
|
export interface ITC {
|
|
17
|
-
send (
|
|
18
|
-
notify (
|
|
17
|
+
send (message: string, data: any, options?: Record<string, any>): Promise<any>
|
|
18
|
+
notify (message: string, data: any, options?: Record<string, any>): void
|
|
19
19
|
handle (message: string, handler: Handler): void
|
|
20
20
|
getHandler (message: string): Handler | undefined
|
|
21
21
|
listen (): void
|
|
22
22
|
close (): void
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
export interface MessagingApi {
|
|
26
|
+
send (name: string, message: string, data: any, options?: Record<string, any>): Promise<any>
|
|
27
|
+
notify (name: string, message: string, data: any): void
|
|
28
|
+
handle (message: string, handler: Handler): void
|
|
29
|
+
}
|
|
30
|
+
|
|
25
31
|
export interface PlatformaticGlobalInterface {
|
|
26
32
|
// Runtime
|
|
27
33
|
isBuilding: boolean
|
|
@@ -78,7 +84,7 @@ export interface PlatformaticGlobalInterface {
|
|
|
78
84
|
|
|
79
85
|
events: EventEmitter & { emitAndNotify: EventEmitter['emit'] }
|
|
80
86
|
itc: ITC
|
|
81
|
-
messaging:
|
|
87
|
+
messaging: MessagingApi
|
|
82
88
|
}
|
|
83
89
|
|
|
84
90
|
export type PlatformaticGlobal = Optional<PlatformaticGlobalInterface>
|