-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueRecent RegressionThis is a new regression just found in the last major/minor version of TypeScript.This is a new regression just found in the last major/minor version of TypeScript.
Milestone
Description
#52836 broke fragmented-store on Definitely Typed. Here's a repro that doesn't depend on React:
type StateHook<S> = () => [S, unknown];
type StoreUtils<Store extends { [K: string]: any }> = Omit<{
[K in keyof Store as `use${Capitalize<string & K>}`]: StateHook<Store[K]>
}, 'useStore'> & {
Provider: unknown,
useStore: StateHook<Store>
};
declare function createStore<Store extends { [K: string]: any }>(store: Store): StoreUtils<Store>;
const { Provider, useUsername, useAge, useStore } = createStore({
username: "Aral",
age: 31
});
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueRecent RegressionThis is a new regression just found in the last major/minor version of TypeScript.This is a new regression just found in the last major/minor version of TypeScript.