import { type AuthMetricsInput } from '../metrics.js'; import { Bearer, Receiver, Token } from '../token.js'; import { custom, customJson } from '../util/logging.js'; /** * Reads a fixed access token from a text file for every authentication fetch. * * The file must contain one non-empty line. Leading and trailing whitespace is * removed. This bearer does not renew the token, but it sees file changes on * later requests. * * @example * ```ts * import { SDK } from '@nebius/js-sdk'; * import { FileBearer } from '@nebius/js-sdk/runtime/token/file'; * * const sdk = new SDK({ * credentials: new FileBearer('~/.config/my-app/token'), * userAgentPrefix: 'example-application/1.0', * }); * ``` */ export declare class FileBearer extends Bearer { [custom]: () => string; /** Contains the fully qualified runtime type name. */ readonly $type = "nebius.sdk.FileBearer"; private readonly filePath; private readonly metrics; /** Creates a bearer for `filePath`. A leading `~` resolves to the home directory. */ constructor(filePath: string, metrics?: AuthMetricsInput); /** Returns a JSON-safe value for logs. */ [customJson](): unknown; /** Creates a token receiver. */ receiver(): Receiver; /** * Reads and validates the current file contents. * * Rejects when the file is empty, contains an embedded newline, or cannot be * read. The returned token has no known expiration. */ fetchToken(): Promise; /** Sets the metrics. */ setMetrics(metrics: AuthMetricsInput): void; } //# sourceMappingURL=file.d.ts.map