DefinitelyTyped/types/k6/html.d.ts
bookmoons 518db0303d [k6] Add type documentation (#37056)
* k6: Document fail

* k6: Remove docs link

Complete docs are included in the doc comment.

* k6: Document group

* k6: Document sleep

* k6: Order signature docs before remarks

Renders more usefully in Visual Studio Code.

* k6: Document check

* k6: Space documented declarations

* k6: Space section headers

* k6: Document method releases

* k6: Simplify check documentation

* k6: Simplify fail documentation

* k6: Simplify group documentation

* k6: Document package

* k6: Compress documentation

* k6: Document Checker

* k6: Document Checkers

* k6: Link to check docs

* k6: Link to fail docs

* k6: Link to group docs

* k6: Link to sleep docs

* k6: Correct returns tag

* k6: Document check type param

* k6: Document group return type

* k6: Document byte

* k6: Document bytes

* k6: Document JSON types

* k6: Configure API Extractor

Enables validating docs with:
mkdir -p etc; api-extractor run -c api-extractor.json -l

* k6: Ignore docs build

* k6: Document doc comment validation

* k6: Disable API report generation

* k6: Disable doc model generation

* k6: Disable .d.ts rollup generation

* k6: Disable TSDoc metadata generation

* k6: Document typeParam tag warnings

* k6/global: Document module

* k6/global: Normalize section comments

* k6/global: Document open

* k6/global: Document __ENV

* k6/global: Refine __ENV type

* k6/global: Document __VU

* k6/global: Document __ITER

* k6/global: Document console

* k6/global: Normalize VU logic references

* k6: Improve section header visibility

* k6/crypto: Document module

* k6/crypto: Document randomBytes

* k6/crypto: Document hmac

* k6/crypto: Document md4

* k6/crypto: Document md5

* k6/crypto: Document sha1

* k6/crypto: Document sha256

* k6/crypto: Document sha384

* k6/crypto: Document sha512

* k6/crypto: Document sha512_224

* k6/crypto: Document sha512_256

* k6/crypto: Document ripemd160

* k6/crypto: Document createHash

* k6/crypto: Document createHMAC

* k6/crypto: Link to createHash docs

* k6/crypto: Document Algorithm

* k6/crypto: Document StringEncoding

* k6/crypto: Document BinaryEncoding

* k6/crypto: Document OutputEncoding

* k6/crypto: Document Output

* k6/crypto: Document Hasher

* k6/crypto: Document Hasher#update

* k6/crypto: Document Hasher#digest

* k6/crypto: Update formatting

Repo formatter really wants it this way.

* k6/encoding: Document module

* k6/encoding: Document b64encode

* k6/encoding: Document b64decode

* k6/encoding: Document Base64Variant

* k6/html: Document module

* k6/html: Document parseHTML

* k6/html: Add section headers

* k6/html: Document Selection

* k6: Disable redundant JSDoc check

Incorrectly applies to our TSDoc doc comments.

* k6/global: Add missing semicolon

* k6/global: Correct test

* k6/html: Update tests

* k6/html: Accept overloads for documentation

The overloads in these cases produce more natural IntelliSense
rendering of the documentation.

* k6/html: Document FormValue

* k6/html: Document Tester

* k6/html: Document Handler

* k6/html: Document Mapper

* k6/html: Qualify FormValue description

* k6/html: Normalize section header language

* k6/html: Document Attribute

* k6/html: Document NodeType

* k6/html: Document Element

* k6/html: Document AnchorElement

* k6/html: Document AreaElement

* k6/html: Link to Element docs

* k6/html: Document AudioElement

* k6/html: Document BaseElement

* k6/html: Document ButtonElement

* k6/html: Document CanvasElement

* k6/html: Document DataElement

* k6/html: Document DataListElement

* k6/html: Document DelElement

* k6/html: Document EmbedElement

* k6/html: Document FieldSetElement

* k6/html: Document FormElement

* k6/html: Document FormFieldElement

* k6/html: Document HrefElement

* k6/html: Document IFrameElement

* k6/html: Document ImageElement

* k6/html: Document InputElement

* k6/html: Document InsElement

* k6/html: Document KeygenElement

* k6/html: Document LabelElement

* k6/html: Document LegendElement

* k6/html: Document LiElement

* k6/html: Document LinkElement

* k6/html: Document MapElement

* k6/html: Document MediaElement

* k6/html: Document MetaElement

* k6/html: Document MeterElement

* k6/html: Document ModElement

* k6/html: Document ObjectElement

* k6/html: Document OListElement

* k6/html: Document OptGroupElement

* k6/html: Document OptionElement

* k6/html: Document OutputElement

* k6/html: Document ParamElement

* k6/html: Document PreElement

* k6/html: Document ProgressElement

* k6/html: QuoteElement

* k6/html: Document ScriptElement

* k6/html: Document SelectElement

* k6/html: Document SourceElement

* k6/html: Document StyleElement

* k6/html: Document TableBodyElement

* k6/html: Document TableCellElement

* k6/html: Document TableColElement

* k6/html: Document TableDataCellElement

* k6/html: Document TableElement

* k6/html: Document TableFootElement

* k6/html: Document TableHeadElement

* k6/html: Document TableHeaderCellElement

* k6/html: Document TableRowElement

* k6/html: Document TableSectionElement

* k6/html: Document TextAreaElement

* k6/html: Document TimeElement

* k6/html: Document TitleElement

* k6/html: Document TrackElement

* k6/html: Correct MediaElement#textTracks return type

* k6/html: Document UListElement

* k6/html: Document VideoElement

* k6/html: Update HrefElement test

* k6/http: Document module

* k6/http: Add section headers

* k6/http: Normalize refined params type name

* k6/http: Normalize refined batch request type names

* k6/http: Remove generics justification

* k6/http: Document del

* k6/http: Document get

* k6/http: Document options

* k6/http: Document patch

* k6/http: Document post

* k6/http: Document put

* k6/http: Document request

* k6/http: Document batch

* k6/http: Document file

* k6/http: Document cookieJar

* k6/http: Include release tags

* k6/http: Document Params

* k6/http: Document RefinedParams

* k6/http: Document AuthMethod

* k6/http: Document ResponseType

* k6/http: Document ParamsCookieValue

* k6/http: Document RequestBody

* k6/http: Document StructuredRequestBody

* k6/http: Document batch request types

* k6/http: Document refined batch request types

* k6/http: Document BatchResponses

* k6/http: Document Response properties

* k6/http: Document Response.html

* k6/http: Document Response.json

* k6/http: Document Response.clickLink

* k6/http: Document Response.submitForm

* k6/http: Define SSL/TLS version constants

* k6/http: Define OCSP status constants

* k6/http: Document OCSP reason constants

* k6/http: Define CipherSuite

* k6/http: Document Protocol

* k6/http: Document CipherSuite

* k6/http: Document RefinedResponse

* k6/http: Document ResponseBody

* k6/http: Document RefinedResponseBody

* k6/http: Document RequestCookie

* k6/http: Document ResponseCookie

* k6/http: Correct Unix time specifications

* k6/http: Document FileData

* k6/http: Accept formatter changes

* k6/http: Link to FileData docs

* k6/http: Accept formatter changes

* k6/http: Document CookieJar

* k6/http: Document CookieJarCookies

* k6/http: CookieOptions

* k6/metrics: Document module

* k6/metrics: Document Metric

* k6/metrics: Document Counter

* k6/metrics: Document Gauge

* k6/metrics: Document Rate

* k6/metrics: Document Trend

* k6/ws: Document module

* k6/ws: Add section headers

* k6/ws: Document connect

* k6/ws: Document Params

* k6/ws: Document Executor

* k6/ws: Document Response

* k6/ws: Document Socket

* k6/ws: Document EventType

* k6/ws: Document TimerHandler

* k6/ws: Document event handlers

* k6/ws: Document WebSocketError

* k6/options: Document module

* k6/options: Document Options

* k6/options: Document CollectorOptions

* k6/options: Document Stage

* k6/options: Document threshold specifications

* k6/options: Document Certificate

* k6: Remove API Extractor config

No obvious way to get the repo test to accept it.
To be restored when an approach is discovered.
2019-07-22 17:29:26 -07:00

1390 lines
32 KiB
TypeScript

/*
* HTML parsing and access.
* https://docs.k6.io/docs/k6html
*/
// === Main ===
// ------------
/**
* Parse an HTML string.
* @param html - HTML source.
* @returns Document node object.
* @public
*/
export function parseHTML(html: string): Selection;
// === Selection ===
// -----------------
/**
* Represents a set of nodes in a DOM tree.
* https://docs.k6.io/docs/selection-k6html
* @public
*/
export abstract class Selection {
protected __brand: never;
/**
* Get the value of an attribute for the first element in the Selection.
* https://docs.k6.io/docs/selectionattrname
* @param name - Name of attribute to get.
* @returns Attribute value.
*/
attr(name: string): string | undefined;
/**
* Get the children of each element in the set of matched elements,
* optionally filtered by a selector.
* https://docs.k6.io/docs/selectionchildrenselector
* @param selector - Selector expression.
* @returns Selected children.
*/
children(selector?: string): Selection;
/**
* For each element in the set, get the first element that matches the
* selector by testing the element itself and traversing up through its
* ancestors in the DOM tree.
* https://docs.k6.io/docs/selectionclosestselector
* @param selector - Selector expression.
* @returns Selected nodes.
*/
closest(selector: string): Selection;
/**
* Get the children of each element in the set of matched elements,
* including text and comment nodes.
* https://docs.k6.io/docs/selectioncontents
* @returns Selected nodes.
*/
contents(): Selection;
/**
* Return the value at the named data store for the first element in the
* set of matched elements.
* https://docs.k6.io/docs/selectiondatakey
* @param key - A string naming the piece of data to set.\
* @returns The value at the named data store.
*/
data(key?: string): string | undefined;
/**
* Iterate over a Selection (k6/html), executing a function for each
* matched element.
* https://docs.k6.io/docs/selectioneachfn
* @param handler - Logic to execute for each element.
*/
each(handler: Handler): void;
/**
* Reduce the set of matched elements to the one at the specified index.
* https://docs.k6.io/docs/selectioneqindex
* @param index - An integer indicating the 0-based position of the element.
* @returns Unary set of selected element.
*/
eq(index: number): Selection;
/**
* Reduce the set of matched elements to those that match the selector
* or pass the function's test.
* https://docs.k6.io/docs/selectionfilterfn
* @param selector - Selector expression.
* @returns Selected elements.
*/
filter(selector: string): Selection; // tslint:disable:unified-signatures
/**
* Reduce the set of matched elements to those that match the selector
* or pass the function's test.
* https://docs.k6.io/docs/selectionfilterfn
* @param selector - A function used as a test for each element in the set.
* @returns Selected elements.
*/
filter(selector: Tester): Selection; // tslint:disable:unified-signatures
/**
* Reduce the set of matched elements to those that match the selector
* or pass the function's test.
* https://docs.k6.io/docs/selectionfilterfn
* @param selector - A selection to match elements against.
* @returns Selected elements.
*/
filter(selector: Selection): Selection; // tslint:disable:unified-signatures
/**
* Find the selection descendants, filtered by a selector.
* https://docs.k6.io/docs/selectionfindselector
* @param selector - Selector expression.
* @returns Selected elements.
*/
find(selector: string): Selection;
/**
* Reduce the set of matched elements to the first.
* https://docs.k6.io/docs/selectionfirst
* @returns Unary set of first element.
*/
first(): Selection;
/**
* Retrieve the element matched by the selector.
* https://docs.k6.io/docs/selectiongetindex
* @param index - A zero-based integer indicating which element to retrieve.
* @returns Selected element.
*/
get(index: number): Element;
/**
* Reduce the set of matched elements to those that have a descendant that
* matches the selector.
* https://docs.k6.io/docs/selectionhasselector
* @param selector - Selector expression.
* @returns Selected elements.
*/
has(selector: string): Selection;
/**
* Get the HTML contents of the first element.
* https://docs.k6.io/docs/selectionhtml
* @returns The HTML content of the first element.
*/
html(): string | undefined;
/**
* Check the current matched set of elements against a selector or element
* and return true if at least one of these elements matches the given
* arguments.
* https://docs.k6.io/docs/selectionisselector
* @param selector - Selector expression.
* @returns Whether selector matched at least one element.
*/
is(selector: string): boolean; // tslint:disable:unified-signatures
/**
* Check the current matched set of elements against a selector or element
* and return true if at least one of these elements matches the given
* arguments.
* https://docs.k6.io/docs/selectionisselector
* @param selector - A function used as a test for each element in the set.
* @returns Whether selector matched at least one element.
*/
is(selector: Tester): boolean; // tslint:disable:unified-signatures
/**
* Check the current matched set of elements against a selector or element
* and return true if at least one of these elements matches the given
* arguments.
* https://docs.k6.io/docs/selectionisselector
* @param selector - A selection to match against.
* @returns Whether selector matched at least one element.
*/
is(selector: Selection): boolean; // tslint:disable:unified-signatures
/**
* Reduce the set of matched elements to the final one.
* https://docs.k6.io/docs/selectionlast
* @returns Unary set of last element.
*/
last(): Selection;
/**
* Pass each element in the current matched set through a function,
* producing a new Array containing the return values.
* https://docs.k6.io/docs/selectionmapfn
* @param mapper - Procedure to execute on each element.
* @returns Mapper return values.
*/
map(mapper: Mapper): unknown[];
/**
* Get the immediately following sibling of each element.
* https://docs.k6.io/docs/selectionnext
* @param selector - Selector expression.
* @returns Selected elements.
*/
next(selector?: string): Selection;
/**
* Get all following siblings of each element,
* optionally filtered by a selector.
* https://docs.k6.io/docs/selectionnextallselector
* @param selector - Selector expression.
* @returns Selected elements.
*/
nextAll(selector?: string): Selection;
/**
* Get all following siblings of each element up to but not including the
* element matched by the selector.
* https://docs.k6.io/docs/selectionnextuntilselector
* @param selector - Selector expression.
* @returns Selected elements.
*/
nextUntil(selector?: string): Selection;
/**
* Remove elements.
* https://docs.k6.io/docs/selectionnotselector
* @param selector - Selector expression.
* @returns Selection with matched elements removed.
*/
not(selector: string): Selection; // tslint:disable:unified-signatures
/**
* Remove elements.
* https://docs.k6.io/docs/selectionnotselector
* @param selector - A function used as a test for each element in the set.
* @returns Selection with matched elements removed.
*/
not(selector: Tester): Selection; // tslint:disable:unified-signatures
/**
* Get the parent of each element, optionally filtered by a selector.
* https://docs.k6.io/docs/selectionparentselector
* @param selector - Selector expression.
* @returns Selected elements.
*/
parent(selector?: string): Selection;
/**
* Get the ancestors of each element, optionally filtered by a selector.
* https://docs.k6.io/docs/selectionparentsselector
* @param selector - Selector expression.
* @returns Selected elements.
*/
parents(selector?: string): Selection;
/**
* Get the ancestors of each element,
* up to but not including the element matched by the selector.
* https://docs.k6.io/docs/selectionparentsuntilselector
* @param selector - Selector expression.
* @returns Selected elements.
*/
parentsUntil(selector?: string): Selection;
/**
* Get the immediately preceding sibling of each element.
* https://docs.k6.io/docs/selectionprevselector
* @param selector - Selector expression.
* @returns Selected elements.
*/
prev(selector?: string): Selection;
/**
* Get all preceding siblings of each element,
* optionally filtered by a selector.
* https://docs.k6.io/docs/selectionprevallselector
* @param selector - Selector expression.
* @returns Selected elements.
*/
prevAll(selector?: string): Selection;
/**
* Get all preceding siblings of each element
* up to but not including the element matched by the selector.
* https://docs.k6.io/docs/selectionprevuntilselector
* @param selector - Selector expression.
* @returns Selected elements.
*/
prevUntil(selector?: string): Selection;
/**
* Encode a set of form elements as a string
* in standard URL-encoded notation for submission.
* https://docs.k6.io/docs/selectionserialize
* @returns URL-encoded representation of the form or form elements.
*/
serialize(): string;
/**
* Encode a set of form elements as an array of name-value objects.
* `[{ name: "name", value: "value" }, ... ]`
* https://docs.k6.io/docs/selectionserializearray
* @returns Array of name value objects of the form or form elements.
*/
serializeArray(): FormValue[];
/**
* Encode a set of form elements as an object.
* `{ inputName: "value", checkboxName: "value", ... }`
* https://docs.k6.io/docs/selectionserializeobject
* @returns Object representation of the form or form elements,
* key is field name and value is field value.
*/
serializeObject(): { [name: string]: string };
/**
* Return the number of elements in the selection.
* https://docs.k6.io/docs/selectionsize
* @returns The number of elements in the selection.
*/
size(): number;
/**
* Reduce the set of elements to a subset specified by a range of indices.
* https://docs.k6.io/docs/selectionslicestart-end
* @param start - An integer indicating the 0-based position at which the
* elements begin to be selected.
* @param end - An integer indicating the 0-based position at which the
* elements stop being selected.
* @returns Selected elements.
*/
slice(start: number, end?: number): Selection;
/**
* Get the text content of the selection.
* @returns Text content.
*/
text(): string;
/**
* Retrieve all the elements contained in the selection as an array.
* https://docs.k6.io/docs/selectiontoarray
* @returns A unary selection of each element.
*/
toArray(): Selection[];
/**
* Get the current value of the first element.
* @returns The value of the first element.
*/
val(): string | undefined;
}
/**
* Form field value.
* @public
*/
export interface FormValue {
/** Field name. */
name: string;
/** Field value. */
value: string;
}
/**
* Test procedure.
* @public
*/
export interface Tester {
/**
* @param index - Current index.
* @param element - Current element.
* @returns Whether element passes test.
*/
(index: number, element: Element): boolean;
}
/**
* Handle procedure.
* @public
*/
export interface Handler {
/**
* @param index - Current index.
* @param element - Current element.
*/
(index: number, element: Element): void;
}
/**
* Map procedure.
* @public
*/
export interface Mapper {
/**
* @param index - Current index.
* @param element - Current element.
* @returns Value element maps to.
*/
(index: number, element: Element): unknown;
}
// === Attribute ===
// -----------------
/**
* HTML attribute.
* @public
*/
export abstract class Attribute {
protected __brand: never;
/** Name. */
name: string;
/** Owning element. */
ownerElement: Element;
/** Value. */
value: string;
/** Local part of qualified name. */
localName(): string;
/** Namespace URI. */
namespaceURI(): string;
/** Namespace prefix. */
prefix(): string;
}
// === Node type ===
// -----------------
/**
* Node type.
* @public
*/
export enum NodeType {
ElementNode = 1,
TextNode = 3,
CommentNode = 8,
DocumentNode = 9,
DoctypeNode = 10,
}
// === Element ===
// ---------------
/**
* HTML node.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class Element {
protected __brand: never;
/** Dictionary of element attributes. */
attributes(): { [name: string]: Attribute };
/** Count of child elements. */
childElementCount(): number;
/** Child nodes. */
childNodes(): Element[];
/** Child elements. */
children(): Element[];
/** Class names. */
classList(): string[];
/**
* Class value.
* @returns Single string with all class names.
*/
className(): string | undefined;
/**
* Check whether contains element.
* @param element - Possibly contained element.
* @returns Whether contains element. Self containment returns `true`.
*/
contains(element: Element): boolean;
/** First child node. */
firstChild(): Element | undefined;
/** First child element. */
firstElementChild(): Element | undefined;
/**
* Get attribute value.
* @param name - Attribute name.
* @returns Attribute value.
*/
getAttribute(name: string): string | undefined;
/**
* Get attribute node.
* @param name - Attribute name.
* @returns Attribute node.
*/
getAttributeNode(name: string): Attribute | undefined;
/**
* Get descendant elements in class.
* @param name - Class name.
* @return Descendant elements in class.
*/
getElementsByClassName(name: string): Element[];
/**
* Get descendant elements with tag name.
* @param name - Tag name.
* @return Descendant elements with tag name.
*/
getElementsByTagName(name: string): Element[];
/**
* Check whether has attribute.
* @param name - Attribute name.
* @returns Whether has attribute.
*/
hasAttribute(name: string): boolean;
/** Whether has any attributes. */
hasAttributes(): boolean;
/** Whether has any child nodes. */
hasChildNodes(): boolean;
/** Identifier value. */
id(): string;
/** Inner HTML. Markup of content. */
innerHTML(): string | undefined;
/** Whether has the default namespace. */
isDefaultNamespace(): boolean;
/**
* Check whether node is equal.
* @param node - Node to check.
* @returns Whether node has equal HTML representation.
*/
isEqualNode(node: Element): boolean;
/**
* Check whether node is identical.
* @param node - Node to check.
* @returns Whether node is self.
*/
isSameNode(node: Element): boolean;
/** Value of `lang` attribute. */
lang(): string | undefined;
/** Last child node. */
lastChild(): Element | undefined;
/** Last child element. */
lastElementChild(): Element | undefined;
/**
* Check whether matches selector.
* @param selector - Selector expression.
* @returns Whether matches selector.
*/
matches(selector: string): boolean;
/** Namespace URI. */
namespaceURI(): string;
/** Next sibling element. */
nextElementSibling(): Element | undefined;
/** Next sibling node. */
nextSibling(): Element | undefined;
/** Node name. */
nodeName(): string;
/** Node type. */
nodeType(): NodeType | undefined;
/** Node value. */
nodeValue(): string | undefined;
/** Owning document node. */
ownerDocument(): Element | undefined;
/** Parent element. */
parentElement(): Element | undefined;
/** Parent node. */
parentNode(): Element | undefined;
/** Previous sibling element. */
previousElementSibling(): Element | undefined;
/** Previous sibling node. */
previousSibling(): Element | undefined;
/**
* Select a single descendant element.
* @param selector - Selector expression.
* @returns First matched element.
*/
querySelector(selector: string): Element | undefined;
/**
* Select descendant elements.
* @param selector - Selector expression.
* @returns All matched elements.
*/
querySelectorAll(selector: string): Element[];
/** Text content. */
textContent(): string;
/** String representation, eg `[object html.Node]`. */
toString(): string;
}
/**
* HTML <a> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class AnchorElement extends HrefElement {
protected __brand: never;
}
/**
* HTML <area> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class AreaElement extends HrefElement {
protected __brand: never;
}
/**
* HTML <audio> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class AudioElement extends MediaElement {
protected __brand: never;
}
/**
* HTML <base> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class BaseElement extends Element {
protected __brand: never;
}
/**
* HTML <button> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class ButtonElement extends FormFieldElement {
protected __brand: never;
/** Value of `value` attribute if exists. Otherwise markup of content. */
value(): string;
}
/**
* HTML <canvas> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class CanvasElement extends Element {
protected __brand: never;
/** Coordinate space height in CSS pixels. */
height(): number;
/** Coordinate space width in CSS pixels. */
width(): number;
}
/**
* HTML <data> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class DataElement extends Element {
protected __brand: never;
}
/**
* HTML <datalist> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class DataListElement extends Element {
protected __brand: never;
/** Contained <option> elements. */
options(): OptionElement[];
}
/**
* HTML <del> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class DelElement extends ModElement {
protected __brand: never;
}
/**
* HTML <embed> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class EmbedElement extends Element {
protected __brand: never;
}
/**
* HTML <fieldset> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class FieldSetElement extends Element {
protected __brand: never;
/** Grouped elements. */
elements(): Element[];
/** Containing <form> element. */
form(): FormElement | undefined;
/** Field set type. Always `fieldset`. */
type(): string;
/** Validity states. Unimplemented. Always `undefined`. */
validity(): undefined;
}
/**
* HTML <form> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class FormElement extends Element {
protected __brand: never;
/** Contained form control elements. */
elements(): Element[];
/** Number of contained form control elements. */
length(): number;
/** Form submission HTTP method. */
method(): string;
}
/**
* HTML form field element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class FormFieldElement extends Element {
protected __brand: never;
/** Owning <form> element. */
form(): FormElement | undefined;
/** Form submission action URI. */
formAction(): string;
/** Form submission encoding. */
formEnctype(): string;
/** Form submission HTTP method. */
formMethod(): string;
/** Whether form submits without validation. */
formNoValidate(): boolean;
/** Form submission response display location. */
formTarget(): string;
/** Associated <label> elements. */
labels(): LabelElement[];
/** Form field name. */
name(): string;
}
/**
* HTML hyperlink element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class HrefElement extends Element {
protected __brand: never;
/** `#` prefixed URL fragment identifier. */
hash(): string;
/** URL hostname plus `:` delimited port if nonempty. `hostname[:port]` */
host(): string;
/** URL hostname. */
hostname(): string;
/** Unicode serialization of URL origin. */
origin(): string;
/** URL password. */
password(): string;
/** `/` prefixed URL path. */
pathname(): string;
/** URL port number. Empty string if unspecified. */
port(): string;
/** `:` suffixed URL protocol scheme. */
protocol(): string;
/** Link types. */
relList(): string[];
/** `?` prefixed URL query string. */
search(): string;
/** Text content. */
text(): string;
/** URL username. */
username(): string;
}
/**
* HTML <iframe> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class IFrameElement extends Element {
protected __brand: never;
}
/**
* HTML <img> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class ImageElement extends Element {
protected __brand: never;
}
/**
* HTML <input> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class InputElement extends FormFieldElement {
protected __brand: never;
/** Owning <form> element. */
form(): FormElement | undefined;
}
/**
* HTML <ins> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class InsElement extends ModElement {
protected __brand: never;
}
/**
* HTML <keygen> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class KeygenElement extends Element {
protected __brand: never;
/** Owning <form> element. */
form(): FormElement | undefined;
/** Associated <label> elements. */
labels(): LabelElement[];
}
/**
* HTML <label> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class LabelElement extends Element {
protected __brand: never;
/** Associated form control element. */
control(): Element | undefined;
/** Owning <form> element. */
form(): FormElement | undefined;
}
/**
* HTML <legend> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class LegendElement extends Element {
protected __brand: never;
/** Owning <form> element. */
form(): FormElement | undefined;
}
/**
* HTML <li> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class LiElement extends Element {
protected __brand: never;
}
/**
* HTML <link> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class LinkElement extends Element {
protected __brand: never;
/** Link types. */
relList(): string[];
}
/**
* HTML <map> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class MapElement extends Element {
protected __brand: never;
/** Associated <area> elements. */
areas(): Element[];
/** Associated <img> and <object> elements. */
images(): Element[];
}
/**
* HTML media element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class MediaElement extends Element {
protected __brand: never;
/** Contained <track> elements. */
textTracks(): TrackElement[];
}
/**
* HTML <meta> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class MetaElement extends Element {
protected __brand: never;
}
/**
* HTML <meter> element.
* https://docs.k6.io/docs/element-k6html
* @Public
*/
export abstract class MeterElement extends Element {
protected __brand: never;
/** Associated <label> elements. */
labels(): LabelElement[];
}
/**
* HTML modification element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class ModElement extends Element {
protected __brand: never;
}
/**
* HTML <object> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class ObjectElement extends Element {
protected __brand: never;
/** Owning <form> element. */
form(): FormElement | undefined;
}
/**
* HTML <ol> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class OListElement extends Element {
protected __brand: never;
}
/**
* HTML <optgroup> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class OptGroupElement extends Element {
protected __brand: never;
}
/**
* HTML <option> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class OptionElement extends Element {
protected __brand: never;
/** Whether disabled. */
disabled(): boolean;
/** Owning <form> element. */
form(): FormElement | undefined;
/** Index in containing options list. */
index(): number;
/** `label` attribute value. */
label(): string;
/** Text content. */
text(): string;
/** `value` attribute value. */
value(): string;
}
/**
* HTML <output> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class OutputElement extends Element {
protected __brand: never;
/** Default value. */
defaultValue(): string;
/** Owning <form> element. */
form(): FormElement | undefined;
/** Associated <label> elements. */
labels(): LabelElement[];
/** Text content. */
value(): string;
}
/**
* HTML <param> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class ParamElement extends Element {
protected __brand: never;
}
/**
* HTML <pre> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class PreElement extends Element {
protected __brand: never;
}
/**
* HTML <progress> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class ProgressElement extends Element {
protected __brand: never;
/** Associated <label> elements. */
labels(): LabelElement[];
/** Work required. */
max(): number;
/** Progress bar position. `value/max` */
position(): number;
/** Work completed. */
value(): number;
}
/**
* HTML <q> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class QuoteElement extends Element {
protected __brand: never;
}
/**
* HTML <script> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class ScriptElement extends Element {
protected __brand: never;
/** Source code. */
text(): string;
}
/**
* HTML <select> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class SelectElement extends Element {
protected __brand: never;
/** Owning <form> element. */
form(): FormElement | undefined;
/** Associated <label> elements. */
labels(): LabelElement[];
/** Number of contained <option> elements. */
length(): number;
/** Contained <option> elements. */
options(): OptionElement[];
/** First selected <option> element index. */
selectedIndex(): number;
/** Selected <option> elements. */
selectedOptions(): OptionElement[];
/** Number of visible rows. */
size(): number;
/** Select type. `select-one` or `select-multiple`. */
type(): string;
/** First selected <option> element value. */
value(): string;
}
/**
* HTML <source> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class SourceElement extends Element {
protected __brand: never;
}
/**
* HTML <style> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class StyleElement extends Element {
protected __brand: never;
/** `type` attribute value. */
type(): string;
}
/**
* HTML <tbody> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class TableBodyElement extends TableSectionElement {
protected __brand: never;
}
/**
* HTML table cell element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class TableCellElement extends Element {
protected __brand: never;
/** Index in containing row. */
cellIndex(): number;
}
/**
* HTML <col> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class TableColElement extends Element {
protected __brand: never;
/** Number of consecutive columns spanned. */
span(): number;
}
/**
* HTML <td> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class TableDataCellElement extends TableCellElement {
protected __brand: never;
}
/**
* HTML <table> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class TableElement extends Element {
protected __brand: never;
/** First child <caption> element. */
caption(): Element | undefined;
/** Contained <tr> elements. */
rows(): Element[];
/** Contained <tbody> elements. */
tBodies(): Element[];
/** First child <tfoot> element. */
tFoot(): Element | undefined;
/** First child <thead> element. */
tHead(): Element | undefined;
}
/**
* HTML <tfoot> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class TableFootElement extends TableSectionElement {
protected __brand: never;
}
/**
* HTML <thead> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class TableHeadElement extends TableSectionElement {
protected __brand: never;
}
/**
* HTML <th> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class TableHeaderCellElement extends TableCellElement {
protected __brand: never;
}
/**
* HTML <tr> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class TableRowElement extends Element {
protected __brand: never;
/** Contained table cell elements. */
cells(): TableCellElement[];
/** Index in containing table. */
rowIndex(): number;
/** Index in containing table section. */
sectionRowIndex(): number;
}
/**
* HTML table section element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class TableSectionElement extends Element {
protected __brand: never;
/** Contained <tr> elements. */
rows(): Element[];
}
/**
* HTML <textarea> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class TextAreaElement extends Element {
protected __brand: never;
/** Owning <form> element. */
form(): FormElement | undefined;
/** Associated <label> elements. */
labels(): LabelElement[];
/** Byte length of current text value. */
length(): number;
}
/**
* HTML <time> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class TimeElement extends Element {
protected __brand: never;
}
/**
* HTML <title> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class TitleElement extends Element {
protected __brand: never;
/** Title text. */
text(): string;
}
/**
* HTML <track> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class TrackElement extends Element {
protected __brand: never;
}
/**
* HTML <ul> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class UListElement extends Element {
protected __brand: never;
}
/**
* HTML <video> element.
* https://docs.k6.io/docs/element-k6html
* @public
*/
export abstract class VideoElement extends MediaElement {
protected __brand: never;
}