UNPKG

@siren-js/client

Version:
19 lines (18 loc) 812 B
import { EmbeddedLink, Entity, Link } from '../models'; import { Target } from '../utils'; import { DefaultSirenElementVisitor } from '../visitor'; /** [Selection policy](https://en.wikipedia.org/wiki/Web_crawler#Selection_policy) for a Crawler */ export interface SelectionPolicy { /** Selects targets from the given {@linkcode Entity} to crawl */ selectFrom(entity: Entity): Promise<Target[]>; } /** * Default {@linkcode SelectionPolicy} that collects all the {@linkcode Link}s and * {@linkcode EmbeddedLink}s in an {@linkcode Entity} */ export declare class DefaultSelectionPolicy extends DefaultSirenElementVisitor implements SelectionPolicy { private urls; visitEmbeddedLink(link: EmbeddedLink): void; visitLink(link: Link): void; selectFrom(entity: Entity): Promise<Target[]>; }