ts-interface-keys-transformer icon indicating copy to clipboard operation
ts-interface-keys-transformer copied to clipboard

Nested interface with indexer does not work

Open rodcloutier opened this issue 4 years ago • 0 comments

Compiling the following code

import { keys } from 'ts-interface-keys-transformer';

interface working {
    name: string;
    [index: string]: string;
}
const workingKeys = keys<working>()

interface notWorking {
    working: working;
    [index: string]: any;
}
const notWorkingKeys = keys<notWorking>()

generates the following error

$ npx ttsc test.ts
Cannot read property 'intrinsicName' of undefined

Removing the [index: string]: string; fixes the issue. I am pretty new to TypeScript, is [index: string]: any; should be supported?

rodcloutier avatar Oct 29 '20 21:10 rodcloutier