Skip to content

Commit 5db6494

Browse files
committed
v0.5
1 parent 215a2fa commit 5db6494

File tree

32 files changed

+1027
-259
lines changed

32 files changed

+1027
-259
lines changed

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
44

55
plugins {
66
id("org.jetbrains.kotlin.jvm") version "1.4.32"
7+
`maven-publish`
78
}
89

910
repositories {

declarations/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
plugins {
22
id("org.jetbrains.kotlin.js")
3+
`maven-publish`
34
}
45

56
repositories {
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package activityLog
2+
3+
import extensionTypes.Date
4+
import webextensions.Event
5+
6+
/**
7+
* The result of the call. */
8+
typealias Result = Any
9+
10+
/**
11+
* @param args A list of arguments passed to the call.
12+
* @param result The result of the call.
13+
* @param tabId The tab associated with this event if it is a tab or content script.
14+
* @param url If the type is content_script, this is the url of the script that was injected.
15+
*/
16+
class Data(
17+
var args: Array<dynamic>? = null,
18+
var result: Result? = null,
19+
var tabId: Int? = null,
20+
var url: String? = null
21+
)
22+
23+
/**
24+
* @param timeStamp The date string when this call is triggered.
25+
* @param type The type of log entry. api_call is a function call made by the extension and
26+
api_event is an event callback to the extension. content_script is logged when a content
27+
script is injected.
28+
* @param viewType The type of view where the activity occurred. Content scripts will not have a
29+
viewType.
30+
* @param name The name of the api call or event, or the script url if this is a content or user
31+
script event.
32+
*/
33+
class Details(
34+
var timeStamp: Date,
35+
var type: String,
36+
var viewType: String? = null,
37+
var name: String,
38+
var data: Data
39+
)
40+
41+
external class ActivityLogNamespace {
42+
/**
43+
* Receives an activityItem for each logging event.
44+
*
45+
* @param details null */
46+
val onExtensionActivity: Event<(details: Details) -> Unit>
47+
}

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ typealias IdOrIdList = Any
6868
/**
6969
* An object specifying properties and values to match when searching. Produces bookmarks matching
7070
all properties.
71-
* @param query A string of words and quoted phrases that are matched against bookmark URLs and
72-
titles.
71+
* @param query A string of words that are matched against bookmark URLs and titles.
7372
* @param url The URL of the bookmark; matches verbatim. Note that folders have no URL.
7473
* @param title The title of the bookmark; matches verbatim.
7574
*/
@@ -80,10 +79,9 @@ class Query(
8079
)
8180

8281
/**
83-
* Either a string of words and quoted phrases that are matched against bookmark URLs and titles, or
84-
an object. If an object, the properties <code>query</code>, <code>url</code>, and
85-
<code>title</code> may be specified and bookmarks matching all specified properties will be
86-
produced. */
82+
* Either a string of words that are matched against bookmark URLs and titles, or an object. If an
83+
object, the properties <code>query</code>, <code>url</code>, and <code>title</code> may be
84+
specified and bookmarks matching all specified properties will be produced. */
8785
typealias Query2 = Any
8886

8987
class Destination(var parentId: String? = null, var index: Int? = null)

declarations/src/main/kotlin/browserAction/browserAction.kt

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ class ImageDataType() {
4040
with opaque red being <code>#FF0000</code> or <code>#F00</code>. */
4141
typealias ColorValue = Any
4242

43+
/**
44+
* Information sent when a browser action is clicked.
45+
* @param modifiers An array of keyboard modifiers that were held while the menu item was clicked.
46+
* @param button An integer value of button by which menu item was clicked.
47+
*/
48+
class OnClickData(
49+
var modifiers: Array<String>,
50+
var button: Int? = null
51+
)
52+
4353
/**
4454
* The string the browser action should display when moused over. */
4555
typealias Title = Any
@@ -139,8 +149,9 @@ external class BrowserActionNamespace {
139149
* Fired when a browser action icon is clicked. This event will not fire if the browser action
140150
has a popup.
141151
*
142-
* @param tab null */
143-
val onClicked: Event<(tab: Tab) -> Unit>
152+
* @param tab null
153+
* @param info null */
154+
val onClicked: Event<(tab: Tab, info: OnClickData?) -> Unit>
144155

145156
/**
146157
* Sets the title of the browser action. This shows up in the tooltip.

declarations/src/main/kotlin/browserSettings/browserSettings.kt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ external class BrowserSettingsNamespace {
3333
*/
3434
var contextMenuShowEvent: Setting
3535

36+
/**
37+
* Returns whether the FTP protocol is enabled. Read-only.
38+
*/
39+
var ftpProtocolEnabled: Setting
40+
3641
/**
3742
* Returns the value of the overridden home page. Read-only.
3843
*/
@@ -89,4 +94,16 @@ external class BrowserSettingsNamespace {
8994
* This setting controls whether the document's fonts are used.
9095
*/
9196
var useDocumentFonts: Setting
97+
98+
/**
99+
* This boolean setting controls whether zoom is applied to the full page or to text only.
100+
*/
101+
var zoomFullPage: Setting
102+
103+
/**
104+
* This boolean setting controls whether zoom is applied on a per-site basis or to the current
105+
tab only. If privacy.resistFingerprinting is true, this setting has no effect and zoom
106+
is applied to the current tab only.
107+
*/
108+
var zoomSiteSpecific: Setting
92109
}

declarations/src/main/kotlin/browsingData/browsingData.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import kotlin.js.Promise
1010
object). If absent, defaults to 0 (which would remove all browsing data).
1111
* @param hostnames Only remove data associated with these hostnames (only applies to cookies and
1212
localStorage).
13+
* @param cookieStoreId Only remove data associated with this specific cookieStoreId.
1314
* @param originTypes An object whose properties specify which origin types ought to be cleared. If
1415
this object isn't specified, it defaults to clearing only "unprotected" origins. Please
1516
ensure that you <em>really</em> want to remove application data before adding 'protectedWeb'
@@ -18,6 +19,7 @@ import kotlin.js.Promise
1819
class RemovalOptions(
1920
var since: Date? = null,
2021
var hostnames: Array<String>? = null,
22+
var cookieStoreId: String? = null,
2123
var originTypes: OriginTypes? = null
2224
)
2325

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package captivePortal
2+
3+
import kotlin.js.Promise
4+
import types.Setting
5+
import webextensions.Event
6+
7+
/**
8+
* @param state The current captive portal state.
9+
*/
10+
class Details(
11+
var state: String
12+
)
13+
14+
external class CaptivePortalNamespace {
15+
/**
16+
* Fired when the captive portal state changes.
17+
*
18+
* @param details null */
19+
val onStateChanged: Event<(details: Details) -> Unit>
20+
21+
/**
22+
* This notification will be emitted when the captive portal service has determined that we can
23+
connect to the internet. The service will pass either `captive` if there is an unlocked
24+
captive portal present, or `clear` if no captive portal was detected.
25+
*
26+
* @param status null */
27+
val onConnectivityAvailable: Event<(status: String) -> Unit>
28+
29+
/**
30+
* Return the canonical captive-portal detection URL. Read-only.
31+
*/
32+
var canonicalURL: Setting
33+
34+
/**
35+
* Returns the current portal state, one of `unknown`, `not_captive`, `unlocked_portal`,
36+
`locked_portal`.
37+
*/
38+
fun getState(): Promise<Any>
39+
40+
/**
41+
* Returns the time difference between NOW and the last time a request was completed in
42+
milliseconds.
43+
*/
44+
fun getLastChecked(): Promise<Any>
45+
}

declarations/src/main/kotlin/commands/commands.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package commands
22

33
import kotlin.js.Promise
4-
import manifest.KeyName
54
import webextensions.Event
65

76
/**
@@ -23,7 +22,7 @@ class Command(
2322
class Detail(
2423
var name: String,
2524
var description: String? = null,
26-
var shortcut: KeyName? = null
25+
var shortcut: String? = null
2726
)
2827

2928
external class CommandsNamespace {

declarations/src/main/kotlin/devtools/devtools.kt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package devtools
22

3+
import kotlin.Suppress
4+
import kotlin.js.Promise
35
import manifest.ExtensionURL
46
import webextensions.Event
5-
import kotlin.js.Promise
67

78
/**
89
* Set to undefined if the resource content was set successfully; describes error otherwise.
@@ -248,14 +249,14 @@ external class PanelsNamespace {
248249
*/
249250
var themeName: String
250251

251-
// /**
252-
// * Creates an extension panel.
253-
// */
254-
// fun create(
255-
// title: String,
256-
// iconPath: String,
257-
// pagePath: ExtensionURL
258-
// ): Promise<ExtensionPanel>
252+
/**
253+
* Creates an extension panel.
254+
*/
255+
fun create(
256+
title: String,
257+
iconPath: String,
258+
pagePath: ExtensionURL
259+
): Promise<ExtensionPanel>
259260

260261
/**
261262
* Creates an extension panel.

declarations/src/main/kotlin/downloads/downloads.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class DownloadItem(
5050
var filename: String,
5151
var incognito: Boolean,
5252
var danger: DangerType,
53-
var mime: String,
53+
var mime: String? = null,
5454
var startTime: String,
5555
var endTime: String? = null,
5656
var estimatedEndTime: String? = null,
@@ -171,6 +171,8 @@ class Headers(
171171
<code>value</code> or <code>binaryValue</code>, restricted to those allowed by
172172
XMLHttpRequest.
173173
* @param body Post body.
174+
* @param allowHttpErrors When this flag is set to <code>true</code>, then the browser will allow
175+
downloads to proceed after encountering HTTP errors such as <code>404 Not Found</code>.
174176
*/
175177
class Options(
176178
var url: String,
@@ -180,7 +182,8 @@ class Options(
180182
var saveAs: Boolean? = null,
181183
var method: String? = null,
182184
var headers: Array<Headers>? = null,
183-
var body: String? = null
185+
var body: String? = null,
186+
var allowHttpErrors: Boolean? = null
184187
)
185188

186189
/**

declarations/src/main/kotlin/extensionTypes/extensionTypes.kt

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,20 @@ package extensionTypes
55
typealias ImageFormat = String
66

77
/**
8-
* Details about the format and quality of an image.
8+
* Details about the format, quality, area and scale of the capture.
99
* @param format The format of the resulting image. Default is <code>"jpeg"</code>.
1010
* @param quality When format is <code>"jpeg"</code>, controls the quality of the resulting image.
1111
This value is ignored for PNG images. As quality is decreased, the resulting image will
1212
have more visual artifacts, and the number of bytes needed to store it will decrease.
13+
* @param rect The area of the document to capture, in CSS pixels, relative to the page. If
14+
omitted, capture the visible viewport.
15+
* @param scale The scale of the resulting image. Defaults to <code>devicePixelRatio</code>.
1316
*/
1417
class ImageDetails(
1518
var format: ImageFormat? = null,
16-
var quality: Int? = null
19+
var quality: Int? = null,
20+
var rect: Rect? = null,
21+
var scale: Float? = null
1722
)
1823

1924
/**
@@ -62,4 +67,15 @@ typealias ExtensionFileOrCode = Any
6267
* A plain JSON value */
6368
typealias PlainJSONValue = Any
6469

70+
/**
71+
* The area of the document to capture, in CSS pixels, relative to the page. If omitted, capture
72+
the visible viewport.
73+
*/
74+
class Rect(
75+
var x: Float,
76+
var y: Float,
77+
var width: Float,
78+
var height: Float
79+
)
80+
6581
external class ExtensionTypesNamespace

declarations/src/main/kotlin/geckoProfiler/geckoProfiler.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ external class GeckoProfilerNamespace {
5454
*/
5555
fun resume(): Promise<Any>
5656

57+
/**
58+
* Gathers the profile data from the current profiling session, and writes it to disk. The
59+
returned promise resolves to a path that locates the created file.
60+
*/
61+
fun dumpProfileToFile(fileName: String): Promise<Any>
62+
5763
/**
5864
* Gathers the profile data from the current profiling session.
5965
*/
@@ -65,6 +71,12 @@ external class GeckoProfilerNamespace {
6571
*/
6672
fun getProfileAsArrayBuffer(): Promise<Any>
6773

74+
/**
75+
* Gathers the profile data from the current profiling session. The returned promise resolves to
76+
an array buffer that contains a gzipped JSON string.
77+
*/
78+
fun getProfileAsGzippedArrayBuffer(): Promise<Any>
79+
6880
/**
6981
* Gets the debug symbols for a particular library.
7082
*/

0 commit comments

Comments
 (0)