@praxisjs/decorators 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/events/emit.d.ts +1 -1
- package/dist/events/emit.d.ts.map +1 -1
- package/dist/events/emit.js +4 -1
- package/dist/events/emit.js.map +1 -1
- package/package.json +1 -1
- package/src/events/emit.ts +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @praxisjs/decorators
|
|
2
2
|
|
|
3
|
+
## 0.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 966efdc: Fix JSX prop typing for `StatelessComponent` to automatically accept reactive values (`() => T`) without requiring manual declaration. `LibraryManagedAttributes` now uses `InstancePropsOf` directly instead of intersecting with the raw constructor props, preventing the erroneous `T | (T & (() => T))` type expansion.
|
|
8
|
+
|
|
9
|
+
`InstancePropsOf` now uses `_rawProps` to infer props for class components decorated with `@Prop()`, providing accurate JSX prop types without manual interface declarations.
|
|
10
|
+
|
|
11
|
+
The `@Emit` decorator type signature was relaxed from `unknown` to `any` to allow broader method compatibility. Devtools `Panel` and `DevToolsApp` components were refactored to use `@Prop()` and `@Emit()` decorators instead of manual props casting.
|
|
12
|
+
|
|
3
13
|
## 0.4.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
package/dist/events/emit.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { StatefulComponent } from "@praxisjs/core";
|
|
2
|
-
export declare function Emit(propName: string): (value: (this: StatefulComponent, ...args:
|
|
2
|
+
export declare function Emit(propName: string): (value: (this: StatefulComponent, ...args: any[]) => any, context: ClassMethodDecoratorContext<StatefulComponent>) => void;
|
|
3
3
|
//# sourceMappingURL=emit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emit.d.ts","sourceRoot":"","sources":["../../src/events/emit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAIxD,wBAAgB,IAAI,CAAC,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"emit.d.ts","sourceRoot":"","sources":["../../src/events/emit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAIxD,wBAAgB,IAAI,CAAC,QAAQ,EAAE,MAAM,IAGjC,OAAO,CAAC,IAAI,EAAE,iBAAiB,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACvD,SAAS,2BAA2B,CAAC,iBAAiB,CAAC,KACtD,IAAI,CAgCR"}
|
package/dist/events/emit.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { readProp } from "./helper";
|
|
2
2
|
export function Emit(propName) {
|
|
3
|
-
return function (
|
|
3
|
+
return function (
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
|
+
value, context) {
|
|
4
6
|
const wrapped = function (...args) {
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
5
8
|
const result = value.apply(this, args);
|
|
6
9
|
const callback = readProp(this, propName);
|
|
7
10
|
if (typeof callback !== "function")
|
package/dist/events/emit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emit.js","sourceRoot":"","sources":["../../src/events/emit.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,MAAM,UAAU,IAAI,CAAC,QAAgB;IACnC,OAAO,
|
|
1
|
+
{"version":3,"file":"emit.js","sourceRoot":"","sources":["../../src/events/emit.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,MAAM,UAAU,IAAI,CAAC,QAAgB;IACnC,OAAO;IACL,8DAA8D;IAC9D,KAAuD,EACvD,OAAuD;QAEvD,MAAM,OAAO,GAAG,UAEd,GAAG,IAAe;YAElB,mEAAmE;YACnE,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAEvC,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;YAC1C,IAAI,OAAO,QAAQ,KAAK,UAAU;gBAAE,OAAO,MAAM,CAAC;YAElD,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;gBACxB,QAAiC,CAAC,MAAM,CAAC,CAAC;YAC7C,CAAC;iBAAM,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC1B,QAAsC,CAAC,GAAG,IAAI,CAAC,CAAC;YACnD,CAAC;iBAAM,CAAC;gBACL,QAAuB,EAAE,CAAC;YAC7B,CAAC;YAED,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;QAEF,OAAO,CAAC,cAAc,CAAC;YACrB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAc,CAAC;YACpC,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,IAAyB,CAAC,CAAC;YACtD,MAAM,CAAC,cAAc,CAAC,IAAc,EAAE,IAAI,EAAE;gBAC1C,KAAK,EAAE,KAAK;gBACZ,YAAY,EAAE,IAAI;gBAClB,QAAQ,EAAE,IAAI;aACf,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
package/src/events/emit.ts
CHANGED
|
@@ -4,13 +4,15 @@ import { readProp } from "./helper";
|
|
|
4
4
|
|
|
5
5
|
export function Emit(propName: string) {
|
|
6
6
|
return function (
|
|
7
|
-
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
|
+
value: (this: StatefulComponent, ...args: any[]) => any,
|
|
8
9
|
context: ClassMethodDecoratorContext<StatefulComponent>,
|
|
9
10
|
): void {
|
|
10
11
|
const wrapped = function (
|
|
11
12
|
this: StatefulComponent,
|
|
12
13
|
...args: unknown[]
|
|
13
14
|
): unknown {
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
14
16
|
const result = value.apply(this, args);
|
|
15
17
|
|
|
16
18
|
const callback = readProp(this, propName);
|