Skip to main content

@headless-tree/core

Index

Async Data Loader/General

Other

Async Data Loader/General

AsyncDataLoaderFeatureDef

AsyncDataLoaderFeatureDef<T>: { config: { asyncDataLoader?: AsyncTreeDataLoader<T>; createLoadingItemData?: () => T; onLoadedChildren?: (itemId: string, childrenIds: string[]) => void; onLoadedItem?: (itemId: string, item: T) => void; rootItemId: string; setLoadingItems?: SetStateFn<string[]> }; hotkeys: SyncDataLoaderFeatureDef<T>[hotkeys]; itemInstance: SyncDataLoaderFeatureDef<T>[itemInstance] & { invalidateChildrenIds: () => void; invalidateItemData: () => void; isLoading: () => void }; state: { loadingItems: string[] }; treeInstance: SyncDataLoaderFeatureDef<T>[treeInstance] & { invalidateChildrenIds: (itemId: string) => void; invalidateItemData: (itemId: string) => void } }

Type parameters

  • T

Type declaration

  • config: { asyncDataLoader?: AsyncTreeDataLoader<T>; createLoadingItemData?: () => T; onLoadedChildren?: (itemId: string, childrenIds: string[]) => void; onLoadedItem?: (itemId: string, item: T) => void; rootItemId: string; setLoadingItems?: SetStateFn<string[]> }
    • optionalasyncDataLoader?: AsyncTreeDataLoader<T>
    • optionalcreateLoadingItemData?: () => T
        • (): T
        • Returns T

    • optionalonLoadedChildren?: (itemId: string, childrenIds: string[]) => void
        • (itemId: string, childrenIds: string[]): void
        • Parameters

          • itemId: string
          • childrenIds: string[]

          Returns void

    • optionalonLoadedItem?: (itemId: string, item: T) => void
        • (itemId: string, item: T): void
        • Parameters

          • itemId: string
          • item: T

          Returns void

    • rootItemId: string
    • optionalsetLoadingItems?: SetStateFn<string[]>
  • hotkeys: SyncDataLoaderFeatureDef<T>[hotkeys]
  • itemInstance: SyncDataLoaderFeatureDef<T>[itemInstance] & { invalidateChildrenIds: () => void; invalidateItemData: () => void; isLoading: () => void }
  • state: { loadingItems: string[] }
    • loadingItems: string[]
  • treeInstance: SyncDataLoaderFeatureDef<T>[treeInstance] & { invalidateChildrenIds: (itemId: string) => void; invalidateItemData: (itemId: string) => void }

Other

AsyncDataLoaderFeatureHotkeys

AsyncDataLoaderFeatureHotkeys<T>: AsyncDataLoaderFeatureDef<T>[hotkeys]

Type parameters

  • T

AsyncDataLoaderRef

AsyncDataLoaderRef<T>: { childrenIds: Record<string, string[]>; itemData: Record<string, T> }

Type parameters

  • T = any

Type declaration

  • childrenIds: Record<string, string[]>
  • itemData: Record<string, T>

AsyncTreeDataLoader

AsyncTreeDataLoader<T>: { getChildren: (itemId: string) => Promise<string[]>; getChildrenWithData?: (itemId: string) => Promise<{ data: T; id: string }[]>; getItem: (itemId: string) => Promise<T> }

Type parameters

  • T

Type declaration

  • getChildren: (itemId: string) => Promise<string[]>
      • (itemId: string): Promise<string[]>
      • Parameters

        • itemId: string

        Returns Promise<string[]>

  • optionalgetChildrenWithData?: (itemId: string) => Promise<{ data: T; id: string }[]>
      • (itemId: string): Promise<{ data: T; id: string }[]>
      • Parameters

        • itemId: string

        Returns Promise<{ data: T; id: string }[]>

  • getItem: (itemId: string) => Promise<T>
      • (itemId: string): Promise<T>
      • Parameters

        • itemId: string

        Returns Promise<T>

CustomHotkeysConfig

CustomHotkeysConfig<T, F>: Partial<Record<HotkeyName<F> | `custom${string}`, Partial<HotkeyConfig<T>>>>

Type parameters

DefaultFeatures

DefaultFeatures<T>: MainFeatureDef | TreeFeatureDef<T>

Type parameters

  • T

DndDataRef

DndDataRef: { lastDragCode?: string }

Type declaration

  • optionallastDragCode?: string

DndState

DndState<T>: { dragTarget?: DropTarget<T>; draggedItems?: ItemInstance<T>[]; draggingOverItem?: ItemInstance<T> }

Type parameters

  • T

Type declaration

DragAndDropFeatureDef

DragAndDropFeatureDef<T>: { config: { bottomLinePercentage?: number; canDrag?: (items: ItemInstance<T>[]) => boolean; canDrop?: (items: ItemInstance<T>[], target: DropTarget<T>) => boolean; canDropForeignDragObject?: (dataTransfer: DataTransfer, target: DropTarget<T>) => boolean; canDropInbetween?: boolean; createForeignDragObject?: (items: ItemInstance<T>[]) => { data: any; format: string }; isItemDraggable?: (item: ItemInstance<T>) => boolean; onCompleteForeignDrop?: (items: ItemInstance<T>[]) => void; onDrop?: (items: ItemInstance<T>[], target: DropTarget<T>) => void; onDropForeignDragObject?: (dataTransfer: DataTransfer, target: DropTarget<T>) => void; setDndState?: SetStateFn<DndState<T> | null>; topLinePercentage?: number }; hotkeys: never; itemInstance: { isDraggingOver: () => boolean; isDropTarget: () => boolean; isDropTargetAbove: () => boolean; isDropTargetBelow: () => boolean }; state: { dnd?: DndState<T> | null }; treeInstance: { getDragLineData: () => DragLineData | null; getDropTarget: () => DropTarget<T> | null } }

Type parameters

  • T

Type declaration

  • config: { bottomLinePercentage?: number; canDrag?: (items: ItemInstance<T>[]) => boolean; canDrop?: (items: ItemInstance<T>[], target: DropTarget<T>) => boolean; canDropForeignDragObject?: (dataTransfer: DataTransfer, target: DropTarget<T>) => boolean; canDropInbetween?: boolean; createForeignDragObject?: (items: ItemInstance<T>[]) => { data: any; format: string }; isItemDraggable?: (item: ItemInstance<T>) => boolean; onCompleteForeignDrop?: (items: ItemInstance<T>[]) => void; onDrop?: (items: ItemInstance<T>[], target: DropTarget<T>) => void; onDropForeignDragObject?: (dataTransfer: DataTransfer, target: DropTarget<T>) => void; setDndState?: SetStateFn<DndState<T> | null>; topLinePercentage?: number }
    • optionalbottomLinePercentage?: number
    • optionalcanDrag?: (items: ItemInstance<T>[]) => boolean
    • optionalcanDrop?: (items: ItemInstance<T>[], target: DropTarget<T>) => boolean
    • optionalcanDropForeignDragObject?: (dataTransfer: DataTransfer, target: DropTarget<T>) => boolean
        • (dataTransfer: DataTransfer, target: DropTarget<T>): boolean
        • Parameters

          Returns boolean

    • optionalcanDropInbetween?: boolean
    • optionalcreateForeignDragObject?: (items: ItemInstance<T>[]) => { data: any; format: string }
        • Parameters

          Returns { data: any; format: string }

          • data: any
          • format: string
    • optionalisItemDraggable?: (item: ItemInstance<T>) => boolean
    • optionalonCompleteForeignDrop?: (items: ItemInstance<T>[]) => void

      Runs in the onDragEnd event, if ev.dataTransfer.dropEffect is not none, i.e. the drop was not aborted. No target is provided as parameter since the target may be a foreign drop target. This is useful to seperate out the logic to move dragged items out of their previous parents. Use onDrop to handle drop-related logic.

      This ignores the canDrop handler, since the drop target is unknown in this handler.

    • optionalonDrop?: (items: ItemInstance<T>[], target: DropTarget<T>) => void
    • optionalonDropForeignDragObject?: (dataTransfer: DataTransfer, target: DropTarget<T>) => void
        • (dataTransfer: DataTransfer, target: DropTarget<T>): void
        • Parameters

          Returns void

    • optionalsetDndState?: SetStateFn<DndState<T> | null>
    • optionaltopLinePercentage?: number
  • hotkeys: never
  • itemInstance: { isDraggingOver: () => boolean; isDropTarget: () => boolean; isDropTargetAbove: () => boolean; isDropTargetBelow: () => boolean }
    • isDraggingOver: () => boolean
        • (): boolean
        • Returns boolean

    • isDropTarget: () => boolean
        • (): boolean
        • Returns boolean

    • isDropTargetAbove: () => boolean
        • (): boolean
        • Returns boolean

    • isDropTargetBelow: () => boolean
        • (): boolean
        • Returns boolean

  • state: { dnd?: DndState<T> | null }
  • treeInstance: { getDragLineData: () => DragLineData | null; getDropTarget: () => DropTarget<T> | null }

DragAndDropFeatureHotkeys

DragAndDropFeatureHotkeys<T>: DragAndDropFeatureDef<T>[hotkeys]

Type parameters

  • T

DragLineData

DragLineData: { intend: number; left: number; right: number; top: number }

Type declaration

  • intend: number
  • left: number
  • right: number
  • top: number

DropTarget

DropTarget<T>: { childIndex: number; insertionIndex: number; item: ItemInstance<T> } | { childIndex: null; insertionIndex: null; item: ItemInstance<T> }

Type parameters

  • T

EmptyFeatureDef

EmptyFeatureDef: { config: {}; hotkeys: never; itemInstance: {}; state: {}; treeInstance: {} }

Type declaration

  • config: {}
    • hotkeys: never
    • itemInstance: {}
      • state: {}
        • treeInstance: {}

          ExpandAllFeatureDef

          ExpandAllFeatureDef: { config: {}; hotkeys: never; itemInstance: { collapseAll: () => void; expandAll: (cancelToken?: { current: boolean }) => Promise<void> }; state: {}; treeInstance: { collapseAll: () => void; expandAll: (cancelToken?: { current: boolean }) => Promise<void> } }

          Type declaration

          • config: {}
            • hotkeys: never
            • itemInstance: { collapseAll: () => void; expandAll: (cancelToken?: { current: boolean }) => Promise<void> }
              • collapseAll: () => void
                  • (): void
                  • Returns void

              • expandAll: (cancelToken?: { current: boolean }) => Promise<void>
                  • (cancelToken?: { current: boolean }): Promise<void>
                  • Parameters

                    • optionalcancelToken: { current: boolean }

                    Returns Promise<void>

            • state: {}
              • treeInstance: { collapseAll: () => void; expandAll: (cancelToken?: { current: boolean }) => Promise<void> }
                • collapseAll: () => void
                    • (): void
                    • Returns void

                • expandAll: (cancelToken?: { current: boolean }) => Promise<void>
                    • (cancelToken?: { current: boolean }): Promise<void>
                    • Parameters

                      • optionalcancelToken: { current: boolean }

                      Returns Promise<void>

              ExpandAllFeatureHotkeys

              ExpandAllFeatureHotkeys: ExpandAllFeatureDef[hotkeys]

              FeatureDef

              FeatureDef: { config: any; hotkeys: string; itemInstance: FunctionMap; state: any; treeInstance: FunctionMap }

              Type declaration

              • config: any
              • hotkeys: string
              • itemInstance: FunctionMap
              • state: any
              • treeInstance: FunctionMap

              FeatureDefs

              Type parameters

              • T

              FeatureImplementation

              FeatureImplementation<T, SelfFeatureDef, DepFeaturesDef>: { deps?: string[]; getDefaultConfig?: (defaultConfig: Partial<MergedFeatures<DepFeaturesDef>[config]>, tree: MergedFeatures<DepFeaturesDef>[treeInstance]) => Partial<SelfFeatureDef[config] & MergedFeatures<DepFeaturesDef>[config]>; getInitialState?: (initialState: Partial<MergedFeatures<DepFeaturesDef>[state]>, tree: MergedFeatures<DepFeaturesDef>[treeInstance]) => Partial<SelfFeatureDef[state] & MergedFeatures<DepFeaturesDef>[state]>; hotkeys?: HotkeysConfig<T, SelfFeatureDef>; itemInstance?: { [ key in keyof SelfFeatureDef[itemInstance] & MergedFeatures<DepFeaturesDef>[itemInstance] ]?: (opts: ItemInstanceOpts<SelfFeatureDef[itemInstance] & MergedFeatures<DepFeaturesDef>[itemInstance], SelfFeatureDef[treeInstance] & MergedFeatures<DepFeaturesDef>[treeInstance], key>, ...args: Parameters<SelfFeatureDef[itemInstance] & MergedFeatures<DepFeaturesDef>[itemInstance][key]>) => void }; key?: string; onItemMount?: (instance: MergedFeatures<DepFeaturesDef>[itemInstance], itemElement: HTMLElement, tree: MergedFeatures<DepFeaturesDef>[treeInstance]) => void; onItemUnmount?: (instance: MergedFeatures<DepFeaturesDef>[itemInstance], itemElement: HTMLElement, tree: MergedFeatures<DepFeaturesDef>[treeInstance]) => void; onTreeMount?: (instance: MergedFeatures<DepFeaturesDef>[treeInstance], treeElement: HTMLElement) => void; onTreeUnmount?: (instance: MergedFeatures<DepFeaturesDef>[treeInstance], treeElement: HTMLElement) => void; overwrites?: string[]; stateHandlerNames?: Partial<Record<keyof MergedFeatures<DepFeaturesDef>[state], keyof MergedFeatures<DepFeaturesDef>[config]>>; treeInstance?: { [ key in keyof SelfFeatureDef[treeInstance] & MergedFeatures<DepFeaturesDef>[treeInstance] ]?: (opts: TreeInstanceOpts<SelfFeatureDef[treeInstance] & MergedFeatures<DepFeaturesDef>[treeInstance], key>, ...args: Parameters<SelfFeatureDef[treeInstance] & MergedFeatures<DepFeaturesDef>[treeInstance][key]>) => void } }

              Type parameters

              Type declaration

              • optionaldeps?: string[]
              • optionalgetDefaultConfig?: (defaultConfig: Partial<MergedFeatures<DepFeaturesDef>[config]>, tree: MergedFeatures<DepFeaturesDef>[treeInstance]) => Partial<SelfFeatureDef[config] & MergedFeatures<DepFeaturesDef>[config]>
                  • (defaultConfig: Partial<MergedFeatures<DepFeaturesDef>[config]>, tree: MergedFeatures<DepFeaturesDef>[treeInstance]): Partial<SelfFeatureDef[config] & MergedFeatures<DepFeaturesDef>[config]>
                  • Parameters

                    • defaultConfig: Partial<MergedFeatures<DepFeaturesDef>[config]>
                    • tree: MergedFeatures<DepFeaturesDef>[treeInstance]

                    Returns Partial<SelfFeatureDef[config] & MergedFeatures<DepFeaturesDef>[config]>

              • optionalgetInitialState?: (initialState: Partial<MergedFeatures<DepFeaturesDef>[state]>, tree: MergedFeatures<DepFeaturesDef>[treeInstance]) => Partial<SelfFeatureDef[state] & MergedFeatures<DepFeaturesDef>[state]>
                  • (initialState: Partial<MergedFeatures<DepFeaturesDef>[state]>, tree: MergedFeatures<DepFeaturesDef>[treeInstance]): Partial<SelfFeatureDef[state] & MergedFeatures<DepFeaturesDef>[state]>
                  • Parameters

                    • initialState: Partial<MergedFeatures<DepFeaturesDef>[state]>
                    • tree: MergedFeatures<DepFeaturesDef>[treeInstance]

                    Returns Partial<SelfFeatureDef[state] & MergedFeatures<DepFeaturesDef>[state]>

              • optionalhotkeys?: HotkeysConfig<T, SelfFeatureDef>
              • optionalitemInstance?: { [ key in keyof SelfFeatureDef[itemInstance] & MergedFeatures<DepFeaturesDef>[itemInstance] ]?: (opts: ItemInstanceOpts<SelfFeatureDef[itemInstance] & MergedFeatures<DepFeaturesDef>[itemInstance], SelfFeatureDef[treeInstance] & MergedFeatures<DepFeaturesDef>[treeInstance], key>, ...args: Parameters<SelfFeatureDef[itemInstance] & MergedFeatures<DepFeaturesDef>[itemInstance][key]>) => void }
              • optionalkey?: string
              • optionalonItemMount?: (instance: MergedFeatures<DepFeaturesDef>[itemInstance], itemElement: HTMLElement, tree: MergedFeatures<DepFeaturesDef>[treeInstance]) => void
                  • (instance: MergedFeatures<DepFeaturesDef>[itemInstance], itemElement: HTMLElement, tree: MergedFeatures<DepFeaturesDef>[treeInstance]): void
                  • Parameters

                    • instance: MergedFeatures<DepFeaturesDef>[itemInstance]
                    • itemElement: HTMLElement
                    • tree: MergedFeatures<DepFeaturesDef>[treeInstance]

                    Returns void

              • optionalonItemUnmount?: (instance: MergedFeatures<DepFeaturesDef>[itemInstance], itemElement: HTMLElement, tree: MergedFeatures<DepFeaturesDef>[treeInstance]) => void
                  • (instance: MergedFeatures<DepFeaturesDef>[itemInstance], itemElement: HTMLElement, tree: MergedFeatures<DepFeaturesDef>[treeInstance]): void
                  • Parameters

                    • instance: MergedFeatures<DepFeaturesDef>[itemInstance]
                    • itemElement: HTMLElement
                    • tree: MergedFeatures<DepFeaturesDef>[treeInstance]

                    Returns void

              • optionalonTreeMount?: (instance: MergedFeatures<DepFeaturesDef>[treeInstance], treeElement: HTMLElement) => void
                  • (instance: MergedFeatures<DepFeaturesDef>[treeInstance], treeElement: HTMLElement): void
                  • Parameters

                    • instance: MergedFeatures<DepFeaturesDef>[treeInstance]
                    • treeElement: HTMLElement

                    Returns void

              • optionalonTreeUnmount?: (instance: MergedFeatures<DepFeaturesDef>[treeInstance], treeElement: HTMLElement) => void
                  • (instance: MergedFeatures<DepFeaturesDef>[treeInstance], treeElement: HTMLElement): void
                  • Parameters

                    • instance: MergedFeatures<DepFeaturesDef>[treeInstance]
                    • treeElement: HTMLElement

                    Returns void

              • optionaloverwrites?: string[]
              • optionalstateHandlerNames?: Partial<Record<keyof MergedFeatures<DepFeaturesDef>[state], keyof MergedFeatures<DepFeaturesDef>[config]>>
              • optionaltreeInstance?: { [ key in keyof SelfFeatureDef[treeInstance] & MergedFeatures<DepFeaturesDef>[treeInstance] ]?: (opts: TreeInstanceOpts<SelfFeatureDef[treeInstance] & MergedFeatures<DepFeaturesDef>[treeInstance], key>, ...args: Parameters<SelfFeatureDef[treeInstance] & MergedFeatures<DepFeaturesDef>[treeInstance][key]>) => void }

              HotkeyName

              HotkeyName<F>: MergedFeatures<F>[hotkeys]

              Type parameters

              HotkeysConfig

              HotkeysConfig<T, F>: Record<HotkeyName<F>, HotkeyConfig<T>>

              Type parameters

              HotkeysCoreDataRef

              HotkeysCoreDataRef: { keydownHandler?: (e: KeyboardEvent) => void; keyupHandler?: (e: KeyboardEvent) => void; pressedKeys: Set<string> }

              Type declaration

              • optionalkeydownHandler?: (e: KeyboardEvent) => void
                  • (e: KeyboardEvent): void
                  • Parameters

                    • e: KeyboardEvent

                    Returns void

              • optionalkeyupHandler?: (e: KeyboardEvent) => void
                  • (e: KeyboardEvent): void
                  • Parameters

                    • e: KeyboardEvent

                    Returns void

              • pressedKeys: Set<string>

              HotkeysCoreFeatureDef

              HotkeysCoreFeatureDef<T>: { config: { hotkeys?: CustomHotkeysConfig<T>; onItemHotkey?: (name: string, item: ItemInstance<T>, element: HTMLElement) => void; onTreeHotkey?: (name: string, element: HTMLElement) => void }; hotkeys: never; itemInstance: {}; state: {}; treeInstance: {} }

              Type parameters

              • T

              Type declaration

              • config: { hotkeys?: CustomHotkeysConfig<T>; onItemHotkey?: (name: string, item: ItemInstance<T>, element: HTMLElement) => void; onTreeHotkey?: (name: string, element: HTMLElement) => void }
                • optionalhotkeys?: CustomHotkeysConfig<T>
                • optionalonItemHotkey?: (name: string, item: ItemInstance<T>, element: HTMLElement) => void
                    • (name: string, item: ItemInstance<T>, element: HTMLElement): void
                    • Parameters

                      Returns void

                • optionalonTreeHotkey?: (name: string, element: HTMLElement) => void
                    • (name: string, element: HTMLElement): void
                    • Parameters

                      • name: string
                      • element: HTMLElement

                      Returns void

              • hotkeys: never
              • itemInstance: {}
                • state: {}
                  • treeInstance: {}

                    HotkeysCoreFeatureHotkeys

                    HotkeysCoreFeatureHotkeys<T>: HotkeysCoreFeatureDef<T>[hotkeys]

                    Type parameters

                    • T

                    InstanceBuilder

                    InstanceBuilder: <T>(features: FeatureImplementation[], instanceType: T, buildOpts: (self: any) => any) => [instance: InstanceTypeMap[T], finalize: () => void]

                    Type declaration

                      • <T>(features: FeatureImplementation[], instanceType: T, buildOpts: (self: any) => any): [instance: InstanceTypeMap[T], finalize: () => void]
                      • Type parameters

                        • T: keyof InstanceTypeMap

                        Parameters

                        Returns [instance: InstanceTypeMap[T], finalize: () => void]

                    ItemInstanceOpts

                    ItemInstanceOpts<ItemInstance, TreeInstance, Key>: { item: ItemInstance; itemId: string; prev: MayReturnNull<ItemInstance[Key]>; tree: TreeInstance }

                    Type parameters

                    • ItemInstance: FunctionMap = FunctionMap
                    • TreeInstance: FunctionMap = FunctionMap
                    • Key: keyof ItemInstance = any

                    Type declaration

                    • item: ItemInstance
                    • itemId: string
                    • prev: MayReturnNull<ItemInstance[Key]>
                    • tree: TreeInstance

                    ItemMeta

                    ItemMeta: { index: number; itemId: string; level: number; parentId: string; posInSet: number; setSize: number }

                    Type declaration

                    • index: number
                    • itemId: string
                    • level: number
                    • parentId: string
                    • posInSet: number
                    • setSize: number

                    MainFeatureDef

                    MainFeatureDef<T>: { config: { features?: FeatureImplementation<any>[]; initialState?: Partial<TreeState<T>>; instanceBuilder?: InstanceBuilder; setState?: SetStateFn<TreeState<T>>; state?: Partial<TreeState<T>> }; hotkeys: never; itemInstance: { getElement: () => HTMLElement | undefined | null; getItemMeta: () => ItemMeta; registerElement: (element: HTMLElement | null) => void }; state: {}; treeInstance: { getConfig: () => TreeConfig<T>; getElement: () => HTMLElement | undefined | null; getHotkeyPresets: () => HotkeysConfig<T>; getItemInstance: (itemId: string) => ItemInstance<T>; getItems: () => ItemInstance<T>[]; getState: () => TreeState<T>; rebuildTree: () => void; registerElement: (element: HTMLElement | null) => void; setConfig: SetStateFn<TreeConfig<T>>; setState: SetStateFn<TreeState<T>> } }

                    Type parameters

                    • T = any

                    Type declaration

                    MainFeatureHotkeys

                    MainFeatureHotkeys: MainFeatureDef[hotkeys]

                    RenamingFeatureDef

                    RenamingFeatureDef<T>: { config: { canRename?: (item: ItemInstance<T>) => boolean; onRename?: (item: ItemInstance<T>, value: string) => void; setRenamingItem?: SetStateFn<string | null>; setRenamingValue?: SetStateFn<string | undefined> }; hotkeys: renameItem | abortRenaming | completeRenaming; itemInstance: { canRename: () => boolean; getRenameInputProps: () => any; isRenaming: () => boolean }; state: { renamingItem?: string | null; renamingValue?: string }; treeInstance: { abortRenaming: () => void; completeRenaming: () => void; getRenamingItem: () => ItemInstance<T> | null; getRenamingValue: () => string; isRenamingItem: () => boolean; startRenamingItem: (itemId: string) => void } }

                    Type parameters

                    • T

                    Type declaration

                    • config: { canRename?: (item: ItemInstance<T>) => boolean; onRename?: (item: ItemInstance<T>, value: string) => void; setRenamingItem?: SetStateFn<string | null>; setRenamingValue?: SetStateFn<string | undefined> }
                    • hotkeys: renameItem | abortRenaming | completeRenaming
                    • itemInstance: { canRename: () => boolean; getRenameInputProps: () => any; isRenaming: () => boolean }
                      • canRename: () => boolean
                          • (): boolean
                          • Returns boolean

                      • getRenameInputProps: () => any
                          • (): any
                          • Returns any

                      • isRenaming: () => boolean
                          • (): boolean
                          • Returns boolean

                    • state: { renamingItem?: string | null; renamingValue?: string }
                      • optionalrenamingItem?: string | null
                      • optionalrenamingValue?: string
                    • treeInstance: { abortRenaming: () => void; completeRenaming: () => void; getRenamingItem: () => ItemInstance<T> | null; getRenamingValue: () => string; isRenamingItem: () => boolean; startRenamingItem: (itemId: string) => void }
                      • abortRenaming: () => void
                          • (): void
                          • Returns void

                      • completeRenaming: () => void
                          • (): void
                          • Returns void

                      • getRenamingItem: () => ItemInstance<T> | null
                      • getRenamingValue: () => string
                          • (): string
                          • Returns string

                      • isRenamingItem: () => boolean
                          • (): boolean
                          • Returns boolean

                      • startRenamingItem: (itemId: string) => void
                          • (itemId: string): void
                          • Parameters

                            • itemId: string

                            Returns void

                    RenamingFeatureHotkeys

                    RenamingFeatureHotkeys<T>: RenamingFeatureDef<T>[hotkeys]

                    Type parameters

                    • T

                    SearchFeatureDataRef

                    SearchFeatureDataRef<T>: HotkeysCoreDataRef & { matchingItems: ItemInstance<T>[]; searchInput: HTMLInputElement | null }

                    Type parameters

                    • T = any

                    SearchFeatureDef

                    SearchFeatureDef<T>: { config: { isSearchMatchingItem?: (search: string, item: ItemInstance<T>) => boolean; onCloseSearch?: () => void; onOpenSearch?: () => void; onSearchMatchesItems?: (search: string, items: ItemInstance<T>[]) => void; setSearch?: SetStateFn<string | null> }; hotkeys: openSearch | closeSearch | submitSearch | nextSearchItem | previousSearchItem; itemInstance: { isMatchingSearch: () => boolean }; state: { search: string | null }; treeInstance: { closeSearch: () => void; getSearchInputElement: () => HTMLInputElement | null; getSearchInputElementProps: () => any; getSearchMatchingItems: () => ItemInstance<T>[]; getSearchValue: () => string; isSearchOpen: () => boolean; openSearch: (initialValue?: string) => void; registerSearchInputElement: (element: HTMLInputElement | null) => void; setSearch: (search: string | null) => void } }

                    Type parameters

                    • T

                    Type declaration

                    • config: { isSearchMatchingItem?: (search: string, item: ItemInstance<T>) => boolean; onCloseSearch?: () => void; onOpenSearch?: () => void; onSearchMatchesItems?: (search: string, items: ItemInstance<T>[]) => void; setSearch?: SetStateFn<string | null> }
                      • optionalisSearchMatchingItem?: (search: string, item: ItemInstance<T>) => boolean
                      • optionalonCloseSearch?: () => void
                          • (): void
                          • Returns void

                      • optionalonOpenSearch?: () => void
                          • (): void
                          • Returns void

                      • optionalonSearchMatchesItems?: (search: string, items: ItemInstance<T>[]) => void
                      • optionalsetSearch?: SetStateFn<string | null>
                    • hotkeys: openSearch | closeSearch | submitSearch | nextSearchItem | previousSearchItem
                    • itemInstance: { isMatchingSearch: () => boolean }
                      • isMatchingSearch: () => boolean
                          • (): boolean
                          • Returns boolean

                    • state: { search: string | null }
                      • search: string | null
                    • treeInstance: { closeSearch: () => void; getSearchInputElement: () => HTMLInputElement | null; getSearchInputElementProps: () => any; getSearchMatchingItems: () => ItemInstance<T>[]; getSearchValue: () => string; isSearchOpen: () => boolean; openSearch: (initialValue?: string) => void; registerSearchInputElement: (element: HTMLInputElement | null) => void; setSearch: (search: string | null) => void }
                      • closeSearch: () => void
                          • (): void
                          • Returns void

                      • getSearchInputElement: () => HTMLInputElement | null
                          • (): HTMLInputElement | null
                          • Returns HTMLInputElement | null

                      • getSearchInputElementProps: () => any
                          • (): any
                          • Returns any

                      • getSearchMatchingItems: () => ItemInstance<T>[]
                      • getSearchValue: () => string
                          • (): string
                          • Returns string

                      • isSearchOpen: () => boolean
                          • (): boolean
                          • Returns boolean

                      • openSearch: (initialValue?: string) => void
                          • (initialValue?: string): void
                          • Parameters

                            • optionalinitialValue: string

                            Returns void

                      • registerSearchInputElement: (element: HTMLInputElement | null) => void
                          • (element: HTMLInputElement | null): void
                          • Parameters

                            • element: HTMLInputElement | null

                            Returns void

                      • setSearch: (search: string | null) => void
                          • (search: string | null): void
                          • Parameters

                            • search: string | null

                            Returns void

                    SearchFeatureHotkeys

                    SearchFeatureHotkeys<T>: SearchFeatureDef<T>[hotkeys]

                    Type parameters

                    • T

                    SelectionFeatureDef

                    SelectionFeatureDef<T>: { config: { setSelectedItems?: SetStateFn<string[]> }; hotkeys: toggleSelectItem | selectUpwards | selectDownwards | selectUpwardsCtrl | selectDownwardsCtrl | selectAll; itemInstance: { deselect: () => void; isSelected: () => boolean; select: () => void; selectUpTo: (ctrl: boolean) => void; toggleSelect: () => void }; state: { selectedItems: string[] }; treeInstance: { getSelectedItems: () => ItemInstance<T>[]; setSelectedItems: (selectedItems: string[]) => void } }

                    Type parameters

                    • T

                    Type declaration

                    • config: { setSelectedItems?: SetStateFn<string[]> }
                    • hotkeys: toggleSelectItem | selectUpwards | selectDownwards | selectUpwardsCtrl | selectDownwardsCtrl | selectAll
                    • itemInstance: { deselect: () => void; isSelected: () => boolean; select: () => void; selectUpTo: (ctrl: boolean) => void; toggleSelect: () => void }
                      • deselect: () => void
                          • (): void
                          • Returns void

                      • isSelected: () => boolean
                          • (): boolean
                          • Returns boolean

                      • select: () => void
                          • (): void
                          • Returns void

                      • selectUpTo: (ctrl: boolean) => void
                          • (ctrl: boolean): void
                          • Parameters

                            • ctrl: boolean

                            Returns void

                      • toggleSelect: () => void
                          • (): void
                          • Returns void

                    • state: { selectedItems: string[] }
                      • selectedItems: string[]
                    • treeInstance: { getSelectedItems: () => ItemInstance<T>[]; setSelectedItems: (selectedItems: string[]) => void }
                      • getSelectedItems: () => ItemInstance<T>[]
                      • setSelectedItems: (selectedItems: string[]) => void
                          • (selectedItems: string[]): void
                          • Parameters

                            • selectedItems: string[]

                            Returns void

                    SelectionFeatureHotkeys

                    SelectionFeatureHotkeys<T>: SelectionFeatureDef<T>[hotkeys]

                    Type parameters

                    • T

                    SetStateFn

                    SetStateFn<T>: (updaterOrValue: Updater<T>) => void

                    Type parameters

                    • T

                    Type declaration

                      • Parameters

                        Returns void

                    SyncDataLoaderFeatureDef

                    SyncDataLoaderFeatureDef<T>: { config: { dataLoader?: SyncTreeDataLoader<T>; rootItemId: string }; hotkeys: never; itemInstance: { isLoading: () => boolean }; state: {}; treeInstance: { retrieveChildrenIds: (itemId: string) => string[]; retrieveItemData: (itemId: string) => T } }

                    Type parameters

                    • T

                    Type declaration

                    • config: { dataLoader?: SyncTreeDataLoader<T>; rootItemId: string }
                    • hotkeys: never
                    • itemInstance: { isLoading: () => boolean }
                      • isLoading: () => boolean
                          • (): boolean
                          • Returns boolean

                    • state: {}
                      • treeInstance: { retrieveChildrenIds: (itemId: string) => string[]; retrieveItemData: (itemId: string) => T }
                        • retrieveChildrenIds: (itemId: string) => string[]
                            • (itemId: string): string[]
                            • Parameters

                              • itemId: string

                              Returns string[]

                        • retrieveItemData: (itemId: string) => T
                            • (itemId: string): T
                            • Parameters

                              • itemId: string

                              Returns T

                      SyncDataLoaderFeatureHotkeys

                      SyncDataLoaderFeatureHotkeys<T>: SyncDataLoaderFeatureDef<T>[hotkeys]

                      Type parameters

                      • T

                      SyncTreeDataLoader

                      SyncTreeDataLoader<T>: { getChildren: (itemId: string) => string[]; getItem: (itemId: string) => T }

                      Type parameters

                      • T

                      Type declaration

                      • getChildren: (itemId: string) => string[]
                          • (itemId: string): string[]
                          • Parameters

                            • itemId: string

                            Returns string[]

                      • getItem: (itemId: string) => T
                          • (itemId: string): T
                          • Parameters

                            • itemId: string

                            Returns T

                      TreeFeatureDef

                      TreeFeatureDef<T>: { config: { getItemName: (item: ItemInstance<T>) => string; isItemFolder: (item: ItemInstance<T>) => boolean; onPrimaryAction?: (item: ItemInstance<T>) => void; scrollToItem?: (item: ItemInstance<T>) => void; setExpandedItems?: SetStateFn<string[]>; setFocusedItem?: SetStateFn<string | null> }; hotkeys: focusNextItem | focusPreviousItem | expandOrDown | collapseOrUp | focusFirstItem | focusLastItem; itemInstance: { collapse: () => void; expand: () => void; getChildren: () => ItemInstance<T>[]; getId: () => string; getIndexInParent: () => number; getItemAbove: () => ItemInstance<T> | null; getItemBelow: () => ItemInstance<T> | null; getItemData: () => T; getItemName: () => string; getMemoizedProp: <X>(name: string, create: () => X, deps?: any[]) => X; getParent: () => ItemInstance<T>; getProps: () => Record<string, any>; getTree: () => TreeInstance<T>; isExpanded: () => boolean; isFocused: () => boolean; isFolder: () => boolean; primaryAction: () => void; scrollTo: (scrollIntoViewArg?: boolean | ScrollIntoViewOptions) => Promise<void>; setFocused: () => void }; state: { expandedItems: string[]; focusedItem: string | null }; treeInstance: { collapseItem: (itemId: string) => void; expandItem: (itemId: string) => void; focusItem: (itemId: string) => void; focusNextItem: () => void; focusPreviousItem: () => void; getContainerProps: () => Record<string, any>; getFocusedItem: () => ItemInstance<any>; isItemExpanded: (itemId: string) => boolean; updateDomFocus: () => void } }

                      Type parameters

                      • T

                      Type declaration

                      • config: { getItemName: (item: ItemInstance<T>) => string; isItemFolder: (item: ItemInstance<T>) => boolean; onPrimaryAction?: (item: ItemInstance<T>) => void; scrollToItem?: (item: ItemInstance<T>) => void; setExpandedItems?: SetStateFn<string[]>; setFocusedItem?: SetStateFn<string | null> }
                      • hotkeys: focusNextItem | focusPreviousItem | expandOrDown | collapseOrUp | focusFirstItem | focusLastItem
                      • itemInstance: { collapse: () => void; expand: () => void; getChildren: () => ItemInstance<T>[]; getId: () => string; getIndexInParent: () => number; getItemAbove: () => ItemInstance<T> | null; getItemBelow: () => ItemInstance<T> | null; getItemData: () => T; getItemName: () => string; getMemoizedProp: <X>(name: string, create: () => X, deps?: any[]) => X; getParent: () => ItemInstance<T>; getProps: () => Record<string, any>; getTree: () => TreeInstance<T>; isExpanded: () => boolean; isFocused: () => boolean; isFolder: () => boolean; primaryAction: () => void; scrollTo: (scrollIntoViewArg?: boolean | ScrollIntoViewOptions) => Promise<void>; setFocused: () => void }
                        • collapse: () => void
                            • (): void
                            • Returns void

                        • expand: () => void
                            • (): void
                            • Returns void

                        • getChildren: () => ItemInstance<T>[]
                        • getId: () => string
                            • (): string
                            • Returns string

                        • getIndexInParent: () => number
                            • (): number
                            • Returns number

                        • getItemAbove: () => ItemInstance<T> | null
                        • getItemBelow: () => ItemInstance<T> | null
                        • getItemData: () => T
                            • (): T
                            • Returns T

                        • getItemName: () => string
                            • (): string
                            • Returns string

                        • getMemoizedProp: <X>(name: string, create: () => X, deps?: any[]) => X
                            • <X>(name: string, create: () => X, deps?: any[]): X
                            • Type parameters

                              • X

                              Parameters

                              • name: string
                              • create: () => X
                              • optionaldeps: any[]

                              Returns X

                        • getParent: () => ItemInstance<T>
                        • getProps: () => Record<string, any>
                            • (): Record<string, any>
                            • Returns Record<string, any>

                        • getTree: () => TreeInstance<T>
                        • isExpanded: () => boolean
                            • (): boolean
                            • Returns boolean

                        • isFocused: () => boolean
                            • (): boolean
                            • Returns boolean

                        • isFolder: () => boolean
                            • (): boolean
                            • Returns boolean

                        • primaryAction: () => void
                            • (): void
                            • Returns void

                        • scrollTo: (scrollIntoViewArg?: boolean | ScrollIntoViewOptions) => Promise<void>
                            • (scrollIntoViewArg?: boolean | ScrollIntoViewOptions): Promise<void>
                            • Parameters

                              • optionalscrollIntoViewArg: boolean | ScrollIntoViewOptions

                              Returns Promise<void>

                        • setFocused: () => void
                            • (): void
                            • Returns void

                      • state: { expandedItems: string[]; focusedItem: string | null }
                        • expandedItems: string[]
                        • focusedItem: string | null
                      • treeInstance: { collapseItem: (itemId: string) => void; expandItem: (itemId: string) => void; focusItem: (itemId: string) => void; focusNextItem: () => void; focusPreviousItem: () => void; getContainerProps: () => Record<string, any>; getFocusedItem: () => ItemInstance<any>; isItemExpanded: (itemId: string) => boolean; updateDomFocus: () => void }
                        • collapseItem: (itemId: string) => void
                            • (itemId: string): void
                            • Parameters

                              • itemId: string

                              Returns void

                        • expandItem: (itemId: string) => void
                            • (itemId: string): void
                            • Parameters

                              • itemId: string

                              Returns void

                        • focusItem: (itemId: string) => void
                            • (itemId: string): void
                            • Parameters

                              • itemId: string

                              Returns void

                        • focusNextItem: () => void
                            • (): void
                            • Returns void

                        • focusPreviousItem: () => void
                            • (): void
                            • Returns void

                        • getContainerProps: () => Record<string, any>
                            • (): Record<string, any>
                            • Returns Record<string, any>

                        • getFocusedItem: () => ItemInstance<any>
                        • isItemExpanded: (itemId: string) => boolean
                            • (itemId: string): boolean
                            • Parameters

                              • itemId: string

                              Returns boolean

                        • updateDomFocus: () => void
                            • (): void
                            • Returns void

                      TreeFeatureHotkeys

                      TreeFeatureHotkeys<T>: TreeFeatureDef<T>[hotkeys]

                      Type parameters

                      • T

                      TreeInstanceOpts

                      TreeInstanceOpts<TreeInstance, Key>: { prev: MayReturnNull<TreeInstance[Key]>; tree: TreeInstance }

                      Type parameters

                      • TreeInstance: FunctionMap = FunctionMap
                      • Key: keyof TreeInstance = any

                      Type declaration

                      • prev: MayReturnNull<TreeInstance[Key]>
                      • tree: TreeInstance

                      TreeItemDataRef

                      TreeItemDataRef: { memoizedDeps: Record<string, any[] | undefined>; memoizedValues: Record<string, any> }

                      Type declaration

                      • memoizedDeps: Record<string, any[] | undefined>
                      • memoizedValues: Record<string, any>

                      Updater

                      Updater<T>: T | (old: T) => T

                      Type parameters

                      • T

                      constasyncDataLoaderFeature

                      constdragAndDropFeature

                      dragAndDropFeature: FeatureImplementation<any, DragAndDropFeatureDef<any>, FeatureDefs<any>> = ...

                      constexpandAllFeature

                      consthotkeysCoreFeature

                      constrenamingFeature

                      constsearchFeature

                      constselectionFeature

                      constsyncDataLoaderFeature