Skip to content

ComponentDefinition type #34

@buschtoens

Description

@buschtoens

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions