UNPKG

591 BTypeScriptView Raw
1import { Token, TopLevelToken } from '../tokens';
2import { Template } from '../template';
3type ParseToken<T extends Token> = ((token: T, remainTokens: T[]) => Template);
4export declare class ParseStream<T extends Token = TopLevelToken> {
5 private tokens;
6 private handlers;
7 private stopRequested;
8 private parseToken;
9 constructor(tokens: T[], parseToken: ParseToken<T>);
10 on<T2 extends Template | T | undefined>(name: string, cb: (this: ParseStream, arg: T2) => void): ParseStream<T>;
11 private trigger;
12 start(): this;
13 stop(): this;
14}
15export {};
16
\No newline at end of file