You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					28 lines
				
				984 B
			
		
		
			
		
	
	
					28 lines
				
				984 B
			| 
								 
											4 years ago
										 
									 | 
							
								import type { Parser, Handler } from "./Parser";
							 | 
						||
| 
								 | 
							
								/**
							 | 
						||
| 
								 | 
							
								 * Calls a specific handler function for all events that are encountered.
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								export default class MultiplexHandler implements Handler {
							 | 
						||
| 
								 | 
							
								    private readonly func;
							 | 
						||
| 
								 | 
							
								    /**
							 | 
						||
| 
								 | 
							
								     * @param func The function to multiplex all events to.
							 | 
						||
| 
								 | 
							
								     */
							 | 
						||
| 
								 | 
							
								    constructor(func: (event: keyof Handler, ...args: unknown[]) => void);
							 | 
						||
| 
								 | 
							
								    onattribute(name: string, value: string, quote: string | null | undefined): void;
							 | 
						||
| 
								 | 
							
								    oncdatastart(): void;
							 | 
						||
| 
								 | 
							
								    oncdataend(): void;
							 | 
						||
| 
								 | 
							
								    ontext(text: string): void;
							 | 
						||
| 
								 | 
							
								    onprocessinginstruction(name: string, value: string): void;
							 | 
						||
| 
								 | 
							
								    oncomment(comment: string): void;
							 | 
						||
| 
								 | 
							
								    oncommentend(): void;
							 | 
						||
| 
								 | 
							
								    onclosetag(name: string): void;
							 | 
						||
| 
								 | 
							
								    onopentag(name: string, attribs: {
							 | 
						||
| 
								 | 
							
								        [key: string]: string;
							 | 
						||
| 
								 | 
							
								    }): void;
							 | 
						||
| 
								 | 
							
								    onopentagname(name: string): void;
							 | 
						||
| 
								 | 
							
								    onerror(error: Error): void;
							 | 
						||
| 
								 | 
							
								    onend(): void;
							 | 
						||
| 
								 | 
							
								    onparserinit(parser: Parser): void;
							 | 
						||
| 
								 | 
							
								    onreset(): void;
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								//# sourceMappingURL=MultiplexHandler.d.ts.map
							 |