jmap-kit
    Preparing search index...

    Interface JMAPClientEvents

    Events emitted by the JMAP client

    interface JMAPClientEvents {
        "download-error": { accountId: Id; blobId: Id; error: JMAPRequestError };
        "invalid-capabilities": {
            accountCapabilities: (
                { errors: Error[]; valid: false } & {
                    accountId: string;
                    uri: keyof JMAPServerCapabilities;
                }
            )[];
            context: "connection"
            | "registration";
            serverCapabilities: (
                { errors: Error[]; valid: false } & {
                    uri: keyof JMAPServerCapabilities;
                }
            )[];
        };
        "request-error": { error: JMAPRequestError };
        "session-stale": {
            newSessionState: string;
            oldSessionState: string | null;
        };
        "status-changed": { sessionState: string
        | null; status: string };
        "transport-error": { error: unknown };
        "upload-error": { accountId: Id; error: JMAPRequestError };
    }
    Index

    Properties

    "download-error": { accountId: Id; blobId: Id; error: JMAPRequestError }

    Emitted when a file download operation fails

    Type Declaration

    • accountId: Id

      The account ID from which the download was attempted

    • blobId: Id

      The blob ID of the file being downloaded

    • error: JMAPRequestError

      The error that occurred during download

    "invalid-capabilities": {
        accountCapabilities: (
            { errors: Error[]; valid: false } & {
                accountId: string;
                uri: keyof JMAPServerCapabilities;
            }
        )[];
        context: "connection"
        | "registration";
        serverCapabilities: (
            { errors: Error[]; valid: false } & {
                uri: keyof JMAPServerCapabilities;
            }
        )[];
    }

    Emitted when one or more capabilities fail schema validation.

    During connection (context: "connection"), invalid capabilities are stripped from the frozen session and treated as unsupported.

    During late registration (context: "registration"), capabilities whose schemas fail validation against the existing session are rejected and not registered.

    Type Declaration

    • accountCapabilities: (
          { errors: Error[]; valid: false } & {
              accountId: string;
              uri: keyof JMAPServerCapabilities;
          }
      )[]

      Account capabilities that failed validation

    • context: "connection" | "registration"

      Whether the validation occurred during initial connection or late registration

    • serverCapabilities: ({ errors: Error[]; valid: false } & { uri: keyof JMAPServerCapabilities })[]

      Server capabilities that failed validation

    "request-error": { error: JMAPRequestError }

    Emitted when a request-level error occurs (e.g. authentication error, invalid JSON, etc.)

    Type Declaration

    "session-stale": { newSessionState: string; oldSessionState: string | null }

    Emitted when the session state reported by the server changes

    Type Declaration

    • newSessionState: string

      The new session state

    • oldSessionState: string | null

      The previous session state

    "status-changed": { sessionState: string | null; status: string }

    Emitted when the client's connection status changes

    Type Declaration

    • sessionState: string | null

      The session state, if available

    • status: string

      The new connection status

    "transport-error": { error: unknown }

    Emitted when a transport or network error occurs during any kind of request

    Type Declaration

    • error: unknown

      The error that occurred

    "upload-error": { accountId: Id; error: JMAPRequestError }

    Emitted when a file upload operation fails

    Type Declaration

    • accountId: Id

      The account ID to which the upload was attempted

    • error: JMAPRequestError

      The error that occurred during upload