@univerjs/engine-render v0.4.2 • Docs
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
Parameter | Type |
---|---|
init | Pick <IRenderContext <UnitModel <object , number >>, "unit" | "scene" | "engine" | "isMainScene" > |
parentInjector | Injector |
Returns
Overrides
Defined in
submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:79 (opens in a new tab)
Properties
Property | Modifier | Type | Default value | Inherited from | Defined in |
---|---|---|---|---|---|
_disposed | protected | boolean | false | Disposable ._disposed | submodules/univer/packages/core/src/shared/lifecycle.ts:93 (opens in a new tab) |
isRenderUnit | readonly | boolean | true | - | 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
Parameter | Type |
---|---|
engine | Engine |
Returns
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
Parameter | Type |
---|---|
is | boolean |
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
Parameter | Type |
---|---|
component | Nullable <RenderComponentType > |
Returns
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
Parameter | Type |
---|---|
scene | Scene |
Returns
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
Parameter | Type |
---|---|
dependencies | Dependency [] |
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
Defined in
submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:99 (opens in a new tab)
disposeWithMe()
disposeWithMe(disposable): IDisposable
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
Defined in
submodules/univer/packages/core/src/shared/lifecycle.ts:96 (opens in a new tab)
ensureNotDisposed()
protected ensureNotDisposed(): void
Returns
void
Inherited from
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
Parameter | Type |
---|---|
dependency | DependencyIdentifier <T > |
Returns
T
Implementation of
Defined in
submodules/univer/packages/engine-render/src/render-manager/render-unit.ts:107 (opens in a new tab)