add firefox extension template

This commit is contained in:
2025-08-07 16:03:16 -05:00
parent 6cbb29fed1
commit 5df289ffcb
586 changed files with 13636 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
package webextension_polyfill.search;
/**
Location where search results should be displayed.
**/
typedef Disposition = String;

View File

@@ -0,0 +1,20 @@
package webextension_polyfill.search;
typedef QueryQueryInfoType = {
/**
String to query with the default search provider.
**/
var text : String;
/**
Location where search results should be displayed. CURRENT_TAB is the default.
Optional.
**/
@:optional
var disposition : Disposition;
/**
Location where search results should be displayed. tabId cannot be used with disposition.
Optional.
**/
@:optional
var tabId : Float;
};

View File

@@ -0,0 +1,19 @@
package webextension_polyfill.search;
/**
An object encapsulating a search engine
**/
typedef SearchEngine = {
var name : String;
var isDefault : Bool;
/**
Optional.
**/
@:optional
var alias : String;
/**
Optional.
**/
@:optional
var favIconUrl : String;
};

View File

@@ -0,0 +1,27 @@
package webextension_polyfill.search;
typedef SearchSearchPropertiesType = {
/**
Terms to search for.
**/
var query : String;
/**
Search engine to use. Uses the default if not specified.
Optional.
**/
@:optional
var engine : String;
/**
Location where search results should be displayed. NEW_TAB is the default.
Optional.
**/
@:optional
var disposition : Disposition;
/**
The ID of the tab for the search results. If not specified, a new tab is created, unless disposition is set.
tabId cannot be used with disposition.
Optional.
**/
@:optional
var tabId : Float;
};

View File

@@ -0,0 +1,16 @@
package webextension_polyfill.search;
typedef Static = {
/**
Gets a list of search engines.
**/
function get():js.lib.Promise<Array<SearchEngine>>;
/**
Perform a search.
**/
function search(searchProperties:SearchSearchPropertiesType):Void;
/**
Use the chrome.search API to search via the default provider.
**/
function query(queryInfo:QueryQueryInfoType):js.lib.Promise<ts.Undefined>;
};