import { coerceBooleanProperty } from 'ngx-tethys/util' ; import { Constructor } from './constructor' ; export interface ThyCanDisable { thyDisabled : boolean ; } export type ThyCanDisableCtor = Constructor < ThyCanDisable > ; /** Mixin to augment a directive with a `disable` property. */ export function mixinDisabled < T extends Constructor < { } > > ( base ) { return class extends base { private _thyDisabled = false ; get thyDisabled ( ) { return this . _thyDisabled ; } set thyDisabled ( value ) { this . _thyDisabled = coerceBooleanProperty ( value ) ; } constructor ( ... args ) { super ( ... args ) ; } } ; }