Skip to content

Commit 265274e

Browse files
committed
generate all secondary types as not external and add bodies to indexers
1 parent 48a0b49 commit 265274e

File tree

37 files changed

+3878
-4860
lines changed

37 files changed

+3878
-4860
lines changed

declarations/src/main/kotlin/alarms/alarms.kt

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,38 @@ package alarms
33
import browser.Event
44
import kotlin.js.Promise
55

6-
external class Alarm {
7-
/**
8-
* Name of this alarm.
9-
*/
10-
var name: String
11-
12-
/**
13-
* Time when the alarm is scheduled to fire, in milliseconds past the epoch.
14-
*/
15-
var scheduledTime: Int
16-
17-
/**
18-
* When present, signals that the alarm triggers periodically after so many minutes.
19-
*/
20-
var periodInMinutes: Int?
21-
}
6+
class Alarm(
7+
/**
8+
* Name of this alarm.
9+
*/
10+
var name: String,
11+
/**
12+
* Time when the alarm is scheduled to fire, in milliseconds past the epoch.
13+
*/
14+
var scheduledTime: Int,
15+
/**
16+
* When present, signals that the alarm triggers periodically after so many minutes.
17+
*/
18+
var periodInMinutes: Int? = null
19+
)
2220

2321
/**
2422
* Details about the alarm. The alarm first fires either at 'when' milliseconds past the epoch (if 'when' is provided), after 'delayInMinutes' minutes from the current time (if 'delayInMinutes' is provided instead), or after 'periodInMinutes' minutes from the current time (if only 'periodInMinutes' is provided). Users should never provide both 'when' and 'delayInMinutes'. If 'periodInMinutes' is provided, then the alarm recurs repeatedly after that many minutes.
2523
*/
26-
external class AlarmInfo {
27-
/**
28-
* Time when the alarm is scheduled to first fire, in milliseconds past the epoch.
29-
*/
30-
var `when`: Int?
31-
32-
/**
33-
* Number of minutes from the current time after which the alarm should first fire.
34-
*/
35-
var delayInMinutes: Int?
36-
37-
/**
38-
* Number of minutes after which the alarm should recur repeatedly.
39-
*/
40-
var periodInMinutes: Int?
41-
}
24+
class AlarmInfo(
25+
/**
26+
* Time when the alarm is scheduled to first fire, in milliseconds past the epoch.
27+
*/
28+
var `when`: Int? = null,
29+
/**
30+
* Number of minutes from the current time after which the alarm should first fire.
31+
*/
32+
var delayInMinutes: Int? = null,
33+
/**
34+
* Number of minutes after which the alarm should recur repeatedly.
35+
*/
36+
var periodInMinutes: Int? = null
37+
)
4238

4339
external class AlarmsNamespace {
4440
val onAlarm: Event<(name: Alarm) -> Unit>

declarations/src/main/kotlin/bookmarks/bookmarks.kt

Lines changed: 84 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -14,78 +14,65 @@ typealias BookmarkTreeNodeType = String
1414
/**
1515
* A node (either a bookmark or a folder) in the bookmark tree. Child nodes are ordered within their parent folder.
1616
*/
17-
external class BookmarkTreeNode {
18-
/**
19-
* The unique identifier for the node. IDs are unique within the current profile, and they remain valid even after the browser is restarted.
20-
*/
21-
var id: String
22-
23-
/**
24-
* The <code>id</code> of the parent folder. Omitted for the root node.
25-
*/
26-
var parentId: String?
27-
28-
/**
29-
* The 0-based position of this node within its parent folder.
30-
*/
31-
var index: Int?
32-
33-
/**
34-
* The URL navigated to when a user clicks the bookmark. Omitted for folders.
35-
*/
36-
var url: String?
37-
38-
/**
39-
* The text displayed for the node.
40-
*/
41-
var title: String
42-
43-
/**
44-
* When this node was created, in milliseconds since the epoch (<code>new Date(dateAdded)</code>).
45-
*/
46-
var dateAdded: Int?
47-
48-
/**
49-
* When the contents of this folder last changed, in milliseconds since the epoch.
50-
*/
51-
var dateGroupModified: Int?
52-
53-
/**
54-
* Indicates the reason why this node is unmodifiable. The <var>managed</var> value indicates that this node was configured by the system administrator or by the custodian of a supervised user. Omitted if the node can be modified by the user and the extension (default).
55-
*/
56-
var unmodifiable: BookmarkTreeNodeUnmodifiable?
57-
58-
/**
59-
* Indicates the type of the BookmarkTreeNode, which can be one of bookmark, folder or separator.
60-
*/
61-
var type: BookmarkTreeNodeType?
62-
63-
/**
64-
* An ordered list of children of this node.
65-
*/
66-
var children: Array<BookmarkTreeNode>
67-
}
17+
class BookmarkTreeNode(
18+
/**
19+
* The unique identifier for the node. IDs are unique within the current profile, and they remain valid even after the browser is restarted.
20+
*/
21+
var id: String,
22+
/**
23+
* The <code>id</code> of the parent folder. Omitted for the root node.
24+
*/
25+
var parentId: String? = null,
26+
/**
27+
* The 0-based position of this node within its parent folder.
28+
*/
29+
var index: Int? = null,
30+
/**
31+
* The URL navigated to when a user clicks the bookmark. Omitted for folders.
32+
*/
33+
var url: String? = null,
34+
/**
35+
* The text displayed for the node.
36+
*/
37+
var title: String,
38+
/**
39+
* When this node was created, in milliseconds since the epoch (<code>new Date(dateAdded)</code>).
40+
*/
41+
var dateAdded: Int? = null,
42+
/**
43+
* When the contents of this folder last changed, in milliseconds since the epoch.
44+
*/
45+
var dateGroupModified: Int? = null,
46+
/**
47+
* Indicates the reason why this node is unmodifiable. The <var>managed</var> value indicates that this node was configured by the system administrator or by the custodian of a supervised user. Omitted if the node can be modified by the user and the extension (default).
48+
*/
49+
var unmodifiable: BookmarkTreeNodeUnmodifiable? = null,
50+
/**
51+
* Indicates the type of the BookmarkTreeNode, which can be one of bookmark, folder or separator.
52+
*/
53+
var type: BookmarkTreeNodeType? = null,
54+
/**
55+
* An ordered list of children of this node.
56+
*/
57+
var children: Array<BookmarkTreeNode>? = null
58+
)
6859

6960
/**
7061
* Object passed to the create() function.
7162
*/
72-
external class CreateDetails {
73-
/**
74-
* Defaults to the Other Bookmarks folder.
75-
*/
76-
var parentId: String?
77-
78-
var index: Int?
79-
80-
var title: String?
81-
82-
var url: String?
83-
84-
/**
85-
* Indicates the type of BookmarkTreeNode to create, which can be one of bookmark, folder or separator.
86-
*/
87-
var type: BookmarkTreeNodeType?
88-
}
63+
class CreateDetails(
64+
/**
65+
* Defaults to the Other Bookmarks folder.
66+
*/
67+
var parentId: String? = null,
68+
var index: Int? = null,
69+
var title: String? = null,
70+
var url: String? = null,
71+
/**
72+
* Indicates the type of BookmarkTreeNode to create, which can be one of bookmark, folder or separator.
73+
*/
74+
var type: BookmarkTreeNodeType? = null
75+
)
8976

9077
/**
9178
* A single string-valued id, or an array of string-valued ids */
@@ -94,66 +81,45 @@ typealias IdOrIdList = Any
9481
/**
9582
* An object specifying properties and values to match when searching. Produces bookmarks matching all properties.
9683
*/
97-
external class Query {
98-
/**
99-
* A string of words and quoted phrases that are matched against bookmark URLs and titles.
100-
*/
101-
var query: String?
102-
103-
/**
104-
* The URL of the bookmark; matches verbatim. Note that folders have no URL.
105-
*/
106-
var url: String?
107-
108-
/**
109-
* The title of the bookmark; matches verbatim.
110-
*/
111-
var title: String?
112-
}
84+
class Query(
85+
/**
86+
* A string of words and quoted phrases that are matched against bookmark URLs and titles.
87+
*/
88+
var query: String? = null,
89+
/**
90+
* The URL of the bookmark; matches verbatim. Note that folders have no URL.
91+
*/
92+
var url: String? = null,
93+
/**
94+
* The title of the bookmark; matches verbatim.
95+
*/
96+
var title: String? = null
97+
)
11398

11499
/**
115100
* Either a string of words and quoted phrases that are matched against bookmark URLs and titles, or an object. If an object, the properties <code>query</code>, <code>url</code>, and <code>title</code> may be specified and bookmarks matching all specified properties will be produced. */
116101
typealias Query2 = Any
117102

118-
external class Destination {
119-
var parentId: String?
120-
121-
var index: Int?
122-
}
123-
124-
external class Changes {
125-
var title: String?
103+
class Destination(var parentId: String? = null, var index: Int? = null)
126104

127-
var url: String?
128-
}
129-
130-
external class RemoveInfo {
131-
var parentId: String
105+
class Changes(var title: String? = null, var url: String? = null)
132106

133-
var index: Int
107+
class RemoveInfo(
108+
var parentId: String,
109+
var index: Int,
110+
var node: BookmarkTreeNode
111+
)
134112

135-
var node: BookmarkTreeNode
136-
}
113+
class ChangeInfo(var title: String, var url: String? = null)
137114

138-
external class ChangeInfo {
139-
var title: String
115+
class MoveInfo(
116+
var parentId: String,
117+
var index: Int,
118+
var oldParentId: String,
119+
var oldIndex: Int
120+
)
140121

141-
var url: String?
142-
}
143-
144-
external class MoveInfo {
145-
var parentId: String
146-
147-
var index: Int
148-
149-
var oldParentId: String
150-
151-
var oldIndex: Int
152-
}
153-
154-
external class ReorderInfo {
155-
var childIds: Array<String>
156-
}
122+
class ReorderInfo(var childIds: Array<String>)
157123

158124
external class BookmarksNamespace {
159125
val onCreated: Event<(id: String, bookmark: BookmarkTreeNode) -> Unit>

0 commit comments

Comments
 (0)