update template
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package webextension_polyfill.history;
|
||||
|
||||
typedef AddUrlDetailsType = {
|
||||
/**
|
||||
The URL to add. Must be a valid URL that can be added to history.
|
||||
**/
|
||||
var url : String;
|
||||
/**
|
||||
The title of the page.
|
||||
Optional.
|
||||
**/
|
||||
@:optional
|
||||
var title : String;
|
||||
/**
|
||||
The $(topic:transition-types)[transition type] for this visit from its referrer.
|
||||
Optional.
|
||||
**/
|
||||
@:optional
|
||||
var transition : TransitionType;
|
||||
/**
|
||||
The date when this visit occurred.
|
||||
Optional.
|
||||
**/
|
||||
@:optional
|
||||
var visitTime : webextension_polyfill.extensiontypes.DateType;
|
||||
};
|
@@ -0,0 +1,12 @@
|
||||
package webextension_polyfill.history;
|
||||
|
||||
typedef DeleteRangeRangeType = {
|
||||
/**
|
||||
Items added to history after this date.
|
||||
**/
|
||||
var startTime : webextension_polyfill.extensiontypes.DateType;
|
||||
/**
|
||||
Items added to history before this date.
|
||||
**/
|
||||
var endTime : webextension_polyfill.extensiontypes.DateType;
|
||||
};
|
@@ -0,0 +1,8 @@
|
||||
package webextension_polyfill.history;
|
||||
|
||||
typedef DeleteUrlDetailsType = {
|
||||
/**
|
||||
The URL to remove.
|
||||
**/
|
||||
var url : String;
|
||||
};
|
@@ -0,0 +1,8 @@
|
||||
package webextension_polyfill.history;
|
||||
|
||||
typedef GetVisitsDetailsType = {
|
||||
/**
|
||||
The URL for which to retrieve visit information. It must be in the format as returned from a call to history.search.
|
||||
**/
|
||||
var url : String;
|
||||
};
|
@@ -0,0 +1,41 @@
|
||||
package webextension_polyfill.history;
|
||||
|
||||
/**
|
||||
An object encapsulating one result of a history query.
|
||||
**/
|
||||
typedef HistoryItem = {
|
||||
/**
|
||||
The unique identifier for the item.
|
||||
**/
|
||||
var id : String;
|
||||
/**
|
||||
The URL navigated to by a user.
|
||||
Optional.
|
||||
**/
|
||||
@:optional
|
||||
var url : String;
|
||||
/**
|
||||
The title of the page when it was last loaded.
|
||||
Optional.
|
||||
**/
|
||||
@:optional
|
||||
var title : String;
|
||||
/**
|
||||
When this page was last loaded, represented in milliseconds since the epoch.
|
||||
Optional.
|
||||
**/
|
||||
@:optional
|
||||
var lastVisitTime : Float;
|
||||
/**
|
||||
The number of times the user has navigated to this page.
|
||||
Optional.
|
||||
**/
|
||||
@:optional
|
||||
var visitCount : Float;
|
||||
/**
|
||||
The number of times the user has navigated to this page by typing in the address.
|
||||
Optional.
|
||||
**/
|
||||
@:optional
|
||||
var typedCount : Float;
|
||||
};
|
@@ -0,0 +1,12 @@
|
||||
package webextension_polyfill.history;
|
||||
|
||||
typedef OnTitleChangedChangedType = {
|
||||
/**
|
||||
The URL for which the title has changed
|
||||
**/
|
||||
var url : String;
|
||||
/**
|
||||
The new title for the URL.
|
||||
**/
|
||||
var title : String;
|
||||
};
|
@@ -0,0 +1,9 @@
|
||||
package webextension_polyfill.history;
|
||||
|
||||
typedef OnVisitRemovedRemovedType = {
|
||||
/**
|
||||
True if all history was removed. If true, then urls will be empty.
|
||||
**/
|
||||
var allHistory : Bool;
|
||||
var urls : Array<String>;
|
||||
};
|
@@ -0,0 +1,26 @@
|
||||
package webextension_polyfill.history;
|
||||
|
||||
typedef SearchQueryType = {
|
||||
/**
|
||||
A free-text query to the history service. Leave empty to retrieve all pages.
|
||||
**/
|
||||
var text : String;
|
||||
/**
|
||||
Limit results to those visited after this date. If not specified, this defaults to 24 hours in the past.
|
||||
Optional.
|
||||
**/
|
||||
@:optional
|
||||
var startTime : webextension_polyfill.extensiontypes.DateType;
|
||||
/**
|
||||
Limit results to those visited before this date.
|
||||
Optional.
|
||||
**/
|
||||
@:optional
|
||||
var endTime : webextension_polyfill.extensiontypes.DateType;
|
||||
/**
|
||||
The maximum number of results to retrieve. Defaults to 100.
|
||||
Optional.
|
||||
**/
|
||||
@:optional
|
||||
var maxResults : Float;
|
||||
};
|
43
template/externs/webextension_polyfill/history/Static.hx
Normal file
43
template/externs/webextension_polyfill/history/Static.hx
Normal file
@@ -0,0 +1,43 @@
|
||||
package webextension_polyfill.history;
|
||||
|
||||
typedef Static = {
|
||||
/**
|
||||
Searches the history for the last visit time of each page matching the query.
|
||||
**/
|
||||
function search(query:SearchQueryType):js.lib.Promise<Array<HistoryItem>>;
|
||||
/**
|
||||
Retrieves information about visits to a URL.
|
||||
**/
|
||||
function getVisits(details:GetVisitsDetailsType):js.lib.Promise<Array<VisitItem>>;
|
||||
/**
|
||||
Adds a URL to the history with a default visitTime of the current time and a default $(topic:transition-types)
|
||||
[transition type] of "link".
|
||||
**/
|
||||
function addUrl(details:AddUrlDetailsType):js.lib.Promise<ts.Undefined>;
|
||||
/**
|
||||
Removes all occurrences of the given URL from the history.
|
||||
**/
|
||||
function deleteUrl(details:DeleteUrlDetailsType):js.lib.Promise<ts.Undefined>;
|
||||
/**
|
||||
Removes all items within the specified date range from the history. Pages will not be removed from the history unless
|
||||
all visits fall within the range.
|
||||
**/
|
||||
function deleteRange(range:DeleteRangeRangeType):js.lib.Promise<ts.Undefined>;
|
||||
/**
|
||||
Deletes all items from the history.
|
||||
**/
|
||||
function deleteAll():js.lib.Promise<ts.Undefined>;
|
||||
/**
|
||||
Fired when a URL is visited, providing the HistoryItem data for that URL. This event fires before the page has loaded.
|
||||
**/
|
||||
var onVisited : webextension_polyfill.events.Event<(result:HistoryItem) -> Void>;
|
||||
/**
|
||||
Fired when one or more URLs are removed from the history service. When all visits have been removed the URL is purged
|
||||
from history.
|
||||
**/
|
||||
var onVisitRemoved : webextension_polyfill.events.Event<(removed:OnVisitRemovedRemovedType) -> Void>;
|
||||
/**
|
||||
Fired when the title of a URL is changed in the browser history.
|
||||
**/
|
||||
var onTitleChanged : webextension_polyfill.events.Event<(changed:OnTitleChangedChangedType) -> Void>;
|
||||
};
|
@@ -0,0 +1,6 @@
|
||||
package webextension_polyfill.history;
|
||||
|
||||
/**
|
||||
The $(topic:transition-types)[transition type] for this visit from its referrer.
|
||||
**/
|
||||
typedef TransitionType = String;
|
29
template/externs/webextension_polyfill/history/VisitItem.hx
Normal file
29
template/externs/webextension_polyfill/history/VisitItem.hx
Normal file
@@ -0,0 +1,29 @@
|
||||
package webextension_polyfill.history;
|
||||
|
||||
/**
|
||||
An object encapsulating one visit to a URL.
|
||||
**/
|
||||
typedef VisitItem = {
|
||||
/**
|
||||
The unique identifier for the item.
|
||||
**/
|
||||
var id : String;
|
||||
/**
|
||||
The unique identifier for this visit.
|
||||
**/
|
||||
var visitId : String;
|
||||
/**
|
||||
When this visit occurred, represented in milliseconds since the epoch.
|
||||
Optional.
|
||||
**/
|
||||
@:optional
|
||||
var visitTime : Float;
|
||||
/**
|
||||
The visit ID of the referrer.
|
||||
**/
|
||||
var referringVisitId : String;
|
||||
/**
|
||||
The $(topic:transition-types)[transition type] for this visit from its referrer.
|
||||
**/
|
||||
var transition : TransitionType;
|
||||
};
|
Reference in New Issue
Block a user