decentraland-ui
Version:
Decentraland's UI components and styles
88 lines (87 loc) • 2.79 kB
TypeScript
import * as React from 'react';
import { PreviewCamera, PreviewEmote, PreviewOptions, PreviewProjection, WearableWithBlobs, EmoteWithBlobs, PreviewType, PreviewRenderer } from '@dcl/schemas/dist/dapps/preview';
import { BodyShape } from '@dcl/schemas';
import './WearablePreview.css';
export declare type PreviewUnityMode = 'authentication' | 'builder' | 'marketplace' | 'profile';
export declare type WearablePreviewProps = {
id?: string;
contractAddress?: string;
tokenId?: string;
itemId?: string;
profile?: string;
urns?: string[];
urls?: string[];
base64s?: string[];
blob?: WearableWithBlobs | EmoteWithBlobs;
skin?: string;
hair?: string;
eyes?: string;
emote?: PreviewEmote;
bodyShape?: BodyShape;
camera?: PreviewCamera;
projection?: PreviewProjection;
zoom?: number;
background?: string;
offsetX?: number;
offsetY?: number;
offsetZ?: number;
cameraX?: number;
cameraY?: number;
cameraZ?: number;
wheelZoom?: number;
wheelPrecision?: number;
wheelStart?: number;
disableBackground?: boolean;
disableAutoRotate?: boolean;
disableAutoCenter?: boolean;
disableFace?: boolean;
disableDefaultWearables?: boolean;
disableDefaultEmotes?: boolean;
disableFadeEffect?: boolean;
showSceneBoundaries?: boolean;
showThumbnailBoundaries?: boolean;
panning?: boolean;
lockAlpha?: boolean;
lockBeta?: boolean;
lockRadius?: boolean;
dev?: boolean;
baseUrl?: string;
peerUrl?: string;
nftServerUrl?: string;
type?: PreviewType;
unityMode?: PreviewUnityMode;
unity?: boolean;
onLoad?: (renderer?: PreviewRenderer) => void;
onError?: (error: Error) => void;
onUpdate?: (options: PreviewOptions) => void;
};
declare type WearablePreviewState = {
url?: string;
isReady: boolean;
pendingOptions: PreviewOptions | null;
lastOptions: PreviewOptions | null;
};
export declare class WearablePreview extends React.PureComponent<WearablePreviewProps> {
static defaultProps: {
dev: boolean;
baseUrl: string;
unity: boolean;
onLoad: () => void;
onError: () => void;
onUpdate: () => void;
};
static createController(id: string): import("@dcl/schemas").IPreviewController;
state: WearablePreviewState;
iframe: HTMLIFrameElement | null;
getUrl: () => string;
getOptions: () => PreviewOptions;
handleMessage: (event: MessageEvent) => void;
handleUpdate: () => void;
sendUpdate: (options: PreviewOptions) => void;
componentDidMount(): void;
componentWillUnmount(): void;
componentDidUpdate(): void;
refIframe: (iframe: HTMLIFrameElement | null) => void;
render(): JSX.Element;
}
export {};