import type { ImpulseElement } from './element'; import type { Token } from './observers/token_list_watcher'; import type { TokenRouterDelegate } from './observers/token_router'; import type { SingleTargetHost } from './single_target'; import type { TargetDescriptor } from './target_descriptor'; export default class Target implements TokenRouterDelegate, SingleTargetHost { private readonly instance; private readonly declarations; private targetsByKey; private tokensByElement; private readonly singles; private orderedByKey; private nowByKey; private stableByKey; private stopWatching?; private subscribed; constructor(instance: ImpulseElement); start(): void; stop(): void; tokenMatched(token: Token, { key }: TargetDescriptor): void; tokenUnmatched(token: Token, { key }: TargetDescriptor): void; private connect; /** * The targets under `key`, in document order. `targetsByKey` is kept in insertion order, so the first read after a * change sorts; later reads get the same array until the next change, which never mutates it. * * Targets removed earlier in the same mutation batch are already detached until their unmatch is delivered, and * `compareDocumentPosition` orders nodes in different trees arbitrarily. A read part-way through such a batch (from a * `[key]Connected` or `[key]Disconnected` callback) can therefore see the survivors out of order. */ private orderedTargets; /** * What the field for `key` reads while changes wait to be delivered: `now()`, worked out from the DOM, reused until * more changes are waiting. */ private readNow; /** * `targets`, or the array last handed out for `key` when it holds the same elements in the same order, so a * `@targets()` field gives the same array until its elements change, whether it was read from the index or from the * DOM. */ private stableArray; private isInDocumentTree; /** * The elements claiming `key` as the DOM stands, in document order, this element included when it carries the key * itself. Once the changes waiting are delivered, they are the Targets of a `@targets()` key. */ claimants(key: string): T[]; claims(key: string, element: Element): boolean; connected(key: string, element: T): void; disconnected(key: string, element: T): void; reportMultiple(key: string): void; active(): boolean; clock(): number; afterRun(task: () => void): void; deliver(task: () => void): void; private isStillReferenced; private holdsKey; private isDeclared; private invokeCallback; private get identifier(); } //# sourceMappingURL=target.d.ts.map