Skip to content

Handle rest types for @typedef for createTypeFromMapping #154

Open
@kungfooman

Description

@kungfooman

Example:

/**
 * @typedef {{a: 'aa', b: 'bb', c: 'cc'}} Obj
 * @typedef {Obj[Keys]} ObjKeys
 * @typedef {{[Key in ObjKeys]: [1, 2, 3, Key, ...[1, 2, 3]]}} ArrayTest
 */
const t2 = createTypeFromMapping(typedefs.ArrayTest, console.warn);
console.log(JSON.stringify(t2, null, 2));

RTI REPL

Current errors:

getTypeKeys: Couldn't get keys for type {type: 'indexedAccess', index: 'Keys', object: 'Obj'}
createTypeFromMapping: validateMapping: missing typeKeys

image

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtranspilertypingsEverything related to type declarations

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions