zcw-shared 1.38.2 → 1.40.1
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/dist/constants/hybridConstants.d.ts +37 -0
- package/dist/constants/hybridConstants.js +38 -0
- package/dist/constants/hybridConstants.js.map +1 -0
- package/dist/functions/hybrid/createBridgeMessage.d.ts +25 -0
- package/dist/functions/hybrid/createBridgeMessage.js +33 -0
- package/dist/functions/hybrid/createBridgeMessage.js.map +1 -0
- package/dist/functions/hybrid/detectBridgeEnvironment.d.ts +11 -0
- package/dist/functions/hybrid/detectBridgeEnvironment.js +26 -0
- package/dist/functions/hybrid/detectBridgeEnvironment.js.map +1 -0
- package/dist/functions/hybrid/generateBridgeMessageId.d.ts +10 -0
- package/dist/functions/hybrid/generateBridgeMessageId.js +11 -0
- package/dist/functions/hybrid/generateBridgeMessageId.js.map +1 -0
- package/dist/functions/hybrid/postBridgeMessage.d.ts +16 -0
- package/dist/functions/hybrid/postBridgeMessage.js +68 -0
- package/dist/functions/hybrid/postBridgeMessage.js.map +1 -0
- package/dist/functions/hybrid/validateBridgeMessage.d.ts +5 -0
- package/dist/functions/hybrid/validateBridgeMessage.js +55 -0
- package/dist/functions/hybrid/validateBridgeMessage.js.map +1 -0
- package/dist/functions/ios/integrateThirdPartyModule.js +1 -44
- package/dist/functions/ios/integrateThirdPartyModule.js.map +1 -1
- package/dist/functions/ios/modifyInfoPlistKeyValue.d.ts +2 -0
- package/dist/functions/ios/modifyInfoPlistKeyValue.js +45 -0
- package/dist/functions/ios/modifyInfoPlistKeyValue.js.map +1 -0
- package/dist/functions/ios/safelyModifyProjectPbxproj.d.ts +16 -0
- package/dist/functions/ios/safelyModifyProjectPbxproj.js +87 -0
- package/dist/functions/ios/safelyModifyProjectPbxproj.js.map +1 -0
- package/dist/functions/uniapp/app-plus/buildAndroidApp.d.ts +1 -0
- package/dist/functions/uniapp/app-plus/buildAndroidApp.js +190 -111
- package/dist/functions/uniapp/app-plus/buildAndroidApp.js.map +1 -1
- package/dist/functions/uniapp/app-plus/buildAndroidPlugin.d.ts +3 -0
- package/dist/functions/uniapp/app-plus/buildAndroidPlugin.js +501 -0
- package/dist/functions/uniapp/app-plus/buildAndroidPlugin.js.map +1 -0
- package/dist/functions/uniapp/app-plus/buildIOSApp.d.ts +2 -2
- package/dist/functions/uniapp/app-plus/buildIOSApp.js +94 -521
- package/dist/functions/uniapp/app-plus/buildIOSApp.js.map +1 -1
- package/dist/functions/uniapp/app-plus/buildIOSPlugin.d.ts +3 -0
- package/dist/functions/uniapp/app-plus/buildIOSPlugin.js +383 -0
- package/dist/functions/uniapp/app-plus/buildIOSPlugin.js.map +1 -0
- package/dist/hybrid/constants.d.ts +37 -0
- package/dist/hybrid/constants.js +38 -0
- package/dist/hybrid/constants.js.map +1 -0
- package/dist/hybrid/createBridgeMessage.d.ts +17 -0
- package/dist/hybrid/createBridgeMessage.js +81 -0
- package/dist/hybrid/createBridgeMessage.js.map +1 -0
- package/dist/hybrid/types.d.ts +88 -0
- package/dist/hybrid/types.js +2 -0
- package/dist/hybrid/types.js.map +1 -0
- package/dist/vue-hooks/browser/useBridgeMessage.d.ts +34 -0
- package/dist/vue-hooks/browser/useBridgeMessage.js +87 -0
- package/dist/vue-hooks/browser/useBridgeMessage.js.map +1 -0
- package/dist/vue-hooks/browser/useWechatJSSDK.d.ts +2 -0
- package/dist/vue-hooks/browser/useWechatJSSDK.js +16 -1
- package/dist/vue-hooks/browser/useWechatJSSDK.js.map +1 -1
- package/package.json +13 -3
- package/references/hybrid.d.ts +83 -0
- package/types/hybrid.d.ts +119 -0
- package/types/uniapp-android-build.d.ts +25 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hybrid 跨端通信类型定义
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 运行环境类型
|
|
7
|
+
*/
|
|
8
|
+
export type Environment = 'h5' | 'miniapp' | 'app' | 'unknown'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 通信方向
|
|
12
|
+
*/
|
|
13
|
+
export type BridgeDirection = 'h5-to-miniapp' | 'h5-to-app' | 'miniapp-to-h5' | 'app-to-h5'
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 消息类型
|
|
17
|
+
*/
|
|
18
|
+
export type MessageType = 'request' | 'response' | 'event' | 'error'
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 通信消息基础结构
|
|
22
|
+
*/
|
|
23
|
+
export interface BaseMessage {
|
|
24
|
+
id: string // 消息ID,用于请求-响应匹配
|
|
25
|
+
type: MessageType // 消息类型
|
|
26
|
+
action: string // 操作类型:'share', 'login', 'pay'...
|
|
27
|
+
method?: string // 具体方法:'setShare', 'triggerShare'...
|
|
28
|
+
timestamp: number // 时间戳
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 请求消息
|
|
33
|
+
*/
|
|
34
|
+
export interface RequestMessage extends BaseMessage {
|
|
35
|
+
type: 'request'
|
|
36
|
+
method: string // 请求必须有方法
|
|
37
|
+
params?: any // 请求参数
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* 响应消息
|
|
42
|
+
*/
|
|
43
|
+
export interface ResponseMessage extends BaseMessage {
|
|
44
|
+
type: 'response'
|
|
45
|
+
success: boolean // 是否成功
|
|
46
|
+
data?: any // 响应数据
|
|
47
|
+
error?: { // 错误信息
|
|
48
|
+
code: string | number
|
|
49
|
+
message: string
|
|
50
|
+
details?: any
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* 事件消息
|
|
56
|
+
*/
|
|
57
|
+
export interface EventMessage extends BaseMessage {
|
|
58
|
+
type: 'event'
|
|
59
|
+
event: string // 事件名称
|
|
60
|
+
data?: any // 事件数据
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* 错误消息
|
|
65
|
+
*/
|
|
66
|
+
export interface ErrorMessage extends BaseMessage {
|
|
67
|
+
type: 'error'
|
|
68
|
+
error: {
|
|
69
|
+
code: string | number
|
|
70
|
+
message: string
|
|
71
|
+
details?: any
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* 所有消息类型的联合
|
|
77
|
+
*/
|
|
78
|
+
export type BridgeMessage = RequestMessage | ResponseMessage | EventMessage | ErrorMessage
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* 消息处理器类型
|
|
82
|
+
*/
|
|
83
|
+
export type MessageHandler = (message: BridgeMessage) => void | Promise<void>
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* 事件监听器类型
|
|
87
|
+
*/
|
|
88
|
+
export type EventListener = (data?: any) => void
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* 平台 API 依赖接口
|
|
92
|
+
*/
|
|
93
|
+
export interface PlatformDeps {
|
|
94
|
+
window: {
|
|
95
|
+
wx?: any
|
|
96
|
+
uni?: any
|
|
97
|
+
plus?: any
|
|
98
|
+
document: {
|
|
99
|
+
createElement: (tag: string) => any
|
|
100
|
+
querySelector: (selector: string) => any
|
|
101
|
+
head: { appendChild: (el: any) => any }
|
|
102
|
+
}
|
|
103
|
+
location: {
|
|
104
|
+
origin: string
|
|
105
|
+
href: string
|
|
106
|
+
}
|
|
107
|
+
self: any
|
|
108
|
+
top: any
|
|
109
|
+
parent: any
|
|
110
|
+
}
|
|
111
|
+
navigator: {
|
|
112
|
+
userAgent: string
|
|
113
|
+
}
|
|
114
|
+
isServer: () => boolean
|
|
115
|
+
setTimeout: (callback: () => void, ms: number) => any
|
|
116
|
+
clearTimeout: (id: any) => void
|
|
117
|
+
setInterval: (callback: () => void, ms: number) => any
|
|
118
|
+
clearInterval: (id: any) => void
|
|
119
|
+
}
|
|
@@ -184,4 +184,29 @@ export interface UniAppAndroidBuildOptions extends AndroidBuildOptions {
|
|
|
184
184
|
*/
|
|
185
185
|
export interface UniAppAndroidBuildResult extends AndroidBuildResult {
|
|
186
186
|
// 可以添加 UniApp 特有的结果属性
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* UniApp Android 插件开发构建选项
|
|
191
|
+
*
|
|
192
|
+
* @description
|
|
193
|
+
* 这是 UniAppAndroidBuildOptions 的简化版本,专门用于 Android 插件开发场景。
|
|
194
|
+
* 与完整的应用打包相比,插件开发构建有以下特点:
|
|
195
|
+
* 1. 始终使用 Debug 配置(除非明确指定)
|
|
196
|
+
* 2. 始终启用自定义基座模式
|
|
197
|
+
* 3. 专门针对 UniPlugin-Hello-AS 项目结构优化
|
|
198
|
+
*/
|
|
199
|
+
export interface UniAppAndroidPluginBuildOptions extends Omit<UniAppAndroidBuildOptions, 'buildCustomBase' | 'buildVariant'> {
|
|
200
|
+
/** 构建类型(可选,默认为 'debug') */
|
|
201
|
+
buildVariant?: 'debug' | 'release'
|
|
202
|
+
/** 不包含第三方登录/分享配置(插件开发通常不需要) */
|
|
203
|
+
wechatLogin?: never
|
|
204
|
+
wechatShare?: never
|
|
205
|
+
univerifyLogin?: never
|
|
206
|
+
qqLogin?: never
|
|
207
|
+
sinaLogin?: never
|
|
208
|
+
miuiLogin?: never
|
|
209
|
+
googleLogin?: never
|
|
210
|
+
facebookLogin?: never
|
|
211
|
+
shareTrace?: never
|
|
187
212
|
}
|