import type { ReplPlatform } from '@mongosh/service-provider-core'; import type { AutocompletionContext } from '@mongodb-js/mongodb-ts-autocomplete'; import type { Mongo, ShellInstanceState } from '.'; import type { Topologies } from './enums'; import { asPrintable, shellApiType } from './enums'; import type { CursorConstructionOptionsWithChains } from './abstract-cursor'; export interface Namespace { db: string; collection: string; } export interface ShellResultSourceInformation { namespace: Namespace; } export interface ShellResult { rawValue: any; printable: any; type: string | null; source?: ShellResultSourceInformation; constructionOptions?: CursorConstructionOptionsWithChains; } export declare abstract class ShellApiClass { help: any; abstract get _instanceState(): ShellInstanceState; get [shellApiType](): string; set [shellApiType](value: string); [asPrintable](): any; } export declare abstract class ShellApiWithMongoClass extends ShellApiClass { abstract get _mongo(): Mongo; get _instanceState(): ShellInstanceState; } export declare abstract class ShellApiValueClass extends ShellApiClass { get _mongo(): never; get _instanceState(): never; } export declare function getShellApiType(rawValue: any): string | null; export declare function toShellResult(rawValue: any): Promise; export interface ShellCommandAutocompleteParameters { getDatabaseCompletions: (dbName: string) => string[] | Promise; } export type NewShellCommandAutocompleteParameters = Pick; export type ShellCommandCompleter = (params: ShellCommandAutocompleteParameters, args: string[]) => Promise; export type NewShellCommandCompleter = (context: NewShellCommandAutocompleteParameters, args: string[]) => Promise; export interface TypeSignature { type: string; serverVersions?: [string, string]; apiVersions?: [number, number]; topologies?: Topologies[]; returnsPromise?: boolean; deprecated?: boolean; returnType?: string | TypeSignature; attributes?: { [key: string]: TypeSignature; }; isDirectShellCommand?: boolean; acceptsRawInput?: boolean; shellCommandCompleter?: ShellCommandCompleter; newShellCommandCompleter?: NewShellCommandCompleter; inherited?: boolean; } interface Signatures { [key: string]: TypeSignature; } declare const signatures: Signatures; export { signatures }; export declare const toIgnore: string[]; export declare function shellApiClassDefault(constructor: T, context: ClassDecoratorContext): void; export declare function shellApiClassNoHelp(constructor: T, context: ClassDecoratorContext): void; export declare function serverVersions(serverVersions: [string, string]): (value: T, context: ClassMethodDecoratorContext) => T & { serverVersions: [string, string]; }; export declare function apiVersions(versionArray: [] | [number] | [number, number]): (value: T, context: ClassMethodDecoratorContext) => T & { apiVersions: [number, number]; }; export declare function deprecated(value: T, context: ClassMethodDecoratorContext): T & { deprecated: true; }; export declare function topologies(topologies: Topologies[]): (value: T, context: ClassMethodDecoratorContext) => T & { topologies: Topologies[]; }; export declare const nonAsyncFunctionsReturningPromises: string[]; export declare function returnsPromise(originalFunction: (this: This, ...args: Args) => Promise, context: ClassMethodDecoratorContext Promise>): ((this: This, ...args: Args) => Promise) & { returnsPromise: true; }; export declare function directShellCommand(value: T, context: ClassMethodDecoratorContext): T & { isDirectShellCommand: true; }; export declare function shellCommandCompleter(shellCommandCompleter: ShellCommandCompleter, newShellCommandCompleter: NewShellCommandCompleter): (value: T, context: ClassMethodDecoratorContext) => T & { shellCommandCompleter: ShellCommandCompleter; newShellCommandCompleter: NewShellCommandCompleter; }; export declare function returnType(returnType: string): (value: T, context: ClassMethodDecoratorContext) => T & { returnType: string; }; export declare function classDeprecated(constructor: T, context: ClassDecoratorContext): void; export declare function platforms(platforms: ReplPlatform[]): (value: T, context: ClassMethodDecoratorContext) => T & { platforms: ReplPlatform[]; }; export declare function classPlatforms(platformsArray: ReplPlatform[]): Function; export declare function addSourceToResults(constructor: T, context: ClassDecoratorContext): void; export declare function cursorChainable(originalFunction: (this: This, ...args: Args) => Return, context: ClassMethodDecoratorContext): (this: This, ...args: Args) => Return;