import { ViewTypeRegistry } from './ViewTypeRegistry';

ViewTypeRegistry.register({
  namespace: 'matrix.viewers',
  name: 'generic-inspector',
  tag: 'generic-inspector-view',
  matches: [{ priority: 1 }],
});

ViewTypeRegistry.register({
  namespace: 'matrix.viewers',
  name: 'json-tree',
  tag: 'json-tree-viewer',
  matches: [{ stateShape: { field: '_state', type: 'object' }, priority: 5 }],
});

ViewTypeRegistry.register({
  namespace: 'matrix.viewers',
  name: 'table-view',
  tag: 'table-viewer',
  matches: [
    { stateShape: { field: '_data', type: 'array', elementShape: 'Record' }, priority: 10 },
    { dataType: 'mx:ui:table-data', priority: 8 },
  ],
});
