UNPKG

hilink-ts

Version:

智能家居hilink扩展h5应用工具开发

148 lines (147 loc) 8.63 kB
import type { IEventCallbaskResult } from "./event_callback"; import type { IHilink } from "./hilink"; import { HuaweiTime, HuaweiTimestamp } from "./time"; export type { HuaweiTime } from "./time"; export type { IEventCallbaskResult } from "./event_callback"; export type { IProfileResult } from "./profile_result"; export type { IProfileService } from "./profile_service"; export type * from "./devinfo"; export type { IDeviceError } from "./code"; export type * from "./history_logs"; declare class Hilink implements IHilink { getDevCacheAll(devId: "0", json_body: string, cb: Function): void | undefined; getDevInfo(devId: "0", sid: string, json_body: string, cb: Function): void | undefined; getDevInfoWithProdId(devId: "0", sid: string, json_body: string, cb: Function): void | undefined; setDeviceInfo(devId: "0", json_body: string, cb: Function): void | undefined; setMultipleDeviceInfo(devId: string, json_body: string, isParallel: string, isWaitAll: string, cb: Function): void | undefined; setDeviceInfoWithProdId(devId: string, json_body: string, cb: Function): void | undefined; setLongPressDeviceInfo(devId: string, json_body: string, cb: Function, isLongPressInProgress: boolean): void | undefined; setDeviceServiceLoop(devId: string, serivceId: string, json_body: string, loopFlag: string, intervalTime: string, cb: Function): void | undefined; setDeviceInfoWithoutCallback(devId: "0", json_body: string): void | undefined; getDevHistory(devId: "0", pageNo: number, pageSize: number, startTime: string, endTime: string, sid: string, character: string, cb: Function): void | undefined; deleteDeviceHistory(devId: "0", serviceId: string, cursor: string | null, json_body: string): void | undefined; registerInfraredHubDevice(json_body: string, cb: Function): void | undefined; regiterInfraredHubDevice(json_body: string, cb: Function): void | undefined; deleteInfraredHubDevice(devId: "0", cb: Function): void | undefined; postDeviceExtendData(json_body: string, cb: Function): void | undefined; postDeviceExtendDataById(devId: string, cb: Function): void | undefined; getDeviceExtendData(type: string, cb: Function): void | undefined; getDeviceExtendDataById(json_body: string, cb: Function): void | undefined; deleteDeviceExtendData(type: string, cb: Function): void | undefined; deleteDeviceExtendDataById(devId: string, type: string, cb: Function): void | undefined; reportDeviceProfileImpermanency(devId: "0", json_body: string, cb: Function): void | undefined; deleteDevice(isAssociate: string, cb: Function): void | undefined; modifyDeviceName(deviceName: string, cb: Function): void | undefined; modifyDeviceRoomName(chooseRoomString: string, cb: Function): void | undefined; getDeviceInfo(cb: Function): void | undefined; uploadObjectReq(file: string, additionInfo: string, cb: Function): void | undefined; downloadObjectReq(request: string, cb: Function): void | undefined; deleteObjectReq(request: string, cb: Function): void | undefined; getUserList(devId: string, cb: Function): void | undefined; setUserList(userInfo: string, cb: Function): void | undefined; updateUserList(userInfo: string, cb: Function): void | undefined; getDevStatisticsDataWithQuery(devId: string, request: string, cb: Function): void | undefined; getDevScalarData(devId: string, serviceId: string, characteristicName: string, cb: Function): void | undefined; getDeviceProfile(cb: Function): void | undefined; getBridgeSubclassRegisteredDevices(cb: Function): void | undefined; getSubDeviceUrl(productId: string, cb: Function): void | undefined; getHilinkConnection(deviceId: string, cb: Function): void | undefined; getDevInfoAll(deviceId: string, extendData: string, cb: Function): void | undefined; getRoomList(cb: Function): void | undefined; getRules(condition: string, cb: Function): void | undefined; getSingleRule(ruleId: string, cb: Function): void | undefined; createRule(rule: string, cb: Function): void | undefined; updateRule(rule: string, cb: Function): void | undefined; deleteRules(ruleIds: string, cb: Function): void | undefined; deleteSingleRule(ruleId: string, cb: Function): void | undefined; controlRuleActive(ruleId: string, active: string, cb: Function): void | undefined; getDeviceRuleEvents(cursor: string, pageSize: string, startTime: string, endTime: string, cb: Function): void | undefined; getAutoRuleSize(cb: Function): void | undefined; gotoVmall(suffix: string): void | undefined; gotoNative(typeString: string, cb: Function): void | undefined; showDelayInfoDialog(): void | undefined; jumpTo(uri: "com.huawei.smarthome.timerPage" | "com.huawei.smarthome.deviceSettingActivity" | "com.huawei.smarthome.addSmartlockActivity" | "com.huawei.smarthome.deviceinfoactivity" | "com.huawei.smarthome.deviceNetinfoActivity", cb: Function): void; jumpToOfflineHelpActivity(deviceId: string, hotline: string, cb: Function): void | undefined; jumpToSelfOfflineHelpActivity(deviceId: string, message: string, cb: Function): void | undefined; startApp(packageName: string, cb: Function): void | undefined; jumpToH5Device(listCount: number, cb: Function): void | undefined; modifyTitleBar(uri: boolean, argb: string, cb: Function): void | undefined; setTitleEnable(uri: boolean, cb: Function): void | undefined; setTitleVisible(uri: boolean, cb: Function): void | undefined; addMessage(json_body: string, cb: Function): void | undefined; removeMessage(json_body: string, cb: Function): void | undefined; setMessageVisible(uri: boolean, cb: Function): void | undefined; changeTitleStyle(styleValue: number): void | undefined; showTitleBarIcons(json_body: string, buttonClick: string, isVisible: boolean, cb: Function): void | undefined; getStatusBarHeight(cb: Function): void | undefined; toast(time: number, body: string): void | undefined; getPadLandscape(): number | undefined; finishDeviceActivity(): void | undefined; printLogDebug(isSaveLog: boolean, tag: string, msg: string): void | undefined; printLog(isSaveLog: boolean, tag: string, msg: string): void | undefined; overrideBackPressed(enable: boolean, cb: Function): void | undefined; overrideSettingClick(enable: boolean, cb: Function): void | undefined; requestThirdPartConfig(json_body: string, cb: Function): void | undefined; setH5Info(key: string, value: string, cb: Function): void | undefined; setStorageSync(key: string, value: string, cb: Function): void | undefined; getVersion(cb: Function): void | undefined; refreshWebView(): void | undefined; verifyPassword(cb: Function): void | undefined; getAppVersionCode(cb: Function): void | undefined; getUserRole(cb: Function): void | undefined; reportH5SingleDevBiInfo(biKey: string, biH5Info: string): void | undefined; takePhoto(fileName: string, cb: Function): void | undefined; getAppLanguageSync(): string | undefined; getDarkMode(cb: Function): void; setGuideDialogEnable(enabled: boolean, cb: Function): void | undefined; isScreenSpreaded(): boolean | undefined; createShortCut(deviceId: string, productId: string, deviceName: string, cb?: Function): void | undefined; doHttpsRequest(jsonBody: string, cb: Function): void | undefined; refuseSharedDevice(cb: Function): void | undefined; } export declare function deviceEventCallback(cb: (res: IEventCallbaskResult) => void): void; export declare function init(): void; /** * 转换设备数据返回JSON结构 * @param result * @returns */ export declare function parse(result: string): any; export declare enum ThemeMode { Default = 1, Dark = 2 } /** * 将华为世界时间格式转换为正常北京时间格式 * 20150501T010203Z => 2015-05-01 01:02:03 * @param t */ export declare function t2t(t: HuaweiTime): string; /** * 将华为时间戳格式转为正常时间戳格式 * @param t * @returns number */ export declare function ts2t(t: HuaweiTimestamp): number; /** * 将北京正常时间转为华为时间 * @param t * @returns */ export declare function t2ht(t: number | string | Date): string; declare const hilink: Hilink; /** * desc 获取手机信息,包含系统和屏幕 * @param option */ export declare function getPhoneInfo(): { type: string; version: string; isPad: boolean; isDarkMode: boolean; isFold: boolean; isPortrait: boolean; changeScreen: boolean; deviceType: string; }; export default hilink;