feat: properly export types
This commit is contained in:
@@ -130,7 +130,7 @@ import {
|
||||
GenerateTitle,
|
||||
GenerateDescription
|
||||
GenerateURL
|
||||
} from '@payloadcms/plugin-seo/dist/types';
|
||||
} from '@payloadcms/plugin-seo/types';
|
||||
```
|
||||
|
||||
## Development
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { buildConfig } from 'payload/config';
|
||||
import path from 'path';
|
||||
// import seo from '../../dist';
|
||||
import seo from '../../src';
|
||||
import Users from './collections/Users';
|
||||
import Pages from './collections/Pages';
|
||||
import Media from './collections/Media';
|
||||
import HomePage from './globals/Settings';
|
||||
import Posts from './collections/Posts';
|
||||
import seo from '../../src'
|
||||
import Users from './collections/Users'
|
||||
import Pages from './collections/Pages'
|
||||
import Media from './collections/Media'
|
||||
import HomePage from './globals/Settings'
|
||||
import Posts from './collections/Posts'
|
||||
|
||||
export default buildConfig({
|
||||
serverURL: 'http://localhost:3000',
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
"typescript": "^4.5.5"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
"dist",
|
||||
"*.js",
|
||||
"*.d.ts"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
import { Field } from "payload/dist/fields/config/types";
|
||||
import { Field } from 'payload/dist/fields/config/types';
|
||||
|
||||
export type GenerateTitle = <T = any>(args: { doc: T; locale?: string }) => string | Promise<string>
|
||||
export type GenerateDescription = <T = any>(args: {
|
||||
doc: T
|
||||
locale?: string
|
||||
}) => string | Promise<string>
|
||||
export type GenerateImage = <T = any>(args: { doc: T; locale?: string }) => string | Promise<string>
|
||||
export type GenerateURL = <T = any>(args: { doc: T; locale?: string }) => string | Promise<string>
|
||||
|
||||
export type PluginConfig = {
|
||||
collections?: string[]
|
||||
@@ -6,10 +14,10 @@ export type PluginConfig = {
|
||||
uploadsCollection?: string
|
||||
fields?: Partial<Field>[]
|
||||
tabbedUI?: boolean
|
||||
generateTitle?: <T = any>(args: { doc: T, locale?: string }) => string | Promise<string>
|
||||
generateDescription?: <T = any>(args: { doc: T, locale?: string }) => string | Promise<string>
|
||||
generateImage?: <T = any>(args: { doc: T, locale?: string }) => string | Promise<string>
|
||||
generateURL?: <T = any>(args: { doc: T, locale?: string }) => string | Promise<string>
|
||||
generateTitle?: GenerateTitle
|
||||
generateDescription?: GenerateDescription
|
||||
generateImage?: GenerateImage
|
||||
generateURL?: GenerateURL
|
||||
}
|
||||
|
||||
export type Meta = {
|
||||
|
||||
1
packages/plugin-seo/types.d.ts
vendored
Normal file
1
packages/plugin-seo/types.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from './dist/types';
|
||||
1
packages/plugin-seo/types.js
Normal file
1
packages/plugin-seo/types.js
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = require('./dist/types');
|
||||
Reference in New Issue
Block a user