Skip to content
Open
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: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build
.build
dist
example-app
example-app
56 changes: 20 additions & 36 deletions example-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions example-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
"ionicons": "^7.4.0",
"react": "19.0.0",
"react-dom": "19.0.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"react-router": "^5.3.4",
"react-router-dom": "^5.3.4"
},
Expand All @@ -32,8 +32,8 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^16.2.0",
"@testing-library/user-event": "^14.4.3",
"@types/react": "19.0.10",
"@types/react-dom": "19.0.4",
"@types/react": "^19.0.10",
"@types/react-dom": "^19.0.4",
"@vitejs/plugin-legacy": "^5.0.0",
"@vitejs/plugin-react": "^4.0.1",
"cypress": "^13.5.0",
Expand All @@ -46,7 +46,7 @@
"terser": "^5.4.0",
"typescript": "^5.1.6",
"typescript-eslint": "^8.24.0",
"vite": "~5.2.0",
"vite": "^5.2.0",
"vitest": "^0.34.6"
},
"overrides": {
Expand Down
27 changes: 14 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
"eslint": "eslint . --ext ts",
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
"prettier": "prettier \"**/*.{css,html,ts,js,java}\" --plugin=prettier-plugin-java",
"swiftlint": "node-swiftlint",
"docgen": "docgen --api HapticsPlugin --output-readme README.md --output-json dist/docs.json",
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.mjs",
Expand All @@ -49,24 +49,25 @@
"devDependencies": {
"@capacitor/android": "next",
"@capacitor/core": "next",
"@capacitor/docgen": "0.2.2",
"@capacitor/docgen": "^0.3.0",
"@capacitor/ios": "next",
"@ionic/eslint-config": "^0.4.0",
"@ionic/prettier-config": "~1.0.1",
"@ionic/swiftlint-config": "^1.1.2",
"@ionic/prettier-config": "^4.0.0",
"@ionic/swiftlint-config": "^2.0.0",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/exec": "^7.1.0",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^12.0.0",
"@semantic-release/npm": "^13.1.1",
"@semantic-release/github": "^12.0.2",
"@semantic-release/npm": "^13.1.2",
"@types/node": "^24.10.1",
"eslint": "^8.57.0",
"prettier": "~2.3.0",
"prettier-plugin-java": "~1.0.2",
"rimraf": "^6.0.1",
"rollup": "^4.26.0",
"semantic-release": "^25.0.1",
"swiftlint": "^1.0.1",
"typescript": "~4.1.5"
"prettier": "^3.6.2",
"prettier-plugin-java": "^2.7.7",
"rimraf": "^6.1.2",
"rollup": "^4.53.3",
"semantic-release": "^25.0.2",
"swiftlint": "^2.0.0",
"typescript": "^5.9.3"
},
"peerDependencies": {
"@capacitor/core": "next"
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { registerPlugin } from '@capacitor/core';
import type { HapticsPlugin } from './definitions';

const Haptics = registerPlugin<HapticsPlugin>('Haptics', {
web: () => import('./web').then(m => new m.HapticsWeb()),
web: () => import('./web').then((m) => new m.HapticsWeb()),
});

export * from './definitions';
Expand Down
11 changes: 2 additions & 9 deletions src/web.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import { WebPlugin } from '@capacitor/core';

import { ImpactStyle, NotificationType } from './definitions';
import type {
HapticsPlugin,
ImpactOptions,
NotificationOptions,
VibrateOptions,
} from './definitions';
import type { HapticsPlugin, ImpactOptions, NotificationOptions, VibrateOptions } from './definitions';

export class HapticsWeb extends WebPlugin implements HapticsPlugin {
selectionStarted = false;
Expand Down Expand Up @@ -49,9 +44,7 @@ export class HapticsWeb extends WebPlugin implements HapticsPlugin {
return [61];
}

private patternForNotification(
type: NotificationType = NotificationType.Success,
): number[] {
private patternForNotification(type: NotificationType = NotificationType.Success): number[] {
if (type === NotificationType.Warning) {
return [30, 40, 30, 50, 60];
} else if (type === NotificationType.Error) {
Expand Down