feat: add typed WRN declarations
This commit is contained in:
@@ -4,6 +4,29 @@ Complete VS Code language support for [WRNexus](https://wrnexusjs.dev) `.wrn` fi
|
||||
|
||||
WRNexus is an SSR-first, Bun-powered full-stack framework with reactive components, layouts, colocated APIs, browser functions, lifecycle hooks, state watchers, client-side navigation, and reusable UI components.
|
||||
|
||||
Typed declarations work across props, state, and functions:
|
||||
|
||||
```wrn
|
||||
component UserCard {
|
||||
types {
|
||||
interface User { id: string; name: string }
|
||||
}
|
||||
props {
|
||||
user: User
|
||||
compact: boolean = false
|
||||
}
|
||||
state selected: boolean = false
|
||||
functions {
|
||||
function select(user: User): void {
|
||||
selected = true
|
||||
}
|
||||
}
|
||||
view { <article>{user.name}</article> }
|
||||
}
|
||||
```
|
||||
|
||||
The extension shows declared prop types and reports missing required props and incompatible values. Typed prop and state expressions passed into nested components retain their declared type.
|
||||
|
||||
## Installation
|
||||
|
||||
Search for **WRNexus Language Support** in the VS Code Extensions view or run:
|
||||
|
||||
Reference in New Issue
Block a user