-
Notifications
You must be signed in to change notification settings - Fork 17
Utilities
Chad Shurtz edited this page Aug 30, 2016
·
1 revision
A set of utility functions are provided at notebookUtils.ts to allow the application developer to traverse notebooks.
These utilities are a WIP, and more will be added in the future.
OneNoteApi.NotebookUtils.sectionExistsInNotebooks(notebooks /* Notebook[] */, sectionId /* string */); // true/false
OneNoteApi.NotebookUtils.sectionExistsInParent(parent /* Notebook | SectionGroup */, sectionId /* string */); // true/false
// Returns section path (e.g., [Notebook, SectionGroup, ..., Section]
OneNoteApi.NotebookUtils.getPathFromNotebooksToSection(notebooks /* Notebook[] */, function(section) {
return section.name === "The section I want";
});
OneNoteApi.NotebookUtils.getPathFromParentToSection(parent /* Notebook | SectionGroup */, function(section) {
return section.name === "The section I want"
});
OneNoteApi.NotebookUtils.getDepthOfNotebooks(notebooks /* Notebook[] */); // Number
OneNoteApi.NotebookUtils.getDepthOfParent(parent /* Notebook | SectionGroup */); // Number