import {Type} from "./Utils.js"; export default interface Extendable { as(type: Type): C; asOptional(type: Type): C | null; has(type: Type): boolean; /** * @throws MissingComponentError */ require(type: Type): void; } export class MissingComponentError extends Error { public constructor(type: Type) { super(`Required component ${type.name} was not found.`); } }