next-schema-buddy
Version:
A simple and lightweight Schema.org implementation for Next.js applications. Easily add structured data to your Next.js pages with type-safe components.
321 lines (296 loc) • 8.78 kB
TypeScript
import * as react_jsx_runtime from 'react/jsx-runtime';
interface BaseSchema {
"@context"?: "https://schema.org";
"@type": string;
"@id"?: string;
}
interface UseSchemaOptions {
id?: string;
space?: number;
}
declare const SchemaMarkup: () => react_jsx_runtime.JSX.Element | null;
interface ContactPointSchema extends BaseSchema {
"@type": "ContactPoint";
telephone?: string;
contactType?: string;
email?: string;
areaServed?: string | string[];
availableLanguage?: string | string[];
}
interface ImageObjectSchema extends BaseSchema {
"@type": "ImageObject";
url: string;
width?: number;
height?: number;
caption?: string;
}
interface PostalAddressSchema extends BaseSchema {
"@type": "PostalAddress";
streetAddress?: string;
addressLocality?: string;
addressRegion?: string;
postalCode?: string;
addressCountry?: string;
}
interface OrganizationSchema$1 extends BaseSchema {
"@type": "Organization";
name: string;
url: string;
logo?: ImageObjectSchema;
description?: string;
sameAs?: string[];
address?: PostalAddressSchema;
contactPoint?: ContactPointSchema;
}
interface OrganizationSchemaProps {
data: Omit<OrganizationSchema$1, "@context" | "@type">;
}
interface EntryPointSchema extends BaseSchema {
"@type": "EntryPoint";
urlTemplate: string;
}
interface SearchActionSchema extends BaseSchema {
"@type": "SearchAction";
target: string | EntryPointSchema;
"query-input": string;
}
interface WebsiteSchema$1 extends BaseSchema {
"@type": "WebSite";
name: string;
url: string;
description?: string;
image?: string;
publisher?: OrganizationSchema$1;
potentialAction?: SearchActionSchema | SearchActionSchema[];
sameAs?: string[];
}
interface WebsiteSchemaProps {
data: Omit<WebsiteSchema$1, "@context" | "@type">;
}
declare const WebsiteSchema: ({ data }: WebsiteSchemaProps) => null;
interface AggregateRatingSchema extends BaseSchema {
"@type": "AggregateRating";
ratingValue: number;
reviewCount: number;
bestRating?: number;
worstRating?: number;
}
interface OfferSchema extends BaseSchema {
"@type": "Offer";
price: number | string;
priceCurrency: string;
availability?: "InStock" | "OutOfStock" | "PreOrder";
url?: string;
itemCondition?: "NewCondition" | "UsedCondition" | "RefurbishedCondition";
validFrom?: string;
priceValidUntil?: string;
}
interface AuthorSchema extends BaseSchema {
"@type": "Person" | "Organization";
name: string;
url?: string;
image?: string;
}
interface ReviewRatingSchema extends BaseSchema {
"@type": "Rating";
ratingValue: number;
bestRating?: number;
worstRating?: number;
ratingCount?: number;
}
interface ReviewItemSchema extends BaseSchema {
"@type": string;
name: string;
image?: string | {
"@type": "ImageObject";
url: string;
width?: number;
height?: number;
};
description?: string;
sku?: string;
brand?: {
"@type": "Brand" | "Organization";
name: string;
};
offers?: {
"@type": "Offer";
price: number;
priceCurrency: string;
availability?: "InStock" | "OutOfStock" | "PreOrder";
};
}
interface ReviewSchema extends BaseSchema {
"@type": "Review";
name?: string;
reviewBody: string;
abstract?: string;
author: AuthorSchema;
datePublished: string;
dateModified?: string;
reviewRating: ReviewRatingSchema;
itemReviewed: ReviewItemSchema;
publisher?: {
"@type": "Organization";
name: string;
logo?: {
"@type": "ImageObject";
url: string;
};
};
url?: string;
inLanguage?: string;
keywords?: string[];
pros?: string[];
cons?: string[];
positiveNotes?: string[];
negativeNotes?: string[];
isAccessibleForFree?: boolean;
awards?: string[];
sameAs?: string[];
}
interface ProductSchema$1 extends BaseSchema {
"@type": "Product";
name: string;
description?: string;
image?: string | ImageObjectSchema | (string | ImageObjectSchema)[];
brand?: string | OrganizationSchema$1;
offers?: OfferSchema | OfferSchema[];
sku?: string;
gtin?: string;
gtin8?: string;
gtin13?: string;
gtin14?: string;
mpn?: string;
aggregateRating?: AggregateRatingSchema;
review?: ReviewSchema | ReviewSchema[];
manufacturer?: OrganizationSchema$1;
category?: string;
model?: string;
}
interface ProductSchemaProps {
data: Omit<ProductSchema$1, "@context" | "@type">;
}
declare const ProductSchema: ({ data }: ProductSchemaProps) => null;
declare const OrganizationSchema: ({ data }: OrganizationSchemaProps) => null;
interface GeoCoordinates extends BaseSchema {
"@type": "GeoCoordinates";
latitude: number;
longitude: number;
}
interface OpeningHoursSpecification extends BaseSchema {
"@type": "OpeningHoursSpecification";
dayOfWeek: string | string[];
opens: string;
closes: string;
validFrom?: string;
validThrough?: string;
}
interface LocalBusinessSchema$1 extends BaseSchema {
"@type": "LocalBusiness" | "Restaurant" | "Store" | "Bakery" | "BarOrPub" | "BeautySalon" | "BookStore" | "CafeOrCoffeeShop" | "ClothingStore" | "GroceryStore" | "Hotel" | "MovieTheater" | "ShoppingCenter";
name: string;
image?: string | string[];
"@id"?: string;
url?: string;
telephone?: string;
email?: string;
description?: string;
address: {
"@type": "PostalAddress";
streetAddress: string;
addressLocality: string;
addressRegion?: string;
postalCode: string;
addressCountry: string;
};
geo?: GeoCoordinates;
openingHoursSpecification?: OpeningHoursSpecification[];
priceRange?: string;
currencyAccepted?: string;
paymentAccepted?: string[];
areaServed?: string | string[];
hasMap?: string;
sameAs?: string[];
logo?: {
"@type": "ImageObject";
url: string;
width?: number;
height?: number;
};
aggregateRating?: {
"@type": "AggregateRating";
ratingValue: number;
reviewCount: number;
bestRating?: number;
worstRating?: number;
};
}
interface LocalBusinessSchemaProps {
data: Omit<LocalBusinessSchema$1, "@context" | "@type"> & {
"@type"?: LocalBusinessSchema$1["@type"];
};
}
declare const LocalBusinessSchema: ({ data }: LocalBusinessSchemaProps) => null;
interface PersonSchema extends BaseSchema {
"@type": "Person";
name: string;
}
type ArticleType = "Article" | "NewsArticle" | "BlogPosting" | "TechArticle" | "ScholarlyArticle" | "Report" | "SocialMediaPosting";
interface ArticleSchema$1 extends BaseSchema {
"@type": ArticleType;
headline: string;
description?: string;
articleBody?: string;
image?: string | string[] | {
"@type": "ImageObject";
url: string;
width?: number;
height?: number;
caption?: string;
};
author: PersonSchema | PersonSchema[] | OrganizationSchema$1 | OrganizationSchema$1[];
publisher: OrganizationSchema$1;
datePublished: string;
dateModified?: string;
url?: string;
mainEntityOfPage?: string;
keywords?: string | string[];
articleSection?: string;
wordCount?: number;
inLanguage?: string;
copyrightYear?: number;
copyrightHolder?: PersonSchema | OrganizationSchema$1;
dateline?: string;
printEdition?: string;
printColumn?: string;
printSection?: string;
printPage?: string;
isAccessibleForFree?: boolean;
alternativeHeadline?: string;
thumbnailUrl?: string;
speakable?: {
"@type": "SpeakableSpecification";
cssSelector?: string[];
xpath?: string[];
};
video?: {
"@type": "VideoObject";
name: string;
description?: string;
thumbnailUrl?: string;
uploadDate: string;
duration?: string;
contentUrl?: string;
embedUrl?: string;
}[];
}
interface ArticleSchemaProps {
data: Omit<ArticleSchema$1, "@context" | "@type"> & {
"@type"?: ArticleType;
};
}
declare const ArticleSchema: ({ data }: ArticleSchemaProps) => null;
interface SchemaRegistryOptions {
indentation?: number;
}
export { ArticleSchema, type ArticleSchemaProps, type BaseSchema, LocalBusinessSchema, type LocalBusinessSchemaProps, OrganizationSchema, type OrganizationSchemaProps, ProductSchema, type ProductSchemaProps, SchemaMarkup, type SchemaRegistryOptions, type UseSchemaOptions, WebsiteSchema, type WebsiteSchemaProps };