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: RawRelationship‹RelationshipData›
RelationshipArray
Ƭ RelationshipArray: RawRelationship‹RelationshipData[]›
RelationshipData
Ƭ RelationshipData: object
Type declaration:
id: string
type: Type
RelationshipType
Ƭ RelationshipType: RelationshipData‹Type› | RelationshipData‹Type›[]
Relationships
Ƭ Relationships: Record‹string, RawRelationship‹RelationshipType› | 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
Const
DEFAULT_RESOURCE_LIMIT• DEFAULT_RESOURCE_LIMIT: 10 = 10
Functions
Const
findIncludedRelationship
Const
findIncludedRelationship▸ findIncludedRelationship(relationship
: RelationshipData, included
: IncludedRelationships): AnyData | undefined
Parameters:
Name | Type |
| |
|
Returns: AnyData | undefined
Const
includedGroup
Const
includedGroup▸ includedGroup<D>(type
: string): IncludedGroup‹D›
Type parameters:
▪ D: AnyData
Parameters:
Name | Type |
| string |
Returns: IncludedGroup‹D›
Const
isData
Const
isData▸ isData<D>(data
: RelationshipData | D): data is D
Type parameters:
▪ D: AnyData
Parameters:
Name | Type |
| RelationshipData | D |
Returns: data is D
Const
mergeElementData
Const
mergeElementData▸ mergeElementData<D>(data
: D): MergedData‹D›
Type parameters:
▪ D: AnyData
Parameters:
Name | Type |
| D |
Returns: MergedData‹D›
resolveRelationships
▸ resolveRelationships<D>(data
: D, included
: IncludedRelationships): D
Type parameters:
Parameters:
Name | Type |
| D |
|
Returns: D
▸ resolveRelationships(data
: RelationshipData[], included
: IncludedRelationships): object | Data‹any, any›[]
Parameters:
Name | Type |
| |
|
Returns: object | Data‹any, any›[]
▸ resolveRelationships(data
: RelationshipData, included
: IncludedRelationships): AnyData | RelationshipData
Parameters:
Name | Type |
| |
|
Returns: AnyData | RelationshipData
Object literals
Const
Headers
Const
Headers▪ Headers: object
Accept
• Accept: ContentType = ContentType.VND_JSON
Content-Type
• Content-Type: ContentType = ContentType.VND_JSON
Last updated