export { action, attachFile, exec, logger, sleep } from './src/api'; /** * Resumes the task. * * The task that was previously running in the bot is resumed, the state restored, * and the given function drives the execution in the bot. * * ## State * * Attachments, streams, metrics are visible when the callback function executes. * * ## Execution * * Since `exec` calls generate transient files(in the bot), you can save those * files in the attached file system to persist them across new task invocation. * * When the function resolves to `true`, the task is retried in the bot with the * files persisted to the attached file system. * * For example: * * ```tsx * import React, { useState } from 'react'; * import { exec, logger, resumeTask } from 'iret/client'; * * export default function() { * const [currHostname, setCurrHostname] = useState('unknown'); * return ( *
The hostname is: {currHostname}.
* * ); * } * ``` * * Since tasks are only defined during the configuration phase, you can't * define new tasks within the callback function. * * @param fn The function that drives the execution in the bot. */ export declare const resumeTask: (fn: () => Promise) => () => any;