@akanjs/next 0.0.39 → 0.0.40

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.
Files changed (46) hide show
  1. package/csrTypes-B6ATv9-y.d.ts +88 -0
  2. package/index.d.ts +33 -0
  3. package/index.js +20 -2723
  4. package/package.json +2 -35
  5. package/src/bootCsr.d.ts +3 -0
  6. package/src/bootCsr.js +206 -0
  7. package/src/createNextMiddleware.d.ts +5 -0
  8. package/src/createNextMiddleware.js +88 -0
  9. package/src/createRobotPage.d.ts +5 -0
  10. package/src/createRobotPage.js +39 -0
  11. package/src/createSitemapPage.d.ts +5 -0
  12. package/src/createSitemapPage.js +34 -0
  13. package/src/index.d.ts +33 -0
  14. package/src/index.js +82 -0
  15. package/src/lazy.d.ts +8 -0
  16. package/src/lazy.js +40 -0
  17. package/src/makePageProto.d.ts +42 -0
  18. package/src/makePageProto.js +147 -0
  19. package/src/types.d.ts +9 -0
  20. package/src/types.js +15 -0
  21. package/src/useCamera.d.ts +11 -0
  22. package/src/useCamera.js +114 -0
  23. package/src/useCodepush.d.ts +51 -0
  24. package/src/useCodepush.js +115 -0
  25. package/src/useContact.d.ts +10 -0
  26. package/src/useContact.js +73 -0
  27. package/src/useCsrValues.d.ts +44 -0
  28. package/src/useCsrValues.js +924 -0
  29. package/src/useDebounce.d.ts +3 -0
  30. package/src/useDebounce.js +42 -0
  31. package/src/useFetch.d.ts +8 -0
  32. package/src/useFetch.js +54 -0
  33. package/src/useGeoLocation.d.ts +12 -0
  34. package/src/useGeoLocation.js +51 -0
  35. package/src/useHistory.d.ts +24 -0
  36. package/src/useHistory.js +88 -0
  37. package/src/useInterval.d.ts +5 -0
  38. package/src/useInterval.js +49 -0
  39. package/src/useLocation.d.ts +12 -0
  40. package/src/useLocation.js +92 -0
  41. package/src/usePurchase.d.ts +20 -0
  42. package/src/usePurchase.js +139 -0
  43. package/src/usePushNoti.d.ts +8 -0
  44. package/src/usePushNoti.js +68 -0
  45. package/src/useThrottle.d.ts +3 -0
  46. package/src/useThrottle.js +44 -0
@@ -0,0 +1,68 @@
1
+ "use client";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var usePushNoti_exports = {};
21
+ __export(usePushNoti_exports, {
22
+ usePushNoti: () => usePushNoti
23
+ });
24
+ module.exports = __toCommonJS(usePushNoti_exports);
25
+ var import_device = require("@capacitor/device");
26
+ var import_push_notifications = require("@capacitor/push-notifications");
27
+ var import_fcm = require("@capacitor-community/fcm");
28
+ const usePushNoti = /* @__PURE__ */ __name(() => {
29
+ const init = /* @__PURE__ */ __name(async () => {
30
+ const device = await import_device.Device.getInfo();
31
+ if (device.platform === "web") return;
32
+ void import_fcm.FCM.setAutoInit({
33
+ enabled: true
34
+ });
35
+ void import_push_notifications.PushNotifications.requestPermissions().then(async (result) => {
36
+ if (result.receive === "granted") {
37
+ await import_push_notifications.PushNotifications.register();
38
+ }
39
+ });
40
+ }, "init");
41
+ const checkPermission = /* @__PURE__ */ __name(async () => {
42
+ const { receive } = await import_push_notifications.PushNotifications.checkPermissions();
43
+ return receive === "granted";
44
+ }, "checkPermission");
45
+ const register = /* @__PURE__ */ __name(async () => {
46
+ const device = await import_device.Device.getInfo();
47
+ if (device.platform === "web") return;
48
+ const { receive } = await import_push_notifications.PushNotifications.checkPermissions();
49
+ if (receive === "denied") location.assign("app-settings:");
50
+ else await import_push_notifications.PushNotifications.register();
51
+ }, "register");
52
+ const getToken = /* @__PURE__ */ __name(async () => {
53
+ const device = await import_device.Device.getInfo();
54
+ if (device.platform === "web") return;
55
+ const { token } = await import_fcm.FCM.getToken();
56
+ return token;
57
+ }, "getToken");
58
+ return {
59
+ init,
60
+ checkPermission,
61
+ register,
62
+ getToken
63
+ };
64
+ }, "usePushNoti");
65
+ // Annotate the CommonJS export names for ESM import in node:
66
+ 0 && (module.exports = {
67
+ usePushNoti
68
+ });
@@ -0,0 +1,3 @@
1
+ declare const useThrottle: (func: (...args: any) => any, delay?: number, deps?: any[]) => (...args: any[]) => void;
2
+
3
+ export { useThrottle };
@@ -0,0 +1,44 @@
1
+ "use client";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var useThrottle_exports = {};
21
+ __export(useThrottle_exports, {
22
+ useThrottle: () => useThrottle
23
+ });
24
+ module.exports = __toCommonJS(useThrottle_exports);
25
+ var import_react = require("react");
26
+ const useThrottle = /* @__PURE__ */ __name((func, delay = 200, deps = []) => {
27
+ const throttleSeed = (0, import_react.useRef)(null);
28
+ const throttleFunction = (0, import_react.useCallback)((...args) => {
29
+ if (throttleSeed.current) return;
30
+ func(...args);
31
+ throttleSeed.current = setTimeout(() => {
32
+ throttleSeed.current = null;
33
+ }, delay);
34
+ }, [
35
+ func,
36
+ delay,
37
+ ...deps
38
+ ]);
39
+ return throttleFunction;
40
+ }, "useThrottle");
41
+ // Annotate the CommonJS export names for ESM import in node:
42
+ 0 && (module.exports = {
43
+ useThrottle
44
+ });