import type { DeepPartial } from 'ts-essentials'; import type { Document, PayloadRequest, PopulateType, SelectType, TransformGlobalWithSelect } from '../../../types/index.js'; import type { DataFromGlobalSlug, DraftFlagFromGlobalSlug, SelectFromGlobalSlug } from '../../config/types.js'; import { type FindOptions, type GlobalSlug, type Payload, type RequestContext, type TypedLocale } from '../../../index.js'; type BaseOptions = { /** * [Context](https://payloadcms.com/docs/hooks/context), which will then be passed to `context` and `req.context`, * which can be read by hooks. Useful if you want to pass additional information to the hooks which * shouldn't be necessarily part of the document, for example a `triggerBeforeChange` option which can be read by the BeforeChange hook * to determine if it should run or not. */ context?: RequestContext; /** * The global data to update. */ data: DeepPartial, 'id'>>; /** * [Control auto-population](https://payloadcms.com/docs/queries/depth) of nested relationship and upload fields. */ depth?: number; /** * Specify a [fallback locale](https://payloadcms.com/docs/configuration/localization) to use for any returned documents. */ fallbackLocale?: false | TypedLocale; /** * Specify [locale](https://payloadcms.com/docs/configuration/localization) for any returned documents. */ locale?: 'all' | TypedLocale; /** * Skip access control. * Set to `false` if you want to respect Access Control for the operation, for example when fetching data for the front-end. * @default true */ overrideAccess?: boolean; /** * If you are uploading a file and would like to replace * the existing file instead of generating a new filename, * you can set the following property to `true` */ overrideLock?: boolean; /** * Specify [populate](https://payloadcms.com/docs/queries/select#populate) to control which fields to include to the result from populated documents. */ populate?: PopulateType; /** * Publish the document / documents in all locales. Requires `versions.drafts.localizeStatus` to be enabled. * * @default undefined */ publishAllLocales?: boolean; /** * Publish the document / documents with a specific locale. */ publishSpecificLocale?: TypedLocale; /** * The `PayloadRequest` object. You can pass it to thread the current [transaction](https://payloadcms.com/docs/database/transactions), user and locale to the operation. * Recommended to pass when using the Local API from hooks, as usually you want to execute the operation within the current transaction. */ req?: Partial; /** * Opt-in to receiving hidden fields. By default, they are hidden from returned documents in accordance to your config. * @default false */ showHiddenFields?: boolean; /** * the Global slug to operate against. */ slug: TSlug; /** * Unpublish the document / documents in all locales. Requires `versions.drafts.localizeStatus` to be enabled. */ unpublishAllLocales?: boolean; /** * If you set `overrideAccess` to `false`, you can pass a user to use against the access control checks. */ user?: Document; } & Pick, 'select'>; export type Options = BaseOptions & DraftFlagFromGlobalSlug; export declare function updateGlobalLocal>(payload: Payload, options: Options): Promise>; export {}; //# sourceMappingURL=update.d.ts.map