You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| plugin.version | Plugin version (array) |`Array<Integer,Integer,Integer>`|
48
+
| plugin.versionStr | Plugin version (string) |`String`|
49
+
| plugin.filePath | Path to plugin |`String`|
50
+
| plugin.others | Other information |`Object`|
48
51
49
52
### List all loaded plugins
50
53
@@ -60,74 +63,100 @@ Some interfaces related to loader operations are provided here.
60
63
- Return value: A list containing the plugin objects of all loaded plugin
61
64
- Return value type: `Array<Plugin,Plugin,...>`
62
65
66
+
### Set the function called while the plugin is unloading
67
+
68
+
!!! warning
69
+
This function is only available in LSE 0.9.6 and later.
70
+
71
+
`ll.onUnload(func)`
72
+
73
+
- Parameter:
74
+
- func : `Function`
75
+
Function to be called while the plugin is unloading
76
+
63
77
### Remote Function Call
64
78
65
-
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.
79
+
In order to allow the pre-plug-ins developed by developers to provide interfaces and services for other plug-ins, the
80
+
remote function call function is provided here, so that one LLSE plug-in can call the existing functions in another
81
+
plug-in.
66
82
67
83
#### Export Function
68
84
69
-
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 an LL or LLSE plug-in can call the existing functions in another plug-in.
85
+
In order to allow the pre-plug-ins developed by developers to provide interfaces and services for other plug-ins, the
86
+
remote function call function is provided here, so that an LL or LLSE plug-in can call the existing functions in another
87
+
plug-in.
70
88
71
89
`ll.exports(func,namespace,name)`
72
90
73
-
- Parameter:
74
-
- func : `Function`
75
-
Function to be exported
76
-
- namespace : `String`
77
-
The namespace name of the function, which is only convenient for distinguishing the API exported by different plugins.
78
-
- name : `String`
79
-
The export name of the function. Other plugins call this function based on the export name.
91
+
- Parameter:
92
+
- func : `Function`
93
+
Function to be exported
94
+
- namespace : `String`
95
+
The namespace name of the function, which is only convenient for distinguishing the API exported by different
96
+
plugins.
97
+
- name : `String`
98
+
The export name of the function. Other plugins call this function based on the export name.
80
99
- Return value: Whether the export was successful.
81
100
- Return value type: `Boolean`
82
101
83
-
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.
102
+
Note: If the namespace and name of the exported function are exactly the same as another already exported function, the
103
+
export will fail. Please select the namespace and export name appropriately when exporting.
84
104
85
105
#### Import Function
86
106
87
-
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.
107
+
After you have learned that there is a plug-in exporting function, in order to use the function exported by him, you
108
+
first need to import this function into your own scripting system.
88
109
LLSE provides the interface import to import functions already exported by other plugins.
89
110
90
111
`ll.imports(namespace,name)`
91
112
92
-
- Parameter:
93
-
- namespace : `String`
94
-
The namespace name used by the function that is being imported.
95
-
- name : `String`
96
-
The name of the function that is being imported.
113
+
- Parameter:
114
+
- namespace : `String`
115
+
The namespace name used by the function that is being imported.
116
+
- name : `String`
117
+
The name of the function that is being imported.
97
118
- Return value: The imported function
98
119
- Return value type: `Function`
99
120
100
-
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.
121
+
The return value of `ll.import` is a function. When you call this function, the cross-plugin call process will be done
122
+
automatically in the background. The parameters of the calling function will be wrapped and passed to the remote
123
+
function, and the return value of this function is the return value returned by the remote function after it has been
124
+
executed.
101
125
102
-
#### Example of Remote Calling Function
126
+
#### Example of Remote Calling Function
103
127
104
-
For example, there is a plug-in that exports a function using the namespace AAA, and the name of the exported function is Welcome
105
-
You can execute `welcome = ll.import("AAA", "Welcome"); ` to import this function. After the import is complete, you can execute directly below:
128
+
For example, there is a plug-in that exports a function using the namespace AAA, and the name of the exported function
129
+
is Welcome
130
+
You can execute `welcome = ll.import("AAA", "Welcome"); ` to import this function. After the import is complete, you can
131
+
execute directly below:
106
132
107
-
`welcome("hello",2,true);`
133
+
`welcome("hello",2,true);`
108
134
109
-
The parameters of the function will be automatically forwarded to the corresponding target function for execution, and the return value of the corresponding target function will be returned after execution. The whole process is automatically completed.
135
+
The parameters of the function will be automatically forwarded to the corresponding target function for execution, and
136
+
the return value of the corresponding target function will be returned after execution. The whole process is
137
+
automatically completed.
110
138
111
-
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.
139
+
Notice! When calling a function, you need to ensure that the number and types of parameters you pass in and the
140
+
parameters accepted by the target function are correct and in one-to-one correspondence. Otherwise, an error will occur.
112
141
113
142
### Determine if a remote function has been exported
114
143
115
144
`ll.hasExported(namespace,name)`
116
145
117
146
- Parameter:
118
-
- namespace : `String`
119
-
Namespace name used by the function
120
-
- name : `String`
121
-
Export name used by the function
147
+
- namespace : `String`
148
+
Namespace name used by the function
149
+
- name : `String`
150
+
Export name used by the function
122
151
- Return value:Whether the function has been exported
0 commit comments