diff --git a/types/keystonejs__keystone/index.d.ts b/types/keystonejs__keystone/index.d.ts index f4894f06d5..10a1c41543 100644 --- a/types/keystonejs__keystone/index.d.ts +++ b/types/keystonejs__keystone/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for @keystonejs/keystone 5.2 +// Type definitions for @keystonejs/keystone 6.0 // Project: https://github.com/keystonejs/keystone // Definitions by: Kevin Brown // Timothee Clain +// Abhijith Vijayan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 3.5 @@ -48,7 +49,21 @@ declare module '@keystonejs/keystone' { } interface AuthenticationContext { - authentication: { item: any }; // TODO + authentication: { + item: { + id: string; + name: string; + email: string; + isAdmin: boolean; + password: string; + }; + listKey: string; + operation: string; + originalInput?: any; // TODO: types + gqlName: string; + itemId?: any; // TODO: types + itemIds?: any; // TODO: types + }; } interface GraphQLWhereClause { @@ -217,6 +232,11 @@ declare module '@keystonejs/keystone' { mutations?: GraphQLExtension[]; } + interface QueryExecutionSchema { + variables?: any; + context?: any; + } + class Keystone { constructor(options: KeystoneOptions); @@ -228,7 +248,7 @@ declare module '@keystonejs/keystone' { // The return type is actually important info here. I don't believe this generic is unnecessary. // tslint:disable-next-line:no-unnecessary-generics - executeQuery(query: string, config: { variables: any; context: any }): Output; + executeQuery(query: string, config?: QueryExecutionSchema): Output; connect(): Promise; disconnect(): Promise;