@@ -40,11 +40,11 @@ export interface DocBase {
4040export type Document = DocWithErrors | DocWithMeta | DocWithData ;
4141export type SingleResourceDoc <
4242 T extends string = string ,
43- A extends { [ k : string ] : JSON . Value } = { [ k : string ] : JSON . Value }
43+ A extends Attributes = Attributes
4444> = DocWithData < ResourceObject < T , A > > ;
4545export type CollectionResourceDoc <
4646 T extends string = string ,
47- A extends { [ k : string ] : JSON . Value } = { [ k : string ] : JSON . Value }
47+ A extends Attributes = Attributes
4848> = DocWithData < Array < ResourceObject < T , A > > > ;
4949
5050// an object describing the server’s implementation
@@ -53,7 +53,13 @@ export interface ImplementationInfo {
5353 meta ?: MetaObject ;
5454}
5555
56- export type Link = string | { href : string ; meta ?: MetaObject } ;
56+ interface Attribute {
57+ [ k : string ] : JSON . Value ;
58+ }
59+
60+ type Attributes = Partial < Attribute > ;
61+
62+ type Link = string | { href : string ; meta ?: MetaObject } ;
5763
5864// The top-level links object MAY contain the following members:
5965export interface Links {
@@ -136,7 +142,7 @@ export interface RelationshipsObject {
136142}
137143
138144export type AttributesObject <
139- ATTRS extends { [ k : string ] : JSON . Value } = { [ k : string ] : JSON . Value }
145+ ATTRS extends Attributes = Attributes
140146> = { [ K in keyof ATTRS ] : ATTRS [ K ] } ;
141147
142148export type Errors = ErrorObject [ ] ;
0 commit comments