mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-11 18:42:56 +00:00
docs: improve comments for plugin-context
This commit is contained in:
parent
bbe438cf83
commit
16c4c96c66
@ -16,6 +16,7 @@ import {
|
|||||||
IPublicApiPlugins,
|
IPublicApiPlugins,
|
||||||
IPublicTypePluginDeclaration,
|
IPublicTypePluginDeclaration,
|
||||||
IPublicApiCanvas,
|
IPublicApiCanvas,
|
||||||
|
IPublicApiWorkspace,
|
||||||
} from '@alilc/lowcode-types';
|
} from '@alilc/lowcode-types';
|
||||||
import {
|
import {
|
||||||
IPluginContextOptions,
|
IPluginContextOptions,
|
||||||
@ -24,8 +25,8 @@ import {
|
|||||||
} from './plugin-types';
|
} from './plugin-types';
|
||||||
import { isValidPreferenceKey } from './plugin-utils';
|
import { isValidPreferenceKey } from './plugin-utils';
|
||||||
|
|
||||||
|
export default class PluginContext implements
|
||||||
export default class PluginContext implements IPublicModelPluginContext, ILowCodePluginContextPrivate {
|
IPublicModelPluginContext, ILowCodePluginContextPrivate {
|
||||||
hotkey: IPublicApiHotkey;
|
hotkey: IPublicApiHotkey;
|
||||||
project: IPublicApiProject;
|
project: IPublicApiProject;
|
||||||
skeleton: IPublicApiSkeleton;
|
skeleton: IPublicApiSkeleton;
|
||||||
@ -39,6 +40,7 @@ export default class PluginContext implements IPublicModelPluginContext, ILowCod
|
|||||||
preference: IPluginPreferenceMananger;
|
preference: IPluginPreferenceMananger;
|
||||||
pluginEvent: IPublicApiEvent;
|
pluginEvent: IPublicApiEvent;
|
||||||
canvas: IPublicApiCanvas;
|
canvas: IPublicApiCanvas;
|
||||||
|
workspace: IPublicApiWorkspace;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
options: IPluginContextOptions,
|
options: IPluginContextOptions,
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import {
|
|||||||
IPublicApiCanvas,
|
IPublicApiCanvas,
|
||||||
IPluginPreferenceMananger,
|
IPluginPreferenceMananger,
|
||||||
IPublicApiPlugins,
|
IPublicApiPlugins,
|
||||||
|
IPublicApiWorkspace,
|
||||||
} from '../api';
|
} from '../api';
|
||||||
import { IPublicModelEngineConfig } from './';
|
import { IPublicModelEngineConfig } from './';
|
||||||
|
|
||||||
@ -28,31 +29,88 @@ export interface IPublicModelPluginContext {
|
|||||||
* by using this, init options can be accessed from inside plugin
|
* by using this, init options can be accessed from inside plugin
|
||||||
*/
|
*/
|
||||||
preference: IPluginPreferenceMananger;
|
preference: IPluginPreferenceMananger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* skeleton API
|
||||||
|
* @tutorial https://lowcode-engine.cn/site/docs/api/skeleton
|
||||||
|
*/
|
||||||
get skeleton(): IPublicApiSkeleton;
|
get skeleton(): IPublicApiSkeleton;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* hotkey API
|
||||||
|
* @tutorial https://lowcode-engine.cn/site/docs/api/hotkey
|
||||||
|
*/
|
||||||
get hotkey(): IPublicApiHotkey;
|
get hotkey(): IPublicApiHotkey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* setter API
|
||||||
|
* @tutorial https://lowcode-engine.cn/site/docs/api/setters
|
||||||
|
*/
|
||||||
get setters(): IPublicApiSetters;
|
get setters(): IPublicApiSetters;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* config API
|
||||||
|
* @tutorial https://lowcode-engine.cn/site/docs/api/config
|
||||||
|
*/
|
||||||
get config(): IPublicModelEngineConfig;
|
get config(): IPublicModelEngineConfig;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* material API
|
||||||
|
* @tutorial https://lowcode-engine.cn/site/docs/api/material
|
||||||
|
*/
|
||||||
get material(): IPublicApiMaterial;
|
get material(): IPublicApiMaterial;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* event API
|
||||||
* this event works globally, can be used between plugins and engine.
|
* this event works globally, can be used between plugins and engine.
|
||||||
|
* @tutorial https://lowcode-engine.cn/site/docs/api/event
|
||||||
*/
|
*/
|
||||||
get event(): IPublicApiEvent;
|
get event(): IPublicApiEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* project API
|
||||||
|
* @tutorial https://lowcode-engine.cn/site/docs/api/project
|
||||||
|
*/
|
||||||
get project(): IPublicApiProject;
|
get project(): IPublicApiProject;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* common API
|
||||||
|
* @tutorial https://lowcode-engine.cn/site/docs/api/common
|
||||||
|
*/
|
||||||
get common(): IPublicApiCommon;
|
get common(): IPublicApiCommon;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* plugins API
|
||||||
|
* @tutorial https://lowcode-engine.cn/site/docs/api/plugins
|
||||||
|
*/
|
||||||
get plugins(): IPublicApiPlugins;
|
get plugins(): IPublicApiPlugins;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* logger API
|
||||||
|
* @tutorial https://lowcode-engine.cn/site/docs/api/logger
|
||||||
|
*/
|
||||||
get logger(): IPublicApiLogger;
|
get logger(): IPublicApiLogger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* this event works within current plugin, on an emit locally.
|
* this event works within current plugin, on an emit locally.
|
||||||
|
* @tutorial https://lowcode-engine.cn/site/docs/api/event
|
||||||
*/
|
*/
|
||||||
get pluginEvent(): IPublicApiEvent;
|
get pluginEvent(): IPublicApiEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* canvas API
|
||||||
|
* @tutorial https://lowcode-engine.cn/site/docs/api/canvas
|
||||||
|
*/
|
||||||
get canvas(): IPublicApiCanvas;
|
get canvas(): IPublicApiCanvas;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* workspace API
|
||||||
|
* @tutorial https://lowcode-engine.cn/site/docs/api/workspace
|
||||||
|
*/
|
||||||
|
get workspace(): IPublicApiWorkspace;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* @deprecated please use IPublicModelPluginContext instead
|
* @deprecated please use IPublicModelPluginContext instead
|
||||||
*/
|
*/
|
||||||
export interface ILowCodePluginContext extends IPublicModelPluginContext {
|
export interface ILowCodePluginContext extends IPublicModelPluginContext {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user