import type { SeoMeta, SeoMetaInput, SeoTagNode, UseSeoMetaBase, UseSeoMetaOptions } from "./seo-meta.types.js"; import { type SiteConfig } from "./site.config.js"; export type { SeoArrayable, SeoBooleanable, SeoMeta, SeoMetaArticle, SeoMetaFlat, SeoMetaInput, SeoOgImageObject, SeoRobotsObject, SeoTagNode, UseSeoMetaBase, UseSeoMetaOptions, } from "./seo-meta.types.js"; /** * Result of {@link useSeoMeta}: `html` / `tags` for the head, plus **one** * flat object of resolved fields (site + HTML + OG). No duplicate * `title` / `meta.title` / `config.title`. * * - `title` = document title (page) * - `siteTitle` = brand / site name * - `html` / `tags` = what you inject into `` */ export type SeoTagResult = UseSeoMetaOptions & { html: string; tags: SeoTagNode[]; jsonLd?: Record; }; /** @deprecated Use {@link SeoTagResult}. */ export type SeoTagsResult = SeoTagResult; /** * SEO helper: one flat object in → one flat object out (+ html/tags). * * @example * ```ts * const seo = useSeoMeta({ * site: "https://example.com", * siteTitle: "My Site", * title: "Home", * description: "…", * ogImage: "https://example.com/image.png", * }); * // seo.title, seo.site, seo.ogImage — once each * // seo.html / seo.tags — head injection * ``` */ export declare function useSeoMeta(opts: UseSeoMetaOptions, defaults?: SiteConfig): SeoTagResult; /** * Registers the site-wide SEO config once — the same `define*Config` pattern * used by the HTTP client and the other services. * * After the call, every `useSeoMeta(opts)` resolves against this config, so * pages only pass their own fields. An explicit second argument still wins, so * per-call overrides and tests stay possible. * * @param config - The site config (same shape the docs site uses). * @returns The same config, for chaining or reference. * @throws {Error} When required blocks (`seo`, `rss`) are missing. * * @example * ```ts * import { defineSeoMetaConfig, useSeoMeta } from "katanakit-js"; * * defineSeoMetaConfig({ * site: "https://myblog.com", * title: "My Blog", * description: "Notes on software", * lang: "en", * author: "Ada", * ogImage: "https://myblog.com/og.png", * rss: { enabled: true, path: "/rss.xml", limit: 20 }, * seo: { noindex: false, canonical: true, openGraph: true, twitterCard: true, jsonLd: true }, * }); * * const seo = useSeoMeta({ title: "My Post", description: "A great post" }); * // seo.site === "https://myblog.com", seo.html / seo.tags ready for * ``` */ export declare function defineSeoMetaConfig(config: SiteConfig): SiteConfig; /** * Returns the registered site config, falling back to the bundled demo * defaults when {@link defineSeoMetaConfig} was never called. */ export declare function useSeoMetaConfig(): SiteConfig; /** Clears the registered config (restores the demo defaults). Useful in tests. */ export declare function useResetSeoMetaConfig(): void; /** * @deprecated Prefer {@link useSeoMeta} with a unified flat object. * Legacy: `useSeoTag(siteConfig, { title, description, ... })`. */ export declare function useSeoTag(config: SiteConfig, meta: SeoMeta): SeoTagResult; /** @deprecated Prefer {@link useSeoMeta}. */ export declare const useSeoTags: typeof useSeoTag; /** * Applies tags from a {@link SeoTagResult} into `document.head` (Vanilla / SPA). * No-op when `document` is unavailable (SSR). */ export declare function useApplySeoTag(seo: SeoTagResult, head?: ParentNode | null): void; /** HTML string of meta tags (no RSS). Prefer {@link useSeoMeta}. */ export declare function useGenerateMetaTags(config: SiteConfig, meta: SeoMeta): string; export declare function useTitle(config: SiteConfig, pageTitle?: string): string; export declare function useRssHeadLink(config: SiteConfig): string; /** Full `` HTML (meta + RSS). Accepts legacy `SeoMeta` or flat {@link SeoMetaInput}. */ export declare function useHeadTags(config: SiteConfig, meta: SeoMeta | SeoMetaInput): string; //# sourceMappingURL=seo.service.d.ts.map