Compare commits

..

No commits in common. "master" and "v2.0.41" have entirely different histories.

4 changed files with 3 additions and 20 deletions

View File

@ -1,12 +1,5 @@
# Changelog
## 2025-04-18 - 2.0.42 - fix(directives)
Add explicit type annotations to subscribeWithTemplate directive export
- Imported DirectiveResult type for better typing
- Defined SubscribeWithTemplateFn signature to ensure proper type inference
- Used type assertion with 'as SubscribeWithTemplateFn' to improve type safety
## 2025-04-18 - 2.0.41 - fix(directives)
Refactor export statements in directives index for consistency

View File

@ -1,6 +1,6 @@
{
"name": "@design.estate/dees-element",
"version": "2.0.42",
"version": "2.0.41",
"private": false,
"description": "A library for creating custom elements extending the lit element class with additional functionalities.",
"main": "dist_ts/index.js",

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@design.estate/dees-element',
version: '2.0.42',
version: '2.0.41',
description: 'A library for creating custom elements extending the lit element class with additional functionalities.'
}

View File

@ -1,5 +1,4 @@
import { type TemplateResult, noChange } from 'lit';
import type { DirectiveResult } from 'lit/directive.js';
import { AsyncDirective, directive } from 'lit/async-directive.js';
import { rxjs } from '@push.rocks/smartrx';
@ -49,13 +48,4 @@ class SubscribeWithTemplateDirective extends AsyncDirective {
* Directive that renders templates for each emission of an Observable.
* Usage: html`${subscribeWithTemplate(myObservable, v => html`<span>${v}</span>`)}`
*/
/**
* Typed directive function signature: returns a Lit DirectiveResult.
*/
type SubscribeWithTemplateFn = <T>(
observable: rxjs.Observable<T>,
templateFn: (value: T) => TemplateResult | unknown
) => DirectiveResult;
export const subscribeWithTemplate = directive(
SubscribeWithTemplateDirective
) as SubscribeWithTemplateFn;
export const subscribeWithTemplate = directive(SubscribeWithTemplateDirective);