import ModelCollection from './ModelCollection'; import type Model from './Model'; import type { MaybeArray } from '../Support/type'; type Ancestralised = T & { [key in CT]: ModelCollection>; }; export default class AncestryCollection extends ModelCollection> { /** * The name of the key that will be set when arranging the items in a tree structure. */ static depthName: string; /** * The name of the attribute that includes the related models. * * @protected */ protected childrenRelation: CT; /** * @param models - The models already arranged in an ancestry tree format. * @param childrenRelation - The key that will include descendants. * */ protected constructor(models?: MaybeArray>, childrenRelation?: CT); /** * Arrange the items in an ancestry tree format. * * @param models - The ModelCollection to sort. * @param parentKey - The key that identifies the parent's id. * @param childrenRelation - The key that will include descendants. * * @return {AncestryCollection} */ static treeOf(models: ModelCollection | ST[], parentKey?: string, childrenRelation?: CT): AncestryCollection; /** * Return all the models in a single level with no children set. * * @return {ModelCollection} */ flatten(): ModelCollection; /** * All the models that do not have any children. * * @return {ModelCollection} */ leaves(): ModelCollection; /** * Asserts whether the given value * is an instance of AncestryCollection. * * @param value * * @return {boolean} */ static isAncestryCollection(value: any): value is AncestryCollection; } export {}; //# sourceMappingURL=AncestryCollection.d.ts.map