@@ -11,7 +11,7 @@ local Logbook = require('orgmode.parser.logbook')
1111local config = require (' orgmode.config' )
1212
1313--- @class Section
14- --- @field id number
14+ --- @field id string
1515--- @field line_number number
1616--- @field level number
1717--- @field node table
@@ -20,7 +20,7 @@ local config = require('orgmode.config')
2020--- @field line string
2121--- @field range Range
2222--- @field sections Section[]
23- --- @field todo_keyword table<string , string>
23+ --- @field todo_keyword SectionTodoKeyword
2424--- @field priority string
2525--- @field title string
2626--- @field category string
@@ -34,8 +34,35 @@ local config = require('orgmode.config')
3434--- @field clocked_in boolean
3535local Section = {}
3636
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
3762function Section :new (data )
3863 data = data or {}
64+
65+ --- @type Section
3966 local section = {}
4067 section .id = string.format (' %s####%s' , data .root .filename or ' ' , data .range .start_line )
4168 section .line_number = data .range .start_line
@@ -337,7 +364,7 @@ function Section:is_last_section()
337364 return self .parent .sections [# self .parent .sections ].id == self .id
338365end
339366
340- --- @return Section
367+ --- @return Section ?
341368function Section :get_prev_headline_same_level ()
342369 if self :is_first_section () then
343370 return nil
@@ -353,7 +380,7 @@ function Section:get_prev_headline_same_level()
353380 return nil
354381end
355382
356- --- @return Section
383+ --- @return Section ?
357384function Section :get_next_headline_same_level ()
358385 if self :is_last_section () then
359386 return nil
0 commit comments