mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 12:56:46 +08:00
Added definitions for auto-launch package
Project page is here. https://github.com/Teamwork/node-auto-launch > Launch node-webkit apps at login (mac & windows)
This commit is contained in:
17
auto-launch/auto-launch-tests.ts
Normal file
17
auto-launch/auto-launch-tests.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
/// <reference path="auto-launch.d.ts" />
|
||||
|
||||
import AutoLaunch = require('auto-launch');
|
||||
|
||||
var a1 = new AutoLaunch({
|
||||
name: 'Foo',
|
||||
});
|
||||
|
||||
var a2 = new AutoLaunch({
|
||||
name: 'Foo',
|
||||
path: '/Applications/Foo.app',
|
||||
isHidden: true,
|
||||
});
|
||||
|
||||
a1.enable();
|
||||
a2.disable();
|
||||
var enabled: boolean = a1.isEnabled();
|
||||
41
auto-launch/auto-launch.d.ts
vendored
Normal file
41
auto-launch/auto-launch.d.ts
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
// Type definitions for auto-launch 0.1.18
|
||||
// Project: https://github.com/Teamwork/node-auto-launch
|
||||
// Definitions by: rhysd <https://github.com/rhysd>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
interface AutoLaunchOption {
|
||||
/**
|
||||
* Application name.
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Hidden on launch or not. Default is false.
|
||||
*/
|
||||
isHidden?: boolean;
|
||||
/**
|
||||
* Path to application directory.
|
||||
* Default is process.execPath.
|
||||
*/
|
||||
path?: string;
|
||||
}
|
||||
|
||||
declare class AutoLaunch {
|
||||
constructor(opts: AutoLaunchOption);
|
||||
/**
|
||||
* Enables to launch at start up
|
||||
*/
|
||||
enable(callback?: (err: Error) => void): void;
|
||||
/**
|
||||
* Disables to launch at start up
|
||||
*/
|
||||
disable(callback?: (err: Error) => void): void;
|
||||
/**
|
||||
* Returns if auto start up is enabled
|
||||
*/
|
||||
isEnabled(callback?: (err: Error) => void): boolean;
|
||||
}
|
||||
|
||||
declare module "auto-launch" {
|
||||
var al: typeof AutoLaunch;
|
||||
export = al;
|
||||
}
|
||||
Reference in New Issue
Block a user