marko 5.25.12 → 5.25.14

Sign up to get free protection for your applications and to get access to all the features.
package/index.d.ts CHANGED
@@ -25,7 +25,7 @@ declare global {
25
25
  [attr: PropertyKey]: unknown;
26
26
  }
27
27
 
28
- export type TemplateInput<Input = { [attr: PropertyKey]: any }> = Input & {
28
+ export type TemplateInput<Input> = Input & {
29
29
  $global?: Global;
30
30
  };
31
31
 
@@ -104,13 +104,8 @@ declare global {
104
104
  ? Params
105
105
  : never;
106
106
 
107
- export class Component<
108
- Input extends Record<PropertyKey, any> = Record<PropertyKey, any>,
109
- State extends undefined | null | Record<PropertyKey, any> =
110
- | undefined
111
- | null
112
- | Record<PropertyKey, any>
113
- > implements Emitter
107
+ export class Component<Input = unknown, State = unknown>
108
+ implements Emitter
114
109
  {
115
110
  /** A unique id for this instance. */
116
111
  public readonly id: string;
@@ -221,10 +216,7 @@ declare global {
221
216
  }
222
217
 
223
218
  /** The top level api for a Marko Template. */
224
- export abstract class Template<
225
- Input = { [attr: PropertyKey]: any },
226
- Return = unknown
227
- > {
219
+ export abstract class Template<Input = unknown, Return = unknown> {
228
220
  /** Creates a Marko compatible output stream. */
229
221
  createOut(): Out;
230
222
 
@@ -248,6 +240,15 @@ declare global {
248
240
  }
249
241
  ): Marko.Out<Marko.Component>;
250
242
 
243
+ /** Asynchronously render the template in buffered mode. */
244
+ abstract render(
245
+ input: Marko.TemplateInput<Input>,
246
+ cb?: (
247
+ err: Error | null,
248
+ result: Marko.RenderResult<Marko.Component>
249
+ ) => void
250
+ ): Marko.Out<Marko.Component>;
251
+
251
252
  /** Synchronously render the template. */
252
253
  abstract renderSync(
253
254
  input: Marko.TemplateInput<Input>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "5.25.12",
3
+ "version": "5.25.14",
4
4
  "license": "MIT",
5
5
  "description": "UI Components + streaming, async, high performance, HTML templating for Node.js and the browser.",
6
6
  "dependencies": {
package/tags-html.d.ts CHANGED
@@ -1237,7 +1237,7 @@ declare global {
1237
1237
  * Controls the data type (and associated control) of the element.
1238
1238
  * @see https://html.spec.whatwg.org/multipage/input.html#attr-input-type
1239
1239
  */
1240
- type:
1240
+ type?:
1241
1241
  | AttrMissing
1242
1242
  | "button"
1243
1243
  | "checkbox"