@@ -11,7 +11,7 @@ local Logbook = require('orgmode.parser.logbook')
11
11
local config = require (' orgmode.config' )
12
12
13
13
--- @class Section
14
- --- @field id number
14
+ --- @field id string
15
15
--- @field line_number number
16
16
--- @field level number
17
17
--- @field node table
@@ -20,7 +20,7 @@ local config = require('orgmode.config')
20
20
--- @field line string
21
21
--- @field range Range
22
22
--- @field sections Section[]
23
- --- @field todo_keyword table<string , string>
23
+ --- @field todo_keyword SectionTodoKeyword
24
24
--- @field priority string
25
25
--- @field title string
26
26
--- @field category string
@@ -34,8 +34,35 @@ local config = require('orgmode.config')
34
34
--- @field clocked_in boolean
35
35
local Section = {}
36
36
37
+ --- @class SectionTodoKeyword
38
+ --- @field node unknown
39
+ --- @field type ' TODO' | ' DONE' | ' '
40
+ --- @field value string
41
+
42
+ --- @class NewSectionOptions
43
+ --- @field content string[]
44
+ --- @field dates Date[]
45
+ --- @field level number
46
+ --- @field line string
47
+ --- @field logbook Logbook
48
+ --- @field node table
49
+ --- @field own_tags string[]
50
+ --- @field parent Section
51
+ --- @field priority string
52
+ --- @field properties table
53
+ --- @field range Range
54
+ --- @field root File
55
+ --- @field tags string[]
56
+ --- @field title string
57
+ --- @field todo_keyword_node unknown
58
+
59
+ --- Constructs a new Section
60
+ --- @param data NewSectionOptions
61
+ --- @return Section
37
62
function Section :new (data )
38
63
data = data or {}
64
+
65
+ --- @type Section
39
66
local section = {}
40
67
section .id = string.format (' %s####%s' , data .root .filename or ' ' , data .range .start_line )
41
68
section .line_number = data .range .start_line
@@ -337,7 +364,7 @@ function Section:is_last_section()
337
364
return self .parent .sections [# self .parent .sections ].id == self .id
338
365
end
339
366
340
- --- @return Section
367
+ --- @return Section ?
341
368
function Section :get_prev_headline_same_level ()
342
369
if self :is_first_section () then
343
370
return nil
@@ -353,7 +380,7 @@ function Section:get_prev_headline_same_level()
353
380
return nil
354
381
end
355
382
356
- --- @return Section
383
+ --- @return Section ?
357
384
function Section :get_next_headline_same_level ()
358
385
if self :is_last_section () then
359
386
return nil
0 commit comments