Installation
npm install --save @types/html-truncate
Summary
This package contains type definitions for html-truncate (https://github.com/huang47/nodejs-html-truncate).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/html-truncate.
index.d.ts
interface TruncateOptions {
/**
* Flag to specify if keep image tag, false by default.
*/
keepImageTag?: boolean;
/**
* Omission symbol for truncated string, '...' by default.
*/
ellipsis?: boolean | string;
/**
* truncates last word, true by default
*/
truncateLastWord?: boolean;
/**
* Tolerance when options.truncateLastWord is false before we give up and just truncate at the maxLength position, 10 by default (but not greater than maxLength)
*/
slop?: number;
}
/**
* Truncate HTML text and also keep tag safe.
*/
declare function truncate(input: string, maxLength: number, options?: TruncateOptions): string;
export = truncate;
Additional Details
- Last updated: Tue, 07 Nov 2023 03:09:37 GMT
- Dependencies: none
Credits
These definitions were written by .