UNPKG

@hanivanrizky/nestjs-html-parser

Version:

⚠️ ARCHIVED - This package is no longer maintained. Please migrate to @hanivanrizky/nestjs-xpath-parser (https://github.com/Hanivan/nestjs-xpath-parser)

26 lines (25 loc) 1.1 kB
/** * Example: Pagination validation and safe extraction * * This example demonstrates how to safely handle undefined selectors * and validate pagination patterns before extracting data using both * the new extractPagination method and manual extraction methods. */ import { PaginationPage } from '../types'; interface PageResult { href: string; text: string; isCurrent: boolean; isSkip: boolean; } interface PaginationPattern { PAGE_NODE_PATTERN?: { selector: string; }; } declare function demonstrateNewExtractPagination(): Promise<PaginationPage[]>; declare function demonstrateOldMethodValidation(): Promise<PageResult[]>; declare function demonstrateUndefinedSelectorError(): Promise<Record<string, any>[]>; declare function demonstrateEnhancedExtractPagination(): Promise<PaginationPage[]>; declare function compareExtractionMethods(): Promise<void>; export { compareExtractionMethods, demonstrateEnhancedExtractPagination, demonstrateNewExtractPagination, demonstrateOldMethodValidation, demonstrateUndefinedSelectorError, PageResult, PaginationPattern, };