Skip to content

Commit 055a3ca

Browse files
committed
docs: remove deprecated api
1 parent 1ecdca1 commit 055a3ca

File tree

3 files changed

+10
-181
lines changed

3 files changed

+10
-181
lines changed

docs/apis/ScriptAPI/Ll.md

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,6 @@ Some interfaces related to loader operations are provided here.
2525
- Return value: loader version
2626
- Return value type: `String`
2727

28-
29-
30-
### Check LeviLamina version
31-
32-
`ll.requireVersion(major[,minor,revision])`
33-
34-
- Parameter:
35-
- major: `Integer`
36-
Check if the major version number of the currently installed LL is >= this value.
37-
- minor: `Integer` (optional parameter)
38-
Check if the minor version number of the currently installed LL is >= this value.
39-
- revision: `Integer` (optional parameter)
40-
Check if the revision number of the currently installed LL is >= this value.
41-
- Return value: Test result
42-
- Return value type: `Boolean`
43-
44-
If the detection finds that the currently installed version of LLSE is lower than the value passed in, it will return `false`.
45-
You can choose to judge based on the results and report an error to remind users to upgrade their LeviLamina version.
46-
47-
48-
4928
### Get information about Plugin
5029

5130
`ll.getPluginInfo(name)`
@@ -66,27 +45,20 @@ You can choose to judge based on the results and report an error to remind users
6645
| plugin.filePath | Path to plugin | `String` |
6746
| plugin.others | Other information | `Object` |
6847

69-
70-
71-
7248
### List all loaded plugins
7349

7450
`ll.listPlugins()`
7551

7652
- Return value: A list containing the names of all loaded plugin
7753
- Return value type: `Array<String,String,...>`
7854

79-
80-
8155
### List all loaded plugins with information
8256

8357
`ll.getAllPluginInfo()`
8458

8559
- Return value: A list containing the plugin objects of all loaded plugin
8660
- Return value type: `Array<Plugin,Plugin,...>`
8761

88-
89-
9062
### Remote Function Call
9163

9264
In order to allow the pre-plug-ins developed by developers to provide interfaces and services for other plug-ins, the remote function call function is provided here, so that one LLSE plug-in can call the existing functions in another plug-in.
@@ -109,8 +81,6 @@ In order to allow the pre-plug-ins developed by developers to provide interfaces
10981

11082
Note: If the namespace and name of the exported function are exactly the same as another already exported function, the export will fail. Please select the namespace and export name appropriately when exporting.
11183

112-
113-
11484
#### Import Function
11585

11686
After you have learned that there is a plug-in exporting function, in order to use the function exported by him, you first need to import this function into your own scripting system.
@@ -128,8 +98,6 @@ LLSE provides the interface import to import functions already exported by other
12898

12999
The return value of `ll.import` is a function. When you call this function, the cross-plugin call process will be done automatically in the background. The parameters of the calling function will be wrapped and passed to the remote function, and the return value of this function is the return value returned by the remote function after it has been executed.
130100

131-
132-
133101
#### Example of Remote Calling Function
134102

135103
For example, there is a plug-in that exports a function using the namespace AAA, and the name of the exported function is Welcome
@@ -141,8 +109,6 @@ The parameters of the function will be automatically forwarded to the correspond
141109

142110
Notice! When calling a function, you need to ensure that the number and types of parameters you pass in and the parameters accepted by the target function are correct and in one-to-one correspondence. Otherwise, an error will occur.
143111

144-
145-
146112
### Determine if a remote function has been exported
147113

148114
`ll.hasExported(namespace,name)`
@@ -155,41 +121,6 @@ Notice! When calling a function, you need to ensure that the number and types of
155121
- Return value:Whether the function has been exported
156122
- Return value type: `Boolean`
157123

158-
159-
160-
### Set Plugin Dependencies
161-
162-
Sometimes, you need to make sure that certain plugins are loaded before your own plugins to use the frontend services provided by them. We call these frontend plugins **library dependencies**.
163-
164-
When using the import function mentioned above, you need to pay attention: the premise of being able to import a function is that the pre-plugin to be called has been loaded by LLSE.
165-
Therefore, you may need to use the following function to set the dependent library, so that the pre-plugins you need are loaded first and the import is successful.
166-
167-
LLSE provides the following interface to preload the dependent libraries required by the plugin, download the dependent library files you need from local files, or even from remote HTTP(s) addresses.
168-
169-
`ll.require(path[,remotePath])`
170-
171-
- Parameter:
172-
- path : `String`
173-
Library dependency filename (Example: `addplugin.js`)
174-
- remotePath : `String`
175-
(Optional parameter) The path to find and load dependent libraries, see below for instructions.
176-
- Return value: Whether the dependent library is loaded successfully
177-
- Return value type: `Boolean`
178-
179-
For execution, use `ll.require`, then LLSE will perform the following series of operations:
180-
181-
- Search the list of loaded plugins. If the dependent library has been loaded, it will return success directly.
182-
- Search **plugins** and **plugins/lib** directories, if the corresponding dependent library file is found, load it and return the loading result.
183-
- If the corresponding dependent library file is not found after the search is completed, and the remotePath parameter is not passed in, it will return directly to failure.
184-
- Use the HTTP(s) protocol remotePath to request the download address corresponding to the remotePath parameter, and download the dependent library files to the `plugins/lib` directory. If the download fails, return failure.
185-
- Load the successfully downloaded dependent library file and return the loading result.
186-
187-
188-
189-
Authors of dependent libraries can host relevant code on stable large websites such as GitHub or Gitee, and provide external links to other developers for remote download.
190-
191-
192-
193124
### Execute a String as a Script
194125

195126
`ll.eval(str)`
@@ -199,5 +130,3 @@ Authors of dependent libraries can host relevant code on stable large websites s
199130
String to execute as a Script
200131
- Return value: Execution result
201132
- Return value type: `Any Type`
202-
203-
Different from the above mentioned `ll.require`, the script code executed here is directly executed in the engine corresponding to the current plugin, similar to the eval mechanism of each language.

docs/apis/ScriptAPI/Ll.zh.md

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,6 @@
2626
- 返回值:加载器版本
2727
- 返回值类型: `String`
2828

29-
30-
31-
### 检查 LeviLamina 版本
32-
33-
`ll.requireVersion(major[,minor,revision])`
34-
35-
- 参数:
36-
- major: `Integer`
37-
检查当前已安装LeviLamina的主版本号是否 >= 此值
38-
- minor: `Integer`(可选参数)
39-
检查当前已安装LeviLamina的次版本号是否 >= 此值
40-
- revision: `Integer`(可选参数)
41-
检查当前已安装LeviLamina的修订版本号是否 >= 此值
42-
- 返回值:检查结果
43-
- 返回值类型: `Boolean`
44-
45-
如果检测发现当前安装的脚本引擎版本低于传入的数值,将返回`false`
46-
你可以选择根据结果判断并报错,提醒用户升级自己的LeviLamina版本
47-
48-
49-
5029
### 获取有关插件的信息
5130

5231
`ll.getPluginInfo(name)`
@@ -68,26 +47,20 @@
6847
| plugin.filePath | 插件路径 | `String` |
6948
| plugin.others | 其他信息 | `Object` |
7049

71-
72-
7350
### 列出所有已加载的插件
7451

7552
`ll.listPlugins()`
7653

7754
- 返回值:已加载的所有的插件名字列表
7855
- 返回值类型: `Array<String,String,...>`
7956

80-
81-
8257
### 列出所有加载的插件信息
8358

8459
`ll.getAllPluginInfo()`
8560

8661
- 返回值: 包含所有已加载插件的插件对象的列表
8762
- 返回值类型: `Array<Plugin,Plugin,...>`
8863

89-
90-
9164
### 远程函数调用
9265

9366
#### 导出函数
@@ -108,8 +81,6 @@
10881

10982
注意:如果导出的函数的命名空间和名字与另一个已经导出的函数完全相同,将会导出失败。选定命名空间和导出名称时请适当选择。
11083

111-
112-
11384
#### 导入函数
11485

11586
当你已经得知有插件导出函数之后,为了可以使用他导出的函数,首先需要将这个函数导入到你自己的脚本系统中
@@ -127,8 +98,6 @@
12798

12899
`ll.import` 的返回值是一个函数。当你调用这个函数时,跨插件调用的流程将在后台自动完成。调用函数的参数将被包装并传递给远程函数,此函数的返回值即是远程函数执行完毕之后返回的返回值。
129100

130-
131-
132101
#### 远程调用参数类型对照,其中Type可以为其他受支持的类型
133102

134103
| C++层类型 | 脚本引擎类型 | .NET托管类型 | 内部类型(备注) |
@@ -160,8 +129,6 @@
160129

161130
注意!在调用函数的时候,需要保证你传入的参数和目标函数接受的参数数量和类型都是正确且一一对应的。否则,将会发生错误。
162131

163-
164-
165132
### 判断远程函数是否已导出
166133
`ll.hasExported(namespace,name)`
167134

@@ -173,41 +140,6 @@
173140
- 返回值:函数是否已导出
174141
- 返回值类型: `Boolean`
175142

176-
177-
178-
### 设置插件依赖库
179-
180-
有的时候,你需要确保某些插件在你自己的插件之前加载,以使用他们提供的前置服务,我们称这些前置插件为**依赖库**
181-
182-
在使用上述提到的导入函数时,你需要注意:能够导入一个函数的前提是要被调用的前置插件已经被脚本引擎加载。
183-
因此,你可能需要用下面的函数来设置依赖库,让你需要的前置插件被优先加载,保证导入成功
184-
185-
脚本引擎提供了下面的接口来提前加载插件所需要的依赖库,从本地文件,甚至可以从远程HTTP(s)地址下载你所需的依赖库文件
186-
187-
`ll.require(path[,remotePath])`
188-
189-
- 参数:
190-
- path : `String`
191-
依赖库文件名(如`addplugin.js`)
192-
- remotePath : `String`
193-
(可选参数)查找并装载依赖库的路径,说明见下
194-
- 返回值:是否加载依赖库成功
195-
- 返回值类型: `Boolean`
196-
197-
在执行`ll.require`后,脚本引擎将进行如下一系列操作
198-
199-
- 搜索已加载插件列表。如果依赖库已经被加载,则直接返回成功。
200-
- 搜索 **plugins****plugins/lib** 目录,如果发现对应的依赖库文件,则加载,并返回加载结果
201-
- 如果搜索完毕之后未发现对应的依赖库文件,且 remotePath 参数也未传入,则直接返回失败
202-
- 使用 HTTP(s) 协议请求 remotePath 参数对应的下载地址,并下载依赖库文件到 **plugins/lib** 目录。如果下载失败,则返回失败
203-
- 加载下载成功的依赖库文件,并返回加载结果
204-
205-
206-
207-
依赖库作者可以将相关代码托管在GitHub或Gitee等稳定的大型网站上,并将外链提供给其他开发者以供远程下载使用。
208-
209-
210-
211143
### 将字符串作为脚本代码执行
212144

213145
`ll.eval(str)`
@@ -218,4 +150,3 @@
218150
- 返回值:执行结果
219151
- 返回值类型: `任意类型`
220152

221-
不同于上面提到的的`ll.require`,此处执行的脚本代码是在当前插件对应的引擎中直接执行的,类似于各语言的 eval 机制

src/legacy/api/LlAPI.cpp

Lines changed: 10 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,11 @@ Local<Value> LlClass::isWine() {
6868
}
6969

7070
auto LlClass::isDebugMode() -> Local<Value> {
71-
try {
7271
#ifdef NDEBUG
73-
return Boolean::newBoolean(false);
72+
return Boolean::newBoolean(false);
7473
#else
75-
return Boolean::newBoolean(true);
74+
return Boolean::newBoolean(true);
7675
#endif
77-
}
78-
CATCH("Fail in LLSEIsDebugMode")
7976
}
8077

8178
Local<Value> LlClass::isRelease() {
@@ -92,12 +89,7 @@ Local<Value> LlClass::isBeta() {
9289
CATCH("Fail in LLSEIsBeta")
9390
}
9491

95-
Local<Value> LlClass::isDev() {
96-
try {
97-
return Boolean::newBoolean(false);
98-
}
99-
CATCH("Fail in LLSEIsDev")
100-
}
92+
Local<Value> LlClass::isDev() { return Boolean::newBoolean(false); }
10193

10294
Local<Value> LlClass::getMajorVersion() {
10395
try {
@@ -127,19 +119,9 @@ Local<Value> LlClass::getScriptEngineVersion() {
127119
CATCH("Fail in LLSEGetScriptEngineVerison")
128120
}
129121

130-
Local<Value> LlClass::getVersionStatus() {
131-
try {
132-
return Number::newNumber(0);
133-
}
134-
CATCH("Fail in LLSEGetVersionStatus")
135-
}
122+
Local<Value> LlClass::getVersionStatus() { return Number::newNumber(0); }
136123

137-
Local<Value> LlClass::registerPlugin(const Arguments& args) {
138-
try {
139-
return Boolean::newBoolean(true);
140-
}
141-
CATCH("Fail in LLAPI");
142-
}
124+
Local<Value> LlClass::registerPlugin(const Arguments& args) { return Boolean::newBoolean(true); }
143125
Local<Value> LlClass::getPluginInfo(const Arguments& args) {
144126
try {
145127
auto plugin = lse::getPluginManager().getPlugin(args[0].asString().toString());
@@ -180,13 +162,7 @@ Local<Value> LlClass::versionString(const Arguments& args) {
180162
CATCH("Fail in LLSEGetVersionString!")
181163
}
182164

183-
Local<Value> LlClass::requireVersion(const Arguments& args) {
184-
185-
try {
186-
return Boolean::newBoolean(true);
187-
}
188-
CATCH("Fail in LLSERequireVersion!")
189-
}
165+
Local<Value> LlClass::requireVersion(const Arguments& args) { return Boolean::newBoolean(true); }
190166

191167
Local<Value> LlClass::getAllPluginInfo(const Arguments& args) {
192168
try {
@@ -240,12 +216,8 @@ Local<Value> LlClass::listPlugins(const Arguments& args) {
240216
CATCH("Fail in LLAPI");
241217
}
242218

243-
Local<Value> LlClass::require(const Arguments& args) {
244-
try {
245-
return {};
246-
}
247-
CATCH("Fail in LLAPI");
248-
}
219+
Local<Value> LlClass::require(const Arguments& args) { return Boolean::newBoolean(true); }
220+
249221
Local<Value> LlClass::eval(const Arguments& args) {
250222
CHECK_ARGS_COUNT(args, 1);
251223
CHECK_ARG_TYPE(args[0], ValueKind::kString);
@@ -275,14 +247,11 @@ Local<Value> LlClass::version(const Arguments& args) {
275247

276248
// For Compatibility
277249
Local<Value> LlClass::isDebugModeFunction(const Arguments& args) {
278-
try {
279250
#ifdef LEGACYSCRIPTENGINE_DEBUG
280-
return Boolean::newBoolean(true);
251+
return Boolean::newBoolean(true);
281252
#else
282-
return Boolean::newBoolean(false);
253+
return Boolean::newBoolean(false);
283254
#endif
284-
}
285-
CATCH("Fail in LLSEGetIsDebugModeFunction")
286255
}
287256

288257
// For Compatibility

0 commit comments

Comments
 (0)