export const requiredUiAdapterCapabilities = Object.freeze([
    'button', 'text-field', 'text-area', 'select', 'multi-select', 'checkbox', 'date-field',
    'number-field', 'dialog', 'status-tag', 'inline-message', 'paginator', 'tabs', 'data-grid'
]);
export function assertUiAdapterContract(adapter) {
    if (adapter.descriptor.contractVersion !== '4.0') {
        throw new Error(`Unsupported UI adapter contract: ${adapter.descriptor.contractVersion}`);
    }
    const missing = requiredUiAdapterCapabilities.filter(x => !adapter.descriptor.capabilities.has(x));
    if (missing.length > 0) {
        throw new Error(`UI adapter ${adapter.descriptor.id} is missing capabilities: ${missing.join(', ')}`);
    }
    const componentNames = [
        'Button', 'TextField', 'TextArea', 'Select', 'MultiSelect', 'Checkbox', 'DateField',
        'NumberField', 'Dialog', 'StatusTag', 'InlineMessage', 'Paginator', 'Tabs', 'DataGrid'
    ];
    for (const name of componentNames) {
        if (!adapter.components[name])
            throw new Error(`UI adapter ${adapter.descriptor.id} has no component for ${name}`);
    }
}
export const uiAdapterKey = Symbol('KArtSellUiAdapterV4');
