@dosgato/templating 1.1.7 → 1.1.8

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.
@@ -355,7 +355,7 @@ export interface SiteInfo {
355
355
  path: string;
356
356
  };
357
357
  }
358
- export interface PageRecord<DataType extends PageData = PageData> {
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,14 @@ 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 | undefined>;
198
206
  /** Get all ancestor pages of a specific page. First array element will be the pagetree root page. */
199
207
  getAncestors: ({ id, path }: {
200
208
  id?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dosgato/templating",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "description": "A library to support building templates for dosgato CMS.",
5
5
  "type": "module",
6
6
  "exports": {