export type AnchorOpts = { icon: string; visible: 'hover' | 'always' | 'touch'; placement: 'right' | 'left'; ariaLabel: string; class: string; base: string; truncate: number; titleText: string; }; export declare function anchor(opts?: Partial, selector?: string | Array | NodeList): Anchor; export declare class Anchor { opts: Partial; els: HTMLElement[]; constructor(opts?: Partial); /** * Assign options to the internal options object, and provide defaults. * @param {AnchorOpts} opts - Options object. This will be mutated. */ private _applyRemainingDefaultOptions; /** * Check to see if this device supports touch. Uses criteria pulled * from Modernizr: * https://github.com/Modernizr/Modernizr/blob/da22eb27631fc4957f67607fe6042e85c0a84656/feature-detects/touchevents.js#L40 * * @return {boolean} - true if the current device supports touch. */ isTouchDevice(): boolean; /** * Determine if this element already has an AnchorJS link on it. * Uses this technique: https://stackoverflow.com/a/5898748/1154642 * @param {HTMLElement} el - a DOM node * @return {Boolean} true/false */ hasAnchorJSLink(el: HTMLElement): boolean; /** * Urlify - Refine text so it makes a good ID. * * To do this, we remove apostrophes, replace non-safe characters * with hyphens, remove extra hyphens, truncate, trim hyphens, and * make lowercase. * * @param {string} text - Any text. Usually pulled from the webpage element * we are linking to. * @return {string} - hyphen-delimited text for use in IDs and URLs. */ urlify(text: string): string; /** * Add anchor links to page elements. * * @param {string|Array|NodeList} [selector] - A CSS selector for targeting * the elements you wish to add anchor links to. Also accepts an array or * nodeList containing the relavant elements. * @return {this} */ add(selector?: string | Array | NodeList): this; /** * Remove all anchorjs-links from elements targeted by the selector. * * @param {string|Array|Nodelist} selector - A CSS selector string * targeting elements with anchor links, * OR a nodeList / array containing the DOM elements. * @return {this} The AnchorJS object */ remove(selector: string | Node[] | NodeList): this; /** * Remove all anchorjs links. Mostly used for tests. */ removeAll(): void; } //# sourceMappingURL=index.d.ts.map