Function SetWatermarkOptionsPrompt

  • Prompts the user to decide whether to add a watermark to an image and, if so, where to position it.

    Returns Promise<{ watermark: boolean; watermarkPosition: keyof GravityEnum }>

    An object containing: - watermark: A boolean indicating whether the user wants to add a watermark. - watermarkPosition: A string representing the desired position of the watermark (e.g., 'center', 'northwest', 'southeast'). This value corresponds to the keys of the gravity object from the sharp library. If watermark is false, this defaults to 'center'. *

    const WatermarkOptions = await SetWatermarkOptionsPrompt();
    console.log(WatermarkOptions);
    // will returns:
    {
    watermark: true,
    watermarkPosition: 'center' || 'northwest' || 'southeast' as keyof typeof gravity,
    }