applitools / Eyes.Sdk.JavaScript

Applitools SDK for Selenium 3. This repository is deprecated. It has moved to https://github.com/applitools/eyes.sdk.javascript1/tree/master/packages/eyes-selenium-3
6 stars 17 forks source link

fix: add missing properties to MutableImage #71

Closed dmhalejr closed 5 years ago

dmhalejr commented 5 years ago

I receive this error when attempting to compile my typescript project properly. Currently the workaround is to locally fix this types which of course is not sustainable. Opening this PR to alleviate the error.

Let me know if I need to add a contributor's agreement or anything.

node_modules/eyes.selenium/typings/index.d.ts:194:5 - error TS2416: Property 'getScreenShot' in type 'Eyes' is not assignable to the same property in base type 'EyesBase'.
  Type '() => Promise<MutableImage>' is not assignable to type '() => Promise<EyesScreenshot>'.
    Type 'Promise<MutableImage>' is not assignable to type 'Promise<EyesScreenshot>'.
      Type 'MutableImage' is missing the following properties from type 'EyesScreenshot': getImage, getSubScreenshot, convertLocationFromLocation, getLocationInScreenshot, and 2 m
ore.

Thanks for all you do!

dmhalejr commented 5 years ago

Signpost:

If anyone runs into this and it's not merged in yet I created this quick script to be a stopgap solution.

#!/bin/bash

# This should be removed once this is merged: https://github.com/applitools/Eyes.Sdk.JavaScript/pull/71
OLD_TYPES="./node_modules/eyes.sdk/typings/index.d.ts"

# update this line with wherever your stopgap file is at with the changes made to this PR
NEW_TYPES="./scripts/typings/eyes.sdk/index.d.ts"

if cmp -s "$OLD_TYPES" "$NEW_TYPES" ; then
  echo "Type does not need to update"
else
  echo "Remove old typing that is broken"
  rm -rf $OLD_TYPES

  echo "Add our copy before updated"
  cp $NEW_TYPES $OLD_TYPES
fi
astappiev commented 5 years ago

Thanks @dmhalejr! I will investigate the issue until end of the week.

astappiev commented 5 years ago

I have updated the repository, a new version will be published soon. @dmhalejr can you please verify that it works? (you can wait until it published to npm)

astappiev commented 5 years ago

If you still have any troubles, please, create a new issue or post here https://github.com/applitools/Eyes.Sdk.JavaScript/issues/70

dmhalejr commented 5 years ago

@astappiev Thanks for the update! Am I looking at the appropriate NPM package looking for a new published version here?

If not, could you let me know which one would be the appropriate package?