-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Plugins: Use types on typescript for plugins
* Create typescript types and parse the json string directly in ts-bindings * Use files directly instead of directories for typescript types. * Rust: Set render options in a box for parser * Fix linting issues on typescript
- Loading branch information
1 parent
598a838
commit fa45a79
Showing
12 changed files
with
105 additions
and
45 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
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
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
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,63 @@ | ||
export interface PluginEntity { | ||
dir_path: string; | ||
plugin_type: PluginType; | ||
state: PluginState; | ||
metadata: PluginMetadata | null; | ||
} | ||
|
||
export enum PluginType { | ||
Parser = 'Parser', | ||
ByteSource = 'ByteSource', | ||
} | ||
|
||
export type PluginState = | ||
| { type: 'Active'; state: ActiveState } | ||
| { type: 'Invalid'; state: InvalidState }; | ||
|
||
export interface ActiveState { | ||
wasm_file_path: string; | ||
api_version: Version; | ||
plugin_version: Version; | ||
config_schemas: ConfigSchema[]; | ||
render_options: RenderOptions; | ||
} | ||
|
||
export interface InvalidState { | ||
error_msg: string; | ||
} | ||
|
||
export interface Version { | ||
major: number; | ||
minor: number; | ||
patch: number; | ||
} | ||
|
||
export type ConfigSchemaType = | ||
| { type: 'Boolean' } | ||
| { type: 'Number' } | ||
| { type: 'Float' } | ||
| { type: 'Text' } | ||
| { type: 'Path' } | ||
| { type: 'Dropdown'; options: string[] }; | ||
|
||
export interface ConfigSchema { | ||
id: string; | ||
title: string; | ||
description: string; | ||
input_type: ConfigSchemaType; | ||
} | ||
|
||
export type RenderOptions = | ||
| { type: PluginType.Parser; options: ParserRenderOptions } | ||
| { type: PluginType.ByteSource }; | ||
|
||
export interface ParserRenderOptions { | ||
Parser: { | ||
headers: null; | ||
}; | ||
} | ||
|
||
export interface PluginMetadata { | ||
name: string; | ||
description: string; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.