-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP commit, Implementing plugin API schema
- Loading branch information
Showing
8 changed files
with
99 additions
and
36 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
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { IpcMainInvokeEvent } from 'electron'; | ||
import project from 'main/project'; | ||
|
||
export default async function getFileTypes( | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
event: IpcMainInvokeEvent, | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
_: undefined | ||
): Promise<string[]> { | ||
const pluginsService = project.pluginsService; | ||
const fileTypes = pluginsService.getFileTypePlugins(); | ||
return ['ok']; | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
type ConnectionInfo = { | ||
in: number; | ||
out: number; | ||
}; | ||
|
||
type NodeInfo = { | ||
type: string; | ||
connection: ConnectionInfo; | ||
}; | ||
|
||
// builder.flowView.setFileType('xxx') // *.xxx | ||
// builder.flowView.setNodes(xxx) | ||
// builder.globalShortcut.setShortcutAction(yyy) | ||
|
||
class FlowViewBuilder { | ||
#fileType: string | null = null; | ||
|
||
#nodes: NodeInfo[] | null = null; | ||
|
||
setFileType(extension: string) { | ||
this.#fileType = extension; | ||
return this; | ||
} | ||
|
||
setNodes(nodes: NodeInfo[]) { | ||
this.#nodes = nodes; | ||
return this; | ||
} | ||
|
||
// TODO: making these build functions private can help with a well constructed API | ||
build() { | ||
const fileType = this.#fileType; | ||
const nodes = this.#nodes; | ||
return { fileType, nodes }; | ||
} | ||
} | ||
|
||
export default class PluginBuilder { | ||
flowView: FlowViewBuilder; | ||
|
||
constructor() { | ||
this.flowView = new FlowViewBuilder(); | ||
} | ||
|
||
build() { | ||
const flowViewBuilder = this.flowView; | ||
const flowView = flowViewBuilder.build(); | ||
return { flowView }; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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