
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
@types/html-parser
Advanced tools
TypeScript definitions for html-parser
npm install --save @types/html-parser
This package contains type definitions for html-parser (https://www.npmjs.com/package/html-parser).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/html-parser.
export type Callback = (arg: any) => any;
export type Token = ">" | "/>" | "?>";
export interface CallbacksOption {
attribute?(name: string, value: any): void;
openElement?(tagName: string): void;
closeOpenedElement?(tagName: string, token: Token, isUnary: boolean): void;
closeElement?(name: string): void;
comment?(content: string): void;
docType?(content: string): void;
cdata?(content: string): void;
xmlProlog?(): void;
text?(value: string): void;
}
export interface RegExpOptions {
name?: RegExp | undefined;
attribute?: RegExp | undefined;
}
export interface RemovalCallback {
attributes?: Callback | string[];
elements?: Callback | string[];
comments?: Callback | boolean;
docTypes?: Callback | boolean;
}
export function parse(htmlString: string, callbacks?: CallbacksOption, regex?: RegExpOptions): void;
export function parseFile(
fileName: string,
encoding: string | undefined,
callbacks: CallbacksOption,
callback: Callback,
): void;
export function sanitize(htmlString: string, removalCallbacks?: RemovalCallback): string;
These definitions were written by Vladimir Grenaderov https://github.com/VladimirGrenaderov, // Max Boguslavskiy.
FAQs
TypeScript definitions for html-parser
The npm package @types/html-parser receives a total of 1,195 weekly downloads. As such, @types/html-parser popularity was classified as popular.
We found that @types/html-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.