Skip to content

Commit c167365

Browse files
authored
refactor(plugin-seo): strongly type collection and global slugs in plugin config (#9962)
1 parent 1d6a935 commit c167365

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

packages/plugin-seo/src/types.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
import type { DocumentInfoContext } from '@payloadcms/ui'
2-
import type { CollectionConfig, Field, GlobalConfig, PayloadRequest } from 'payload'
2+
import type {
3+
CollectionConfig,
4+
CollectionSlug,
5+
Field,
6+
GlobalConfig,
7+
GlobalSlug,
8+
PayloadRequest,
9+
} from 'payload'
310

411
export type FieldsOverride = (args: { defaultFields: Field[] }) => Field[]
512

@@ -63,7 +70,7 @@ export type SEOPluginConfig = {
6370
/**
6471
* Collections to include the SEO fields in
6572
*/
66-
collections?: string[]
73+
collections?: CollectionSlug[]
6774
/**
6875
* Override the default fields inserted by the SEO plugin via a function that receives the default fields and returns the new fields
6976
*
@@ -80,7 +87,7 @@ export type SEOPluginConfig = {
8087
/**
8188
* Globals to include the SEO fields in
8289
*/
83-
globals?: string[]
90+
globals?: GlobalSlug[]
8491
interfaceName?: string
8592
/**
8693
* Group fields into tabs, your content will be automatically put into a general tab and the SEO fields into an SEO tab
@@ -91,7 +98,7 @@ export type SEOPluginConfig = {
9198
/**
9299
* The slug of the collection used to handle image uploads
93100
*/
94-
uploadsCollection?: string
101+
uploadsCollection?: CollectionSlug
95102
}
96103

97104
export type Meta = {

0 commit comments

Comments
 (0)