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

chore: remove Haptics plugin #3363

Merged
merged 9 commits into from
Aug 21, 2020
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions android/capacitor/src/main/java/com/getcapacitor/Bridge.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.getcapacitor.plugin.Device;
import com.getcapacitor.plugin.Filesystem;
import com.getcapacitor.plugin.Geolocation;
import com.getcapacitor.plugin.Haptics;
import com.getcapacitor.plugin.Keyboard;
import com.getcapacitor.plugin.LocalNotifications;
import com.getcapacitor.plugin.Modals;
Expand Down Expand Up @@ -402,7 +401,6 @@ private void registerAllPlugins() {
this.registerPlugin(LocalNotifications.class);
this.registerPlugin(Filesystem.class);
this.registerPlugin(Geolocation.class);
this.registerPlugin(Haptics.class);
this.registerPlugin(Keyboard.class);
this.registerPlugin(Modals.class);
this.registerPlugin(Network.class);
Expand Down

This file was deleted.

57 changes: 0 additions & 57 deletions core/src/core-plugin-definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export interface PluginRegistry {
Device: DevicePlugin;
Filesystem: FilesystemPlugin;
Geolocation: GeolocationPlugin;
Haptics: HapticsPlugin;
Keyboard: KeyboardPlugin;
LocalNotifications: LocalNotificationsPlugin;
Modals: ModalsPlugin;
Expand Down Expand Up @@ -928,62 +927,6 @@ export type GeolocationWatchCallback = (

//

export interface HapticsPlugin extends Plugin {
/**
* Trigger a haptics "impact" feedback
*/
impact(options: HapticsImpactOptions): void;
/**
* Trigger a haptics "notification" feedback
*/
notification(options: HapticsNotificationOptions): void;
/**
* Vibrate the device
*/
vibrate(): void;
/**
* Trigger a selection started haptic hint
*/
selectionStart(): void;
/**
* Trigger a selection changed haptic hint. If a selection was
* started already, this will cause the device to provide haptic
* feedback
*/
selectionChanged(): void;
/**
* If selectionStart() was called, selectionEnd() ends the selection.
* For example, call this when a user has lifted their finger from a control
*/
selectionEnd(): void;
}

export interface HapticsImpactOptions {
style: HapticsImpactStyle;
}

export enum HapticsImpactStyle {
Heavy = 'HEAVY',
Medium = 'MEDIUM',
Light = 'LIGHT',
}

export interface HapticsNotificationOptions {
type: HapticsNotificationType;
}

export enum HapticsNotificationType {
SUCCESS = 'SUCCESS',
WARNING = 'WARNING',
ERROR = 'ERROR',
}

export interface VibrateOptions {
duration?: number;
}

//

export interface KeyboardPlugin extends Plugin {
/**
* Show the keyboard. This method is alpha and may have issues
Expand Down
9 changes: 0 additions & 9 deletions ios/Capacitor/Capacitor/Plugins/DefaultPlugins.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,6 @@
CAP_PLUGIN_METHOD(clearWatch, CAPPluginReturnPromise);
)

CAP_PLUGIN(CAPHapticsPlugin, "Haptics",
CAP_PLUGIN_METHOD(impact, CAPPluginReturnNone);
CAP_PLUGIN_METHOD(notification, CAPPluginReturnNone);
CAP_PLUGIN_METHOD(selectionStart, CAPPluginReturnNone);
CAP_PLUGIN_METHOD(selectionChanged, CAPPluginReturnNone);
CAP_PLUGIN_METHOD(selectionEnd, CAPPluginReturnNone);
CAP_PLUGIN_METHOD(vibrate, CAPPluginReturnNone);
)

CAP_PLUGIN(CAPKeyboard, "Keyboard",
CAP_PLUGIN_METHOD(show, CAPPluginReturnPromise);
CAP_PLUGIN_METHOD(hide, CAPPluginReturnPromise);
Expand Down
71 changes: 0 additions & 71 deletions ios/Capacitor/Capacitor/Plugins/Haptics.swift

This file was deleted.