aws / aws/jsii

Better Support for Mapped Types

Open
#2,901 3 comments 31 reactions 1 assignee Claimed by @RomainMuller View on GitHub
effort/medium feature-request p1
Dominant language
TypeScript
Stars
2.9k
Forks
267
Avg merge
1d 25m
Merged PRs (30d)
14

Description

## :rocket: Feature Request

### Affected Languages

- [ ] `TypeScript` or `Javascript`
- [ ] `Python`
- [ ] `Java`
- [ ] .NET (`C#`, `F#`, ...)
- [ ] `Go`

### General Information
* **JSII Version:** 1.30.0
* **Platform:** Linux docker-desktop 5.10.25-linuxkit #1 SMP Tue Mar 23 09:27:39 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

* [ ] I may be able to implement this feature request

* [ ] This feature might incur a breaking change

### Description

We would like to make an attribute of an exported Properties object Partial<>, like this:

```
export interface MyLevelThreeConstructProps{
readonly serviceProps: Partial
}
```
This converts ServiceProps to a Mapped Type that JSII does not support:

`error JSII1003: Only string-indexed map types are supported`

This is pretty deep inside the Typescript transpilation process, so I'm not sure of the exact nature of the Mapped Type that makes it incompatible. What are the chances of a fix to JSII that supports this sort of Mapped Type?

### Proposed Solution

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.