Skip to main content
Version: 1.x.x

APIs

quip.apps.ImageRecord.prototype

chooseFile

Function() => void

Prompts the user with a file picker to have them choose an image file. Once the file is successfully uploaded to Quip and is accessible, listeners for this Record will be notified.

hasImage

Function() => boolean

Returns whether this ImageRecord has already been successfully associated with an image file.

openInLightbox

Function() => void

Sends a message to the host to open this image in an external lightbox.

downloadOriginal

Function() => void

Sends a message to the host to trigger a download of the original image file to the user's machine.

handleShowFilePickerActionStarted

Function() => void

Convenience method to allow an ImageRecord to handle the actionStarted phase for a MenuCommand that uses quip.apps.DocumentMenuActions.SHOW_FILE_PICKER.

handleShowFilePickerAction

Function(blobsWithThumbnails: BlobWithThumbnails[]) => void

Convenience method to allow an ImageRecord to handle the result for a MenuCommand that uses quip.apps.DocumentMenuActions.SHOW_FILE_PICKER.

getOriginalImageWidth

Function() => number

Returns the original image width for this image.

getOriginalImageHeight

Function() => number

Returns the original image height for this image.

uploadFile

Function(blob: Blob) => void

Uploads a file directly to this record. Useful if you programatically generate blobs or otherwise handle image picking on your own.

commitCrop

Function(crop: {
fracionLeft: number,
fractionTop: number,
fractionWidth: number,
fractionHeight: number,
cropInitiatedKey?: number
}) => void

Crops the image to the specified parameters. Listeners to this record will be notified when the operation is complete.