import { Connector, Pagination } from './types'; import { Field } from 'canner-graphql-utils/lib/schema/types'; interface Hooks { afterListResolveByUnique?: (key: string, row: any) => void; afterListResolveQuery?: (key: string, rows: any) => void; afterResolveToOne?: (to: string, id: string, row: any) => void; } export default class MemoryConnector implements Connector { private db; private hooks; constructor({ defaultData, hooks }: { defaultData?: any; hooks?: Hooks; }); listResolveByUnique({ key, field, schema }: { key: string; field: { [key: string]: any; }; schema: Field; }): Promise; listResolveQuery({ key, where, order, pagination, schema }: { key: string; where: any; order: any; pagination: Pagination; schema: Field; }): Promise; hasNextPage(): 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; private setDefault; } export {};