Skip to content

Instantly share code, notes, and snippets.

@ksaldana1
Last active January 30, 2019 04:01
Show Gist options
  • Save ksaldana1/92d2310ae387060828dca1ac8a19c25c to your computer and use it in GitHub Desktop.
Save ksaldana1/92d2310ae387060828dca1ac8a19c25c to your computer and use it in GitHub Desktop.
ts-alias problem
/*
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