export const Message = {
key: 'chat-lists-contacts',
name: 'Message Contact',
description: 'A contact message card',
children: [],
};
export interface Template {
key: string;
name?: string;
description?: string;
class?: string;
children?: Array<ComponentRef>;
}
export interface TemplateRef<T extends Template> {
key: T['key']; // Is it possible to enforce that this be 'chat-lists-contacts'
children: Array<ComponentRef>;
}
// Выше я использую как.
templateRef(): TemplateRef<typeof Message> {
return {
key: 'd', // It doesn't validate this as invalid, should require `chat-lists-contacts`
children: [
{
id: 'id,
settings: {
inputs: [
{
key: 'styles',
value: ''
}
]
}
},
]
};
}
Пожалуйста, смотрите встроенные комментарии; Я хочу использовать объект Message
где-нибудь еще, чтобы мне не пришлось его повторно декларировать.,