@dosgato/templating 0.0.51 → 0.0.52

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.
@@ -107,7 +107,7 @@ export interface APIComponentTemplate extends APITemplate {
107
107
  *
108
108
  * See the ComponentExtras type to see all the contextual information you'll have available.
109
109
  */
110
- validate?: (data: ComponentData, extras: ComponentExtras) => Promise<ValidationFeedback[]>;
110
+ validate?: <T extends ComponentData>(data: T, extras: ComponentExtras) => Promise<ValidationFeedback[]>;
111
111
  /**
112
112
  * Each template must provide a list of migrations for upgrading the data schema over time.
113
113
  * Typically this will start as an empty array and migrations will be added as the template
@@ -124,7 +124,7 @@ export interface APIPageTemplate extends APITemplate {
124
124
  /**
125
125
  * Page template implementations do not receive a path like component templates do.
126
126
  */
127
- validate?: (data: PageData, extras: PageExtras) => Promise<ValidationFeedback[]>;
127
+ validate?: <T extends PageData>(data: T, extras: PageExtras) => Promise<ValidationFeedback[]>;
128
128
  migrations?: PageMigration[];
129
129
  /**
130
130
  * Hard-coded properties that may be set on page templates to influence the rendering of
@@ -144,7 +144,7 @@ export interface APIDataTemplate extends APITemplate {
144
144
  * as well as the folder id (if applicable) and their own id. Keep in mind dataId will be
145
145
  * null when it is a creation operation.
146
146
  */
147
- validate?: (data: ComponentData, extras: DataExtras) => Promise<ValidationFeedback[]>;
147
+ validate?: <T extends DataData>(data: T, extras: DataExtras) => Promise<ValidationFeedback[]>;
148
148
  migrations?: DataMigration[];
149
149
  }
150
150
  export declare type APIAnyTemplate = APIComponentTemplate | APIPageTemplate | APIDataTemplate;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dosgato/templating",
3
- "version": "0.0.51",
3
+ "version": "0.0.52",
4
4
  "description": "A library to support building templates for dosgato CMS.",
5
5
  "type": "module",
6
6
  "exports": {