import type { ErrorOr, LoggedInMachineConfiguration, MachineConfiguration } from './types.js'; export declare const getDirectory: (d?: string | undefined) => string; /** * Replace the path prefix with `~` if it is inside the user's home directory. * * @param {*} absPath an absolute file or directory path * @returns {*} the same path that possibly looks more friendly to users */ export declare const homeRelative: (absPath: string) => string; /** * Replace the path prefix with `~` if it is inside the user's home directory. * * @param {*} absPath an absolute file or directory path * @param {*} workspace an absolute file or the workspace root * @returns {*} the same path that possibly looks more friendly to users */ export declare const workspaceRelative: (absPath: string, workspace: string) => string; export declare const getStepZenExtensions: (configuration?: MachineConfiguration) => Promise; export declare const validateEndpoint: (endpoint: string) => string | true; export declare const maskStepZenKey: (key: string) => string; export declare const getFeatureFlag: (flag: string) => boolean; export declare const hasWebDashboard: (configuration: LoggedInMachineConfiguration) => boolean; export type GraphiQLDashboardType = { type: 'web'; } | { type: 'local'; port: number; } | { type: 'none'; }; export declare const formatEndpointInfo: ({ configuration, endpoint, graphiql, }: { configuration: LoggedInMachineConfiguration; endpoint: string; graphiql?: GraphiQLDashboardType; }) => string; export declare const parseSnowflakeAccountId: (accountId?: string) => ErrorOr<{ organization: string; account: string; }>; export declare function maskPasswordInDsn(dsn: string): string; export declare function rewriteLocalhostToHostGateway(config: MachineConfiguration, hostname: string): string; export declare function rewriteLocalhostToHostGatewayInURL(config: MachineConfiguration, url: string): string; export declare function prependEachLine(text: string, prefix: string): string; /** * Create a Promise that completes within the given duration, unless * cancelled. * * @param {*} ms milliseconds before completion * @returns {*} a Promise */ export declare function getTimeout(ms: number): Promise & { cancel: () => void; }; /** * * Check if an endpoint is up; if not 200 OK after given number of tries raise an * exception. For graphql, send a simple introspection query. * * @param {*} url url to a web service * @param {*} tries number of attempts at 3-second intervals * @returns {*} a promise that completes if the service is up, otherwise fails */ export declare function probeEndpoint(url: string, tries?: number): Promise; export declare const findNextAvailableSubfolder: (folder: string, name: string) => string; //# sourceMappingURL=utils.d.ts.map