@univerjs/engine-render v0.5.4


Class: RenderUnit

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:59

This class is necessary for Univer to render several units in the same webpage. It encapsulates the rendering context and rendering modules for a specific unit.

Extends

Implements

Constructors

new RenderUnit()

new RenderUnit(init, parentInjector): RenderUnit

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:79

Parameters

ParameterType
initPick<IRenderContext, "unit" | "scene" | "engine" | "isMainScene">
parentInjectorInjector

Returns

RenderUnit

Overrides

Disposable.constructor

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseDisposable._disposedpackages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:96
isRenderUnitreadonlybooleantrue-packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:60

Accessors

components

Get Signature

get components(): Map<string, RenderComponentType>

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:77

Returns

Map<string, RenderComponentType>

Implementation of

IRender.components


engine

Get Signature

get engine(): Engine

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:72

Returns

Engine

Set Signature

set engine(engine): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:71

Parameters
ParameterType
engineEngine
Returns

void

Implementation of

IRender.engine


isMainScene

Get Signature

get isMainScene(): boolean

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:70

Returns

boolean

Set Signature

set isMainScene(is): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:69

Parameters
ParameterType
isboolean
Returns

void

Implementation of

IRender.isMainScene


mainComponent

Get Signature

get mainComponent(): Nullable<RenderComponentType>

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:74

Returns

Nullable<RenderComponentType>

Set Signature

set mainComponent(component): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:73

Parameters
ParameterType
componentNullable<RenderComponentType>
Returns

void

Implementation of

IRender.mainComponent


scene

Get Signature

get scene(): Scene

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:76

Returns

Scene

Set Signature

set scene(scene): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:75

Parameters
ParameterType
sceneScene
Returns

void

Implementation of

IRender.scene


type

Get Signature

get type(): number

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:63

Returns

number

Implementation of

IRender.type


unitId

Get Signature

get unitId(): string

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:62

The id of the RenderUnit.

Returns

string

The id of the RenderUnit.

Implementation of

IRender.unitId

Methods

addRenderDependencies()

addRenderDependencies(dependencies): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:115

Add render dependencies to the RenderUnit’s injector. Note that the dependencies would be initialized immediately after being added.

Parameters

ParameterType
dependenciesDependency[]

Returns

void


dispose()

dispose(): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:99

Returns

void

Overrides

Disposable.dispose


disposeWithMe()

disposeWithMe(disposable): IDisposable

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:99

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe


ensureNotDisposed()

protected ensureNotDisposed(): void

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:103

Returns

void

Inherited from

Disposable.ensureNotDisposed


with()

with<T>(dependency): T

Defined in: packages/api/tmp/univer-pro/submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:107

Get a dependency from the RenderUnit’s injector.

Type Parameters

Type Parameter
T

Parameters

ParameterType
dependencyDependencyIdentifier<T>

Returns

T

Implementation of

IRender.with