WebReflection / usignal

A blend of @preact/signals-core and solid-js basic reactivity API
ISC License
220 stars 15 forks source link

Fixed types #5

Closed 38elements closed 2 years ago

38elements commented 2 years ago

This added @protected to Signal._, since Signal._ is used within subclass. https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#property-modifiers

coveralls commented 2 years ago

Pull Request Test Coverage Report for Build 3077376584


Totals Coverage Status
Change from base Build 3069266852: 0.0%
Covered Lines: 231
Relevant Lines: 231

💛 - Coveralls
WebReflection commented 2 years ago

this ruins value which is the only field that matters ... see https://github.com/WebReflection/usignal/blob/main/types/index.d.ts#L7-L17

why do you think this is relevant or needed?

38elements commented 2 years ago

I am sorry. I may understand problem correctly. The problem is these lines. Computed and Reactive have value property. Signal does not have value property. It have _ propery. I do not know how to resolve it by using JSDoc annotations.

https://github.com/WebReflection/usignal/blob/15c07e14250c4b35181cda0688201125c809ff75/esm/index.js#L117-L119

https://github.com/WebReflection/usignal/blob/15c07e14250c4b35181cda0688201125c809ff75/esm/index.js#L228-L230

I can only come up with the following solution. Stopping generating index.d.ts by tsc -p .. Creating index.d.ts by manualy.

WebReflection commented 2 years ago

that's what the sed command does ... so I am generatig index.d.ts and patching after, and it seems to work well.

38elements commented 2 years ago

Thank you for reply. I think your current method is correct. I apologize for wasting your time.