@devvit/public-api 0.11.4-next-2024-12-04-1757fb455.0 → 0.11.4-next-2024-12-04-6662f7606.0
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/apis/ui/UIClient.d.ts.map +1 -1
- package/apis/ui/UIClient.js +4 -2
- package/devvit/internals/blocks/handler/UIClient.d.ts.map +1 -1
- package/devvit/internals/blocks/handler/UIClient.js +4 -2
- package/meta.json +5 -5
- package/meta.min.json +6 -6
- package/package.json +6 -6
- package/public-api.d.ts +20 -1
- package/public-api.iife.js +9 -5
- package/public-api.min.js +2 -2
- package/public-api.min.js.map +3 -3
- package/types/web-view-ui-client.d.ts +20 -1
- package/types/web-view-ui-client.d.ts.map +1 -1
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
import type { JSONValue } from '@devvit/shared-types/json.js';
|
|
2
2
|
export interface WebViewUIClient {
|
|
3
3
|
/**
|
|
4
|
-
* Send a message to a
|
|
4
|
+
* Send a message to a WebView in your UI
|
|
5
|
+
* Any WebView can receive this message. If your app contains different WebViews with specific
|
|
6
|
+
* IDs you can target a specific WebView with the alternate overload: postMessage('id', message);
|
|
7
|
+
*
|
|
5
8
|
* Message will arrive via window.onmessage and will be wrapped in an object:
|
|
6
9
|
* { type: 'devvit-message', data: { message } }
|
|
10
|
+
*
|
|
11
|
+
* If no WebViews are present an error will be logged to the console.
|
|
12
|
+
*
|
|
13
|
+
* @param message
|
|
14
|
+
*/
|
|
15
|
+
postMessage<T extends JSONValue>(message: T): void;
|
|
16
|
+
/**
|
|
17
|
+
* Send a message to a specific WebView in your UI
|
|
18
|
+
*
|
|
19
|
+
* Message will arrive via window.onmessage and will be wrapped in an object:
|
|
20
|
+
* { type: 'devvit-message', data: { message } }
|
|
21
|
+
*
|
|
22
|
+
* If a WebView with the given ID is not found an error will be logged to the console.
|
|
23
|
+
*
|
|
24
|
+
* @param webviewId
|
|
25
|
+
* @param message
|
|
7
26
|
*/
|
|
8
27
|
postMessage<T extends JSONValue>(webviewId: string, message: T): void;
|
|
9
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-view-ui-client.d.ts","sourceRoot":"","sources":["../../src/types/web-view-ui-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D,MAAM,WAAW,eAAe;
|
|
1
|
+
{"version":3,"file":"web-view-ui-client.d.ts","sourceRoot":"","sources":["../../src/types/web-view-ui-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D,MAAM,WAAW,eAAe;IAM9B;;;;;;;;;;;OAWG;IACH,WAAW,CAAC,CAAC,SAAS,SAAS,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC;IACnD;;;;;;;;;;OAUG;IACH,WAAW,CAAC,CAAC,SAAS,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC;CACvE"}
|