Skip to content

Commit 606a39e

Browse files
chore(prettier): 🤖 ✨ (#132)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 610cf05 commit 606a39e

File tree

1 file changed

+151
-89
lines changed

1 file changed

+151
-89
lines changed

‎frontend/sanity.types.ts‎

Lines changed: 151 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,14 @@ export type Page = {
176176
slug: Slug;
177177
heading: string;
178178
subheading?: string;
179-
pageBuilder?: Array<{
180-
_key: string;
181-
} & CallToAction | {
182-
_key: string;
183-
} & InfoSection>;
179+
pageBuilder?: Array<
180+
| ({
181+
_key: string;
182+
} & CallToAction)
183+
| ({
184+
_key: string;
185+
} & InfoSection)
186+
>;
184187
};
185188

186189
export type Post = {
@@ -249,17 +252,21 @@ export type SanityAssistInstructionTask = {
249252

250253
export type SanityAssistTaskStatus = {
251254
_type: "sanity.assist.task.status";
252-
tasks?: Array<{
253-
_key: string;
254-
} & SanityAssistInstructionTask>;
255+
tasks?: Array<
256+
{
257+
_key: string;
258+
} & SanityAssistInstructionTask
259+
>;
255260
};
256261

257262
export type SanityAssistSchemaTypeAnnotations = {
258263
_type: "sanity.assist.schemaType.annotations";
259264
title?: string;
260-
fields?: Array<{
261-
_key: string;
262-
} & SanityAssistSchemaTypeField>;
265+
fields?: Array<
266+
{
267+
_key: string;
268+
} & SanityAssistSchemaTypeField
269+
>;
263270
};
264271

265272
export type SanityAssistOutputType = {
@@ -312,18 +319,23 @@ export type SanityAssistInstructionUserInput = {
312319
};
313320

314321
export type SanityAssistInstructionPrompt = Array<{
315-
children?: Array<{
316-
marks?: Array<string>;
317-
text?: string;
318-
_type: "span";
319-
_key: string;
320-
} | {
321-
_key: string;
322-
} & SanityAssistInstructionFieldRef | {
323-
_key: string;
324-
} & SanityAssistInstructionContext | {
325-
_key: string;
326-
} & SanityAssistInstructionUserInput>;
322+
children?: Array<
323+
| {
324+
marks?: Array<string>;
325+
text?: string;
326+
_type: "span";
327+
_key: string;
328+
}
329+
| ({
330+
_key: string;
331+
} & SanityAssistInstructionFieldRef)
332+
| ({
333+
_key: string;
334+
} & SanityAssistInstructionContext)
335+
| ({
336+
_key: string;
337+
} & SanityAssistInstructionUserInput)
338+
>;
327339
style?: "normal";
328340
listItem?: never;
329341
markDefs?: null;
@@ -344,19 +356,24 @@ export type SanityAssistInstruction = {
344356
title?: string;
345357
userId?: string;
346358
createdById?: string;
347-
output?: Array<{
348-
_key: string;
349-
} & SanityAssistOutputField | {
350-
_key: string;
351-
} & SanityAssistOutputType>;
359+
output?: Array<
360+
| ({
361+
_key: string;
362+
} & SanityAssistOutputField)
363+
| ({
364+
_key: string;
365+
} & SanityAssistOutputType)
366+
>;
352367
};
353368

354369
export type SanityAssistSchemaTypeField = {
355370
_type: "sanity.assist.schemaType.field";
356371
path?: string;
357-
instructions?: Array<{
358-
_key: string;
359-
} & SanityAssistInstruction>;
372+
instructions?: Array<
373+
{
374+
_key: string;
375+
} & SanityAssistInstruction
376+
>;
360377
};
361378

362379
export type SanityImagePaletteSwatch = {
@@ -477,7 +494,38 @@ export type SanityAssetSourceData = {
477494
url?: string;
478495
};
479496

480-
export type AllSanitySchemaTypes = CallToAction | Link | InfoSection | BlockContent | Settings | Page | Post | Person | SanityAssistInstructionTask | SanityAssistTaskStatus | SanityAssistSchemaTypeAnnotations | SanityAssistOutputType | SanityAssistOutputField | SanityAssistInstructionContext | AssistInstructionContext | SanityAssistInstructionUserInput | SanityAssistInstructionPrompt | SanityAssistInstructionFieldRef | SanityAssistInstruction | SanityAssistSchemaTypeField | SanityImagePaletteSwatch | SanityImagePalette | SanityImageDimensions | SanityImageHotspot | SanityImageCrop | SanityFileAsset | SanityImageAsset | SanityImageMetadata | Geopoint | Slug | SanityAssetSourceData;
497+
export type AllSanitySchemaTypes =
498+
| CallToAction
499+
| Link
500+
| InfoSection
501+
| BlockContent
502+
| Settings
503+
| Page
504+
| Post
505+
| Person
506+
| SanityAssistInstructionTask
507+
| SanityAssistTaskStatus
508+
| SanityAssistSchemaTypeAnnotations
509+
| SanityAssistOutputType
510+
| SanityAssistOutputField
511+
| SanityAssistInstructionContext
512+
| AssistInstructionContext
513+
| SanityAssistInstructionUserInput
514+
| SanityAssistInstructionPrompt
515+
| SanityAssistInstructionFieldRef
516+
| SanityAssistInstruction
517+
| SanityAssistSchemaTypeField
518+
| SanityImagePaletteSwatch
519+
| SanityImagePalette
520+
| SanityImageDimensions
521+
| SanityImageHotspot
522+
| SanityImageCrop
523+
| SanityFileAsset
524+
| SanityImageAsset
525+
| SanityImageMetadata
526+
| Geopoint
527+
| Slug
528+
| SanityAssetSourceData;
481529
export declare const internalGroqTypeReferenceTo: unique symbol;
482530
// Source: ./sanity/lib/queries.ts
483531
// Variable: settingsQuery
@@ -545,60 +593,74 @@ export type GetPageQueryResult = {
545593
slug: Slug;
546594
heading: string;
547595
subheading: string | null;
548-
pageBuilder: Array<{
549-
_key: string;
550-
_type: "callToAction";
551-
heading: string;
552-
text?: string;
553-
buttonText?: string;
554-
link: {
555-
_type: "link";
556-
linkType?: "href" | "page" | "post";
557-
href?: string;
558-
page: string | null;
559-
post: string | null;
560-
openInNewTab?: boolean;
561-
} | null;
562-
} | {
563-
_key: string;
564-
_type: "infoSection";
565-
heading?: string;
566-
subheading?: string;
567-
content: Array<{
568-
children?: Array<{
569-
marks?: Array<string>;
570-
text?: string;
571-
_type: "span";
596+
pageBuilder: Array<
597+
| {
572598
_key: string;
573-
}>;
574-
style?: "blockquote" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "normal";
575-
listItem?: "bullet" | "number";
576-
markDefs: Array<{
577-
linkType?: "href" | "page" | "post";
578-
href?: string;
579-
page: string | null;
580-
post: string | null;
581-
openInNewTab?: boolean;
582-
_type: "link";
599+
_type: "callToAction";
600+
heading: string;
601+
text?: string;
602+
buttonText?: string;
603+
link: {
604+
_type: "link";
605+
linkType?: "href" | "page" | "post";
606+
href?: string;
607+
page: string | null;
608+
post: string | null;
609+
openInNewTab?: boolean;
610+
} | null;
611+
}
612+
| {
583613
_key: string;
584-
}> | null;
585-
level?: number;
586-
_type: "block";
587-
_key: string;
588-
}> | null;
589-
}> | null;
614+
_type: "infoSection";
615+
heading?: string;
616+
subheading?: string;
617+
content: Array<{
618+
children?: Array<{
619+
marks?: Array<string>;
620+
text?: string;
621+
_type: "span";
622+
_key: string;
623+
}>;
624+
style?:
625+
| "blockquote"
626+
| "h1"
627+
| "h2"
628+
| "h3"
629+
| "h4"
630+
| "h5"
631+
| "h6"
632+
| "normal";
633+
listItem?: "bullet" | "number";
634+
markDefs: Array<{
635+
linkType?: "href" | "page" | "post";
636+
href?: string;
637+
page: string | null;
638+
post: string | null;
639+
openInNewTab?: boolean;
640+
_type: "link";
641+
_key: string;
642+
}> | null;
643+
level?: number;
644+
_type: "block";
645+
_key: string;
646+
}> | null;
647+
}
648+
> | null;
590649
} | null;
591650
// Variable: sitemapData
592651
// Query: *[_type == "page" || _type == "post" && defined(slug.current)] | order(_type asc) { "slug": slug.current, _type, _updatedAt, }
593-
export type SitemapDataResult = Array<{
594-
slug: string;
595-
_type: "page";
596-
_updatedAt: string;
597-
} | {
598-
slug: string;
599-
_type: "post";
600-
_updatedAt: string;
601-
}>;
652+
export type SitemapDataResult = Array<
653+
| {
654+
slug: string;
655+
_type: "page";
656+
_updatedAt: string;
657+
}
658+
| {
659+
slug: string;
660+
_type: "post";
661+
_updatedAt: string;
662+
}
663+
>;
602664
// Variable: allPostsQuery
603665
// Query: *[_type == "post" && defined(slug.current)] | order(date desc, _updatedAt desc) { _id, "status": select(_originalId in path("drafts.**") => "draft", "published"), "title": coalesce(title, "Untitled"), "slug": slug.current, excerpt, coverImage, "date": coalesce(date, _updatedAt), "author": author->{firstName, lastName, picture}, }
604666
export type AllPostsQueryResult = Array<{
@@ -756,13 +818,13 @@ export type PagesSlugsResult = Array<{
756818
import "@sanity/client";
757819
declare module "@sanity/client" {
758820
interface SanityQueries {
759-
"*[_type == \"settings\"][0]": SettingsQueryResult;
760-
"\n *[_type == 'page' && slug.current == $slug][0]{\n _id,\n _type,\n name,\n slug,\n heading,\n subheading,\n \"pageBuilder\": pageBuilder[]{\n ...,\n _type == \"callToAction\" => {\n \n link {\n ...,\n \n _type == \"link\" => {\n \"page\": page->slug.current,\n \"post\": post->slug.current\n }\n\n }\n,\n },\n _type == \"infoSection\" => {\n content[]{\n ...,\n markDefs[]{\n ...,\n \n _type == \"link\" => {\n \"page\": page->slug.current,\n \"post\": post->slug.current\n }\n\n }\n }\n },\n },\n }\n": GetPageQueryResult;
761-
"\n *[_type == \"page\" || _type == \"post\" && defined(slug.current)] | order(_type asc) {\n \"slug\": slug.current,\n _type,\n _updatedAt,\n }\n": SitemapDataResult;
762-
"\n *[_type == \"post\" && defined(slug.current)] | order(date desc, _updatedAt desc) {\n \n _id,\n \"status\": select(_originalId in path(\"drafts.**\") => \"draft\", \"published\"),\n \"title\": coalesce(title, \"Untitled\"),\n \"slug\": slug.current,\n excerpt,\n coverImage,\n \"date\": coalesce(date, _updatedAt),\n \"author\": author->{firstName, lastName, picture},\n\n }\n": AllPostsQueryResult;
763-
"\n *[_type == \"post\" && _id != $skip && defined(slug.current)] | order(date desc, _updatedAt desc) [0...$limit] {\n \n _id,\n \"status\": select(_originalId in path(\"drafts.**\") => \"draft\", \"published\"),\n \"title\": coalesce(title, \"Untitled\"),\n \"slug\": slug.current,\n excerpt,\n coverImage,\n \"date\": coalesce(date, _updatedAt),\n \"author\": author->{firstName, lastName, picture},\n\n }\n": MorePostsQueryResult;
764-
"\n *[_type == \"post\" && slug.current == $slug] [0] {\n content[]{\n ...,\n markDefs[]{\n ...,\n \n _type == \"link\" => {\n \"page\": page->slug.current,\n \"post\": post->slug.current\n }\n\n }\n },\n \n _id,\n \"status\": select(_originalId in path(\"drafts.**\") => \"draft\", \"published\"),\n \"title\": coalesce(title, \"Untitled\"),\n \"slug\": slug.current,\n excerpt,\n coverImage,\n \"date\": coalesce(date, _updatedAt),\n \"author\": author->{firstName, lastName, picture},\n\n }\n": PostQueryResult;
765-
"\n *[_type == \"post\" && defined(slug.current)]\n {\"slug\": slug.current}\n": PostPagesSlugsResult;
766-
"\n *[_type == \"page\" && defined(slug.current)]\n {\"slug\": slug.current}\n": PagesSlugsResult;
821+
'*[_type == "settings"][0]': SettingsQueryResult;
822+
'\n *[_type == \'page\' && slug.current == $slug][0]{\n _id,\n _type,\n name,\n slug,\n heading,\n subheading,\n "pageBuilder": pageBuilder[]{\n ...,\n _type == "callToAction" => {\n \n link {\n ...,\n \n _type == "link" => {\n "page": page->slug.current,\n "post": post->slug.current\n }\n\n }\n,\n },\n _type == "infoSection" => {\n content[]{\n ...,\n markDefs[]{\n ...,\n \n _type == "link" => {\n "page": page->slug.current,\n "post": post->slug.current\n }\n\n }\n }\n },\n },\n }\n': GetPageQueryResult;
823+
'\n *[_type == "page" || _type == "post" && defined(slug.current)] | order(_type asc) {\n "slug": slug.current,\n _type,\n _updatedAt,\n }\n': SitemapDataResult;
824+
'\n *[_type == "post" && defined(slug.current)] | order(date desc, _updatedAt desc) {\n \n _id,\n "status": select(_originalId in path("drafts.**") => "draft", "published"),\n "title": coalesce(title, "Untitled"),\n "slug": slug.current,\n excerpt,\n coverImage,\n "date": coalesce(date, _updatedAt),\n "author": author->{firstName, lastName, picture},\n\n }\n': AllPostsQueryResult;
825+
'\n *[_type == "post" && _id != $skip && defined(slug.current)] | order(date desc, _updatedAt desc) [0...$limit] {\n \n _id,\n "status": select(_originalId in path("drafts.**") => "draft", "published"),\n "title": coalesce(title, "Untitled"),\n "slug": slug.current,\n excerpt,\n coverImage,\n "date": coalesce(date, _updatedAt),\n "author": author->{firstName, lastName, picture},\n\n }\n': MorePostsQueryResult;
826+
'\n *[_type == "post" && slug.current == $slug] [0] {\n content[]{\n ...,\n markDefs[]{\n ...,\n \n _type == "link" => {\n "page": page->slug.current,\n "post": post->slug.current\n }\n\n }\n },\n \n _id,\n "status": select(_originalId in path("drafts.**") => "draft", "published"),\n "title": coalesce(title, "Untitled"),\n "slug": slug.current,\n excerpt,\n coverImage,\n "date": coalesce(date, _updatedAt),\n "author": author->{firstName, lastName, picture},\n\n }\n': PostQueryResult;
827+
'\n *[_type == "post" && defined(slug.current)]\n {"slug": slug.current}\n': PostPagesSlugsResult;
828+
'\n *[_type == "page" && defined(slug.current)]\n {"slug": slug.current}\n': PagesSlugsResult;
767829
}
768830
}

0 commit comments

Comments
 (0)