Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(typescript): update types #75

Merged
merged 1 commit into from
Feb 13, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 11 additions & 36 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,45 +1,20 @@
// Type definitions for Apache Cordova Vibration plugin
// Type definitions for cordova-plugin-vibration 3.1
// Project: https://github.com/apache/cordova-plugin-vibration
// Definitions by: Microsoft Open Technologies Inc <http://msopentech.com>, Louis Lagrange <https://github.com/Minishlink/>
// Definitions by: Microsoft Open Technologies Inc <http://msopentech.com>
// Louis Lagrange <https://github.com/Minishlink>
// Tim Brust <https://github.com/timbru31>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
//
// Copyright (c) Microsoft Open Technologies Inc
// Licensed under the MIT license.

interface Navigator {
/**
* Vibrates the device for the specified amount of time.
* @param time Milliseconds to vibrate the device. 0 cancels the vibration. Ignored on iOS.
*/
vibrate(time: number): void;

/**
* Vibrates the device with a given pattern.
* @param time Sequence of durations (in milliseconds) for which to turn on or off the vibrator. Ignored on iOS.
*/
vibrate(time: number[]): void;
}

interface Notification {
/**
* Vibrates the device for the specified amount of time.
* @param time Milliseconds to vibrate the device. Ignored on iOS.
* @deprecated
*/
* Vibrates the device for the specified amount of time.
* @param time Milliseconds to vibrate the device. 0 cancels the vibration. Ignored on iOS.
*/
vibrate(time: number): void;

/**
* Vibrates the device with a given pattern.
* @param number[] pattern Pattern with which to vibrate the device.
* The first value - number of milliseconds to wait before turning the vibrator on.
* The next value - the number of milliseconds for which to keep the vibrator on before turning it off.
* @param number repeat Optional index into the pattern array at which to start repeating (will repeat until canceled),
* or -1 for no repetition (default).
* @deprecated
*/
vibrateWithPattern(pattern: number[], repeat: number): void;
/**
* Immediately cancels any currently running vibration.
* @deprecated
* @param time Sequence of durations (in milliseconds) for which to turn on or off the vibrator. Ignored on iOS.
*/
cancelVibration(): void;
}
vibrate(time: number[]): void;
}