You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
563 B
34 lines
563 B
|
3 years ago
|
import clipboard from '@system.clipboard'
|
||
|
|
|
||
|
|
import {
|
||
|
|
invoke
|
||
|
|
} from '../../bridge'
|
||
|
|
|
||
|
|
export function getClipboardData (options, callbackId) {
|
||
|
|
clipboard.get({
|
||
|
|
success: (ret) => {
|
||
|
|
invoke(callbackId, {
|
||
|
|
data: ret.text,
|
||
|
|
errMsg: 'getClipboardData:ok'
|
||
|
|
})
|
||
|
|
},
|
||
|
|
fail: (data, code) => {
|
||
|
|
invoke(callbackId, {
|
||
|
|
data: code,
|
||
|
|
errMsg: 'getClipboardData:fail'
|
||
|
|
})
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
export function setClipboardData ({
|
||
|
|
data
|
||
|
|
}) {
|
||
|
|
clipboard.set({
|
||
|
|
text: data
|
||
|
|
})
|
||
|
|
return {
|
||
|
|
errMsg: 'setClipboardData:ok'
|
||
|
|
}
|
||
|
|
}
|