index.ts 961 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import type { App } from 'vue'
  2. import TresCanvas from './components/TresCanvas.vue'
  3. import { disposeObject3D as dispose } from './utils'
  4. import { normalizeColor, normalizeVectorFlexibleParam } from './utils/normalize'
  5. import templateCompilerOptions from './utils/template-compiler-options'
  6. export * from './components'
  7. export * from './composables'
  8. export * from './core/catalogue'
  9. export * from './core/loop'
  10. export * from './directives'
  11. export * from './types'
  12. export interface TresOptions {
  13. extends?: Record<string, unknown>
  14. }
  15. export interface TresPlugin {
  16. [key: string]: any
  17. install: (app: App, options?: TresOptions) => void
  18. }
  19. const plugin: TresPlugin = {
  20. install(app: App) {
  21. // Register core components
  22. app.component('TresCanvas', TresCanvas)
  23. },
  24. }
  25. export default plugin
  26. export {
  27. dispose,
  28. normalizeColor,
  29. normalizeVectorFlexibleParam,
  30. templateCompilerOptions,
  31. }
  32. export type { VectorFlexibleParams } from './utils/normalize'