narraleaf-react
Version:
A React visual novel player framework
77 lines (76 loc) • 3.52 kB
TypeScript
import { Actionable } from "../../action/actionable";
import { Transform } from "../../elements/transform/transform";
import { Chained, Proxied } from "../../action/chain";
import { LogicAction } from "../../action/logicAction";
import { EventfulDisplayable } from "../../../player/elements/displayable/type";
import type { TransformDefinitions } from "../../elements/transform/type";
export declare abstract class Displayable<StateData extends Record<string, any>, Self extends Displayable<any, any, any>, TransformType extends TransformDefinitions.Types = TransformDefinitions.Types> extends Actionable<StateData, Self> implements EventfulDisplayable {
/**
* Set Image Position
*
* @param position - The position of the image, expected {@link RawPosition} or {@link IPosition}
* @param duration - The duration of the position animation
* @param easing - The easing of the position animation
* @chainable
*/
pos(position: TransformDefinitions.ImageTransformProps["position"], duration?: number, easing?: TransformDefinitions.EasingDefinition): Proxied<Self, Chained<LogicAction.Actions>>;
/**
* Set Image Scale
* @param scale - The scale of the image, between 0 and 1
* @param duration - The duration of the scale animation
* @param easing - The easing of the scale animation
* @chainable
*/
scale(scale: number, duration?: number, easing?: TransformDefinitions.EasingDefinition): Proxied<Self, Chained<LogicAction.Actions>>;
/**
* Set Image Rotation
* @param rotation - The rotation of the image, in degrees
* @param duration - The duration of the rotation animation
* @param easing - The easing of the rotation animation
* @chainable
*/
rotate(rotation: number, duration?: number, easing?: TransformDefinitions.EasingDefinition): Proxied<Self, Chained<LogicAction.Actions>>;
/**
* Set Image Opacity
* @param opacity - The opacity of the image, between 0 and 1
* @param duration - The duration of the opacity animation
* @param easing - The easing of the opacity animation
* @chainable
*/
opacity(opacity: number, duration?: number, easing?: TransformDefinitions.EasingDefinition): Proxied<Self, Chained<LogicAction.Actions>>;
/**
* Apply a transform to the Displayable
* @chainable
*/
transform(transform: Transform<TransformType>): Proxied<Self, Chained<LogicAction.Actions, Self>>;
/**
* Show the Displayable
*
* if options are provided, the displayable will show with the provided transform options
* @example
* ```ts
* text.show({
* duration: 1000,
* });
* ```
* @chainable
*/
show(): Proxied<Self, Chained<LogicAction.Actions>>;
show(options: Transform<TransformType>): Proxied<Self, Chained<LogicAction.Actions>>;
show(options: Partial<TransformDefinitions.CommonTransformProps>): Proxied<Self, Chained<LogicAction.Actions>>;
/**
* Hide the Displayable
*
* if options are provided, the displayable will hide with the provided transform options
* @example
* ```ts
* text.hide({
* duration: 1000,
* });
* ```
* @chainable
*/
hide(): Proxied<Self, Chained<LogicAction.Actions>>;
hide(options: Transform<TransformType>): Proxied<Self, Chained<LogicAction.Actions>>;
hide(options: Partial<TransformDefinitions.CommonTransformProps>): Proxied<Self, Chained<LogicAction.Actions>>;
}