forked from Gr3q/types-gjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
105 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
declare namespace imports { | ||
|
||
export const byteArray: ByteArray; | ||
class ByteArray { | ||
/** | ||
* Converts the Uint8Array into a literal string. The bytes are interpreted according to the given encoding (or UTF-8 if not given). | ||
The resulting string is guaranteed to round-trip back into an identical ByteArray by passing the result to ByteArray.fromString(), i.e., `b === ByteArray.fromString(ByteArray.toString(b, encoding), encoding)`. | ||
* @param array | ||
* @param encoding | ||
*/ | ||
toString(array: Uint8Array, encoding?: string): string; | ||
/** | ||
* Convert a GLib.Bytes instance into a newly constructed Uint8Array. The contents are copied. | ||
* @param text | ||
*/ | ||
fromGBytes(text: gi.GLib.Bytes): Uint8Array; | ||
/** | ||
* Convert a String into a newly constructed Uint8Array; this creates a new Uint8Array of the same length as the String, then assigns each Uint8Array entry the corresponding byte value of the String encoded according to the given encoding (or UTF-8 if not given). | ||
* @param text | ||
* @param encoding | ||
*/ | ||
fromString(text: string, encoding?: string): Uint8Array; | ||
/** Converts the Uint8Array into a GLib.Bytes instance. The contents are copied. */ | ||
toGBytes(array: Uint8Array): gi.GLib.Bytes; | ||
fromArray(array: Uint8Array): any; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
declare namespace imports.gi.WebKit2 { | ||
|
||
interface WebView extends gi.Gtk.Container { | ||
|
||
connect(event: 'load-changed', callback: (actor: this, event: LoadEvent) => void): number | ||
|
||
/** | ||
* Requests loading of the specified URI string. | ||
* You can monitor the load operation by connecting to | ||
* WebKit2.WebView.load-changed signal. | ||
* | ||
* @param uri an URI string | ||
*/ | ||
load_uri(uri: string): void | ||
|
||
|
||
/** | ||
* The current active URI of the WebKit2.WebView. | ||
* See WebKit2.WebView.get_uri for more details. | ||
*/ | ||
readonly uri: string | ||
|
||
} | ||
|
||
class WebView { | ||
constructor() | ||
} | ||
|
||
|
||
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 = 0, | ||
/** A provisional data source received a server redirect */ | ||
REDIRECTED = 1, | ||
/** The content started arriving for a page load. | ||
* The necessary transport requirements are established, and the | ||
* load is being performed. */ | ||
COMMITED = 2, | ||
/** Load completed. All resources are done loading | ||
* or there was an error during the load operation. */ | ||
FINISHED = 3 | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters