nodejs-vision
nodejs-vision copied to clipboard
Why do the methods return an array containing the results?
I'm trying to use ImageAnnotatorClient to annotate images. I've realized that the methods that are called on the ImageAnnotatorClient instance return Promise<[protoTypes.google.cloud.vision.v1.IAnnotateImageResponse]>. And in the examples the result is assigned and used like below:
const [result] = await client.labelDetection('./resources/wakeupcat.jpg');
const labels = result.labelAnnotations;
What is the reason of this? Why do methods not return Promise<[protoTypes.google.cloud.vision.v1.IAnnotateImageResponse]> directly?