Latest
Search
K
Links

API

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Object literals

Type aliases

AnyData

Ƭ AnyData: Data‹any, any›

AttributesOf

Ƭ AttributesOf: D extends object ? D["attributes"] : EmptyRecord

EmptyRecord

Ƭ EmptyRecord: object

Type declaration:

  • [ key: string]: never

IncludedGroups

Ƭ IncludedGroups: object

Type declaration:

IncludedGroupsSchema

Ƭ IncludedGroupsSchema: Record‹string, IncludedGroup

IncludedRelationships

Ƭ IncludedRelationships: D[]

MergedData

Ƭ MergedData:

MergeData type

This sophisticated type allows to correctly infer nicely formatted data from JSON API format. id, type, attributes and relationships suddenly become a single, combined object with easy access to it. Same is applied to arrays.

MergedIncludedGroups

Ƭ MergedIncludedGroups: object

Type declaration:

OptionalRels

Ƭ OptionalRels: Relationships | undefined

RawRelationship

Ƭ RawRelationship: object

Type declaration:

  • data: T
  • links? : undefined | object
  • related? : undefined | string

Relationship

Ƭ Relationship: RawRelationshipRelationshipData

RelationshipArray

Ƭ RelationshipArray: RawRelationshipRelationshipData[]›

RelationshipData

Ƭ RelationshipData: object

Type declaration:

  • id: string
  • type: Type

RelationshipType

Ƭ RelationshipType: RelationshipData‹Type› | RelationshipData‹Type›[]

Relationships

Ƭ Relationships: Record‹string, RawRelationshipRelationshipType› | undefined›

RelationshipsOf

Ƭ RelationshipsOf: D extends object ? D["relationships"] : EmptyRecord

ResolvedRelationship

Ƭ ResolvedRelationship: RawRelationship‹D›

ResolvedRelationshipArray

Ƭ ResolvedRelationshipArray: RawRelationship‹D[]›

ResolvedRelationships

Ƭ ResolvedRelationships: Record‹string, ResolvedRelationship | ResolvedRelationshipArray | undefined›

UnresolvedRelationships

Ƭ UnresolvedRelationships: Record‹string, Relationship | RelationshipArray

Variables

Const DEFAULT_RESOURCE_LIMIT

DEFAULT_RESOURCE_LIMIT: 10 = 10

Functions

Const findIncludedRelationship

findIncludedRelationship(relationship: RelationshipData, included: IncludedRelationships): AnyData | undefined
Parameters:
Name
Type
relationship
included
Returns: AnyData | undefined

Const includedGroup

includedGroup<D>(type: string): IncludedGroup‹D›
Type parameters:
D: AnyData
Parameters:
Name
Type
type
string
Returns: IncludedGroup‹D›

Const isData

isData<D>(data: RelationshipData | D): data is D
Type parameters:
D: AnyData
Parameters:
Name
Type
data
Returns: data is D

Const mergeElementData

mergeElementData<D>(data: D): MergedData‹D›
Type parameters:
D: AnyData
Parameters:
Name
Type
data
D
Returns: MergedData‹D›

resolveRelationships

resolveRelationships<D>(data: D, included: IncludedRelationships): D
Type parameters:
D: AnyData | AnyData[]
Parameters:
Name
Type
data
D
included
Returns: D
resolveRelationships(data: RelationshipData[], included: IncludedRelationships): object | Data‹any, any›[]
Parameters:
Name
Type
data
included
Returns: object | Data‹any, any›[]
resolveRelationships(data: RelationshipData, included: IncludedRelationships): AnyData | RelationshipData
Parameters:
Name
Type
data
included

Object literals

Const Headers

Headers: object

Accept

Accept: ContentType = ContentType.VND_JSON

Content-Type

Content-Type: ContentType = ContentType.VND_JSON