refactor: Retire the use of unmaintained custom-card-helpers (#1956)

- Closes #1295
This commit is contained in:
Dermot Duffy
2025-03-09 16:02:33 -07:00
committed by GitHub
parent c65ee3f0f2
commit a79ffa6edc
116 changed files with 933 additions and 545 deletions
+30
View File
@@ -0,0 +1,30 @@
/**
* Broadcast haptic feedback requests
*/
import { fireHASSEvent } from './fire-hass-event';
// Allowed types are from iOS HIG.
// https://developer.apple.com/design/human-interface-guidelines/ios/user-interaction/feedback/#haptics
// Implementors on platforms other than iOS should attempt to match the patterns (shown in HIG) as closely as possible.
export type HapticType =
| 'success'
| 'warning'
| 'failure'
| 'light'
| 'medium'
| 'heavy'
| 'selection';
declare global {
interface HASSDomEvents {
haptic: HapticType;
}
interface GlobalEventHandlersEventMap {
haptic: CustomEvent<HapticType>;
}
}
export const forwardHaptic = (hapticType: HapticType) => {
fireHASSEvent(window, 'haptic', hapticType);
};