declare module 'oidc-provider' {
  import type { IncomingMessage, ServerResponse } from 'http';
  export interface InteractionDetails {
    uid: string;
    prompt: { name: string; [k: string]: unknown };
    params: Record<string, unknown>;
    session?: { accountId?: string };
    grantId?: string;
  }
  export class Grant {
    constructor(props: { accountId: string; clientId: string });
    addOIDCScope(scope: string): void;
    addResourceScope(resource: string, scope: string): void;
    save(): Promise<string>;
  }
  export default class Provider {
    constructor(issuer: string, configuration?: unknown);
    proxy: boolean;
    Grant: typeof Grant;
    AccessToken: {
      find(value: string, opts?: { ignoreExpiration?: boolean }): Promise<{
        accountId?: string;
        grantId?: string;
        scope?: string;
        aud?: string | string[];
      } | undefined>;
    };
    callback(): (req: IncomingMessage, res: ServerResponse) => void;
    interactionDetails(req: unknown, res: unknown): Promise<InteractionDetails>;
    interactionResult(req: unknown, res: unknown, result: unknown, opts?: { mergeWithLastSubmission?: boolean }): Promise<string>;
    interactionFinished(req: unknown, res: unknown, result: unknown, opts?: { mergeWithLastSubmission?: boolean }): Promise<void>;
  }
}
