summaryrefslogtreecommitdiffstats
path: root/lua/inbox/types.lua
blob: 7894e8d42995637574399e2bb6baf004ea03a2ab (plain)
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
67
68
69
70
---@alias inbox.Headers table<inbox.Header, string>

---@alias inbox.Header
---| "Subject"
---| "Date"
---| "To"
---| "From"
---| string

---@alias inbox.ContentType
---| "text/plain"
---| "text/html"
---| string

---@class inbox.Indexer
---@field setup? fun(opts: table)
---@field available? fun(): boolean
---@field index? fun(bufnr: integer, cb: fun(entries: inbox.Summary[]), opts?: table)
---@field get_entry? fun(bufnr: integer, lnum: integer): inbox.Entry?
---@field get_parts? fun(bufnr: integer, lnum: integer): inbox.ContentType[]
---@field get_part? fun(bufnr: integer, lnum: integer, content_type: inbox.ContentType): string[]

---@alias inbox.Indexer.Config
---| "notmuch"
---| string
---| table

---@class inbox.Summary
---@field tags string[]
---@field date string
---@field from string
---@field subject string

---@class inbox.Entry
---@field timestamp integer
---@field filename string
---@field tags string[]
---@field parts string[]
---@field headers inbox.Headers

---@class inbox.EntryPart
---@field id integer
---@field content-type inbox.ContentType
---@field content-charset? string
---@field content-length? integer
---@field	content-disposition? string
---@field	content-transfer-encoding? string
---@field content? string | inbox.EntryPart[]

---@class inbox.Notmuch.SearchResult
---@field authors string | string[]
---@field date_relative string
---@field matched integer
---@field query string[]
---@field subject string | string[]
---@field tags string[]
---@field thread integer
---@field timestamp integer
---@field total integer

---@class inbox.Notmuch.ShowResult
---@field id string
---@field filename string[]
---@field timestamp integer
---@field date_relative string?
---@field tags string[]
---@field duplicate integer
---@field body inbox.EntryPart[]
---@field crypto table
---@field headers inbox.Headers