import {Constructor, Mixin} from "../component-types.js" export interface WithContext { get context(): xContext } export function mixinContext(providedContext: xContext) { return function( Base: C ): Mixin> { return class extends Base { get context() { return providedContext } } } } export function mixinRequireContext(name?: string) { return function( Base: C ): Mixin> { return class extends Base { get context(): xContext { throw new Error(`context required by component${name ? " " + name : ""}`) } } } }