///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
///
/**
* Type Definitions for Gjs (https://gjs.guide/)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in `ts-for-gir` or create a bug report on https://github.com/gjsify/ts-for-gir
*
* The based EJS template file is used for the generated .d.ts file of each GIR module like Gtk-4.0, GObject-2.0, ...
*/
declare module 'gi://WebKit2?version=4.0' {
// Module dependencies
import type Soup from 'gi://Soup?version=2.4';
import type Gio from 'gi://Gio?version=2.0';
import type GObject from 'gi://GObject?version=2.0';
import type GLib from 'gi://GLib?version=2.0';
import type GModule from 'gi://GModule?version=2.0';
import type JavaScriptCore from 'gi://JavaScriptCore?version=4.0';
import type Gtk from 'gi://Gtk?version=3.0';
import type xlib from 'gi://xlib?version=2.0';
import type Gdk from 'gi://Gdk?version=3.0';
import type cairo from 'cairo';
import type Pango from 'gi://Pango?version=1.0';
import type HarfBuzz from 'gi://HarfBuzz?version=0.0';
import type freetype2 from 'gi://freetype2?version=2.0';
import type GdkPixbuf from 'gi://GdkPixbuf?version=2.0';
import type Atk from 'gi://Atk?version=1.0';
export namespace WebKit2 {
/**
* WebKit2-4.0
*/
/**
* Enum values representing the authentication scheme.
*/
/**
* Enum values representing the authentication scheme.
*/
export namespace AuthenticationScheme {
export const $gtype: GObject.GType;
}
enum AuthenticationScheme {
/**
* The default authentication scheme of WebKit.
*/
DEFAULT,
/**
* Basic authentication scheme as defined in RFC 2617.
*/
HTTP_BASIC,
/**
* Digest authentication scheme as defined in RFC 2617.
*/
HTTP_DIGEST,
/**
* HTML Form authentication.
*/
HTML_FORM,
/**
* NTLM Microsoft proprietary authentication scheme.
*/
NTLM,
/**
* Negotiate (or SPNEGO) authentication scheme as defined in RFC 4559.
*/
NEGOTIATE,
/**
* Client Certificate Authentication (see RFC 2246).
*/
CLIENT_CERTIFICATE_REQUESTED,
/**
* Server Trust Authentication.
*/
SERVER_TRUST_EVALUATION_REQUESTED,
/**
* Client certificate PIN required for use. Since: 2.34
*/
CLIENT_CERTIFICATE_PIN_REQUESTED,
/**
* Authentication scheme unknown.
*/
UNKNOWN,
}
/**
* Enum values used for determining the automation browsing context presentation.
*/
/**
* Enum values used for determining the automation browsing context presentation.
*/
export namespace AutomationBrowsingContextPresentation {
export const $gtype: GObject.GType;
}
enum AutomationBrowsingContextPresentation {
/**
* a window
*/
WINDOW,
/**
* a tab
*/
TAB,
}
/**
* Enum values used to specify autoplay policies.
*/
/**
* Enum values used to specify autoplay policies.
*/
export namespace AutoplayPolicy {
export const $gtype: GObject.GType;
}
enum AutoplayPolicy {
/**
* Do not restrict autoplay.
*/
ALLOW,
/**
* Allow videos to autoplay if
* they have no audio track, or if their audio track is muted.
*/
ALLOW_WITHOUT_SOUND,
/**
* Never allow autoplay.
*/
DENY,
}
/**
* Enum values used for determining the #WebKitWebContext cache model.
*/
/**
* Enum values used for determining the #WebKitWebContext cache model.
*/
export namespace CacheModel {
export const $gtype: GObject.GType;
}
enum CacheModel {
/**
* Disable the cache completely, which
* substantially reduces memory usage. Useful for applications that only
* access a single local file, with no navigation to other pages. No remote
* resources will be cached.
*/
DOCUMENT_VIEWER,
/**
* Improve document load speed substantially
* by caching a very large number of resources and previously viewed content.
*/
WEB_BROWSER,
/**
* A cache model optimized for viewing
* a series of local files -- for example, a documentation viewer or a website
* designer. WebKit will cache a moderate number of resources.
*/
DOCUMENT_BROWSER,
}
/**
* Enum values used to denote the stock actions for
* #WebKitContextMenuItems
*/
/**
* Enum values used to denote the stock actions for
* #WebKitContextMenuItems
*/
export namespace ContextMenuAction {
export const $gtype: GObject.GType;
}
enum ContextMenuAction {
/**
* No action, used by separator menu items.
*/
NO_ACTION,
/**
* Open current link.
*/
OPEN_LINK,
/**
* Open current link in a new window.
*/
OPEN_LINK_IN_NEW_WINDOW,
/**
* Download link destination.
*/
DOWNLOAD_LINK_TO_DISK,
/**
* Copy link location to the clipboard.
*/
COPY_LINK_TO_CLIPBOARD,
/**
* Open current image in a new window.
*/
OPEN_IMAGE_IN_NEW_WINDOW,
/**
* Download current image.
*/
DOWNLOAD_IMAGE_TO_DISK,
/**
* Copy current image to the clipboard.
*/
COPY_IMAGE_TO_CLIPBOARD,
/**
* Copy current image location to the clipboard.
*/
COPY_IMAGE_URL_TO_CLIPBOARD,
/**
* Open current frame in a new window.
*/
OPEN_FRAME_IN_NEW_WINDOW,
/**
* Load the previous history item.
*/
GO_BACK,
/**
* Load the next history item.
*/
GO_FORWARD,
/**
* Stop any ongoing loading operation.
*/
STOP,
/**
* Reload the contents of current view.
*/
RELOAD,
/**
* Copy current selection the clipboard.
*/
COPY,
/**
* Cut current selection to the clipboard.
*/
CUT,
/**
* Paste clipboard contents.
*/
PASTE,
/**
* Delete current selection.
*/
DELETE,
/**
* Select all text.
*/
SELECT_ALL,
/**
* Input methods menu.
*/
INPUT_METHODS,
/**
* Unicode menu.
*/
UNICODE,
/**
* A proposed replacement for a misspelled word.
*/
SPELLING_GUESS,
/**
* An indicator that spellchecking found no proposed replacements.
*/
NO_GUESSES_FOUND,
/**
* Causes the spellchecker to ignore the word for this session.
*/
IGNORE_SPELLING,
/**
* Causes the spellchecker to add the word to the dictionary.
*/
LEARN_SPELLING,
/**
* Ignore grammar.
*/
IGNORE_GRAMMAR,
/**
* Font options menu.
*/
FONT_MENU,
/**
* Bold.
*/
BOLD,
/**
* Italic.
*/
ITALIC,
/**
* Underline.
*/
UNDERLINE,
/**
* Outline.
*/
OUTLINE,
/**
* Open current element in the inspector.
*/
INSPECT_ELEMENT,
/**
* Open current video element in a new window.
*/
OPEN_VIDEO_IN_NEW_WINDOW,
/**
* Open current audio element in a new window.
*/
OPEN_AUDIO_IN_NEW_WINDOW,
/**
* Copy video link location in to the clipboard.
*/
COPY_VIDEO_LINK_TO_CLIPBOARD,
/**
* Copy audio link location in to the clipboard.
*/
COPY_AUDIO_LINK_TO_CLIPBOARD,
/**
* Enable or disable media controls.
*/
TOGGLE_MEDIA_CONTROLS,
/**
* Enable or disable media loop.
*/
TOGGLE_MEDIA_LOOP,
/**
* Show current video element in fullscreen mode.
*/
ENTER_VIDEO_FULLSCREEN,
/**
* Play current media element.
*/
MEDIA_PLAY,
/**
* Pause current media element.
*/
MEDIA_PAUSE,
/**
* Mute current media element.
*/
MEDIA_MUTE,
/**
* Download video to disk. Since 2.2
*/
DOWNLOAD_VIDEO_TO_DISK,
/**
* Download audio to disk. Since 2.2
*/
DOWNLOAD_AUDIO_TO_DISK,
/**
* Insert an emoji. Since 2.26
*/
INSERT_EMOJI,
/**
* Paste clipboard contents as plain text. Since 2.30
*/
PASTE_AS_PLAIN_TEXT,
/**
* Custom action defined by applications.
*/
CUSTOM,
}
/**
* Enum values used to denote the cookie acceptance policies.
*/
/**
* Enum values used to denote the cookie acceptance policies.
*/
export namespace CookieAcceptPolicy {
export const $gtype: GObject.GType;
}
enum CookieAcceptPolicy {
/**
* Accept all cookies unconditionally.
*/
ALWAYS,
/**
* Reject all cookies unconditionally.
*/
NEVER,
/**
* Accept only cookies set by the main document loaded.
*/
NO_THIRD_PARTY,
}
/**
* Enum values used to denote the cookie persistent storage types.
*/
/**
* Enum values used to denote the cookie persistent storage types.
*/
export namespace CookiePersistentStorage {
export const $gtype: GObject.GType;
}
enum CookiePersistentStorage {
/**
* Cookies are stored in a text
* file in the Mozilla "cookies.txt" format.
*/
TEXT,
/**
* Cookies are stored in a SQLite
* file in the current Mozilla format.
*/
SQLITE,
}
/**
* Enum values representing the duration for which a credential persists.
*/
/**
* Enum values representing the duration for which a credential persists.
*/
export namespace CredentialPersistence {
export const $gtype: GObject.GType;
}
enum CredentialPersistence {
/**
* Credential does not persist
*/
NONE,
/**
* Credential persists for session only
*/
FOR_SESSION,
/**
* Credential persists permanently
*/
PERMANENT,
}
/**
* Enum values used to denote the various download errors.
*/
class DownloadError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* Download failure due to network error
*/
static NETWORK: number;
/**
* Download was cancelled by user
*/
static CANCELLED_BY_USER: number;
/**
* Download failure due to destination error
*/
static DESTINATION: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
/**
* Gets the quark for the domain of download errors.
*/
static quark(): GLib.Quark;
}
/**
* Enum values used to denote the various errors related to the #WebKitFaviconDatabase.
*/
class FaviconDatabaseError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* The #WebKitFaviconDatabase is closed
*/
static NOT_INITIALIZED: number;
/**
* There is not an icon available for the requested URL
*/
static FAVICON_NOT_FOUND: number;
/**
* There might be an icon for the requested URL, but its data is unknown at the moment
*/
static FAVICON_UNKNOWN: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
/**
* Gets the quark for the domain of favicon database errors.
*/
static quark(): GLib.Quark;
}
/**
* Describes the status of a [struct`WebKitFeature]`.
*
* The status for a given feature can be obtained with
* [id`webkit_feature_get_status]`.
*/
/**
* Describes the status of a [struct`WebKitFeature]`.
*
* The status for a given feature can be obtained with
* [id`webkit_feature_get_status]`.
*/
export namespace FeatureStatus {
export const $gtype: GObject.GType;
}
enum FeatureStatus {
/**
* Feature that adjust behaviour for
* specific application needs. The feature is not part of a Web platform
* feature, not a mature feature intended to be always on.
*/
EMBEDDER,
/**
* Feature in development. The feature
* may be unfinished, and there are no guarantees about its safety and
* stability.
*/
UNSTABLE,
/**
* Feature for debugging the WebKit engine.
* The feature is not generally useful for user or web developers, and
* always disabled by default.
*/
INTERNAL,
/**
* Feature for web developers. The feature
* is not generally useful for end users, and always disabled by default.
*/
DEVELOPER,
/**
* Feature in active development and
* complete enough for testing. The feature may not be yet ready to
* ship and is disabled by default.
*/
TESTABLE,
/**
* Feature ready to be tested by users.
* The feature is disabled by default, but may be enabled by applications
* automatically e.g. in their “technology preview” or “beta” versions.
*/
PREVIEW,
/**
* Feature ready for general use. The
* feature is enabled by default, but it may still be toggled to support
* debugging and testing.
*/
STABLE,
/**
* Feature in general use. The feature is
* always enabled and in general there should be no user-facing interface
* to toggle it.
*/
MATURE,
}
/**
* Enum values used for determining the hardware acceleration policy.
*/
/**
* Enum values used for determining the hardware acceleration policy.
*/
export namespace HardwareAccelerationPolicy {
export const $gtype: GObject.GType;
}
enum HardwareAccelerationPolicy {
/**
* Hardware acceleration is enabled/disabled as request by web contents.
*/
ON_DEMAND,
/**
* Hardware acceleration is always enabled, even for websites not requesting it.
*/
ALWAYS,
/**
* Hardware acceleration is always disabled, even for websites requesting it.
*/
NEVER,
}
/**
* Enum values used to describe the primary purpose of the active editable element.
*/
/**
* Enum values used to describe the primary purpose of the active editable element.
*/
export namespace InputPurpose {
export const $gtype: GObject.GType;
}
enum InputPurpose {
/**
* Editable element expects any characters
*/
FREE_FORM,
/**
* Editable element expects digits
*/
DIGITS,
/**
* Editable element expects a number
*/
NUMBER,
/**
* Editable element expects a telephone
*/
PHONE,
/**
* Editable element expects a URL
*/
URL,
/**
* Editable element expects an email
*/
EMAIL,
/**
* Editable element expects a password
*/
PASSWORD,
}
/**
* Enum values previously used to denote the different events which can trigger
* the detection of insecure content. Since 2.46, WebKit generally no longer
* loads insecure content in secure contexts.
*/
/**
* Enum values previously used to denote the different events which can trigger
* the detection of insecure content. Since 2.46, WebKit generally no longer
* loads insecure content in secure contexts.
*/
export namespace InsecureContentEvent {
export const $gtype: GObject.GType;
}
enum InsecureContentEvent {
/**
* Insecure content has been detected by
* trying to execute any kind of logic (e.g. a script) from an
* untrusted source.
*/
RUN,
/**
* Insecure content has been
* detected by trying to display any kind of resource (e.g. an image)
* from an untrusted source.
*/
DISPLAYED,
}
/**
* Enum values used to denote errors happening when executing JavaScript
*/
class JavascriptError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* An exception was raised in JavaScript execution
*/
static SCRIPT_FAILED: number;
/**
* An unsupported parameter has been used to call and async function from API. Since 2.40
*/
static INVALID_PARAMETER: number;
/**
* The result of JavaScript execution could not be returned. Since 2.40
*/
static INVALID_RESULT: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
/**
* Gets the quark for the domain of JavaScript errors.
*/
static quark(): GLib.Quark;
}
/**
* Enum values used to denote the different events that happen during a
* #WebKitWebView load operation.
*/
/**
* Enum values used to denote the different events that happen during a
* #WebKitWebView load operation.
*/
export namespace LoadEvent {
export const $gtype: GObject.GType;
}
enum LoadEvent {
/**
* A new load request has been made.
* No data has been received yet, empty structures have
* been allocated to perform the load; the load may still
* fail due to transport issues such as not being able to
* resolve a name, or connect to a port.
*/
STARTED,
/**
* A provisional data source received
* a server redirect.
*/
REDIRECTED,
/**
* The content started arriving for a page load.
* The necessary transport requirements are established, and the
* load is being performed.
*/
COMMITTED,
/**
* Load completed. All resources are done loading
* or there was an error during the load operation.
*/
FINISHED,
}
/**
* Enum values used to specify the capture state of a media device.
*/
/**
* Enum values used to specify the capture state of a media device.
*/
export namespace MediaCaptureState {
export const $gtype: GObject.GType;
}
enum MediaCaptureState {
/**
* Media capture is disabled.
*/
NONE,
/**
* Media capture is active.
*/
ACTIVE,
/**
* Media capture is muted.
*/
MUTED,
}
/**
* Enum values used to denote the various navigation types.
*/
/**
* Enum values used to denote the various navigation types.
*/
export namespace NavigationType {
export const $gtype: GObject.GType;
}
enum NavigationType {
/**
* The navigation was triggered by clicking a link.
*/
LINK_CLICKED,
/**
* The navigation was triggered by submitting a form.
*/
FORM_SUBMITTED,
/**
* The navigation was triggered by navigating forward or backward.
*/
BACK_FORWARD,
/**
* The navigation was triggered by reloading.
*/
RELOAD,
/**
* The navigation was triggered by resubmitting a form.
*/
FORM_RESUBMITTED,
/**
* The navigation was triggered by some other action.
*/
OTHER,
}
/**
* Enum values used to denote the various network errors.
*/
class NetworkError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* Generic load failure
*/
static FAILED: number;
/**
* Load failure due to transport error
*/
static TRANSPORT: number;
/**
* Load failure due to unknown protocol
*/
static UNKNOWN_PROTOCOL: number;
/**
* Load failure due to cancellation
*/
static CANCELLED: number;
/**
* Load failure due to missing file
*/
static FILE_DOES_NOT_EXIST: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
/**
* Gets the quark for the domain of networking errors.
*/
static quark(): GLib.Quark;
}
/**
* Enum values used to set the network proxy mode.
*/
/**
* Enum values used to set the network proxy mode.
*/
export namespace NetworkProxyMode {
export const $gtype: GObject.GType;
}
enum NetworkProxyMode {
/**
* Use the default proxy of the system.
*/
DEFAULT,
/**
* Do not use any proxy.
*/
NO_PROXY,
/**
* Use custom proxy settings.
*/
CUSTOM,
}
/**
* Enum values representing query permission results.
*/
/**
* Enum values representing query permission results.
*/
export namespace PermissionState {
export const $gtype: GObject.GType;
}
enum PermissionState {
/**
* Access to the feature is granted.
*/
GRANTED,
/**
* Access to the feature is denied.
*/
DENIED,
/**
* Access to the feature has to be requested via user prompt.
*/
PROMPT,
}
/**
* Enum values used to denote the various plugin and media errors.
*/
class PluginError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* Generic plugin load failure. Deprecated 2.32
*/
static FAILED: number;
/**
* Load failure due to missing plugin. Deprecated 2.32
*/
static CANNOT_FIND_PLUGIN: number;
/**
* Load failure due to inability to load plugin. Deprecated 2.32
*/
static CANNOT_LOAD_PLUGIN: number;
/**
* Load failure due to missing Java support that is required to load plugin. Deprecated 2.32
*/
static JAVA_UNAVAILABLE: number;
/**
* Load failure due to connection cancellation. Deprecated 2.32
*/
static CONNECTION_CANCELLED: number;
/**
* Preliminary load failure for media content types. A new load will be started to perform the media load.
*/
static WILL_HANDLE_LOAD: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
/**
* Gets the quark for the domain of plug-in errors.
*/
static quark(): GLib.Quark;
}
/**
* Enum values used for determining the type of a policy decision during
* #WebKitWebView::decide-policy.
*/
/**
* Enum values used for determining the type of a policy decision during
* #WebKitWebView::decide-policy.
*/
export namespace PolicyDecisionType {
export const $gtype: GObject.GType;
}
enum PolicyDecisionType {
/**
* This type of policy decision
* is requested when WebKit is about to navigate to a new page in either the
* main frame or a subframe. Acceptable policy decisions are either
* webkit_policy_decision_use() or webkit_policy_decision_ignore(). This
* type of policy decision is always a #WebKitNavigationPolicyDecision.
*/
NAVIGATION_ACTION,
/**
* This type of policy decision
* is requested when WebKit is about to create a new window. Acceptable policy
* decisions are either webkit_policy_decision_use() or
* webkit_policy_decision_ignore(). This type of policy decision is always
* a #WebKitNavigationPolicyDecision. These decisions are useful for implementing
* special actions for new windows, such as forcing the new window to open
* in a tab when a keyboard modifier is active or handling a special
* target attribute on elements.
*/
NEW_WINDOW_ACTION,
/**
* This type of decision is used when WebKit has
* received a response for a network resource and is about to start the load.
* Note that these resources include all subresources of a page such as images
* and stylesheets as well as main documents. Appropriate policy responses to
* this decision are webkit_policy_decision_use(), webkit_policy_decision_ignore(),
* or webkit_policy_decision_download(). This type of policy decision is always
* a #WebKitResponsePolicyDecision. This decision is useful for forcing
* some types of resources to be downloaded rather than rendered in the WebView
* or to block the transfer of resources entirely.
*/
RESPONSE,
}
/**
* Enum values used to denote the various policy errors.
*/
class PolicyError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* Generic load failure due to policy error
*/
static FAILED: number;
/**
* Load failure due to unsupported mime type
*/
static CANNOT_SHOW_MIME_TYPE: number;
/**
* Load failure due to URI that can not be shown
*/
static CANNOT_SHOW_URI: number;
/**
* Load failure due to frame load interruption by policy change
*/
static FRAME_LOAD_INTERRUPTED_BY_POLICY_CHANGE: number;
/**
* Load failure due to port restriction
*/
static CANNOT_USE_RESTRICTED_PORT: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
/**
* Gets the quark for the domain of policy errors.
*/
static quark(): GLib.Quark;
}
/**
* Enum values used to denote the various print errors.
*/
class PrintError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* Unspecified error during a print operation
*/
static GENERAL: number;
/**
* Selected printer cannot be found
*/
static PRINTER_NOT_FOUND: number;
/**
* Invalid page range
*/
static INVALID_PAGE_RANGE: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
/**
* Gets the quark for the domain of printing errors.
*/
static quark(): GLib.Quark;
}
/**
* Enum values representing the response of the print dialog shown with
* webkit_print_operation_run_dialog().
*/
/**
* Enum values representing the response of the print dialog shown with
* webkit_print_operation_run_dialog().
*/
export namespace PrintOperationResponse {
export const $gtype: GObject.GType;
}
enum PrintOperationResponse {
/**
* Print button was clicked in print dialog
*/
PRINT,
/**
* Print dialog was cancelled
*/
CANCEL,
}
/**
* Enum values used for determining the #WebKitWebContext process model.
*/
/**
* Enum values used for determining the #WebKitWebContext process model.
*/
export namespace ProcessModel {
export const $gtype: GObject.GType;
}
enum ProcessModel {
/**
* Deprecated 2.26.
*/
SHARED_SECONDARY_PROCESS,
/**
* Use one process
* for each #WebKitWebView, while still allowing for some of them to
* share a process in certain situations. The main advantage
* of this process model is that the rendering process for a web view
* can crash while the rest of the views keep working normally. This
* process model is indicated for applications which may use a number
* of web views and the content of in each must not interfere with the
* rest — for example a full-fledged web browser with support for
* multiple tabs.
*/
MULTIPLE_SECONDARY_PROCESSES,
}
/**
* Enum values to specify the different ways in which a #WebKitWebView
* can save its current web page into a self-contained file.
*/
/**
* Enum values to specify the different ways in which a #WebKitWebView
* can save its current web page into a self-contained file.
*/
export namespace SaveMode {
export const $gtype: GObject.GType;
}
enum SaveMode {
/**
* Save the current page using the MHTML format.
*/
MHTML,
}
/**
* Enum values used for determining the type of #WebKitScriptDialog
*/
/**
* Enum values used for determining the type of #WebKitScriptDialog
*/
export namespace ScriptDialogType {
export const $gtype: GObject.GType;
}
enum ScriptDialogType {
/**
* Alert script dialog, used to show a
* message to the user.
*/
ALERT,
/**
* Confirm script dialog, used to ask
* confirmation to the user.
*/
CONFIRM,
/**
* Prompt script dialog, used to ask
* information to the user.
*/
PROMPT,
/**
* Before unload confirm dialog,
* used to ask confirmation to leave the current page to the user. Since 2.12
*/
BEFORE_UNLOAD_CONFIRM,
}
/**
* Enum values used to denote errors happening when creating snapshots of #WebKitWebView
*/
class SnapshotError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* An error occurred when creating a webpage snapshot.
*/
static CREATE: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
/**
* Gets the quark for the domain of page snapshot errors.
*/
static quark(): GLib.Quark;
}
/**
* Enum values used to specify the region from which to get a #WebKitWebView
* snapshot
*/
/**
* Enum values used to specify the region from which to get a #WebKitWebView
* snapshot
*/
export namespace SnapshotRegion {
export const $gtype: GObject.GType;
}
enum SnapshotRegion {
/**
* Specifies a snapshot only for the area that is
* visible in the webview
*/
VISIBLE,
/**
* A snapshot of the entire document.
*/
FULL_DOCUMENT,
}
/**
* Enum values used to denote the TLS errors policy.
*/
/**
* Enum values used to denote the TLS errors policy.
*/
export namespace TLSErrorsPolicy {
export const $gtype: GObject.GType;
}
enum TLSErrorsPolicy {
/**
* Ignore TLS errors.
*/
IGNORE,
/**
* TLS errors will emit
* #WebKitWebView::load-failed-with-tls-errors and, if the signal is handled,
* finish the load. In case the signal is not handled,
* #WebKitWebView::load-failed is emitted before the load finishes.
*/
FAIL,
}
/**
* Errors that can occur while compiling content filters.
*/
class UserContentFilterError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* The JSON source for a content filter is invalid.
*/
static INVALID_SOURCE: number;
/**
* The requested content filter could not be found.
*/
static NOT_FOUND: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
/**
* Gets the quark for the domain of user content filter errors.
*/
static quark(): GLib.Quark;
}
/**
* Specifies in which frames user style sheets are to be inserted in.
*/
/**
* Specifies in which frames user style sheets are to be inserted in.
*/
export namespace UserContentInjectedFrames {
export const $gtype: GObject.GType;
}
enum UserContentInjectedFrames {
/**
* Insert the user style
* sheet in all the frames loaded by the web view, including
* nested frames. This is the default.
*/
ALL_FRAMES,
/**
* Insert the user style
* sheet *only* in the top-level frame loaded by the web view,
* and *not* in the nested frames.
*/
TOP_FRAME,
}
/**
* Enum values used to denote errors happening when sending user messages.
*/
class UserMessageError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* The message was not handled by the receiver.
*/
static MESSAGE: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
/**
* Gets the quark for the domain of user message errors.
*/
static quark(): GLib.Quark;
}
/**
* Specifies at which place of documents an user script will be inserted.
*/
/**
* Specifies at which place of documents an user script will be inserted.
*/
export namespace UserScriptInjectionTime {
export const $gtype: GObject.GType;
}
enum UserScriptInjectionTime {
/**
* Insert the code of the user
* script at the beginning of loaded documents. This is the default.
*/
START,
/**
* Insert the code of the user
* script at the end of the loaded documents.
*/
END,
}
/**
* Specifies how to treat an user style sheet.
*/
/**
* Specifies how to treat an user style sheet.
*/
export namespace UserStyleLevel {
export const $gtype: GObject.GType;
}
enum UserStyleLevel {
/**
* The style sheet is an user style sheet,
* its contents always override other style sheets. This is the default.
*/
USER,
/**
* The style sheet will be treated as if
* it was provided by the loaded documents. That means other user style
* sheets may still override it.
*/
AUTHOR,
}
/**
* Enum values used to denote errors happening when creating a #WebKitWebExtensionMatchPattern
*/
class WebExtensionMatchPatternError extends GLib.Error {
static $gtype: GObject.GType;
// Static fields
/**
* An unknown error occured.
*/
static UNKNOWN: number;
/**
* The scheme component was invalid.
*/
static INVALID_SCHEME: number;
/**
* The host component was invalid.
*/
static INVALID_HOST: number;
/**
* The path component was invalid.
*/
static INVALID_PATH: number;
// Constructors
constructor(options: { message: string; code: number });
_init(...args: any[]): void;
// Static methods
/**
* Gets the quark for the domain of Web Extension Match Pattern errors.
*/
static quark(): GLib.Quark;
}
/**
* Enum values used for setting if a #WebKitWebView is intended for
* WebExtensions.
*/
/**
* Enum values used for setting if a #WebKitWebView is intended for
* WebExtensions.
*/
export namespace WebExtensionMode {
export const $gtype: GObject.GType;
}
enum WebExtensionMode {
/**
* Not for an extension.
*/
NONE,
/**
* For a ManifestV2 extension.
*/
MANIFESTV2,
/**
* For a ManifestV3 extension.
*/
MANIFESTV3,
}
/**
* Enum values used to specify the reason why the web process terminated abnormally.
*/
/**
* Enum values used to specify the reason why the web process terminated abnormally.
*/
export namespace WebProcessTerminationReason {
export const $gtype: GObject.GType;
}
enum WebProcessTerminationReason {
/**
* the web process crashed.
*/
CRASHED,
/**
* the web process exceeded the memory limit.
*/
EXCEEDED_MEMORY_LIMIT,
/**
* the web process termination was requested by an API call. Since: 2.34
*/
TERMINATED_BY_API,
}
/**
* The copy clipboard command. Copies the current selection inside
* a #WebKitWebView to the clipboard.
* You can check whether it's possible to execute the command with
* webkit_web_view_can_execute_editing_command(). In general it's
* possible to copy to the clipboard when there is an active selection
* inside the #WebKitWebView.
*/
const EDITING_COMMAND_COPY: string;
/**
* The create link command. Creates a link element that is inserted at
* the current cursor position. If there's a selection, the selected text
* will be used as the link text, otherwise the URL itself will be used.
* It receives the link URL as argument. This command should be executed
* with webkit_web_view_execute_editing_command_with_argument()
*/
const EDITING_COMMAND_CREATE_LINK: string;
/**
* The cut clipboard command. Copies the current selection inside
* a #WebKitWebView to the clipboard and deletes the selected content.
* You can check whether it's possible to execute the command with
* webkit_web_view_can_execute_editing_command(). In general it's
* possible to cut to the clipboard when the #WebKitWebView content is
* editable and there is an active selection.
*/
const EDITING_COMMAND_CUT: string;
/**
* The insert image command. Creates an image element that is inserted at
* the current cursor position. It receives an URI as argument,
* that is used as the image source. This command should be executed with
* webkit_web_view_execute_editing_command_with_argument().
*/
const EDITING_COMMAND_INSERT_IMAGE: string;
/**
* The paste clipboard command. Pastes the contents of the clipboard to
* a #WebKitWebView.
* You can check whether it's possible to execute the command with
* webkit_web_view_can_execute_editing_command(). In general it's possible
* to paste from the clipboard when the #WebKitWebView content is editable
* and clipboard is not empty.
*/
const EDITING_COMMAND_PASTE: string;
/**
* The paste as plaintext clipboard command. Pastes the contents of the
* clipboard to a #WebKitWebView, with formatting removed.
* You can check whether it's possible to execute the command with
* webkit_web_view_can_execute_editing_command(). In general it's possible
* to paste from the clipboard when the #WebKitWebView content is editable
* and clipboard is not empty.
*/
const EDITING_COMMAND_PASTE_AS_PLAIN_TEXT: string;
/**
* The redo command. Redoes a previously undone editing command in
* a #WebKitWebView.
* You can check whether it's possible to execute the command with
* webkit_web_view_can_execute_editing_command(). It's only possible
* to redo a command when it has been previously undone.
*/
const EDITING_COMMAND_REDO: string;
/**
* The select all command. Selects all the content of the current text field in
* a #WebKitWebView.
* It is always possible to select all text, no matter whether the
* #WebKitWebView content is editable or not. You can still check it
* with webkit_web_view_can_execute_editing_command().
*/
const EDITING_COMMAND_SELECT_ALL: string;
/**
* The undo command. Undoes the last editing command in a #WebKitWebView.
* You can check whether it's possible to execute the command with
* webkit_web_view_can_execute_editing_command(). It's only possible
* to undo a command after a previously executed editing operation.
*/
const EDITING_COMMAND_UNDO: string;
/**
* Like webkit_get_major_version(), but from the headers used at
* application compile time, rather than from the library linked
* against at application run time.
*/
const MAJOR_VERSION: number;
/**
* Like webkit_get_micro_version(), but from the headers used at
* application compile time, rather than from the library linked
* against at application run time.
*/
const MICRO_VERSION: number;
/**
* Like webkit_get_minor_version(), but from the headers used at
* application compile time, rather than from the library linked
* against at application run time.
*/
const MINOR_VERSION: number;
/**
* Gets the quark for the domain of download errors.
* @returns download error domain.
*/
function download_error_quark(): GLib.Quark;
/**
* Gets the quark for the domain of favicon database errors.
* @returns favicon database error domain.
*/
function favicon_database_error_quark(): GLib.Quark;
/**
* Returns the major version number of the WebKit library.
*
* (e.g. in WebKit version 1.8.3 this is 1.)
*
* This function is in the library, so it represents the WebKit library
* your code is running against. Contrast with the #WEBKIT_MAJOR_VERSION
* macro, which represents the major version of the WebKit headers you
* have included when compiling your code.
* @returns the major version number of the WebKit library
*/
function get_major_version(): number;
/**
* Returns the micro version number of the WebKit library.
*
* (e.g. in WebKit version 1.8.3 this is 3.)
*
* This function is in the library, so it represents the WebKit library
* your code is running against. Contrast with the #WEBKIT_MICRO_VERSION
* macro, which represents the micro version of the WebKit headers you
* have included when compiling your code.
* @returns the micro version number of the WebKit library
*/
function get_micro_version(): number;
/**
* Returns the minor version number of the WebKit library.
*
* (e.g. in WebKit version 1.8.3 this is 8.)
*
* This function is in the library, so it represents the WebKit library
* your code is running against. Contrast with the #WEBKIT_MINOR_VERSION
* macro, which represents the minor version of the WebKit headers you
* have included when compiling your code.
* @returns the minor version number of the WebKit library
*/
function get_minor_version(): number;
/**
* Gets the quark for the domain of JavaScript errors.
* @returns JavaScript error domain.
*/
function javascript_error_quark(): GLib.Quark;
/**
* Get the key system for which access permission is being requested.
* @param request a #WebKitMediaKeySystemPermissionRequest
* @returns the key system name for @request
*/
function media_key_system_permission_get_name(request: MediaKeySystemPermissionRequest): string;
/**
* Gets the quark for the domain of networking errors.
* @returns network error domain.
*/
function network_error_quark(): GLib.Quark;
/**
* Gets the quark for the domain of plug-in errors.
* @returns plug-in error domain.
*/
function plugin_error_quark(): GLib.Quark;
/**
* Gets the quark for the domain of policy errors.
* @returns policy error domain.
*/
function policy_error_quark(): GLib.Quark;
/**
* Gets the quark for the domain of printing errors.
* @returns print error domain.
*/
function print_error_quark(): GLib.Quark;
/**
* Gets the quark for the domain of page snapshot errors.
* @returns snapshot error domain.
*/
function snapshot_error_quark(): GLib.Quark;
/**
* Use this function to format a URI for display.
*
* The URIs used internally by
* WebKit may contain percent-encoded characters or Punycode, which are not
* generally suitable to display to users. This function provides protection
* against IDN homograph attacks, so in some cases the host part of the returned
* URI may be in Punycode if the safety check fails.
* @param uri the URI to be converted
* @returns @uri suitable for display, or %NULL in case of error.
*/
function uri_for_display(uri: string): string | null;
/**
* Gets the quark for the domain of user content filter errors.
* @returns user content filter error domain.
*/
function user_content_filter_error_quark(): GLib.Quark;
/**
* Check whether the permission request is for an audio device.
* @param request a #WebKitUserMediaPermissionRequest
* @returns %TRUE if access to an audio device was requested.
*/
function user_media_permission_is_for_audio_device(request: UserMediaPermissionRequest): boolean;
/**
* Check whether the permission request is for a display device.
* @param request a #WebKitUserMediaPermissionRequest
* @returns %TRUE if access to a display device was requested.
*/
function user_media_permission_is_for_display_device(request: UserMediaPermissionRequest): boolean;
/**
* Check whether the permission request is for a video device.
* @param request a #WebKitUserMediaPermissionRequest
* @returns %TRUE if access to a video device was requested.
*/
function user_media_permission_is_for_video_device(request: UserMediaPermissionRequest): boolean;
/**
* Gets the quark for the domain of user message errors.
* @returns user message error domain.
*/
function user_message_error_quark(): GLib.Quark;
/**
* Gets the quark for the domain of Web Extension Match Pattern errors.
* @returns web extension match pattern error domain.
*/
function web_extension_match_pattern_error_quark(): GLib.Quark;
/**
* Registers a custom URL scheme that can be used in match patterns.
*
* This method should be used to register any custom URL schemes used by the app for the extension base URLs,
* other than `webkit-extension`, or if extensions should have access to other supported URL schemes when using ``.
* @param urlScheme The custom URL scheme to register
*/
function web_extension_match_pattern_register_custom_URL_scheme(urlScheme: string): void;
interface URISchemeRequestCallback {
(request: URISchemeRequest): void;
}
/**
* Enum values with flags representing typing attributes.
*/
/**
* Enum values with flags representing typing attributes.
*/
export namespace EditorTypingAttributes {
export const $gtype: GObject.GType;
}
enum EditorTypingAttributes {
/**
* No typing attributes.
*/
NONE,
/**
* Bold typing attribute.
*/
BOLD,
/**
* Italic typing attribute.
*/
ITALIC,
/**
* Underline typing attribute.
*/
UNDERLINE,
/**
* Strikethrough typing attribute.
*/
STRIKETHROUGH,
}
/**
* Enum values used to specify search options.
*/
/**
* Enum values used to specify search options.
*/
export namespace FindOptions {
export const $gtype: GObject.GType;
}
enum FindOptions {
/**
* no search flags, this means a case
* sensitive, no wrap, forward only search.
*/
NONE,
/**
* case insensitive search.
*/
CASE_INSENSITIVE,
/**
* search text only at the
* begining of the words.
*/
AT_WORD_STARTS,
/**
* treat
* capital letters in the middle of words as word start.
*/
TREAT_MEDIAL_CAPITAL_AS_WORD_START,
/**
* search backwards.
*/
BACKWARDS,
/**
* if not present search will stop
* at the end of the document.
*/
WRAP_AROUND,
}
/**
* Enum values with flags representing the context of a #WebKitHitTestResult.
*/
/**
* Enum values with flags representing the context of a #WebKitHitTestResult.
*/
export namespace HitTestResultContext {
export const $gtype: GObject.GType;
}
enum HitTestResultContext {
/**
* anywhere in the document.
*/
DOCUMENT,
/**
* a hyperlink element.
*/
LINK,
/**
* an image element.
*/
IMAGE,
/**
* a video or audio element.
*/
MEDIA,
/**
* an editable element
*/
EDITABLE,
/**
* a scrollbar element.
*/
SCROLLBAR,
/**
* a selected element. Since 2.8
*/
SELECTION,
}
/**
* Enum values used to describe hints that might be taken into account by input methods.
*/
/**
* Enum values used to describe hints that might be taken into account by input methods.
*/
export namespace InputHints {
export const $gtype: GObject.GType;
}
enum InputHints {
/**
* No special behavior suggested
*/
NONE,
/**
* Suggest spell checking
*/
SPELLCHECK,
/**
* Suggest to not autocapitlize
*/
LOWERCASE,
/**
* Suggest to capitalize all text
*/
UPPERCASE_CHARS,
/**
* Suggest to capitalize the first character of each word
*/
UPPERCASE_WORDS,
/**
* Suggest to capitalize the first word of each sentence
*/
UPPERCASE_SENTENCES,
/**
* Suggest to not show an onscreen keyboard
*/
INHIBIT_OSK,
}
/**
* Enum values used to specify options when taking a snapshot
* from a #WebKitWebView.
*/
/**
* Enum values used to specify options when taking a snapshot
* from a #WebKitWebView.
*/
export namespace SnapshotOptions {
export const $gtype: GObject.GType;
}
enum SnapshotOptions {
/**
* Do not include any special options.
*/
NONE,
/**
* Whether to include in the
* snapshot the highlight of the selected content.
*/
INCLUDE_SELECTION_HIGHLIGHTING,
/**
* Do not fill the background with white before
* rendering the snapshot. Since 2.8
*/
TRANSPARENT_BACKGROUND,
}
/**
* Enum values representing matching options.
*/
/**
* Enum values representing matching options.
*/
export namespace WebExtensionMatchPatternOptions {
export const $gtype: GObject.GType;
}
enum WebExtensionMatchPatternOptions {
/**
* No special matching options.
*/
NONE,
/**
* The scheme components should be ignored while matching.
*/
IGNORE_SCHEMES,
/**
* The host components should be ignored while matching.
*/
IGNORE_PATHS,
/**
* Two patterns should be checked in either direction while matching (A matches B, or B matches A). Invalid for matching URLs.
*/
MATCH_BIDIRECTIONALLY,
}
/**
* Enum values with flags representing types of Website data.
*/
/**
* Enum values with flags representing types of Website data.
*/
export namespace WebsiteDataTypes {
export const $gtype: GObject.GType;
}
enum WebsiteDataTypes {
/**
* Memory cache.
*/
MEMORY_CACHE,
/**
* HTTP disk cache.
*/
DISK_CACHE,
/**
* Offline web application cache.
*/
OFFLINE_APPLICATION_CACHE,
/**
* Session storage data.
*/
SESSION_STORAGE,
/**
* Local storage data.
*/
LOCAL_STORAGE,
/**
* WebSQL databases. Deprecated 2.24
*/
WEBSQL_DATABASES,
/**
* IndexedDB databases.
*/
INDEXEDDB_DATABASES,
/**
* Plugins data. Deprecated 2.32
*/
PLUGIN_DATA,
/**
* Cookies.
*/
COOKIES,
/**
* Hash salt used to generate the device ids used by webpages. Since 2.24
*/
DEVICE_ID_HASH_SALT,
/**
* HSTS cache. Since 2.26
*/
HSTS_CACHE,
/**
* Intelligent Tracking Prevention data. Since 2.30.
*/
ITP,
/**
* Service worker registrations. Since 2.30
*/
SERVICE_WORKER_REGISTRATIONS,
/**
* DOM (CacheStorage) cache. Since 2.30
*/
DOM_CACHE,
/**
* All types.
*/
ALL,
}
namespace AuthenticationRequest {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {
authenticated: (arg0: Credential) => void;
cancelled: () => void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* Represents an authentication request.
*
* Whenever a client attempts to load a page protected by HTTP
* authentication, credentials will need to be provided to authorize access.
* To allow the client to decide how it wishes to handle authentication,
* WebKit will fire a #WebKitWebView::authenticate signal with a
* WebKitAuthenticationRequest object to provide client side
* authentication support. Credentials are exposed through the
* #WebKitCredential object.
*
* In case the client application does not wish
* to handle this signal WebKit will provide a default handler. To handle
* authentication asynchronously, simply increase the reference count of the
* WebKitAuthenticationRequest object.
*/
class AuthenticationRequest extends GObject.Object {
static $gtype: GObject.GType;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: AuthenticationRequest.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(
signal: K,
callback: GObject.SignalCallback,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
connect_after(
signal: K,
callback: GObject.SignalCallback,
): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
emit(
signal: K,
...args: GObject.GjsParameters extends [any, ...infer Q]
? Q
: never
): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Authenticate the #WebKitAuthenticationRequest.
*
* Authenticate the #WebKitAuthenticationRequest using the #WebKitCredential
* supplied. To continue without credentials, pass %NULL as `credential`.
* @param credential A #WebKitCredential, or %NULL
*/
authenticate(credential?: Credential | null): void;
/**
* Determine whether this #WebKitAuthenticationRequest should allow the storage of credentials.
*
* Determine whether the authentication method associated with this
* #WebKitAuthenticationRequest should allow the storage of credentials.
* This will return %FALSE if WebKit doesn't support credential storing,
* if private browsing is enabled, or if persistent credential storage has been
* disabled in #WebKitWebsiteDataManager, unless credentials saving has been
* explicitly enabled with webkit_authentication_request_set_can_save_credentials().
* @returns %TRUE if WebKit can store credentials or %FALSE otherwise.
*/
can_save_credentials(): boolean;
/**
* Cancel the authentication challenge.
*
* This will also cancel the page loading and result in a
* #WebKitWebView::load-failed signal with a #WebKitNetworkError of type %WEBKIT_NETWORK_ERROR_CANCELLED being emitted.
*/
cancel(): void;
/**
* Get the #GTlsPasswordFlags of the %WEBKIT_AUTHENTICATION_SCHEME_CLIENT_CERTIFICATE_PIN_REQUESTED authentication challenge.
* @returns a #GTlsPasswordFlags
*/
get_certificate_pin_flags(): Gio.TlsPasswordFlags;
/**
* Get the host that this authentication challenge is applicable to.
* @returns The host of @request.
*/
get_host(): string;
/**
* Get the port that this authentication challenge is applicable to.
* @returns The port of @request.
*/
get_port(): number;
/**
* Get the #WebKitCredential of the proposed authentication challenge.
*
* Get the #WebKitCredential of the proposed authentication challenge that was
* stored from a previous session. The client can use this directly for
* authentication or construct their own #WebKitCredential.
* @returns A #WebKitCredential encapsulating credential details or %NULL if there is no stored credential.
*/
get_proposed_credential(): Credential;
/**
* Get the realm that this authentication challenge is applicable to.
* @returns The realm of @request.
*/
get_realm(): string;
/**
* Get the authentication scheme of the authentication challenge.
* @returns The #WebKitAuthenticationScheme of @request.
*/
get_scheme(): AuthenticationScheme;
/**
* Get the #WebKitSecurityOrigin that this authentication challenge is applicable to.
* @returns a newly created #WebKitSecurityOrigin.
*/
get_security_origin(): SecurityOrigin;
/**
* Determine whether the authentication challenge is associated with a proxy server.
*
* Determine whether the authentication challenge is associated with a proxy server rather than an "origin" server.
* @returns %TRUE if authentication is for a proxy or %FALSE otherwise.
*/
is_for_proxy(): boolean;
/**
* Determine whether this this is a first attempt or a retry for this authentication challenge.
* @returns %TRUE if authentication attempt is a retry or %FALSE otherwise.
*/
is_retry(): boolean;
/**
* Set whether the authentication method associated with `request`
* should allow the storage of credentials.
*
* Set whether the authentication method associated with `request`
* should allow the storage of credentials.
* This should be used by applications handling their own credentials
* storage to indicate that it should be supported even when internal
* credential storage is disabled or unsupported.
* Note that storing of credentials will not be allowed on ephemeral
* sessions in any case.
* @param enabled value to set
*/
set_can_save_credentials(enabled: boolean): void;
/**
* Set the #WebKitCredential of the proposed authentication challenge.
*
* Set the #WebKitCredential of the proposed authentication challenge that was
* stored from a previous session. This should only be used by applications handling
* their own credential storage. (When using the default WebKit credential storage,
* webkit_authentication_request_get_proposed_credential() already contains previously-stored
* credentials.)
* Passing a %NULL `credential` will clear the proposed credential.
* @param credential a #WebKitCredential, or %NULL
*/
set_proposed_credential(credential: Credential): void;
}
namespace AutomationSession {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {
'create-web-view': () => WebView;
'will-close': () => void;
'notify::id': (pspec: GObject.ParamSpec) => void;
'create-web-view::id': () => WebView;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
id: string;
}
}
/**
* Automation Session.
*
* WebKitAutomationSession represents an automation session of a WebKitWebContext.
* When a new session is requested, a WebKitAutomationSession is created and the signal
* WebKitWebContext::automation-started is emitted with the WebKitAutomationSession as
* argument. Then, the automation client can request the session to create a new
* #WebKitWebView to interact with it. When this happens the signal #WebKitAutomationSession::create-web-view
* is emitted.
*/
class AutomationSession extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* The session unique identifier.
*/
get id(): string;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: AutomationSession.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(
signal: K,
callback: GObject.SignalCallback,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
connect_after(
signal: K,
callback: GObject.SignalCallback,
): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
emit(
signal: K,
...args: GObject.GjsParameters extends [any, ...infer Q]
? Q
: never
): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Get the the previously set #WebKitAutomationSession.
*
* Get the #WebKitAutomationSession previously set with webkit_automation_session_set_application_info().
* @returns the #WebKitAutomationSession of @session, or %NULL if no one has been set.
*/
get_application_info(): ApplicationInfo;
/**
* Get the unique identifier of a #WebKitAutomationSession
* @returns the unique identifier of @session
*/
get_id(): string;
/**
* Set the application information to `session`.
*
* This information will be used by the driver service
* to match the requested capabilities with the actual application information. If this information
* is not provided to the session when a new automation session is requested, the creation might fail
* if the client requested a specific browser name or version. This will not have any effect when called
* after the automation session has been fully created, so this must be called in the callback of
* #WebKitWebContext::automation-started signal.
* @param info a #WebKitApplicationInfo
*/
set_application_info(info: ApplicationInfo): void;
}
namespace BackForwardList {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {
changed: (arg0: BackForwardListItem | null, arg1: any | null) => void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* List of visited pages.
*
* WebKitBackForwardList maintains a list of visited pages used to
* navigate to recent pages. Items are inserted in the list in the
* order they are visited.
*
* WebKitBackForwardList also maintains the notion of the current item
* (which is always at index 0), the preceding item (which is at index -1),
* and the following item (which is at index 1).
* Methods webkit_web_view_go_back() and webkit_web_view_go_forward() move
* the current item backward or forward by one. Method
* webkit_web_view_go_to_back_forward_list_item() sets the current item to the
* specified item. All other methods returning #WebKitBackForwardListItems
* do not change the value of the current item, they just return the requested
* item or items.
*/
class BackForwardList extends GObject.Object {
static $gtype: GObject.GType;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: BackForwardList.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(
signal: K,
callback: GObject.SignalCallback,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
connect_after(
signal: K,
callback: GObject.SignalCallback,
): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
emit(
signal: K,
...args: GObject.GjsParameters extends [any, ...infer Q]
? Q
: never
): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Returns the item that precedes the current item.
* @returns the #WebKitBackForwardListItem preceding the current item or %NULL.
*/
get_back_item(): BackForwardListItem | null;
/**
* Obtain the list of items preceding the current one.
* @returns a #GList of items preceding the current item.
*/
get_back_list(): BackForwardListItem[];
/**
* Obtain a list up to some number of items preceding the current one.
* @param limit the number of items to retrieve
* @returns a #GList of items preceding the current item limited by @limit.
*/
get_back_list_with_limit(limit: number): BackForwardListItem[];
/**
* Returns the current item in `back_forward_list`.
* @returns a #WebKitBackForwardListItem or %NULL if @back_forward_list is empty.
*/
get_current_item(): BackForwardListItem | null;
/**
* Returns the item that follows the current item.
* @returns the #WebKitBackForwardListItem following the current item or %NULL.
*/
get_forward_item(): BackForwardListItem | null;
/**
* Obtain the list of items following the current one.
* @returns a #GList of items following the current item.
*/
get_forward_list(): BackForwardListItem[];
/**
* Obtain a list up to some number of items following the current one.
* @param limit the number of items to retrieve
* @returns a #GList of items following the current item limited by @limit.
*/
get_forward_list_with_limit(limit: number): BackForwardListItem[];
/**
* Obtain the amount of items in the list.
* @returns the length of @back_forward_list.
*/
get_length(): number;
/**
* Returns the item at a given index relative to the current item.
* @param index the index of the item
* @returns the #WebKitBackForwardListItem located at the specified index relative to the current item or %NULL.
*/
get_nth_item(index: number): BackForwardListItem | null;
}
namespace BackForwardListItem {
// Signal signatures
interface SignalSignatures extends GObject.InitiallyUnowned.SignalSignatures {}
// Constructor properties interface
interface ConstructorProps extends GObject.InitiallyUnowned.ConstructorProps {}
}
/**
* One item of the #WebKitBackForwardList.
*
* A history item is part of the #WebKitBackForwardList and consists
* out of a title and a URI.
*/
class BackForwardListItem extends GObject.InitiallyUnowned {
static $gtype: GObject.GType;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: BackForwardListItem.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(
signal: K,
callback: GObject.SignalCallback,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
connect_after(
signal: K,
callback: GObject.SignalCallback,
): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
emit(
signal: K,
...args: GObject.GjsParameters extends [any, ...infer Q]
? Q
: never
): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Obtain the original URI of the item.
*
* See also webkit_back_forward_list_item_get_uri().
* @returns the original URI of @list_item or %NULL when the original URI is empty.
*/
get_original_uri(): string;
/**
* Obtain the title of the item.
* @returns the page title of @list_item or %NULL when the title is empty.
*/
get_title(): string;
/**
* Obtain the URI of the item.
*
* This URI may differ from the original URI if the page was,
* for example, redirected to a new location.
* See also webkit_back_forward_list_item_get_original_uri().
* @returns the URI of @list_item or %NULL when the URI is empty.
*/
get_uri(): string;
}
namespace ClipboardPermissionRequest {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, PermissionRequest.ConstructorProps {}
}
/**
* A permission request for reading clipboard contents.
*
* WebKitClipboardPermissionRequest represents a request for
* permission to decide whether WebKit can access the clipboard to read
* its contents through the Async Clipboard API.
*
* When a WebKitClipboardPermissionRequest is not handled by the user,
* it is denied by default.
*/
class ClipboardPermissionRequest extends GObject.Object implements PermissionRequest {
static $gtype: GObject.GType;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: ClipboardPermissionRequest.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(
signal: K,
callback: GObject.SignalCallback,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
connect_after(
signal: K,
callback: GObject.SignalCallback,
): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
emit(
signal: K,
...args: GObject.GjsParameters extends [any, ...infer Q]
? Q
: never
): void;
emit(signal: string, ...args: any[]): void;
// Inherited methods
/**
* Allow the action which triggered this request.
*/
allow(): void;
/**
* Deny the action which triggered this request.
*/
deny(): void;
/**
* Allow the action which triggered this request.
*/
vfunc_allow(): void;
/**
* Deny the action which triggered this request.
*/
vfunc_deny(): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace ColorChooserRequest {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {
finished: () => void;
'notify::rgba': (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
rgba: Gdk.RGBA;
}
}
/**
* A request to open a color chooser.
*
* Whenever the user interacts with an
* HTML element, WebKit will need to show a dialog to choose a color. For that
* to happen in a general way, instead of just opening a #GtkColorChooser
* (which might be not desirable in some cases, which could prefer to use their
* own color chooser dialog), WebKit will fire the
* #WebKitWebView::run-color-chooser signal with a #WebKitColorChooserRequest
* object, which will allow the client application to specify the color to be
* selected, to inspect the details of the request (e.g. to get initial color)
* and to cancel the request, in case nothing was selected.
*
* In case the client application does not wish to handle this signal,
* WebKit will provide a default handler which will asynchronously run
* a regular #GtkColorChooserDialog for the user to interact with.
*/
class ColorChooserRequest extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* The #GdkRGBA color of the request
*/
get rgba(): Gdk.RGBA;
set rgba(val: Gdk.RGBA);
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: ColorChooserRequest.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(
signal: K,
callback: GObject.SignalCallback,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
connect_after(
signal: K,
callback: GObject.SignalCallback,
): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
emit(
signal: K,
...args: GObject.GjsParameters extends [any, ...infer Q]
? Q
: never
): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Cancels `request` and the input element changes to use the initial color.
*
* Cancels `request` and the input element changes to use the initial color
* it has before the request started.
* The signal #WebKitColorChooserRequest::finished
* is emitted to notify that the request has finished.
*/
cancel(): void;
/**
* Finishes `request` and the input element keeps the current value of
* #WebKitColorChooserRequest:rgba.
*
* Finishes `request` and the input element keeps the current value of
* #WebKitColorChooserRequest:rgba.
* The signal #WebKitColorChooserRequest::finished
* is emitted to notify that the request has finished.
*/
finish(): void;
/**
* Gets the bounding box of the color input element.
*/
get_element_rectangle(): Gdk.Rectangle;
/**
* Gets the current #GdkRGBA color of `request`
*/
get_rgba(): Gdk.RGBA;
/**
* Sets the current #GdkRGBA color of `request`
* @param rgba a pointer #GdkRGBA
*/
set_rgba(rgba: Gdk.RGBA): void;
}
namespace ContextMenu {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* Represents the context menu in a #WebKitWebView.
*
* #WebKitContextMenu represents a context menu containing
* #WebKitContextMenuItems in a #WebKitWebView.
*
* When a #WebKitWebView is about to display the context menu, it
* emits the #WebKitWebView::context-menu signal, which has the
* #WebKitContextMenu as an argument. You can modify it, adding new
* submenus that you can create with webkit_context_menu_new(), adding
* new #WebKitContextMenuItems with
* webkit_context_menu_prepend(), webkit_context_menu_append() or
* webkit_context_menu_insert(), maybe after having removed the
* existing ones with webkit_context_menu_remove_all().
*/
class ContextMenu extends GObject.Object {
static $gtype: GObject.GType;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: ContextMenu.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](): ContextMenu;
static new_with_items(items: ContextMenuItem[]): ContextMenu;
// Signals
connect(
signal: K,
callback: GObject.SignalCallback,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
connect_after(
signal: K,
callback: GObject.SignalCallback,
): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
emit(
signal: K,
...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never
): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Adds `item` at the end of the `menu`.
* @param item the #WebKitContextMenuItem to add
*/
append(item: ContextMenuItem): void;
/**
* Gets the first item in the `menu`.
* @returns the first #WebKitContextMenuItem of @menu, or %NULL if the #WebKitContextMenu is empty.
*/
first(): ContextMenuItem;
/**
* Gets the #GdkEvent that triggered the context menu. This function only returns a valid
* #GdkEvent when called for a #WebKitContextMenu passed to #WebKitWebView::context-menu
* signal; in all other cases, %NULL is returned.
*
* The returned #GdkEvent is expected to be one of the following types:
*
*
* a #GdkEventButton of type %GDK_BUTTON_PRESS when the context menu was triggered with mouse.
*
*
* a #GdkEventKey of type %GDK_KEY_PRESS if the keyboard was used to show the menu.
*
*
* a generic #GdkEvent of type %GDK_NOTHING when the #GtkWidget::popup-menu signal was used to show the context menu.
*
*
* @returns the menu event or %NULL.
*/
get_event(): Gdk.Event;
/**
* Gets the item at the given position in the `menu`.
* @param position the position of the item, counting from 0
* @returns the #WebKitContextMenuItem at position @position in @menu, or %NULL if the position is off the end of the @menu.
*/
get_item_at_position(position: number): ContextMenuItem;
/**
* Returns the item list of `menu`.
* @returns a #GList of #WebKitContextMenuItems
*/
get_items(): ContextMenuItem[];
/**
* Gets the length of the `menu`.
* @returns the number of #WebKitContextMenuItems in @menu
*/
get_n_items(): number;
/**
* Gets the user data of `menu`.
*
* This function can be used from the UI Process to get user data previously set
* from the Web Process with webkit_context_menu_set_user_data().
* @returns the user data of @menu, or %NULL if @menu doesn't have user data
*/
get_user_data(): GLib.Variant;
/**
* Inserts `item` into the `menu` at the given position.
*
* If `position` is negative, or is larger than the number of items
* in the #WebKitContextMenu, the item is added on to the end of
* the `menu`. The first position is 0.
* @param item the #WebKitContextMenuItem to add
* @param position the position to insert the item
*/
insert(item: ContextMenuItem, position: number): void;
/**
* Gets the last item in the `menu`.
* @returns the last #WebKitContextMenuItem of @menu, or %NULL if the #WebKitContextMenu is empty.
*/
last(): ContextMenuItem;
/**
* Moves `item` to the given position in the `menu`.
*
* If `position` is negative, or is larger than the number of items
* in the #WebKitContextMenu, the item is added on to the end of
* the `menu`.
* The first position is 0.
* @param item the #WebKitContextMenuItem to add
* @param position the new position to move the item
*/
move_item(item: ContextMenuItem, position: number): void;
/**
* Adds `item` at the beginning of the `menu`.
* @param item the #WebKitContextMenuItem to add
*/
prepend(item: ContextMenuItem): void;
/**
* Removes `item` from the `menu`.
*
* See also webkit_context_menu_remove_all() to remove all items.
* @param item the #WebKitContextMenuItem to remove
*/
remove(item: ContextMenuItem): void;
/**
* Removes all items of the `menu`.
*/
remove_all(): void;
/**
* Sets user data to `menu`.
*
* This function can be used from a Web Process extension to set user data
* that can be retrieved from the UI Process using webkit_context_menu_get_user_data().
* If the `user_data` #GVariant is floating, it is consumed.
* @param user_data a #GVariant
*/
set_user_data(user_data: GLib.Variant): void;
}
namespace ContextMenuItem {
// Signal signatures
interface SignalSignatures extends GObject.InitiallyUnowned.SignalSignatures {}
// Constructor properties interface
interface ConstructorProps extends GObject.InitiallyUnowned.ConstructorProps {}
}
/**
* One item of a #WebKitContextMenu.
*
* The #WebKitContextMenu is composed of #WebKitContextMenuItems. These items can be created from a #GtkAction, from a
* #WebKitContextMenuAction or from a #WebKitContextMenuAction and a
* label. These #WebKitContextMenuActions denote stock actions
* for the items. You can also create separators and submenus.
*/
class ContextMenuItem extends GObject.InitiallyUnowned {
static $gtype: GObject.GType;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: ContextMenuItem.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
static ['new'](action: Gtk.Action): ContextMenuItem;
static new_from_gaction(action: Gio.Action, label: string, target?: GLib.Variant | null): ContextMenuItem;
static new_from_stock_action(action: ContextMenuAction): ContextMenuItem;
static new_from_stock_action_with_label(action: ContextMenuAction, label: string): ContextMenuItem;
static new_separator(): ContextMenuItem;
static new_with_submenu(label: string, submenu: ContextMenu): ContextMenuItem;
// Signals
connect(
signal: K,
callback: GObject.SignalCallback,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
connect_after(
signal: K,
callback: GObject.SignalCallback,
): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
emit(
signal: K,
...args: GObject.GjsParameters extends [any, ...infer Q]
? Q
: never
): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Gets the action associated to `item` as a #GtkAction.
* @returns the #GtkAction associated to the #WebKitContextMenuItem, or %NULL if @item is a separator.
*/
get_action(): Gtk.Action;
/**
* Gets the action associated to `item` as a #GAction.
* @returns the #GAction associated to the #WebKitContextMenuItem, or %NULL if @item is a separator.
*/
get_gaction(): Gio.Action;
/**
* Gets the #WebKitContextMenuAction of `item`.
*
* If the #WebKitContextMenuItem was not
* created for a stock action %WEBKIT_CONTEXT_MENU_ACTION_CUSTOM will be
* returned. If the #WebKitContextMenuItem is a separator %WEBKIT_CONTEXT_MENU_ACTION_NO_ACTION
* will be returned.
* @returns the #WebKitContextMenuAction of @item
*/
get_stock_action(): ContextMenuAction;
/**
* Gets the submenu of `item`.
* @returns the #WebKitContextMenu representing the submenu of @item or %NULL if @item doesn't have a submenu.
*/
get_submenu(): ContextMenu;
/**
* Checks whether `item` is a separator.
* @returns %TRUE is @item is a separator or %FALSE otherwise
*/
is_separator(): boolean;
/**
* Sets or replaces the `item` submenu.
*
* If `submenu` is %NULL the current
* submenu of `item` is removed.
* @param submenu a #WebKitContextMenu
*/
set_submenu(submenu?: ContextMenu | null): void;
}
namespace CookieManager {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {
changed: () => void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* Defines how to handle cookies in a #WebKitWebContext.
*
* The WebKitCookieManager defines how to set up and handle cookies.
* You can get it from a #WebKitWebsiteDataManager with
* webkit_website_data_manager_get_cookie_manager(), and use it to set where to
* store cookies with webkit_cookie_manager_set_persistent_storage(),
* or to set the acceptance policy, with webkit_cookie_manager_get_accept_policy().
*/
class CookieManager extends GObject.Object {
static $gtype: GObject.GType;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: CookieManager.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(
signal: K,
callback: GObject.SignalCallback,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
connect_after(
signal: K,
callback: GObject.SignalCallback,
): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
emit(
signal: K,
...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never
): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Asynchronously add a #SoupCookie to the underlying storage.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_add_cookie_finish() to get the result of the operation.
* @param cookie the #SoupCookie to be added
* @param cancellable a #GCancellable or %NULL to ignore
*/
add_cookie(cookie: Soup.Cookie, cancellable?: Gio.Cancellable | null): globalThis.Promise;
/**
* Asynchronously add a #SoupCookie to the underlying storage.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_add_cookie_finish() to get the result of the operation.
* @param cookie the #SoupCookie to be added
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
add_cookie(
cookie: Soup.Cookie,
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback | null,
): void;
/**
* Asynchronously add a #SoupCookie to the underlying storage.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_add_cookie_finish() to get the result of the operation.
* @param cookie the #SoupCookie to be added
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
add_cookie(
cookie: Soup.Cookie,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): globalThis.Promise | void;
/**
* Finish an asynchronous operation started with webkit_cookie_manager_add_cookie().
* @param result a #GAsyncResult
* @returns %TRUE if the cookie was added or %FALSE in case of error.
*/
add_cookie_finish(result: Gio.AsyncResult): boolean;
/**
* Delete all cookies of `cookie_manager`.
*/
delete_all_cookies(): void;
/**
* Asynchronously delete a #SoupCookie from the current session.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_delete_cookie_finish() to get the result of the operation.
* @param cookie the #SoupCookie to be deleted
* @param cancellable a #GCancellable or %NULL to ignore
*/
delete_cookie(cookie: Soup.Cookie, cancellable?: Gio.Cancellable | null): globalThis.Promise;
/**
* Asynchronously delete a #SoupCookie from the current session.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_delete_cookie_finish() to get the result of the operation.
* @param cookie the #SoupCookie to be deleted
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
delete_cookie(
cookie: Soup.Cookie,
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback | null,
): void;
/**
* Asynchronously delete a #SoupCookie from the current session.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_delete_cookie_finish() to get the result of the operation.
* @param cookie the #SoupCookie to be deleted
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
delete_cookie(
cookie: Soup.Cookie,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): globalThis.Promise | void;
/**
* Finish an asynchronous operation started with webkit_cookie_manager_delete_cookie().
* @param result a #GAsyncResult
* @returns %TRUE if the cookie was deleted or %FALSE in case of error.
*/
delete_cookie_finish(result: Gio.AsyncResult): boolean;
/**
* Remove all cookies of `cookie_manager` for the given `domain`.
* @param domain a domain name
*/
delete_cookies_for_domain(domain: string): void;
/**
* Asynchronously get the cookie acceptance policy of `cookie_manager`.
*
* Note that when policy was set to %WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY and
* ITP is enabled, this will return %WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS.
* See also webkit_website_data_manager_set_itp_enabled().
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_get_accept_policy_finish() to get the result of the operation.
* @param cancellable a #GCancellable or %NULL to ignore
*/
get_accept_policy(cancellable?: Gio.Cancellable | null): globalThis.Promise;
/**
* Asynchronously get the cookie acceptance policy of `cookie_manager`.
*
* Note that when policy was set to %WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY and
* ITP is enabled, this will return %WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS.
* See also webkit_website_data_manager_set_itp_enabled().
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_get_accept_policy_finish() to get the result of the operation.
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
get_accept_policy(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void;
/**
* Asynchronously get the cookie acceptance policy of `cookie_manager`.
*
* Note that when policy was set to %WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY and
* ITP is enabled, this will return %WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS.
* See also webkit_website_data_manager_set_itp_enabled().
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_get_accept_policy_finish() to get the result of the operation.
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
get_accept_policy(
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): globalThis.Promise | void;
/**
* Finish an asynchronous operation started with webkit_cookie_manager_get_accept_policy().
* @param result a #GAsyncResult
* @returns the cookie acceptance policy of @cookie_manager as a #WebKitCookieAcceptPolicy.
*/
get_accept_policy_finish(result: Gio.AsyncResult): CookieAcceptPolicy;
/**
* Asynchronously get a list of #SoupCookie from `cookie_manager`.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_get_all_cookies_finish() to get the result of the operation.
* @param cancellable a #GCancellable or %NULL to ignore
*/
get_all_cookies(cancellable?: Gio.Cancellable | null): globalThis.Promise;
/**
* Asynchronously get a list of #SoupCookie from `cookie_manager`.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_get_all_cookies_finish() to get the result of the operation.
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback (closure user_data): a #GAsyncReadyCallback to call when the request is satisfied
*/
get_all_cookies(cancellable: Gio.Cancellable | null, callback: Gio.AsyncReadyCallback | null): void;
/**
* Asynchronously get a list of #SoupCookie from `cookie_manager`.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_get_all_cookies_finish() to get the result of the operation.
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback (closure user_data): a #GAsyncReadyCallback to call when the request is satisfied
*/
get_all_cookies(
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): globalThis.Promise | void;
/**
* Finish an asynchronous operation started with webkit_cookie_manager_get_all_cookies().
*
* The return value is a #GList of #SoupCookie instances which should be released
* with g_list_free_full() and soup_cookie_free().
* @param result a #GAsyncResult
* @returns A #GList of #SoupCookie instances.
*/
get_all_cookies_finish(result: Gio.AsyncResult): Soup.Cookie[];
/**
* Asynchronously get a list of #SoupCookie from `cookie_manager`.
*
* Asynchronously get a list of #SoupCookie from `cookie_manager` associated with `uri,` which
* must be either an HTTP or an HTTPS URL.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_get_cookies_finish() to get the result of the operation.
* @param uri the URI associated to the cookies to be retrieved
* @param cancellable a #GCancellable or %NULL to ignore
*/
get_cookies(uri: string, cancellable?: Gio.Cancellable | null): globalThis.Promise;
/**
* Asynchronously get a list of #SoupCookie from `cookie_manager`.
*
* Asynchronously get a list of #SoupCookie from `cookie_manager` associated with `uri,` which
* must be either an HTTP or an HTTPS URL.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_get_cookies_finish() to get the result of the operation.
* @param uri the URI associated to the cookies to be retrieved
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
get_cookies(
uri: string,
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback | null,
): void;
/**
* Asynchronously get a list of #SoupCookie from `cookie_manager`.
*
* Asynchronously get a list of #SoupCookie from `cookie_manager` associated with `uri,` which
* must be either an HTTP or an HTTPS URL.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_get_cookies_finish() to get the result of the operation.
* @param uri the URI associated to the cookies to be retrieved
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
get_cookies(
uri: string,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): globalThis.Promise | void;
/**
* Finish an asynchronous operation started with webkit_cookie_manager_get_cookies().
*
* The return value is a #GList of #SoupCookie instances which should be released
* with g_list_free_full() and soup_cookie_free().
* @param result a #GAsyncResult
* @returns A #GList of #SoupCookie instances.
*/
get_cookies_finish(result: Gio.AsyncResult): Soup.Cookie[];
/**
* Asynchronously get the list of domains for which `cookie_manager` contains cookies.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_get_domains_with_cookies_finish() to get the result of the operation.
* @param cancellable a #GCancellable or %NULL to ignore
*/
get_domains_with_cookies(cancellable?: Gio.Cancellable | null): globalThis.Promise;
/**
* Asynchronously get the list of domains for which `cookie_manager` contains cookies.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_get_domains_with_cookies_finish() to get the result of the operation.
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
get_domains_with_cookies(
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback | null,
): void;
/**
* Asynchronously get the list of domains for which `cookie_manager` contains cookies.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_get_domains_with_cookies_finish() to get the result of the operation.
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback a #GAsyncReadyCallback to call when the request is satisfied
*/
get_domains_with_cookies(
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): globalThis.Promise | void;
/**
* Finish an asynchronous operation started with webkit_cookie_manager_get_domains_with_cookies().
*
* The return value is a %NULL terminated list of strings which should
* be released with g_strfreev().
* @param result a #GAsyncResult
* @returns A %NULL terminated array of domain names or %NULL in case of error.
*/
get_domains_with_cookies_finish(result: Gio.AsyncResult): string[];
/**
* Asynchronously replace all cookies in `cookie_manager` with the given list of `cookies`.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_replace_cookies_finish() to get the result of the operation.
* @param cookies a #GList of #SoupCookie to be added
* @param cancellable a #GCancellable or %NULL to ignore
*/
replace_cookies(cookies: Soup.Cookie[], cancellable?: Gio.Cancellable | null): globalThis.Promise;
/**
* Asynchronously replace all cookies in `cookie_manager` with the given list of `cookies`.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_replace_cookies_finish() to get the result of the operation.
* @param cookies a #GList of #SoupCookie to be added
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback (closure user_data): a #GAsyncReadyCallback to call when the request is satisfied
*/
replace_cookies(
cookies: Soup.Cookie[],
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback | null,
): void;
/**
* Asynchronously replace all cookies in `cookie_manager` with the given list of `cookies`.
*
* When the operation is finished, `callback` will be called. You can then call
* webkit_cookie_manager_replace_cookies_finish() to get the result of the operation.
* @param cookies a #GList of #SoupCookie to be added
* @param cancellable a #GCancellable or %NULL to ignore
* @param callback (closure user_data): a #GAsyncReadyCallback to call when the request is satisfied
*/
replace_cookies(
cookies: Soup.Cookie[],
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): globalThis.Promise | void;
/**
* Finish an asynchronous operation started with webkit_cookie_manager_replace_cookies().
* @param result a #GAsyncResult
* @returns %TRUE if the cookies were added or %FALSE in case of error.
*/
replace_cookies_finish(result: Gio.AsyncResult): boolean;
/**
* Set the cookie acceptance policy of `cookie_manager` as `policy`.
*
* Note that ITP has its own way to handle third-party cookies, so when it's enabled,
* and `policy` is set to %WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY, %WEBKIT_COOKIE_POLICY_ACCEPT_ALWAYS
* will be used instead. Once disabled, the policy will be set back to %WEBKIT_COOKIE_POLICY_ACCEPT_NO_THIRD_PARTY.
* See also webkit_website_data_manager_set_itp_enabled().
* @param policy a #WebKitCookieAcceptPolicy
*/
set_accept_policy(policy: CookieAcceptPolicy | null): void;
/**
* Set non-session cookies.
*
* Set the `filename` where non-session cookies are stored persistently using
* `storage` as the format to read/write the cookies.
* Cookies are initially read from `filename` to create an initial set of cookies.
* Then, non-session cookies will be written to `filename` when the WebKitCookieManager::changed
* signal is emitted.
* By default, `cookie_manager` doesn't store the cookies persistently, so you need to call this
* method to keep cookies saved across sessions.
*
* This method should never be called on a #WebKitCookieManager associated to an ephemeral #WebKitWebsiteDataManager.
* @param filename the filename to read to/write from
* @param storage a #WebKitCookiePersistentStorage
*/
set_persistent_storage(filename: string, storage: CookiePersistentStorage | null): void;
}
namespace DeviceInfoPermissionRequest {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, PermissionRequest.ConstructorProps {}
}
/**
* A permission request for enumerating the user's media devices
*
* WebKitDeviceInfoPermissionRequest represents a request for
* permission to whether WebKit should be allowed to access the user's
* devices information when requested through the MediaDevices.enumerateDevices
* API.
*
* When a WebKitDeviceInfoPermissionRequest is not handled by the user,
* it is denied by default.
*/
class DeviceInfoPermissionRequest extends GObject.Object implements PermissionRequest {
static $gtype: GObject.GType;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: DeviceInfoPermissionRequest.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(
signal: K,
callback: GObject.SignalCallback,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
connect_after(
signal: K,
callback: GObject.SignalCallback,
): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
emit(
signal: K,
...args: GObject.GjsParameters extends [
any,
...infer Q,
]
? Q
: never
): void;
emit(signal: string, ...args: any[]): void;
// Inherited methods
/**
* Allow the action which triggered this request.
*/
allow(): void;
/**
* Deny the action which triggered this request.
*/
deny(): void;
/**
* Allow the action which triggered this request.
*/
vfunc_allow(): void;
/**
* Deny the action which triggered this request.
*/
vfunc_deny(): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace Download {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {
'created-destination': (arg0: string) => void;
'decide-destination': (arg0: string) => boolean | void;
failed: (arg0: GLib.Error) => void;
finished: () => void;
'received-data': (arg0: number) => void;
'notify::allow-overwrite': (pspec: GObject.ParamSpec) => void;
'notify::destination': (pspec: GObject.ParamSpec) => void;
'notify::estimated-progress': (pspec: GObject.ParamSpec) => void;
'notify::response': (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
allow_overwrite: boolean;
allowOverwrite: boolean;
destination: string;
estimated_progress: number;
estimatedProgress: number;
response: URIResponse;
}
}
/**
* Object used to communicate with the application when downloading.
*
* #WebKitDownload carries information about a download request and
* response, including a #WebKitURIRequest and a #WebKitURIResponse
* objects. The application may use this object to control the
* download process, or to simply figure out what is to be downloaded,
* and handle the download process itself.
*/
class Download extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* Whether or not the download is allowed to overwrite an existing file on
* disk. If this property is %FALSE and the destination already exists,
* the download will fail.
*/
get allow_overwrite(): boolean;
set allow_overwrite(val: boolean);
/**
* Whether or not the download is allowed to overwrite an existing file on
* disk. If this property is %FALSE and the destination already exists,
* the download will fail.
*/
get allowOverwrite(): boolean;
set allowOverwrite(val: boolean);
/**
* The local path to where the download will be saved.
*/
get destination(): string;
/**
* An estimate of the percent completion for the download operation.
* This value will range from 0.0 to 1.0. The value is an estimate
* based on the total number of bytes expected to be received for
* a download.
* If you need a more accurate progress information you can connect to
* #WebKitDownload::received-data signal to track the progress.
*/
get estimated_progress(): number;
/**
* An estimate of the percent completion for the download operation.
* This value will range from 0.0 to 1.0. The value is an estimate
* based on the total number of bytes expected to be received for
* a download.
* If you need a more accurate progress information you can connect to
* #WebKitDownload::received-data signal to track the progress.
*/
get estimatedProgress(): number;
/**
* The #WebKitURIResponse associated with this download.
*/
get response(): URIResponse;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: Download.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(
signal: K,
callback: GObject.SignalCallback,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
connect_after(
signal: K,
callback: GObject.SignalCallback,
): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
emit(
signal: K,
...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never
): void;
emit(signal: string, ...args: any[]): void;
// Virtual methods
vfunc_decide_destination(suggested_filename: string): boolean;
// Methods
/**
* Cancels the download.
*
* When the ongoing download
* operation is effectively cancelled the signal
* #WebKitDownload::failed is emitted with
* %WEBKIT_DOWNLOAD_ERROR_CANCELLED_BY_USER error.
*/
cancel(): void;
/**
* Returns the current value of the #WebKitDownload:allow-overwrite property.
*
* Returns the current value of the #WebKitDownload:allow-overwrite property,
* which determines whether the download will overwrite an existing file on
* disk, or if it will fail if the destination already exists.
* @returns the current value of the #WebKitDownload:allow-overwrite property
*/
get_allow_overwrite(): boolean;
/**
* Obtains the destination to which the downloaded file will be written.
*
* You can connect to #WebKitDownload::created-destination to make
* sure this method returns a valid destination.
* @returns the destination or %NULL
*/
get_destination(): string | null;
/**
* Gets the elapsed time in seconds, including any fractional part.
*
* If the download finished, had an error or was cancelled this is
* the time between its start and the event.
* @returns seconds since the download was started
*/
get_elapsed_time(): number;
/**
* Gets the value of the #WebKitDownload:estimated-progress property.
* Gets the value of the #WebKitDownload:estimated-progress property.
* You can monitor the estimated progress of the download operation by
* connecting to the notify::estimated-progress signal of `download`.
* @returns an estimate of the of the percent complete for a download as a range from 0.0 to 1.0.
*/
get_estimated_progress(): number;
/**
* Gets the length of the data already downloaded for `download`.
*
* Gets the length of the data already downloaded for `download`
* in bytes.
* @returns the amount of bytes already downloaded.
*/
get_received_data_length(): number;
/**
* Retrieves the #WebKitURIRequest object that backs the download
* process.
* @returns the #WebKitURIRequest of @download
*/
get_request(): URIRequest;
/**
* Retrieves the #WebKitURIResponse object that backs the download process.
*
* Retrieves the #WebKitURIResponse object that backs the download
* process. This method returns %NULL if called before the response
* is received from the server. You can connect to notify::response
* signal to be notified when the response is received.
* @returns the #WebKitURIResponse, or %NULL if the response hasn't been received yet.
*/
get_response(): URIResponse;
/**
* Get the #WebKitWebView that initiated the download.
* @returns the #WebKitWebView that initiated @download, or %NULL if @download was not initiated by a #WebKitWebView.
*/
get_web_view(): WebView;
/**
* Sets the #WebKitDownload:allow-overwrite property.
*
* Sets the #WebKitDownload:allow-overwrite property, which determines whether
* the download may overwrite an existing file on disk, or if it will fail if
* the destination already exists.
* @param allowed the new value for the #WebKitDownload:allow-overwrite property
*/
set_allow_overwrite(allowed: boolean): void;
/**
* Sets the destination to which the downloaded file will be written.
*
* This method should be called before the download transfer
* starts or it will not have any effect on the ongoing download
* operation. To set the destination using the filename suggested
* by the server connect to #WebKitDownload::decide-destination
* signal and call webkit_download_set_destination(). If you want to
* set a fixed destination that doesn't depend on the suggested
* filename you can connect to notify::response signal and call
* webkit_download_set_destination().
*
* If #WebKitDownload::decide-destination signal is not handled
* and destination is not set when the download transfer starts,
* the file will be saved with the filename suggested by the server in
* %G_USER_DIRECTORY_DOWNLOAD directory.
* @param destination the destination
*/
set_destination(destination: string): void;
}
namespace EditorState {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {
changed: () => void;
'notify::typing-attributes': (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
typing_attributes: number;
typingAttributes: number;
}
}
/**
* Web editor state.
*
* WebKitEditorState represents the state of a #WebKitWebView editor.
* Use webkit_web_view_get_editor_state() to get the WebKitEditorState
* of a #WebKitWebView.
*/
class EditorState extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* Bitmask of #WebKitEditorTypingAttributes flags.
* See webkit_editor_state_get_typing_attributes() for more information.
*/
get typing_attributes(): number;
/**
* Bitmask of #WebKitEditorTypingAttributes flags.
* See webkit_editor_state_get_typing_attributes() for more information.
*/
get typingAttributes(): number;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: EditorState.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(
signal: K,
callback: GObject.SignalCallback,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
connect_after(
signal: K,
callback: GObject.SignalCallback,
): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
emit(
signal: K,
...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never
): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Gets the typing attributes at the current cursor position.
*
* If there is a selection, this returns the typing attributes
* of the selected text. Note that in case of a selection,
* typing attributes are considered active only when they are
* present throughout the selection.
* @returns a bitmask of #WebKitEditorTypingAttributes flags
*/
get_typing_attributes(): number;
/**
* Gets whether a copy command can be issued.
* @returns %TRUE if copy is currently available
*/
is_copy_available(): boolean;
/**
* Gets whether a cut command can be issued.
* @returns %TRUE if cut is currently available
*/
is_cut_available(): boolean;
/**
* Gets whether a paste command can be issued.
* @returns %TRUE if paste is currently available
*/
is_paste_available(): boolean;
/**
* Gets whether a redo command can be issued.
* @returns %TRUE if redo is currently available
*/
is_redo_available(): boolean;
/**
* Gets whether an undo command can be issued.
* @returns %TRUE if undo is currently available
*/
is_undo_available(): boolean;
}
namespace FaviconDatabase {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {
'favicon-changed': (arg0: string, arg1: string) => void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* Provides access to the icons associated with web sites.
*
* WebKit will automatically look for available icons in
* elements on opened pages as well as an existing favicon.ico and
* load the images found into a memory cache if possible. That cache
* is frozen to an on-disk database for persistence.
*
* If #WebKitSettings:enable-private-browsing is %TRUE, new icons
* won't be added to the on-disk database and no existing icons will
* be deleted from it. Nevertheless, WebKit will still store them in
* the in-memory cache during the current execution.
*/
class FaviconDatabase extends GObject.Object {
static $gtype: GObject.GType;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: FaviconDatabase.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(
signal: K,
callback: GObject.SignalCallback,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
connect_after(
signal: K,
callback: GObject.SignalCallback,
): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
emit(
signal: K,
...args: GObject.GjsParameters extends [any, ...infer Q]
? Q
: never
): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Clears all icons from the database.
*/
clear(): void;
/**
* Asynchronously obtains a favicon image.
*
* Asynchronously obtains an image of the favicon for the
* given page URI. It returns the cached icon if it's in the database
* asynchronously waiting for the icon to be read from the database.
*
* This is an asynchronous method. When the operation is finished, callback will
* be invoked. You can then call webkit_favicon_database_get_favicon_finish()
* to get the result of the operation.
* @param page_uri URI of the page for which we want to retrieve the favicon
* @param cancellable A #GCancellable or %NULL.
*/
get_favicon(page_uri: string, cancellable?: Gio.Cancellable | null): globalThis.Promise;
/**
* Asynchronously obtains a favicon image.
*
* Asynchronously obtains an image of the favicon for the
* given page URI. It returns the cached icon if it's in the database
* asynchronously waiting for the icon to be read from the database.
*
* This is an asynchronous method. When the operation is finished, callback will
* be invoked. You can then call webkit_favicon_database_get_favicon_finish()
* to get the result of the operation.
* @param page_uri URI of the page for which we want to retrieve the favicon
* @param cancellable A #GCancellable or %NULL.
* @param callback A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
*/
get_favicon(
page_uri: string,
cancellable: Gio.Cancellable | null,
callback: Gio.AsyncReadyCallback | null,
): void;
/**
* Asynchronously obtains a favicon image.
*
* Asynchronously obtains an image of the favicon for the
* given page URI. It returns the cached icon if it's in the database
* asynchronously waiting for the icon to be read from the database.
*
* This is an asynchronous method. When the operation is finished, callback will
* be invoked. You can then call webkit_favicon_database_get_favicon_finish()
* to get the result of the operation.
* @param page_uri URI of the page for which we want to retrieve the favicon
* @param cancellable A #GCancellable or %NULL.
* @param callback A #GAsyncReadyCallback to call when the request is satisfied or %NULL if you don't care about the result.
*/
get_favicon(
page_uri: string,
cancellable?: Gio.Cancellable | null,
callback?: Gio.AsyncReadyCallback | null,
): globalThis.Promise | void;
/**
* Finishes an operation started with webkit_favicon_database_get_favicon().
* @param result A #GAsyncResult obtained from the #GAsyncReadyCallback passed to webkit_favicon_database_get_favicon()
* @returns a new favicon image, or %NULL in case of error.
*/
get_favicon_finish(result: Gio.AsyncResult): cairo.Surface;
/**
* Obtains the URI of the favicon for the given `page_uri`.
* @param page_uri URI of the page containing the icon
* @returns a newly allocated URI for the favicon, or %NULL if the database doesn't have a favicon for @page_uri.
*/
get_favicon_uri(page_uri: string): string;
}
namespace FileChooserRequest {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {
'notify::filter': (pspec: GObject.ParamSpec) => void;
'notify::mime-types': (pspec: GObject.ParamSpec) => void;
'notify::select-multiple': (pspec: GObject.ParamSpec) => void;
'notify::selected-files': (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
filter: Gtk.FileFilter;
mime_types: string[];
mimeTypes: string[];
select_multiple: boolean;
selectMultiple: boolean;
selected_files: string[];
selectedFiles: string[];
}
}
/**
* A request to open a file chooser.
*
* Whenever the user interacts with an HTML input element with
* file type, WebKit will need to show a dialog to choose one or
* more files to be uploaded to the server along with the rest of the
* form data. For that to happen in a general way, instead of just
* opening a #GtkFileChooserDialog (which might be not desirable in
* some cases, which could prefer to use their own file chooser
* dialog), WebKit will fire the #WebKitWebView::run-file-chooser
* signal with a #WebKitFileChooserRequest object, which will allow
* the client application to specify the files to be selected, to
* inspect the details of the request (e.g. if multiple selection
* should be allowed) and to cancel the request, in case nothing was
* selected.
*
* In case the client application does not wish to handle this signal,
* WebKit will provide a default handler which will asynchronously run
* a regular #GtkFileChooserDialog for the user to interact with.
*/
class FileChooserRequest extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* The filter currently associated with the request. See
* webkit_file_chooser_request_get_mime_types_filter() for more
* details.
*/
get filter(): Gtk.FileFilter;
/**
* A %NULL-terminated array of strings containing the list of MIME
* types the file chooser dialog should handle. See
* webkit_file_chooser_request_get_mime_types() for more details.
*/
get mime_types(): string[];
/**
* A %NULL-terminated array of strings containing the list of MIME
* types the file chooser dialog should handle. See
* webkit_file_chooser_request_get_mime_types() for more details.
*/
get mimeTypes(): string[];
/**
* Whether the file chooser should allow selecting multiple
* files. See
* webkit_file_chooser_request_get_select_multiple() for
* more details.
*/
get select_multiple(): boolean;
/**
* Whether the file chooser should allow selecting multiple
* files. See
* webkit_file_chooser_request_get_select_multiple() for
* more details.
*/
get selectMultiple(): boolean;
/**
* A %NULL-terminated array of strings containing the list of
* selected files associated to the current request. See
* webkit_file_chooser_request_get_selected_files() for more details.
*/
get selected_files(): string[];
/**
* A %NULL-terminated array of strings containing the list of
* selected files associated to the current request. See
* webkit_file_chooser_request_get_selected_files() for more details.
*/
get selectedFiles(): string[];
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: FileChooserRequest.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(
signal: K,
callback: GObject.SignalCallback,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
connect_after(
signal: K,
callback: GObject.SignalCallback,
): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
emit(
signal: K,
...args: GObject.GjsParameters extends [any, ...infer Q]
? Q
: never
): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Ask WebKit to cancel the request.
*
* It's important to do this in case
* no selection has been made in the client, otherwise the request
* won't be properly completed and the browser will keep the request
* pending forever, which might cause the browser to hang.
*/
cancel(): void;
/**
* Get the list of MIME types the file chooser dialog should handle.
*
* Get the list of MIME types the file chooser dialog should handle,
* in the format specified in RFC 2046 for "media types". Its contents
* depend on the value of the 'accept' attribute for HTML input
* elements. This function should normally be called before presenting
* the file chooser dialog to the user, to decide whether to allow the
* user to select multiple files at once or only one.
* @returns a %NULL-terminated array of strings if a list of accepted MIME types is defined or %NULL otherwise, meaning that any MIME type should be accepted. This array and its contents are owned by WebKit and should not be modified or freed.
*/
get_mime_types(): string[];
/**
* Get the filter currently associated with the request.
*
* Get the filter currently associated with the request, ready to be
* used by #GtkFileChooser. This function should normally be called
* before presenting the file chooser dialog to the user, to decide
* whether to apply a filter so the user would not be allowed to
* select files with other MIME types.
*
* See webkit_file_chooser_request_get_mime_types() if you are
* interested in getting the list of accepted MIME types.
* @returns a #GtkFileFilter if a list of accepted MIME types is defined or %NULL otherwise. The returned object is owned by WebKit should not be modified or freed.
*/
get_mime_types_filter(): Gtk.FileFilter;
/**
* Whether the file chooser should allow selecting multiple files.
*
* Determine whether the file chooser associated to this
* #WebKitFileChooserRequest should allow selecting multiple files,
* which depends on the HTML input element having a 'multiple'
* attribute defined.
* @returns %TRUE if the file chooser should allow selecting multiple files or %FALSE otherwise.
*/
get_select_multiple(): boolean;
/**
* Get the list of selected files associated to the request.
*
* Get the list of selected files currently associated to the
* request. Initially, the return value of this method contains any
* files selected in previous file chooser requests for this HTML
* input element. Once webkit_file_chooser_request_select_files, the
* value will reflect whatever files are given.
*
* This function should normally be called only before presenting the
* file chooser dialog to the user, to decide whether to perform some
* extra action, like pre-selecting the files from a previous request.
* @returns a %NULL-terminated array of strings if there are selected files associated with the request or %NULL otherwise. This array and its contents are owned by WebKit and should not be modified or freed.
*/
get_selected_files(): string[];
/**
* Ask WebKit to select local files for upload and complete the
* request.
* @param files a %NULL-terminated array of strings, containing paths to local files.
*/
select_files(files: string[]): void;
}
namespace FindController {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {
'counted-matches': (arg0: number) => void;
'failed-to-find-text': () => void;
'found-text': (arg0: number) => void;
'notify::max-match-count': (pspec: GObject.ParamSpec) => void;
'notify::options': (pspec: GObject.ParamSpec) => void;
'notify::text': (pspec: GObject.ParamSpec) => void;
'notify::web-view': (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
max_match_count: number;
maxMatchCount: number;
options: FindOptions;
text: string;
web_view: WebView;
webView: WebView;
}
}
/**
* Controls text search in a #WebKitWebView.
*
* A #WebKitFindController is used to search text in a #WebKitWebView. You
* can get a #WebKitWebView's #WebKitFindController with
* webkit_web_view_get_find_controller(), and later use it to search
* for text using webkit_find_controller_search(), or get the
* number of matches using webkit_find_controller_count_matches(). The
* operations are asynchronous and trigger signals when ready, such as
* #WebKitFindController::found-text,
* #WebKitFindController::failed-to-find-text or
* #WebKitFindController::counted-matches.
*/
class FindController extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* The maximum number of matches to report for a given search.
*/
get max_match_count(): number;
/**
* The maximum number of matches to report for a given search.
*/
get maxMatchCount(): number;
/**
* The options to be used in the search operation.
*/
get options(): FindOptions;
/**
* The current search text for this #WebKitFindController.
*/
get text(): string;
/**
* The #WebKitWebView this controller is associated to.
*/
get web_view(): WebView;
/**
* The #WebKitWebView this controller is associated to.
*/
get webView(): WebView;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: FindController.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(
signal: K,
callback: GObject.SignalCallback,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
connect_after(
signal: K,
callback: GObject.SignalCallback,
): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
emit(
signal: K,
...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never
): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Counts the number of matches for `search_text`.
*
* Counts the number of matches for `search_text` found in the
* #WebKitWebView with the provided `find_options`. The number of
* matches will be provided by the
* #WebKitFindController::counted-matches signal.
* @param search_text the text to look for
* @param find_options a bitmask with the #WebKitFindOptions used in the search
* @param max_match_count the maximum number of matches allowed in the search
*/
count_matches(search_text: string, find_options: number, max_match_count: number): void;
/**
* Gets the maximum number of matches to report.
*
* Gets the maximum number of matches to report during a text
* lookup. This number is passed as the last argument of
* webkit_find_controller_search() or
* webkit_find_controller_count_matches().
* @returns the maximum number of matches to report.
*/
get_max_match_count(): number;
/**
* Gets the #WebKitFindOptions for the current search.
*
* Gets a bitmask containing the #WebKitFindOptions associated with
* the current search.
* @returns a bitmask containing the #WebKitFindOptions associated with the current search.
*/
get_options(): number;
/**
* Gets the text that `find_controller` is searching for.
*
* Gets the text that `find_controller` is currently searching
* for. This text is passed to either
* webkit_find_controller_search() or
* webkit_find_controller_count_matches().
* @returns the text to look for in the #WebKitWebView.
*/
get_search_text(): string;
/**
* Gets the #WebKitWebView this find controller is associated to.
*
* Do
* not dereference the returned instance as it belongs to the
* #WebKitFindController.
* @returns the #WebKitWebView.
*/
get_web_view(): WebView;
/**
* Looks for `search_text` associated with `find_controller`.
*
* Looks for `search_text` in the #WebKitWebView associated with
* `find_controller` since the beginning of the document highlighting
* up to `max_match_count` matches. The outcome of the search will be
* asynchronously provided by the #WebKitFindController::found-text
* and #WebKitFindController::failed-to-find-text signals.
*
* To look for the next or previous occurrences of the same text
* with the same find options use webkit_find_controller_search_next()
* and/or webkit_find_controller_search_previous(). The
* #WebKitFindController will use the same text and options for the
* following searches unless they are modified by another call to this
* method.
*
* Note that if the number of matches is higher than `max_match_count`
* then #WebKitFindController::found-text will report %G_MAXUINT matches
* instead of the actual number.
*
* Callers should call webkit_find_controller_search_finish() to
* finish the current search operation.
* @param search_text the text to look for
* @param find_options a bitmask with the #WebKitFindOptions used in the search
* @param max_match_count the maximum number of matches allowed in the search
*/
search(search_text: string, find_options: number, max_match_count: number): void;
/**
* Finishes a find operation.
*
* Finishes a find operation started by
* webkit_find_controller_search(). It will basically unhighlight
* every text match found.
*
* This method will be typically called when the search UI is
* closed/hidden by the client application.
*/
search_finish(): void;
/**
* Looks for the next occurrence of the search text.
*
* Calling this method before webkit_find_controller_search() or
* webkit_find_controller_count_matches() is a programming error.
*/
search_next(): void;
/**
* Looks for the previous occurrence of the search text.
*
* Calling this method before webkit_find_controller_search() or
* webkit_find_controller_count_matches() is a programming error.
*/
search_previous(): void;
}
namespace FormSubmissionRequest {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {}
}
/**
* Represents a form submission request.
*
* When a form is about to be submitted in a #WebKitWebView, the
* #WebKitWebView::submit-form signal is emitted. Its request argument
* contains information about the text fields of the form, that are
* typically used to store login information, returned as lists by
* webkit_form_submission_request_list_text_fields(). You can submit the
* form with webkit_form_submission_request_submit().
*/
class FormSubmissionRequest extends GObject.Object {
static $gtype: GObject.GType;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: FormSubmissionRequest.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(
signal: K,
callback: GObject.SignalCallback,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
connect_after(
signal: K,
callback: GObject.SignalCallback,
): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
emit(
signal: K,
...args: GObject.GjsParameters extends [any, ...infer Q]
? Q
: never
): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Get the values of the text fields contained in the form associated to `request`.
*
* Get a #GHashTable with the values of the text fields contained in the form
* associated to `request`. Note that fields will be missing if the form
* contains multiple text input elements with the same name, so this
* function does not reliably return all text fields.
* @returns a #GHashTable with the form text fields, or %NULL if the form doesn't contain text fields.
*/
get_text_fields(): GLib.HashTable | null;
/**
* Get lists of the text fields contained in the form associated to `request`.
*
* Get lists with the names and values of the text fields contained in
* the form associated to `request`. Note that names and values may be
* %NULL.
*
* If this function returns %FALSE, then both `field_names` and
* `field_values` will be empty.
* @returns %TRUE if the form contains text fields, or %FALSE otherwise
*/
list_text_fields(): [boolean, string[] | null, string[] | null];
/**
* Continue the form submission.
*/
submit(): void;
}
namespace GeolocationManager {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {
start: () => boolean | void;
stop: () => void;
'notify::enable-high-accuracy': (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
enable_high_accuracy: boolean;
enableHighAccuracy: boolean;
}
}
/**
* Geolocation manager.
*
* WebKitGeolocationManager provides API to get the geographical position of the user.
* Once a #WebKitGeolocationPermissionRequest is allowed, when WebKit needs to know the
* user location #WebKitGeolocationManager::start signal is emitted. If the signal is handled
* and returns %TRUE, the application is responsible for providing the position every time it's
* updated by calling webkit_geolocation_manager_update_position(). The signal #WebKitGeolocationManager::stop
* will be emitted when location updates are no longer needed.
*/
class GeolocationManager extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* Whether high accuracy is enabled. This is a read-only property that will be
* set to %TRUE when a #WebKitGeolocationManager needs to get accurate position updates.
* You can connect to notify::enable-high-accuracy signal to monitor it.
*/
get enable_high_accuracy(): boolean;
/**
* Whether high accuracy is enabled. This is a read-only property that will be
* set to %TRUE when a #WebKitGeolocationManager needs to get accurate position updates.
* You can connect to notify::enable-high-accuracy signal to monitor it.
*/
get enableHighAccuracy(): boolean;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: GeolocationManager.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(
signal: K,
callback: GObject.SignalCallback,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
connect_after(
signal: K,
callback: GObject.SignalCallback,
): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
emit(
signal: K,
...args: GObject.GjsParameters extends [any, ...infer Q]
? Q
: never
): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Notify `manager` that determining the position failed.
* @param error_message the error message
*/
failed(error_message: string): void;
/**
* Get whether high accuracy is enabled.
* @returns Whether the setting is enabled.
*/
get_enable_high_accuracy(): boolean;
/**
* Notify `manager` that position has been updated to `position`.
* @param position a #WebKitGeolocationPosition
*/
update_position(position: GeolocationPosition): void;
}
namespace GeolocationPermissionRequest {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, PermissionRequest.ConstructorProps {}
}
/**
* A permission request for sharing the user's location.
*
* WebKitGeolocationPermissionRequest represents a request for
* permission to decide whether WebKit should provide the user's
* location to a website when requested through the Geolocation API.
*
* When a WebKitGeolocationPermissionRequest is not handled by the user,
* it is denied by default.
*
* When embedding web views in your application, you *must* configure an
* application identifier to allow web content to use geolocation services.
* The identifier *must* match the name of the `.desktop` file which describes
* the application, sans the suffix.
*
* If your application uses #GApplication (or any subclass like
* #GtkApplication), WebKit will automatically use the identifier returned by
* g_application_get_application_id(). This is the recommended approach for
* enabling geolocation in applications.
*
* If an identifier cannot be obtained through #GApplication, the value
* returned by g_get_prgname() will be used instead as a fallback. For
* programs which cannot use #GApplication, calling g_set_prgname() early
* during initialization is needed when the name of the executable on disk
* does not match the name of a valid `.desktop` file.
*/
class GeolocationPermissionRequest extends GObject.Object implements PermissionRequest {
static $gtype: GObject.GType;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: GeolocationPermissionRequest.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(
signal: K,
callback: GObject.SignalCallback,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
connect_after(
signal: K,
callback: GObject.SignalCallback,
): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
emit(
signal: K,
...args: GObject.GjsParameters extends [
any,
...infer Q,
]
? Q
: never
): void;
emit(signal: string, ...args: any[]): void;
// Inherited methods
/**
* Allow the action which triggered this request.
*/
allow(): void;
/**
* Deny the action which triggered this request.
*/
deny(): void;
/**
* Allow the action which triggered this request.
*/
vfunc_allow(): void;
/**
* Deny the action which triggered this request.
*/
vfunc_deny(): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace HitTestResult {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {
'notify::context': (pspec: GObject.ParamSpec) => void;
'notify::image-uri': (pspec: GObject.ParamSpec) => void;
'notify::link-label': (pspec: GObject.ParamSpec) => void;
'notify::link-title': (pspec: GObject.ParamSpec) => void;
'notify::link-uri': (pspec: GObject.ParamSpec) => void;
'notify::media-uri': (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
context: number;
image_uri: string;
imageUri: string;
link_label: string;
linkLabel: string;
link_title: string;
linkTitle: string;
link_uri: string;
linkUri: string;
media_uri: string;
mediaUri: string;
}
}
/**
* Result of a Hit Test.
*
* A Hit Test is an operation to get context information about a given
* point in a #WebKitWebView. #WebKitHitTestResult represents the
* result of a Hit Test. It provides context information about what is
* at the coordinates of the Hit Test, such as if there's a link,
* an image or a media.
*
* You can get the context of the HitTestResult with
* webkit_hit_test_result_get_context() that returns a bitmask of
* #WebKitHitTestResultContext flags. You can also use
* webkit_hit_test_result_context_is_link(), webkit_hit_test_result_context_is_image() and
* webkit_hit_test_result_context_is_media() to determine whether there's
* a link, image or a media element at the coordinates of the Hit Test.
* Note that it's possible that several #WebKitHitTestResultContext flags
* are active at the same time, for example if there's a link containing an image.
*
* When the mouse is moved over a #WebKitWebView a Hit Test is performed
* for the mouse coordinates and #WebKitWebView::mouse-target-changed
* signal is emitted with a #WebKitHitTestResult.
*/
class HitTestResult extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* Bitmask of #WebKitHitTestResultContext flags representing
* the context of the #WebKitHitTestResult.
*/
get context(): number;
/**
* The URI of the image if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE
* is present in #WebKitHitTestResult:context
*/
get image_uri(): string;
/**
* The URI of the image if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE
* is present in #WebKitHitTestResult:context
*/
get imageUri(): string;
/**
* The label of the link if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK
* is present in #WebKitHitTestResult:context
*/
get link_label(): string;
/**
* The label of the link if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK
* is present in #WebKitHitTestResult:context
*/
get linkLabel(): string;
/**
* The title of the link if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK
* is present in #WebKitHitTestResult:context
*/
get link_title(): string;
/**
* The title of the link if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK
* is present in #WebKitHitTestResult:context
*/
get linkTitle(): string;
/**
* The URI of the link if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK
* is present in #WebKitHitTestResult:context
*/
get link_uri(): string;
/**
* The URI of the link if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK
* is present in #WebKitHitTestResult:context
*/
get linkUri(): string;
/**
* The URI of the media if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA
* is present in #WebKitHitTestResult:context
*/
get media_uri(): string;
/**
* The URI of the media if flag %WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA
* is present in #WebKitHitTestResult:context
*/
get mediaUri(): string;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: HitTestResult.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(
signal: K,
callback: GObject.SignalCallback,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
connect_after(
signal: K,
callback: GObject.SignalCallback,
): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
emit(
signal: K,
...args: GObject.GjsParameters extends [any, ...infer Q] ? Q : never
): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* Gets whether %WEBKIT_HIT_TEST_RESULT_CONTEXT_EDITABLE flag is present in
* #WebKitHitTestResult:context.
* @returns %TRUE if there's an editable element at the coordinates of the @hit_test_result, or %FALSE otherwise
*/
context_is_editable(): boolean;
/**
* Gets whether %WEBKIT_HIT_TEST_RESULT_CONTEXT_IMAGE flag is present in
* #WebKitHitTestResult:context.
* @returns %TRUE if there's an image element in the coordinates of the Hit Test, or %FALSE otherwise
*/
context_is_image(): boolean;
/**
* Gets whether %WEBKIT_HIT_TEST_RESULT_CONTEXT_LINK flag is present in
* #WebKitHitTestResult:context.
* @returns %TRUE if there's a link element in the coordinates of the Hit Test, or %FALSE otherwise
*/
context_is_link(): boolean;
/**
* Gets whether %WEBKIT_HIT_TEST_RESULT_CONTEXT_MEDIA flag is present in
* #WebKitHitTestResult:context.
* @returns %TRUE if there's a media element in the coordinates of the Hit Test, or %FALSE otherwise
*/
context_is_media(): boolean;
/**
* Gets whether %WEBKIT_HIT_TEST_RESULT_CONTEXT_SCROLLBAR flag is present in
* #WebKitHitTestResult:context.
* @returns %TRUE if there's a scrollbar element at the coordinates of the @hit_test_result, or %FALSE otherwise
*/
context_is_scrollbar(): boolean;
/**
* Gets whether %WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION flag is present in
* #WebKitHitTestResult:context.
* @returns %TRUE if there's a selected element at the coordinates of the @hit_test_result, or %FALSE otherwise
*/
context_is_selection(): boolean;
/**
* Gets the value of the #WebKitHitTestResult:context property.
* @returns a bitmask of #WebKitHitTestResultContext flags
*/
get_context(): number;
/**
* Gets the value of the #WebKitHitTestResult:image-uri property.
* @returns the URI of the image element in the coordinates of the Hit Test, or %NULL if there isn't an image element in @hit_test_result context
*/
get_image_uri(): string;
/**
* Gets the value of the #WebKitHitTestResult:link-label property.
* @returns the label of the link element in the coordinates of the Hit Test, or %NULL if there isn't a link element in @hit_test_result context or the link element doesn't have a label
*/
get_link_label(): string;
/**
* Gets the value of the #WebKitHitTestResult:link-title property.
* @returns the title of the link element in the coordinates of the Hit Test, or %NULL if there isn't a link element in @hit_test_result context or the link element doesn't have a title
*/
get_link_title(): string;
/**
* Gets the value of the #WebKitHitTestResult:link-uri property.
* @returns the URI of the link element in the coordinates of the Hit Test, or %NULL if there isn't a link element in @hit_test_result context
*/
get_link_uri(): string;
/**
* Gets the value of the #WebKitHitTestResult:media-uri property.
* @returns the URI of the media element in the coordinates of the Hit Test, or %NULL if there isn't a media element in @hit_test_result context
*/
get_media_uri(): string;
}
namespace InputMethodContext {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {
committed: (arg0: string) => void;
'delete-surrounding': (arg0: number, arg1: number) => void;
'preedit-changed': () => void;
'preedit-finished': () => void;
'preedit-started': () => void;
'notify::input-hints': (pspec: GObject.ParamSpec) => void;
'notify::input-purpose': (pspec: GObject.ParamSpec) => void;
}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps {
input_hints: InputHints;
inputHints: InputHints;
input_purpose: InputPurpose;
inputPurpose: InputPurpose;
}
}
/**
* Base class for input method contexts.
*
* WebKitInputMethodContext defines the interface to implement WebKit input methods.
* The input methods are used by WebKit, when editable content is focused, to map from
* key events to Unicode character strings.
*
* An input method may consume multiple key events in sequence and finally
* output the composed result. This is called preediting, and an input method
* may provide feedback about this process by displaying the intermediate
* composition states as preedit text.
*/
abstract class InputMethodContext extends GObject.Object {
static $gtype: GObject.GType;
// Properties
/**
* The #WebKitInputHints of the input associated with this context.
*/
get input_hints(): InputHints;
set input_hints(val: InputHints);
/**
* The #WebKitInputHints of the input associated with this context.
*/
get inputHints(): InputHints;
set inputHints(val: InputHints);
/**
* The #WebKitInputPurpose of the input associated with this context.
*/
get input_purpose(): InputPurpose;
set input_purpose(val: InputPurpose);
/**
* The #WebKitInputPurpose of the input associated with this context.
*/
get inputPurpose(): InputPurpose;
set inputPurpose(val: InputPurpose);
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: InputMethodContext.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(
signal: K,
callback: GObject.SignalCallback,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
connect_after(
signal: K,
callback: GObject.SignalCallback,
): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
emit(
signal: K,
...args: GObject.GjsParameters extends [any, ...infer Q]
? Q
: never
): void;
emit(signal: string, ...args: any[]): void;
// Virtual methods
vfunc_committed(text: string): void;
vfunc_delete_surrounding(offset: number, n_chars: number): void;
/**
* Allow `key_event` to be handled by the input method.
*
* If %TRUE is returned, then no further processing should be
* done for the key event.
* @param key_event the key event to filter
*/
vfunc_filter_key_event(key_event: Gdk.EventKey): boolean;
/**
* Get the pre-edit string and a list of WebKitInputMethodUnderline.
*
* Get the current pre-edit string for the `context,` and a list of WebKitInputMethodUnderline to apply to the string.
* The string will be displayed inserted at `cursor_offset`.
*/
vfunc_get_preedit(): [string, InputMethodUnderline[] | null, number];
/**
* Notify `context` that cursor area changed in input associated.
* @param x the x coordinate of cursor location
* @param y the y coordinate of cursor location
* @param width the width of cursor area
* @param height the height of cursor area
*/
vfunc_notify_cursor_area(x: number, y: number, width: number, height: number): void;
/**
* Notify `context` that input associated has gained focus.
*/
vfunc_notify_focus_in(): void;
/**
* Notify `context` that input associated has lost focus.
*/
vfunc_notify_focus_out(): void;
/**
* Notify `context` that the context surrounding the cursor has changed.
*
* If there's no selection `selection_index` is the same as `cursor_index`.
* @param text text surrounding the insertion point
* @param length the length of @text, or -1 if @text is nul-terminated
* @param cursor_index the byte index of the insertion cursor within @text.
* @param selection_index the byte index of the selection cursor within @text.
*/
vfunc_notify_surrounding(text: string, length: number, cursor_index: number, selection_index: number): void;
vfunc_preedit_changed(): void;
vfunc_preedit_finished(): void;
vfunc_preedit_started(): void;
/**
* Reset the `context`.
*
* This will typically cause the input to clear the preedit state.
*/
vfunc_reset(): void;
/**
* Set whether `context` should enable preedit to display feedback.
* @param enabled whether to enable preedit
*/
vfunc_set_enable_preedit(enabled: boolean): void;
// Methods
/**
* Allow `key_event` to be handled by the input method.
*
* If %TRUE is returned, then no further processing should be
* done for the key event.
* @param key_event the key event to filter
* @returns %TRUE if the key event was handled, or %FALSE otherwise
*/
filter_key_event(key_event: Gdk.EventKey): boolean;
/**
* Get the value of the #WebKitInputMethodContext:input-hints property.
* @returns the #WebKitInputHints of the input associated with @context
*/
get_input_hints(): InputHints;
/**
* Get the value of the #WebKitInputMethodContext:input-purpose property.
* @returns the #WebKitInputPurpose of the input associated with @context
*/
get_input_purpose(): InputPurpose;
/**
* Get the pre-edit string and a list of WebKitInputMethodUnderline.
*
* Get the current pre-edit string for the `context,` and a list of WebKitInputMethodUnderline to apply to the string.
* The string will be displayed inserted at `cursor_offset`.
*/
get_preedit(): [string, InputMethodUnderline[] | null, number];
/**
* Notify `context` that cursor area changed in input associated.
* @param x the x coordinate of cursor location
* @param y the y coordinate of cursor location
* @param width the width of cursor area
* @param height the height of cursor area
*/
notify_cursor_area(x: number, y: number, width: number, height: number): void;
/**
* Notify `context` that input associated has gained focus.
*/
notify_focus_in(): void;
/**
* Notify `context` that input associated has lost focus.
*/
notify_focus_out(): void;
/**
* Notify `context` that the context surrounding the cursor has changed.
*
* If there's no selection `selection_index` is the same as `cursor_index`.
* @param text text surrounding the insertion point
* @param length the length of @text, or -1 if @text is nul-terminated
* @param cursor_index the byte index of the insertion cursor within @text.
* @param selection_index the byte index of the selection cursor within @text.
*/
notify_surrounding(text: string, length: number, cursor_index: number, selection_index: number): void;
/**
* Reset the `context`.
*
* This will typically cause the input to clear the preedit state.
*/
reset(): void;
/**
* Set whether `context` should enable preedit to display feedback.
* @param enabled whether to enable preedit
*/
set_enable_preedit(enabled: boolean): void;
/**
* Set the value of the #WebKitInputMethodContext:input-hints property.
* @param hints a #WebKitInputHints
*/
set_input_hints(hints: InputHints | null): void;
/**
* Set the value of the #WebKitInputMethodContext:input-purpose property.
* @param purpose a #WebKitInputPurpose
*/
set_input_purpose(purpose: InputPurpose | null): void;
}
namespace InstallMissingMediaPluginsPermissionRequest {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, PermissionRequest.ConstructorProps {}
}
/**
* Previously, a permission request for installing missing media plugins.
*
* WebKitInstallMissingMediaPluginsPermissionRequest will no longer ever be created, so
* you can remove any code that attempts to handle it.
*/
class InstallMissingMediaPluginsPermissionRequest extends GObject.Object implements PermissionRequest {
static $gtype: GObject.GType;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: InstallMissingMediaPluginsPermissionRequest.SignalSignatures;
// Constructors
constructor(
properties?: Partial,
...args: any[]
);
_init(...args: any[]): void;
// Signals
connect(
signal: K,
callback: GObject.SignalCallback,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
connect_after(
signal: K,
callback: GObject.SignalCallback,
): number;
connect_after(signal: string, callback: (...args: any[]) => any): number;
emit(
signal: K,
...args: GObject.GjsParameters<
InstallMissingMediaPluginsPermissionRequest.SignalSignatures[K]
> extends [any, ...infer Q]
? Q
: never
): void;
emit(signal: string, ...args: any[]): void;
// Methods
/**
* This function returns an empty string.
* @returns an empty string
*/
get_description(): string;
// Inherited methods
/**
* Allow the action which triggered this request.
*/
allow(): void;
/**
* Deny the action which triggered this request.
*/
deny(): void;
/**
* Allow the action which triggered this request.
*/
vfunc_allow(): void;
/**
* Deny the action which triggered this request.
*/
vfunc_deny(): void;
/**
* Creates a binding between `source_property` on `source` and `target_property`
* on `target`.
*
* Whenever the `source_property` is changed the `target_property` is
* updated using the same value. For instance:
*
*
* ```c
* g_object_bind_property (action, "active", widget, "sensitive", 0);
* ```
*
*
* Will result in the "sensitive" property of the widget #GObject instance to be
* updated with the same value of the "active" property of the action #GObject
* instance.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well.
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. To remove the binding without affecting the
* `source` and the `target` you can just call g_object_unref() on the returned
* #GBinding instance.
*
* Removing the binding by calling g_object_unref() on it must only be done if
* the binding, `source` and `target` are only used from a single thread and it
* is clear that both `source` and `target` outlive the binding. Especially it
* is not safe to rely on this if the binding, `source` or `target` can be
* finalized from different threads. Keep another reference to the binding and
* use g_binding_unbind() instead to be on the safe side.
*
* A #GObject can have multiple bindings.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
): GObject.Binding;
/**
* Complete version of g_object_bind_property().
*
* Creates a binding between `source_property` on `source` and `target_property`
* on `target,` allowing you to set the transformation functions to be used by
* the binding.
*
* If `flags` contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual:
* if `target_property` on `target` changes then the `source_property` on `source`
* will be updated as well. The `transform_from` function is only used in case
* of bidirectional bindings, otherwise it will be ignored
*
* The binding will automatically be removed when either the `source` or the
* `target` instances are finalized. This will release the reference that is
* being held on the #GBinding instance; if you want to hold on to the
* #GBinding instance, you will need to hold a reference to it.
*
* To remove the binding, call g_binding_unbind().
*
* A #GObject can have multiple bindings.
*
* The same `user_data` parameter will be used for both `transform_to`
* and `transform_from` transformation functions; the `notify` function will
* be called once, when the binding is removed. If you need different data
* for each transformation function, please use
* g_object_bind_property_with_closures() instead.
* @param source_property the property on @source to bind
* @param target the target #GObject
* @param target_property the property on @target to bind
* @param flags flags to pass to #GBinding
* @param transform_to the transformation function from the @source to the @target, or %NULL to use the default
* @param transform_from the transformation function from the @target to the @source, or %NULL to use the default
* @param notify a function to call when disposing the binding, to free resources used by the transformation functions, or %NULL if not required
* @returns the #GBinding instance representing the binding between the two #GObject instances. The binding is released whenever the #GBinding reference count reaches zero.
*/
bind_property_full(
source_property: string,
target: GObject.Object,
target_property: string,
flags: GObject.BindingFlags | null,
transform_to?: GObject.BindingTransformFunc | null,
transform_from?: GObject.BindingTransformFunc | null,
notify?: GLib.DestroyNotify | null,
): GObject.Binding;
// Conflicted with GObject.Object.bind_property_full
bind_property_full(...args: never[]): any;
/**
* This function is intended for #GObject implementations to re-enforce
* a [floating][floating-ref] object reference. Doing this is seldom
* required: all #GInitiallyUnowneds are created with a floating reference
* which usually just needs to be sunken by calling g_object_ref_sink().
*/
force_floating(): void;
/**
* Increases the freeze count on `object`. If the freeze count is
* non-zero, the emission of "notify" signals on `object` is
* stopped. The signals are queued until the freeze count is decreased
* to zero. Duplicate notifications are squashed so that at most one
* #GObject::notify signal is emitted for each property modified while the
* object is frozen.
*
* This is necessary for accessors that modify multiple properties to prevent
* premature notification while the object is still being modified.
*/
freeze_notify(): void;
/**
* Gets a named field from the objects table of associations (see g_object_set_data()).
* @param key name of the key for that association
* @returns the data if found, or %NULL if no such data exists.
*/
get_data(key: string): any | null;
/**
* Gets a property of an object.
*
* The value can be:
* - an empty GObject.Value initialized by G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
* - a GObject.Value initialized with the expected type of the property
* - a GObject.Value initialized with a type to which the expected type of the property can be transformed
*
* In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling GObject.Value.unset.
*
* Note that GObject.Object.get_property is really intended for language bindings, GObject.Object.get is much more convenient for C programming.
* @param property_name The name of the property to get
* @param value Return location for the property value. Can be an empty GObject.Value initialized by G_VALUE_INIT (auto-initialized with expected type since GLib 2.60), a GObject.Value initialized with the expected property type, or a GObject.Value initialized with a transformable type
*/
get_property(property_name: string, value: GObject.Value | any): any;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
get_qdata(quark: GLib.Quark): any | null;
/**
* Gets `n_properties` properties for an `object`.
* Obtained properties will be set to `values`. All properties must be valid.
* Warnings will be emitted and undefined behaviour may result if invalid
* properties are passed in.
* @param names the names of each property to get
* @param values the values of each property to get
*/
getv(names: string[], values: (GObject.Value | any)[]): void;
/**
* Checks whether `object` has a [floating][floating-ref] reference.
* @returns %TRUE if @object has a floating reference
*/
is_floating(): boolean;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param property_name the name of a property installed on the class of @object.
*/
notify(property_name: string): void;
/**
* Emits a "notify" signal for the property specified by `pspec` on `object`.
*
* This function omits the property name lookup, hence it is faster than
* g_object_notify().
*
* One way to avoid using g_object_notify() from within the
* class that registered the properties, and using g_object_notify_by_pspec()
* instead, is to store the GParamSpec used with
* g_object_class_install_property() inside a static array, e.g.:
*
*
* ```c
* typedef enum
* {
* PROP_FOO = 1,
* PROP_LAST
* } MyObjectProperty;
*
* static GParamSpec *properties[PROP_LAST];
*
* static void
* my_object_class_init (MyObjectClass *klass)
* {
* properties[PROP_FOO] = g_param_spec_int ("foo", NULL, NULL,
* 0, 100,
* 50,
* G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
* g_object_class_install_property (gobject_class,
* PROP_FOO,
* properties[PROP_FOO]);
* }
* ```
*
*
* and then notify a change on the "foo" property with:
*
*
* ```c
* g_object_notify_by_pspec (self, properties[PROP_FOO]);
* ```
*
* @param pspec the #GParamSpec of a property installed on the class of @object.
*/
notify_by_pspec(pspec: GObject.ParamSpec): void;
/**
* Increases the reference count of `object`.
*
* Since GLib 2.56, if `GLIB_VERSION_MAX_ALLOWED` is 2.56 or greater, the type
* of `object` will be propagated to the return type (using the GCC typeof()
* extension), so any casting the caller needs to do on the return type must be
* explicit.
* @returns the same @object
*/
ref(): GObject.Object;
/**
* Increase the reference count of `object,` and possibly remove the
* [floating][floating-ref] reference, if `object` has a floating reference.
*
* In other words, if the object is floating, then this call "assumes
* ownership" of the floating reference, converting it to a normal
* reference by clearing the floating flag while leaving the reference
* count unchanged. If the object is not floating, then this call
* adds a new normal reference increasing the reference count by one.
*
* Since GLib 2.56, the type of `object` will be propagated to the return type
* under the same conditions as for g_object_ref().
* @returns @object
*/
ref_sink(): GObject.Object;
/**
* Releases all references to other objects. This can be used to break
* reference cycles.
*
* This function should only be called from object system implementations.
*/
run_dispose(): void;
/**
* Each object carries around a table of associations from
* strings to pointers. This function lets you set an association.
*
* If the object already had an association with that name,
* the old association will be destroyed.
*
* Internally, the `key` is converted to a #GQuark using g_quark_from_string().
* This means a copy of `key` is kept permanently (even after `object` has been
* finalized) — so it is recommended to only use a small, bounded set of values
* for `key` in your program, to avoid the #GQuark storage growing unbounded.
* @param key name of the key
* @param data data to associate with that key
*/
set_data(key: string, data?: any | null): void;
/**
* Sets a property on an object.
* @param property_name The name of the property to set
* @param value The value to set the property to
*/
set_property(property_name: string, value: GObject.Value | any): void;
/**
* Remove a specified datum from the object's data associations,
* without invoking the association's destroy handler.
* @param key name of the key
* @returns the data if found, or %NULL if no such data exists.
*/
steal_data(key: string): any | null;
/**
* This function gets back user data pointers stored via
* g_object_set_qdata() and removes the `data` from object
* without invoking its destroy() function (if any was
* set).
* Usually, calling this function is only required to update
* user data pointers with a destroy notifier, for example:
*
* ```c
* void
* object_add_to_user_list (GObject *object,
* const gchar *new_string)
* {
* // the quark, naming the object data
* GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
* // retrieve the old string list
* GList *list = g_object_steal_qdata (object, quark_string_list);
*
* // prepend new string
* list = g_list_prepend (list, g_strdup (new_string));
* // this changed 'list', so we need to set it again
* g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
* }
* static void
* free_string_list (gpointer data)
* {
* GList *node, *list = data;
*
* for (node = list; node; node = node->next)
* g_free (node->data);
* g_list_free (list);
* }
* ```
*
* Using g_object_get_qdata() in the above example, instead of
* g_object_steal_qdata() would have left the destroy function set,
* and thus the partial string list would have been freed upon
* g_object_set_qdata_full().
* @param quark A #GQuark, naming the user data pointer
* @returns The user data pointer set, or %NULL
*/
steal_qdata(quark: GLib.Quark): any | null;
/**
* Reverts the effect of a previous call to
* g_object_freeze_notify(). The freeze count is decreased on `object`
* and when it reaches zero, queued "notify" signals are emitted.
*
* Duplicate notifications for each property are squashed so that at most one
* #GObject::notify signal is emitted for each property, in the reverse order
* in which they have been queued.
*
* It is an error to call this function when the freeze count is zero.
*/
thaw_notify(): void;
/**
* Decreases the reference count of `object`. When its reference count
* drops to 0, the object is finalized (i.e. its memory is freed).
*
* If the pointer to the #GObject may be reused in future (for example, if it is
* an instance variable of another object), it is recommended to clear the
* pointer to %NULL rather than retain a dangling pointer to a potentially
* invalid #GObject instance. Use g_clear_object() for this.
*/
unref(): void;
/**
* This function essentially limits the life time of the `closure` to
* the life time of the object. That is, when the object is finalized,
* the `closure` is invalidated by calling g_closure_invalidate() on
* it, in order to prevent invocations of the closure with a finalized
* (nonexisting) object. Also, g_object_ref() and g_object_unref() are
* added as marshal guards to the `closure,` to ensure that an extra
* reference count is held on `object` during invocation of the
* `closure`. Usually, this function will be called on closures that
* use this `object` as closure data.
* @param closure #GClosure to watch
*/
watch_closure(closure: GObject.Closure): void;
/**
* the `constructed` function is called by g_object_new() as the
* final step of the object creation process. At the point of the call, all
* construction properties have been set on the object. The purpose of this
* call is to allow for object initialisation steps that can only be performed
* after construction properties have been set. `constructed` implementors
* should chain up to the `constructed` call of their parent class to allow it
* to complete its initialisation.
*/
vfunc_constructed(): void;
/**
* emits property change notification for a bunch
* of properties. Overriding `dispatch_properties_changed` should be rarely
* needed.
* @param n_pspecs
* @param pspecs
*/
vfunc_dispatch_properties_changed(n_pspecs: number, pspecs: GObject.ParamSpec): void;
/**
* the `dispose` function is supposed to drop all references to other
* objects, but keep the instance otherwise intact, so that client method
* invocations still work. It may be run multiple times (due to reference
* loops). Before returning, `dispose` should chain up to the `dispose` method
* of the parent class.
*/
vfunc_dispose(): void;
/**
* instance finalization function, should finish the finalization of
* the instance begun in `dispose` and chain up to the `finalize` method of the
* parent class.
*/
vfunc_finalize(): void;
/**
* the generic getter for all properties of this type. Should be
* overridden for every type with properties.
* @param property_id
* @param value
* @param pspec
*/
vfunc_get_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Emits a "notify" signal for the property `property_name` on `object`.
*
* When possible, eg. when signaling a property change from within the class
* that registered the property, you should use g_object_notify_by_pspec()
* instead.
*
* Note that emission of the notify signal may be blocked with
* g_object_freeze_notify(). In this case, the signal emissions are queued
* and will be emitted (in reverse order) when g_object_thaw_notify() is
* called.
* @param pspec
*/
vfunc_notify(pspec: GObject.ParamSpec): void;
/**
* the generic setter for all properties of this type. Should be
* overridden for every type with properties. If implementations of
* `set_property` don't emit property change notification explicitly, this will
* be done implicitly by the type system. However, if the notify signal is
* emitted explicitly, the type system will not emit it a second time.
* @param property_id
* @param value
* @param pspec
*/
vfunc_set_property(property_id: number, value: GObject.Value | any, pspec: GObject.ParamSpec): void;
/**
* Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to.
* @param id Handler ID of the handler to be disconnected
*/
disconnect(id: number): void;
/**
* Sets multiple properties of an object at once. The properties argument should be a dictionary mapping property names to values.
* @param properties Object containing the properties to set
*/
set(properties: { [key: string]: any }): void;
/**
* Blocks a handler of an instance so it will not be called during any signal emissions
* @param id Handler ID of the handler to be blocked
*/
block_signal_handler(id: number): void;
/**
* Unblocks a handler so it will be called again during any signal emissions
* @param id Handler ID of the handler to be unblocked
*/
unblock_signal_handler(id: number): void;
/**
* Stops a signal's emission by the given signal name. This will prevent the default handler and any subsequent signal handlers from being invoked.
* @param detailedName Name of the signal to stop emission of
*/
stop_emission_by_name(detailedName: string): void;
}
namespace MediaKeySystemPermissionRequest {
// Signal signatures
interface SignalSignatures extends GObject.Object.SignalSignatures {}
// Constructor properties interface
interface ConstructorProps extends GObject.Object.ConstructorProps, PermissionRequest.ConstructorProps {}
}
/**
* A permission request for using an EME Content Decryption Module.
*
* WebKitMediaKeySystemPermissionRequest represents a request for permission to decide whether
* WebKit should use the given CDM to access protected media when requested through the
* MediaKeySystem API.
*
* When a WebKitMediaKeySystemPermissionRequest is not handled by the user,
* it is denied by default.
*
* When handling this permission request the application may perform additional installation of the
* requested CDM, unless it is already present on the host system.
*/
class MediaKeySystemPermissionRequest extends GObject.Object implements PermissionRequest {
static $gtype: GObject.GType;
/**
* Compile-time signal type information.
*
* This instance property is generated only for TypeScript type checking.
* It is not defined at runtime and should not be accessed in JS code.
* @internal
*/
$signals: MediaKeySystemPermissionRequest.SignalSignatures;
// Constructors
constructor(properties?: Partial, ...args: any[]);
_init(...args: any[]): void;
// Signals
connect(
signal: K,
callback: GObject.SignalCallback,
): number;
connect(signal: string, callback: (...args: any[]) => any): number;
connect_after(
signal: K,
callback: GObject.SignalCallback