import type { Article, BlogPosting, BreadcrumbList, Event, FAQPage, Graph as SchemaOrgGraph, HowTo, ImageObject, JsonLdObject, LocalBusiness, Offer, Organization, Person, Product, Service, SoftwareApplication, TechArticle, Thing, VideoObject, WebPage, WebSite, } from 'schema-dts'; export type { Article, BlogPosting, BreadcrumbList, Event, FAQPage, Graph as SchemaOrgGraph, HowTo, ImageObject, JsonLdObject, LocalBusiness, Offer, Organization, Person, Product, Service, SoftwareApplication, TechArticle, Thing, VideoObject, WebPage, WebSite, } from 'schema-dts'; declare const schemaIdBrand: unique symbol; declare const schemaEntityType: unique symbol; declare const schemaReferenceType: unique symbol; /** The object-valued members of schema-dts's `Thing` vocabulary union. */ export type SchemaThing = Exclude; /** Open vocabulary fallback used when a caller does not select one schema-dts leaf. */ export interface GenericSchemaEntity extends JsonLdObject { readonly [property: string]: unknown; } /** A validated, absolute JSON-LD identifier branded with its entity type. */ export type SchemaId = string & { readonly [schemaIdBrand]: T['@type']; }; /** Public roadmap spelling retained alongside the more vocabulary-specific alias. */ export type EntityId = SchemaId; /** An ID-only JSON-LD reference. Relative IDs remain valid until graph validation. */ export interface EntityReference { readonly '@id': string; readonly [schemaReferenceType]?: T; } /** A schema-dts entity whose optional ID is structurally safe but may be relative. */ export type SchemaEntity = [T] extends [never] ? GenericSchemaEntity & { readonly '@id'?: string } : T extends unknown ? Omit & { readonly '@id'?: string; readonly [schemaEntityType]?: T } : never; /** Select the exact leaf from one of schema-dts's subtype unions. */ export type ExactSchemaType = T extends JsonLdObject ? T extends { '@type': Name } ? T : never : never; /** Input for a builder that owns its entity's exact `@type`. */ export type SchemaBuilderInput = T extends unknown ? Omit & { readonly '@type'?: never; readonly '@context'?: never; } : never; export type GraphRole = | 'site' | 'page' | 'breadcrumbs' | 'mainEntity' | 'author' | 'publisher' | 'supporting'; export type GraphProvenanceSource = | 'authored-jsonld' | 'authored-head' | 'configuration' | 'inference' | 'plugin' | 'api'; /** Provenance is retained beside the graph and never emitted as JSON-LD. */ export interface GraphProvenance { source: GraphProvenanceSource; /** RFC 6901 pointer. Omit it to describe the whole entity. */ pointer?: string; pathname?: string; sourcePath?: string; plugin?: string; } export interface GraphEntryInput { entity: T | SchemaEntity; roles?: GraphRole | readonly GraphRole[]; provenance?: GraphProvenance | readonly GraphProvenance[]; } export interface GraphEntry { readonly entity: SchemaEntity; readonly roles: readonly GraphRole[]; readonly provenance: readonly GraphProvenance[]; } export type GraphConflictPolicy = 'error' | 'first' | 'last'; /** A scalar conflict without either conflicting value. */ export interface GraphConflict { readonly entityId?: string; readonly role?: GraphRole; readonly pointer: string; readonly policy: GraphConflictPolicy; readonly resolution: 'unresolved' | 'first' | 'last'; readonly first: readonly GraphProvenance[]; readonly incoming: readonly GraphProvenance[]; } export interface GraphFinding { readonly version: 1; readonly code: string; readonly severity: 'info' | 'warning' | 'error'; readonly message: string; readonly entityId?: string; readonly pointer?: string; readonly pathname?: string; } export interface AeoGraph { readonly version: 1; readonly entries: readonly GraphEntry[]; readonly conflicts: readonly GraphConflict[]; } export type GraphInput = | AeoGraph | SchemaOrgGraph | GenericSchemaEntity | GraphEntryInput | readonly (GenericSchemaEntity | GraphEntryInput)[]; export interface GraphMergeOptions { /** How equal-ID scalar conflicts resolve. Default: `error`. */ conflictPolicy?: GraphConflictPolicy; } export interface GraphValidationOptions extends GraphMergeOptions { /** Stable page canonical used to resolve fragment and relative IDs. */ documentCanonical?: string | URL; /** Configured Astro site, including its base path when applicable. */ siteUrl?: string | URL; /** Complete collected ID set used for cross-page reference validation. */ knownEntityIds?: readonly string[]; /** Downgrade unresolved references to warnings when false. Default: true. */ strictReferences?: boolean; } export interface GraphValidationResult { readonly valid: boolean; readonly graph: AeoGraph; readonly findings: readonly GraphFinding[]; readonly conflicts: readonly GraphConflict[]; } /** Public semantic-publishing spelling for a graph validation result. */ export type SchemaValidationResult = GraphValidationResult; export declare class SchemaGraphError extends Error { readonly result: GraphValidationResult; } /** Resolve an ID only against the explicit base, never a request host. */ export declare function createId( value: string | URL, base?: string | URL, ): SchemaId; /** Clone and structurally validate an entity. Relative IDs are resolved by validateGraph. */ export declare function createEntity(entity: T): SchemaEntity; /** Create an ID-only reference. An entity without an ID throws at runtime. */ export declare function ref( target: string | EntityReference | SchemaEntity, ): EntityReference; export interface ConnectOptions { /** Append and deduplicate by default, or replace the relation. */ mode?: 'append' | 'replace'; } /** Immutably attach an ID reference to a schema-dts relation. */ export declare function connect( source: SchemaEntity, property: Exclude, '@id' | '@type'>, target: string | EntityReference | SchemaEntity, options?: ConnectOptions, ): SchemaEntity; export declare function createGraph(input: GraphInput, options?: GraphMergeOptions): AeoGraph; export declare function mergeGraph( inputs: readonly GraphInput[], options?: GraphMergeOptions, ): AeoGraph; export declare function deduplicateGraph( input: GraphInput, options?: GraphMergeOptions, ): AeoGraph; export declare function validateGraph( input: GraphInput, options?: GraphValidationOptions, ): GraphValidationResult; /** Serialize a valid graph as deterministic, inline-script-safe JSON-LD. */ export declare function serializeGraph( input: GraphInput, options?: GraphValidationOptions, ): string; type WebSiteEntity = ExactSchemaType; type WebPageEntity = ExactSchemaType; type PersonEntity = ExactSchemaType; type OrganizationEntity = ExactSchemaType; type ArticleEntity = ExactSchemaType; type BlogPostingEntity = ExactSchemaType; type TechArticleEntity = ExactSchemaType; type BreadcrumbListEntity = ExactSchemaType; type ImageObjectEntity = ExactSchemaType; type VideoObjectEntity = ExactSchemaType; type ProductEntity = ExactSchemaType; type SoftwareApplicationEntity = ExactSchemaType; type ServiceEntity = ExactSchemaType; type OfferEntity = ExactSchemaType; type FAQPageEntity = ExactSchemaType; type HowToEntity = ExactSchemaType; type EventEntity = ExactSchemaType; type LocalBusinessEntity = ExactSchemaType; export declare function createWebSite(input: SchemaBuilderInput): SchemaEntity; export declare function createWebPage(input: SchemaBuilderInput): SchemaEntity; export declare function createPerson(input: SchemaBuilderInput): SchemaEntity; export declare function createOrganization( input: SchemaBuilderInput, ): SchemaEntity; export declare function createArticle(input: SchemaBuilderInput): SchemaEntity; export declare function createBlogPosting( input: SchemaBuilderInput, ): SchemaEntity; export declare function createTechArticle( input: SchemaBuilderInput, ): SchemaEntity; export declare function createBreadcrumbList( input: SchemaBuilderInput, ): SchemaEntity; export declare function createImageObject( input: SchemaBuilderInput, ): SchemaEntity; export declare function createVideoObject( input: SchemaBuilderInput, ): SchemaEntity; export declare function createProduct(input: SchemaBuilderInput): SchemaEntity; export declare function createSoftwareApplication( input: SchemaBuilderInput, ): SchemaEntity; export declare function createService(input: SchemaBuilderInput): SchemaEntity; export declare function createOffer(input: SchemaBuilderInput): SchemaEntity; export declare function createFAQPage(input: SchemaBuilderInput): SchemaEntity; export declare function createHowTo(input: SchemaBuilderInput): SchemaEntity; export declare function createEvent(input: SchemaBuilderInput): SchemaEntity; export declare function createLocalBusiness( input: SchemaBuilderInput, ): SchemaEntity;