UNPKG

1.13 kBTypeScriptView Raw
1import { IRenderMime } from '@jupyterlab/rendermime-interfaces';
2/**
3 * A class to sanitize HTML strings.
4 */
5export declare class Sanitizer implements IRenderMime.ISanitizer {
6 constructor();
7 /**
8 * Sanitize an HTML string.
9 *
10 * @param dirty - The dirty text.
11 *
12 * @param options - The optional sanitization options.
13 *
14 * @returns The sanitized string.
15 */
16 sanitize(dirty: string, options?: IRenderMime.ISanitizerOptions): string;
17 /**
18 * @returns Whether to replace URLs by HTML anchors.
19 */
20 getAutolink(): boolean;
21 /**
22 * Set the allowed schemes
23 *
24 * @param scheme Allowed schemes
25 */
26 setAllowedSchemes(scheme: Array<string>): void;
27 /**
28 * Set the URL replacement boolean.
29 *
30 * @param autolink URL replacement boolean.
31 */
32 setAutolink(autolink: boolean): void;
33 /**
34 * Set the whether to allow `name` and `id` attributes.
35 */
36 setAllowNamedProperties(allowNamedProperties: boolean): void;
37 private _autolink;
38 private _allowNamedProperties;
39 private _options;
40 private _generateOptions;
41}