expose client.writeTextToClipboard

Summary: per title

Reviewed By: priteshrnandgaonkar

Differential Revision: D27044508

fbshipit-source-id: 8af99f66ec8203b76ccb3d880e1a184193a389c7
This commit is contained in:
Michel Weststrate
2021-03-16 14:54:53 -07:00
committed by Facebook GitHub Bot
parent 4e2383cdb0
commit 7093a932f8
2 changed files with 12 additions and 0 deletions

View File

@@ -86,6 +86,11 @@ export interface BasePluginClient {
* Clicking the notification will open this plugin. If the `action` id is set, it will be used as deeplink.
*/
showNotification(notification: Notification): void;
/**
* Writes text to the clipboard of the Operating System
*/
writeTextToClipboard(text: string): void;
}
let currentPluginInstance: BasePluginInstance | undefined = undefined;
@@ -272,6 +277,7 @@ export abstract class BasePluginInstance {
this.menuEntries.push(normalizeMenuEntry(entry));
}
},
writeTextToClipboard: this.flipperLib.writeTextToClipboard,
createPaste: this.flipperLib.createPaste,
GK: this.flipperLib.GK,
showNotification: (notification: Notification) => {

View File

@@ -295,6 +295,12 @@ interface Notification {
};
```
#### `writeTextToClipboard`
Usage: `writeTextToClipboard(text: string)`
Writes text to the OS-level clipboard.
#### `createPaste`
Facebook only API.