generated from obsidianmd/obsidian-sample-plugin
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(API): ✨ Expose more function on API + Add API to global window o…
…bject
- Loading branch information
1 parent
f3e125b
commit ad20594
Showing
6 changed files
with
17,064 additions
and
17,005 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,30 @@ | ||
export {}; | ||
// import type { MultiGraph } from "graphology"; | ||
// import type { App } from "obsidian"; | ||
// import type BCPlugin from "./main"; | ||
// import { buildObsGraph } from "./Utils/graphUtils"; | ||
// import type { BCAPIInterface } from "./interfaces"; | ||
import type { App } from "obsidian"; | ||
import type { BCAPII, Directions } from "./interfaces"; | ||
import type BCPlugin from "./main"; | ||
import { | ||
buildObsGraph, | ||
dfsAllPaths, | ||
getSubForFields, | ||
getSubInDirs, | ||
} from "./Utils/graphUtils"; | ||
|
||
// export class BCAPI implements BCAPIInterface { | ||
// app: App; | ||
// mainG: MultiGraph; | ||
// closedG: MultiGraph; | ||
export class BCAPI implements BCAPII { | ||
app: App; | ||
plugin: BCPlugin; | ||
|
||
// public constructor(app: App, mainG: MultiGraph, closedG: MultiGraph) { | ||
// this.app = app; | ||
// this.mainG = mainG; | ||
// this.closedG = closedG; | ||
// } | ||
public constructor(app: App, plugin: BCPlugin) { | ||
this.app = app; | ||
this.plugin = plugin; | ||
} | ||
|
||
// public buildObsG() { | ||
// buildObsGraph; | ||
// } | ||
// } | ||
public buildObsGraph = () => buildObsGraph(this.app); | ||
|
||
public getSubInDirs = (dirs: Directions[], g = this.plugin.mainG) => | ||
getSubInDirs(g, ...dirs); | ||
|
||
public getSubForFields = (fields: string[], g = this.plugin.mainG) => | ||
getSubForFields(g, fields); | ||
|
||
public dfsAllPaths = (fromNode: string, g = this.plugin.mainG) => | ||
dfsAllPaths(g, fromNode); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
export { buildObsGraph } from "./Utils/graphUtils"; | ||
export { | ||
buildObsGraph, | ||
getSubInDirs, | ||
getSubForFields, | ||
dfsAllPaths, | ||
} from "./Utils/graphUtils"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters