/** * This interface must be implemented by nodes that represent a `Map[string, T]` data type * in the specification, and therefore can't be modeled as a node containing * a known collection of named fields. * * Examples include: * * Oas20Paths * Oas20Definitions * Oas20Reponses * * @author eric.wittmann@gmail.com * @class */ export interface IIndexedNode { /** * Gets a single item (indexed child) by name. Returns undefined if not found. * * @param {string} name * @return {Node} */ getItem(name: string): T; /** * Returns an array of all the child items. * @return {Node[]} */ getItems(): Array; /** * Gets a list of the names of all indexed children. * @return {string[]} */ getItemNames(): Array; /** * Adds a child item. * * @param {string} name * @param {Node} item */ addItem(name: string, item: T): any; /** * Deletes a child item by name and returns the deleted child or undefined if there wasn't one. * * @param {string} name * @return {Node} */ deleteItem(name: string): T; } import { Node } from './Node';