/** * A set of keys. * We use the TypeScript indexable type for this. * See https://www.typescriptlang.org/docs/handbook/interfaces.html * * Example: * { * 'Mon': true, * 'Wed': true, * 'Fri': true, * 'Sat': false, * 'Sun': false, * } */ export interface KeySet { [item: string]: boolean; } /** * A key-value pair, with the value being a boolean * * Example: * { * key: 'Mon', * value: true, * } */ export interface KeyBoolValue { key: string; value: boolean; } /** * Returns all keys of a KeySet as an array */ export declare const keySetToArray: (set: KeySet) => string[]; /** * Returns KeySet as an array of key-value pairs */ export declare const keySetToKeyValue: (set: KeySet) => Array; /** * Comparison function for key-value pairs */ export declare function compareKeyBoolValues(e1: KeyBoolValue, e2: KeyBoolValue): number; /** * Returns keys whose value is true */ export declare const keySetGetOnKeys: (set: KeySet) => string[]; /** * Returns keys whose value is true */ export declare const keySetGetOffKeys: (set: KeySet) => string[]; export declare const arrayToKeySet: (keys: Array) => KeySet; export declare const mergeKeySets: (...sets: Array) => any; /** * Returns true if the two keySets have the same keys (ignoring order) * Note that the values are not compared. */ export declare const keySetsMatchKeys: (k1: KeySet, k2: KeySet) => boolean; /** * Returns true if the two keySets have the same keys and values (ignoring order) * Note that the values are not compared. */ export declare const keySetsAreEqual: (k1: KeySet, k2: KeySet) => boolean; /** * Returns true if the supplied KeySet contains any of the specified keys */ export declare const keySetContainsOneOf: (set: KeySet, keys: Array) => boolean; /** * Returns a new KeySet with values from src copied to target. * If a key does not exist in target, then it is not copied. * (This is different from Object.assign) * Neither src or target are mutated */ export declare const keySetCopyValues: (target: KeySet, src: KeySet) => KeySet;