API Reference
@univerjs
@univerjs/engine-render
classes
Renderunit

@univerjs/engine-render v0.4.2Docs


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

submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:79 (opens in a new tab)

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseDisposable._disposedsubmodules/univer/packages/core/src/shared/lifecycle.ts:93 (opens in a new tab)
isRenderUnitreadonlybooleantrue-submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:60 (opens in a new tab)

Accessors

components

get components(): Map<string, RenderComponentType>

Returns

Map<string, RenderComponentType>

Implementation of

IRender.components

Defined in

submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:77 (opens in a new tab)


engine

get engine(): Engine
set engine(engine): void

Parameters

ParameterType
engineEngine

Returns

Engine

Implementation of

IRender.engine

Defined in

submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:72 (opens in a new tab)


isMainScene

get isMainScene(): boolean
set isMainScene(is): void

Parameters

ParameterType
isboolean

Returns

boolean

Implementation of

IRender.isMainScene

Defined in

submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:70 (opens in a new tab)


mainComponent

get mainComponent(): Nullable<RenderComponentType>
set mainComponent(component): void

Parameters

ParameterType
componentNullable<RenderComponentType>

Returns

Nullable<RenderComponentType>

Implementation of

IRender.mainComponent

Defined in

submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:74 (opens in a new tab)


scene

get scene(): Scene
set scene(scene): void

Parameters

ParameterType
sceneScene

Returns

Scene

Implementation of

IRender.scene

Defined in

submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:76 (opens in a new tab)


type

get type(): number

Returns

number

Implementation of

IRender.type

Defined in

submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:63 (opens in a new tab)


unitId

get unitId(): string

The id of the RenderUnit.

Returns

string

Implementation of

IRender.unitId

Defined in

submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:62 (opens in a new tab)

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

submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:115 (opens in a new tab)


dispose()

dispose(): void

Returns

void

Overrides

Disposable.dispose

Defined in

submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:99 (opens in a new tab)


disposeWithMe()

disposeWithMe(disposable): IDisposable

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe

Defined in

submodules/univer/packages/core/src/shared/lifecycle.ts:96 (opens in a new tab)


ensureNotDisposed()

protected ensureNotDisposed(): void

Returns

void

Inherited from

Disposable.ensureNotDisposed

Defined in

submodules/univer/packages/core/src/shared/lifecycle.ts:100 (opens in a new tab)


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

submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:107 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.