You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
1.2 KiB
25 lines
1.2 KiB
/**
|
|
* @license
|
|
* Copyright Google LLC All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|
|
import { Element } from 'parse5';
|
|
/**
|
|
* Parses a HTML fragment and traverses all AST nodes in order find elements that
|
|
* include the specified attribute.
|
|
*/
|
|
export declare function findElementsWithAttribute(html: string, attributeName: string): Element[];
|
|
/**
|
|
* Finds elements with explicit tag names that also contain the specified attribute. Returns the
|
|
* attribute start offset based on the specified HTML.
|
|
*/
|
|
export declare function findAttributeOnElementWithTag(html: string, name: string, tagNames: string[]): number[];
|
|
/**
|
|
* Finds elements that contain the given attribute and contain at least one of the other
|
|
* specified attributes. Returns the primary attribute's start offset based on the specified HTML.
|
|
*/
|
|
export declare function findAttributeOnElementWithAttrs(html: string, name: string, attrs: string[]): number[];
|
|
/** Gets the start offset of the given attribute from a Parse5 element. */
|
|
export declare function getStartOffsetOfAttribute(element: any, attributeName: string): number;
|