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,43 @@
package webextension_polyfill.find;
/**
Search parameters.
**/
typedef FindParamsType = {
/**
Tab to query. Defaults to the active tab.
Optional.
**/
@:optional
var tabId : Float;
/**
Find only ranges with case sensitive match.
Optional.
**/
@:optional
var caseSensitive : Bool;
/**
Find only ranges with diacritic sensitive match.
Optional.
**/
@:optional
var matchDiacritics : Bool;
/**
Find only ranges that match entire word.
Optional.
**/
@:optional
var entireWord : Bool;
/**
Return rectangle data which describes visual position of search results.
Optional.
**/
@:optional
var includeRectData : Bool;
/**
Return range data which provides range data in a serializable form.
Optional.
**/
@:optional
var includeRangeData : Bool;
};

View File

@@ -0,0 +1,26 @@
package webextension_polyfill.find;
typedef FindResult = {
/**
The number of results found.
**/
var count : Float;
/**
If includeRangeData was given in the options parameter, then this property will be included.
It is provided as an array of RangeData objects, one for each match. Each RangeData object describes where in the DOM
tree the match was found. This would enable, for example, an extension to get the text surrounding each match,
so as to display context for the matches. The items correspond to the items given in rectData, so rangeData[i]
describes the same match as rectData[i].
Optional.
**/
@:optional
var rangeData : Array<RangeData>;
/**
If includeRectData was given in the options parameter, then this property will be included.
It is an array of RectData objects. It contains client rectangles for all the text matched in the search,
relative to the top-left of the viewport. Extensions can use this to provide custom highlighting of the results.
Optional.
**/
@:optional
var rectData : Array<RectData>;
};

View File

@@ -0,0 +1,25 @@
package webextension_polyfill.find;
/**
highlightResults parameters
**/
typedef HighlightResultsParamsType = {
/**
Found range to be highlighted. Default highlights all ranges.
Optional.
**/
@:optional
var rangeIndex : Float;
/**
Tab to highlight. Defaults to the active tab.
Optional.
**/
@:optional
var tabId : Float;
/**
Don't scroll to highlighted item.
Optional.
**/
@:optional
var noScroll : Bool;
};

View File

@@ -0,0 +1,28 @@
package webextension_polyfill.find;
typedef RangeData = {
/**
The index of the frame containing the match. 0 corresponds to the parent window. Note that the order of objects in the
rangeData array will sequentially line up with the order of frame indexes: for example,
framePos for the first sequence of rangeData objects will be 0, framePos for the next sequence will be 1, and so on.
**/
var framePos : Float;
/**
The ordinal position of the text node in which the match started.
**/
var startTextNodePos : Float;
/**
The ordinal position of the text node in which the match ended.
**/
var endTextNodePos : Float;
/**
The ordinal string position of the start of the matched word within start text node.
If match word include in single text node, Extension can get match word between startOffset and endOffset string index
in the single text node.
**/
var startOffset : Float;
/**
The ordinal string position of the end of the matched word within end text node.
**/
var endOffset : Float;
};

View File

@@ -0,0 +1,14 @@
package webextension_polyfill.find;
typedef RectData = {
/**
The index of the frame containing the match. 0 corresponds to the parent window. Note that the order of objects in the
rangeData array will sequentially line up with the order of frame indexes: for example,
framePos for the first sequence of rangeData objects will be 0, framePos for the next sequence will be 1, and so on.
**/
var rectsAndTexts : RectsAndTexts;
/**
The complete text of the match.
**/
var text : String;
};

View File

@@ -0,0 +1,20 @@
package webextension_polyfill.find;
typedef Rectangle = {
/**
Pixels from the top.
**/
var top : Float;
/**
Pixels from the left.
**/
var left : Float;
/**
Pixels from the bottom.
**/
var bottom : Float;
/**
Pixels from the right.
**/
var right : Float;
};

View File

@@ -0,0 +1,13 @@
package webextension_polyfill.find;
typedef RectsAndTexts = {
/**
Rectangles relative to the top-left of the viewport.
**/
var rectList : Array<Rectangle>;
/**
an array of strings, corresponding to the rectList array. The entry at textList[i]
contains the part of the match bounded by the rectangle at rectList[i].
**/
var textList : Array<String>;
};

View File

@@ -0,0 +1,16 @@
package webextension_polyfill.find;
typedef Static = {
/**
Search for text in document and store found ranges in array, in document order.
**/
function find(queryphrase:String, ?params:FindParamsType):js.lib.Promise<FindResult>;
/**
Highlight a range
**/
function highlightResults(?params:HighlightResultsParamsType):js.lib.Promise<ts.Undefined>;
/**
Remove all highlighting from previous searches.
**/
function removeHighlighting(?tabId:Float):js.lib.Promise<ts.Undefined>;
};