export interface IMediaQueryCondition { returns matches : boolean ; /** Attach listener to wrapped media query list */ addListener ( cb ) : void ; /** Detach listener from wrapped media query list */ removeListener ( cb ) : void ; /** Optimize condition with nested hierarchy */ optimize ( ) : IMediaQueryCondition ; /** Stringify condition */ toString ( ) : string ; } author Alexey Stsefanovich (ala'n) *
 * Ignores listeners always return the same result.
 * Have only two instances:  ALL and  NOT_ALL class MediaQueryConstCondition implements IMediaQueryCondition { constructor ( private readonly _matches ) { } public get matches ( ) : boolean { return this . _matches ; } public addListener ( cb ) { } public removeListener ( cb ) { } public optimize ( ) { return this ; } public toString ( ) { return this . _matches ? 'all' : 'not all' ; } /** Compare const media condition with the passed query instance or string */ public eq ( val ) { return val . toString ( ) . trim ( ) === this . toString ( ) ; } } export const ALL = new MediaQueryConstCondition ( true ) ; export const NOT_ALL = new MediaQueryConstCondition ( false ) ;