Skip to content

BlockSuite API Documentation / @blocksuite/blocks / SpecProvider

Class: SpecProvider

Constructors

new SpecProvider()

private new SpecProvider(): SpecProvider

Returns

SpecProvider

Source

packages/blocks/src/specs/utils/spec-provider.ts:11

Properties

specMap

private specMap: Map<string, BlockSpec<string, BlockService<BlockModel<object>>>[]>

Source

packages/blocks/src/specs/utils/spec-provider.ts:9


instance

static instance: SpecProvider

Source

packages/blocks/src/specs/utils/spec-provider.ts:7

Methods

addSpec()

addSpec(id, spec): void

Parameters

id: string

spec: BlockSpec<string, BlockService<BlockModel<object>>>[]

Returns

void

Source

packages/blocks/src/specs/utils/spec-provider.ts:20


clearSpec()

clearSpec(id): void

Parameters

id: string

Returns

void

Source

packages/blocks/src/specs/utils/spec-provider.ts:36


getSpec()

getSpec(id): SpecBuilder

Parameters

id: string

Returns

SpecBuilder

Source

packages/blocks/src/specs/utils/spec-provider.ts:30


hasSpec()

hasSpec(id): boolean

Parameters

id: string

Returns

boolean

Source

packages/blocks/src/specs/utils/spec-provider.ts:26


getInstance()

static getInstance(): SpecProvider

Returns

SpecProvider

Source

packages/blocks/src/specs/utils/spec-provider.ts:13