@akanjs/next 0.0.39 → 0.0.41
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/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/bootCsr.d.ts +1 -0
- package/src/createNextMiddleware.d.ts +2 -0
- package/src/createRobotPage.d.ts +2 -0
- package/src/createSitemapPage.d.ts +2 -0
- package/src/index.d.ts +20 -0
- package/src/lazy.d.ts +5 -0
- package/src/makePageProto.d.ts +30 -0
- package/src/types.d.ts +7 -0
- package/src/useCamera.d.ts +7 -0
- package/src/useCodepush.d.ts +17 -0
- package/src/useContact.d.ts +6 -0
- package/src/useCsrValues.d.ts +30 -0
- package/src/useDebounce.d.ts +1 -0
- package/src/useFetch.d.ts +6 -0
- package/src/useGeoLocation.d.ts +7 -0
- package/src/useHistory.d.ts +20 -0
- package/src/useInterval.d.ts +1 -0
- package/src/useLocation.d.ts +8 -0
- package/src/usePurchase.d.ts +19 -0
- package/src/usePushNoti.d.ts +6 -0
- package/src/useThrottle.d.ts +1 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./src";
|
package/package.json
CHANGED
package/src/bootCsr.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const bootCsr: (context: Record<string, () => Promise<unknown>>, rootPath: string, entryPath?: string) => Promise<void>;
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type * from "./types";
|
|
2
|
+
export { useFetch } from "./useFetch";
|
|
3
|
+
export { lazy } from "./lazy";
|
|
4
|
+
export { makePageProto } from "./makePageProto";
|
|
5
|
+
export { useDebounce } from "./useDebounce";
|
|
6
|
+
export { useInterval } from "./useInterval";
|
|
7
|
+
export { bootCsr } from "./bootCsr";
|
|
8
|
+
export { useCamera } from "./useCamera";
|
|
9
|
+
export { useContact } from "./useContact";
|
|
10
|
+
export { usePushNoti } from "./usePushNoti";
|
|
11
|
+
export { useGeoLocation } from "./useGeoLocation";
|
|
12
|
+
export { useCodepush } from "./useCodepush";
|
|
13
|
+
export { usePurchase, type PlatformType, type ProductType, type CdvProductType } from "./usePurchase";
|
|
14
|
+
export { useCsrValues } from "./useCsrValues";
|
|
15
|
+
export { createRobotPage } from "./createRobotPage";
|
|
16
|
+
export { createSitemapPage } from "./createSitemapPage";
|
|
17
|
+
export { createNextMiddleware } from "./createNextMiddleware";
|
|
18
|
+
export { useThrottle } from "./useThrottle";
|
|
19
|
+
export { useHistory } from "./useHistory";
|
|
20
|
+
export { useLocation } from "./useLocation";
|
package/src/lazy.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type Translation, type TransMessage } from "@akanjs/dictionary";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
export declare const makePageProto: <Locale extends {
|
|
4
|
+
[key: string]: {
|
|
5
|
+
[key: string]: Translation;
|
|
6
|
+
};
|
|
7
|
+
}>(locales: Locale[]) => () => {
|
|
8
|
+
path: string;
|
|
9
|
+
l: {
|
|
10
|
+
(key: TransMessage<Locale>, param?: {
|
|
11
|
+
[key: string]: string | number;
|
|
12
|
+
}): string;
|
|
13
|
+
rich(key: TransMessage<Locale>, param?: {
|
|
14
|
+
[key: string]: string | number;
|
|
15
|
+
}): ReactNode;
|
|
16
|
+
field<ModelKey extends keyof Locale>(model: ModelKey, field: keyof Locale[ModelKey]): string;
|
|
17
|
+
desc<ModelKey extends keyof Locale>(model: ModelKey, field: keyof Locale[ModelKey]): string;
|
|
18
|
+
enum<ModelKey extends keyof Locale>(model: ModelKey, field: keyof Locale[ModelKey], value: string): string;
|
|
19
|
+
enumdesc<ModelKey extends keyof Locale>(model: ModelKey, field: keyof Locale[ModelKey], value: string): string;
|
|
20
|
+
api<ModelKey extends keyof Locale>(model: ModelKey, endpoint: keyof Locale[ModelKey]): string;
|
|
21
|
+
apidesc<ModelKey extends keyof Locale>(model: ModelKey, endpoint: keyof Locale[ModelKey]): string;
|
|
22
|
+
arg<ModelKey extends keyof Locale>(model: ModelKey, endpoint: keyof Locale[ModelKey], arg: string): string;
|
|
23
|
+
argdesc<ModelKey extends keyof Locale>(model: ModelKey, endpoint: keyof Locale[ModelKey], arg: string): string;
|
|
24
|
+
qry<ModelKey extends keyof Locale>(model: ModelKey, queryKey: keyof Locale[ModelKey]): string;
|
|
25
|
+
qrydesc<ModelKey extends keyof Locale>(model: ModelKey, queryKey: keyof Locale[ModelKey]): string;
|
|
26
|
+
qarg<ModelKey extends keyof Locale>(model: ModelKey, queryKey: keyof Locale[ModelKey], arg: string): string;
|
|
27
|
+
qargdesc<ModelKey extends keyof Locale>(model: ModelKey, queryKey: keyof Locale[ModelKey], arg: string): string;
|
|
28
|
+
};
|
|
29
|
+
lang: string;
|
|
30
|
+
};
|
package/src/types.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PermissionStatus } from "@capacitor/camera";
|
|
2
|
+
export declare const useCamera: () => {
|
|
3
|
+
permissions: PermissionStatus;
|
|
4
|
+
getPhoto: (src?: "prompt" | "camera" | "photos") => Promise<import("@capacitor/camera").Photo | undefined>;
|
|
5
|
+
pickImage: () => Promise<import("@capacitor/camera").GalleryPhotos>;
|
|
6
|
+
checkPermission: (type: "photos" | "camera" | "all") => Promise<void>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ProtoAppInfo, ProtoFile } from "@akanjs/constant";
|
|
2
|
+
export declare const useCodepush: ({ serverUrl, branch }: {
|
|
3
|
+
serverUrl: string;
|
|
4
|
+
branch: "debug" | "develop" | "main";
|
|
5
|
+
}) => {
|
|
6
|
+
update: boolean;
|
|
7
|
+
version: string;
|
|
8
|
+
initialize: () => Promise<void>;
|
|
9
|
+
checkNewRelease: () => Promise<{
|
|
10
|
+
release: ProtoAppInfo & {
|
|
11
|
+
appBuild: string;
|
|
12
|
+
};
|
|
13
|
+
bundleFile: ProtoFile;
|
|
14
|
+
} | undefined>;
|
|
15
|
+
codepush: () => Promise<void>;
|
|
16
|
+
statManager: () => Promise<void>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PermissionStatus } from "@capacitor-community/contacts";
|
|
2
|
+
export declare const useContact: () => {
|
|
3
|
+
permissions: PermissionStatus;
|
|
4
|
+
getContacts: () => Promise<import("@capacitor-community/contacts").ContactPayload[]>;
|
|
5
|
+
checkPermission: () => Promise<void>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { PathRoute, type RouteGuide, type RouterInstance, type TransitionType } from "@akanjs/client";
|
|
2
|
+
export declare const useCsrValues: (rootRouteGuide: RouteGuide, pathRoutes: PathRoute[]) => {
|
|
3
|
+
topSafeArea: import("@akanjs/client").SafeAreaTransition | null;
|
|
4
|
+
page: import("@akanjs/client").PageTransition | null;
|
|
5
|
+
prevPage: import("@akanjs/client").PageTransition | null;
|
|
6
|
+
topInset: import("@akanjs/client").ContainerTransition | null;
|
|
7
|
+
bottomInset: import("@akanjs/client").ContainerTransition | null;
|
|
8
|
+
topLeftAction: import("@akanjs/client").ContainerTransition | null;
|
|
9
|
+
bottomSafeArea: import("@akanjs/client").SafeAreaTransition | null;
|
|
10
|
+
pageBind: (...args: any[]) => import("@use-gesture/react/dist/declarations/src/types").ReactDOMAttributes;
|
|
11
|
+
pageClassName: string;
|
|
12
|
+
transDirection: "vertical" | "horizontal" | "none";
|
|
13
|
+
transUnitRange: number[];
|
|
14
|
+
transUnit: import("@react-spring/web").SpringValue<number>;
|
|
15
|
+
transPercent: import("@react-spring/web").Interpolation<number>;
|
|
16
|
+
transProgress: import("@react-spring/web").Interpolation<number>;
|
|
17
|
+
clientWidth: number;
|
|
18
|
+
clientHeight: number;
|
|
19
|
+
location: import("@akanjs/client").Location;
|
|
20
|
+
prevLocation: import("@akanjs/client").Location | null;
|
|
21
|
+
history: import("react").MutableRefObject<import("@akanjs/client").History>;
|
|
22
|
+
topSafeAreaRef: import("react").MutableRefObject<HTMLDivElement | null>;
|
|
23
|
+
bottomSafeAreaRef: import("react").MutableRefObject<HTMLDivElement | null>;
|
|
24
|
+
prevPageContentRef: import("react").MutableRefObject<HTMLDivElement | null>;
|
|
25
|
+
pageContentRef: import("react").MutableRefObject<HTMLDivElement | null>;
|
|
26
|
+
frameRootRef: import("react").MutableRefObject<HTMLDivElement | null>;
|
|
27
|
+
onBack: import("react").MutableRefObject<{ [K in TransitionType]?: () => Promise<void>; }>;
|
|
28
|
+
router: RouterInstance;
|
|
29
|
+
pathRoutes: PathRoute[];
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useDebounce: <Callback extends (...args: any) => any>(callback: Callback, states?: any[], wait?: number) => Callback;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const useGeoLocation: () => {
|
|
2
|
+
checkPermission: () => Promise<{
|
|
3
|
+
geolocation: import("@capacitor/core").PermissionState;
|
|
4
|
+
coarseLocation: import("@capacitor/core").PermissionState;
|
|
5
|
+
}>;
|
|
6
|
+
getPosition: () => Promise<import("@capacitor/geolocation").Position | undefined>;
|
|
7
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { History, Location } from "@akanjs/client";
|
|
2
|
+
interface setForwardOptions {
|
|
3
|
+
type: "push" | "replace" | "popForward";
|
|
4
|
+
location: Location;
|
|
5
|
+
scrollTop?: number;
|
|
6
|
+
}
|
|
7
|
+
interface setBackOptions {
|
|
8
|
+
type: "back" | "popBack";
|
|
9
|
+
location: Location;
|
|
10
|
+
scrollTop?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const useHistory: (locations?: Location[]) => {
|
|
13
|
+
history: import("react").MutableRefObject<History>;
|
|
14
|
+
setHistoryForward: ({ type, location, scrollTop }: setForwardOptions) => void;
|
|
15
|
+
setHistoryBack: ({ location, scrollTop }: setBackOptions) => void;
|
|
16
|
+
getCurrentLocation: () => Location;
|
|
17
|
+
getPrevLocation: () => Location | null;
|
|
18
|
+
getScrollTop: (pathname?: string) => number;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useInterval: (callback: (() => void) | (() => Promise<void>), delay: number) => import("react").MutableRefObject<(() => void) | (() => Promise<void>) | null>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Location, type RouteGuide } from "@akanjs/client";
|
|
2
|
+
interface UseLocationOptions {
|
|
3
|
+
rootRouteGuide: RouteGuide;
|
|
4
|
+
}
|
|
5
|
+
export declare const useLocation: ({ rootRouteGuide }: UseLocationOptions) => {
|
|
6
|
+
getLocation: (href: string) => Location;
|
|
7
|
+
};
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import "cordova-plugin-purchase/www/store";
|
|
2
|
+
export type PlatformType = "android" | "ios" | "all";
|
|
3
|
+
export interface ProductType {
|
|
4
|
+
id: string;
|
|
5
|
+
type: keyof typeof CdvPurchase.ProductType;
|
|
6
|
+
}
|
|
7
|
+
export type CdvProductType = CdvPurchase.ProductType;
|
|
8
|
+
export declare const usePurchase: ({ platform, productInfo, url, onPay, onSubscribe, }: {
|
|
9
|
+
platform: PlatformType;
|
|
10
|
+
productInfo: ProductType[];
|
|
11
|
+
url: string;
|
|
12
|
+
onPay?: (transaction: CdvPurchase.Transaction) => void | Promise<void>;
|
|
13
|
+
onSubscribe?: (transaction: CdvPurchase.Transaction) => void | Promise<void>;
|
|
14
|
+
}) => {
|
|
15
|
+
isLoading: boolean;
|
|
16
|
+
products: CdvPurchase.Product[];
|
|
17
|
+
purchaseProduct: (product: CdvPurchase.Product) => Promise<void>;
|
|
18
|
+
restorePurchases: () => Promise<void>;
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useThrottle: (func: (...args: any) => any, delay?: number, deps?: any[]) => (...args: any[]) => void;
|