refactor
This commit is contained in:
		
							
								
								
									
										28
									
								
								src/common/index.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								src/common/index.ts
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,28 @@ | ||||
| export enum Actions { | ||||
|     // from background to content script | ||||
|     EXTRACT = 1, | ||||
|     GOTO_URL, | ||||
|     PING, | ||||
|     QUERY_URL, | ||||
|     SCROLL_BOTTOM, | ||||
|     SLEEP, | ||||
|     WAKEUP, | ||||
|     // from popup to background script | ||||
|     UPLOAD_STATE, | ||||
|     // from content to background script | ||||
|     REPORT_NEW_PAGE, | ||||
| } | ||||
|  | ||||
| export interface Request { | ||||
|     action: Actions | ||||
|     itemsSelector?: string | ||||
|     fieldSelectors?: string[] | ||||
|     url?: string | ||||
|     fileName?: string | ||||
|     state?: string | ||||
| } | ||||
|  | ||||
| export interface Response<T> { | ||||
|     result: T; | ||||
|     error: string; | ||||
| } | ||||
		Reference in New Issue
	
	Block a user