Skip to content

Commit f998b17

Browse files
committed
0.2.0-alpha.14
1 parent 655e2ab commit f998b17

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@purifyjs/core",
3-
"version": "0.2.0-alpha.13",
3+
"version": "0.2.0-alpha.14",
44
"workspace": ["./apps/vite", "./apps/size"],
55
"exports": {
66
".": "./lib/mod.ts",

lib/tags.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ _(() => {
2222
declare const svgElement: SVGSVGElement;
2323
declare const divElement: HTMLDivElement;
2424
declare const divElementWithLifecycle: WithLifecycle<HTMLDivElement>;
25+
declare const formElementWithLifecycle: WithLifecycle<HTMLFormElement>;
2526
_(() => {
2627
const svgBuilder = new Builder(svgElement);
2728
const divBuilder = new Builder(divElement);
2829
const divWithLifecycleBuilder = new Builder(divElementWithLifecycle);
30+
const formWithLifecycleBuilder = new Builder(formElementWithLifecycle);
2931

3032
svgBuilder.replaceChildren("123");
3133
/// @ts-expect-error Don't allow signals on elements without lifecycle
@@ -49,4 +51,9 @@ _(() => {
4951
divWithLifecycleBuilder.replaceChildren$(divWithLifecycleBuilder);
5052
divWithLifecycleBuilder.ariaLabel(ref("foo"));
5153
divWithLifecycleBuilder.$effect(() => {});
54+
55+
// Form element sometimes might cause issues since it has [key: string] and [index: number] in it, so be careful, keep this in mind
56+
formWithLifecycleBuilder.replaceChildren$("");
57+
formWithLifecycleBuilder.$effect(() => {});
58+
formWithLifecycleBuilder.ariaAtomic("");
5259
});

lib/tags.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ type ProxyNodeFunctionArgs<
138138
: T extends WithLifecycle ? RecursiveSignalAndArrayArgs<Args>
139139
: RecursiveArrayArgs<Args>;
140140

141+
type _ = Extract<{ a: 123; [key: string]: any }, { [key: `${any}${any}`]: any }>;
142+
141143
export type Builder<T extends Node = Node> =
142144
& {
143145
[K in keyof T as If<IsReflectFunction<T, K>, K>]: T[K] extends (...args: infer Args) => any ? (...args: Args) => Builder<T> : never;
@@ -149,7 +151,7 @@ export type Builder<T extends Node = Node> =
149151
[K in keyof T as If<IsProxyableFunction<T, K>, K>]: (...args: ProxyFunctionArgs<T, K>) => Builder<T>;
150152
}
151153
& {
152-
[K in keyof T & string as If<IsProxyableNodeFunction<T, K>, `${K}$`>]: (...args: ProxyNodeFunctionArgs<T, K>) => Builder<T>;
154+
[K in keyof T as If<IsProxyableNodeFunction<T, K>, `${K & string}$`>]: (...args: ProxyNodeFunctionArgs<T, K>) => Builder<T>;
153155
}
154156
& {
155157
$node: T;

0 commit comments

Comments
 (0)