chore(): migrate vue to typescript (#15928)

This commit is contained in:
Modus Create
2018-10-24 09:22:36 -04:00
committed by Mike Hartington
parent d800c48734
commit e251ca71b4
61 changed files with 1339 additions and 7860 deletions

View File

@ -0,0 +1,57 @@
import * as apiUtils from './api-utils';
import { ProxyMenuControllerInterface } from './interfaces';
// A proxy class that allows early access to controller methods
export default class ProxyMenuController implements ProxyMenuControllerInterface {
constructor(public tag: string) {}
// Open a menu
open(menuId?: string): Promise<boolean> {
return apiUtils.proxyMethod(this.tag, 'open', menuId);
}
// Close a menu
close(menuId?: string): Promise<boolean> {
return apiUtils.proxyMethod(this.tag, 'close', menuId);
}
// Toggle a menu
toggle(menuId?: string): Promise<boolean> {
return apiUtils.proxyMethod(this.tag, 'toggle', menuId);
}
// Enable or disable a menu
enable(shouldEnable: boolean, menuId?: string): Promise<HTMLElement> {
return apiUtils.proxyMethod(this.tag, 'enable', shouldEnable, menuId);
}
// Enable or disable the ability to swipe open the menu
swipeEnable(shouldEnable: boolean, menuId?: string): Promise<HTMLElement> {
return apiUtils.proxyMethod(this.tag, 'swipeEnable', shouldEnable, menuId);
}
// Check if specific or any menu is open
isOpen(menuId?: string): Promise<boolean> {
return apiUtils.proxyMethod(this.tag, 'isOpen', menuId);
}
// Check is certain menu is enabled
isEnabled(menuId?: string): Promise<boolean> {
return apiUtils.proxyMethod(this.tag, 'isEnabled', menuId);
}
// Get specific or first menu instance
get(menuId?: string): Promise<HTMLElement> {
return apiUtils.proxyMethod(this.tag, 'get', menuId);
}
// Get an instance of an open menu
getOpen(): Promise<HTMLElement> {
return apiUtils.proxyMethod(this.tag, 'getOpen');
}
// Get an array of all menus
getMenus(): Promise<HTMLElement> {
return apiUtils.proxyMethod(this.tag, 'getMenus');
}
}