@dosgato/templating
Advanced tools
Comparing version 0.0.109 to 0.0.110
import { ContextBase, DataData, PageData, PageRecord, PageRecordOptionalData } from './component.js'; | ||
import { AssetLink, DataFolderLink, DataLink, LinkDefinition, PageLink } from './links.js'; | ||
import { AssetFolderLink, AssetLink, DataFolderLink, DataLink, LinkDefinition, PageLink } from './links.js'; | ||
export declare function printHeader(ctx: ContextBase, content: string | undefined | null, attributes?: Record<string, string>): string; | ||
@@ -34,2 +34,13 @@ export declare function advanceHeader<T extends ContextBase>(ctx: T, content: string | undefined | null): T; | ||
} | ||
export interface AssetRecord { | ||
id: string; | ||
path: string; | ||
checksum: string; | ||
name: string; | ||
extension: string; | ||
filename: string; | ||
mime: string; | ||
downloadLink: string; | ||
image?: PictureAttributes; | ||
} | ||
export interface PageForNavigation { | ||
@@ -96,2 +107,17 @@ id: string; | ||
/** | ||
* Get assets by link | ||
* | ||
* Certain components will be presenting download links for assets instead of showing images inline. In | ||
* those cases, you can use this function instead of getImgAttributes. The result you would get from | ||
* getImgAttributes will be inside the `image` property. | ||
* | ||
* It returns an array of assets because if you provide a link to an asset folder the result will be an | ||
* array. So if you provide an asset link you will just get an array of length 1. The recursive parameter | ||
* is available if you prefer to receive all assets that descend from the given folder instead of direct child | ||
* assets. | ||
* | ||
* Will be dataloaded so you can safely use this in a Promise.all. | ||
*/ | ||
getAssetsByLink: (link: AssetLink | AssetFolderLink | string, recursive?: boolean) => Promise<AssetRecord[]>; | ||
/** | ||
* This function will retrieve information about an image to help you construct responsive HTML | ||
@@ -104,3 +130,3 @@ * for a <picture> element including the <img> and all <source> tags. | ||
* | ||
* Will be dataloaded. | ||
* Will be dataloaded so you can safely use this in a Promise.all. | ||
*/ | ||
@@ -107,0 +133,0 @@ getImgAttributes: (link: string | AssetLink | undefined, absolute?: boolean) => Promise<PictureAttributes | undefined>; |
@@ -123,3 +123,3 @@ import { ComponentData, PageData } from './component.js'; | ||
*/ | ||
export declare function dialogQuery<T = any>(query: string, variables: any): Promise<T>; | ||
export declare function dialogQuery<T = any>(query: string, variables?: any): Promise<T>; | ||
export {}; |
{ | ||
"name": "@dosgato/templating", | ||
"version": "0.0.109", | ||
"version": "0.0.110", | ||
"description": "A library to support building templates for dosgato CMS.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
91897
2065