/** * Everything with Avatar Editor should be hidden from the user documentation! * * @hidden */ /** * @hidden */ export declare enum AssetTypeWrapper { UNDEFINED = 0, GARMENT_2D = 1, GARMENT_3D = 3, AVATAR_HEAD_3D = 11, AVATAR_3D = 15, AVATAR_2D = 6, ACCESSORY_3D = 9, SCENE = 14, ANIMATION = 19, MATERIAL = 20 } /** * An interface to identify an asset and access its individual components. * One can imagine it as a folder containing multiple files associated with that asset. * * @hidden */ export interface IAssetWrapper { /** * Get a component of this asset associated with the specified key. * Returns a blob incase the component is available, otherwise it will throw an error. * This is the entrypoint from which components are requested for local purposes. (aka. when no compute server is involved.) * @param key - The key that the component is associated with. * @returns A promise that resolves to the components blob. */ getComponent(key: string): Promise; /** * Get the location of a component of this asset associated with the specified key. * Will return null incase an location could not be resolved. This could sometimes be the case when a component is only available locally but has no public location. * @param key - The key that the component is associated with. * @returns The location of the component or null. Does not mean that the component behind the url is available. */ getComponentLocation(key: string): Promise; /** * Get all keys of this asset. */ getKeys(): Promise>; /** * The type of an asset. */ getType(): Promise; /** * Initiates a pre-loading of all components. Use this with caution as it will load all available assets. * Sometimes we don't need to access all assets though. This would trigger unnecessary network transfers and consume additional memory! */ preloadComponents(): Promise; /** * Initiates pre-loading of a specific component. */ preloadComponent(key: string): Promise; } /** * @hidden */ export interface AvatarEditorConfiguration { avatar: IAssetWrapper; scene: IAssetWrapper; } /** * @hidden */ export interface AvatarEditorState { loading: boolean; morphFactors: Map | null; } /** * @hidden */ export interface AvatarEditorActions { getAvatar: () => Promise; updateMorphs: (morphs: Map) => Promise; openIn(target: HTMLElement): void; hide(): void; } /** * @hidden */ export interface AvatarEditorApi extends AvatarEditorActions { getConfiguration(): AvatarEditorConfiguration | null; setConfiguration(cfg: AvatarEditorConfiguration): void; addConfigurationUpdate(cb: (cfg: AvatarEditorConfiguration) => void): () => void; removeConfigurationUpdate(cb: (cfg: AvatarEditorConfiguration) => void): void; getState(): AvatarEditorState | null; setState(cfg: AvatarEditorState): void; addStateUpdate(cb: (cfg: AvatarEditorState) => void): () => void; removeStateUpdate(cb: (cfg: AvatarEditorState) => void): void; setActionReceiver(receiver: AvatarEditorActions): void; } /** * @hidden */ export interface AvatarEditorBuilder { build(): Promise; }