? V : S[K] } &
GetPropsType> &
@@ -296,7 +305,7 @@ export interface RnConfig {
* - `true`:允许退出应用
* - `false`:阻止退出应用
*/
- onAppBack?: () => boolean
+ onAppBack?: (delta: number) => boolean
/**
* 是否禁用框架内部的 AppStateChange 监听。
@@ -356,26 +365,6 @@ export interface RnConfig {
dimensions: T
) => T | void
- /**
- * 异步分包加载配置。
- */
- asyncChunk?: {
- /**
- * 加载超时时长配置,单位为毫秒。
- */
- timeout: number
-
- /**
- * 异步分包页面加载超时或失败时,自定义兜底页面文件路径。
- */
- fallback: string
-
- /**
- * 异步分包页面加载时,自定义 loading 页面文件路径。
- */
- loading: string
- }
-
/**
* 加载并执行异步分包的方法。
*
@@ -399,10 +388,10 @@ interface MpxConfig {
ignoreWarning: boolean | string | RegExp | ((msg: string, location: string, e: Error) => boolean)
ignoreProxyWhiteList: Array
observeClassInstance: boolean | Array
- errorHandler: (msg: String, location: String, e: Error) => any | null
- warnHandler: (msg: String, location: String, e: Error) => any | null
- proxyEventHandler: (e: WechatMiniprogram.CustomEvent, target: ComponentIns<{}, {}, {}, {}, []>) => any | null
- setDataHandler: (data: object, target: ComponentIns<{}, {}, {}, {}, []>) => any | null
+ errorHandler: (msg: String, location: String, e: Error) => void
+ warnHandler: (msg: String, location: String, e: Error) => void
+ proxyEventHandler: (e: WechatMiniprogram.CustomEvent, target: ComponentIns<{}, {}, {}, {}, []>) => void
+ setDataHandler: (data: object, target: ComponentIns<{}, {}, {}, {}, []>) => void
forceFlushSync: boolean,
webRouteConfig: object,
webConfig: object,
@@ -413,7 +402,7 @@ interface MpxConfig {
*/
webviewConfig: WebviewConfig,
/** react-native 相关配置,用于挂载事件等,如 onShareAppMessage */
- rnConfig?: RnConfig,
+ rnConfig: RnConfig,
}
type SupportedMode = 'wx' | 'ali' | 'qq' | 'swan' | 'tt' | 'web' | 'qa'
diff --git a/packages/core/package.json b/packages/core/package.json
index a308d87931..8e6434788a 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -93,6 +93,10 @@
"optional": true
}
},
+ "devDependencies": {
+ "@types/react": "^18.2.79",
+ "react-native": "^0.74.5"
+ },
"publishConfig": {
"registry": "https://registry.npmjs.org",
"access": "public"
diff --git a/packages/store/@types/index.d.ts b/packages/store/@types/index.d.ts
index 2699b43e26..dcf0f1cdcf 100644
--- a/packages/store/@types/index.d.ts
+++ b/packages/store/@types/index.d.ts
@@ -4,7 +4,7 @@ type UnboxDepField = F extends keyof D ? D[F] : {}
type GetReturnOrSelf = T extends (...args: any)=> infer R ? R : T
-interface compContext {
+export interface compContext {
[key: string]: any
}
@@ -158,7 +158,7 @@ type UnionToIntersection = (U extends any
? I
: never;
-interface mapStateFunctionType {
+export interface mapStateFunctionType {
[key: string]: (state: S, getter: G) => any
}
interface DeeperMutationsAndActions {
@@ -242,7 +242,7 @@ interface StoreOptWithThis {
modules?: Record>
}
-interface IStoreWithThis {
+export interface IStoreWithThis {
[DEPS_SYMBOL]: D
[STATE_SYMBOL]: S
@@ -384,7 +384,7 @@ interface IStoreWithThis {
mapActionsToInstance(obj: T, context: compContext): void
}
-type StoreWithThis = IStoreWithThis & CompatibleDispatch
+export type StoreWithThis = IStoreWithThis & CompatibleDispatch
interface StoreOpt {
state?: S,