import { AmfDefinitions } from '@api-client/core/build/browser.js';
import '../../src/define/amf/api-documentation.js';
import '../../src/define/amf/api-request.js';
import '../../src/define/amf/api-navigation.js';
import { DomEventsAmfStore } from '../../src/index.js';

async function downloadAmfModel(): Promise<AmfDefinitions.IAmfDocument> {
  const response = await fetch('/demo/models/demo-api.json');
  return response.json();
}

async function init(): Promise<void> {
  const apiStore = new DomEventsAmfStore();
  apiStore.listen();
  const model = await downloadAmfModel();
  apiStore.amf = model;
}
init();
