Interface: IImagingService
Class for creating and deleting images
Extends
Methods
canAddImage()
canAddImage(profileId
?): boolean
Ask the imaging service whether the user can add an image for the current document
Parameters
• profileId?: number
(optional) the artifact id of the profile that will be used to image
Returns
boolean
A boolean that indicates whether it is possible to add an image for the current document
If no profile id is passed in, checks if user has access to any valid profile ids.
If profile id is passed in, checks specifically if user has access to that profile, and that it allows the document's native type.
canCreateImage()
canCreateImage(profileId
?): boolean
Ask the imaging service whether imaging is possible for the current document
Parameters
• profileId?: number
(optional) the artifact id of the profile that will be used to image
Returns
boolean
A boolean that indicates whether imaging is possible for the current document
If no profile id is passed in, checks if user has access to any valid profile ids.
If profile id is passed in, checks specifically if user has access to that profile, and that it allows the document's native type.
canDeleteImages()
canDeleteImages(): boolean
Ask the imaging service whether deleting images is possible for the current document
Returns
boolean
A boolean that indicates whether it is possible to delete images for the current document
canReplaceImage()
canReplaceImage(profileId
?): boolean
Ask the imaging service whether the user can replace the image for the current document
Parameters
• profileId?: number
(optional) the artifact id of the profile that will be used to image
Returns
boolean
A boolean that indicates whether it is possible to replace the image for the current document
- If no profile id is passed in, checks if user has access to any valid profile ids.
If profile id is passed in, checks specifically if user has access to that profile, and that it allows the document's native type.
createImage()
createImage(profileId
): Promise
<boolean
>
Attempts to create an image for the current document
Parameters
• profileId: number
Artifact ID of the profile to use to create the image
Returns
Promise
<boolean
>
A promise that resolves to true if image creation was successfully started
deleteImages()
deleteImages(): Promise
<boolean
>
Attempts to delete all images for the current document
Returns
Promise
<boolean
>
A promise that resolves to true if image deletion was successful
getImagingProfilesForUser()
getImagingProfilesForUser(): IImagingProfileInfo
[]
Get the imaging profiles that the user has permission for
Returns
IImagingProfileInfo
[]
A promise that resolves to the available imaging profiles
newImageAdded()
newImageAdded(): Promise
<boolean
>
Inform the review interface that a new image file has been uploaded
Returns
Promise
<boolean
>
A promise that resolves when the review interface has finished handling the new image
off()
off(eventType
, handler
?, once
?): void
Unregisters an event handler
Parameters
• eventType: ImagingServiceEventType
Event to unregister from
• handler?: EventHandler
Event handler function. If not passed in, it removes all event handlers.
• once?: boolean
Boolean indicating if the event handler was registered as a one-time event handler (Defaults to false)
Returns
void
Inherited from
IEventEmitter
.off
on()
on(eventType
, handler
): void
Registers an event handler
Parameters
• eventType: ImagingServiceEventType
Event to listen for
• handler: EventHandler
Event handler function
Returns
void
Inherited from
IEventEmitter
.on
once()
once(eventType
, handler
): void
Registers an event handler that is only run once
Parameters
• eventType: ImagingServiceEventType
Event to listen for
• handler: EventHandler
Event handler function
Returns
void
Inherited from
IEventEmitter
.once