further typing

This commit is contained in:
James
2020-11-30 08:42:06 -05:00
parent dbc403319d
commit 7644b031c1
7 changed files with 20 additions and 21 deletions

View File

@@ -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;

View File

@@ -1,5 +1,4 @@
import joi from 'joi';
import path from 'path';
import collectionSchema from '../collections/config/schema';
import globalSchema from '../globals/config/schema';

View File

@@ -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[];

View File

@@ -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?: {