UNPKG

semantic-analysis

Version:

Extensible semantic Structured Data analysis library for Microdata and JSON-LD

34 lines (33 loc) 950 B
import { IExtractionResult } from '../../'; import { ITerm } from '../validation/schema'; export interface IResultSimple { items: readonly IItemSimple[]; document: { url?: string; }; logs: readonly ILogSimple[]; } export interface IItemSimple { type: readonly string[]; id?: string; meta: IMetaSimple; properties: { [name: string]: readonly IPropertySimple[]; }; } export interface IPropertySimple { value: ValueSimple; meta: IMetaSimple; } export declare type ValueSimple = IItemSimple | string; export interface IMetaSimple { type: 'JSON-LD' | 'Microdata' | 'RDFa' | 'Microformats'; logs: readonly ILogSimple[]; } export interface ILogSimple { sort: 'Notice' | 'Warning' | 'Error'; message: string; phase: 'Parsing' | 'Extraction' | 'Semantics'; term?: ITerm; } export declare const toSerializable: ({ items, document, logs }: IExtractionResult) => IResultSimple;