mirror of
https://github.com/troisjs/trois.git
synced 2024-11-23 20:02:32 +08:00
improve interfaces
This commit is contained in:
parent
dde4c566ae
commit
3705f97c61
@ -18,6 +18,8 @@ export interface Object3DInterface extends Object3DSetupInterface {
|
||||
remove(o: Object3D): void
|
||||
}
|
||||
|
||||
export interface Object3DPublicInterface extends ComponentPublicInstance, Object3DInterface {}
|
||||
|
||||
// export function object3DSetup(): Object3DSetupInterface {
|
||||
// const renderer = inject(RendererInjectionKey)
|
||||
// const scene = inject(SceneInjectionKey)
|
||||
|
@ -10,4 +10,4 @@ export { default as Raycaster } from './Raycaster'
|
||||
export { default as CubeCamera } from './CubeCamera'
|
||||
|
||||
export type { RendererPublicInterface } from './Renderer'
|
||||
export type { Object3DInterface } from './Object3D'
|
||||
export type { Object3DPublicInterface } from './Object3D'
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { defineComponent, InjectionKey, PropType, watch } from 'vue'
|
||||
import { ComponentPublicInstance, defineComponent, InjectionKey, PropType, watch } from 'vue'
|
||||
import { FrontSide, Material, NormalBlending, Texture } from 'three'
|
||||
import { MeshInjectionKey, MeshInterface } from '../meshes/Mesh'
|
||||
|
||||
@ -13,7 +13,9 @@ export interface MaterialInterface extends MaterialSetupInterface {
|
||||
setTexture(texture: Texture | null, key: string): void
|
||||
}
|
||||
|
||||
export const MaterialInjectionKey: InjectionKey<MaterialInterface> = Symbol('Material')
|
||||
export interface MaterialPublicInterface extends ComponentPublicInstance, MaterialInterface {}
|
||||
|
||||
export const MaterialInjectionKey: InjectionKey<MaterialPublicInterface> = Symbol('Material')
|
||||
|
||||
export default defineComponent({
|
||||
// inject for sub components
|
||||
|
@ -14,4 +14,4 @@ export { default as CubeTexture } from './CubeTexture'
|
||||
|
||||
export { default as PointsMaterial } from './PointsMaterial'
|
||||
|
||||
export type { MaterialInterface } from './Material'
|
||||
export type { MaterialPublicInterface } from './Material'
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ComponentPropsOptions, defineComponent, InjectionKey, watch } from 'vue'
|
||||
import { ComponentPropsOptions, ComponentPublicInstance, defineComponent, InjectionKey, watch } from 'vue'
|
||||
import { BufferGeometry, Material, Mesh as TMesh } from 'three'
|
||||
import Object3D, { Object3DSetupInterface } from '../core/Object3D'
|
||||
import { bindProp } from '../tools'
|
||||
@ -25,7 +25,9 @@ export interface MeshInterface extends MeshSetupInterface {
|
||||
setMaterial(m: Material): void
|
||||
}
|
||||
|
||||
export const MeshInjectionKey: InjectionKey<MeshInterface> = Symbol('Mesh')
|
||||
export interface MeshPublicInterface extends ComponentPublicInstance, MeshInterface {}
|
||||
|
||||
export const MeshInjectionKey: InjectionKey<MeshPublicInterface> = Symbol('Mesh')
|
||||
|
||||
const Mesh = defineComponent({
|
||||
name: 'Mesh',
|
||||
|
@ -24,4 +24,4 @@ export { default as Sprite } from './Sprite'
|
||||
|
||||
export { default as Points } from './Points'
|
||||
|
||||
export type { MeshInterface } from './Mesh'
|
||||
export type { MeshPublicInterface } from './Mesh'
|
||||
|
Loading…
Reference in New Issue
Block a user