@dosgato/templating 1.1.7 → 1.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/component.d.ts +4 -2
- package/dist/render.d.ts +11 -1
- package/package.json +1 -1
package/dist/component.d.ts
CHANGED
|
@@ -355,7 +355,7 @@ export interface SiteInfo {
|
|
|
355
355
|
path: string;
|
|
356
356
|
};
|
|
357
357
|
}
|
|
358
|
-
export interface
|
|
358
|
+
export interface PageRecordNoData {
|
|
359
359
|
id: string;
|
|
360
360
|
name: string;
|
|
361
361
|
linkId: string;
|
|
@@ -364,12 +364,14 @@ export interface PageRecord<DataType extends PageData = PageData> {
|
|
|
364
364
|
modifiedAt: Date;
|
|
365
365
|
publishedAt?: Date;
|
|
366
366
|
path: string;
|
|
367
|
-
data: DataType;
|
|
368
367
|
pagetree: {
|
|
369
368
|
id: string;
|
|
370
369
|
};
|
|
371
370
|
site: SiteInfo;
|
|
372
371
|
}
|
|
372
|
+
export interface PageRecord<DataType extends PageData = PageData> extends PageRecordNoData {
|
|
373
|
+
data: DataType;
|
|
374
|
+
}
|
|
373
375
|
export interface PageRecordOptionalData<DataType extends PageData = PageData> extends Omit<PageRecord<DataType>, 'data'> {
|
|
374
376
|
data?: DataType;
|
|
375
377
|
}
|
package/dist/render.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ContextBase, DataRecord, PageData, PageRecord, PageRecordOptionalData } from './component.js';
|
|
1
|
+
import type { ContextBase, DataRecord, PageData, PageRecord, PageRecordNoData, PageRecordOptionalData } from './component.js';
|
|
2
2
|
import type { AssetFolderLink, AssetLink, DataFolderLink, DataLink, LinkDefinition, PageLink } from './links.js';
|
|
3
3
|
/**
|
|
4
4
|
* Safely encapsulates `content` in header tags based on the `ctx` context passed and adds any passed `attributes` to the header tagging.
|
|
@@ -195,6 +195,16 @@ export interface APIClient {
|
|
|
195
195
|
}) => Promise<PageRecord<PageData> & {
|
|
196
196
|
title: string;
|
|
197
197
|
} | undefined>;
|
|
198
|
+
/**
|
|
199
|
+
* Get the page record for a page, but without data.
|
|
200
|
+
*
|
|
201
|
+
* Helpful for evaluating links when you need more than just an href like you'd get from `resolveLink`.
|
|
202
|
+
*/
|
|
203
|
+
getPageNoData: ({ link }: {
|
|
204
|
+
link: string | PageLink;
|
|
205
|
+
}) => Promise<PageRecordNoData & {
|
|
206
|
+
title: string;
|
|
207
|
+
} | undefined>;
|
|
198
208
|
/** Get all ancestor pages of a specific page. First array element will be the pagetree root page. */
|
|
199
209
|
getAncestors: ({ id, path }: {
|
|
200
210
|
id?: string;
|