Skip to content

Commit

Permalink
feat(API): ✨ Add refreshIndex method (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
SkepticMystic committed Apr 17, 2022
1 parent 42b2b67 commit f9b97b9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
3 changes: 3 additions & 0 deletions src/API.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
iterateHiers,
} from "./Utils/HierUtils";
import { createIndex } from "./Commands/CreateIndex";
import { refreshIndex } from "./refreshIndex";

export class BCAPI implements BCAPII {
app: App;
Expand All @@ -37,6 +38,8 @@ export class BCAPI implements BCAPII {

public buildObsGraph = () => buildObsGraph(this.app);

public refreshIndex = async () => await refreshIndex(this.plugin)

public getSubInDirs = (dirs: Directions[], g = this.mainG) =>
getSubInDirs(g, ...dirs);

Expand Down
17 changes: 10 additions & 7 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@ export type RawValue =
export interface dvFrontmatterCache {
file: TFile;
[field: string]:
| string
| string[]
| string[][]
| dvLink
| dvLink[]
| Pos
| TFile;
| string
| string[]
| string[][]
| dvLink
| dvLink[]
| Pos
| TFile;
}

export type Directions = typeof DIRECTIONS[number];
Expand Down Expand Up @@ -352,6 +352,9 @@ export interface BCAPII {
/** Build the obsidian graph as a graphology MultiGraph */
buildObsGraph: () => MultiGraph;

/** Refresh the Breadcrumb Index programmatically. */
refreshIndex: () => Promise<void>

/**
* Return a subgraph of all nodes & edges with `dirs.includes(a.dir)`
*
Expand Down

0 comments on commit f9b97b9

Please sign in to comment.