You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Ryan Murphy (JIRA)" <ji...@apache.org> on 2018/01/26 16:44:00 UTC

***UNCHECKED*** [jira] [Created] (CB-13837) TypeScript Definition for CameraPopoverOptions does not declare class

Ryan Murphy created CB-13837:
--------------------------------

             Summary: 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


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-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org