import type { AutoEncryptionOptions, ConnectionExtraInfo, ConnectionInfo, ServerApi, ServiceProvider, ServiceProviderBaseCursor } from '@mongosh/service-provider-core'; import type { ApiEvent, ApiEventWithArguments, ConfigProvider, MongoshBus, ShellUserConfig } from '@mongosh/types'; import { type Topologies } from './enums'; import type { ShellResult, DatabaseWithSchema } from './index'; import { Mongo, ShellApi } from './index'; import { InterruptFlag } from './interruptor'; import { type ShellBson, type BSON as BSONLibrary } from '@mongosh/shell-bson'; import { ShellLog } from './shell-log'; import type { AutocompletionContext } from '@mongodb-js/mongodb-ts-autocomplete'; import type { BaseCursor } from './abstract-cursor'; export interface ShellCliOptions { nodb?: boolean; deepInspect?: boolean; } export interface AutocompleteParameters { topology: () => Topologies | undefined; apiVersionInfo: () => Required | undefined; connectionInfo: () => ConnectionExtraInfo | undefined; getCollectionCompletionsForCurrentDb: (collName: string) => Promise; getDatabaseCompletions: (dbName: string) => Promise; } export interface OnLoadResult { resolvedFilename: string; evaluate(): Promise; } export interface EvaluationListener extends Partial> { onPrint?: (value: ShellResult[], type: 'print' | 'printjson') => Promise | void; onPrompt?: (question: string, type: 'password' | 'yesno') => Promise | string; onClearCommand?: () => Promise | void; onExit?: (exitCode?: number) => Promise; onLoad?: (filename: string) => Promise | OnLoadResult; getCryptLibraryOptions?: () => Promise; getLogPath?: () => string | undefined; } export interface ShellPlugin { transformError?: (err: Error) => Error; } export declare class ShellInstanceState { currentCursor: BaseCursor | null; currentDb: DatabaseWithSchema; messageBus: MongoshBus; initialServiceProvider: ServiceProvider; private bsonLibrary; private connectionInfoCache; context: any; mongos: Mongo[]; shellApi: ShellApi; shellLog: ShellLog; shellBson: ShellBson; cliOptions: ShellCliOptions; evaluationListener: EvaluationListener; displayBatchSizeFromDBQuery: number | undefined; isInteractive: boolean; apiCallDepth: number; private warningsShown; readonly interrupted: InterruptFlag; resumeMongosAfterInterrupt: Array<{ mongo: Mongo; resume: (() => Promise) | null; }> | undefined; private plugins; private alreadyTransformedErrors; private preFetchCollectionAndDatabaseNames; constructor(initialServiceProvider: ServiceProvider, messageBus?: any, cliOptions?: ShellCliOptions, bsonLibrary?: BSONLibrary); private static commonConstructShellBsonProps; private constructShellBson; fetchConnectionInfo(): Promise; cachedConnectionInfo(): ConnectionInfo | undefined; close(): Promise; setPreFetchCollectionAndDatabaseNames(value: boolean): void; setDbFunc(newDb: any): DatabaseWithSchema; setCtx(contextObject: any): void; get currentServiceProvider(): ServiceProvider; emitApiCallWithArgs(event: ApiEventWithArguments): void; emitApiCall(event: Omit): void; setEvaluationListener(listener: EvaluationListener): void; getMongoByConnectionId(connectionId: string): Mongo; getAutocompletionContext(): AutocompletionContext; getAutocompleteParameters(): AutocompleteParameters; apiVersionInfo(): Required | undefined; onInterruptExecution(): Promise; onResumeExecution(): Promise; getDefaultPrompt(): Promise; private getDefaultPromptPrefix; private getTopologySpecificPrompt; private getTopologySinglePrompt; registerPlugin(plugin: ShellPlugin): void; transformError(err: any): any; printDeprecationWarning(message: string): Promise; printWarning(message: string): Promise; } export default ShellInstanceState;