You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
139 lines
3.3 KiB
139 lines
3.3 KiB
declare module "dpa" {
|
|
global {
|
|
/**
|
|
* @description: 运行在 dpa 的脚本,可以使用额外的环境信息和功能。
|
|
*/
|
|
const dpa: DPA;
|
|
}
|
|
|
|
interface DPA {
|
|
/**
|
|
* @description: 包含环境信息和开发者自定义的脚本配置(参见 [在脚本中使用配置] )。
|
|
*
|
|
* [在脚本中使用配置]: https://docs.hamibot.com/tutorials/tutorial-config#%E5%9C%A8%E8%84%9A%E6%9C%AC%E4%B8%AD%E4%BD%BF%E7%94%A8%E9%85%8D%E7%BD%AE
|
|
*/
|
|
readonly env: DPAEnv;
|
|
|
|
/**
|
|
* @description: 获取流程输入。
|
|
* @param {string} action 流程输入参数 默认为 input
|
|
* @example
|
|
* ```typescript
|
|
* dpa.getInParam();
|
|
* ```
|
|
*/
|
|
getInParam(action?: string): void;
|
|
|
|
/**
|
|
* @description: 设置流程输出。
|
|
* @param {any} content 流程输出内容
|
|
* @param {string} action 流程输出参数 默认为 input
|
|
* @example
|
|
* ```typescript
|
|
* dpa.getOutParam('输出内容');
|
|
* ```
|
|
*/
|
|
setOutParam(content: any, action?: string): void;
|
|
|
|
/**
|
|
* @description: 数据表操作
|
|
* @param {+} content 流程输出内容
|
|
* @param {string} action 流程输出参数 默认为 input
|
|
* @example
|
|
* ```typescript
|
|
* dpa.getOutParam('输出内容');
|
|
* ```
|
|
*/
|
|
optDataTable(type, action?: string): void;
|
|
}
|
|
|
|
interface DPAEnv {
|
|
/**
|
|
* @description: 助手id
|
|
*/
|
|
readonly excutorId: number;
|
|
|
|
/**
|
|
* @description: 任务id
|
|
*/
|
|
readonly taskId: string;
|
|
|
|
/**
|
|
* @description: DPA应用id
|
|
*/
|
|
readonly solutionId: number;
|
|
|
|
/**
|
|
* @description: 设备id
|
|
*/
|
|
readonly deviceId: string;
|
|
}
|
|
|
|
// /**
|
|
// * @description: 脚本定价计划。
|
|
// */
|
|
// interface PricePlan {
|
|
// /**
|
|
// * @description: 计划名称(默认为 `免费` )。
|
|
// */
|
|
// readonly name: string;
|
|
// /**
|
|
// * @description: 定价模式,可以是下列值之一:。
|
|
// * - `free`
|
|
// * - `flatRate`
|
|
// * (默认为 `free` )
|
|
// */
|
|
// readonly mode: 'free' | 'flatRate';
|
|
// /**
|
|
// * @description: 是否处于免费试用期(默认为 `false` )。
|
|
// */
|
|
// readonly onFreeTrial: boolean;
|
|
// }
|
|
|
|
// /**
|
|
// * @description: 消息选项。
|
|
// */
|
|
// interface MessageOptions {
|
|
// telemetry: boolean; // TODO: 询问这个键的意义
|
|
|
|
// /**
|
|
// * @description: 消息数据。
|
|
// */
|
|
// data: MessageData | Object;
|
|
// }
|
|
|
|
// /**
|
|
// * @description: 消息数据(包括消息标题和消息附件)。
|
|
// */
|
|
// interface MessageData {
|
|
// /**
|
|
// * @description: 消息标题。
|
|
// */
|
|
// title: string;
|
|
|
|
// /**
|
|
// * @description: 存放附件的数组。
|
|
// */
|
|
// attachments: MessageAttachment[];
|
|
// }
|
|
|
|
// /**
|
|
// * @description: 消息附件。
|
|
// */
|
|
// interface MessageAttachment {
|
|
// /**
|
|
// * @description: 附件类型,根据实际需要选择使用,可选的值为:
|
|
// *
|
|
// * - `text` - 文本类型
|
|
// * - `json` - JSON类型
|
|
// * - `image` - 图片类型
|
|
// *
|
|
// */
|
|
// type: 'text' | 'json' | 'image';
|
|
|
|
// /**
|
|
// * @description: 附件内容。
|
|
// */
|
|
// data: string;
|
|
// }
|
|
}
|
|
|