diff --git a/next-14/sanity.types.ts b/next-14/sanity.types.ts index 4592747..42c72e4 100644 --- a/next-14/sanity.types.ts +++ b/next-14/sanity.types.ts @@ -1,3 +1,6 @@ +// Query TypeMap +import '@sanity/client' + /** * --------------------------------------------------------------------------------- * This file has been generated by Sanity TypeGen. @@ -166,3 +169,33 @@ export type AllSanitySchemaTypes = | Slug | Theme export declare const internalGroqTypeReferenceTo: unique symbol +// Source: ./src/app/layout.tsx +// Variable: THEME_QUERY +// Query: *[_id == "theme"][0]{background,text,"fetchedAt": dateTime(now())} +export type THEME_QUERYResult = + | { + background: null + text: null + fetchedAt: string | null + } + | { + background: string | null + text: string | null + fetchedAt: string | null + } + | null + +// Source: ./src/app/page.tsx +// Variable: DEMO_QUERY +// Query: *[_type == "demo" && slug.current == $slug][0]{title,"fetchedAt": dateTime(now())} +export type DEMO_QUERYResult = { + title: string | null + fetchedAt: string | null +} | null + +declare module '@sanity/client' { + interface SanityQueries { + '*[_id == "theme"][0]{background,text,"fetchedAt": dateTime(now())}': THEME_QUERYResult + '*[_type == "demo" && slug.current == $slug][0]{title,"fetchedAt": dateTime(now())}': DEMO_QUERYResult + } +}