alinea
Version:
Headless git-based CMS
34 lines (33 loc) • 1.09 kB
TypeScript
import type { DragTarget, ItemInstance, TreeDataLoader } from '@headless-tree/core';
import type { EntryStatus } from 'alinea/core/Entry';
export declare const ROOT_ID = "@alinea/root";
export interface EntryTreeItem {
id: string;
index: string;
type: string;
entries: Array<{
id: string;
type: string;
title: string;
status: EntryStatus;
locale: string | null;
workspace: string;
root: string;
path: string;
parents: Array<{
path: string;
type: string;
}>;
main: boolean;
}>;
isFolder?: boolean;
isRoot?: boolean;
canDrag?: boolean;
hasChildren: boolean;
children: Promise<Array<string>>;
}
export declare function useEntryTreeProvider(): TreeDataLoader<EntryTreeItem> & {
canDrag(item: Array<ItemInstance<EntryTreeItem>>): boolean;
canDrop(items: Array<ItemInstance<EntryTreeItem>>, target: DragTarget<EntryTreeItem>): boolean;
onDrop(items: Array<ItemInstance<EntryTreeItem>>, target: DragTarget<EntryTreeItem>): void;
};