mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Merge pull request #411 from Pax1601/410-update-shortcuts-to-plugin-friendly-format
Converted for plugin use
This commit is contained in:
16
client/@types/olympus/index.d.ts
vendored
16
client/@types/olympus/index.d.ts
vendored
@@ -588,11 +588,11 @@ declare module "interfaces" {
|
||||
name?: string;
|
||||
shiftKey?: boolean;
|
||||
}
|
||||
export interface KeyboardShortcutOptions extends ShortcutOptions {
|
||||
export interface ShortcutKeyboardOptions extends ShortcutOptions {
|
||||
code: string;
|
||||
event?: "keydown" | "keyup";
|
||||
}
|
||||
export interface MouseShortcutOptions extends ShortcutOptions {
|
||||
export interface ShortcutMouseOptions extends ShortcutOptions {
|
||||
button: number;
|
||||
event: "mousedown" | "mouseup";
|
||||
}
|
||||
@@ -1493,26 +1493,28 @@ declare module "plugin/pluginmanager" {
|
||||
}
|
||||
}
|
||||
declare module "shortcut/shortcut" {
|
||||
import { KeyboardShortcutOptions, MouseShortcutOptions, ShortcutOptions } from "interfaces";
|
||||
import { ShortcutKeyboardOptions, ShortcutMouseOptions, ShortcutOptions } from "interfaces";
|
||||
export abstract class Shortcut {
|
||||
#private;
|
||||
constructor(config: ShortcutOptions);
|
||||
getConfig(): ShortcutOptions;
|
||||
}
|
||||
export class ShortcutKeyboard extends Shortcut {
|
||||
constructor(config: KeyboardShortcutOptions);
|
||||
constructor(config: ShortcutKeyboardOptions);
|
||||
}
|
||||
export class ShortcutMouse extends Shortcut {
|
||||
constructor(config: MouseShortcutOptions);
|
||||
constructor(config: ShortcutMouseOptions);
|
||||
}
|
||||
}
|
||||
declare module "shortcut/shortcutmanager" {
|
||||
import { ShortcutKeyboardOptions, ShortcutMouseOptions } from "interfaces";
|
||||
import { Manager } from "other/manager";
|
||||
import { Shortcut } from "shortcut/shortcut";
|
||||
export class ShortcutManager extends Manager {
|
||||
#private;
|
||||
constructor();
|
||||
add(name: string, shortcut: Shortcut): this;
|
||||
add(name: string, shortcut: any): this;
|
||||
addKeyboardShortcut(name: string, shortcutKeyboardOptions: ShortcutKeyboardOptions): this;
|
||||
addMouseShortcut(name: string, shortcutMouseOptions: ShortcutMouseOptions): this;
|
||||
getKeysBeingHeld(): string[];
|
||||
keyComboMatches(combo: string[]): boolean;
|
||||
onKeyDown(callback: CallableFunction): void;
|
||||
|
||||
Reference in New Issue
Block a user