Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
feat: image hotspot and crop types (#29)
Browse files Browse the repository at this point in the history
* feat: image hotspot and crop types

* bump version

* fix bug in generate types

* update snapshot
  • Loading branch information
ricokahler authored Dec 18, 2020
1 parent b3982c0 commit 7ce9093
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 31 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sanity-codegen",
"version": "0.4.0",
"version": "0.5.0",
"private": true,
"description": "",
"repository": {
Expand Down
92 changes: 66 additions & 26 deletions src/generate-types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,23 @@ describe('generate-types', () => {
SanityAsset,
SanityImage,
SanityFile,
SanitySlug,
SanityGeoPoint,
SanityBlock,
SanityDocument,
SanityImageCrop,
SanityImageHotspot,
} from \\"sanity-codegen\\";
export type {
SanityReference,
SanityAsset,
SanityImage,
SanityFile,
SanitySlug,
SanityGeoPoint,
SanityBlock,
SanityDocument,
SanityImageCrop,
SanityImageHotspot,
};
/**
Expand All @@ -96,7 +98,12 @@ describe('generate-types', () => {
*
*
*/
image?: { _type: \\"image\\"; asset: SanityAsset };
image?: {
_type: \\"image\\";
asset: SanityAsset;
crop?: SanityImageCrop;
hotspot?: SanityImageHotspot;
};
/**
* boolean — \`boolean\`
Expand Down Expand Up @@ -159,7 +166,12 @@ describe('generate-types', () => {
*
*
*/
image?: { _type: \\"image\\"; asset: SanityAsset };
image?: {
_type: \\"image\\";
asset: SanityAsset;
crop?: SanityImageCrop;
hotspot?: SanityImageHotspot;
};
/**
* file — \`file\`
Expand Down Expand Up @@ -210,21 +222,23 @@ describe('generate-types', () => {
SanityAsset,
SanityImage,
SanityFile,
SanitySlug,
SanityGeoPoint,
SanityBlock,
SanityDocument,
SanityImageCrop,
SanityImageHotspot,
} from \\"sanity-codegen\\";
export type {
SanityReference,
SanityAsset,
SanityImage,
SanityFile,
SanitySlug,
SanityGeoPoint,
SanityBlock,
SanityDocument,
SanityImageCrop,
SanityImageHotspot,
};
/**
Expand Down Expand Up @@ -271,21 +285,23 @@ describe('generate-types', () => {
SanityAsset,
SanityImage,
SanityFile,
SanitySlug,
SanityGeoPoint,
SanityBlock,
SanityDocument,
SanityImageCrop,
SanityImageHotspot,
} from \\"sanity-codegen\\";
export type {
SanityReference,
SanityAsset,
SanityImage,
SanityFile,
SanitySlug,
SanityGeoPoint,
SanityBlock,
SanityDocument,
SanityImageCrop,
SanityImageHotspot,
};
/**
Expand Down Expand Up @@ -356,21 +372,23 @@ describe('generate-types', () => {
SanityAsset,
SanityImage,
SanityFile,
SanitySlug,
SanityGeoPoint,
SanityBlock,
SanityDocument,
SanityImageCrop,
SanityImageHotspot,
} from \\"sanity-codegen\\";
export type {
SanityReference,
SanityAsset,
SanityImage,
SanityFile,
SanitySlug,
SanityGeoPoint,
SanityBlock,
SanityDocument,
SanityImageCrop,
SanityImageHotspot,
};
export type Foo = {
Expand Down Expand Up @@ -467,26 +485,31 @@ describe('generate-types', () => {
SanityAsset,
SanityImage,
SanityFile,
SanitySlug,
SanityGeoPoint,
SanityBlock,
SanityDocument,
SanityImageCrop,
SanityImageHotspot,
} from \\"sanity-codegen\\";
export type {
SanityReference,
SanityAsset,
SanityImage,
SanityFile,
SanitySlug,
SanityGeoPoint,
SanityBlock,
SanityDocument,
SanityImageCrop,
SanityImageHotspot,
};
export type Foo = {
_type: \\"foo\\";
asset: SanityAsset;
crop?: SanityImageCrop;
hotspot?: SanityImageHotspot;
/**
* Title — \`string\`
*
Expand All @@ -505,6 +528,9 @@ describe('generate-types', () => {
nestedImage?: {
_type: \\"nestedImage\\";
asset: SanityAsset;
crop?: SanityImageCrop;
hotspot?: SanityImageHotspot;
/**
* Description — \`string\`
*
Expand Down Expand Up @@ -592,21 +618,23 @@ describe('generate-types', () => {
SanityAsset,
SanityImage,
SanityFile,
SanitySlug,
SanityGeoPoint,
SanityBlock,
SanityDocument,
SanityImageCrop,
SanityImageHotspot,
} from \\"sanity-codegen\\";
export type {
SanityReference,
SanityAsset,
SanityImage,
SanityFile,
SanitySlug,
SanityGeoPoint,
SanityBlock,
SanityDocument,
SanityImageCrop,
SanityImageHotspot,
};
/**
Expand Down Expand Up @@ -683,21 +711,23 @@ describe('generate-types', () => {
SanityAsset,
SanityImage,
SanityFile,
SanitySlug,
SanityGeoPoint,
SanityBlock,
SanityDocument,
SanityImageCrop,
SanityImageHotspot,
} from \\"sanity-codegen\\";
export type {
SanityReference,
SanityAsset,
SanityImage,
SanityFile,
SanitySlug,
SanityGeoPoint,
SanityBlock,
SanityDocument,
SanityImageCrop,
SanityImageHotspot,
};
export type FooSlug = { _type: \\"fooSlug\\"; current: string };
Expand Down Expand Up @@ -750,21 +780,23 @@ describe('generate-types', () => {
SanityAsset,
SanityImage,
SanityFile,
SanitySlug,
SanityGeoPoint,
SanityBlock,
SanityDocument,
SanityImageCrop,
SanityImageHotspot,
} from \\"sanity-codegen\\";
export type {
SanityReference,
SanityAsset,
SanityImage,
SanityFile,
SanitySlug,
SanityGeoPoint,
SanityBlock,
SanityDocument,
SanityImageCrop,
SanityImageHotspot,
};
/**
Expand Down Expand Up @@ -828,21 +860,23 @@ describe('generate-types', () => {
SanityAsset,
SanityImage,
SanityFile,
SanitySlug,
SanityGeoPoint,
SanityBlock,
SanityDocument,
SanityImageCrop,
SanityImageHotspot,
} from \\"sanity-codegen\\";
export type {
SanityReference,
SanityAsset,
SanityImage,
SanityFile,
SanitySlug,
SanityGeoPoint,
SanityBlock,
SanityDocument,
SanityImageCrop,
SanityImageHotspot,
};
/**
Expand Down Expand Up @@ -912,21 +946,23 @@ describe('generate-types', () => {
SanityAsset,
SanityImage,
SanityFile,
SanitySlug,
SanityGeoPoint,
SanityBlock,
SanityDocument,
SanityImageCrop,
SanityImageHotspot,
} from \\"sanity-codegen\\";
export type {
SanityReference,
SanityAsset,
SanityImage,
SanityFile,
SanitySlug,
SanityGeoPoint,
SanityBlock,
SanityDocument,
SanityImageCrop,
SanityImageHotspot,
};
/**
Expand Down Expand Up @@ -1024,21 +1060,23 @@ describe('generate-types', () => {
SanityAsset,
SanityImage,
SanityFile,
SanitySlug,
SanityGeoPoint,
SanityBlock,
SanityDocument,
SanityImageCrop,
SanityImageHotspot,
} from \\"sanity-codegen\\";
export type {
SanityReference,
SanityAsset,
SanityImage,
SanityFile,
SanitySlug,
SanityGeoPoint,
SanityBlock,
SanityDocument,
SanityImageCrop,
SanityImageHotspot,
};
/**
Expand Down Expand Up @@ -1094,21 +1132,23 @@ describe('generate-types', () => {
SanityAsset,
SanityImage,
SanityFile,
SanitySlug,
SanityGeoPoint,
SanityBlock,
SanityDocument,
SanityImageCrop,
SanityImageHotspot,
} from \\"sanity-codegen\\";
export type {
SanityReference,
SanityAsset,
SanityImage,
SanityFile,
SanitySlug,
SanityGeoPoint,
SanityBlock,
SanityDocument,
SanityImageCrop,
SanityImageHotspot,
};
export type Foo = {
Expand Down
Loading

0 comments on commit 7ce9093

Please sign in to comment.