threepipe
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

IExporter.ts 1.3KB

123456789101112131415161718192021222324252627282930313233343536
  1. import {AnyOptions, IEventDispatcher} from 'ts-browser-helpers'
  2. import {IObject3D} from '../core'
  3. import {GLTFExporter2Options} from './export/GLTFExporter2'
  4. export type BlobExt = Blob&{ext:string}
  5. export interface IExportParser {
  6. // parse(obj: any, options: AnyOptions): any;
  7. parseAsync(obj: any, options: AnyOptions): Promise<Blob>
  8. }
  9. export interface IExporter {
  10. extensions?: any[]
  11. ext: string[];
  12. ctor: (assetExporter: IAssetExporter, exporter: IExporter)=>IExportParser|undefined;
  13. }
  14. export type ExportFileOptions = {
  15. /**
  16. * Extension to export to, default for object/scene = glb, default for viewerConfig = json, default for material = mat, otherwise determined by exporter
  17. */
  18. exportExt?: string,
  19. /**
  20. * Export and bundle the viewer config (scene settings).
  21. * only works for rootSceneModelRoot and supported only in GLTFExporter2 {@link GLTFExporter2Options.viewerConfig}
  22. * @default true
  23. */
  24. viewerConfig?: boolean,
  25. [key: string]: any
  26. } & GLTFExporter2Options
  27. export interface IAssetExporter extends IEventDispatcher<'exportFile' | 'exporterCreate'>{
  28. getExporter(...ext: string[]): IExporter|undefined
  29. exportObject(obj?: IObject3D, options?: ExportFileOptions): Promise<BlobExt|undefined>
  30. // processors: ObjectProcessorMap<TAssetTypes>
  31. }