-
Notifications
You must be signed in to change notification settings - Fork 342
/
types.ts
66 lines (58 loc) · 1.59 KB
/
types.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import Storex, { FindManyOptions } from '@worldbrain/storex'
export * from '@worldbrain/memex-common/lib/page-indexing/types'
export type DBGet = () => Promise<Storex>
export type SuggestOptions = FindManyOptions & {
/** Define the name of a field to return in case suggest is being performed on a Dexie multi-entry index. */
multiEntryAssocField?: string
}
export type SuggestResult<S, P> = Array<{
collection: string
suggestion: S
pk: P
}>
export type BookmarkInput = number
export type PageID = string
export type PageScore = number
export type SearchResult = [PageID, PageScore, number]
export type TermsIndexName = 'terms' | 'urlTerms' | 'titleTerms'
export type PageResultsMap = Map<PageID, PageScore>
export interface SearchParams {
domains: string[]
domainsExclude: string[]
tags: string[]
tagsExc: string[]
terms: string[]
termsExclude: string[]
bookmarks: boolean
endDate?: number
startDate?: number
skip?: number
limit?: number
lists: number[]
}
export interface FilteredIDs<T = string> {
include: Set<T>
exclude: Set<T>
isAllowed(url: T): boolean
isDataFiltered: boolean
}
export interface VisitInteraction {
duration: number
scrollPx: number
scrollPerc: number
scrollMaxPx: number
scrollMaxPerc: number
}
export interface PageCreationProps {
fullUrl: string
tabId?: number
allowScreenshot?: boolean
visitTime?: number | '$now'
skipUpdatePageCount?: boolean
metaData?: {
pageTitle?: string
}
}
export interface PageCreationOpts {
addInboxEntryOnCreate?: boolean
}