[ 
https://issues.apache.org/jira/browse/CB-13837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16697391#comment-16697391
 ] 

ASF GitHub Bot commented on CB-13837:
-------------------------------------

jcesarmobile closed pull request #379: CB-13837: fix TypeScript Definition for 
CameraPopoverOptions
URL: https://github.com/apache/cordova-plugin-camera/pull/379
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/types/index.d.ts b/types/index.d.ts
index fa50e9ce..0ab73050 100644
--- a/types/index.d.ts
+++ b/types/index.d.ts
@@ -138,6 +138,10 @@ interface CameraPopoverOptions {
     arrowDir : number;
 }
 
+declare class CameraPopoverOptions implements CameraPopoverOptions {
+    constructor(x?: number, y?: number, width?: number, height?: number, 
arrowDir?: number);
+}
+
 declare var Camera: {
     // Camera constants, defined in Camera plugin
     DestinationType: {


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> TypeScript Definition for CameraPopoverOptions does not declare class
> ---------------------------------------------------------------------
>
>                 Key: CB-13837
>                 URL: https://issues.apache.org/jira/browse/CB-13837
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-plugin-camera
>            Reporter: Ryan Murphy
>            Priority: Minor
>
> The docs for CameraPopoverOptions use it as a class.
> From docs: 
> {code:javascript}
> var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, 
> Camera.PopoverArrowDirection.ARROW_ANY);
> {code}
>  
> But the index.d.ts only define an interface, not declare a class, so using it 
> as a class in a TypeScript file gives the error:
>  {color:#ff0000}[ts] 'CameraPopoverOptions' only refers to a type, but is 
> being used as a value here.{color}
> The fix would be to declare a class and constructor.
> {code:java}
> declare class CameraPopoverOptions implements CameraPopoverOptions {
>     constructor(x?: number, y?: number, width?: number, height?: number, 
> arrowDir?: number);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to