-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2387db
commit d496c9b
Showing
22 changed files
with
50 additions
and
44 deletions.
There are no files selected for viewing
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import type { JSONAPIObject } from "./object"; | ||
import type { JSONObject } from "./json/object"; | ||
|
||
export type JSONAPIAttributesObject = JSONAPIObject; | ||
export type JSONAPIAttributesObject = JSONObject; |
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import type { JSONObject } from './object'; | ||
import type { JSONPrimitives } from './primitives'; | ||
|
||
export type JSONArray = JSONObject[] | JSONPrimitives[]; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import type { JSONArray } from './array'; | ||
import type { JSONObject } from './object'; | ||
import type { JSONPrimitives } from './primitives'; | ||
|
||
export type JSONDataTypes = JSONPrimitives | JSONArray | JSONObject; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export * from './dataTypes'; | ||
export * from './primitives'; | ||
export * from './object'; | ||
export * from './array'; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import type { JSONDataTypes } from './dataTypes'; | ||
|
||
export type JSONObject = { [key: string]: JSONDataTypes }; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type JSONPrimitives = string | number | boolean | null; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import type { Satisfies } from "./helpers/satisfies"; | ||
import type { JSONObject } from "./json/object"; | ||
|
||
export type JSONAPIObject = Satisfies<{ | ||
verison?: string; | ||
ext?: string[]; | ||
profile?: string[]; | ||
}, JSONObject>; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import type { JSONAPIObject } from "./object"; | ||
import type { JSONObject } from "./json/object"; | ||
import type { Satisfies } from "./helpers/satisfies"; | ||
|
||
export type JSONAPILinksObject = Satisfies<{ [key: string]: string | JSONAPILinksObject | null }, JSONAPIObject>; | ||
export type JSONAPILinksObject = Satisfies<{ [key: string]: string | JSONAPILinksObject | null }, JSONObject>; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import type { JSONAPIObject } from './object'; | ||
import type { JSONObject } from './json/object'; | ||
|
||
export type JSONAPIMetaObject = JSONAPIObject; | ||
export type JSONAPIMetaObject = JSONObject; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import type { JSONAPIResourceIdentifierObject } from "./resourceIdentifierObject"; | ||
import type { JSONAPILinksObject } from "./linksObject"; | ||
import type { JSONAPIMetaObject } from "./metaObject"; | ||
import type { JSONAPIObject } from "./object"; | ||
import type { JSONObject } from "./json/object"; | ||
import type { Satisfies } from "./helpers/satisfies"; | ||
|
||
export type JSONAPIRelationshipObject = Satisfies<{ | ||
data: JSONAPIResourceIdentifierObject; | ||
links?: JSONAPILinksObject; | ||
meta?: JSONAPIMetaObject; | ||
}, JSONAPIObject>; | ||
}, JSONObject>; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import type { JSONAPIObject } from "./object"; | ||
import type { JSONObject } from "./json/object"; | ||
import type { Satisfies } from "./helpers/satisfies"; | ||
import type { JSONAPIRelationshipObject } from "./relationshipObject"; | ||
|
||
export type JSONAPIRelationshipsObject = Satisfies<{ [key: string]: JSONAPIRelationshipObject }, JSONAPIObject>; | ||
export type JSONAPIRelationshipsObject = Satisfies<{ [key: string]: JSONAPIRelationshipObject }, JSONObject>; |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import type { JSONAPIObject } from "./object"; | ||
import type { JSONObject } from "./json/object"; | ||
import type { Satisfies } from "./helpers/satisfies"; | ||
|
||
export type JSONAPIResourceIdentifierObject = Satisfies<{ | ||
type: string; | ||
} & ( | ||
{ id: string } | ||
| { lid: string } | ||
), JSONAPIObject>; | ||
), JSONObject>; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,25 @@ | ||
import type { JSONAPIErrorObject } from "./errorObject"; | ||
import type { JSONAPILinksObject } from "./linksObject"; | ||
import type { JSONAPIMetaObject } from "./metaObject"; | ||
import type { JSONAPIObject } from "./object"; | ||
import type { JSONObject } from "./json/object"; | ||
import type { JSONAPIResourceObject } from "./resourceObject" | ||
import type { JSONAPILinkObject } from "./linkObject"; | ||
import type { JSONAPIPaginationLinks } from "./paginationLinks"; | ||
import type { JSONAPIResourceIdentifierObject } from "./resourceIdentifierObject"; | ||
import type { Satisfies } from "./helpers/satisfies"; | ||
import type { JSONAPIObject } from "./jsonApiObject"; | ||
|
||
export type JSONAPITopLevelObject = Satisfies<({ | ||
data: JSONAPIResourceObject | JSONAPIResourceObject[] | JSONAPIResourceIdentifierObject | JSONAPIResourceIdentifierObject[] | null; | ||
included?: JSONAPIResourceObject[]; | ||
} | { | ||
errors: JSONAPIErrorObject[]; | ||
}) & { | ||
jsonapi?: { | ||
verison?: string; | ||
ext?: string[]; | ||
profile?: string[]; | ||
}, | ||
jsonapi?: JSONAPIObject, | ||
meta?: JSONAPIMetaObject; | ||
links?: JSONAPILinksObject & { | ||
self?: JSONAPILinkObject; | ||
related?: JSONAPILinkObject; | ||
describedby?: JSONAPILinkObject; | ||
} & JSONAPIPaginationLinks; | ||
}, JSONAPIObject>; | ||
}, JSONObject>; |