import type { Optional } from '@ephox/katamari'; import { Attribute, type SugarElement } from '@ephox/sugar'; export const enum Placement { North = 'north', Northeast = 'northeast', Northwest = 'northwest', South = 'south', Southeast = 'southeast', Southwest = 'southwest', East = 'east', West = 'west' } const placementAttribute = 'data-alloy-placement'; const setPlacement = (element: SugarElement, placement: Placement): void => { Attribute.set(element, placementAttribute, placement); }; const getPlacement = (element: SugarElement): Optional => Attribute.getOpt(element, placementAttribute) as Optional; const reset = (element: SugarElement): void => Attribute.remove(element, placementAttribute); export { setPlacement, getPlacement, reset };