|
4 | 4 |
|
5 | 5 | namespace Elastic.Documentation.Site.Navigation; |
6 | 6 |
|
7 | | -public interface INavigationModel; |
| 7 | +/// Represents navigation model data for documentation elements. |
| 8 | +public interface INavigationModel |
| 9 | +{ |
| 10 | + // This interface serves as a marker interface for navigation models |
| 11 | + // It's used as a constraint in other navigation-related interfaces |
| 12 | +} |
8 | 13 |
|
| 14 | +/// Represents an item in the navigation hierarchy. |
9 | 15 | public interface INavigationItem |
10 | 16 | { |
| 17 | + /// Gets the URL for this navigation item. |
11 | 18 | string Url { get; } |
| 19 | + |
| 20 | + /// Gets the title displayed in navigation. |
12 | 21 | string NavigationTitle { get; } |
| 22 | + |
| 23 | + /// Gets the root navigation item. |
13 | 24 | INodeNavigationItem<INavigationModel, INavigationItem> NavigationRoot { get; } |
14 | 25 |
|
15 | | - //TODO the setter smells |
| 26 | + /// <summary> |
| 27 | + /// Gets or sets the parent navigation item. |
| 28 | + /// </summary> |
| 29 | + /// <remarks> |
| 30 | + /// TODO: This should be read-only however currently needs the setter in assembler. |
| 31 | + /// </remarks> |
16 | 32 | INodeNavigationItem<INavigationModel, INavigationItem>? Parent { get; set; } |
17 | 33 | } |
18 | 34 |
|
| 35 | +/// Represents a leaf node in the navigation tree with associated model data. |
| 36 | +/// <typeparam name="TModel">The type attached to the navigation model.</typeparam> |
19 | 37 | public interface ILeafNavigationItem<out TModel> : INavigationItem |
20 | 38 | where TModel : INavigationModel |
21 | 39 | { |
| 40 | + /// Gets the navigation model associated with this navigation item. |
22 | 41 | TModel Model { get; } |
23 | 42 | } |
24 | 43 |
|
25 | | -public interface INodeNavigationItem<out TIndex, out TChildNavigation> |
26 | | - : INavigationItem |
| 44 | + |
| 45 | +/// Represents a node in the navigation tree that can contain child items. |
| 46 | +/// <typeparam name="TIndex">The type of the index model.</typeparam> |
| 47 | +/// <typeparam name="TChildNavigation">The type of child navigation items.</typeparam> |
| 48 | +public interface INodeNavigationItem<out TIndex, out TChildNavigation> : INavigationItem |
27 | 49 | where TIndex : INavigationModel |
28 | 50 | where TChildNavigation : INavigationItem |
29 | 51 | { |
| 52 | + /// Gets the depth level in the navigation hierarchy. |
30 | 53 | int Depth { get; } |
| 54 | + |
| 55 | + /// Gets the unique identifier for this node. |
31 | 56 | string Id { get; } |
| 57 | + |
| 58 | + /// Gets the index model associated with this node. |
32 | 59 | TIndex Index { get; } |
| 60 | + |
| 61 | + /// <summary> |
| 62 | + /// Gets the collection of child navigation items. |
| 63 | + /// </summary> |
33 | 64 | IReadOnlyCollection<TChildNavigation> NavigationItems { get; } |
34 | 65 | } |
35 | | - |
|
0 commit comments