@univerjs/engine-render v0.5.0-beta.1Docs


Class: RenderUnit

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

Parameters

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

Returns

RenderUnit

Overrides

Disposable.constructor

Defined in

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

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseDisposable._disposedpackages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:93
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>
Returns

Map<string, RenderComponentType>

Implementation of

IRender.components

Defined in

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


engine

Get Signature

get engine(): Engine
Returns

Engine

Set Signature

set engine(engine): void
Parameters
ParameterType
engineEngine
Returns

void

Implementation of

IRender.engine

Defined in

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


isMainScene

Get Signature

get isMainScene(): boolean
Returns

boolean

Set Signature

set isMainScene(is): void
Parameters
ParameterType
isboolean
Returns

void

Implementation of

IRender.isMainScene

Defined in

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


mainComponent

Get Signature

get mainComponent(): Nullable<RenderComponentType>
Returns

Nullable<RenderComponentType>

Set Signature

set mainComponent(component): void
Parameters
ParameterType
componentNullable<RenderComponentType>
Returns

void

Implementation of

IRender.mainComponent

Defined in

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


scene

Get Signature

get scene(): Scene
Returns

Scene

Set Signature

set scene(scene): void
Parameters
ParameterType
sceneScene
Returns

void

Implementation of

IRender.scene

Defined in

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


type

Get Signature

get type(): number
Returns

number

Implementation of

IRender.type

Defined in

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


unitId

Get Signature

get unitId(): string

The id of the RenderUnit.

Returns

string

The id of the RenderUnit.

Implementation of

IRender.unitId

Defined in

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

Methods

addRenderDependencies()

addRenderDependencies(dependencies): void

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

Parameters

ParameterType
dependenciesDependency[]

Returns

void

Defined in

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


dispose()

dispose(): void

Returns

void

Overrides

Disposable.dispose

Defined in

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


disposeWithMe()

disposeWithMe(disposable): IDisposable

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:96


ensureNotDisposed()

protected ensureNotDisposed(): void

Returns

void

Inherited from

Disposable.ensureNotDisposed

Defined in

packages/api/tmp/univer-pro/submodules/univer/packages/core/src/shared/lifecycle.ts:100


with()

with<T>(dependency): T

Get a dependency from the RenderUnit’s injector.

Type Parameters

Type Parameter
T

Parameters

ParameterType
dependencyDependencyIdentifier<T>

Returns

T

Implementation of

IRender.with

Defined in

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