From 6942a05ee1739b3832bbfb3dfcf5803334c4dccf Mon Sep 17 00:00:00 2001 From: Wouter Van Schandevijl Date: Tue, 4 Apr 2023 00:45:22 +0200 Subject: [PATCH] type safety? --- src/WiredInput.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/WiredInput.ts b/src/WiredInput.ts index 8cb4793..1071538 100644 --- a/src/WiredInput.ts +++ b/src/WiredInput.ts @@ -1,8 +1,13 @@ import * as React from 'react'; -import { createComponent } from '@lit-labs/react'; +import { createComponent, EventName } from '@lit-labs/react'; import { WiredInput as _WiredInput } from 'wired-elements/lib/wired-input.js'; +type EventTargetWithValue = EventTarget & { value: string }; + +export interface ChangeEvent extends Omit { + target: EventTargetWithValue +} + export const WiredInput = createComponent(React, 'wired-input', _WiredInput, { - onChange: 'input', - onchange: 'input' -}); \ No newline at end of file + onChange: 'input' as EventName, +});