forked from yorkie/react-native-wechat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
61 lines (61 loc) · 1.58 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
declare module "react-native-wechat" {
export function registerApp(appId: string): Promise<boolean>;
export function registerAppWithDescription(
appId: string,
desc: string
): Promise<boolean>;
export function isWXAppInstalled(): Promise<boolean>;
export function isWXAppSupportApi(): Promise<boolean>;
export function getApiVersion(): Promise<string>;
export function openWXApp(): Promise<boolean>;
export interface AuthResponse {
errCode?: number;
errStr?: string;
openId?: string;
code?: string;
url?: string;
lang?: string;
country?: string;
}
export function sendAuthRequest(
scope: string | string[],
state?: string
): Promise<AuthResponse>;
export interface ShareMetadata {
type:
| "news"
| "text"
| "imageUrl"
| "imageFile"
| "imageResource"
| "video"
| "audio"
| "file";
thumbImage?: string;
title?: string;
description?: string;
webpageUrl?: string;
imageUrl?: string;
videoUrl?: string;
musicUrl?: string;
filePath?: string;
fileExtension?: string;
}
export function shareToTimeline(
message: ShareMetadata
): Promise<{ errCode?: number; errStr?: string }>;
export function shareToSession(
message: ShareMetadata
): Promise<{ errCode?: number; errStr?: string }>;
export interface PaymentLoad {
partnerId: string;
prepayId: string;
nonceStr: string;
timeStamp: string;
package: string;
sign: string;
}
export function pay(
payload: PaymentLoad
): Promise<{ errCode?: number; errStr?: string }>;
}