@devmehq/open-graph-extractor
Version:
Fast, lightweight Open Graph, Twitter Card, and structured data extractor for Node.js with caching and validation
31 lines (30 loc) • 996 B
TypeScript
import type { CheerioAPI } from "cheerio";
import type { IStructuredData } from "./types";
/**
* Extract all structured data from HTML
*/
export declare function extractStructuredData($: CheerioAPI): IStructuredData;
/**
* Extract JSON-LD structured data
*/
export declare function extractJsonLD($: CheerioAPI): any[];
/**
* Extract specific JSON-LD types
*/
export declare function extractJsonLDByType<T>(jsonLDData: any[], type: string): T | null;
/**
* Extract Schema.org microdata
*/
export declare function extractSchemaOrg($: CheerioAPI): Record<string, any>;
/**
* Extract RDFa data
*/
export declare function extractRDFa($: CheerioAPI): Record<string, any[]>;
/**
* Extract Dublin Core metadata
*/
export declare function extractDublinCore($: CheerioAPI): Record<string, string>;
/**
* Merge structured data with Open Graph data
*/
export declare function mergeStructuredDataWithOG(ogData: Record<string, unknown>, structuredData: IStructuredData): Record<string, unknown>;