import { Datastore } from '@google-cloud/datastore'; import { entity as Entity } from '@google-cloud/datastore/build/src/entity'; import { RunQueryInfo } from '@google-cloud/datastore/build/src/query'; import * as t from 'io-ts'; import { Omit, OneOrMany } from '../util/types'; import { Context } from './context'; import { Index, QueryOptions } from './loader'; export interface RepositoryOptions { defaultValues?: Partial>; index?: Index>; } export declare function buildExclusions(input: T, schema?: Index, path?: string): string[]; export declare const datastoreKey: t.Type; export declare const dateType: t.Type; export interface BaseEntity { id: string; } export declare class Repository { private readonly datastore; protected readonly kind: string; protected readonly options: RepositoryOptions; private readonly validator; constructor(datastore: Datastore, kind: string, validator: t.Type, options?: RepositoryOptions); getRequired(context: Context, id: string): Promise; get(context: Context, id: string): Promise; get(context: Context, id: ReadonlyArray): Promise | undefined>; query(context: Context, options?: Partial>): Promise<[ReadonlyArray, RunQueryInfo]>; save(context: Context, entities: T): Promise; save(context: Context, entities: ReadonlyArray): Promise>; update(context: Context, entities: T): Promise; update(context: Context, entities: ReadonlyArray): Promise>; insert(context: Context, entities: T): Promise; insert(context: Context, entities: ReadonlyArray): Promise>; upsert(context: Context, entities: T): Promise; upsert(context: Context, entities: ReadonlyArray): Promise>; protected beforePersist(context: Context, entities: OneOrMany): OneOrMany; reindex(context: Context, operation?: (input: T) => T | Promise): Promise; delete(context: Context, ...ids: string[]): Promise; deleteAll(context: Context): Promise; key: (name: string) => Entity.Key; private validate; private applyMutation; }