import SchemaInspector from '@directus/schema';
import { Knex } from 'knex';
import Keyv from 'keyv';
import { AbstractServiceOptions, Collection, CollectionMeta, MutationOptions } from '../types';
import { Accountability, RawField, SchemaOverview } from '@directus/shared/types';
import { Table } from 'knex-schema-inspector/dist/types/table';
export declare type RawCollection = {
collection: string;
fields?: RawField[];
schema?: Partial
| null;
meta?: Partial | null;
};
export declare class CollectionsService {
knex: Knex;
accountability: Accountability | null;
schemaInspector: ReturnType;
schema: SchemaOverview;
cache: Keyv | null;
systemCache: Keyv;
options: {
isSystem?: boolean;
} | undefined;
constructor(options: AbstractServiceOptions);
/**
* Create a single new collection
*/
createOne(payload: RawCollection, opts?: MutationOptions): Promise;
/**
* Create multiple new collections
*/
createMany(payloads: RawCollection[], opts?: MutationOptions): Promise;
/**
* Read all collections. Currently doesn't support any query.
*/
readByQuery(opts?: {
includePhysicalTable?: boolean;
includeExternalTable?: boolean;
}): Promise;
/**
* Get a single collection by name
*/
readOne(collectionKey: string): Promise;
/**
* Read many collections by name
*/
readMany(collectionKeys: string[]): Promise;
/**
* Update a single collection by name
*/
updateOne(collectionKey: string, data: Partial, opts?: MutationOptions): Promise;
/**
* Update multiple collections by name
*/
updateMany(collectionKeys: string[], data: Partial, opts?: MutationOptions): Promise;
/**
* Delete a single collection This will delete the table and all records within. It'll also
* delete any fields, presets, activity, revisions, and permissions relating to this collection
*/
deleteOne(collectionKey: string, opts?: MutationOptions): Promise;
/**
* Delete multiple collections by key
*/
deleteMany(collectionKeys: string[], opts?: MutationOptions): Promise;
}