/*! * This module defines the LinkedList class, which represents a doubly-linked list data structure. * * Author: Jan Curn (jan@apify.com) * Copyright(c) 2014 Apify. All rights reserved. * */ export declare class LinkedListNode { readonly data: T; prev?: LinkedListNode | null; next?: LinkedListNode | null; dictKey?: string; constructor(data: T); } /** * A class representing a doubly-linked list. */ export declare class LinkedList { head?: LinkedListNode | null; tail?: LinkedListNode | null; length: number; /** * Appends a new node with specific data to the end of the linked list. */ add(data: T, toFirstPosition?: boolean): LinkedListNode; /** * Appends a new node to the end of the linked list or the beginning if firstPosition is true-ish. */ addNode(node: LinkedListNode, toFirstPosition?: boolean): void; /** * Finds a first node that holds a specific data object. See 'dataEqual' function for a description * how the object equality is tested. Function returns null if the data cannot be found. */ find(data: T): LinkedListNode | null; removeNode(node: LinkedListNode): void; /** * Removes the first item from the list. The function * returns the item object or null if the list is empty. */ removeFirst(): T | null; }