import { SupportedCredentialFormats, SupportedPresentationFormats } from './credential.js';
import { OAuth2ClientMetadata } from './oauth2.js';

interface IssuerServerMetadata {
    credential_issuer: string;
    authorization_server?: string;
    credential_endpoint: string;
    deferred_credential_endpoint: string;
    credentials_supported: SupportedCredential[];
}
interface OPMetadata {
    issuer: string;
    authorization_endpoint: string;
    token_endpoint: string;
    presentation_definition_endpoint?: string;
    jwks_uri: string;
    scopes_supported?: ['openid'];
    response_types_supported: string[];
    response_modes_supported?: string[];
    grant_types_supported?: string[];
    subject_types_supported: ('pairwise' | 'public')[];
    id_token_signing_alg_values_supported: string[];
    request_object_signing_alg_values_supported?: string[];
    request_parameter_supported?: boolean;
    request_uri_parameter_supported?: boolean;
    vp_formats_supported?: Partial<Record<'jwt_vc' | 'jwt_vp' | 'jwt_vc_json' | 'jwt_vp_json', {
        alg_values_supported: string[];
    }>>;
    subject_syntax_types_supported: string[];
    subject_syntax_types_discriminations: string[];
    redirect_uris: string[];
    token_endpoint_auth_methods_supported: string[];
    request_authentication_methods_supported?: {
        authorization_endpoint?: string[];
    };
    subject_trust_frameworks_supported: string[];
    id_token_types_supported: string[];
}
interface VerifierServerMetadata extends OAuth2ClientMetadata {
    vp_formats: (SupportedCredentialFormats | SupportedPresentationFormats)[];
    subject_syntax_types_supported: string[];
}
type SupportedCredential = {
    id?: string;
    cryptographic_binding_methods_supported?: string[];
    cryptographic_suites_supported?: string[];
    display?: CredentialDisplay[];
    order?: string[];
    credentialSchema: CredentialSchema;
} & (SupportedCredentialJwtVcJson | SupportedCredentialJwtVcJsonLd | SupportedCredentialMsoMdoc);
interface SupportedCredentialJwtVcJson {
    format: 'jwt_vc_json';
    types: string[];
    credentialSubject?: any;
}
interface SupportedCredentialJwtVcJsonLd {
    format: 'jwt_vc_json-ld' | 'ldp_vc';
    types: string[];
    '@context': string[];
    credentialSubject?: any;
}
interface SupportedCredentialMsoMdoc {
    format: 'mso_mdoc';
    doctype: string;
    claims?: any;
}
interface CredentialSchema {
    id: string;
    type: string;
}
interface CredentialDisplay {
    name: string;
    locale?: string;
    logo?: Logo;
    background_color?: string;
    text_color?: string;
}
interface Logo {
    url?: string;
    alt_text?: string;
}

export type { CredentialSchema, IssuerServerMetadata, OPMetadata, SupportedCredential, SupportedCredentialJwtVcJson, SupportedCredentialJwtVcJsonLd, SupportedCredentialMsoMdoc, VerifierServerMetadata };
