import type { Request, Express } from 'express'; import { OAuth2Model } from './oauth2-model'; export interface CookieOptions { /** Convenient option for setting the expiry time relative to the current time in **milliseconds**. */ maxAge?: number | undefined; /** Indicates if the cookie should be signed. */ signed?: boolean | undefined; /** Expiry date of the cookie in GMT. If not specified or set to 0, create a session cookie. */ expires?: Date | undefined; /** Flags the cookie to be accessible only by the web server. */ httpOnly?: boolean | undefined; /** Path for the cookie. Defaults to “/”. */ path?: string | undefined; /** Domain name for the cookie. Defaults to the domain name of the app. */ domain?: string | undefined; /** Marks the cookie to be used with HTTPS only. */ secure?: boolean | undefined; /** A synchronous function used for cookie value encoding. Defaults to encodeURIComponent. */ encode?: ((val: string) => string) | undefined; /** Value of the “SameSite” Set-Cookie attribute. */ sameSite?: boolean | 'lax' | 'strict' | 'none' | undefined; /** Value of the “Priority” Set-Cookie attribute. */ priority?: 'low' | 'medium' | 'high'; /** Marks the cookie to use partitioned storage. */ partitioned?: boolean | undefined; } /** * Create an OAuth2 server on the given Express app. * * @param adapter The adapter instance * @param options Options * @param options.app The Express app * @param options.secure Whether the connection is secure (default: false) * @param options.accessLifetime Access token expiration in seconds (default: 1 hour) * @param options.refreshLifetime Refresh token expiration in seconds (default: 30 days) * @param options.noBasicAuth Do not allow basic authentication * @param options.loginPage The login page URL (default: empty and someone else will handle the login). It could be a function too */ export declare function createOAuth2Server(adapter: ioBroker.Adapter, options: { app: Express; secure?: boolean; accessLifetime?: number; refreshLifetime?: number; noBasicAuth?: boolean; loginPage?: string | ((req: Request) => string); }): OAuth2Model;