import { ParserSyntaxError } from '../../shared';
export type FindModifier = {
    method: 'skip' | 'filter' | 'min' | 'max' | 'returnKey' | 'showRecordId' | 'limit' | 'hint';
    parameters: unknown;
} | {
    method: 'sort';
    parameters?: unknown;
    options?: unknown;
};
export interface ExplainParameters {
    parameters?: unknown;
}
interface CollectionCommandBase {
    type: 'collection';
}
interface DatabaseCommandBase {
    type: 'database';
}
export interface CollectionFindCommand extends CollectionCommandBase {
    method: 'find';
    collectionName: string;
    parameters?: unknown;
    options?: unknown;
    explain?: ExplainParameters;
    modifiers: FindModifier[];
}
export interface CollectionFindOneCommand extends CollectionCommandBase {
    method: 'findOne';
    collectionName: string;
    parameters?: unknown;
    options?: unknown;
}
export interface CollectionFindOneAndDeleteCommand extends CollectionCommandBase {
    method: 'findOneAndDelete';
    collectionName: string;
    parameters: unknown;
    options?: unknown;
}
export interface CollectionFindOneAndReplaceCommand extends CollectionCommandBase {
    method: 'findOneAndReplace';
    collectionName: string;
    parameters: unknown;
    replacement: unknown;
    options?: unknown;
}
export interface CollectionFindOneAndUpdateCommand extends CollectionCommandBase {
    method: 'findOneAndUpdate';
    collectionName: string;
    parameters: unknown;
    newValues: unknown;
    options?: unknown;
}
export interface CollectionInsertOneCommand extends CollectionCommandBase {
    method: 'insertOne';
    collectionName: string;
    document: unknown;
    options?: unknown;
}
export interface CollectionInsertManyCommand extends CollectionCommandBase {
    method: 'insertMany';
    collectionName: string;
    documents: unknown;
    options?: unknown;
}
export interface CollectionBulkWriteCommand extends CollectionCommandBase {
    method: 'bulkWrite';
    collectionName: string;
    operations: unknown;
    options?: unknown;
}
export interface CollectionUpdateOneCommand extends CollectionCommandBase {
    method: 'updateOne';
    collectionName: string;
    filter: unknown;
    updateParameters: unknown;
    options?: unknown;
}
export interface CollectionUpdateManyCommand extends CollectionCommandBase {
    method: 'updateMany';
    collectionName: string;
    filter: unknown;
    updateParameters: unknown;
    options?: unknown;
}
export interface CollectionReplaceOneCommand extends CollectionCommandBase {
    method: 'replaceOne';
    collectionName: string;
    filter: unknown;
    replacement: unknown;
    options?: unknown;
}
export interface CollectionDeleteOneCommand extends CollectionCommandBase {
    method: 'deleteOne';
    collectionName: string;
    filter?: unknown;
    options?: unknown;
}
export interface CollectionDeleteManyCommand extends CollectionCommandBase {
    method: 'deleteMany';
    collectionName: string;
    filter?: unknown;
    options?: unknown;
}
export interface CollectionRenameCommand extends CollectionCommandBase {
    method: 'rename';
    collectionName: string;
    newName: unknown;
    options?: unknown;
}
export interface CollectionDropCommand extends CollectionCommandBase {
    method: 'drop';
    collectionName: string;
    options?: unknown;
}
export interface CollectionIsCappedCommand extends CollectionCommandBase {
    method: 'isCapped';
    collectionName: string;
    options?: unknown;
}
export interface CollectionCreateIndexCommand extends CollectionCommandBase {
    method: 'createIndex';
    collectionName: string;
    indexSpec: unknown;
    options?: unknown;
}
export interface CollectionCreateIndexesCommand extends CollectionCommandBase {
    method: 'createIndexes';
    collectionName: string;
    indexSpecs: unknown;
    options?: unknown;
}
export interface CollectionDropIndexCommand extends CollectionCommandBase {
    method: 'dropIndex';
    collectionName: string;
    index: unknown;
    options?: unknown;
}
export interface CollectionDropIndexesCommand extends CollectionCommandBase {
    method: 'dropIndexes';
    collectionName: string;
    options?: unknown;
}
export interface CollectionListIndexesCommand extends CollectionCommandBase {
    method: 'listIndexes';
    collectionName: string;
    options?: unknown;
}
export interface CollectionIndexesCommand extends CollectionCommandBase {
    method: 'indexes';
    collectionName: string;
    options?: unknown;
}
export interface CollectionIndexExistsCommand extends CollectionCommandBase {
    method: 'indexExists';
    collectionName: string;
    indexes: unknown;
    options?: unknown;
}
export interface CollectionIndexInformationCommand extends CollectionCommandBase {
    method: 'indexInformation';
    collectionName: string;
    options?: unknown;
}
export interface CollectionEstimatedDocumentCountCommand extends CollectionCommandBase {
    method: 'estimatedDocumentCount';
    collectionName: string;
    options?: unknown;
}
export interface CollectionCountDocumentsCommand extends CollectionCommandBase {
    method: 'countDocuments';
    collectionName: string;
    filter?: unknown;
    options?: unknown;
}
export interface CollectionDistinctCommand extends CollectionCommandBase {
    method: 'distinct';
    collectionName: string;
    key: unknown;
    filter?: unknown;
    options?: unknown;
}
export interface CollectionAggregateCommand extends CollectionCommandBase {
    method: 'aggregate';
    collectionName: string;
    pipeline?: unknown;
    options?: unknown;
    explain?: ExplainParameters;
}
export interface DatabaseCreateCollectionCommand extends DatabaseCommandBase {
    method: 'createCollection';
    collectionName: unknown;
    options?: unknown;
}
export interface DatabaseCommandCommand extends DatabaseCommandBase {
    method: 'command';
    document: unknown;
    options?: unknown;
}
export interface DatabaseAggregateCommand extends DatabaseCommandBase, Omit<CollectionAggregateCommand, 'collectionName' | 'type'> {
}
export interface DatabaseListCollectionsCommand extends DatabaseCommandBase {
    method: 'listCollections';
    filter?: unknown;
    options?: unknown;
}
export interface DatabaseRenameCollectionCommand extends DatabaseCommandBase {
    method: 'renameCollection';
    currentName: unknown;
    newName: unknown;
    options?: unknown;
}
export interface DatabaseDropCollectionCommand extends DatabaseCommandBase {
    method: 'dropCollection';
    collectionName: unknown;
    options?: unknown;
}
export interface DatabaseDropDatabaseCommand extends DatabaseCommandBase {
    method: 'dropDatabase';
    options?: unknown;
}
export interface DatabaseCreateIndexCommand extends DatabaseCommandBase {
    method: 'createIndex';
    collectionName: unknown;
    indexSpec: unknown;
    options?: unknown;
}
export interface DatabaseRemoveUserCommand extends DatabaseCommandBase {
    method: 'removeUser';
    username: unknown;
    options?: unknown;
}
export interface DatabaseIndexInformationCommand extends DatabaseCommandBase {
    method: 'indexInformation';
    collectionName: unknown;
    options?: unknown;
}
export interface DatabaseRunCursorCommandCommand extends DatabaseCommandBase {
    method: 'runCursorCommand';
    document: unknown;
    options?: unknown;
}
export interface DatabaseStatsCommand extends DatabaseCommandBase {
    method: 'stats';
    options?: unknown;
}
export interface DatabaseProfilingLevelCommand extends DatabaseCommandBase {
    method: 'profilingLevel';
    options?: unknown;
}
export interface DatabaseSetProfilingLevelCommand extends DatabaseCommandBase {
    method: 'setProfilingLevel';
    level: unknown;
    options?: unknown;
}
export interface DatabaseAdminCommand extends DatabaseCommandBase {
    method: 'admin';
    childMethod: ChildAdminMethod;
}
export type ChildAdminMethod = CommonAdminMethod | ValidateCollectionMethod | RemoveUserMethod | CommandMethod;
export interface CommonAdminMethod {
    method: 'buildInfo' | 'serverStatus' | 'serverInfo' | 'ping' | 'listDatabases' | 'replSetGetStatus';
    options?: unknown;
}
export interface ValidateCollectionMethod {
    method: 'validateCollection';
    collectionName: unknown;
    options?: unknown;
}
export interface RemoveUserMethod {
    method: 'removeUser';
    username: unknown;
    options?: unknown;
}
export interface CommandMethod {
    method: 'command';
    document: unknown;
    options?: unknown;
}
export type DatabaseCommand = DatabaseCreateCollectionCommand | DatabaseCommandCommand | DatabaseAggregateCommand | DatabaseListCollectionsCommand | DatabaseRenameCollectionCommand | DatabaseDropCollectionCommand | DatabaseDropDatabaseCommand | DatabaseCreateIndexCommand | DatabaseRemoveUserCommand | DatabaseIndexInformationCommand | DatabaseRunCursorCommandCommand | DatabaseStatsCommand | DatabaseProfilingLevelCommand | DatabaseSetProfilingLevelCommand | DatabaseAdminCommand;
export type CollectionCommand = CollectionFindCommand | CollectionFindOneCommand | CollectionFindOneAndDeleteCommand | CollectionFindOneAndReplaceCommand | CollectionFindOneAndUpdateCommand | CollectionInsertOneCommand | CollectionInsertManyCommand | CollectionBulkWriteCommand | CollectionUpdateOneCommand | CollectionUpdateManyCommand | CollectionReplaceOneCommand | CollectionDeleteOneCommand | CollectionDeleteManyCommand | CollectionRenameCommand | CollectionDropCommand | CollectionIsCappedCommand | CollectionCreateIndexCommand | CollectionCreateIndexesCommand | CollectionDropIndexCommand | CollectionDropIndexesCommand | CollectionListIndexesCommand | CollectionIndexesCommand | CollectionIndexExistsCommand | CollectionIndexInformationCommand | CollectionEstimatedDocumentCountCommand | CollectionCountDocumentsCommand | CollectionDistinctCommand | CollectionAggregateCommand;
export type Command = CollectionCommand | DatabaseCommand;
export interface ParsingError {
    type: 'parsingError';
    message: string;
}
export interface UnexpectedError {
    type: 'unexpectedError';
    message: unknown;
}
type ExtractionError = ParsingError | UnexpectedError;
export type ExtractMongoCommandsFromQueryResult = {
    commands: Command[];
    parseSyntaxErrors?: undefined;
    parseCommandErrors?: undefined;
} | {
    parseSyntaxErrors: ParserSyntaxError[];
    parseCommandErrors?: undefined;
    commands?: undefined;
} | {
    parseCommandErrors: ExtractionError[];
    parseSyntaxErrors?: undefined;
    commands?: undefined;
};
export declare function extractMongoCommandsFromQuery(query: string): ExtractMongoCommandsFromQueryResult;
export {};
