chore: types more app exports

This commit is contained in:
James 2024-03-01 12:01:20 -05:00
parent 87b5cc7762
commit cbe282b5fd
3 changed files with 36 additions and 6 deletions

View File

@ -1,13 +1,26 @@
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
import { Document, generateMetadata as generateMeta } from '@payloadcms/next/pages/Document' import { Document, generateMetadata as generateMeta } from '@payloadcms/next/pages/Document/index'
import config from '@payload-config' import config from '@payload-config'
export const generateMetadata = async ({ params }) => generateMeta({ config, params }) type Args = {
params: {
global?: string
collection?: string
segments: string[]
}
searchParams: {
[key: string]: string | string[]
}
}
export default ({ params, searchParams }) => export const generateMetadata = async ({ params }: Args) => generateMeta({ config, params })
const Page: React.FC<Args> = ({ params, searchParams }) =>
Document({ Document({
config, config,
params, params,
searchParams, searchParams,
}) })
export default Page

View File

@ -1,11 +1,20 @@
/* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */ /* THIS FILE WAS GENERATED AUTOMATICALLY BY PAYLOAD. */
/* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */ /* DO NOT MODIFY IT BECAUSE IT COULD BE REWRITTEN AT ANY TIME. */
import React from 'react' import React from 'react'
import { DocumentLayout } from '@payloadcms/next/layouts/Document' import { DocumentLayout } from '@payloadcms/next/layouts/Document/index'
import configPromise from '@payload-config' import configPromise from '@payload-config'
export default async ({ children, params }: { children: React.ReactNode; params }) => ( type Args = {
children: React.ReactNode
params: {
global: string
}
}
const Layout: React.FC<Args> = async ({ children, params }) => (
<DocumentLayout config={configPromise} globalSlug={params.global}> <DocumentLayout config={configPromise} globalSlug={params.global}>
{children} {children}
</DocumentLayout> </DocumentLayout>
) )
export default Layout

View File

@ -4,6 +4,14 @@ import { Dashboard, generateMetadata as generateMeta } from '@payloadcms/next/pa
import { Metadata } from 'next' import { Metadata } from 'next'
import config from '@payload-config' import config from '@payload-config'
type Args = {
searchParams: {
[key: string]: string | string[]
}
}
export const generateMetadata = async (): Promise<Metadata> => generateMeta({ config }) export const generateMetadata = async (): Promise<Metadata> => generateMeta({ config })
export default async ({ searchParams }) => Dashboard({ config, searchParams }) const Page: React.FC<Args> = async ({ searchParams }) => Dashboard({ config, searchParams })
export default Page