@vk-io/scenes
Version:
Scenes for the library vk-io
66 lines (65 loc) • 1.6 kB
TypeScript
import { IStepContextOptions, IStepContextGoOptions } from './step.types';
import { StepSceneHandler } from '../scenes/step.types';
export declare class StepSceneContext<S extends Record<string, unknown>> {
private context;
private steps;
private stepChanged;
constructor(options: IStepContextOptions<S>);
/**
* The first enter to the handler
*/
get firstTime(): boolean;
/**
* Returns current stepId
*/
get stepId(): number;
/**
* Sets current stepId
*/
set stepId(stepId: number);
/**
* Returns current handler
*/
get current(): StepSceneHandler<{}, S> | undefined;
/**
* Reenter current step handler
*
* ```ts
* ctx.scene.step.reenter();
* ```
*/
reenter(): Promise<void>;
/**
* The go method goes to a specific step
*
* ```ts
* ctx.scene.step.go(3);
* ctx.scene.step.go(3, {
* silent: true
* });
* ```
*/
go(stepId: number, { silent }?: IStepContextGoOptions): Promise<void>;
/**
* Move to the next handler
*
* ```ts
* ctx.scene.step.next();
* ctx.scene.step.next({
* silent: true
* });
* ```
*/
next(options?: IStepContextGoOptions): Promise<void>;
/**
* Move to the previous handler
*
* ```ts
* ctx.scene.step.previous();
* ctx.scene.step.previous({
* silent: true
* });
* ```
*/
previous(options?: IStepContextGoOptions): Promise<void>;
}