From 25cc03276ff9ce79399adfecf826bc4a5ceab609 Mon Sep 17 00:00:00 2001 From: Dermot Duffy Date: Sun, 13 Mar 2022 11:29:27 -0700 Subject: [PATCH] Add allowPropagation option. --- src/action-handler-directive.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/action-handler-directive.ts b/src/action-handler-directive.ts index f1d2a467..a79a8fc9 100644 --- a/src/action-handler-directive.ts +++ b/src/action-handler-directive.ts @@ -18,7 +18,7 @@ interface ActionHandler extends HTMLElement { bind(element: Element, options): void; } interface ActionHandlerElement extends HTMLElement { - actionHandlerOptions?: ActionHandlerOptions; + actionHandlerOptions?: FrigateCardActionHandlerOptions; } declare global { @@ -27,6 +27,10 @@ declare global { } } +interface FrigateCardActionHandlerOptions extends ActionHandlerOptions { + allowPropagation?: boolean; +} + class ActionHandler extends HTMLElement implements ActionHandler { public holdTime = 400; @@ -171,7 +175,7 @@ const getActionHandler = (): ActionHandler => { export const actionHandlerBind = ( element: ActionHandlerElement, - options?: ActionHandlerOptions, + options?: FrigateCardActionHandlerOptions, ): void => { const actionhandler: ActionHandler = getActionHandler(); if (!actionhandler) { @@ -188,6 +192,6 @@ export const actionHandler = directive( } // eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars - render(_options?: ActionHandlerOptions) {} + render(_options?: FrigateCardActionHandlerOptions) {} }, );