collection-assets.ts#
7 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.
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 CollectionAssetInputMembers
Properties
| Name | Type | Description |
|---|---|---|
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 CollectionAssetManifestMembers
Properties
| Name | Type | Description |
|---|---|---|
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 CollectionAssetManifestEntryMembers
Properties
| Name | Type | Description |
|---|---|---|
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): AssetMiddlewareParameters
-
manifestCollectionAssetManifest
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>Parameters
Returns
Promise<CollectionAssetManifest>
interfacePlanCollectionAssetsInputInputs for a content-addressed collection asset manifest.
Inputs for a content-addressed collection asset manifest.
Signature
export interface PlanCollectionAssetsInputMembers
Properties
| Name | Type | Description |
|---|---|---|
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>Parameters
-
inputWriteCollectionAssetsInput
Returns
Promise<WriteCollectionAssetsResult>