import { LoginScript } from "../../script/login/types" ; import { RunnableTask , RunnableTaskOptions , Target } from "./runnable.task" ; import { TaskType } from "./types" ; export type ScriptTarget < T > = ( options : { task : ScriptTask < T > ; script : LoginScript ; } ) => Promise < T > ; /**
 * 脚本任务
 */ export class ScriptTask < R > extends RunnableTask < R > { target : ScriptTarget < R > ; children ? : ScriptTask < R > ; constructor ( options ) { super ( options ) ; this . target = options . target ; this . children = options . children ; } param name param target returns static createScript < R > ( { needBlock = true , ... options } ) { return new ScriptTask ( { needBlock , ... options } ) ; } }