marko 5.25.4 → 5.25.5
Sign up to get free protection for your applications and to get access to all the features.
- package/docs/marko-json.md +1 -1
- package/docs/state.md +1 -1
- package/docs/typescript.md +3 -3
- package/docs/vite.md +1 -1
- package/index.d.ts +341 -303
- package/package.json +6 -4
- package/tags-html.d.ts +4598 -0
package/docs/marko-json.md
CHANGED
@@ -134,7 +134,7 @@ Similar to [`marko-tag.json`](#single-component-definition), this file is discov
|
|
134
134
|
"tags-dir": "./ui-modules", // What directory to crawl to autodiscover components. Default:`./components/`
|
135
135
|
"taglib-imports": ["./some-folder/marko.json", "./other-folder/marko.json"], // Creates a _combined_ tag library by referencing others.
|
136
136
|
|
137
|
-
"tags": { // Definitions for
|
137
|
+
"tags": { // Definitions for individual tags.
|
138
138
|
"my-tag": {
|
139
139
|
// Same options as “marko-tag.json”.
|
140
140
|
}
|
package/docs/state.md
CHANGED
@@ -50,7 +50,7 @@ When a property on `state` is set, the component will be scheduled for an update
|
|
50
50
|
|
51
51
|
> **ProTip:** If you need to know when the update has been applied, you can use `this.once('update', fn)` within a component method.
|
52
52
|
|
53
|
-
> **Note:** The state object only watches its properties one level deep. This means updates to nested
|
53
|
+
> **Note:** The state object only watches its properties one level deep. This means updates to nested properties on the state (e.g. `this.state.object.something = newValue`) will not be detected.
|
54
54
|
>
|
55
55
|
> Using [immutable](https://wecodetheweb.com/2016/02/12/immutable-javascript-using-es6-and-beyond/) data structures is recommended, but if you want to mutate a state property (perhaps push a new item into an array) you can let Marko know it changed using `setStateDirty`.
|
56
56
|
>
|
package/docs/typescript.md
CHANGED
@@ -133,8 +133,8 @@ Marko exposes [type definitions](https://github.com/marko-js/marko/blob/main/pac
|
|
133
133
|
- `EventEmitter` from `@types/node`
|
134
134
|
- **`Marko.NativeTags`**
|
135
135
|
- `Marko.NativeTags`: An object containing all native tags and their types
|
136
|
-
- **`Marko.
|
137
|
-
- Helpers to extract the input and return types
|
136
|
+
- **`Marko.Input<TagName>`** and **`Marko.Return<TagName>`**
|
137
|
+
- Helpers to extract the input and return types native tags (when a string is passed) or a custom tag.
|
138
138
|
- **`Marko.BodyParameters<Body>`** and **`Marko.BodyReturnType<Body>`**
|
139
139
|
- Helpers to extract the parameters and return types from the specified `Marko.Body`
|
140
140
|
- **`Marko.AttrTag<T>`** and **`Marko.RepeatableAttrTag<T>`**
|
@@ -207,7 +207,7 @@ The types for native tags are accessed via the global `Marko.NativeTags` type. H
|
|
207
207
|
_color-button.marko_
|
208
208
|
|
209
209
|
```marko
|
210
|
-
export interface Input extends Marko.
|
210
|
+
export interface Input extends Marko.Input<"button"> {
|
211
211
|
color: string;
|
212
212
|
renderBody?: Marko.Body;
|
213
213
|
}
|
package/docs/vite.md
CHANGED
@@ -48,7 +48,7 @@ if (process.env.NODE_ENV === "production") {
|
|
48
48
|
|
49
49
|
app.get("/", async (req, res) => {
|
50
50
|
const template = (await loadTemplate()).default;
|
51
|
-
// When the template is loaded, it will
|
51
|
+
// When the template is loaded, it will automatically have `vite` assets inlined.
|
52
52
|
template.render({ hello: "world" }, res);
|
53
53
|
);
|
54
54
|
|