assistsx-js 0.0.2039 → 0.0.2040
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/AssistsXAsync.d.ts +24 -0
- package/dist/AssistsXAsync.js +25 -0
- package/dist/CallMethod.d.ts +2 -0
- package/dist/CallMethod.js +3 -0
- package/package.json +1 -1
- package/src/AssistsXAsync.ts +42 -0
- package/src/CallMethod.ts +4 -0
package/dist/AssistsXAsync.d.ts
CHANGED
|
@@ -38,6 +38,16 @@ export interface RecognizeTextRegion {
|
|
|
38
38
|
width?: number;
|
|
39
39
|
height?: number;
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* 联系人信息
|
|
43
|
+
*/
|
|
44
|
+
export interface Contact {
|
|
45
|
+
id: string;
|
|
46
|
+
name: string;
|
|
47
|
+
phoneNumbers: string[];
|
|
48
|
+
emails: string[];
|
|
49
|
+
address: string;
|
|
50
|
+
}
|
|
41
51
|
export declare class AssistsXAsync {
|
|
42
52
|
/**
|
|
43
53
|
* 执行异步调用
|
|
@@ -432,4 +442,18 @@ export declare class AssistsXAsync {
|
|
|
432
442
|
static audioStop({ timeout, }: {
|
|
433
443
|
timeout?: number;
|
|
434
444
|
}): Promise<boolean | null | undefined>;
|
|
445
|
+
/**
|
|
446
|
+
* 添加联系人
|
|
447
|
+
* @param name 联系人姓名(必填)
|
|
448
|
+
* @param phoneNumber 电话号码(必填)
|
|
449
|
+
* @param timeout 超时时间(秒),默认30秒
|
|
450
|
+
* @returns 是否添加成功
|
|
451
|
+
*/
|
|
452
|
+
static addContact(name: string, phoneNumber: string, timeout?: number): Promise<boolean>;
|
|
453
|
+
/**
|
|
454
|
+
* 获取所有联系人
|
|
455
|
+
* @param timeout 超时时间(秒),默认30秒
|
|
456
|
+
* @returns 联系人列表
|
|
457
|
+
*/
|
|
458
|
+
static getAllContacts(timeout?: number): Promise<Contact[]>;
|
|
435
459
|
}
|
package/dist/AssistsXAsync.js
CHANGED
|
@@ -681,4 +681,29 @@ export class AssistsXAsync {
|
|
|
681
681
|
});
|
|
682
682
|
return response.getDataOrDefault(false);
|
|
683
683
|
}
|
|
684
|
+
/**
|
|
685
|
+
* 添加联系人
|
|
686
|
+
* @param name 联系人姓名(必填)
|
|
687
|
+
* @param phoneNumber 电话号码(必填)
|
|
688
|
+
* @param timeout 超时时间(秒),默认30秒
|
|
689
|
+
* @returns 是否添加成功
|
|
690
|
+
*/
|
|
691
|
+
static async addContact(name, phoneNumber, timeout) {
|
|
692
|
+
const response = await this.asyncCall(CallMethod.addContact, {
|
|
693
|
+
args: { name, phoneNumber },
|
|
694
|
+
timeout,
|
|
695
|
+
});
|
|
696
|
+
return response.getDataOrDefault(false);
|
|
697
|
+
}
|
|
698
|
+
/**
|
|
699
|
+
* 获取所有联系人
|
|
700
|
+
* @param timeout 超时时间(秒),默认30秒
|
|
701
|
+
* @returns 联系人列表
|
|
702
|
+
*/
|
|
703
|
+
static async getAllContacts(timeout) {
|
|
704
|
+
const response = await this.asyncCall(CallMethod.getAllContacts, {
|
|
705
|
+
timeout,
|
|
706
|
+
});
|
|
707
|
+
return response.getDataOrDefault([]);
|
|
708
|
+
}
|
|
684
709
|
}
|
package/dist/CallMethod.d.ts
CHANGED
|
@@ -56,5 +56,7 @@ export declare const CallMethod: {
|
|
|
56
56
|
readonly download: "download";
|
|
57
57
|
readonly audioPlayFromFile: "audioPlayFromFile";
|
|
58
58
|
readonly audioStop: "audioStop";
|
|
59
|
+
readonly addContact: "addContact";
|
|
60
|
+
readonly getAllContacts: "getAllContacts";
|
|
59
61
|
};
|
|
60
62
|
export type CallMethodType = (typeof CallMethod)[keyof typeof CallMethod];
|
package/dist/CallMethod.js
CHANGED
package/package.json
CHANGED
package/src/AssistsXAsync.ts
CHANGED
|
@@ -51,6 +51,17 @@ export interface RecognizeTextRegion {
|
|
|
51
51
|
height?: number;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
/**
|
|
55
|
+
* 联系人信息
|
|
56
|
+
*/
|
|
57
|
+
export interface Contact {
|
|
58
|
+
id: string;
|
|
59
|
+
name: string;
|
|
60
|
+
phoneNumbers: string[];
|
|
61
|
+
emails: string[];
|
|
62
|
+
address: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
54
65
|
export class AssistsXAsync {
|
|
55
66
|
/**
|
|
56
67
|
* 执行异步调用
|
|
@@ -1030,6 +1041,37 @@ export class AssistsXAsync {
|
|
|
1030
1041
|
return response.getDataOrDefault(false);
|
|
1031
1042
|
}
|
|
1032
1043
|
|
|
1044
|
+
/**
|
|
1045
|
+
* 添加联系人
|
|
1046
|
+
* @param name 联系人姓名(必填)
|
|
1047
|
+
* @param phoneNumber 电话号码(必填)
|
|
1048
|
+
* @param timeout 超时时间(秒),默认30秒
|
|
1049
|
+
* @returns 是否添加成功
|
|
1050
|
+
*/
|
|
1051
|
+
public static async addContact(
|
|
1052
|
+
name: string,
|
|
1053
|
+
phoneNumber: string,
|
|
1054
|
+
timeout?: number
|
|
1055
|
+
): Promise<boolean> {
|
|
1056
|
+
const response = await this.asyncCall(CallMethod.addContact, {
|
|
1057
|
+
args: { name, phoneNumber },
|
|
1058
|
+
timeout,
|
|
1059
|
+
});
|
|
1060
|
+
return response.getDataOrDefault(false);
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
/**
|
|
1064
|
+
* 获取所有联系人
|
|
1065
|
+
* @param timeout 超时时间(秒),默认30秒
|
|
1066
|
+
* @returns 联系人列表
|
|
1067
|
+
*/
|
|
1068
|
+
public static async getAllContacts(timeout?: number): Promise<Contact[]> {
|
|
1069
|
+
const response = await this.asyncCall(CallMethod.getAllContacts, {
|
|
1070
|
+
timeout,
|
|
1071
|
+
});
|
|
1072
|
+
return response.getDataOrDefault([]);
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1033
1075
|
/**
|
|
1034
1076
|
* 发送HTTP请求
|
|
1035
1077
|
* @param options 请求选项
|
package/src/CallMethod.ts
CHANGED