keystonemc 3.2.1 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import { Priority } from './priority';
|
|
2
1
|
/** リスナー型 */
|
|
3
2
|
export interface Listener<T> {
|
|
4
3
|
handler(event: T): void;
|
|
5
4
|
priority?: Priority;
|
|
6
5
|
}
|
|
6
|
+
/** 優先度 */
|
|
7
|
+
export declare enum Priority {
|
|
8
|
+
LOWEST = 5,
|
|
9
|
+
LOW = 4,
|
|
10
|
+
NORMAL = 3,
|
|
11
|
+
HIGH = 2,
|
|
12
|
+
HIGHEST = 1,
|
|
13
|
+
MONITOR = 0
|
|
14
|
+
}
|
|
@@ -5,12 +5,13 @@ import { ModalForm } from './modalForm';
|
|
|
5
5
|
import { MessageForm } from './messageForm';
|
|
6
6
|
export interface FormComponent<T = any> {
|
|
7
7
|
render(form: ModalFormData): void;
|
|
8
|
-
handle(player: Player, value: T): void;
|
|
8
|
+
handle?(player: Player, value: T): void;
|
|
9
9
|
}
|
|
10
|
-
export interface ModalFormConfig {
|
|
10
|
+
export interface ModalFormConfig<T = any> {
|
|
11
11
|
title: string;
|
|
12
12
|
previousForm?: ModalForm | ActionForm | MessageForm;
|
|
13
13
|
components: FormComponent[];
|
|
14
|
+
handle?(player: Player, values?: T[] | undefined): void;
|
|
14
15
|
}
|
|
15
16
|
export interface ActionButton {
|
|
16
17
|
render(form: ActionFormData): void;
|
package/dist/core/index.d.ts
CHANGED
|
@@ -2,11 +2,11 @@ export { keystone } from './keystone';
|
|
|
2
2
|
export { debug } from './utils/debugger';
|
|
3
3
|
export { Vector3 } from './math/vector3';
|
|
4
4
|
export { AxisAlignedBB } from './math/axisAlignedBB';
|
|
5
|
-
export { Priority } from './event/priority';
|
|
6
5
|
export { EventManager } from './event/eventManager';
|
|
7
6
|
export type { AfterEventMap, BeforeEventMap } from './event/eventManager';
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
7
|
+
export * from './timer/timer';
|
|
8
|
+
export * from './form/modalForm';
|
|
9
|
+
export * from './form/actionForm';
|
|
10
|
+
export * from './form/messageForm';
|
|
11
|
+
export * from './form/components';
|
|
12
|
+
export * from './form/types';
|
package/dist/index.js
CHANGED
|
@@ -1057,11 +1057,12 @@ class ModalForm {
|
|
|
1057
1057
|
res.formValues?.forEach((value, index) => {
|
|
1058
1058
|
const component = this.config.components[index];
|
|
1059
1059
|
try {
|
|
1060
|
-
component.handle(player, value);
|
|
1060
|
+
component.handle?.(player, value);
|
|
1061
1061
|
} catch (e) {
|
|
1062
1062
|
console.warn(`[ModalForm] handler error at index ${index}: ${e}`);
|
|
1063
1063
|
}
|
|
1064
1064
|
});
|
|
1065
|
+
this.config.handle?.(player, res.formValues);
|
|
1065
1066
|
}
|
|
1066
1067
|
}
|
|
1067
1068
|
function createModalForm(config) {
|
|
@@ -1182,11 +1183,14 @@ function button(opts) {
|
|
|
1182
1183
|
};
|
|
1183
1184
|
}
|
|
1184
1185
|
export {
|
|
1186
|
+
ActionForm,
|
|
1185
1187
|
AxisAlignedBB,
|
|
1186
1188
|
DelayedTimer,
|
|
1187
1189
|
EventManager,
|
|
1188
|
-
|
|
1190
|
+
MessageForm,
|
|
1191
|
+
ModalForm,
|
|
1189
1192
|
RepeatingTimer,
|
|
1193
|
+
UntilTimer,
|
|
1190
1194
|
Vector3,
|
|
1191
1195
|
button,
|
|
1192
1196
|
createActionForm,
|
package/package.json
CHANGED