From 8df6aa19fe83a6307ac50742f1a22c0614b64e49 Mon Sep 17 00:00:00 2001 From: Jan Andrle Date: Thu, 21 Sep 2023 13:36:28 +0200 Subject: [PATCH] :sparkles: add className and classList to ElementAttributes --- index.d.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index 3a24036..a83cd13 100644 --- a/index.d.ts +++ b/index.d.ts @@ -25,6 +25,10 @@ type AttrsModified= { * Provide option to add/remove/toggle CSS clasess (index of object) using 1/0/-1. In fact `el.classList.toggle(class_name)` for `-1` and `el.classList.toggle(class_name, Boolean(...))` for others. */ classList: Record, + /** + * By default simiral to `className`, but also supports `string[]` + * */ + className: string | (string|boolean|undefined)[]; /** * Sets `aria-*` simiraly to `dataset` * */ @@ -40,8 +44,8 @@ type AttrsModified= { */ type ElementAttributes= T extends keyof ElementTagNameMap ? - Omit & AttrsModified : - Omit & AttrsModified; + Omit & AttrsModified : + Omit & AttrsModified; export function assign(element: El, ...attrs_array: ElementAttributes[]): El type ElementExtender= (element: El)=> El;