Skip to content

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 ​

ThemeObserver

Inherited from ​

Slot<CssVariablesMap>.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 ​

Slot.subscribe

Source ​

packages/global/dist/utils/slot.d.ts:8

Accessors ​

cssVariables ​

get cssVariables(): null | CssVariablesMap

Returns ​

null | CssVariablesMap

Source ​

packages/blocks/src/_common/theme/theme-observer.ts:31

Methods ​

dispose() ​

dispose(): void

Returns ​

void

Overrides ​

Slot.dispose

Source ​

packages/blocks/src/_common/theme/theme-observer.ts:51


emit() ​

emit(v): void

Parameters ​

• v: CssVariablesMap

Returns ​

void

Inherited from ​

Slot.emit

Source ​

packages/global/dist/utils/slot.d.ts:14


filter() ​

filter(testFun): Slot<CssVariablesMap>

Parameters ​

• testFun: (v) => boolean

Returns ​

Slot<CssVariablesMap>

Inherited from ​

Slot.filter

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 ​

Slot.on

Source ​

packages/global/dist/utils/slot.d.ts:7


once() ​

once(callback): Disposable

Parameters ​

• callback: (v) => unknown

Returns ​

Disposable

Inherited from ​

Slot.once

Source ​

packages/global/dist/utils/slot.d.ts:12


pipe() ​

pipe(that): Slot<CssVariablesMap>

Parameters ​

• that: Slot<CssVariablesMap>

Returns ​

Slot<CssVariablesMap>

Inherited from ​

Slot.pipe

Source ​

packages/global/dist/utils/slot.d.ts:15


toDispose() ​

toDispose(disposables): Slot<CssVariablesMap>

Parameters ​

• disposables: Disposable[]

Returns ​

Slot<CssVariablesMap>

Inherited from ​

Slot.toDispose

Source ​

packages/global/dist/utils/slot.d.ts:17


unshift() ​

unshift(callback): Disposable

Parameters ​

• callback: (v) => unknown

Returns ​

Disposable

Inherited from ​

Slot.unshift

Source ​

packages/global/dist/utils/slot.d.ts:13


Generated using typedoc-plugin-markdown and TypeDoc