@prismicio/types
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -5,2 +5,16 @@ # Changelog | ||
### [0.0.5](https://github.com/prismicio/prismic-types/compare/v0.0.4...v0.0.5) (2021-05-18) | ||
### Features | ||
* use less strict type for link types ([6365216](https://github.com/prismicio/prismic-types/commit/636521654d5e0de06c35026c4c9f8f1edf86412c)) | ||
### Chore | ||
* **config:** run lcov reporter for codecov collection ([6760c57](https://github.com/prismicio/prismic-types/commit/6760c57cda9d9682a27fcf2b887ddc91fea8facc)) | ||
* **config:** setup tests ([b0942e9](https://github.com/prismicio/prismic-types/commit/b0942e932c78f3ed528ed46b766e406df051015f)) | ||
* **config:** update coverage reporters ([3d456c3](https://github.com/prismicio/prismic-types/commit/3d456c30895d4bbb8e05dee78a7501929f3f33e2)) | ||
### [0.0.4](https://github.com/prismicio/prismic-types/compare/v0.0.3...v0.0.4) (2021-05-17) | ||
@@ -7,0 +21,0 @@ |
@@ -9,10 +9,10 @@ declare enum LinkType { | ||
interface FilledMinimalLinkToDocumentField { | ||
_linkType: LinkType.Document; | ||
_linkType: "Link.document"; | ||
} | ||
interface FilledMinimalLinkToWebField { | ||
_linkType: LinkType.Web; | ||
_linkType: "Link.web"; | ||
url: string; | ||
} | ||
interface FilledMinimalLinkToMediaField { | ||
_linkType: LinkType.Image | LinkType.File; | ||
_linkType: "Link.file" | "Link.image"; | ||
url: string; | ||
@@ -19,0 +19,0 @@ } |
@@ -9,10 +9,10 @@ declare enum LinkType { | ||
interface FilledMinimalLinkToDocumentField { | ||
_linkType: LinkType.Document; | ||
_linkType: "Link.document"; | ||
} | ||
interface FilledMinimalLinkToWebField { | ||
_linkType: LinkType.Web; | ||
_linkType: "Link.web"; | ||
url: string; | ||
} | ||
interface FilledMinimalLinkToMediaField { | ||
_linkType: LinkType.Image | LinkType.File; | ||
_linkType: "Link.file" | "Link.image"; | ||
url: string; | ||
@@ -19,0 +19,0 @@ } |
@@ -33,7 +33,8 @@ declare type EmptyObjectField = { | ||
} | ||
declare type EmptyLinkField<Type extends LinkType = LinkType> = { | ||
declare type _LinkType = "Any" | "Document" | "Media" | "Web"; | ||
declare type EmptyLinkField<Type extends _LinkType = "Any"> = { | ||
link_type: Type; | ||
}; | ||
interface FilledLinkToDocumentField<TypeEnum = string, LangEnum = string> { | ||
link_type: LinkType.Document; | ||
link_type: "Document"; | ||
id: string; | ||
@@ -49,3 +50,3 @@ uid?: string; | ||
interface FilledLinkToWebField { | ||
link_type: LinkType.Web; | ||
link_type: "Web"; | ||
url: string; | ||
@@ -55,3 +56,3 @@ target?: string; | ||
interface FilledLinkToMediaField { | ||
link_type: LinkType.Media; | ||
link_type: "Media"; | ||
name: string; | ||
@@ -64,5 +65,5 @@ kind: string; | ||
} | ||
declare type RelationField<TypeEnum = string, LangEnum = string> = FilledLinkToDocumentField<TypeEnum, LangEnum> | EmptyLinkField<LinkType.Document>; | ||
declare type LinkField<TypeEnum = string, LangEnum = string> = FilledLinkToDocumentField<TypeEnum, LangEnum> | FilledLinkToWebField | FilledLinkToMediaField | EmptyLinkField<LinkType.Any>; | ||
declare type LinkToMediaField = FilledLinkToMediaField | EmptyLinkField<LinkType.Media>; | ||
declare type RelationField<TypeEnum = string, LangEnum = string> = FilledLinkToDocumentField<TypeEnum, LangEnum> | EmptyLinkField<"Document">; | ||
declare type LinkField<TypeEnum = string, LangEnum = string> = RelationField<TypeEnum, LangEnum> | FilledLinkToWebField | LinkToMediaField | EmptyLinkField<"Any">; | ||
declare type LinkToMediaField = FilledLinkToMediaField | EmptyLinkField<"Media">; | ||
declare type DateField = string | null; | ||
@@ -69,0 +70,0 @@ declare type TimestampField = string | null; |
{ | ||
"name": "@prismicio/types", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Type definitions for Prismic related structure", | ||
@@ -27,2 +27,6 @@ "keywords": [ | ||
}, | ||
"./dist/graphql": { | ||
"require": "./dist/graphql/index.js", | ||
"import": "./dist/graphql/index.es.js" | ||
}, | ||
"./package.json": "./package.json" | ||
@@ -44,13 +48,19 @@ }, | ||
"lint": "eslint --ext .js,.ts .", | ||
"test": "yarn lint" | ||
"unit": "nyc --reporter=lcovonly --reporter=text ava", | ||
"test": "yarn lint && yarn unit" | ||
}, | ||
"devDependencies": { | ||
"@typescript-eslint/eslint-plugin": "^4.23.0", | ||
"@typescript-eslint/parser": "^4.23.0", | ||
"@types/sinon": "^10.0.0", | ||
"@typescript-eslint/eslint-plugin": "^4.24.0", | ||
"@typescript-eslint/parser": "^4.24.0", | ||
"ava": "^3.15.0", | ||
"eslint": "^7.26.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-plugin-prettier": "^3.4.0", | ||
"nyc": "^15.1.0", | ||
"prettier": "^2.3.0", | ||
"siroc": "^0.10.0", | ||
"sinon": "^10.0.0", | ||
"siroc": "^0.10.1", | ||
"standard-version": "^9.3.0", | ||
"ts-eager": "2.0.2", | ||
"typescript": "^4.2.4" | ||
@@ -57,0 +67,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29673
230
14