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

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

Properties

_adapterMap

private _adapterMap: AdapterMap

Source

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


_jobMiddlewares

private _jobMiddlewares: JobMiddleware[] = []

Source

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


std

std: BlockStdScope

Source

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

Methods

_getClipboardItem()

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

Parameters

slice: Slice

type: string

Returns

Promise<unknown>

Source

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

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


_getJob()

private _getJob(): Job

Returns

Job

Source

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


_getSnapshotByPriority()

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

Parameters

getItem: (type) => string | File[]

doc: Doc

parent?: string

index?: number

Returns

Promise<null | Slice>

Source

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


copy()

copy(slice): Promise<void>

Parameters

slice: Slice

Returns

Promise<void>

Source

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


copySlice()

copySlice(slice): Promise<void>

Parameters

slice: Slice

Returns

Promise<void>

Source

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

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

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


readFromClipboard()

readFromClipboard(clipboardData): any

Parameters

clipboardData: DataTransfer

Returns

any

Source

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

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


unregisterAdapter()

unregisterAdapter(mimeType): void

Parameters

mimeType: string

Returns

void

Source

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


unuse()

unuse(middleware): void

Parameters

middleware: JobMiddleware

Returns

void

Source

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


use()

use(middleware): void

Parameters

middleware: JobMiddleware

Returns

void

Source

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


writeToClipboard()

writeToClipboard(updateItems): Promise<void>

Parameters

updateItems: (items) => Record<string, unknown> | Promise<Record<string, unknown>>

Returns

Promise<void>

Source

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


Generated using TypeDoc and typedoc-plugin-markdown.