import prompts from 'prompts'; import RestApi from '@signageos/sdk/dist/RestApi/RestApi'; import { IExtendedConfig } from './RunControl/runControlHelper'; import { ApiVersions } from '@signageos/sdk/dist/RestApi/apiVersions'; type RequestInit = globalThis.RequestInit; interface ICredentials { oauthClientId: string; oauthClientSecret: string; } export declare function loadApiUrl(): Promise; export declare function getApiUrl(config: IExtendedConfig): string; export declare function createClientVersions(): { signageOS_CLI: any; }; export declare function createOrganizationRestApi(credentials: ICredentials): Promise; export declare const AUTH_HEADER = "X-Auth"; export interface IOptions { url: string; auth: { clientId: string | undefined; secret: string | undefined; }; /** JWT access token — when set, used as `X-Auth: ` (takes precedence over clientId:secret) */ accessToken?: string; version: ApiVersions; headers?: { [name: string]: string; }; } export declare function createOptions(method: 'POST' | 'GET' | 'PUT' | 'DELETE', options: IOptions, data?: any): RequestInit; export declare function createUri(options: IOptions, resource: string, queryParams?: any): string; export declare function getResource(options: IOptions, path: string, query?: any): Promise; export declare function postResource(options: IOptions, path: string, query?: any, data?: any): Promise; export declare function putResource(options: IOptions, path: string, query?: any, data?: any): Promise; export declare function deleteResource(options: IOptions, path: string): Promise; export declare function deserializeJSON(_key: string, value: any): any; export declare function getErrorMessageFromUnknownError(error: unknown): unknown; /** * Custom suggest function for autocomplete prompts. * Searches in both the title (display text) and value (actual value) fields. * This allows users to search by UID even when it's shown in parentheses in the title. * * @example * ```typescript * const response = await prompts({ * type: 'autocomplete', * name: 'deviceUid', * message: 'Select device', * choices: devices.map(d => ({ title: `${d.name} (${d.uid})`, value: d.uid })), * suggest: autocompleteSuggest, * }); * ``` */ export declare function autocompleteSuggest(input: string, choices: T[]): Promise; export {};