mirror of
				https://github.com/valentineus/webos-service-types.git
				synced 2025-11-03 22:19:45 +03:00 
			
		
		
		
	Finished class "ActivityManager" structure
Signed-off-by: Valentin Popov <info@valentineus.link>
This commit is contained in:
		
							
								
								
									
										18
									
								
								dist/activity-manager.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								dist/activity-manager.d.ts
									
									
									
									
										vendored
									
									
								
							@@ -1,6 +1,12 @@
 | 
			
		||||
import { IActivitySpec } from "./types";
 | 
			
		||||
import { Service } from "./service";
 | 
			
		||||
import { Subscription } from "./subscription";
 | 
			
		||||
 | 
			
		||||
export interface ICreateDummyCallback {
 | 
			
		||||
	activity: { name: string };
 | 
			
		||||
	isDummyActivity: boolean;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export declare class ActivityManager {
 | 
			
		||||
	public constructor(service: Service, idleTimeout: number);
 | 
			
		||||
 | 
			
		||||
@@ -20,19 +26,19 @@ export declare class ActivityManager {
 | 
			
		||||
 | 
			
		||||
	private _idleTimer: NodeJS.Timeout | null;
 | 
			
		||||
 | 
			
		||||
	public adopt(): any
 | 
			
		||||
	public adopt(activity: Record<string, any>, callback?: (payload: Record<string, any>) => void): void;
 | 
			
		||||
 | 
			
		||||
	public complete(): any;
 | 
			
		||||
	public complete(activity: Record<string, any>, options?: Record<string, any>, callback?: (payload: Record<string, any>) => void): boolean | void;
 | 
			
		||||
 | 
			
		||||
	public create(): any;
 | 
			
		||||
	public create(spec: string | Record<string, any>, callback: (payload: any) => void): void;
 | 
			
		||||
 | 
			
		||||
	private _add(id: string, activity: Subscription): void;
 | 
			
		||||
 | 
			
		||||
	private _createActual(): any;
 | 
			
		||||
	private _createActual(activitySpec: IActivitySpec, callback?: (payload: any) => void): void;
 | 
			
		||||
 | 
			
		||||
	private _createDummy(): any;
 | 
			
		||||
	private _createDummy(jobId: string, callback?: (payload: ICreateDummyCallback) => void): void;
 | 
			
		||||
 | 
			
		||||
	private _createInternal(): any;
 | 
			
		||||
	private _createInternal(jobId: string, callback?: (payload: any) => void): void;
 | 
			
		||||
 | 
			
		||||
	private _remove(id: string): void;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										18
									
								
								dist/types/index.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								dist/types/index.d.ts
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,18 @@
 | 
			
		||||
export interface IActivitySpec {
 | 
			
		||||
	readonly activity: IActivity;
 | 
			
		||||
	readonly replace?: boolean;
 | 
			
		||||
	readonly start?: boolean;
 | 
			
		||||
	readonly subscribe?: boolean;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface IActivity {
 | 
			
		||||
	readonly description: string;
 | 
			
		||||
	readonly name: string;
 | 
			
		||||
	readonly type?: IType;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface IType {
 | 
			
		||||
	readonly explicit?: boolean;
 | 
			
		||||
	readonly foreground?: boolean;
 | 
			
		||||
	readonly persist?: boolean;
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user