Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
42 lines
2.0 KiB
Plaintext
42 lines
2.0 KiB
Plaintext
import type { DeepPartial } from 'ts-essentials';
|
|
import type { CollectionSlug, FileToSave, SanitizedConfig, TypedFallbackLocale } from '../../../index.js';
|
|
import type { JsonObject, Payload, PayloadRequest, PopulateType, SelectType, TransformCollectionWithSelect } from '../../../types/index.js';
|
|
import type { DataFromCollectionSlug, SanitizedCollectionConfig, SelectFromCollectionSlug, TypeWithID } from '../../config/types.js';
|
|
export type SharedUpdateDocumentArgs<TSlug extends CollectionSlug> = {
|
|
autosave: boolean;
|
|
collectionConfig: SanitizedCollectionConfig;
|
|
config: SanitizedConfig;
|
|
data: DeepPartial<DataFromCollectionSlug<TSlug>>;
|
|
depth: number;
|
|
docWithLocales: JsonObject & TypeWithID;
|
|
draftArg: boolean;
|
|
fallbackLocale: TypedFallbackLocale;
|
|
filesToUpload: FileToSave[];
|
|
id: number | string;
|
|
locale: string;
|
|
overrideAccess: boolean;
|
|
overrideLock: boolean;
|
|
payload: Payload;
|
|
populate?: PopulateType;
|
|
publishAllLocales?: boolean;
|
|
publishSpecificLocale?: string;
|
|
req: PayloadRequest;
|
|
select: SelectType;
|
|
showHiddenFields: boolean;
|
|
unpublishAllLocales?: boolean;
|
|
};
|
|
/**
|
|
* This function is used to update a document in the DB and return the result.
|
|
*
|
|
* It runs the following hooks in order:
|
|
* - beforeValidate - Fields
|
|
* - beforeValidate - Collection
|
|
* - beforeChange - Collection
|
|
* - beforeChange - Fields
|
|
* - afterRead - Fields
|
|
* - afterRead - Collection
|
|
* - afterChange - Fields
|
|
* - afterChange - Collection
|
|
*/
|
|
export declare const updateDocument: <TSlug extends CollectionSlug, TSelect extends SelectFromCollectionSlug<TSlug> = SelectType>({ id, autosave, collectionConfig, config, data, depth, docWithLocales, draftArg, fallbackLocale, filesToUpload, locale, overrideAccess, overrideLock, payload, populate, publishAllLocales: publishAllLocalesArg, publishSpecificLocale, req, select, showHiddenFields, unpublishAllLocales: unpublishAllLocalesArg, }: SharedUpdateDocumentArgs<TSlug>) => Promise<TransformCollectionWithSelect<TSlug, TSelect>>;
|
|
//# sourceMappingURL=update.d.ts.map |