♻️ Refactor keybinding service
This commit is contained in:
@@ -21,7 +21,7 @@ export class Document {
|
||||
/**
|
||||
* UUID for cross-device sync (UUIDv7)
|
||||
*/
|
||||
"uuid": string | null;
|
||||
"uuid": string;
|
||||
|
||||
/**
|
||||
* creation time
|
||||
@@ -56,7 +56,7 @@ export class Document {
|
||||
/** Creates a new Document instance. */
|
||||
constructor($$source: Partial<Document> = {}) {
|
||||
if (!("uuid" in $$source)) {
|
||||
this["uuid"] = null;
|
||||
this["uuid"] = "";
|
||||
}
|
||||
if (!("created_at" in $$source)) {
|
||||
this["created_at"] = "";
|
||||
@@ -98,7 +98,7 @@ export class Extension {
|
||||
/**
|
||||
* UUID for cross-device sync (UUIDv7)
|
||||
*/
|
||||
"uuid": string | null;
|
||||
"uuid": string;
|
||||
|
||||
/**
|
||||
* creation time
|
||||
@@ -116,9 +116,9 @@ export class Extension {
|
||||
"deleted_at"?: string | null;
|
||||
|
||||
/**
|
||||
* extension key
|
||||
* extension name
|
||||
*/
|
||||
"key": string;
|
||||
"name": string;
|
||||
|
||||
/**
|
||||
* extension enabled or not
|
||||
@@ -133,7 +133,7 @@ export class Extension {
|
||||
/** Creates a new Extension instance. */
|
||||
constructor($$source: Partial<Extension> = {}) {
|
||||
if (!("uuid" in $$source)) {
|
||||
this["uuid"] = null;
|
||||
this["uuid"] = "";
|
||||
}
|
||||
if (!("created_at" in $$source)) {
|
||||
this["created_at"] = "";
|
||||
@@ -141,8 +141,8 @@ export class Extension {
|
||||
if (!("updated_at" in $$source)) {
|
||||
this["updated_at"] = "";
|
||||
}
|
||||
if (!("key" in $$source)) {
|
||||
this["key"] = "";
|
||||
if (!("name" in $$source)) {
|
||||
this["name"] = "";
|
||||
}
|
||||
if (!("enabled" in $$source)) {
|
||||
this["enabled"] = false;
|
||||
@@ -179,7 +179,7 @@ export class KeyBinding {
|
||||
/**
|
||||
* UUID for cross-device sync (UUIDv7)
|
||||
*/
|
||||
"uuid": string | null;
|
||||
"uuid": string;
|
||||
|
||||
/**
|
||||
* creation time
|
||||
@@ -197,29 +197,59 @@ export class KeyBinding {
|
||||
"deleted_at"?: string | null;
|
||||
|
||||
/**
|
||||
* key binding key
|
||||
* command identifier
|
||||
*/
|
||||
"key": string;
|
||||
"name": string;
|
||||
|
||||
/**
|
||||
* key binding command
|
||||
* keybinding type: standard or emacs
|
||||
*/
|
||||
"command": string;
|
||||
"type": string;
|
||||
|
||||
/**
|
||||
* key binding extension
|
||||
* universal keybinding (cross-platform)
|
||||
*/
|
||||
"extension"?: string;
|
||||
"key"?: string;
|
||||
|
||||
/**
|
||||
* key binding enabled
|
||||
* macOS specific keybinding
|
||||
*/
|
||||
"macos"?: string;
|
||||
|
||||
/**
|
||||
* Windows specific keybinding
|
||||
*/
|
||||
"windows"?: string;
|
||||
|
||||
/**
|
||||
* Linux specific keybinding
|
||||
*/
|
||||
"linux"?: string;
|
||||
|
||||
/**
|
||||
* extension name (functional category)
|
||||
*/
|
||||
"extension": string;
|
||||
|
||||
/**
|
||||
* whether this keybinding is enabled
|
||||
*/
|
||||
"enabled": boolean;
|
||||
|
||||
/**
|
||||
* prevent browser default behavior
|
||||
*/
|
||||
"preventDefault": boolean;
|
||||
|
||||
/**
|
||||
* keybinding scope (default: editor)
|
||||
*/
|
||||
"scope"?: string;
|
||||
|
||||
/** Creates a new KeyBinding instance. */
|
||||
constructor($$source: Partial<KeyBinding> = {}) {
|
||||
if (!("uuid" in $$source)) {
|
||||
this["uuid"] = null;
|
||||
this["uuid"] = "";
|
||||
}
|
||||
if (!("created_at" in $$source)) {
|
||||
this["created_at"] = "";
|
||||
@@ -227,15 +257,21 @@ export class KeyBinding {
|
||||
if (!("updated_at" in $$source)) {
|
||||
this["updated_at"] = "";
|
||||
}
|
||||
if (!("key" in $$source)) {
|
||||
this["key"] = "";
|
||||
if (!("name" in $$source)) {
|
||||
this["name"] = "";
|
||||
}
|
||||
if (!("command" in $$source)) {
|
||||
this["command"] = "";
|
||||
if (!("type" in $$source)) {
|
||||
this["type"] = "";
|
||||
}
|
||||
if (!("extension" in $$source)) {
|
||||
this["extension"] = "";
|
||||
}
|
||||
if (!("enabled" in $$source)) {
|
||||
this["enabled"] = false;
|
||||
}
|
||||
if (!("preventDefault" in $$source)) {
|
||||
this["preventDefault"] = false;
|
||||
}
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
@@ -261,7 +297,7 @@ export class Theme {
|
||||
/**
|
||||
* UUID for cross-device sync (UUIDv7)
|
||||
*/
|
||||
"uuid": string | null;
|
||||
"uuid": string;
|
||||
|
||||
/**
|
||||
* creation time
|
||||
@@ -279,9 +315,9 @@ export class Theme {
|
||||
"deleted_at"?: string | null;
|
||||
|
||||
/**
|
||||
* theme key
|
||||
* theme name
|
||||
*/
|
||||
"key": string;
|
||||
"name": string;
|
||||
|
||||
/**
|
||||
* theme type
|
||||
@@ -296,7 +332,7 @@ export class Theme {
|
||||
/** Creates a new Theme instance. */
|
||||
constructor($$source: Partial<Theme> = {}) {
|
||||
if (!("uuid" in $$source)) {
|
||||
this["uuid"] = null;
|
||||
this["uuid"] = "";
|
||||
}
|
||||
if (!("created_at" in $$source)) {
|
||||
this["created_at"] = "";
|
||||
@@ -304,8 +340,8 @@ export class Theme {
|
||||
if (!("updated_at" in $$source)) {
|
||||
this["updated_at"] = "";
|
||||
}
|
||||
if (!("key" in $$source)) {
|
||||
this["key"] = "";
|
||||
if (!("name" in $$source)) {
|
||||
this["name"] = "";
|
||||
}
|
||||
if (!("type" in $$source)) {
|
||||
this["type"] = ("" as theme$0.Type);
|
||||
|
||||
@@ -234,6 +234,12 @@ export class EditingConfig {
|
||||
*/
|
||||
"tabType": TabType;
|
||||
|
||||
/**
|
||||
* 快捷键模式
|
||||
* 快捷键模式(standard 或 emacs)
|
||||
*/
|
||||
"keymapMode": KeyBindingType;
|
||||
|
||||
/**
|
||||
* 保存选项
|
||||
* 自动保存延迟(毫秒)
|
||||
@@ -263,6 +269,9 @@ export class EditingConfig {
|
||||
if (!("tabType" in $$source)) {
|
||||
this["tabType"] = ("" as TabType);
|
||||
}
|
||||
if (!("keymapMode" in $$source)) {
|
||||
this["keymapMode"] = ("" as KeyBindingType);
|
||||
}
|
||||
if (!("autoSaveDelay" in $$source)) {
|
||||
this["autoSaveDelay"] = 0;
|
||||
}
|
||||
@@ -283,14 +292,14 @@ export class EditingConfig {
|
||||
* Extension 扩展配置
|
||||
*/
|
||||
export class Extension {
|
||||
"key": ExtensionKey;
|
||||
"key": ExtensionName;
|
||||
"enabled": boolean;
|
||||
"config": ExtensionConfig;
|
||||
|
||||
/** Creates a new Extension instance. */
|
||||
constructor($$source: Partial<Extension> = {}) {
|
||||
if (!("key" in $$source)) {
|
||||
this["key"] = ("" as ExtensionKey);
|
||||
this["key"] = ("" as ExtensionName);
|
||||
}
|
||||
if (!("enabled" in $$source)) {
|
||||
this["enabled"] = false;
|
||||
@@ -321,79 +330,78 @@ export class Extension {
|
||||
export type ExtensionConfig = { [_: string]: any };
|
||||
|
||||
/**
|
||||
* ExtensionKey 扩展标识符
|
||||
* ExtensionName 扩展标识符
|
||||
*/
|
||||
export enum ExtensionKey {
|
||||
export enum ExtensionName {
|
||||
/**
|
||||
* The Go zero value for the underlying type of the enum.
|
||||
*/
|
||||
$zero = "",
|
||||
|
||||
/**
|
||||
* 编辑增强扩展
|
||||
* 彩虹括号
|
||||
*/
|
||||
ExtensionRainbowBrackets = "rainbowBrackets",
|
||||
RainbowBrackets = "rainbowBrackets",
|
||||
|
||||
/**
|
||||
* 超链接
|
||||
*/
|
||||
ExtensionHyperlink = "hyperlink",
|
||||
Hyperlink = "hyperlink",
|
||||
|
||||
/**
|
||||
* 颜色选择器
|
||||
*/
|
||||
ExtensionColorSelector = "colorSelector",
|
||||
ColorSelector = "colorSelector",
|
||||
|
||||
/**
|
||||
* 代码折叠
|
||||
*/
|
||||
ExtensionFold = "fold",
|
||||
Fold = "fold",
|
||||
|
||||
/**
|
||||
* 划词翻译
|
||||
*/
|
||||
ExtensionTranslator = "translator",
|
||||
Translator = "translator",
|
||||
|
||||
/**
|
||||
* Markdown渲染
|
||||
*/
|
||||
ExtensionMarkdown = "markdown",
|
||||
Markdown = "markdown",
|
||||
|
||||
/**
|
||||
* 显示空白字符
|
||||
*/
|
||||
ExtensionHighlightWhitespace = "highlightWhitespace",
|
||||
HighlightWhitespace = "highlightWhitespace",
|
||||
|
||||
/**
|
||||
* 高亮行尾空白
|
||||
*/
|
||||
ExtensionHighlightTrailingWhitespace = "highlightTrailingWhitespace",
|
||||
HighlightTrailingWhitespace = "highlightTrailingWhitespace",
|
||||
|
||||
/**
|
||||
* 小地图
|
||||
*/
|
||||
ExtensionMinimap = "minimap",
|
||||
Minimap = "minimap",
|
||||
|
||||
/**
|
||||
* 行号显示
|
||||
*/
|
||||
ExtensionLineNumbers = "lineNumbers",
|
||||
LineNumbers = "lineNumbers",
|
||||
|
||||
/**
|
||||
* 上下文菜单
|
||||
*/
|
||||
ExtensionContextMenu = "contextMenu",
|
||||
ContextMenu = "contextMenu",
|
||||
|
||||
/**
|
||||
* 搜索功能
|
||||
*/
|
||||
ExtensionSearch = "search",
|
||||
Search = "search",
|
||||
|
||||
/**
|
||||
* HTTP 客户端
|
||||
*/
|
||||
ExtensionHttpClient = "httpClient",
|
||||
HttpClient = "httpClient",
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -684,25 +692,73 @@ export class HotkeyCombo {
|
||||
* KeyBinding 单个快捷键绑定
|
||||
*/
|
||||
export class KeyBinding {
|
||||
"key": KeyBindingKey;
|
||||
"command": string;
|
||||
"extension": ExtensionKey;
|
||||
/**
|
||||
* 命令唯一标识符
|
||||
*/
|
||||
"name": KeyBindingName;
|
||||
|
||||
/**
|
||||
* 快捷键类型(standard 或 "emacs")
|
||||
*/
|
||||
"type": KeyBindingType;
|
||||
|
||||
/**
|
||||
* 通用快捷键(跨平台)
|
||||
*/
|
||||
"key"?: string;
|
||||
|
||||
/**
|
||||
* macOS 专用快捷键
|
||||
*/
|
||||
"macos"?: string;
|
||||
|
||||
/**
|
||||
* windows 专用快捷键
|
||||
*/
|
||||
"win"?: string;
|
||||
|
||||
/**
|
||||
* Linux 专用快捷键
|
||||
*/
|
||||
"linux"?: string;
|
||||
|
||||
/**
|
||||
* 所属扩展
|
||||
*/
|
||||
"extension": ExtensionName;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
"enabled": boolean;
|
||||
|
||||
/**
|
||||
* 阻止浏览器默认行为
|
||||
*/
|
||||
"preventDefault": boolean;
|
||||
|
||||
/**
|
||||
* 作用域(默认 "editor")
|
||||
*/
|
||||
"scope"?: string;
|
||||
|
||||
/** Creates a new KeyBinding instance. */
|
||||
constructor($$source: Partial<KeyBinding> = {}) {
|
||||
if (!("key" in $$source)) {
|
||||
this["key"] = ("" as KeyBindingKey);
|
||||
if (!("name" in $$source)) {
|
||||
this["name"] = ("" as KeyBindingName);
|
||||
}
|
||||
if (!("command" in $$source)) {
|
||||
this["command"] = "";
|
||||
if (!("type" in $$source)) {
|
||||
this["type"] = ("" as KeyBindingType);
|
||||
}
|
||||
if (!("extension" in $$source)) {
|
||||
this["extension"] = ("" as ExtensionKey);
|
||||
this["extension"] = ("" as ExtensionName);
|
||||
}
|
||||
if (!("enabled" in $$source)) {
|
||||
this["enabled"] = false;
|
||||
}
|
||||
if (!("preventDefault" in $$source)) {
|
||||
this["preventDefault"] = false;
|
||||
}
|
||||
|
||||
Object.assign(this, $$source);
|
||||
}
|
||||
@@ -717,9 +773,9 @@ export class KeyBinding {
|
||||
}
|
||||
|
||||
/**
|
||||
* KeyBindingKey 快捷键命令
|
||||
* KeyBindingName 快捷键命令标识符
|
||||
*/
|
||||
export enum KeyBindingKey {
|
||||
export enum KeyBindingName {
|
||||
/**
|
||||
* The Go zero value for the underlying type of the enum.
|
||||
*/
|
||||
@@ -728,247 +784,409 @@ export enum KeyBindingKey {
|
||||
/**
|
||||
* 显示搜索
|
||||
*/
|
||||
ShowSearchKeyBindingKey = "showSearch",
|
||||
ShowSearch = "showSearch",
|
||||
|
||||
/**
|
||||
* 隐藏搜索
|
||||
*/
|
||||
HideSearchKeyBindingKey = "hideSearch",
|
||||
HideSearch = "hideSearch",
|
||||
|
||||
/**
|
||||
* 块内选择全部
|
||||
*/
|
||||
BlockSelectAllKeyBindingKey = "blockSelectAll",
|
||||
BlockSelectAll = "blockSelectAll",
|
||||
|
||||
/**
|
||||
* 在当前块后添加新块
|
||||
*/
|
||||
BlockAddAfterCurrentKeyBindingKey = "blockAddAfterCurrent",
|
||||
BlockAddAfterCurrent = "blockAddAfterCurrent",
|
||||
|
||||
/**
|
||||
* 在最后添加新块
|
||||
*/
|
||||
BlockAddAfterLastKeyBindingKey = "blockAddAfterLast",
|
||||
BlockAddAfterLast = "blockAddAfterLast",
|
||||
|
||||
/**
|
||||
* 在当前块前添加新块
|
||||
*/
|
||||
BlockAddBeforeCurrentKeyBindingKey = "blockAddBeforeCurrent",
|
||||
BlockAddBeforeCurrent = "blockAddBeforeCurrent",
|
||||
|
||||
/**
|
||||
* 跳转到上一个块
|
||||
*/
|
||||
BlockGotoPreviousKeyBindingKey = "blockGotoPrevious",
|
||||
BlockGotoPrevious = "blockGotoPrevious",
|
||||
|
||||
/**
|
||||
* 跳转到下一个块
|
||||
*/
|
||||
BlockGotoNextKeyBindingKey = "blockGotoNext",
|
||||
BlockGotoNext = "blockGotoNext",
|
||||
|
||||
/**
|
||||
* 选择上一个块
|
||||
*/
|
||||
BlockSelectPreviousKeyBindingKey = "blockSelectPrevious",
|
||||
BlockSelectPrevious = "blockSelectPrevious",
|
||||
|
||||
/**
|
||||
* 选择下一个块
|
||||
*/
|
||||
BlockSelectNextKeyBindingKey = "blockSelectNext",
|
||||
BlockSelectNext = "blockSelectNext",
|
||||
|
||||
/**
|
||||
* 删除当前块
|
||||
*/
|
||||
BlockDeleteKeyBindingKey = "blockDelete",
|
||||
BlockDelete = "blockDelete",
|
||||
|
||||
/**
|
||||
* 向上移动当前块
|
||||
*/
|
||||
BlockMoveUpKeyBindingKey = "blockMoveUp",
|
||||
BlockMoveUp = "blockMoveUp",
|
||||
|
||||
/**
|
||||
* 向下移动当前块
|
||||
*/
|
||||
BlockMoveDownKeyBindingKey = "blockMoveDown",
|
||||
BlockMoveDown = "blockMoveDown",
|
||||
|
||||
/**
|
||||
* 删除行
|
||||
*/
|
||||
BlockDeleteLineKeyBindingKey = "blockDeleteLine",
|
||||
BlockDeleteLine = "blockDeleteLine",
|
||||
|
||||
/**
|
||||
* 向上移动行
|
||||
*/
|
||||
BlockMoveLineUpKeyBindingKey = "blockMoveLineUp",
|
||||
BlockMoveLineUp = "blockMoveLineUp",
|
||||
|
||||
/**
|
||||
* 向下移动行
|
||||
*/
|
||||
BlockMoveLineDownKeyBindingKey = "blockMoveLineDown",
|
||||
BlockMoveLineDown = "blockMoveLineDown",
|
||||
|
||||
/**
|
||||
* 字符转置
|
||||
*/
|
||||
BlockTransposeCharsKeyBindingKey = "blockTransposeChars",
|
||||
BlockTransposeChars = "blockTransposeChars",
|
||||
|
||||
/**
|
||||
* 格式化代码块
|
||||
*/
|
||||
BlockFormatKeyBindingKey = "blockFormat",
|
||||
BlockFormat = "blockFormat",
|
||||
|
||||
/**
|
||||
* 复制
|
||||
*/
|
||||
BlockCopyKeyBindingKey = "blockCopy",
|
||||
BlockCopy = "blockCopy",
|
||||
|
||||
/**
|
||||
* 剪切
|
||||
*/
|
||||
BlockCutKeyBindingKey = "blockCut",
|
||||
BlockCut = "blockCut",
|
||||
|
||||
/**
|
||||
* 粘贴
|
||||
*/
|
||||
BlockPasteKeyBindingKey = "blockPaste",
|
||||
BlockPaste = "blockPaste",
|
||||
|
||||
/**
|
||||
* 折叠代码
|
||||
*/
|
||||
FoldCodeKeyBindingKey = "foldCode",
|
||||
FoldCode = "foldCode",
|
||||
|
||||
/**
|
||||
* 展开代码
|
||||
*/
|
||||
UnfoldCodeKeyBindingKey = "unfoldCode",
|
||||
UnfoldCode = "unfoldCode",
|
||||
|
||||
/**
|
||||
* 折叠全部
|
||||
*/
|
||||
FoldAllKeyBindingKey = "foldAll",
|
||||
FoldAll = "foldAll",
|
||||
|
||||
/**
|
||||
* 展开全部
|
||||
*/
|
||||
UnfoldAllKeyBindingKey = "unfoldAll",
|
||||
UnfoldAll = "unfoldAll",
|
||||
|
||||
/**
|
||||
* 光标按语法左移
|
||||
*/
|
||||
CursorSyntaxLeftKeyBindingKey = "cursorSyntaxLeft",
|
||||
CursorSyntaxLeft = "cursorSyntaxLeft",
|
||||
|
||||
/**
|
||||
* 光标按语法右移
|
||||
*/
|
||||
CursorSyntaxRightKeyBindingKey = "cursorSyntaxRight",
|
||||
CursorSyntaxRight = "cursorSyntaxRight",
|
||||
|
||||
/**
|
||||
* 按语法选择左侧
|
||||
*/
|
||||
SelectSyntaxLeftKeyBindingKey = "selectSyntaxLeft",
|
||||
SelectSyntaxLeft = "selectSyntaxLeft",
|
||||
|
||||
/**
|
||||
* 按语法选择右侧
|
||||
*/
|
||||
SelectSyntaxRightKeyBindingKey = "selectSyntaxRight",
|
||||
SelectSyntaxRight = "selectSyntaxRight",
|
||||
|
||||
/**
|
||||
* 向上复制行
|
||||
*/
|
||||
CopyLineUpKeyBindingKey = "copyLineUp",
|
||||
CopyLineUp = "copyLineUp",
|
||||
|
||||
/**
|
||||
* 向下复制行
|
||||
*/
|
||||
CopyLineDownKeyBindingKey = "copyLineDown",
|
||||
CopyLineDown = "copyLineDown",
|
||||
|
||||
/**
|
||||
* 插入空行
|
||||
*/
|
||||
InsertBlankLineKeyBindingKey = "insertBlankLine",
|
||||
InsertBlankLine = "insertBlankLine",
|
||||
|
||||
/**
|
||||
* 选择行
|
||||
*/
|
||||
SelectLineKeyBindingKey = "selectLine",
|
||||
SelectLine = "selectLine",
|
||||
|
||||
/**
|
||||
* 选择父级语法
|
||||
*/
|
||||
SelectParentSyntaxKeyBindingKey = "selectParentSyntax",
|
||||
SelectParentSyntax = "selectParentSyntax",
|
||||
|
||||
/**
|
||||
* 简化选择
|
||||
*/
|
||||
SimplifySelection = "simplifySelection",
|
||||
|
||||
/**
|
||||
* 在上方添加光标
|
||||
*/
|
||||
AddCursorAbove = "addCursorAbove",
|
||||
|
||||
/**
|
||||
* 在下方添加光标
|
||||
*/
|
||||
AddCursorBelow = "addCursorBelow",
|
||||
|
||||
/**
|
||||
* 光标按单词左移
|
||||
*/
|
||||
CursorGroupLeft = "cursorGroupLeft",
|
||||
|
||||
/**
|
||||
* 光标按单词右移
|
||||
*/
|
||||
CursorGroupRight = "cursorGroupRight",
|
||||
|
||||
/**
|
||||
* 按单词选择左侧
|
||||
*/
|
||||
SelectGroupLeft = "selectGroupLeft",
|
||||
|
||||
/**
|
||||
* 按单词选择右侧
|
||||
*/
|
||||
SelectGroupRight = "selectGroupRight",
|
||||
|
||||
/**
|
||||
* 删除到行尾
|
||||
*/
|
||||
DeleteToLineEnd = "deleteToLineEnd",
|
||||
|
||||
/**
|
||||
* 删除到行首
|
||||
*/
|
||||
DeleteToLineStart = "deleteToLineStart",
|
||||
|
||||
/**
|
||||
* 移动到行首
|
||||
*/
|
||||
CursorLineStart = "cursorLineStart",
|
||||
|
||||
/**
|
||||
* 移动到行尾
|
||||
*/
|
||||
CursorLineEnd = "cursorLineEnd",
|
||||
|
||||
/**
|
||||
* 选择到行首
|
||||
*/
|
||||
SelectLineStart = "selectLineStart",
|
||||
|
||||
/**
|
||||
* 选择到行尾
|
||||
*/
|
||||
SelectLineEnd = "selectLineEnd",
|
||||
|
||||
/**
|
||||
* 跳转到文档开头
|
||||
*/
|
||||
CursorDocStart = "cursorDocStart",
|
||||
|
||||
/**
|
||||
* 跳转到文档结尾
|
||||
*/
|
||||
CursorDocEnd = "cursorDocEnd",
|
||||
|
||||
/**
|
||||
* 选择到文档开头
|
||||
*/
|
||||
SelectDocStart = "selectDocStart",
|
||||
|
||||
/**
|
||||
* 选择到文档结尾
|
||||
*/
|
||||
SelectDocEnd = "selectDocEnd",
|
||||
|
||||
/**
|
||||
* 选择到匹配括号
|
||||
*/
|
||||
SelectMatchingBracket = "selectMatchingBracket",
|
||||
|
||||
/**
|
||||
* 分割行
|
||||
*/
|
||||
SplitLine = "splitLine",
|
||||
|
||||
/**
|
||||
* 光标左移一个字符
|
||||
*/
|
||||
CursorCharLeft = "cursorCharLeft",
|
||||
|
||||
/**
|
||||
* 光标右移一个字符
|
||||
*/
|
||||
CursorCharRight = "cursorCharRight",
|
||||
|
||||
/**
|
||||
* 光标上移一行
|
||||
*/
|
||||
CursorLineUp = "cursorLineUp",
|
||||
|
||||
/**
|
||||
* 光标下移一行
|
||||
*/
|
||||
CursorLineDown = "cursorLineDown",
|
||||
|
||||
/**
|
||||
* 向上翻页
|
||||
*/
|
||||
CursorPageUp = "cursorPageUp",
|
||||
|
||||
/**
|
||||
* 向下翻页
|
||||
*/
|
||||
CursorPageDown = "cursorPageDown",
|
||||
|
||||
/**
|
||||
* 选择左移一个字符
|
||||
*/
|
||||
SelectCharLeft = "selectCharLeft",
|
||||
|
||||
/**
|
||||
* 选择右移一个字符
|
||||
*/
|
||||
SelectCharRight = "selectCharRight",
|
||||
|
||||
/**
|
||||
* 选择上移一行
|
||||
*/
|
||||
SelectLineUp = "selectLineUp",
|
||||
|
||||
/**
|
||||
* 选择下移一行
|
||||
*/
|
||||
SelectLineDown = "selectLineDown",
|
||||
|
||||
/**
|
||||
* 减少缩进
|
||||
*/
|
||||
IndentLessKeyBindingKey = "indentLess",
|
||||
IndentLess = "indentLess",
|
||||
|
||||
/**
|
||||
* 增加缩进
|
||||
*/
|
||||
IndentMoreKeyBindingKey = "indentMore",
|
||||
IndentMore = "indentMore",
|
||||
|
||||
/**
|
||||
* 缩进选择
|
||||
*/
|
||||
IndentSelectionKeyBindingKey = "indentSelection",
|
||||
IndentSelection = "indentSelection",
|
||||
|
||||
/**
|
||||
* 光标到匹配括号
|
||||
*/
|
||||
CursorMatchingBracketKeyBindingKey = "cursorMatchingBracket",
|
||||
CursorMatchingBracket = "cursorMatchingBracket",
|
||||
|
||||
/**
|
||||
* 切换注释
|
||||
*/
|
||||
ToggleCommentKeyBindingKey = "toggleComment",
|
||||
ToggleComment = "toggleComment",
|
||||
|
||||
/**
|
||||
* 切换块注释
|
||||
*/
|
||||
ToggleBlockCommentKeyBindingKey = "toggleBlockComment",
|
||||
ToggleBlockComment = "toggleBlockComment",
|
||||
|
||||
/**
|
||||
* 插入新行并缩进
|
||||
*/
|
||||
InsertNewlineAndIndentKeyBindingKey = "insertNewlineAndIndent",
|
||||
InsertNewlineAndIndent = "insertNewlineAndIndent",
|
||||
|
||||
/**
|
||||
* 向后删除字符
|
||||
*/
|
||||
DeleteCharBackwardKeyBindingKey = "deleteCharBackward",
|
||||
DeleteCharBackward = "deleteCharBackward",
|
||||
|
||||
/**
|
||||
* 向前删除字符
|
||||
*/
|
||||
DeleteCharForwardKeyBindingKey = "deleteCharForward",
|
||||
DeleteCharForward = "deleteCharForward",
|
||||
|
||||
/**
|
||||
* 向后删除组
|
||||
*/
|
||||
DeleteGroupBackwardKeyBindingKey = "deleteGroupBackward",
|
||||
DeleteGroupBackward = "deleteGroupBackward",
|
||||
|
||||
/**
|
||||
* 向前删除组
|
||||
*/
|
||||
DeleteGroupForwardKeyBindingKey = "deleteGroupForward",
|
||||
DeleteGroupForward = "deleteGroupForward",
|
||||
|
||||
/**
|
||||
* 撤销
|
||||
*/
|
||||
HistoryUndoKeyBindingKey = "historyUndo",
|
||||
HistoryUndo = "historyUndo",
|
||||
|
||||
/**
|
||||
* 重做
|
||||
*/
|
||||
HistoryRedoKeyBindingKey = "historyRedo",
|
||||
HistoryRedo = "historyRedo",
|
||||
|
||||
/**
|
||||
* 撤销选择
|
||||
*/
|
||||
HistoryUndoSelectionKeyBindingKey = "historyUndoSelection",
|
||||
HistoryUndoSelection = "historyUndoSelection",
|
||||
|
||||
/**
|
||||
* 重做选择
|
||||
*/
|
||||
HistoryRedoSelectionKeyBindingKey = "historyRedoSelection",
|
||||
HistoryRedoSelection = "historyRedoSelection",
|
||||
};
|
||||
|
||||
export enum KeyBindingType {
|
||||
/**
|
||||
* The Go zero value for the underlying type of the enum.
|
||||
*/
|
||||
$zero = "",
|
||||
|
||||
/**
|
||||
* standard 标准快捷键
|
||||
*/
|
||||
Standard = "standard",
|
||||
|
||||
/**
|
||||
* emacs 快捷键
|
||||
*/
|
||||
Emacs = "emacs",
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,35 +20,11 @@ import * as models$0 from "../models/models.js";
|
||||
// @ts-ignore: Unused imports
|
||||
import * as ent$0 from "../models/ent/models.js";
|
||||
|
||||
/**
|
||||
* GetAllExtensions 获取所有扩展
|
||||
*/
|
||||
export function GetAllExtensions(): Promise<(ent$0.Extension | null)[]> & { cancel(): void } {
|
||||
let $resultPromise = $Call.ByID(3094292124) as any;
|
||||
let $typingPromise = $resultPromise.then(($result: any) => {
|
||||
return $$createType2($result);
|
||||
}) as any;
|
||||
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
|
||||
return $typingPromise;
|
||||
}
|
||||
|
||||
/**
|
||||
* GetDefaultExtensions 获取默认扩展配置(用于前端绑定生成)
|
||||
*/
|
||||
export function GetDefaultExtensions(): Promise<models$0.Extension[]> & { cancel(): void } {
|
||||
let $resultPromise = $Call.ByID(4036328166) as any;
|
||||
let $typingPromise = $resultPromise.then(($result: any) => {
|
||||
return $$createType4($result);
|
||||
}) as any;
|
||||
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
|
||||
return $typingPromise;
|
||||
}
|
||||
|
||||
/**
|
||||
* GetExtensionByKey 根据Key获取扩展
|
||||
*/
|
||||
export function GetExtensionByKey(key: string): Promise<ent$0.Extension | null> & { cancel(): void } {
|
||||
let $resultPromise = $Call.ByID(2551065776, key) as any;
|
||||
let $typingPromise = $resultPromise.then(($result: any) => {
|
||||
return $$createType1($result);
|
||||
}) as any;
|
||||
@@ -56,11 +32,47 @@ export function GetExtensionByKey(key: string): Promise<ent$0.Extension | null>
|
||||
return $typingPromise;
|
||||
}
|
||||
|
||||
/**
|
||||
* GetExtensionByID 根据ID获取扩展
|
||||
*/
|
||||
export function GetExtensionByID(id: number): Promise<ent$0.Extension | null> & { cancel(): void } {
|
||||
let $resultPromise = $Call.ByID(1521424252, id) as any;
|
||||
let $typingPromise = $resultPromise.then(($result: any) => {
|
||||
return $$createType3($result);
|
||||
}) as any;
|
||||
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
|
||||
return $typingPromise;
|
||||
}
|
||||
|
||||
/**
|
||||
* GetExtensionConfig 获取扩展配置
|
||||
*/
|
||||
export function GetExtensionConfig(id: number): Promise<{ [_: string]: any }> & { cancel(): void } {
|
||||
let $resultPromise = $Call.ByID(1629559882, id) as any;
|
||||
let $typingPromise = $resultPromise.then(($result: any) => {
|
||||
return $$createType4($result);
|
||||
}) as any;
|
||||
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
|
||||
return $typingPromise;
|
||||
}
|
||||
|
||||
/**
|
||||
* GetExtensions 获取所有扩展
|
||||
*/
|
||||
export function GetExtensions(): Promise<(ent$0.Extension | null)[]> & { cancel(): void } {
|
||||
let $resultPromise = $Call.ByID(3179289021) as any;
|
||||
let $typingPromise = $resultPromise.then(($result: any) => {
|
||||
return $$createType5($result);
|
||||
}) as any;
|
||||
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
|
||||
return $typingPromise;
|
||||
}
|
||||
|
||||
/**
|
||||
* ResetExtensionConfig 重置单个扩展到默认状态
|
||||
*/
|
||||
export function ResetExtensionConfig(key: string): Promise<void> & { cancel(): void } {
|
||||
let $resultPromise = $Call.ByID(3990780299, key) as any;
|
||||
export function ResetExtensionConfig(id: number): Promise<void> & { cancel(): void } {
|
||||
let $resultPromise = $Call.ByID(3990780299, id) as any;
|
||||
return $resultPromise;
|
||||
}
|
||||
|
||||
@@ -83,22 +95,23 @@ export function SyncExtensions(): Promise<void> & { cancel(): void } {
|
||||
/**
|
||||
* UpdateExtensionConfig 更新扩展配置
|
||||
*/
|
||||
export function UpdateExtensionConfig(key: string, config: { [_: string]: any }): Promise<void> & { cancel(): void } {
|
||||
let $resultPromise = $Call.ByID(3184142503, key, config) as any;
|
||||
export function UpdateExtensionConfig(id: number, config: { [_: string]: any }): Promise<void> & { cancel(): void } {
|
||||
let $resultPromise = $Call.ByID(3184142503, id, config) as any;
|
||||
return $resultPromise;
|
||||
}
|
||||
|
||||
/**
|
||||
* UpdateExtensionEnabled 更新扩展启用状态
|
||||
*/
|
||||
export function UpdateExtensionEnabled(key: string, enabled: boolean): Promise<void> & { cancel(): void } {
|
||||
let $resultPromise = $Call.ByID(1067300094, key, enabled) as any;
|
||||
export function UpdateExtensionEnabled(id: number, enabled: boolean): Promise<void> & { cancel(): void } {
|
||||
let $resultPromise = $Call.ByID(1067300094, id, enabled) as any;
|
||||
return $resultPromise;
|
||||
}
|
||||
|
||||
// Private type creation functions
|
||||
const $$createType0 = ent$0.Extension.createFrom;
|
||||
const $$createType1 = $Create.Nullable($$createType0);
|
||||
const $$createType2 = $Create.Array($$createType1);
|
||||
const $$createType3 = models$0.Extension.createFrom;
|
||||
const $$createType4 = $Create.Array($$createType3);
|
||||
const $$createType0 = models$0.Extension.createFrom;
|
||||
const $$createType1 = $Create.Array($$createType0);
|
||||
const $$createType2 = ent$0.Extension.createFrom;
|
||||
const $$createType3 = $Create.Nullable($$createType2);
|
||||
const $$createType4 = $Create.Map($Create.Any, $Create.Any);
|
||||
const $$createType5 = $Create.Array($$createType3);
|
||||
|
||||
@@ -21,22 +21,34 @@ import * as models$0 from "../models/models.js";
|
||||
import * as ent$0 from "../models/ent/models.js";
|
||||
|
||||
/**
|
||||
* GetAllKeyBindings 获取所有快捷键
|
||||
* GetDefaultKeyBindings 获取默认快捷键配置
|
||||
*/
|
||||
export function GetAllKeyBindings(): Promise<(ent$0.KeyBinding | null)[]> & { cancel(): void } {
|
||||
let $resultPromise = $Call.ByID(1633502882) as any;
|
||||
export function GetDefaultKeyBindings(): Promise<models$0.KeyBinding[]> & { cancel(): void } {
|
||||
let $resultPromise = $Call.ByID(3843471588) as any;
|
||||
let $typingPromise = $resultPromise.then(($result: any) => {
|
||||
return $$createType2($result);
|
||||
return $$createType1($result);
|
||||
}) as any;
|
||||
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
|
||||
return $typingPromise;
|
||||
}
|
||||
|
||||
/**
|
||||
* GetDefaultKeyBindings 获取默认快捷键配置
|
||||
* GetKeyBindingByID 根据ID获取快捷键
|
||||
*/
|
||||
export function GetDefaultKeyBindings(): Promise<models$0.KeyBinding[]> & { cancel(): void } {
|
||||
let $resultPromise = $Call.ByID(3843471588) as any;
|
||||
export function GetKeyBindingByID(id: number): Promise<ent$0.KeyBinding | null> & { cancel(): void } {
|
||||
let $resultPromise = $Call.ByID(1578192526, id) as any;
|
||||
let $typingPromise = $resultPromise.then(($result: any) => {
|
||||
return $$createType3($result);
|
||||
}) as any;
|
||||
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
|
||||
return $typingPromise;
|
||||
}
|
||||
|
||||
/**
|
||||
* GetKeyBindings 根据类型获取快捷键
|
||||
*/
|
||||
export function GetKeyBindings(kbType: models$0.KeyBindingType): Promise<(ent$0.KeyBinding | null)[]> & { cancel(): void } {
|
||||
let $resultPromise = $Call.ByID(4253885163, kbType) as any;
|
||||
let $typingPromise = $resultPromise.then(($result: any) => {
|
||||
return $$createType4($result);
|
||||
}) as any;
|
||||
@@ -45,15 +57,11 @@ export function GetDefaultKeyBindings(): Promise<models$0.KeyBinding[]> & { canc
|
||||
}
|
||||
|
||||
/**
|
||||
* GetKeyBindingByKey 根据Key获取快捷键
|
||||
* ResetKeyBindings 重置所有快捷键到默认值
|
||||
*/
|
||||
export function GetKeyBindingByKey(key: string): Promise<ent$0.KeyBinding | null> & { cancel(): void } {
|
||||
let $resultPromise = $Call.ByID(852938650, key) as any;
|
||||
let $typingPromise = $resultPromise.then(($result: any) => {
|
||||
return $$createType1($result);
|
||||
}) as any;
|
||||
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
|
||||
return $typingPromise;
|
||||
export function ResetKeyBindings(): Promise<void> & { cancel(): void } {
|
||||
let $resultPromise = $Call.ByID(4251626010) as any;
|
||||
return $resultPromise;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,24 +81,24 @@ export function SyncKeyBindings(): Promise<void> & { cancel(): void } {
|
||||
}
|
||||
|
||||
/**
|
||||
* UpdateKeyBindingCommand 更新快捷键命令
|
||||
* UpdateKeyBindingEnabled 更新快捷键启用状态
|
||||
*/
|
||||
export function UpdateKeyBindingCommand(key: string, command: string): Promise<void> & { cancel(): void } {
|
||||
let $resultPromise = $Call.ByID(1293670628, key, command) as any;
|
||||
export function UpdateKeyBindingEnabled(id: number, enabled: boolean): Promise<void> & { cancel(): void } {
|
||||
let $resultPromise = $Call.ByID(843626124, id, enabled) as any;
|
||||
return $resultPromise;
|
||||
}
|
||||
|
||||
/**
|
||||
* UpdateKeyBindingEnabled 更新快捷键启用状态
|
||||
* UpdateKeyBindingKeys 更新快捷键绑定(根据操作系统自动判断更新哪个字段)
|
||||
*/
|
||||
export function UpdateKeyBindingEnabled(key: string, enabled: boolean): Promise<void> & { cancel(): void } {
|
||||
let $resultPromise = $Call.ByID(843626124, key, enabled) as any;
|
||||
export function UpdateKeyBindingKeys(id: number, key: string): Promise<void> & { cancel(): void } {
|
||||
let $resultPromise = $Call.ByID(3432755175, id, key) as any;
|
||||
return $resultPromise;
|
||||
}
|
||||
|
||||
// Private type creation functions
|
||||
const $$createType0 = ent$0.KeyBinding.createFrom;
|
||||
const $$createType1 = $Create.Nullable($$createType0);
|
||||
const $$createType2 = $Create.Array($$createType1);
|
||||
const $$createType3 = models$0.KeyBinding.createFrom;
|
||||
const $$createType0 = models$0.KeyBinding.createFrom;
|
||||
const $$createType1 = $Create.Array($$createType0);
|
||||
const $$createType2 = ent$0.KeyBinding.createFrom;
|
||||
const $$createType3 = $Create.Nullable($$createType2);
|
||||
const $$createType4 = $Create.Array($$createType3);
|
||||
|
||||
@@ -18,10 +18,10 @@ import * as application$0 from "../../../github.com/wailsapp/wails/v3/pkg/applic
|
||||
import * as ent$0 from "../models/ent/models.js";
|
||||
|
||||
/**
|
||||
* GetThemeByKey 根据Key获取主题
|
||||
* GetThemeByName 根据Key获取主题
|
||||
*/
|
||||
export function GetThemeByKey(key: string): Promise<ent$0.Theme | null> & { cancel(): void } {
|
||||
let $resultPromise = $Call.ByID(808794256, key) as any;
|
||||
export function GetThemeByName(name: string): Promise<ent$0.Theme | null> & { cancel(): void } {
|
||||
let $resultPromise = $Call.ByID(1938954770, name) as any;
|
||||
let $typingPromise = $resultPromise.then(($result: any) => {
|
||||
return $$createType1($result);
|
||||
}) as any;
|
||||
|
||||
Reference in New Issue
Block a user