prendy
Version:
Make games with prerendered backdrops using babylonjs and repond
108 lines (107 loc) • 3.94 kB
TypeScript
import { Vector3 } from "@babylonjs/core";
import { AnimationNameByModel, DollName, DollOptions, MeshNameByModel, PlaceName, SpotNameByPlace } from "../types";
type ModelNameFromDoll<T_DollName extends DollName> = DollOptions[T_DollName]["model"];
type MeshNamesFromDoll<T_DollName extends DollName> = MeshNameByModel[ModelNameFromDoll<T_DollName>];
export declare const dollEvents: {
setPosition: import("repond-events").EventTypeDefinition<{
which: string;
to: Vector3;
}>;
springPosition: import("repond-events").EventTypeDefinition<{
which: string;
to: Vector3;
}>;
slidePosition: import("repond-events").EventTypeDefinition<{
which: string;
to: Vector3;
}>;
setRotation: import("repond-events").EventTypeDefinition<{
which: string;
to: Vector3;
}>;
lookAtOtherDoll: import("repond-events").EventTypeDefinition<{
whichA: string;
whichB: string;
}>;
lookAtSpot: import("repond-events").EventTypeDefinition<{
place: string;
spot: string;
which: string;
}>;
setRotationY: import("repond-events").EventTypeDefinition<{
which: string;
to: number;
}>;
springRotationY: import("repond-events").EventTypeDefinition<{
which: string;
to: number;
}>;
springAddToRotationY: import("repond-events").EventTypeDefinition<{
which: string;
degrees: number;
useShortestAngle: boolean | undefined;
}>;
setAnimation: import("repond-events").EventTypeDefinition<{
which: string;
to: string;
}>;
focusOn: import("repond-events").EventTypeDefinition<{
which: string;
zoom: number | undefined;
}>;
setToSpot: import("repond-events").EventTypeDefinition<{
which: string;
place: string;
spot: string;
dontSetRotationState: boolean | undefined;
}>;
springToSpot: import("repond-events").EventTypeDefinition<{
place: string;
spot: string;
which: string;
}>;
moveAt2DAngle: import("repond-events").EventTypeDefinition<{
which: string;
angle: number;
speed: number;
}>;
pushRotationY: import("repond-events").EventTypeDefinition<{
which: string;
direction: "right" | "left";
speed: number;
}>;
hide: import("repond-events").EventTypeDefinition<{
which: string;
shouldHide: boolean | undefined;
}>;
toggleMeshes: import("repond-events").EventTypeDefinition<{
which: string;
toggledMeshes: Partial<Record<string, boolean>>;
}>;
};
type DollLookAtSpotParams<T_Place extends PlaceName> = {
which: DollName;
place: T_Place;
to: SpotNameByPlace[T_Place];
};
type DollSetAnimationParams<T_Doll extends DollName> = {
which: DollName;
to: AnimationNameByModel[ModelNameFromDoll<T_Doll>];
};
type DollSetToSpotParams<T_Place extends PlaceName> = {
which: DollName;
place: T_Place;
spot: SpotNameByPlace[T_Place];
dontSetRotationState?: boolean;
};
type DollSpringToSpotParams<T_Place extends PlaceName> = {
which: DollName;
place: T_Place;
spot: SpotNameByPlace[T_Place];
};
type ToggleMeshesParams<T_Doll extends DollName> = {
which: T_Doll;
toggledMeshes: Partial<Record<MeshNamesFromDoll<T_Doll>, boolean>>;
};
export type DollEventParameters<T_Group, T_Event, T_GenericParamA> = T_Group extends "doll" ? T_Event extends "lookAtSpot" ? DollLookAtSpotParams<T_GenericParamA & PlaceName> : T_Event extends "setAnimation" ? DollSetAnimationParams<T_GenericParamA & DollName> : T_Event extends "setToSpot" ? DollSetToSpotParams<T_GenericParamA & PlaceName> : T_Event extends "springToSpot" ? DollSpringToSpotParams<T_GenericParamA & PlaceName> : T_Event extends "toggleMeshes" ? ToggleMeshesParams<T_GenericParamA & DollName> : never : never;
export {};