mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-22 01:03:01 +02:00
41 lines
932 B
TypeScript
41 lines
932 B
TypeScript
import { KeyBindingTypes } from "../../utils/KeyBindingUtils";
|
|
|
|
function getKeyBindingsSchemaProperties() {
|
|
const result: Record<string, unknown> = {};
|
|
for (const keyBindingType of KeyBindingTypes) {
|
|
result[keyBindingType] = {
|
|
type: "array",
|
|
minItems: 2,
|
|
items: {
|
|
type: "object",
|
|
nullable: true,
|
|
properties: {
|
|
control: {
|
|
type: "boolean",
|
|
},
|
|
alt: {
|
|
type: "boolean",
|
|
},
|
|
shift: {
|
|
type: "boolean",
|
|
},
|
|
meta: {
|
|
type: "boolean",
|
|
},
|
|
key: {
|
|
type: "string",
|
|
},
|
|
},
|
|
required: ["control", "alt", "shift", "meta", "key"],
|
|
},
|
|
};
|
|
}
|
|
return result;
|
|
}
|
|
|
|
export const KeyBindingsSchema = {
|
|
$schema: "http://json-schema.org/draft-07/schema#",
|
|
type: "object",
|
|
properties: getKeyBindingsSchemaProperties(),
|
|
};
|