@devvit/public-api 0.11.6-next-2025-01-28-ba7ef7fe2.0 → 0.11.6
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/devvit/internals/blocks/handler/useWebView.d.ts +1 -1
- package/devvit/internals/blocks/handler/useWebView.d.ts.map +1 -1
- package/meta.json +3 -3
- package/meta.min.json +3 -3
- package/package.json +6 -6
- package/public-api.d.ts +7 -16
- package/public-api.iife.js +1 -1
- package/public-api.min.js +3 -3
- package/public-api.min.js.map +2 -2
- package/types/hooks.d.ts +6 -15
- package/types/hooks.d.ts.map +1 -1
|
@@ -3,5 +3,5 @@ import type { UseWebViewOptions, UseWebViewResult } from '../../../../index.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Use this hook to handle a web view's visibility state and any messages sent to your app.
|
|
5
5
|
* */
|
|
6
|
-
export declare function useWebView<
|
|
6
|
+
export declare function useWebView<T extends JSONValue = JSONValue>(options: UseWebViewOptions<T>): UseWebViewResult;
|
|
7
7
|
//# sourceMappingURL=useWebView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useWebView.d.ts","sourceRoot":"","sources":["../../../../../src/devvit/internals/blocks/handler/useWebView.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,EAEV,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAoF9B;;KAEK;AACL,wBAAgB,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"useWebView.d.ts","sourceRoot":"","sources":["../../../../../src/devvit/internals/blocks/handler/useWebView.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,KAAK,EAEV,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAoF9B;;KAEK;AACL,wBAAgB,UAAU,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,EACxD,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAC5B,gBAAgB,CASlB"}
|
package/meta.json
CHANGED
|
@@ -9580,7 +9580,7 @@
|
|
|
9580
9580
|
"format": "esm"
|
|
9581
9581
|
},
|
|
9582
9582
|
"src/types/hooks.ts": {
|
|
9583
|
-
"bytes":
|
|
9583
|
+
"bytes": 5593,
|
|
9584
9584
|
"imports": [],
|
|
9585
9585
|
"format": "esm"
|
|
9586
9586
|
},
|
|
@@ -11889,7 +11889,7 @@
|
|
|
11889
11889
|
"format": "esm"
|
|
11890
11890
|
},
|
|
11891
11891
|
"src/devvit/internals/blocks/handler/useWebView.ts": {
|
|
11892
|
-
"bytes":
|
|
11892
|
+
"bytes": 3561,
|
|
11893
11893
|
"imports": [
|
|
11894
11894
|
{
|
|
11895
11895
|
"path": "../protos/dist/index.js",
|
|
@@ -12988,7 +12988,7 @@
|
|
|
12988
12988
|
"bytesInOutput": 2975
|
|
12989
12989
|
}
|
|
12990
12990
|
},
|
|
12991
|
-
"bytes":
|
|
12991
|
+
"bytes": 12734253
|
|
12992
12992
|
}
|
|
12993
12993
|
}
|
|
12994
12994
|
}
|
package/meta.min.json
CHANGED
|
@@ -2435,7 +2435,7 @@
|
|
|
2435
2435
|
"format": "esm"
|
|
2436
2436
|
},
|
|
2437
2437
|
"src/types/hooks.ts": {
|
|
2438
|
-
"bytes":
|
|
2438
|
+
"bytes": 5593,
|
|
2439
2439
|
"imports": [],
|
|
2440
2440
|
"format": "esm"
|
|
2441
2441
|
},
|
|
@@ -4744,7 +4744,7 @@
|
|
|
4744
4744
|
"format": "esm"
|
|
4745
4745
|
},
|
|
4746
4746
|
"src/devvit/internals/blocks/handler/useWebView.ts": {
|
|
4747
|
-
"bytes":
|
|
4747
|
+
"bytes": 3561,
|
|
4748
4748
|
"imports": [
|
|
4749
4749
|
{
|
|
4750
4750
|
"path": "@devvit/protos",
|
|
@@ -4851,7 +4851,7 @@
|
|
|
4851
4851
|
"imports": [],
|
|
4852
4852
|
"exports": [],
|
|
4853
4853
|
"inputs": {},
|
|
4854
|
-
"bytes":
|
|
4854
|
+
"bytes": 1251764
|
|
4855
4855
|
},
|
|
4856
4856
|
"dist/public-api.min.js": {
|
|
4857
4857
|
"imports": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devvit/public-api",
|
|
3
|
-
"version": "0.11.6
|
|
3
|
+
"version": "0.11.6",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
},
|
|
31
31
|
"types": "./index.d.ts",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@devvit/protos": "0.11.6
|
|
34
|
-
"@devvit/shared-types": "0.11.6
|
|
33
|
+
"@devvit/protos": "0.11.6",
|
|
34
|
+
"@devvit/shared-types": "0.11.6",
|
|
35
35
|
"base64-js": "1.5.1",
|
|
36
36
|
"clone-deep": "4.0.1",
|
|
37
37
|
"core-js": "3.27.2",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@ampproject/filesize": "4.3.0",
|
|
42
|
-
"@devvit/repo-tools": "0.11.6
|
|
43
|
-
"@devvit/tsconfig": "0.11.6
|
|
42
|
+
"@devvit/repo-tools": "0.11.6",
|
|
43
|
+
"@devvit/tsconfig": "0.11.6",
|
|
44
44
|
"@microsoft/api-extractor": "7.41.0",
|
|
45
45
|
"@reddit/faceplate-ui": "18.0.1",
|
|
46
46
|
"@types/clone-deep": "4.0.1",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
"source": "./src/index.ts",
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "a7637e50d80052d422959f265487037a2fb036f5"
|
|
67
67
|
}
|
package/public-api.d.ts
CHANGED
|
@@ -52666,35 +52666,26 @@ export declare type UseStateResult<S> = [S, StateSetter<S>];
|
|
|
52666
52666
|
/**
|
|
52667
52667
|
* Use this hook to handle a web view's visibility state and any messages sent to your app.
|
|
52668
52668
|
* */
|
|
52669
|
-
export declare function useWebView<
|
|
52669
|
+
export declare function useWebView<T extends JSONValue = JSONValue>(options: UseWebViewOptions<T>): UseWebViewResult;
|
|
52670
52670
|
|
|
52671
|
-
|
|
52672
|
-
* @template From Message from web view to Devvit Blocks app.
|
|
52673
|
-
* @template To Message from Devvit Blocks app to web view.
|
|
52674
|
-
*/
|
|
52675
|
-
export declare type UseWebViewOnMessage<From extends JSONValue = JSONValue, To extends JSONValue = JSONValue> = (message: From, hook: UseWebViewResult<To>) => void | Promise<void>;
|
|
52671
|
+
export declare type UseWebViewOnMessage<T extends JSONValue = JSONValue> = (message: T, hook: UseWebViewResult) => void | Promise<void>;
|
|
52676
52672
|
|
|
52677
|
-
|
|
52678
|
-
* @template From Message from web view to Devvit Blocks app.
|
|
52679
|
-
* @template To Message from Devvit Blocks app to web view.
|
|
52680
|
-
*/
|
|
52681
|
-
export declare type UseWebViewOptions<From extends JSONValue = JSONValue, To extends JSONValue = JSONValue> = {
|
|
52673
|
+
export declare type UseWebViewOptions<T extends JSONValue = JSONValue> = {
|
|
52682
52674
|
/** Relative HTML asset filename like `foo/bar.html`. Defaults to index.html if omitted. */
|
|
52683
52675
|
url?: string;
|
|
52684
52676
|
/** Handle UI events originating from the web view to be handled by a Devvit app */
|
|
52685
|
-
onMessage: UseWebViewOnMessage<
|
|
52677
|
+
onMessage: UseWebViewOnMessage<T>;
|
|
52686
52678
|
/**
|
|
52687
52679
|
* The callback to run when the web view has been unmounted. Might be used to
|
|
52688
52680
|
* set state, stop or resume timers, or perform other tasks now that the web view is no longer visible.
|
|
52689
52681
|
* @deprecated use the page visibility API for now.
|
|
52690
52682
|
*/
|
|
52691
|
-
onUnmount?: (hook: UseWebViewResult
|
|
52683
|
+
onUnmount?: (hook: UseWebViewResult) => void | Promise<void>;
|
|
52692
52684
|
};
|
|
52693
52685
|
|
|
52694
|
-
|
|
52695
|
-
export declare type UseWebViewResult<To extends JSONValue = JSONValue> = {
|
|
52686
|
+
export declare type UseWebViewResult = {
|
|
52696
52687
|
/** Send a message to the web view */
|
|
52697
|
-
postMessage(message:
|
|
52688
|
+
postMessage<T extends JSONValue = JSONValue>(message: T): void;
|
|
52698
52689
|
/** Initiate a request for the web view to open */
|
|
52699
52690
|
mount(): void;
|
|
52700
52691
|
};
|