Skip to content

collection-assets.ts#

View Markdown

Source

7 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.

7 symbols 3 functions 4 interfaces 3 parameters 9 members 3 returns

Reference#

interfaceCollectionAssetInputOne collection file and the public URLs that should expose it.

One collection file and the public URLs that should expose it.

Signature

export interface CollectionAssetInput

View source

Members

Properties
NameTypeDescription
publicPath string | readonly string[]
sourcePath string
interfaceCollectionAssetManifestA reusable asset plan for a custom host's build writer and development middlewa…

A reusable asset plan for a custom host's build writer and development middleware. Source paths are absolute so both consumers use the same file.

Signature

export interface CollectionAssetManifest

View source

Members

Properties
NameTypeDescription
assets CollectionAssetManifestEntry[]
interfaceCollectionAssetManifestEntryA source file, its normalized aliases, and its content-addressed URL.

A source file, its normalized aliases, and its content-addressed URL.

Signature

export interface CollectionAssetManifestEntry

View source

Members

Properties
NameTypeDescription
contentPath string
publicPaths string[]
sourcePath string
fncreateCollectionAssetsMiddleware(manifest: CollectionAssetManifest): AssetMiddlewareCreate Connect-compatible middleware that serves planned aliases and their cont…

Create Connect-compatible middleware that serves planned aliases and their content-addressed targets during development.

Signature

export function createCollectionAssetsMiddleware(manifest: CollectionAssetManifest): AssetMiddleware

View source

Parameters

Returns

AssetMiddleware
fnplanCollectionAssets(input: PlanCollectionAssetsInput): Promise<CollectionAssetManifest>Hash collection files and normalize their public aliases without taking over th…

Hash collection files and normalize their public aliases without taking over the host router. The returned manifest can be written at build time and served directly by createCollectionAssetsMiddleware in development.

Signature

export async function planCollectionAssets(input: PlanCollectionAssetsInput): Promise<CollectionAssetManifest>

View source

Parameters

Returns

Promise<CollectionAssetManifest>
interfacePlanCollectionAssetsInputInputs for a content-addressed collection asset manifest.

Inputs for a content-addressed collection asset manifest.

Signature

export interface PlanCollectionAssetsInput

View source

Members

Properties
NameTypeDescription
assets readonly CollectionAssetInput[]
contentDiroptional string
rootoptional string
fnwriteCollectionAssets(input: WriteCollectionAssetsInput): Promise<WriteCollectionAssetsResult>Write each content-addressed target once, then materialize its aliases with har…

Write each content-addressed target once, then materialize its aliases with hard links where supported and copies where they are not.

Signature

export async function writeCollectionAssets(input: WriteCollectionAssetsInput): Promise<WriteCollectionAssetsResult>

View source

Parameters

  • input WriteCollectionAssetsInput

Returns

Promise<WriteCollectionAssetsResult>