Skip to content

Commit

Permalink
generic serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieudutour committed Jan 1, 2021
1 parent 4ff924f commit 44a9c32
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function isProbablyReaderable(
}
): boolean;

export class Readability {
export class Readability<T = string> {
constructor(
document: Document,
options?: {
Expand All @@ -24,7 +24,7 @@ export class Readability {
charThreshold?: number;
classesToPreserve?: string[];
keepClasses?: boolean;
serializer?: (node: Node) => string;
serializer?: (node: Node) => T;
disableJSONLD?: boolean;
}
);
Expand All @@ -36,8 +36,8 @@ export class Readability {
byline: string;
/** content direction */
dir: string;
/** HTML string of processed article content */
content: string;
/** HTML of processed article content */
content: T;
/** text content of the article (all HTML removed) */
textContent: string;
/** length of an article, in characters */
Expand Down

0 comments on commit 44a9c32

Please sign in to comment.