@niobrix/solidjs-skinview3d
Version:
A SolidJS wrapper for SkinView3D
86 lines (82 loc) • 1.93 kB
TypeScript
import { Component } from 'solid-js';
import { SkinViewer } from 'skinview3d';
import * as THREE from 'three';
interface SolidSkinView3DProps {
/**
* Component width in pixels
*/
width?: number;
/**
* Component height in pixels
*/
height?: number;
/**
* Minecraft skin URL
*/
skinUrl?: string;
/**
* Minecraft cape URL
*/
capeUrl?: string;
/**
* Additional CSS class for canvas
*/
className?: string;
/**
* Background for rendering (hex color, THREE.Color or THREE.Texture)
*/
background?: string | THREE.Color | THREE.Texture;
/**
* Camera zoom level
*/
zoom?: number;
/**
* Camera field of view in degrees
*/
fov?: number;
/**
* Enable automatic model rotation
*/
autoRotate?: boolean;
/**
* Model rotation speed (only works when autoRotate=true)
*/
rotateSpeed?: number;
/**
* Enable automatic resizing when parent element size changes
*/
autoResize?: boolean;
/**
* Show loading indicator
*/
showLoader?: boolean;
/**
* Callback called after component initialization
*/
onReady?: (viewer: SkinViewer) => void;
/**
* Callback called after skin is loaded
*/
onSkinLoaded?: () => void;
/**
* Callback called when skin loading fails
*/
onSkinError?: (error: Error) => void;
/**
* Enable ears for model
*/
ears?: boolean | {
textureType: 'standalone' | 'skin';
source: string;
};
/**
* Type of back equipment (cape or elytra)
*/
backEquipment?: 'cape' | 'elytra';
}
/**
* Component for displaying 3D Minecraft skin model
* Based on skinview3d library
*/
declare const SolidSkinView3D: Component<SolidSkinView3DProps>;
export { SolidSkinView3D, type SolidSkinView3DProps, SolidSkinView3D as default };