@drincs/pixi-vn
Version:
Pixi'VN is a npm package that provides various features for creating visual novels.
91 lines (83 loc) • 2.1 kB
text/typescript
import { TickerCallback, UPDATE_PRIORITY } from 'pixi.js';
/**
* is a string that represents a ticker id.
* It is used to {@link canvas.tickers} to get the ticker class.
*/
type TickerIdType = string;
interface TickerArgs {
}
/**
* TickerHistory is a class that contains the name of a class and the arguments that were used to create it.
*/
interface TickerHistory<TArgs extends TickerArgs> {
fn: TickerCallback<any>;
id: TickerIdType;
args: TArgs;
/**
* The aliases of the canvas elements that are connected to this ticker
*/
canvasElementAliases: string[];
priority?: UPDATE_PRIORITY;
duration?: number;
/**
* If this ticker was created by steps
*/
createdByTicketSteps?: {
canvasElementAlias: string;
id: string;
};
onEndOfTicker: () => void;
}
interface TickerHistoryForExport<TArgs extends TickerArgs> {
id: TickerIdType;
args: TArgs;
/**
* The aliases of the canvas elements that are connected to this ticker
*/
canvasElementAliases: string[];
priority?: UPDATE_PRIORITY;
duration?: number;
}
type PauseType = {
/**
* The type of the value
*/
type: "pause";
/**
* Duration in seconds
*/
duration: number;
};
type RepeatType = "repeat";
interface TickersStep<TArgs extends TickerArgs> {
/**
* Ticker class name
*/
ticker: string;
/**
* Duration in seconds. If is undefined, the step will end only when the animation is finished.
*/
duration?: number;
/**
* Arguments to pass to the ticker
*/
args: TArgs;
/**
* Priority of the ticker
*/
priority?: UPDATE_PRIORITY;
}
/**
* The steps of the tickers
*/
interface TickersSequence {
/**
* The step number
*/
currentStepNumber: number;
/**
* The steps of the tickers
*/
steps: (TickersStep<any> | RepeatType | PauseType)[];
}
export type { PauseType as P, RepeatType as R, TickerArgs as T, TickerHistory as a, TickerHistoryForExport as b, TickersSequence as c, TickerIdType as d };