interface PackageResolverInterface

Methods

array
resolvePackages(array$packagesToRequire)

Grabs the URLs for the given packages and converts them to ImportMapEntry objects.

array
downloadPackages(array$importMapEntries,callable|null$progressCallback =null)

Downloads the contents of the given packages.

Details

array resolvePackages(array$packagesToRequire)

Grabs the URLs for the given packages and converts them to ImportMapEntry objects.

If "download" is specified in PackageRequireOptions, the resolved package contents should be included.

Parameters

array $packagesToRequire

Return Value

array The import map entries that should be added

array downloadPackages(array$importMapEntries,callable|null$progressCallback =null)

Downloads the contents of the given packages.

The returned array should be a map using the same keys as $importMapEntries.

The dependencies are an array of module names that are imported by the package.

Parameters

array $importMapEntries
callable|null $progressCallback

Return Value

array array{content: string, dependencies: string[], extraFiles: array<string, string>}>