UNPKG

alinea

Version:

[![npm](https://img.shields.io/npm/v/alinea.svg)](https://npmjs.org/package/alinea) [![install size](https://packagephobia.com/badge?p=alinea)](https://packagephobia.com/result?p=alinea)

23 lines (22 loc) 1.29 kB
import { Entry } from '../Entry.js'; import { Cursor, CursorData, SourceType } from './Cursor.js'; import { Selection } from './Selection.js'; import { TargetI } from './Target.js'; type Narrow = Cursor.Find<any> | TargetI<any>; type Output<T> = [Narrow] extends [T] ? Entry : Selection.Infer<T>; export declare class Tree { constructor(); protected narrowData(narrow?: any): Partial<CursorData>; protected find<T>(sourceType: SourceType, narrow?: any, depth?: number): Cursor.Find<T>; protected get<T>(sourceType: SourceType, narrow?: any): Cursor.Get<T>; children<N extends Narrow>(depth?: number): Cursor.Find<Output<N>>; children<N extends Narrow>(narrow?: N, depth?: number): Cursor.Find<Output<N>>; parents<N extends Narrow>(depth?: number): Cursor.Find<Output<N>>; parents<N extends Narrow>(narrow?: N, depth?: number): Cursor.Find<Output<N>>; previous: <N extends Narrow>(narrow?: N | undefined) => Cursor.Get<Output<N>>; next: <N extends Narrow>(narrow?: N | undefined) => Cursor.Get<Output<N>>; parent: <N extends Narrow>(narrow?: N | undefined) => Cursor.Get<Output<N>>; siblings: <N extends Narrow>(narrow?: N | undefined) => Cursor.Find<Output<N>>; translations: (includeSelf?: boolean) => Cursor.Find<Entry>; } export {};