API > @blocksuite/blocks > ThemeObserver
Class: ThemeObserver ​
Observer theme changing by data-theme property
Extends ​
Slot<CssVariablesMap>
Constructors ​
constructor ​
new ThemeObserver():
ThemeObserver
Returns ​
Inherited from ​
Slot<CssVariablesMap>.constructor
Properties ​
_cssVariables ​
private_cssVariables:null|CssVariablesMap=null
Defined In ​
packages/blocks/src/_common/theme/theme-observer.ts:29
_mode ​
private_mode:string=''
Defined In ​
packages/blocks/src/_common/theme/theme-observer.ts:28
_observer ​
privateoptional_observer:MutationObserver
Defined In ​
packages/blocks/src/_common/theme/theme-observer.ts:26
subscribe ​
subscribe:
function
Type parameters ​
| Parameter |
|---|
U |
Parameters ​
| Parameter | Type |
|---|---|
selector | function |
callback | function |
config? | object |
config.equalityFn? | function |
config.filter? | function |
Returns ​
Disposable
Defined In ​
packages/global/dist/utils/slot.d.ts:8
Inherited from ​
Slot.subscribe
Accessors ​
cssVariables ​
getcssVariables():null|CssVariablesMap
Defined In ​
packages/blocks/src/_common/theme/theme-observer.ts:31
Methods ​
dispose ​
dispose():
void
Returns ​
void
Overrides ​
Slot.dispose
Defined In ​
packages/blocks/src/_common/theme/theme-observer.ts:51
emit ​
emit(
v):void
Parameters ​
| Parameter | Type |
|---|---|
v | CssVariablesMap |
Returns ​
void
Inherited from ​
Slot.emit
Defined In ​
packages/global/dist/utils/slot.d.ts:14
filter ​
filter(
testFun):Slot<CssVariablesMap>
Parameters ​
| Parameter | Type |
|---|---|
testFun | function |
Returns ​
Slot< CssVariablesMap >
Inherited from ​
Slot.filter
Defined In ​
packages/global/dist/utils/slot.d.ts:6
observe ​
observe(
element):void
Parameters ​
| Parameter | Type |
|---|---|
element | Element |
Returns ​
void
Defined In ​
packages/blocks/src/_common/theme/theme-observer.ts:35
on ​
on(
callback):Disposable
Parameters ​
| Parameter | Type |
|---|---|
callback | function |
Returns ​
Disposable
Inherited from ​
Slot.on
Defined In ​
packages/global/dist/utils/slot.d.ts:7
once ​
once(
callback):Disposable
Parameters ​
| Parameter | Type |
|---|---|
callback | function |
Returns ​
Disposable
Inherited from ​
Slot.once
Defined In ​
packages/global/dist/utils/slot.d.ts:12
pipe ​
pipe(
that):Slot<CssVariablesMap>
Parameters ​
| Parameter | Type |
|---|---|
that | Slot< CssVariablesMap > |
Returns ​
Slot< CssVariablesMap >
Inherited from ​
Slot.pipe
Defined In ​
packages/global/dist/utils/slot.d.ts:15
toDispose ​
toDispose(
disposables):Slot<CssVariablesMap>
Parameters ​
| Parameter | Type |
|---|---|
disposables | Disposable[] |
Returns ​
Slot< CssVariablesMap >
Inherited from ​
Slot.toDispose
Defined In ​
packages/global/dist/utils/slot.d.ts:17
unshift ​
unshift(
callback):Disposable
Parameters ​
| Parameter | Type |
|---|---|
callback | function |
Returns ​
Disposable
Inherited from ​
Slot.unshift
Defined In ​
packages/global/dist/utils/slot.d.ts:13