import { Schema as S } from 'effect'; /** Schema mirroring `@floating-ui/dom`'s `Placement` literal union: a side * (`top`/`right`/`bottom`/`left`) optionally suffixed with `-start` or `-end`. */ export declare const Placement: S.Literals; export type Placement = typeof Placement.Type; /** Schema mirroring `@floating-ui/dom`'s `Padding` type: a uniform number or a * partial per-side object (`top`/`right`/`bottom`/`left`). */ export declare const Padding: S.Union; readonly right: S.optionalKey; readonly bottom: S.optionalKey; readonly left: S.optionalKey; }>]>; export type Padding = typeof Padding.Type; /** Static configuration for anchor-based positioning of a floating element relative to a button. */ export declare const AnchorConfig: S.Struct<{ readonly placement: S.optional>; readonly gap: S.optional; readonly offset: S.optional; readonly padding: S.optional; readonly right: S.optionalKey; readonly bottom: S.optionalKey; readonly left: S.optionalKey; }>]>>; readonly portal: S.optional; readonly isPlacementLocked: S.optional; }>; export type AnchorConfig = typeof AnchorConfig.Type; /** Relocates an element into the shared `foldkit-portal-root` div within its * containing root: the shadow root when mounted inside one, otherwise * `document.body`. Escapes any ancestor stacking context while keeping the * element under that root's scoped styles. Returns a cleanup function that * removes the element from the portal root. Designed to be called from inside * an `OnMount` action: the consumer wraps the call in `Effect.sync` and * stashes the returned cleanup in the `Mount` result. */ export declare const portalToContainingRoot: (element: Element) => (() => void); /** Config for `anchorSetup`. * * - `buttonId`: id of the trigger to position against, resolved through the * element's own root. * - `anchor`: the static positioning options. * - `interceptTab`: returns focus to the trigger on Tab inside a portaled * panel. Defaults to `true`. * - `focusAfterPosition`: focuses the element once the first position * resolves. Defaults to `false`. * - `focusSelector`: focuses this descendant instead of the element itself. * Read only when `focusAfterPosition` is true. */ export type SetupConfig = Readonly<{ buttonId: string; anchor: AnchorConfig; interceptTab?: boolean; focusAfterPosition?: boolean; focusSelector?: string; }>; /** Positions a floating element relative to its button using Floating UI, then * returns a cleanup function. Designed to be called inside an `OnMount` * action: the consumer wraps the call in `Effect.sync` and stashes the * returned cleanup in the `Mount` result. When `interceptTab` is true * (default), Tab key in portal mode refocuses the button. Set to false for * components like Popover where Tab should navigate naturally within the * panel. When `focusAfterPosition` is true, the element is focused after the * first position computation clears visibility, deferred via * requestAnimationFrame so the element is painted before focus fires. * `focusSelector` optionally targets a descendant (e.g. a calendar grid * inside a popover panel) instead of the panel itself. * The side the element currently sits on is written to `data-placement`, so * CSS can react to it. When `isPlacementLocked` is true, the element keeps the * side that the first positioning picks, `flip` is removed from every later * update, and `data-placement` holds that locked side. Otherwise the attribute * tracks the side each update resolves to, including the ones `flip` moves. */ export declare const anchorSetup: (element: Element, config: SetupConfig) => (() => void); //# sourceMappingURL=anchor.d.ts.map