Skip to content

JYK0128/hateoas-hal-types

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Typescript types for HAL in HATEOAS

This repository exports a set of typescript types for HAL in HATEOAS.

It exports the following Types:

Type Description
HalLink href string
RepresentationModel HalLinks
EntityModel Properties + Rel Links
CollectionModel Entity Collection + MetaData Links
PagedModel Entity Collection + Page Info + Page Links

Example

type Foo = {
    A:string
    B:HalLink
}

// Helper to build HalModel
const test: EntityModel<Foo> = {
    A:"abc",
    _links:{
     self: {href: "https://self.self"}
        B: {href: "https://test.test"}
    }
}

// Helper to access HalModel
console.log(test.A)
console.log(test._links.B.href)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published