UNPKG

symfony-style-console

Version:

Use the style and utilities of the Symfony Console in Node.js

61 lines (60 loc) 1.49 kB
import OutputFormatterStyleInterface from './OutputFormatterStyleInterface'; /** * Manages nesting of [[OutputFormatterStyleInterface]] styles. * * * @author Jean-François Simon <contact@jfsimon.fr> * * Original PHP class * * @author Florian Reuschel <florian@loilo.de> * * Port to TypeScript * */ declare class OutputFormatterStyleStack { private styles; private emptyStyle; /** * Constructor. * * @param emptyStyle */ constructor(emptyStyle?: OutputFormatterStyleInterface); /** * Resets stack (ie. empty internal arrays). */ reset(): void; /** * Pushes a style in the stack. * * @param style */ push(style: OutputFormatterStyleInterface): void; /** * Pops a style from the stack. * * @param OutputFormatterStyle|null style * * @return OutputFormatterStyle * * @throws InvalidArgumentException When style tags incorrectly nested */ pop(style?: OutputFormatterStyleInterface): OutputFormatterStyleInterface; /** * Computes current style with stacks top codes. * * @return OutputFormatterStyle */ getCurrent(): OutputFormatterStyleInterface; /** * @param emptyStyle * @return this */ setEmptyStyle(emptyStyle: OutputFormatterStyleInterface): this; /** * @return OutputFormatterStyle */ getEmptyStyle(): OutputFormatterStyleInterface; } export default OutputFormatterStyleStack;