Home Reference Source
import Clipboard from '@osjs/client/src/clipboard.js'
public class | source

Clipboard

Clipboard Manager

Constructor Summary

Public Constructor
public

Create new clipboard

Member Summary

Public Members
public

Method Summary

Public Methods
public

clear()

Clear clipboard

public

Destroy clipboard

public

get(clear: boolean): Promise<*>

Gets clipboard data

public

has(type: string | RegExp): boolean

Checks if current clipboard data has this type

public

set(data: *, type: string)

Set clipboard data

Public Constructors

public constructor() source

Create new clipboard

Public Members

public clipboard: ClipboardData source

Public Methods

public clear() source

Clear clipboard

public destroy() source

Destroy clipboard

public get(clear: boolean): Promise<*> source

Gets clipboard data

Params:

NameTypeAttributeDescription
clear boolean
  • optional
  • default: false

Clear clipboard

Return:

Promise<*>

public has(type: string | RegExp): boolean source

Checks if current clipboard data has this type

Params:

NameTypeAttributeDescription
type string | RegExp

Data type

Return:

boolean

public set(data: *, type: string) source

Set clipboard data

Params:

NameTypeAttributeDescription
data *

Clipboard data. For async data, provide a function that returns a promise

type string
  • optional

Optional type used by applications for identifying content