<commit_before>declare module "akismet-api" {
  // Type definitions for akismet-api 5.2.1
  // Definitions by: <NAME> https://github.com/jasonflorentino

  // Main Akismet Client Class
  export class AkismetClient {
    constructor(options: AkismetClientOptions);

    verifyKey(callback?: () => void): void;

    checkSpam(comment: Comment, callback?: () => void): boolean;
    submitSpam(comment: Comment, callback?: () => void): void;
    submitHam(comment: Comment, callback?: () => void): void;
  }

  // Legacy props
  export type Client = AkismetClient;
  export type client = (options: AkismetClientOptions) => AkismetClient;

  // Types
  interface AkismetClientOptions {
    blog: string;
    key: string;
    host?: string;
    protocol?: string;
    version?: string;
    userAgent?: string;
  
    blog_lang?: string;
    lang?: string; // Alias for prev prop 
    
    blog_charset?: string;
    charset?: string; // Alias for prev prop 
  }

  // Require only one of these two types
  type Comment = (CommentWithIP) | (CommentWithUserIP);

  // BaseComment with either `ip` or `user_up`
  type CommentWithIP = { ip: string; } & BaseComment;
  type CommentWithUserIP = { user_ip: string; } & BaseComment;

  // BaseComment is composed of Allowed Keys, all optional
  type BaseComment = 
    Partial<Record<CommentKeys, string>> 
    & Partial<Record<TestKeys, boolean | string>>;

  // Allowed Keys
  type TestKeys = 'is_test' | 'isTest';
  
  type CommentKeys = 'user_ip' | 'ip'
    | 'user_agent' | 'useragent'
    | 'referrer' | 'referer'
    | 'comment_author' | 'name'
    | 'comment_author_email' | 'email'
    | 'comment_content' | 'content'
    | 'comment_type' | 'type'
    | 'comment_date_gmt' | 'date'
    | 'permalink'
    | 'comment_post_modified_gmt' | 'permalinkDate'
    | 'comment_author_url' | 'url'
    | 'user_role' | 'role';
}<commit_msg>Typings: Client methods should return promises<commit_after>declare module "akismet-api" {
  // Main Akismet Client Class
  export class AkismetClient {
    constructor(options: AkismetClientOptions);

    verifyKey(
      callback?: (err: Error, isValid: boolean) => void
    ): Promise<boolean>;

    checkSpam(
      comment: Comment,
      callback?: (err: Error, isSpam: boolean) => void
    ): Promise<boolean>;

    submitSpam(
      comment: Comment,
      callback?: (err: Error) => void
    ): Promise<void>;

    submitHam(
      comment: Comment,
      callback?: (err: Error) => void
    ): Promise<void>;
  }

  // Legacy props
  export type Client = AkismetClient;
  export type client = (options: AkismetClientOptions) => AkismetClient;

  // Types
  interface AkismetClientOptions {
    blog: string;
    key: string;
    host?: string;
    protocol?: string;
    version?: string;
    userAgent?: string;
  
    blog_lang?: string;
    lang?: string; // Alias for prev prop 
    
    blog_charset?: string;
    charset?: string; // Alias for prev prop 
  }

  // Require only one of these two types
  type Comment = (CommentWithIP) | (CommentWithUserIP);

  // BaseComment with either `ip` or `user_up`
  type CommentWithIP = { ip: string; } & BaseComment;
  type CommentWithUserIP = { user_ip: string; } & BaseComment;

  // BaseComment is composed of Allowed Keys, all optional
  type BaseComment = 
    Partial<Record<CommentKeys, string>> 
    & Partial<Record<TestKeys, boolean | string>>;

  // Allowed Keys
  type TestKeys = 'is_test' | 'isTest';
  
  type CommentKeys = 'user_ip' | 'ip'
    | 'user_agent' | 'useragent'
    | 'referrer' | 'referer'
    | 'comment_author' | 'name'
    | 'comment_author_email' | 'email'
    | 'comment_content' | 'content'
    | 'comment_type' | 'type'
    | 'comment_date_gmt' | 'date'
    | 'permalink'
    | 'comment_post_modified_gmt' | 'permalinkDate'
    | 'comment_author_url' | 'url'
    | 'user_role' | 'role';
}
{'fraction_non_alphanumeric': 0.12976901116013495, 'fraction_numerical': 0.0007786140669608098, 'mean_word_length': 3.230515916575192, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 26, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3168185', 'n_tokens_mistral': 1270, 'n_tokens_neox': 1228, 'n_words': 322}