@dosgato/templating 0.0.53 → 0.0.56
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 +11 -0
- package/package.json +2 -1
package/dist/component.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import type { IncomingHttpHeaders } from 'http';
|
|
4
|
+
import type { ParsedUrlQuery } from 'querystring';
|
|
1
5
|
import { ResourceProvider } from './provider.js';
|
|
2
6
|
import { APIClient } from './render.js';
|
|
3
7
|
/**
|
|
@@ -179,6 +183,8 @@ export declare abstract class Component<DataType extends ComponentData = any, Fe
|
|
|
179
183
|
renderedAreas: Map<string, RenderedComponent[]>;
|
|
180
184
|
hadError: boolean;
|
|
181
185
|
autoLabel: string;
|
|
186
|
+
reqHeaders: IncomingHttpHeaders;
|
|
187
|
+
reqQuery: ParsedUrlQuery;
|
|
182
188
|
/**
|
|
183
189
|
* For logging errors during rendering without crashing the render. If your fetch, setContext,
|
|
184
190
|
* render, or renderVariation functions throw, the error will be logged but the page render will
|
|
@@ -243,6 +249,11 @@ export declare abstract class Page<DataType extends PageData = any, FetchedType
|
|
|
243
249
|
* should place include it in the <head> element
|
|
244
250
|
*/
|
|
245
251
|
headContent: string;
|
|
252
|
+
/**
|
|
253
|
+
* This method will be provided to page templates by the render server. You may call it
|
|
254
|
+
* at any time during fetch, context, or render, to set an HTTP header on the response
|
|
255
|
+
*/
|
|
256
|
+
addHeader: (key: string, value: string | undefined) => void;
|
|
246
257
|
protected passError(e: Error, path: string): void;
|
|
247
258
|
constructor(page: PageRecord<DataType>, editMode: boolean);
|
|
248
259
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dosgato/templating",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.56",
|
|
4
4
|
"description": "A library to support building templates for dosgato CMS.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"txstate-utils": "^1.7.4"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
+
"@types/node": "^18.7.11",
|
|
21
22
|
"eslint-config-standard-with-typescript": "^22.0.0",
|
|
22
23
|
"typescript": "^4.4.2"
|
|
23
24
|
},
|