// world root:component/root
export interface RecordEntry {
  path: string,
  hash?: string,
  size?: bigint,
}
export interface DistMetadata {
  metadataVersion: string,
  name: string,
  version: string,
  summary?: string,
  description?: string,
  descriptionContentType?: string,
  requiresDist: Array<string>,
  requiresPython?: string,
  providesExtra: Array<string>,
  author?: string,
  authorEmail?: string,
  maintainer?: string,
  maintainerEmail?: string,
  license?: string,
  licenseExpression?: string,
  classifiers: Array<string>,
  homePage?: string,
  projectUrls: Array<[string, string]>,
  platforms: Array<string>,
  dynamic: Array<string>,
}
export interface DirUrlInfo {
  url: string,
  editable: boolean,
}
export interface ArchiveUrlInfo {
  url: string,
  hash?: string,
}
export interface VcsUrlInfo {
  url: string,
  vcs: string,
  commitId?: string,
  requestedRevision?: string,
}
export type DirectUrlInfo = DirectUrlInfoLocalDirectory | DirectUrlInfoArchive | DirectUrlInfoVcs;
export interface DirectUrlInfoLocalDirectory {
  tag: 'local-directory',
  val: DirUrlInfo,
}
export interface DirectUrlInfoArchive {
  tag: 'archive',
  val: ArchiveUrlInfo,
}
export interface DirectUrlInfoVcs {
  tag: 'vcs',
  val: VcsUrlInfo,
}
import type * as WasiCliEnvironment from './interfaces/wasi-cli-environment.js'; // wasi:cli/environment@0.2.6
import type * as WasiCliExit from './interfaces/wasi-cli-exit.js'; // wasi:cli/exit@0.2.6
import type * as WasiCliStderr from './interfaces/wasi-cli-stderr.js'; // wasi:cli/stderr@0.2.6
import type * as WasiIoError from './interfaces/wasi-io-error.js'; // wasi:io/error@0.2.6
import type * as WasiIoStreams from './interfaces/wasi-io-streams.js'; // wasi:io/streams@0.2.6
import type * as WasiRandomInsecureSeed from './interfaces/wasi-random-insecure-seed.js'; // wasi:random/insecure-seed@0.2.6
export interface ImportObject {
  'wasi:cli/environment@0.2.6': typeof WasiCliEnvironment,
  'wasi:cli/exit@0.2.6': typeof WasiCliExit,
  'wasi:cli/stderr@0.2.6': typeof WasiCliStderr,
  'wasi:io/error@0.2.6': typeof WasiIoError,
  'wasi:io/streams@0.2.6': typeof WasiIoStreams,
  'wasi:random/insecure-seed@0.2.6': typeof WasiRandomInsecureSeed,
}
export interface Root {
  containsAppOrHandler(source: string): boolean,
  getStringConstant(source: string, name: string): string | undefined,
  parseDjangoSettingsModule(source: string): string | undefined,
  parseDistMetadata(content: Uint8Array): DistMetadata,
  parseRecord(content: string): Array<RecordEntry>,
  parseDirectUrl(content: string): DirectUrlInfo,
  normalizePackageName(name: string): string,
}

/**
* Instantiates this component with the provided imports and
* returns a map of all the exports of the component.
*
* This function is intended to be similar to the
* `WebAssembly.instantiate` function. The second `imports`
* argument is the "import object" for wasm, except here it
* uses component-model-layer types instead of core wasm
* integers/numbers/etc.
*
* The first argument to this function, `getCoreModule`, is
* used to compile core wasm modules within the component.
* Components are composed of core wasm modules and this callback
* will be invoked per core wasm module. The caller of this
* function is responsible for reading the core wasm module
* identified by `path` and returning its compiled
* `WebAssembly.Module` object. This would use `compileStreaming`
* on the web, for example.
*/
export function instantiate(
getCoreModule: (path: string) => WebAssembly.Module,
imports: ImportObject,
instantiateCore?: (module: WebAssembly.Module, imports: Record<string, any>) => WebAssembly.Instance
): Root;
export function instantiate(
getCoreModule: (path: string) => WebAssembly.Module | Promise<WebAssembly.Module>,
imports: ImportObject,
instantiateCore?: (module: WebAssembly.Module, imports: Record<string, any>) => WebAssembly.Instance | Promise<WebAssembly.Instance>
): Root | Promise<Root>;

