@kokimoki/app 0.6.7 → 0.6.9

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.
@@ -51,5 +51,6 @@ export declare class KokimokiClient<StatelessDataT = any, ClientContextT = any>
51
51
  acknowledged: boolean;
52
52
  deletedCount: number;
53
53
  }>;
54
+ exposeScriptingContext(context: any): Promise<void>;
54
55
  }
55
56
  export {};
@@ -81,9 +81,12 @@ export class KokimokiClient extends EventEmitter {
81
81
  });
82
82
  // Ping interval
83
83
  setInterval(() => {
84
- this.checkConnectionState();
85
84
  this._providers.forEach((provider) => provider.sendStateless("ping"));
86
85
  }, 5000);
86
+ // Connection state interval
87
+ setInterval(() => {
88
+ this.checkConnectionState();
89
+ }, 1000);
87
90
  // Check initial connected state
88
91
  this.receivePong();
89
92
  }
@@ -124,7 +127,7 @@ export class KokimokiClient extends EventEmitter {
124
127
  // Handle incoming stateless messages
125
128
  provider.on("stateless", (e) => {
126
129
  if (e.payload === "pong") {
127
- this._lastPongAt = Date.now();
130
+ this.receivePong();
128
131
  return;
129
132
  }
130
133
  const payload = JSON.parse(e.payload);
@@ -238,4 +241,10 @@ export class KokimokiClient extends EventEmitter {
238
241
  });
239
242
  return await res.json();
240
243
  }
244
+ async exposeScriptingContext(context) {
245
+ // @ts-ignore
246
+ window.KM_SCRIPTING_CONTEXT = context;
247
+ // @ts-ignore
248
+ window.dispatchEvent(new CustomEvent("km:scriptingContextExposed"));
249
+ }
241
250
  }
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const KOKIMOKI_APP_VERSION = "0.6.7";
1
+ export declare const KOKIMOKI_APP_VERSION = "0.6.9";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const KOKIMOKI_APP_VERSION = "0.6.7";
1
+ export const KOKIMOKI_APP_VERSION = "0.6.9";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kokimoki/app",
3
- "version": "0.6.7",
3
+ "version": "0.6.9",
4
4
  "type": "module",
5
5
  "description": "Kokimoki app",
6
6
  "main": "dist/index.js",