declare namespace GSF { export interface API { client(clientOptions: ClientOptions): Client; } export interface ClientOptions { address: string; port?: string; headers?: object; APIRoot?: string; protocol?: string; } export interface Client { APIRoot: string; URL: string; address: string; port: number; headers?: object; protocol: string; rootURL: string; service(serviceName: string): Service; services(): Promise>; job(jobId: string, progressCallback?: ProgressCallback, startedCallback?: StartedCallback): Job; jobs(jobListOptions: JobListOptions): Promise> } export interface Service { name: string; info(): Promise; task(taskName: string): Task; tasks(): Promise>; taskInfoList(): Promise>; } export interface Task { name: string; service: Service; info(): Promise; submit(options: SubmitOptions, progressCallback?: ProgressCallback, startedCallback?: StartedCallback): Promise; submitAndWait(options: SubmitOptions, progressCallback?: ProgressCallback, startedCallback?: StartedCallback): Promise; } export interface Job { jobId: string; cancel(force: boolean): Promise; info(): Promise; wait(): Promise; on(event: string, callback: (p?: any) => void ): void; removeListener(eventName: any, listener: (p?: any) => void): void; removeAllListeners(): void; } export interface SubmitOptions { inputParameters: object; jobOptions?: JobOptions; } export interface JobOptions { route?: string; } export interface ProgressCallback { (info: JobProgressInfo) : void; } export interface JobProgressInfo { jobId: string; progress: number; message?: string; } export interface StartedCallback { (info: JobStartedInfo) : void; } export interface JobStartedInfo { jobId: string; } export interface JobListOptions { offset?: number; limit?: number; reverse?: boolean; status?: string; } export interface JobInfo { serviceName: string; taskName: string; jobOptions?: JobOptions; inputParameters: Object; jobId?: string; jobProgress?: number; jobMessage?: string; jobStatus: string; jobResults?: JobResults; jobSubmitted?: string; jobStart?: string; jobEnd?: string; jobError?: string; nodeInfo?: NodeInfo; } export interface NodeInfo { nodeAddress: string; nodePort: number; workerID: number; } export interface JobResults { [parameterName: string]: JobResult; } export interface JobResult { best: any; raw: any; } export interface ServiceInfo { name: string; description?: string; } export interface TaskInfo { taskName: string; serviceName: string; displayName?: string; description?: string; inputParameters: InputParameter[]; outputParameters: OutputParameter[]; } export interface InputParameter { displayName?: string; description?: string; choiceList?: string[]; type: string; default?: any; name: string; required: boolean; } export interface OutputParameter { displayName?: string; description?: string; type: string; name: string; required: boolean; } } declare var GSF: GSF.API; export = GSF;