@dosgato/templating 1.1.3 → 1.1.5
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 +11 -1
- package/package.json +1 -1
package/dist/apitemplate.d.ts
CHANGED
|
@@ -137,6 +137,16 @@ export interface APITemplate<DataType> {
|
|
|
137
137
|
* and set it any time you encounter an id or reference.
|
|
138
138
|
*/
|
|
139
139
|
onCopy?: (data: DataType, pageCopy: boolean, workspace: Record<string, any>) => void;
|
|
140
|
+
/**
|
|
141
|
+
* This is very similar to onCopy, but it is called when a page is being imported instead of
|
|
142
|
+
* copied. In this case it is possible but not guaranteed that the original page still exists.
|
|
143
|
+
*
|
|
144
|
+
* Usually you want to avoid regenerating ids during an import because export/import is about
|
|
145
|
+
* archiving and restoring pages, so we'd prefer to restore them exactly as they were. However,
|
|
146
|
+
* since the original can still exist, anything that MUST be globally unique should be regenerated,
|
|
147
|
+
* just in case.
|
|
148
|
+
*/
|
|
149
|
+
onImport?: (data: DataType, workspace: Record<string, any>) => void;
|
|
140
150
|
/**
|
|
141
151
|
* The available component list in the main content area can get very long, among others. Therefore, each
|
|
142
152
|
* template may set a displayCategory and any templates that share a displayCategory will be grouped together
|
|
@@ -273,7 +283,7 @@ export interface APIDataTemplate<DataType extends DataData = any> extends APITem
|
|
|
273
283
|
* cases, you can set this to true and all entries will be automatically published to latest
|
|
274
284
|
* on every change.
|
|
275
285
|
*/
|
|
276
|
-
nopublish
|
|
286
|
+
nopublish?: boolean;
|
|
277
287
|
}
|
|
278
288
|
export type APIAnyTemplate = APIComponentTemplate | APIPageTemplate | APIDataTemplate;
|
|
279
289
|
/**
|