<commit_before>/// <reference types="node" />

declare type VaultOperation = 'add' | 'set' | 'del' | 'touch';

declare class Archivist {
    /**
     * Check whether a given exists in any of our vaults
     *
     * @param {string} topicName
     * @param {ArchivistIndex} index
     * @param {ArchivistExistsCallback} callback
     *
     * @memberOf Archivist
     */
    exists(topicName: string, index: mage.archivist.IArchivistIndex, callback: mage.archivist.ArchivistExistsCallback): void;

    /**
     * Retrieve a value
     *
     * This method is a wrapper around `getValue` which directly returns ArchivistValue.value;
     * in most cases, you will want to call `get` instead to get the actual data.
     *
     * @param {string} topicName
     * @param {ArchivistIndex} index
     * @param {ArchivistOptions} options
     * @param {Callback} callback
     *
     * @memberOf Archivist
     */
    get<T>(topicName: string, index: mage.archivist.IArchivistIndex, options: mage.archivist.IArchivistGetOptions | undefined, callback: mage.archivist.ArchivistGetCallback<T>): void;
    get<T>(topicName: string, index: mage.archivist.IArchivistIndex, callback: mage.archivist.ArchivistGetCallback<T>): void;

    /**
     * Retrieve the VaultValue object for a given key
     *
     * In most cases, you will want to call `get` instead to get the actual data.
     *
     * @param {string} topicName
     * @param {ArchivistIndex} index
     * @param {ArchivistOptions} [options]
     * @param {Function} callback
     *
     * @memberOf Archivist
     */
    getValue(topicName: string, index: mage.archivist.IArchivistIndex, options: mage.archivist.IArchivistGetOptions | undefined, callback: mage.archivist.ArchivistGetCallback<mage.archivist.IVaultValue>): void;
    getValue(topicName: string, index: mage.archivist.IArchivistIndex, callback: mage.archivist.ArchivistGetCallback<mage.archivist.IVaultValue>): void;

    /**
     * Retrieve multiple values
     *
     * This method is a wrapper around `mgetValue` which directly returns an array of ArchivistValue.value;
     * in most cases, you will want to call `mget` instead to get the actual data.
     *
     * @param {ArchivistQuery[]} queries
     * @param {ArchivistOptions} [options]
     * @param {Function} callback
     *
     * @memberOf Archivist
     */
    mget<T>(queries: mage.archivist.IArchivistQuery[], options: mage.archivist.IArchivistGetOptions | undefined, callback: mage.archivist.ArchivistMGetCallback<T>): void;
    mget<T>(queries: mage.archivist.INamedArchivistQuery, options: mage.archivist.IArchivistGetOptions | undefined, callback: mage.archivist.ArchivistNamedMGetCallback<T>): void;
    mget<T>(queries: mage.archivist.IArchivistQuery[], callback: mage.archivist.ArchivistMGetCallback<T>): void;
    mget<T>(queries: mage.archivist.INamedArchivistQuery, callback: mage.archivist.ArchivistNamedMGetCallback<T>): void;

    /**
     * Retrieve multiple VaultValue objects
     *
     * In most cases, you will want to call `mget` instead to get the actual data.
     *
     * @param {ArchivistQuery[]} queries
     * @param {ArchivistOptions} [options]
     * @param {Function} callback
     *
     * @memberOf Archivist
     */
    mgetValues(queries: mage.archivist.IArchivistQuery[], options: mage.archivist.IArchivistGetOptions | undefined, callback: mage.archivist.ArchivistMGetCallback<mage.archivist.IVaultValue>): void;
    mgetValues(queries: mage.archivist.IArchivistQuery[], callback: mage.archivist.ArchivistMGetCallback<mage.archivist.IVaultValue>): void;

    /**
     * Scan the backend vault for matching indexes, and return them
     *
     * In this case, the index can be partial; for instance, `{ userId: 1 }`, would match
     * all the following indexes:
     *
     * ```json
     * { userId: 1, somethingElse: 'hi'}
     * { userId: 1, somethingElse: 'hello'}
     * ```
     *
     * Note that this API returns the list of matching *indexes*, not the data they hold;
     * to fetch the data, you will want to call `mget` using the returned list of indexes.
     *
     * See https://mage.github.io/mage/#key-based-filtering for more details.
     *
     * @param {string} topicName
     * @param {ArchivistIndex} partialIndex
     * @param {ArchivistOptions} [options]
     * @param {Function} callback
     *
     * @memberOf Archivist
     */
    list(topicName: string, partialIndex: mage.archivist.IArchivistIndex, options: mage.archivist.IArchivistListOptions | undefined, callback: mage.archivist.ArchivistListCallback): void;
    list(topicName: string, partialIndex: mage.archivist.IArchivistIndex, callback: mage.archivist.ArchivistListCallback): void;

    /**
     * Add a new topic value by index.
     *
     * Note that if the index already exists, this call will return an error. Use
     * `set` instead if you wish to write the value regardless of whether
     * it already exists.
     *
     * @param {string} topicName
     * @param {ArchivistIndex} index
     * @param {*} data
     * @param {ArchivistMediaType} mediaType
     * @param {ArchivistEncoding} encoding
     * @param {number} expirationTime
     *
     * @memberOf Archivist
     */
    add<T>(topicName: string, index: mage.archivist.IArchivistIndex, data: T, mediaType: mage.archivist.ArchivistMediaType, encoding: mage.archivist.ArchivistEncoding, expirationTime?: number): void;

    /**
     * Set the value for an existing index.
     *
     * @param {string} topicName
     * @param {ArchivistIndex} index
     * @param {*} data
     * @param {ArchivistMediaType} mediaType
     * @param {ArchivistEncoding} encoding
     * @param {number} expirationTime
     *
     * @memberOf Archivist
     */
    set<T>(topicName: string, index: mage.archivist.IArchivistIndex, data: T, mediaType: mage.archivist.ArchivistMediaType, encoding: mage.archivist.ArchivistEncoding, expirationTime?: number): void;

    /**
     * Delete a topic by index.
     *
     * @param {string} topicName
     * @param {ArchivistIndex} index<commit_msg>archivist.add/set: encoding and mediaType<commit_after>/// <reference types="node" />

declare type VaultOperation = 'add' | 'set' | 'del' | 'touch';

declare class Archivist {
    /**
     * Check whether a given exists in any of our vaults
     *
     * @param {string} topicName
     * @param {ArchivistIndex} index
     * @param {ArchivistExistsCallback} callback
     *
     * @memberOf Archivist
     */
    exists(topicName: string, index: mage.archivist.IArchivistIndex, callback: mage.archivist.ArchivistExistsCallback): void;

    /**
     * Retrieve a value
     *
     * This method is a wrapper around `getValue` which directly returns ArchivistValue.value;
     * in most cases, you will want to call `get` instead to get the actual data.
     *
     * @param {string} topicName
     * @param {ArchivistIndex} index
     * @param {ArchivistOptions} options
     * @param {Callback} callback
     *
     * @memberOf Archivist
     */
    get<T>(topicName: string, index: mage.archivist.IArchivistIndex, options: mage.archivist.IArchivistGetOptions | undefined, callback: mage.archivist.ArchivistGetCallback<T>): void;
    get<T>(topicName: string, index: mage.archivist.IArchivistIndex, callback: mage.archivist.ArchivistGetCallback<T>): void;

    /**
     * Retrieve the VaultValue object for a given key
     *
     * In most cases, you will want to call `get` instead to get the actual data.
     *
     * @param {string} topicName
     * @param {ArchivistIndex} index
     * @param {ArchivistOptions} [options]
     * @param {Function} callback
     *
     * @memberOf Archivist
     */
    getValue(topicName: string, index: mage.archivist.IArchivistIndex, options: mage.archivist.IArchivistGetOptions | undefined, callback: mage.archivist.ArchivistGetCallback<mage.archivist.IVaultValue>): void;
    getValue(topicName: string, index: mage.archivist.IArchivistIndex, callback: mage.archivist.ArchivistGetCallback<mage.archivist.IVaultValue>): void;

    /**
     * Retrieve multiple values
     *
     * This method is a wrapper around `mgetValue` which directly returns an array of ArchivistValue.value;
     * in most cases, you will want to call `mget` instead to get the actual data.
     *
     * @param {ArchivistQuery[]} queries
     * @param {ArchivistOptions} [options]
     * @param {Function} callback
     *
     * @memberOf Archivist
     */
    mget<T>(queries: mage.archivist.IArchivistQuery[], options: mage.archivist.IArchivistGetOptions | undefined, callback: mage.archivist.ArchivistMGetCallback<T>): void;
    mget<T>(queries: mage.archivist.INamedArchivistQuery, options: mage.archivist.IArchivistGetOptions | undefined, callback: mage.archivist.ArchivistNamedMGetCallback<T>): void;
    mget<T>(queries: mage.archivist.IArchivistQuery[], callback: mage.archivist.ArchivistMGetCallback<T>): void;
    mget<T>(queries: mage.archivist.INamedArchivistQuery, callback: mage.archivist.ArchivistNamedMGetCallback<T>): void;

    /**
     * Retrieve multiple VaultValue objects
     *
     * In most cases, you will want to call `mget` instead to get the actual data.
     *
     * @param {ArchivistQuery[]} queries
     * @param {ArchivistOptions} [options]
     * @param {Function} callback
     *
     * @memberOf Archivist
     */
    mgetValues(queries: mage.archivist.IArchivistQuery[], options: mage.archivist.IArchivistGetOptions | undefined, callback: mage.archivist.ArchivistMGetCallback<mage.archivist.IVaultValue>): void;
    mgetValues(queries: mage.archivist.IArchivistQuery[], callback: mage.archivist.ArchivistMGetCallback<mage.archivist.IVaultValue>): void;

    /**
     * Scan the backend vault for matching indexes, and return them
     *
     * In this case, the index can be partial; for instance, `{ userId: 1 }`, would match
     * all the following indexes:
     *
     * ```json
     * { userId: 1, somethingElse: 'hi'}
     * { userId: 1, somethingElse: 'hello'}
     * ```
     *
     * Note that this API returns the list of matching *indexes*, not the data they hold;
     * to fetch the data, you will want to call `mget` using the returned list of indexes.
     *
     * See https://mage.github.io/mage/#key-based-filtering for more details.
     *
     * @param {string} topicName
     * @param {ArchivistIndex} partialIndex
     * @param {ArchivistOptions} [options]
     * @param {Function} callback
     *
     * @memberOf Archivist
     */
    list(topicName: string, partialIndex: mage.archivist.IArchivistIndex, options: mage.archivist.IArchivistListOptions | undefined, callback: mage.archivist.ArchivistListCallback): void;
    list(topicName: string, partialIndex: mage.archivist.IArchivistIndex, callback: mage.archivist.ArchivistListCallback): void;

    /**
     * Add a new topic value by index.
     *
     * Note that if the index already exists, this call will return an error. Use
     * `set` instead if you wish to write the value regardless of whether
     * it already exists.
     *
     * @param {string} topicName
     * @param {ArchivistIndex} index
     * @param {*} data
     * @param {ArchivistMediaType} mediaType
     * @param {ArchivistEncoding} encoding
     * @param {number} expirationTime
     *
     * @memberOf Archivist
     */
    add<T>(topicName: string, index: mage.archivist.IArchivistIndex, data: T, mediaType?: mage.archivist.ArchivistMediaType, encoding?: mage.archivist.ArchivistEncoding, expirationTime?: number): void;

    /**
     * Set the value for an existing index.
     *
     * @param {string} topicName
     * @param {ArchivistIndex} index
     * @param {*} data
     * @param {ArchivistMediaType} mediaType
     * @param {ArchivistEncoding} encoding
     * @param {number} expirationTime
     *
     * @memberOf Archivist
     */
    set<T>(topicName: string, index: mage.archivist.IArchivistIndex, data: T, mediaType?: mage.archivist.ArchivistMediaType, encoding?: mage.archivist.ArchivistEncoding, expirationTime?: number): void;

    /**
     * Delete a topic by index.
     *
     * @param {string} topicName
     * @param {ArchivistIndex} index
{'fraction_non_alphanumeric': 0.10901138801782473, 'fraction_numerical': 0.0004951312097705892, 'mean_word_length': 3.406909090909091, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, 'https://': 2, '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': '6143557', 'n_tokens_mistral': 3886, 'n_tokens_neox': 3620, 'n_words': 980}