threepipe
Version:
A 3D viewer framework built on top of three.js in TypeScript with a focus on quality rendering, modularity and extensibility.
81 lines • 2.5 kB
TypeScript
import { ThreeViewer } from '../../viewer/';
import { AViewerPluginSync } from '../../viewer/AViewerPlugin';
import { UiObjectConfig } from 'uiconfig.js';
import { AddAssetOptions, ImportFilesOptions } from '../../assetmanager';
export interface DropzonePluginOptions {
/**
* The DOM element to attach the dropzone to.
*/
domElement?: HTMLElement;
/**
* Allowed file extensions. If undefined, all files are allowed.
*/
allowedExtensions?: string[];
/**
* Automatically import assets when dropped.
* @default true
*/
autoImport?: boolean;
/**
* Automatically add dropped and imported assets to the scene.
* Works only if {@link autoImport} is true.
* @default true
*/
autoAdd?: boolean;
/**
* Import options for the {@link AssetImporter.importFiles}, used when importing files.
*/
importOptions?: ImportFilesOptions;
/**
* Add options for the {@link RootScene.addObject}, used when adding assets to the scene.
*/
addOptions?: AddAssetOptions;
}
/**
* Dropzone Plugin
*
* Adds a dropzone to the viewer for importing assets.
*
* Automatically imports and adds assets to the scene, the behavior can be configured.
* @category Plugins
*/
export declare class DropzonePlugin extends AViewerPluginSync<'drop'> {
static readonly PluginType = "Dropzone";
uiConfig: UiObjectConfig;
enabled: boolean;
private _inputEl?;
private _dropzone?;
private _allowedExtensions;
/**
* Automatically import assets when dropped.
*/
autoImport: boolean;
/**
* Automatically add dropped and imported assets to the scene.
* Works only if {@link autoImport} is true.
*/
autoAdd: boolean;
/**
* Import options for the {@link AssetImporter.importFiles}
*/
importOptions: ImportFilesOptions;
/**
* Add options for the {@link RootScene.addObject}
*/
addOptions: AddAssetOptions;
/**
* Allowed file extensions. If undefined, all files are allowed.
*/
get allowedExtensions(): string[] | undefined;
set allowedExtensions(value: string[] | undefined);
/**
* Prompt for file selection using the browser file dialog.
*/
promptForFile(): void;
private _domElement?;
constructor(options?: DropzonePluginOptions);
onAdded(viewer: ThreeViewer): void;
onRemove(viewer: ThreeViewer): void;
private _onFileDrop;
}
//# sourceMappingURL=DropzonePlugin.d.ts.map