Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Key Remapping in Mapped Types. #17

Merged
merged 4 commits into from
Apr 17, 2021
Merged

Use Key Remapping in Mapped Types. #17

merged 4 commits into from
Apr 17, 2021

Conversation

azu
Copy link
Owner

@azu azu commented Apr 17, 2021

TS 4.1+ support Key Remapping in Mapped Types.

Also, support index signature as Schema.

declare var mappedStorage: KVS<{
    [index: string]: string;
}>;

expectType<Promise<string | undefined>>(mappedStorage.get("key"));

azu added 3 commits April 17, 2021 14:22
BREAKING CHANGE: require TypeScript 4.1+

It aims to support to following schema:

```ts
const storage = kvs<{
    [index: string]: string;
}>;
```
@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 17, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit eec01b0:

Sandbox Source
kvs-example-basic Configuration

@azu azu merged commit 7c099be into master Apr 17, 2021
@azu azu deleted the use-remap-type branch April 17, 2021 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant