@devvit/public-api 0.11.6 → 0.11.7-next-2025-01-28-9b10510e8.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/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 +16 -7
- package/public-api.iife.js +6 -6
- package/public-api.min.js +3 -3
- package/public-api.min.js.map +2 -2
- package/types/hooks.d.ts +15 -6
- package/types/hooks.d.ts.map +1 -1
- package/version.json +5 -5
|
@@ -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<From extends JSONValue = JSONValue, To extends JSONValue = JSONValue>(options: UseWebViewOptions<From, To>): UseWebViewResult<To>;
|
|
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,IAAI,SAAS,SAAS,GAAG,SAAS,EAAE,EAAE,SAAS,SAAS,GAAG,SAAS,EAC7F,OAAO,EAAE,iBAAiB,CAAC,IAAI,EAAE,EAAE,CAAC,GACnC,gBAAgB,CAAC,EAAE,CAAC,CAStB"}
|
package/meta.json
CHANGED
|
@@ -9580,7 +9580,7 @@
|
|
|
9580
9580
|
"format": "esm"
|
|
9581
9581
|
},
|
|
9582
9582
|
"src/types/hooks.ts": {
|
|
9583
|
-
"bytes":
|
|
9583
|
+
"bytes": 6020,
|
|
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": 3601,
|
|
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": 12734893
|
|
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": 6020,
|
|
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": 3601,
|
|
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": 1252243
|
|
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.
|
|
3
|
+
"version": "0.11.7-next-2025-01-28-9b10510e8.0",
|
|
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.
|
|
34
|
-
"@devvit/shared-types": "0.11.
|
|
33
|
+
"@devvit/protos": "0.11.7-next-2025-01-28-9b10510e8.0",
|
|
34
|
+
"@devvit/shared-types": "0.11.7-next-2025-01-28-9b10510e8.0",
|
|
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.
|
|
43
|
-
"@devvit/tsconfig": "0.11.
|
|
42
|
+
"@devvit/repo-tools": "0.11.7-next-2025-01-28-9b10510e8.0",
|
|
43
|
+
"@devvit/tsconfig": "0.11.7-next-2025-01-28-9b10510e8.0",
|
|
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": "bf176e9cc0332377b6a4dbf6825a1942529ba833"
|
|
67
67
|
}
|
package/public-api.d.ts
CHANGED
|
@@ -52666,26 +52666,35 @@ 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<From extends JSONValue = JSONValue, To extends JSONValue = JSONValue>(options: UseWebViewOptions<From, To>): UseWebViewResult<To>;
|
|
52670
52670
|
|
|
52671
|
-
|
|
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>;
|
|
52672
52676
|
|
|
52673
|
-
|
|
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> = {
|
|
52674
52682
|
/** Relative HTML asset filename like `foo/bar.html`. Defaults to index.html if omitted. */
|
|
52675
52683
|
url?: string;
|
|
52676
52684
|
/** Handle UI events originating from the web view to be handled by a Devvit app */
|
|
52677
|
-
onMessage: UseWebViewOnMessage<
|
|
52685
|
+
onMessage: UseWebViewOnMessage<From, To>;
|
|
52678
52686
|
/**
|
|
52679
52687
|
* The callback to run when the web view has been unmounted. Might be used to
|
|
52680
52688
|
* set state, stop or resume timers, or perform other tasks now that the web view is no longer visible.
|
|
52681
52689
|
* @deprecated use the page visibility API for now.
|
|
52682
52690
|
*/
|
|
52683
|
-
onUnmount?: (hook: UseWebViewResult) => void | Promise<void>;
|
|
52691
|
+
onUnmount?: (hook: UseWebViewResult<To>) => void | Promise<void>;
|
|
52684
52692
|
};
|
|
52685
52693
|
|
|
52686
|
-
|
|
52694
|
+
/** @template To Message from Devvit Blocks app to web view. */
|
|
52695
|
+
export declare type UseWebViewResult<To extends JSONValue = JSONValue> = {
|
|
52687
52696
|
/** Send a message to the web view */
|
|
52688
|
-
postMessage
|
|
52697
|
+
postMessage(message: To): void;
|
|
52689
52698
|
/** Initiate a request for the web view to open */
|
|
52690
52699
|
mount(): void;
|
|
52691
52700
|
};
|