1 | import SceneContextScene, { SceneSession, SceneSessionData } from '../context';
|
2 | import Context from '../../context';
|
3 | import { Middleware } from '../../middleware';
|
4 | import { SessionContext } from '../../session';
|
5 | export interface WizardContext<D extends WizardSessionData = WizardSessionData> extends Context {
|
6 | session: WizardSession<D>;
|
7 | scene: SceneContextScene<WizardContext<D>, D>;
|
8 | wizard: WizardContextWizard<WizardContext<D>>;
|
9 | }
|
10 | export interface WizardSessionData extends SceneSessionData {
|
11 | cursor: number;
|
12 | }
|
13 | export interface WizardSession<S extends WizardSessionData = WizardSessionData> extends SceneSession<S> {
|
14 | }
|
15 | export default class WizardContextWizard<C extends SessionContext<WizardSession> & {
|
16 | scene: SceneContextScene<C, WizardSessionData>;
|
17 | }> {
|
18 | private readonly ctx;
|
19 | private readonly steps;
|
20 | readonly state: object;
|
21 | constructor(ctx: C, steps: ReadonlyArray<Middleware<C>>);
|
22 | get step(): Middleware<C> | undefined;
|
23 | get cursor(): number;
|
24 | set cursor(cursor: number);
|
25 | selectStep(index: number): this;
|
26 | next(): this;
|
27 | back(): this;
|
28 | }
|
29 | //# sourceMappingURL=context.d.ts.map |
\ | No newline at end of file |