import { Layout } from './layout.js'; import { BasicNode, Node } from './node.js'; import { TransformConfig } from './transform.js'; /** * A node that is bound to a DOM element and can be projected to a new layout. * @see https://www.youtube.com/watch?v=5-JIu0u42Jc Inside Framer Motion's Layout Animations - Matt Perry * @see https://gist.github.com/TheNightmareX/f5bf72e81d2667f6036e91cf81270ef7 Layout Projection - Matt Perry */ export interface ProjectionNode extends Node { /** * Returns the element of this projection node. */ element(): HTMLElement; /** * Reset the node and the element to its initial state, to get ready * for a new round of projection. */ reset(): void; /** * Measure the current layout and relevant styles of the element. * The result can be accessed via {@link measurement}. * @returns the measurement result */ measure(): Measurement; /** * Return the {@link measure} result of this projection node. */ measurement(): Measurement | null; /** * Projects the element to the given layout. * Requires this projection node to be measured. * @param dest the destination layout * @returns information about the performed projection */ project(dest: Layout): Projection; /** * Return the information about the current projection, or null * if no projection has been performed yet. */ projection(): Projection | null; } /** * A snapshot of the layout and relevant styles of an element. */ export interface Measurement { /** * The layout of the element at the time of measurement. */ readonly layout: Layout; } /** * Information about a performed projection. */ export interface Projection { /** * The final transform applied to the target element. */ readonly transform: TransformConfig; /** * The aggregated transform from all ancestor elements. */ readonly distortion: TransformConfig; } export declare class BasicProjectionNode extends BasicNode implements ProjectionNode { #private; constructor(element: HTMLElement); element(): HTMLElement; reset(): void; measure(): Measurement; measurement(): Measurement | null; project(dest: Layout): Projection; projection(): Projection | null; private computeTransform; private aggregateAncestorTransforms; } //# sourceMappingURL=projection-node-experimental.d.ts.map