Created
March 24, 2017 16:01
-
-
Save vivainio/d69007dbb3fca0794ace0e04c9954bd8 to your computer and use it in GitHub Desktop.
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
| // linked data (HateOAS) with types | |
| interface HData<T> { | |
| rel: string; | |
| href: string; | |
| data?: T; | |
| } | |
| interface HAction<T, U> { | |
| rel: string; | |
| href: string; | |
| } | |
| interface HService { | |
| fetch<T>(resource: HData<T>): Promise<T>; | |
| post<T,U>(action: HAction<T, U>, payload: T) : Promise<U>; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment