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
import { protos } from './my_company_protos' | |
export type User = protos.user.User; |
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; | |
} | |
} |
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
{ | |
"type": "Program", | |
"start": 0, | |
"end": 80, | |
"loc": { | |
"start": { | |
"line": 1, | |
"column": 0 | |
}, | |
"end": { |
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
import { PathPart, Route } from './interfaces/types'; | |
export function isParam(i: any): i is PathParam<any> { | |
return i.param != null; | |
} | |
export function param<T extends string>(t: T): PathParam<T> { | |
return { param: t }; | |
} |
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
// Interface returned by our RouteCreator function | |
export interface Route<Parts extends PathPart<any>> { | |
template(): string; | |
create(params: UnionToIntersection<OnlyParams<Parts>>): string; | |
} | |
export type PathPart<T extends string> = string | PathParam<T>; | |
export function param<T extends string>(t: T): PathParam<T> { | |
return { param: t }; |
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
// Interface returned by our RouteCreator function | |
export interface Route<Parts extends PathPart<any>> { | |
template(): string; | |
create(params: UnionToIntersection<OnlyParams<Parts>>): string; | |
} | |
export interface PathParam<T extends string> { | |
param: T; | |
} |
NewerOlder