import { Field } from 'canner-graphql-utils/lib/schema/types'; export interface Pagination { last: number; first: number; before: string; after: string; } export interface Connector { connect?: () => Promise; prepare?: (props: any) => Promise; disconnect?: () => Promise; equals?(connector: Connector): boolean; preListResolveByUnique?({ document }: { document: any; }): any; listResolveByUnique({ key, field, document, schema }: { key: string; field: { [key: string]: any; }; document?: any; schema?: any; }): Promise; postListResolveByUnique?({ document, value }: { document: any; value: any; }): any; listResolveQuery({ key, where, order, pagination, document, schema }: { key: string; where?: any; order?: any; pagination?: Pagination; document?: any; schema?: any; }): Promise; hasNextPage({ key, id }: { key: string; id: string; }): Promise; resolveToOne({ from, to, id, schema }: { from: string; to: string; id: string; schema: Field; }): Promise; resolveToMany({ from, to, ids, pagination, schema }: { from: string; to: string; ids: [string]; pagination: Pagination; schema: Field; }): Promise; mapResolve(key: string, schema: Field): Promise; mapUpdate(key: string, payload: any, schema: Field): Promise; listCreate(key: string, payload: any, schema: Field): Promise; listUpdate(key: string, where: any, payload: any, schema: Field): Promise; listDelete(key: string, where: any, schema: Field): Promise; }