@sealcode/sealgen 0.15.60 → 0.15.61
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.
|
@@ -26,6 +26,7 @@ export type StatefulPageActionArgument<State extends Record<string, unknown>, Ar
|
|
|
26
26
|
state: State;
|
|
27
27
|
inputs: Record<string, string>;
|
|
28
28
|
args: Args;
|
|
29
|
+
page: StatefulPage<any, any>;
|
|
29
30
|
};
|
|
30
31
|
export type StatefulPageAction<State extends Record<string, unknown>, Args extends unknown[] = unknown[]> = (obj: StatefulPageActionArgument<State, Args>) => State | Promise<State>;
|
|
31
32
|
export type ExtractStatefulPageActionArgs<X> = X extends StatefulPageAction<any, infer Args> ? Args : never;
|
package/package.json
CHANGED
|
@@ -40,6 +40,7 @@ export type StatefulPageActionArgument<
|
|
|
40
40
|
state: State;
|
|
41
41
|
inputs: Record<string, string>;
|
|
42
42
|
args: Args;
|
|
43
|
+
page: StatefulPage<any, any>;
|
|
43
44
|
};
|
|
44
45
|
|
|
45
46
|
export type StatefulPageAction<
|
|
@@ -315,6 +316,7 @@ export abstract class StatefulPage<
|
|
|
315
316
|
args: JSON.parse(
|
|
316
317
|
from_base64(action_args as string)
|
|
317
318
|
) as unknown[],
|
|
319
|
+
page: this,
|
|
318
320
|
});
|
|
319
321
|
ctx.body = this.render(ctx, new_state, inputs);
|
|
320
322
|
} else {
|