further typing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Collection } from './types';
|
||||
import { PayloadCollectionConfig } from './types';
|
||||
|
||||
const buildCollection = (collection: Collection) => collection;
|
||||
const buildCollection = (collection: PayloadCollectionConfig): PayloadCollectionConfig => collection;
|
||||
|
||||
module.exports = buildCollection;
|
||||
export default buildCollection;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import joi from 'joi';
|
||||
import path from 'path';
|
||||
import collectionSchema from '../collections/config/schema';
|
||||
import globalSchema from '../globals/config/schema';
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ type MockEmailTransport = {
|
||||
fromName?: string;
|
||||
fromAddress?: string;
|
||||
};
|
||||
|
||||
type ValidEmailTransport = {
|
||||
transport: Transporter;
|
||||
transportOptions?: SMTPConnection.Options;
|
||||
@@ -101,9 +102,13 @@ export type PayloadConfig = {
|
||||
localization?: {
|
||||
locales: string[]
|
||||
defaultLocale: string
|
||||
fallback?: boolean
|
||||
};
|
||||
defaultLocale?: string;
|
||||
fallback?: boolean;
|
||||
compression: {
|
||||
[key: string]: unknown
|
||||
},
|
||||
graphQL?: {
|
||||
mutations?: {
|
||||
[key: string]: unknown
|
||||
@@ -117,7 +122,7 @@ export type PayloadConfig = {
|
||||
components?: { [key: string]: JSX.Element | (() => JSX.Element) };
|
||||
paths?: { [key: string]: string };
|
||||
hooks?: {
|
||||
afterError?: () => void;
|
||||
afterError?: (err: Error) => void;
|
||||
};
|
||||
webpack?: (config: Configuration) => Configuration;
|
||||
serverModules?: string[];
|
||||
|
||||
@@ -16,8 +16,8 @@ export type FieldHook = (args: {
|
||||
}) => Promise<unknown> | unknown;
|
||||
|
||||
type FieldBase = {
|
||||
name: string;
|
||||
label: string;
|
||||
name?: string;
|
||||
label?: string;
|
||||
slug?: string;
|
||||
required?: boolean;
|
||||
unique?: boolean;
|
||||
@@ -26,7 +26,6 @@ type FieldBase = {
|
||||
hidden?: boolean;
|
||||
localized?: boolean;
|
||||
maxLength?: number;
|
||||
height?: number;
|
||||
validate?: (value: any, field: Field) => any;
|
||||
// eslint-disable-next-line no-use-before-define
|
||||
hooks?: {
|
||||
|
||||
Reference in New Issue
Block a user