UNPKG

syphonx-core

Version:

SyphonX is a template-driven solution for extracting data from HTML in a highly efficient way. It combines the power of jQuery, Regular Expressions, and Javascript into a declarative template-driven format that extracts and reshapes HTML data into JSON.

35 lines (34 loc) 1.05 kB
import { When } from "./When.js"; export interface SelectTarget { query?: SelectQuery[]; pivot?: SelectTarget; select?: Select[]; value?: unknown; all?: boolean; hits?: number | null; limit?: number | null; format?: SelectFormat; pattern?: string; collate?: boolean; comment?: string; context?: number | null; distinct?: boolean; negate?: boolean; removeNulls?: boolean; waitfor?: boolean; when?: When; } export interface Select extends SelectTarget { name?: string; repeated?: boolean; required?: boolean; type?: SelectType; union?: SelectTarget[]; } export type SelectType = "string" | "number" | "boolean" | "object"; export type SelectQuery = [string, ...SelectQueryOp[]]; export type SelectQueryOp = [string, ...unknown[]]; export type SelectQueryOperator = string; export type SelectQueryOperand = unknown; export type SelectFormat = "href" | "multiline" | "singleline" | "innertext" | "textcontent" | "none"; export type SelectOn = "any" | "all" | "none";