• Parameters

    • clipboardModule: {
          addListener(callback: (() => void)): EmitterSubscription;
          getImage(): Promise<string>;
          getImageJPG(): Promise<string>;
          getImagePNG(): Promise<string>;
          getString(): Promise<string>;
          getStrings(): Promise<string[]>;
          hasImage(): any;
          hasNumber(): any;
          hasString(): any;
          hasURL(): any;
          hasWebURL(): any;
          removeAllListeners(): void;
          setImage(content: string): void;
          setString(content: string): void;
          setStrings(content: string[]): void;
      }
      • addListener:function
        • (iOS and Android Only) Adds a listener to get notifications when the clipboard has changed. If this is the first listener, turns on clipboard notifications on the native side. It returns EmitterSubscription where you can call "remove" to remove listener

          const listener = () => console.log("changed!");
          Clipboard.addListener(listener);

          Parameters

          • callback: (() => void)
              • (): void
              • Returns void

          Returns EmitterSubscription

      • getImage:function
        • (Android Only) Get clipboard image in base64, this method returns a Promise, so you can use following code to get clipboard content

          async _getContent() {
          var content = await Clipboard.getImage();
          }

          Returns Promise<string>

      • getImageJPG:function
        • Get clipboard image as JPG in base64, this method returns a Promise, so you can use following code to get clipboard content

          async _getContent() {
          var content = await Clipboard.getImageJPG();
          }

          Returns Promise<string>

      • getImagePNG:function
        • Get clipboard image as PNG in base64, this method returns a Promise, so you can use following code to get clipboard content

          async _getContent() {
          var content = await Clipboard.getImagePNG();
          }

          Returns Promise<string>

      • getString:function
        • Get content of string type, this method returns a Promise, so you can use following code to get clipboard content

          async _getContent() {
          var content = await Clipboard.getString();
          }

          Returns Promise<string>

      • getStrings:function
        • (iOS Only) Get contents of string array type, this method returns a Promise, so you can use following code to get clipboard content

          async _getContent() {
          var content = await Clipboard.getStrings();
          }

          Returns Promise<string[]>

      • hasImage:function
        • Returns whether the clipboard has an image or is empty. This method returns a Promise, so you can use following code to check clipboard content

          async _hasContent() {
          var hasContent = await Clipboard.hasImage();
          }

          Returns any

      • hasNumber:function
        • (iOS 14+ Only) Returns whether the clipboard has a Number(UIPasteboardDetectionPatternNumber) content. Can check if there is a Number content in clipboard without triggering PasteBoard notification for iOS 14+ This method returns a Promise, so you can use following code to check for Number content in clipboard.

          async _hasNumber() {
          var hasNumber = await Clipboard.hasNumber();
          }

          Returns any

      • hasString:function
        • Returns whether the clipboard has content or is empty. This method returns a Promise, so you can use following code to get clipboard content

          async _hasContent() {
          var hasContent = await Clipboard.hasString();
          }

          Returns any

      • hasURL:function
        • (iOS Only) Returns whether the clipboard has a URL content. Can check if there is a URL content in clipboard without triggering PasteBoard notification for iOS 14+ This method returns a Promise, so you can use following code to check for url content in clipboard.

          async _hasURL() {
          var hasURL = await Clipboard.hasURL();
          }

          Returns any

      • hasWebURL:function
        • (iOS 14+ Only) Returns whether the clipboard has a WebURL(UIPasteboardDetectionPatternProbableWebURL) content. Can check if there is a WebURL content in clipboard without triggering PasteBoard notification for iOS 14+ This method returns a Promise, so you can use following code to check for WebURL content in clipboard.

          async _hasWebURL() {
          var hasWebURL = await Clipboard.hasWebURL();
          }

          Returns any

      • removeAllListeners:function
        • (iOS and Android Only) Removes all previously registered listeners and turns off notifications on the native side.

          Clipboard.removeAllListeners();
          

          Returns void

      • setImage:function
        • (iOS Only) Set content of base64 image type. You can use following code to set clipboard content

          _setContent() {
          Clipboard.setImage(...);
          }

          Parameters

          • content: string

          Returns void

      • setString:function
        • Set content of string type. You can use following code to set clipboard content

          _setContent() {
          Clipboard.setString('hello world');
          }

          Parameters

          • content: string

          Returns void

      • setStrings:function
        • Set content of string array type. You can use following code to set clipboard content

          _setContent() {
          Clipboard.setStrings(['hello world', 'second string']);
          }

          Parameters

          • content: string[]

          Returns void

    Returns ClipboardServiceInterface

Generated using TypeDoc