UNPKG

5.08 kBTypeScriptView Raw
1import { _SPCollection, _SPInstance, _SPQueryable, IDeleteable, ISPQueryable } from "../spqueryable.js";
2/**
3 * Represents a collection of navigation nodes
4 *
5 */
6export declare class _NavigationNodes extends _SPCollection<INavNodeInfo[]> {
7 /**
8 * Gets a navigation node by id
9 *
10 * @param id The id of the node
11 */
12 getById(id: number): INavigationNode;
13 /**
14 * Adds a new node to the collection
15 *
16 * @param title Display name of the node
17 * @param url The url of the node
18 * @param visible If true the node is visible, otherwise it is hidden (default: true)
19 */
20 add(title: string, url: string, visible?: boolean): Promise<INavigationNodeAddResult>;
21 /**
22 * Moves a node to be after another node in the navigation
23 *
24 * @param nodeId Id of the node to move
25 * @param previousNodeId Id of the node after which we move the node specified by nodeId
26 */
27 moveAfter(nodeId: number, previousNodeId: number): Promise<void>;
28}
29export interface INavigationNodes extends _NavigationNodes {
30}
31export declare const NavigationNodes: import("../spqueryable.js").ISPInvokableFactory<INavigationNodes>;
32/**
33 * Represents an instance of a navigation node
34 *
35 */
36export declare class _NavigationNode extends _SPInstance<INavNodeInfo> {
37 delete: (this: ISPQueryable<any>) => Promise<void>;
38 /**
39 * Represents the child nodes of this node
40 */
41 get children(): INavigationNodes;
42 /**
43 * Updates this node
44 *
45 * @param properties Properties used to update this node
46 */
47 update(properties: Partial<INavNodeInfo>): Promise<INavNodeUpdateResult>;
48}
49export interface INavigationNode extends _NavigationNode, IDeleteable {
50}
51export declare const NavigationNode: import("../spqueryable.js").ISPInvokableFactory<INavigationNode>;
52export interface INavNodeUpdateResult {
53 data: any;
54 node: INavigationNode;
55}
56/**
57 * Exposes the navigation components
58 *
59 */
60export declare class _Navigation extends _SPQueryable {
61 /**
62 * Gets the quicklaunch navigation nodes for the current context
63 *
64 */
65 get quicklaunch(): INavigationNodes;
66 /**
67 * Gets the top bar navigation nodes for the current context
68 *
69 */
70 get topNavigationBar(): INavigationNodes;
71}
72export interface INavigation {
73 readonly quicklaunch: INavigationNodes;
74 readonly topNavigationBar: INavigationNodes;
75}
76export declare const Navigation: INavigation;
77/**
78 * Represents the top level navigation service
79 */
80export declare class _NavigationService extends _SPQueryable {
81 constructor(base?: string | ISPQueryable, path?: string);
82 /**
83 * The MenuState service operation returns a Menu-State (dump) of a SiteMapProvider on a site.
84 *
85 * @param menuNodeKey MenuNode.Key of the start node within the SiteMapProvider If no key is provided the SiteMapProvider.RootNode will be the root of the menu state.
86 * @param depth Depth of the dump. If no value is provided a dump with the depth of 10 is returned
87 * @param mapProviderName The name identifying the SiteMapProvider to be used
88 * @param customProperties comma seperated list of custom properties to be returned.
89 */
90 getMenuState(menuNodeKey?: string, depth?: number, mapProviderName?: string, customProperties?: string): Promise<IMenuNodeCollection>;
91 /**
92 * Tries to get a SiteMapNode.Key for a given URL within a site collection.
93 *
94 * @param currentUrl A url representing the SiteMapNode
95 * @param mapProviderName The name identifying the SiteMapProvider to be used
96 */
97 getMenuNodeKey(currentUrl: string, mapProviderName?: string): Promise<string>;
98}
99export interface INavigationService extends _NavigationService {
100}
101export declare const NavigationService: (base?: string | ISPQueryable, path?: string) => INavigationService;
102export interface IMenuNode {
103 CustomProperties: any[];
104 FriendlyUrlSegment: string;
105 IsDeleted: boolean;
106 IsHidden: boolean;
107 Key: string;
108 Nodes: IMenuNode[];
109 NodeType: number;
110 SimpleUrl: string;
111 Title: string;
112}
113export interface IMenuNodeCollection {
114 FriendlyUrlPrefix: string;
115 Nodes: IMenuNode[];
116 SimpleUrl: string;
117 SPSitePrefix: string;
118 SPWebPrefix: string;
119 StartingNodeKey: string;
120 StartingNodeTitle: string;
121 Version: Date;
122}
123export interface ISerializableNavigationNode {
124 Id: number;
125 Title: string;
126 Url: string;
127 IsDocLib: boolean;
128 IsExternal: boolean;
129 ParentId: number;
130 ListTemplateType: number;
131 AudienceIds: string[];
132 Children: ISerializableNavigationNode[];
133}
134/**
135 * Result from adding a navigation node
136 *
137 */
138export interface INavigationNodeAddResult {
139 data: INavNodeInfo;
140 node: INavigationNode;
141}
142/**
143 * Represents the information describing a navigation node
144 */
145export interface INavNodeInfo {
146 AudienceIds: string[] | null;
147 Id: number;
148 IsDocLib: boolean;
149 IsExternal: boolean;
150 IsVisible: boolean;
151 ListTemplateType: number;
152 Title: string;
153 Url: string;
154}
155//# sourceMappingURL=types.d.ts.map
\No newline at end of file