Currently, there is no clean way to type check for a ComponentDefinition, e.g.:
{{validated-component someComponent=(component "some-component')}}
The (component) helper returns a CurlyComponentDefintion, which is a subclass of ComponentDefintion of the @glimmer/rutime package.
Ideally, I would like this API:
import Component from '@ember/component';
import { argument } from '@ember-decorators/argument';
import { type } from '@ember-decorators/argument/type';
import { ComponentDefinition } from '@ember-decorators/argument/types';
export default class ValidatedComponent extends Component {
@argument
@type(ComponentDefinition)
someComponent;
}
However, I don't see an easy way to access the ComponentDefinition interface / class from the Ember world.
Currently, there is no clean way to type check for a
ComponentDefinition, e.g.:The
(component)helper returns aCurlyComponentDefintion, which is a subclass ofComponentDefintionof the@glimmer/rutimepackage.Ideally, I would like this API:
However, I don't see an easy way to access the
ComponentDefinitioninterface / class from the Ember world.