Skip to content

Add "indexed properties" #956

@dmitryDemchenko

Description

@dmitryDemchenko

In our project we use ActiveX objects accessible from JavaScript. I have .d.ts of COM library.
One of the external types has "indexed properties". As for now, it's TS declaration loks like

interface axType {
  Values(index:string):string;
}

JS code like

axObject.Values('F1') = 'test'

works just fine in runtime, but TS compiler shows the message: "Invalid left-hand side of assignment expression".

I can't see the way how to define that interface in .d.ts.

As I can imagine, it should be something like

class axType { 
  get Values(index:string): string 
  {
  //....
  }

  set Values(index:string, value: string)
  {
  // ...
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions