export type AnyObject = { [ key ] : any ; __rrdom__ ? : RRdomTreeNode ; } ; export class RRdomTreeNode implements AnyObject { public parent : AnyObject | null = null ; public previousSibling : AnyObject | null = null ; public nextSibling : AnyObject | null = null ; public firstChild : AnyObject | null = null ; public lastChild : AnyObject | null = null ; public childrenVersion = 0 ; public childIndexCachedUpTo : AnyObject | null = null ; /**
     * This value represents the cached node index, as long as
     * cachedIndexVersion matches with the childrenVersion of the parent
     */ public cachedIndex = - 1 ; public cachedIndexVersion = NaN ; public get isAttached ( ) { return Boolean ( this . parent || this . previousSibling || this . nextSibling ) ; } public get hasChildren ( ) { return Boolean ( this . firstChild ) ; } public childrenChanged ( ) { this . childrenVersion = ( this . childrenVersion + 1 ) & 0xffffffff ; this . childIndexCachedUpTo = null ; } public getCachedIndex ( parentNode ) { if ( this . cachedIndexVersion !== parentNode . childrenVersion ) { this . cachedIndexVersion = NaN ; return - 1 ; } return this . cachedIndex ; } public setCachedIndex ( parentNode , index ) { this . cachedIndexVersion = parentNode . childrenVersion ; this . cachedIndex = index ; } }