element-book
Version:
An [`element-vir`](https://npmjs.com/package/element-vir) drop-in element for building, testing, and demonstrating a collection of elements (or, in other words, a design system).
33 lines (32 loc) • 1.13 kB
TypeScript
import { type PartialWithUndefined } from '@augment-vir/common';
import { type BookTreeNode } from '../../book-tree/book-tree-node.js';
import { type BookPageControlsValues } from './book-page-controls.js';
/**
* Nested page controls.
*
* @category Internal
*/
export type ControlsWrapper = {
children: {
[Breadcrumb: string]: ControlsWrapper;
};
controls: BookPageControlsValues;
};
/**
* Find the controls at the given breadcrumbs.
*
* @category Internal
*/
export declare function traverseControls(controlsWrapper: ControlsWrapper, fullUrlBreadcrumbs: ReadonlyArray<string>): BookPageControlsValues;
/**
* Add new controls at the given breadcrumbs.
*
* @category Internal
*/
export declare function createNewControls(controlsWrapper: Readonly<ControlsWrapper>, breadcrumbsForNewValue: ReadonlyArray<string>, newValues: BookPageControlsValues): ControlsWrapper;
/**
* Add new controls from the given tree node.
*
* @category Internal
*/
export declare function updateTreeControls(node: BookTreeNode, existingControls: PartialWithUndefined<ControlsWrapper> | undefined): ControlsWrapper;