@dosgato/templating 0.0.23 → 0.0.24
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/apitemplate.d.ts +3 -3
- package/dist/component.d.ts +1 -5
- package/dist/component.js +0 -1
- package/package.json +1 -1
package/dist/apitemplate.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PageRecord, ComponentData } from './component.js';
|
|
2
2
|
import { LinkDefinition } from './links.js';
|
|
3
3
|
export declare type APITemplateType = 'page' | 'component' | 'data';
|
|
4
4
|
/**
|
|
@@ -85,8 +85,8 @@ export interface APITemplate {
|
|
|
85
85
|
*/
|
|
86
86
|
export interface Migration {
|
|
87
87
|
createdAt: Date;
|
|
88
|
-
up: (data: ComponentData, page:
|
|
89
|
-
down: (data: ComponentData, page:
|
|
88
|
+
up: (data: ComponentData, page: PageRecord) => ComponentData | Promise<ComponentData>;
|
|
89
|
+
down: (data: ComponentData, page: PageRecord) => ComponentData | Promise<ComponentData>;
|
|
90
90
|
}
|
|
91
91
|
export declare type LinkGatheringFn = (data: any) => LinkDefinition[];
|
|
92
92
|
export declare type FulltextGatheringFn = (data: any) => string[];
|
package/dist/component.d.ts
CHANGED
|
@@ -166,9 +166,6 @@ export interface PageRecord<DataType extends PageData = PageData> {
|
|
|
166
166
|
path: string;
|
|
167
167
|
data: DataType;
|
|
168
168
|
}
|
|
169
|
-
export interface PageWithAncestors<DataType extends PageData = PageData> extends PageRecord<DataType> {
|
|
170
|
-
ancestors: PageRecord<PageData>[];
|
|
171
|
-
}
|
|
172
169
|
export interface ComponentData {
|
|
173
170
|
templateKey: string;
|
|
174
171
|
areas?: Record<string, ComponentData[]>;
|
|
@@ -194,7 +191,6 @@ export interface ContextBase {
|
|
|
194
191
|
}
|
|
195
192
|
export declare abstract class Page<DataType extends PageData = any, FetchedType = any, RenderContextType extends ContextBase = any> extends Component<DataType, FetchedType, RenderContextType> {
|
|
196
193
|
pagePath: string;
|
|
197
|
-
ancestors: PageRecord[];
|
|
198
194
|
/**
|
|
199
195
|
* we will fill this before rendering, stuff that dosgato knows needs to be added to
|
|
200
196
|
* the <head> element
|
|
@@ -202,5 +198,5 @@ export declare abstract class Page<DataType extends PageData = any, FetchedType
|
|
|
202
198
|
*/
|
|
203
199
|
headContent: string;
|
|
204
200
|
protected passError(e: Error, path: string): void;
|
|
205
|
-
constructor(page:
|
|
201
|
+
constructor(page: PageRecord<DataType>);
|
|
206
202
|
}
|
package/dist/component.js
CHANGED
|
@@ -167,7 +167,6 @@ export class Page extends Component {
|
|
|
167
167
|
constructor(page) {
|
|
168
168
|
super(page.data, '/', undefined);
|
|
169
169
|
this.pagePath = page.path;
|
|
170
|
-
this.ancestors = page.ancestors;
|
|
171
170
|
}
|
|
172
171
|
passError(e, path) {
|
|
173
172
|
console.warn(`Recoverable issue occured during render of ${this.pagePath}. Component at ${path} threw the following error:`, e);
|