marko 5.25.12 → 5.25.13
Sign up to get free protection for your applications and to get access to all the features.
- package/index.d.ts +13 -12
- package/package.json +1 -1
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
|
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
|
-
|
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>
|