/** Base type for all JSON-LD objects */ interface JsonLdBase { '@context'?: 'https://schema.org'; '@type': string; '@id'?: string; } /** A thing with a name and URL */ interface ThingBase extends JsonLdBase { name?: string; url?: string; description?: string; image?: string | ImageObject | Array; sameAs?: string | string[]; identifier?: string | { '@type': 'PropertyValue'; name: string; value: string; }; alternateName?: string | string[]; mainEntity?: JsonLdBase | JsonLdBase[]; potentialAction?: JsonLdBase | JsonLdBase[]; } interface ImageObject extends JsonLdBase { '@type': 'ImageObject'; url: string; width?: number | string; height?: number | string; caption?: string; } interface PersonSchema extends ThingBase { '@type': 'Person'; givenName?: string; familyName?: string; email?: string; jobTitle?: string; affiliation?: OrganizationSchema; } interface OrganizationSchema extends ThingBase { '@type': 'Organization'; logo?: string | ImageObject; contactPoint?: ContactPoint | ContactPoint[]; address?: PostalAddress; foundingDate?: string; numberOfEmployees?: number; areaServed?: string | string[]; foundingLocation?: PostalAddress | string; knowsAbout?: string | string[]; legalName?: string; parentOrganization?: OrganizationSchema; } interface ContactPoint extends JsonLdBase { '@type': 'ContactPoint'; telephone?: string; contactType?: string; email?: string; areaServed?: string | string[]; availableLanguage?: string | string[]; } interface PostalAddress extends JsonLdBase { '@type': 'PostalAddress'; streetAddress?: string; addressLocality?: string; addressRegion?: string; postalCode?: string; addressCountry?: string; } interface ArticleSchema extends ThingBase { '@type': 'Article' | 'BlogPosting' | 'NewsArticle' | 'TechArticle'; headline: string; author: PersonSchema | PersonSchema[] | OrganizationSchema | string; datePublished: string; dateModified?: string; publisher?: OrganizationSchema; mainEntityOfPage?: string | { '@type': 'WebPage'; '@id': string; }; articleBody?: string; articleSection?: string; wordCount?: number; keywords?: string | string[]; thumbnailUrl?: string; } interface ProductSchema extends ThingBase { '@type': 'Product'; brand?: OrganizationSchema | { '@type': 'Brand'; name: string; }; sku?: string; gtin?: string; gtin8?: string; gtin13?: string; gtin14?: string; mpn?: string; offers?: OfferSchema | OfferSchema[]; aggregateRating?: AggregateRatingSchema; review?: ReviewSchema | ReviewSchema[]; color?: string; material?: string; } interface OfferSchema extends JsonLdBase { '@type': 'Offer' | 'AggregateOffer'; price: number | string; priceCurrency: string; availability?: 'https://schema.org/InStock' | 'https://schema.org/OutOfStock' | 'https://schema.org/PreOrder' | 'https://schema.org/Discontinued' | string; priceValidUntil?: string; url?: string; seller?: OrganizationSchema; itemCondition?: string; lowPrice?: number | string; highPrice?: number | string; offerCount?: number; } interface AggregateRatingSchema extends JsonLdBase { '@type': 'AggregateRating'; ratingValue: number | string; reviewCount?: number; ratingCount?: number; bestRating?: number | string; worstRating?: number | string; } interface ReviewSchema extends JsonLdBase { '@type': 'Review'; author: PersonSchema | string; reviewRating?: RatingSchema; reviewBody?: string; datePublished?: string; name?: string; } interface RatingSchema extends JsonLdBase { '@type': 'Rating'; ratingValue: number | string; bestRating?: number | string; worstRating?: number | string; } interface FAQPageSchema extends JsonLdBase { '@type': 'FAQPage'; mainEntity: FAQQuestionSchema[]; } interface FAQQuestionSchema extends JsonLdBase { '@type': 'Question'; name: string; acceptedAnswer: { '@type': 'Answer'; text: string; }; } interface BreadcrumbListSchema extends JsonLdBase { '@type': 'BreadcrumbList'; itemListElement: BreadcrumbItem[]; } interface BreadcrumbItem extends JsonLdBase { '@type': 'ListItem'; position: number; name: string; item?: string; } interface LocalBusinessSchema extends ThingBase { '@type': 'LocalBusiness' | 'Restaurant' | 'Store' | 'MedicalBusiness' | string; address: PostalAddress; telephone?: string; openingHoursSpecification?: OpeningHours | OpeningHours[]; geo?: GeoCoordinates; priceRange?: string; servesCuisine?: string | string[]; menu?: string; hasMap?: string; aggregateRating?: AggregateRatingSchema; review?: ReviewSchema | ReviewSchema[]; } interface OpeningHours extends JsonLdBase { '@type': 'OpeningHoursSpecification'; dayOfWeek: string | string[]; opens: string; closes: string; } interface GeoCoordinates extends JsonLdBase { '@type': 'GeoCoordinates'; latitude: number; longitude: number; } interface EventSchema extends ThingBase { '@type': 'Event' | 'MusicEvent' | 'BusinessEvent' | 'EducationEvent' | string; startDate: string; endDate?: string; location: string | PostalAddress | { '@type': 'VirtualLocation'; url: string; }; organizer?: PersonSchema | OrganizationSchema; performer?: PersonSchema | PersonSchema[]; offers?: OfferSchema | OfferSchema[]; eventStatus?: string; eventAttendanceMode?: string; } interface RecipeSchema extends ThingBase { '@type': 'Recipe'; author: PersonSchema | string; datePublished?: string; prepTime?: string; cookTime?: string; totalTime?: string; recipeYield?: string; recipeCategory?: string; recipeCuisine?: string; recipeIngredient: string[]; recipeInstructions: HowToStep[] | string[]; nutrition?: NutritionInfo; aggregateRating?: AggregateRatingSchema; video?: VideoObjectSchema; keywords?: string; } interface NutritionInfo extends JsonLdBase { '@type': 'NutritionInformation'; calories?: string; fatContent?: string; carbohydrateContent?: string; proteinContent?: string; fiberContent?: string; sodiumContent?: string; sugarContent?: string; } interface HowToSchema extends ThingBase { '@type': 'HowTo'; step: HowToStep[]; totalTime?: string; estimatedCost?: string | MonetaryAmount; supply?: HowToSupply[]; tool?: HowToTool[]; } interface HowToStep extends JsonLdBase { '@type': 'HowToStep'; name?: string; text: string; url?: string; image?: string; } interface HowToSupply extends JsonLdBase { '@type': 'HowToSupply'; name: string; } interface HowToTool extends JsonLdBase { '@type': 'HowToTool'; name: string; } interface MonetaryAmount extends JsonLdBase { '@type': 'MonetaryAmount'; currency: string; value: number | string; } interface VideoObjectSchema extends ThingBase { '@type': 'VideoObject'; thumbnailUrl: string | string[]; uploadDate: string; duration?: string; contentUrl?: string; embedUrl?: string; interactionStatistic?: { '@type': 'InteractionCounter'; interactionType: { '@type': 'WatchAction'; }; userInteractionCount: number; }; } interface CourseSchema extends ThingBase { '@type': 'Course'; provider?: OrganizationSchema; offers?: OfferSchema | OfferSchema[]; hasCourseInstance?: CourseInstance | CourseInstance[]; coursePrerequisites?: string | string[]; educationalLevel?: string; } interface CourseInstance extends JsonLdBase { '@type': 'CourseInstance'; courseMode?: string; instructor?: PersonSchema; startDate?: string; endDate?: string; } interface JobPostingSchema extends ThingBase { '@type': 'JobPosting'; title: string; datePosted: string; validThrough?: string; hiringOrganization: OrganizationSchema; jobLocation?: PostalAddress | PostalAddress[]; baseSalary?: MonetaryAmount | { '@type': 'MonetaryAmount'; currency: string; value: { '@type': 'QuantitativeValue'; value?: number; minValue?: number; maxValue?: number; unitText?: string; }; }; employmentType?: string | string[]; jobLocationType?: string; applicantLocationRequirements?: { '@type': 'Country'; name: string; } | Array<{ '@type': 'Country'; name: string; }>; } interface SoftwareAppSchema extends ThingBase { '@type': 'SoftwareApplication' | 'MobileApplication' | 'WebApplication'; applicationCategory?: string; operatingSystem?: string; offers?: OfferSchema; aggregateRating?: AggregateRatingSchema; downloadUrl?: string; softwareVersion?: string; } interface BrandSchema extends JsonLdBase { '@type': 'Brand'; name: string; logo?: string | ImageObject; slogan?: string; url?: string; sameAs?: string | string[]; } interface SiteNavigationElementSchema extends ThingBase { '@type': 'SiteNavigationElement'; url: string; } interface WebSiteSchema extends ThingBase { '@type': 'WebSite'; potentialAction?: SearchActionSchema; author?: PersonSchema | OrganizationSchema; publisher?: OrganizationSchema; mainEntity?: SiteNavigationElementSchema | SiteNavigationElementSchema[]; inLanguage?: string; dateCreated?: string; dateModified?: string; } interface SearchActionSchema extends JsonLdBase { '@type': 'SearchAction'; target: string | { '@type': 'EntryPoint'; urlTemplate: string; }; 'query-input'?: string; } interface ItemListSchema extends JsonLdBase { '@type': 'ItemList'; itemListElement: ListItem[]; numberOfItems?: number; itemListOrder?: 'https://schema.org/ItemListOrderAscending' | 'https://schema.org/ItemListOrderDescending' | 'https://schema.org/ItemListUnordered' | string; } interface ListItem extends JsonLdBase { '@type': 'ListItem'; position: number; url?: string; name?: string; item?: ThingBase; } interface ServiceSchema extends ThingBase { '@type': 'Service'; provider?: OrganizationSchema | PersonSchema; areaServed?: string | string[]; serviceType?: string; offers?: OfferSchema | OfferSchema[]; aggregateRating?: AggregateRatingSchema; } /** Union of all supported schema types */ type SchemaObject = ArticleSchema | ProductSchema | FAQPageSchema | BreadcrumbListSchema | LocalBusinessSchema | OrganizationSchema | PersonSchema | EventSchema | RecipeSchema | HowToSchema | VideoObjectSchema | CourseSchema | JobPostingSchema | SoftwareAppSchema | WebSiteSchema | ItemListSchema | ReviewSchema | ServiceSchema | BrandSchema | SiteNavigationElementSchema; /** JSON-LD with context */ type WithContext = T & { '@context': 'https://schema.org'; }; /** Schema graph — multiple connected schemas */ interface SchemaGraph { '@context': 'https://schema.org'; '@graph': SchemaObject[]; } export type { ArticleSchema as A, BrandSchema as B, CourseSchema as C, EventSchema as E, FAQPageSchema as F, GeoCoordinates as G, HowToSchema as H, ImageObject as I, JobPostingSchema as J, LocalBusinessSchema as L, MonetaryAmount as M, NutritionInfo as N, OrganizationSchema as O, PersonSchema as P, RecipeSchema as R, SchemaObject as S, ThingBase as T, VideoObjectSchema as V, WithContext as W, BreadcrumbListSchema as a, ItemListSchema as b, ProductSchema as c, ReviewSchema as d, SchemaGraph as e, ServiceSchema as f, SiteNavigationElementSchema as g, SoftwareAppSchema as h, WebSiteSchema as i, AggregateRatingSchema as j, BreadcrumbItem as k, ContactPoint as l, CourseInstance as m, FAQQuestionSchema as n, HowToStep as o, HowToSupply as p, HowToTool as q, JsonLdBase as r, ListItem as s, OfferSchema as t, OpeningHours as u, PostalAddress as v, RatingSchema as w, SearchActionSchema as x };