Last active
January 30, 2019 05:39
-
-
Save ksaldana1/d10d5a3c54147550d54a50fec161dfbd to your computer and use it in GitHub Desktop.
transform-input-output
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
// input | |
export namespace protos { // ModuleDeclaration | |
export namespace user { // ModuleDeclaration | |
// Module Block | |
export interface User { // InterfaceDeclaration | |
username: string; // username: string is PropertySignature | |
info: protos.Info.User; // TypeReference | |
} | |
} | |
export namespace Info { | |
export interface User { | |
name: protos.Info.Name; // TypeReference | |
} | |
export interface Name { | |
firstName: string; | |
lastName: string; | |
} | |
} | |
} | |
// this line is a TypeAliasDeclaration | |
export type User = protos.user.User; // protos.user.User is a TypeReference | |
// output | |
export interface User { | |
username: string; | |
info: { // info: { .. } is a TypeLiteral | |
name: { // name: { .. } is a TypeLiteral | |
firstName: string; | |
lastName: string; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment