woltlab-compiler
Version:
A compiler for WoltLab-Package Archives and WoltLab-Package Components
71 lines (70 loc) • 1.61 kB
TypeScript
/**
* Represents a collection which is bidirectional.
*/
export declare abstract class BidirectionalCollection<TParent, TChild> extends Array<TChild> {
/**
* The owner of the collection.
*/
private owner;
/**
* Initializes a new instance of the `BidirectionalCollection<TParent, TChild>` class.
*
* @param owner
* The owner of the collection.
*/
constructor(owner: TParent);
/**
* Gets the owner of the collection.
*/
readonly Owner: TParent;
/**
* @inheritdoc
*/
push(...items: TChild[]): number;
/**
* @inheritdoc
*/
pop(): TChild;
/**
* @inheritdoc
*/
shift(): TChild;
/**
* @inheritdoc
*/
unshift(...items: TChild[]): number;
/**
* Gets the parent of a child.
*
* @param child
* The child whose parent to return.
*
* @returns
* The parent of the `child`.
*/
protected abstract GetParent(child: TChild): TParent;
/**
* Sets the parent of a child.
*
* @param child
* The child whose parent is to be set.
*
* @param parent
* The parent to set.
*/
protected abstract SetParent(child: TChild, parent: TParent): void;
/**
* Securely adds an item.
*
* @param item
* The item to add.
*/
protected Add(item: TChild): boolean;
/**
* Securely removes an item.
*
* @param item
* The item to remove.
*/
protected Remove(item: TChild): boolean;
}