import type { DropdownGroup, DropdownItemType } from './Dropdown'; /** * 배열에서 fromId 위치의 요소를 toId 위치로 이동. * id 중 하나라도 없으면 원본 그대로 반환. immutable. */ export declare function arrayMoveById(order: string[], fromId: string, toId: string): string[]; /** * fromId 요소를 toId 기준 edge('top'=직전, 'bottom'=직후)에 삽입. * indicator 위치와 정확히 일치하는 reorder를 위해 사용. */ export declare function arrayReorderByEdge(order: string[], fromId: string, toId: string, edge: 'top' | 'bottom'): string[]; export type DraftState = { order: string[]; visibility: Record; }; /** * groups를 받아 초기 draft state를 만든다. * - order: 모든 그룹·아이템의 id를 순서대로 평탄화 * - visibility: item.visible (undefined면 true) */ export declare function initDraftState(groups: DropdownGroup[]): DraftState; /** * 모든 그룹의 items를 평탄화하고, draft.order 순서로 재배열. * 각 item의 visible은 원래 visible이 정의되어 있던 경우에만 draft.visibility 값으로 갱신. * 그 외 필드는 props 원본 그대로 보존. */ export declare function applyDraftToItems(groups: DropdownGroup[], draft: DraftState): DropdownItemType[]; /** * draft가 original과 비교해 변경되었는지 판단. * order 배열 또는 visibility 객체 중 하나라도 다르면 true. */ export declare function hasDraftChanged(original: DraftState, draft: DraftState): boolean;