Skip to content

Commit

Permalink
refactor(plugin-seo): strongly type collection and global slugs in pl…
Browse files Browse the repository at this point in the history
…ugin config (#9962)
  • Loading branch information
AlessioGr authored Dec 13, 2024
1 parent 1d6a935 commit c167365
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions packages/plugin-seo/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import type { DocumentInfoContext } from '@payloadcms/ui'
import type { CollectionConfig, Field, GlobalConfig, PayloadRequest } from 'payload'
import type {
CollectionConfig,
CollectionSlug,
Field,
GlobalConfig,
GlobalSlug,
PayloadRequest,
} from 'payload'

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

Expand Down Expand Up @@ -63,7 +70,7 @@ export type SEOPluginConfig = {
/**
* Collections to include the SEO fields in
*/
collections?: string[]
collections?: CollectionSlug[]
/**
* Override the default fields inserted by the SEO plugin via a function that receives the default fields and returns the new fields
*
Expand All @@ -80,7 +87,7 @@ export type SEOPluginConfig = {
/**
* Globals to include the SEO fields in
*/
globals?: string[]
globals?: GlobalSlug[]
interfaceName?: string
/**
* Group fields into tabs, your content will be automatically put into a general tab and the SEO fields into an SEO tab
Expand All @@ -91,7 +98,7 @@ export type SEOPluginConfig = {
/**
* The slug of the collection used to handle image uploads
*/
uploadsCollection?: string
uploadsCollection?: CollectionSlug
}

export type Meta = {
Expand Down

0 comments on commit c167365

Please sign in to comment.