-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: plugin add get\getAll\has\delete api
- Loading branch information
Showing
10 changed files
with
178 additions
and
3 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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
title: plugin-instance | ||
sidebar_position: 12 | ||
--- | ||
|
||
> **@types** [IPublicModelPluginInstance](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/model/plugin-instance.ts)<br/> | ||
> **@since** v1.1.0 | ||
|
||
## 基本介绍 | ||
|
||
插件实例 | ||
|
||
## 属性 | ||
|
||
### pluginName | ||
|
||
插件名字 | ||
|
||
```typescript | ||
get name(): string; | ||
``` | ||
|
||
### dep | ||
|
||
插件依赖 | ||
|
||
```typescript | ||
get dep(): string[]; | ||
``` | ||
|
||
### disabled | ||
|
||
插件是否禁用 | ||
|
||
```typescript | ||
get disabled(): boolean | ||
|
||
set disabled(disabled: boolean): void; | ||
|
||
``` | ||
|
||
### meta | ||
|
||
插件 meta 信息 | ||
|
||
```typescript | ||
get meta(): IPublicTypePluginMeta | ||
|
||
``` | ||
|
||
- [IPublicTypePluginMeta](https://github.com/alibaba/lowcode-engine/blob/main/packages/types/src/shell/type/plugin-meta.ts) | ||
|
||
|
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,31 @@ | ||
import { ILowCodePluginRuntime } from '@alilc/lowcode-designer'; | ||
import { IPublicModelPluginInstance } from '@alilc/lowcode-types'; | ||
import { pluginInstanceSymbol } from '../symbols'; | ||
|
||
export class PluginInstance implements IPublicModelPluginInstance { | ||
private readonly [pluginInstanceSymbol]: ILowCodePluginRuntime; | ||
|
||
constructor(pluginInstance: ILowCodePluginRuntime) { | ||
this[pluginInstanceSymbol] = pluginInstance; | ||
} | ||
|
||
get pluginName(): string { | ||
return this[pluginInstanceSymbol].name; | ||
} | ||
|
||
get dep(): string[] { | ||
return this[pluginInstanceSymbol].dep; | ||
} | ||
|
||
get disabled(): boolean { | ||
return this[pluginInstanceSymbol].disabled; | ||
} | ||
|
||
set disabled(disabled: boolean) { | ||
this[pluginInstanceSymbol].setDisabled(disabled); | ||
} | ||
|
||
get meta() { | ||
return this[pluginInstanceSymbol].meta; | ||
} | ||
} |
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,11 @@ | ||
import { IPublicTypePluginMeta } from '../type/plugin-meta'; | ||
|
||
export interface IPublicModelPluginInstance { | ||
pluginName: string; | ||
|
||
dep: string[]; | ||
|
||
disabled: boolean; | ||
|
||
meta: IPublicTypePluginMeta; | ||
} |