@typed-tabletop-simulator/lib
Version:
Library with some helping modules for working with Tabletop Simulator
62 lines (61 loc) • 1.85 kB
TypeScript
/** @noSelfInFile */
export interface BaseProperties {
guid?: string;
name: string;
description?: string;
memo?: string;
gmNotes?: string;
tags?: string[];
position?: VectorTable;
rotation?: VectorTable;
scale?: VectorTable | number;
locked?: boolean;
color?: ColorData | string;
viewAngle?: VectorTable;
assets?: Asset[];
snapPoints?: SnapPoint[];
script?: string;
ui?: string;
tooltip?: boolean;
}
export type Asset = ImageAsset | AssetBundleAsset;
/**
* A snappoint.
* Either just the position of the snappoint or a complete definition with rotation or tags.
*/
export type SnapPoint = VectorTable | {
position: VectorTable;
rotation?: VectorTable;
tags?: string[];
};
interface ImageAsset {
name: string;
image: string;
}
interface AssetBundleAsset {
name: string;
assetBundle: string;
}
export declare const createBaseObject: (properties: BaseProperties, type: ObjectName) => ObjectData;
/**
* Creates a stated object from the given object data.
*
* @param objects The list of objects to add as states. The order in this list will represent the state numbers.
* @param startingState The index of `objects` of the object which should be the current object. Defaults to the first entry.
*/
export declare const createStates: (objects: ObjectData[], startingState?: number) => ObjectData;
export declare const createGuid: () => string;
export declare const createTransform: (properties: BaseProperties) => {
posX: number;
posY: number;
posZ: number;
rotX: number;
rotY: number;
rotZ: number;
scaleX: number;
scaleY: number;
scaleZ: number;
};
export declare const createColor: (color: ColorData | string) => ColorData;
export declare const addAsset: (object: ObjectData, asset: Asset) => void;
export {};