update template

This commit is contained in:
2025-02-02 18:08:09 -06:00
parent f070c12273
commit a04e2bb9d1
575 changed files with 13430 additions and 55 deletions

View File

@@ -0,0 +1,66 @@
package webextension_polyfill.bookmarks;
/**
A node (either a bookmark or a folder) in the bookmark tree. Child nodes are ordered within their parent folder.
**/
typedef BookmarkTreeNode = {
/**
The unique identifier for the node. IDs are unique within the current profile, and they remain valid even after the
browser is restarted.
**/
var id : String;
/**
The <code>id</code> of the parent folder. Omitted for the root node.
Optional.
**/
@:optional
var parentId : String;
/**
The 0-based position of this node within its parent folder.
Optional.
**/
@:optional
var index : Float;
/**
The URL navigated to when a user clicks the bookmark. Omitted for folders.
Optional.
**/
@:optional
var url : String;
/**
The text displayed for the node.
**/
var title : String;
/**
When this node was created, in milliseconds since the epoch (<code>new Date(dateAdded)</code>).
Optional.
**/
@:optional
var dateAdded : Float;
/**
When the contents of this folder last changed, in milliseconds since the epoch.
Optional.
**/
@:optional
var dateGroupModified : Float;
/**
Indicates the reason why this node is unmodifiable. The <var>managed</var> value indicates that this node was configured
by the system administrator or by the custodian of a supervised user. Omitted if the node can be modified by the user
and the extension (default).
Optional.
**/
@:optional
var unmodifiable : String;
/**
Indicates the type of the BookmarkTreeNode, which can be one of bookmark, folder or separator.
Optional.
**/
@:optional
var type : BookmarkTreeNodeType;
/**
An ordered list of children of this node.
Optional.
**/
@:optional
var children : Array<BookmarkTreeNode>;
};

View File

@@ -0,0 +1,6 @@
package webextension_polyfill.bookmarks;
/**
Indicates the type of a BookmarkTreeNode, which can be one of bookmark, folder or separator.
**/
typedef BookmarkTreeNodeType = String;

View File

@@ -0,0 +1,8 @@
package webextension_polyfill.bookmarks;
/**
Indicates the reason why this node is unmodifiable. The <var>managed</var> value indicates that this node was configured
by the system administrator or by the custodian of a supervised user. Omitted if the node can be modified by the user
and the extension (default).
**/
typedef BookmarkTreeNodeUnmodifiable = String;

View File

@@ -0,0 +1,34 @@
package webextension_polyfill.bookmarks;
/**
Object passed to the create() function.
**/
typedef CreateDetails = {
/**
Defaults to the Other Bookmarks folder.
Optional.
**/
@:optional
var parentId : String;
/**
Optional.
**/
@:optional
var index : Float;
/**
Optional.
**/
@:optional
var title : String;
/**
Optional.
**/
@:optional
var url : String;
/**
Indicates the type of BookmarkTreeNode to create, which can be one of bookmark, folder or separator.
Optional.
**/
@:optional
var type : BookmarkTreeNodeType;
};

View File

@@ -0,0 +1,14 @@
package webextension_polyfill.bookmarks;
typedef MoveDestinationType = {
/**
Optional.
**/
@:optional
var parentId : String;
/**
Optional.
**/
@:optional
var index : Float;
};

View File

@@ -0,0 +1,10 @@
package webextension_polyfill.bookmarks;
typedef OnChangedChangeInfoType = {
var title : String;
/**
Optional.
**/
@:optional
var url : String;
};

View File

@@ -0,0 +1,8 @@
package webextension_polyfill.bookmarks;
typedef OnMovedMoveInfoType = {
var parentId : String;
var index : Float;
var oldParentId : String;
var oldIndex : Float;
};

View File

@@ -0,0 +1,7 @@
package webextension_polyfill.bookmarks;
typedef OnRemovedRemoveInfoType = {
var parentId : String;
var index : Float;
var node : BookmarkTreeNode;
};

View File

@@ -0,0 +1,25 @@
package webextension_polyfill.bookmarks;
/**
An object specifying properties and values to match when searching. Produces bookmarks matching all properties.
**/
typedef SearchQueryC2Type = {
/**
A string of words that are matched against bookmark URLs and titles.
Optional.
**/
@:optional
var query : String;
/**
The URL of the bookmark; matches verbatim. Note that folders have no URL.
Optional.
**/
@:optional
var url : String;
/**
The title of the bookmark; matches verbatim.
Optional.
**/
@:optional
var title : String;
};

View File

@@ -0,0 +1,67 @@
package webextension_polyfill.bookmarks;
typedef Static = {
/**
Retrieves the specified BookmarkTreeNode(s).
**/
function get(idOrIdList:ts.AnyOf2<String, Array<String>>):js.lib.Promise<Array<BookmarkTreeNode>>;
/**
Retrieves the children of the specified BookmarkTreeNode id.
**/
function getChildren(id:String):js.lib.Promise<Array<BookmarkTreeNode>>;
/**
Retrieves the recently added bookmarks.
**/
function getRecent(numberOfItems:Float):js.lib.Promise<Array<BookmarkTreeNode>>;
/**
Retrieves the entire Bookmarks hierarchy.
**/
function getTree():js.lib.Promise<Array<BookmarkTreeNode>>;
/**
Retrieves part of the Bookmarks hierarchy, starting at the specified node.
**/
function getSubTree(id:String):js.lib.Promise<Array<BookmarkTreeNode>>;
/**
Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes
matching all specified properties.
**/
function search(query:ts.AnyOf2<String, SearchQueryC2Type>):js.lib.Promise<Array<BookmarkTreeNode>>;
/**
Creates a bookmark or folder under the specified parentId. If url is NULL or missing, it will be a folder.
**/
function create(bookmark:CreateDetails):js.lib.Promise<BookmarkTreeNode>;
/**
Moves the specified BookmarkTreeNode to the provided location.
**/
function move(id:String, destination:MoveDestinationType):js.lib.Promise<BookmarkTreeNode>;
/**
Updates the properties of a bookmark or folder. Specify only the properties that you want to change; unspecified
properties will be left unchanged. <b>Note:</b> Currently, only 'title' and 'url' are supported.
**/
function update(id:String, changes:UpdateChangesType):js.lib.Promise<BookmarkTreeNode>;
/**
Removes a bookmark or an empty bookmark folder.
**/
function remove(id:String):js.lib.Promise<ts.Undefined>;
/**
Recursively removes a bookmark folder.
**/
function removeTree(id:String):js.lib.Promise<ts.Undefined>;
/**
Fired when a bookmark or folder is created.
**/
var onCreated : webextension_polyfill.events.Event<(id:String, bookmark:BookmarkTreeNode) -> Void>;
/**
Fired when a bookmark or folder is removed. When a folder is removed recursively,
a single notification is fired for the folder, and none for its contents.
**/
var onRemoved : webextension_polyfill.events.Event<(id:String, removeInfo:OnRemovedRemoveInfoType) -> Void>;
/**
Fired when a bookmark or folder changes. <b>Note:</b> Currently, only title and url changes trigger this.
**/
var onChanged : webextension_polyfill.events.Event<(id:String, changeInfo:OnChangedChangeInfoType) -> Void>;
/**
Fired when a bookmark or folder is moved to a different parent folder.
**/
var onMoved : webextension_polyfill.events.Event<(id:String, moveInfo:OnMovedMoveInfoType) -> Void>;
};

View File

@@ -0,0 +1,14 @@
package webextension_polyfill.bookmarks;
typedef UpdateChangesType = {
/**
Optional.
**/
@:optional
var title : String;
/**
Optional.
**/
@:optional
var url : String;
};