@sprlab/wccompiler 0.4.1 → 0.4.2

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/README.md CHANGED
@@ -391,6 +391,15 @@ defineExpose({ doubled, handleUpdate, watchLog })
391
391
 
392
392
  `defineExpose()` exposes methods and properties for external access via ref.
393
393
 
394
+ The language server automatically generates a typed interface (PascalCase of the tag name) that can be imported by consumers:
395
+
396
+ ```ts
397
+ // In the parent component:
398
+ import type { WccTypescript } from './wcc-typescript.wcc'
399
+ const child = templateRef<WccTypescript>('myRef')
400
+ child.value!.handleUpdate() // ✅ typed
401
+ ```
402
+
394
403
  ## CLI
395
404
 
396
405
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sprlab/wccompiler",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Zero-runtime compiler that transforms .wcc single-file components into native web components with signals-based reactivity",
5
5
  "type": "module",
6
6
  "bin": {
package/types/wcc.d.ts CHANGED
@@ -19,7 +19,7 @@ declare module 'wcc' {
19
19
  export function defineEmits<T>(): T;
20
20
  export function defineEmits(names: string[]): (name: string, detail?: any) => void;
21
21
 
22
- export function templateRef<T = HTMLElement>(name: string): { value: (T & HTMLElement) | null };
22
+ export function templateRef<T = HTMLElement>(name: string): { value: T | null };
23
23
 
24
24
  export function onMount(fn: () => void | Promise<void>): void;
25
25
  export function onDestroy(fn: () => void | Promise<void>): void;