Skip to content

BlockSuite API Documentation / @blocksuite/block-std / Clipboard

Class: Clipboard

Constructors

new Clipboard(std)

new Clipboard(std): Clipboard

Parameters

std: BlockStdScope

Returns

Clipboard

Source

packages/framework/block-std/src/clipboard/index.ts:24

Properties

_adapterMap

private _adapterMap: AdapterMap

Source

packages/framework/block-std/src/clipboard/index.ts:22


_jobMiddlewares

private _jobMiddlewares: JobMiddleware[] = []

Source

packages/framework/block-std/src/clipboard/index.ts:21


std

std: BlockStdScope

Source

packages/framework/block-std/src/clipboard/index.ts:24

Methods

_getClipboardItem()

private _getClipboardItem(slice, type): Promise<unknown>

Parameters

slice: Slice

type: string

Returns

Promise<unknown>

Source

packages/framework/block-std/src/clipboard/index.ts:73


_getDataByType()

private _getDataByType(clipboardData): (type) => string | File[]

Parameters

clipboardData: DataTransfer

Returns

Function

Parameters

type: string

Returns

string | File[]

Source

packages/framework/block-std/src/clipboard/index.ts:51


_getJob()

private _getJob(): Job

Returns

Job

Source

packages/framework/block-std/src/clipboard/index.ts:42


_getSnapshotByPriority()

private _getSnapshotByPriority(getItem, doc, parent?, index?): Promise<null | Slice>

Parameters

getItem

doc: Doc

parent?: string

index?: number

Returns

Promise<null | Slice>

Source

packages/framework/block-std/src/clipboard/index.ts:85


copy()

copy(slice): Promise<void>

Parameters

slice: Slice

Returns

Promise<void>

Source

packages/framework/block-std/src/clipboard/index.ts:130


copySlice()

copySlice(slice): Promise<void>

Parameters

slice: Slice

Returns

Promise<void>

Source

packages/framework/block-std/src/clipboard/index.ts:237


paste()

paste(event, doc, parent?, index?): Promise<undefined | null | Slice>

Parameters

event: ClipboardEvent

doc: Doc

parent?: string

index?: number

Returns

Promise<undefined | null | Slice>

Source

packages/framework/block-std/src/clipboard/index.ts:134


pasteBlockSnapshot()

pasteBlockSnapshot(snapshot, doc, parent?, index?): Promise<BlockModel<object>>

Parameters

snapshot: BlockSnapshot

doc: Doc

parent?: string

index?: number

Returns

Promise<BlockModel<object>>

Source

packages/framework/block-std/src/clipboard/index.ts:227


readFromClipboard()

readFromClipboard(clipboardData): any

Parameters

clipboardData: DataTransfer

Returns

any

Source

packages/framework/block-std/src/clipboard/index.ts:213


registerAdapter()

registerAdapter(mimeType, adapter, priority): void

Parameters

mimeType: string

adapter: BaseAdapter<unknown>

priority: number= 0

Returns

void

Source

packages/framework/block-std/src/clipboard/index.ts:34


unregisterAdapter()

unregisterAdapter(mimeType): void

Parameters

mimeType: string

Returns

void

Source

packages/framework/block-std/src/clipboard/index.ts:38


unuse()

unuse(middleware): void

Parameters

middleware: JobMiddleware

Returns

void

Source

packages/framework/block-std/src/clipboard/index.ts:30


use()

use(middleware): void

Parameters

middleware: JobMiddleware

Returns

void

Source

packages/framework/block-std/src/clipboard/index.ts:26


writeToClipboard()

writeToClipboard(updateItems): Promise<void>

Parameters

updateItems

Returns

Promise<void>

Source

packages/framework/block-std/src/clipboard/index.ts:166