-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathshim.d.ts
35 lines (33 loc) · 1.02 KB
/
shim.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { ProtocolWithReturn } from 'webext-bridge'
import { File as FileStoreElement } from './src/background/libs/fileCache'
interface ResourceResponse {
isError: boolean
error: Error | null
data:
| {
id: number
name: string
url: string
file: FileStoreElement
}[]
| null
}
declare module 'webext-bridge' {
export interface ProtocolMap {
// define message protocol types
// see https://github.com/antfu/webext-bridge#type-safe-protocols
'tab-prev': { title: string | undefined }
'get-current-tab': ProtocolWithReturn<
{ tabId: number },
{ title?: string }
>
'remember-resources': ProtocolWithReturn<
{ items: { name: string; url: string; ex: number }[] },
ResourceResponse
>
'update-resources': ProtocolWithReturn<
{ items: { id: number; name: string; url: string }[] },
ResourceResponse
>
}
}