anki/ts/sveltelib/position/position-algorithm.d.ts
Matthias Metelka a48c96559d
Fix glitchy animation of floating elements (#2224)
* Set max-height of 400px to scrollable Popover

* Pass computed placement to user components

to set different animation directions when the placement changes.

* Move elevation effect from WithFloating/WithOverlay to Popover

* Apply same changes as in WithFloating to WithOverlay

* Adjust FloatingArrow CSS to Popover

* Run eslint and formatter
2022-12-01 15:45:52 +10:00

13 lines
424 B
TypeScript

// Copyright: Ankitects Pty Ltd and contributors
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import type { FloatingElement, Placement, ReferenceElement } from "@floating-ui/dom";
/**
* The interface of a function that calls `computePosition` of floating-ui.
*/
export type PositionAlgorithm = (
reference: ReferenceElement,
floating: FloatingElement,
) => Promise<Placement>;