BlockSuite API Documentation / @blocksuite/blocks / ThemeObserver
Class: ThemeObserver 
Observer theme changing by data-theme property
Contents 
Extends 
- Slot<- CssVariablesMap>
Constructors 
new ThemeObserver(undefined) 
new ThemeObserver():
ThemeObserver
Returns 
Inherited from 
@blocksuite/store.Slot.constructor
Properties 
_cssVariables 
private_cssVariables:null|CssVariablesMap=null
Source 
packages/blocks/src/_common/theme/theme-observer.ts:29
_mode 
private_mode:string=''
Source 
packages/blocks/src/_common/theme/theme-observer.ts:28
_observer? 
private_observer?:MutationObserver
Source 
packages/blocks/src/_common/theme/theme-observer.ts:26
subscribe 
subscribe: <
U>(selector,callback,config?) =>Disposable
Type parameters 
• U
Parameters 
• selector: (state) => U
• callback: (value) => void
• config?: Object
• config.equalityFn?: (a, b) => boolean
• config.filter?: (state) => boolean
Returns 
Disposable
Inherited from 
@blocksuite/store.Slot.subscribe
Source 
packages/global/dist/utils/slot.d.ts:8
Accessors 
cssVariables 
getcssVariables():null|CssVariablesMap
Returns 
null | CssVariablesMap
Source 
packages/blocks/src/_common/theme/theme-observer.ts:31
Methods 
dispose() 
dispose():
void
Returns 
void
Overrides 
@blocksuite/store.Slot.dispose
Source 
packages/blocks/src/_common/theme/theme-observer.ts:51
emit() 
emit(
v):void
Parameters 
• v: CssVariablesMap
Returns 
void
Inherited from 
Source 
packages/global/dist/utils/slot.d.ts:14
filter() 
filter(
testFun):Slot<CssVariablesMap>
Parameters 
• testFun: (v) => boolean
Returns 
Slot<CssVariablesMap>
Inherited from 
Source 
packages/global/dist/utils/slot.d.ts:6
observe() 
observe(
element):void
Parameters 
• element: Element
Returns 
void
Source 
packages/blocks/src/_common/theme/theme-observer.ts:35
on() 
on(
callback):Disposable
Parameters 
• callback: (v) => unknown
Returns 
Disposable
Inherited from 
Source 
packages/global/dist/utils/slot.d.ts:7
once() 
once(
callback):Disposable
Parameters 
• callback: (v) => unknown
Returns 
Disposable
Inherited from 
Source 
packages/global/dist/utils/slot.d.ts:12
pipe() 
pipe(
that):Slot<CssVariablesMap>
Parameters 
• that: Slot<CssVariablesMap>
Returns 
Slot<CssVariablesMap>
Inherited from 
Source 
packages/global/dist/utils/slot.d.ts:15
toDispose() 
toDispose(
disposables):Slot<CssVariablesMap>
Parameters 
• disposables: Disposable[]
Returns 
Slot<CssVariablesMap>
Inherited from 
@blocksuite/store.Slot.toDispose
Source 
packages/global/dist/utils/slot.d.ts:17
unshift() 
unshift(
callback):Disposable
Parameters 
• callback: (v) => unknown
Returns 
Disposable
Inherited from 
@blocksuite/store.Slot.unshift
Source 
packages/global/dist/utils/slot.d.ts:13
Generated using typedoc-plugin-markdown and TypeDoc