Last active
January 30, 2019 04:01
-
-
Save ksaldana1/92d2310ae387060828dca1ac8a19c25c to your computer and use it in GitHub Desktop.
ts-alias problem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
In node_module package 'my_company_protos' | |
export namespace protos { | |
export namespace user { | |
export interface User { | |
username: string; | |
info: protos.Info.User; | |
} | |
} | |
export namespace Info { | |
export interface User { | |
name: protos.Info.Name; | |
} | |
export interface Name { | |
firstName: string; | |
lastName: string; | |
} | |
} | |
} | |
*/ | |
// Given this file | |
import { protos } from 'my_company_protos' | |
export type User = protos.user.User; | |
// I want this file | |
export interface User { | |
username: string | |
info: { | |
name: { | |
firstName: string; | |
lastName: string; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment