menubar: Provides its own types (#39462)

This commit is contained in:
Alexander T
2019-10-28 09:38:15 -07:00
committed by Jesse Trinity
parent ded19e1847
commit 1b8bd0adeb
6 changed files with 6 additions and 201 deletions
+6
View File
@@ -2130,6 +2130,12 @@
"sourceRepoURL": "http://www.mendix.com",
"asOfVersion": "0.8.1"
},
{
"libraryName": "menubar",
"typingsPackageName": "menubar",
"sourceRepoURL": "https://github.com/maxogden/menubar",
"asOfVersion": "6.0.0"
},
{
"libraryName": "metisMenu",
"typingsPackageName": "metismenu",
-64
View File
@@ -1,64 +0,0 @@
// Type definitions for menubar 5.1.0
// Project: https://github.com/maxogden/menubar
// Definitions by: rhysd <https://rhysd.github.io>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/// <reference types="electron" />
/// <reference types="node" />
declare namespace Menubar {
type Position
= "trayLeft"
| "trayBottomLeft"
| "trayRight"
| "trayBottomRight"
| "trayCenter"
| "trayBottomCenter"
| "topLeft"
| "topRight"
| "bottomLeft"
| "bottomRight"
| "topCenter"
| "bottomCenter"
| "center";
type TrayBounds
= "trayLeft"
| "trayBottomLeft"
| "trayRight"
| "trayBottomRight"
| "trayCenter"
| "trayBottomCenter";
interface ElectronPositioner {
move(pos: Position): void;
calculate(pos: Position, bounds?: TrayBounds): Electron.Point;
}
class MenubarApp extends NodeJS.EventEmitter {
app: Electron.App;
window: Electron.BrowserWindow;
tray: Electron.Tray;
positioner: ElectronPositioner;
setOption(opt: string, value: any): void;
getOption(opt: string): any;
showWindow(): void;
hideWindow(): void;
}
interface MenubarOptions extends Electron.BrowserWindowConstructorOptions {
dir?: string;
index?: string;
tooltip?: string;
tray?: Electron.Tray;
preloadWindow?: boolean;
alwaysOnTop?: boolean;
showOnAllWorkspaces?: boolean;
windowPosition?: Position;
showDockIcon?: boolean;
showOnRightClick?: boolean;
}
}
declare module "menubar" {
const ctor: (opts?: Menubar.MenubarOptions) => Menubar.MenubarApp;
export = ctor;
}
-27
View File
@@ -1,27 +0,0 @@
import menubar = require("menubar");
var mb1 = menubar();
mb1.on("ready", function ready () {
console.log("app is ready")
// your app code here
})
var mb2 = menubar({
index: 'file://path/to/index.html',
icon: '/path/to/icon.png',
width: 400,
height: 800,
preloadWindow: true,
transparent: true,
});
mb2.on('ready', () => mb2.showWindow());
function toggleWindow() {
if (mb2.window.isFocused()) {
mb2.hideWindow();
} else {
mb2.showWindow();
}
}
-6
View File
@@ -1,6 +0,0 @@
{
"private": true,
"dependencies": {
"electron": "^1.6.11"
}
}
-24
View File
@@ -1,24 +0,0 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"strictFunctionTypes": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"menubar-tests.ts"
]
}
-80
View File
@@ -1,80 +0,0 @@
{
"extends": "dtslint/dt.json",
"rules": {
"adjacent-overload-signatures": false,
"array-type": false,
"arrow-return-shorthand": false,
"ban-types": false,
"callable-types": false,
"comment-format": false,
"dt-header": false,
"npm-naming": false,
"eofline": false,
"export-just-namespace": false,
"import-spacing": false,
"interface-name": false,
"interface-over-type-literal": false,
"jsdoc-format": false,
"max-line-length": false,
"member-access": false,
"new-parens": false,
"no-any-union": false,
"no-boolean-literal-compare": false,
"no-conditional-assignment": false,
"no-consecutive-blank-lines": false,
"no-construct": false,
"no-declare-current-package": false,
"no-duplicate-imports": false,
"no-duplicate-variable": false,
"no-empty-interface": false,
"no-for-in-array": false,
"no-inferrable-types": false,
"no-internal-module": false,
"no-irregular-whitespace": false,
"no-mergeable-namespace": false,
"no-misused-new": false,
"no-namespace": false,
"no-object-literal-type-assertion": false,
"no-padding": false,
"no-redundant-jsdoc": false,
"no-redundant-jsdoc-2": false,
"no-redundant-undefined": false,
"no-reference-import": false,
"no-relative-import-in-test": false,
"no-self-import": false,
"no-single-declare-module": false,
"no-string-throw": false,
"no-unnecessary-callback-wrapper": false,
"no-unnecessary-class": false,
"no-unnecessary-generics": false,
"no-unnecessary-qualifier": false,
"no-unnecessary-type-assertion": false,
"no-useless-files": false,
"no-var-keyword": false,
"no-var-requires": false,
"no-void-expression": false,
"no-trailing-whitespace": false,
"object-literal-key-quotes": false,
"object-literal-shorthand": false,
"one-line": false,
"one-variable-per-declaration": false,
"only-arrow-functions": false,
"prefer-conditional-expression": false,
"prefer-const": false,
"prefer-declare-function": false,
"prefer-for-of": false,
"prefer-method-signature": false,
"prefer-template": false,
"radix": false,
"semicolon": false,
"space-before-function-paren": false,
"space-within-parens": false,
"strict-export-declare-modifiers": false,
"trim-file": false,
"triple-equals": false,
"typedef-whitespace": false,
"unified-signatures": false,
"void-return": false,
"whitespace": false
}
}