import { LinkedList, LinkedListItem } from './linked-list'; import { Scope, MountBlock, UpdateBlock } from './types'; import { Component } from './component'; import { SlotContext } from './slot'; export interface Injector extends LinkedList { /** Injector DOM target */ parentNode: Element; /** Current injector contents */ head: LinkedListItem | null; /** Current insertion pointer */ ptr: LinkedListItem | null; /** Slots container */ slots: Record | null; } export interface Block { parentNode?: void; host: Component; injector: Injector; scope: Scope; mount?: MountBlock; update?: UpdateBlock; start: LinkedListItem; end: LinkedListItem; } /** * Creates injector instance for given target, if required */ export declare function createInjector(target: Element): Injector; /** * Inserts given node into current context */ export declare function insert(injector: Injector, node: T, slotName?: string): T; declare type Diff = T extends U ? never : T; declare type BlockInput = Pick> & Partial; /** * Injects given block */ export declare function injectBlock(injector: Injector, block: BlockInput): T; /** * Returns named slot context from given component input’s injector. If slot context * doesn’t exists, it will be created */ export declare function getSlotContext(injector: Injector, name: string): SlotContext; /** * Empties content of given block * @param detached Empty block in detached state. Detached state means one of the * parent DOM element will be removed from document so there’s no need to detach * inner DOM elements */ export declare function emptyBlockContent(block: T, detached?: boolean): void; /** * Moves contents of `block` after `ref` list item */ export declare function move(injector: Injector, block: B, ref?: LinkedListItem): void; /** * Disposes given block */ export declare function disposeBlock(block: Block, detached?: boolean): void; export {};