From dde4c566ae5da14b4cd5d743ffde21bd02b4571c Mon Sep 17 00:00:00 2001 From: Kevin Levron Date: Sun, 2 May 2021 20:44:13 +0200 Subject: [PATCH] improve renderer interface --- src/core/Renderer.ts | 6 ++++-- src/core/index.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/Renderer.ts b/src/core/Renderer.ts index b67007b..452be16 100644 --- a/src/core/Renderer.ts +++ b/src/core/Renderer.ts @@ -1,7 +1,7 @@ /* eslint-disable no-use-before-define */ import { Camera, NoToneMapping, PCFShadowMap, Scene, WebGLRenderer } from 'three' import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer' -import { defineComponent, InjectionKey, PropType } from 'vue' +import { ComponentPublicInstance, defineComponent, InjectionKey, PropType } from 'vue' import { bindProp } from '../tools' import { PointerPublicConfigInterface } from './usePointer' import useThree, { SizeInterface, ThreeConfigInterface, ThreeInterface } from './useThree' @@ -93,7 +93,9 @@ export interface RendererInterface extends RendererSetupInterface { removeListener(t: T, cb: EventCallbackMap[T]): void } -export const RendererInjectionKey: InjectionKey = Symbol('Renderer') +export interface RendererPublicInterface extends ComponentPublicInstance, RendererInterface {} + +export const RendererInjectionKey: InjectionKey = Symbol('Renderer') export default defineComponent({ name: 'Renderer', diff --git a/src/core/index.ts b/src/core/index.ts index 7c49cc4..26fef3c 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -9,5 +9,5 @@ export { default as Raycaster } from './Raycaster' export { default as CubeCamera } from './CubeCamera' -export type { RendererInterface } from './Renderer' +export type { RendererPublicInterface } from './Renderer' export type { Object3DInterface } from './Object3D'