@prismicio/client
Version:
The official JavaScript + TypeScript client library for Prismic
50 lines (49 loc) • 1.54 kB
JavaScript
//#region src/types/migration/Document.ts
/**
* A Prismic migration document instance.
*
* @typeParam TDocument - Type of the Prismic document.
*/
var PrismicMigrationDocument = class {
/**
* The document to be sent to the Migration API.
*/
document;
/**
* The name of the document displayed in the editor.
*/
title;
/**
* The link to the master language document to relate the document to if any.
*/
masterLanguageDocument;
/**
* Original Prismic document when the migration document came from another
* Prismic repository.
*
* @remarks
* When migrating a document from another repository, one might want to alter
* it with migration specific types, hence accepting an
* `ExistingPrismicDocument` instead of a regular `PrismicDocument`.
*/
originalPrismicDocument;
/**
* Creates a Prismic migration document instance.
*
* @param document - The document to be sent to the Migration API.
* @param title - The name of the document displayed in the editor.
* @param params - Parameters to create/update the document with on the
* Migration API.
*
* @returns A Prismic migration document instance.
*/
constructor(document, title, params) {
this.document = document;
this.title = title;
this.masterLanguageDocument = params === null || params === void 0 ? void 0 : params.masterLanguageDocument;
this.originalPrismicDocument = params === null || params === void 0 ? void 0 : params.originalPrismicDocument;
}
};
//#endregion
export { PrismicMigrationDocument };
//# sourceMappingURL=Document.js.map