import { type NanotronClientRequest } from '@alwatr/nanotron-api-server'; /** * Middleware to require a valid access token for a Nanotron API request. * * This function checks the authorization header for a Bearer token and compares it to the provided access token. * If the token is missing or invalid, it sends an appropriate error response and prevents further handlers from executing. * * @param {string} accessToken - The valid access token to compare against. * @returns {Function} A middleware function for Nanotron API requests. * * @example * ```ts * nanotronApiServer.defineRoute({ * method: 'POST', * url: 'secure-endpoint', * preHandlers: [requireAccessToken('mySecretToken')], * async handler() { * this.serverResponse.replyJson({ * ok: true, * message: 'Access granted!', * }); * }, * }); * ``` */ export declare const requireAccessToken: (accessToken: string) => (this: NanotronClientRequest) => Promise; //# sourceMappingURL=require-access-token.d.ts.map