Skip to content

Add Support for Getter and Setter in Ambient Context #9907

@dneimke

Description

@dneimke

As a library developer, I want to provide accurate typing definition files for my components.

The scenario that I cannot achieve this in is where I have a getter and setter on a class declared within an Ambient context.

**foo.d.ts**
// The following gives an error message: 'an accessor cannot be declared in an ambient context'

declare namespace Foo {
    class Widget {
        get name(): string;  // gets the name
        set name(name: string): void;    // sets the name
    }
} 

Metadata

Metadata

Assignees

No one assigned

    Labels

    ExternalRelates to another program, environment, or user action which we cannot control.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions