/** * set相关工具 * @filename: src/data-structure/SetEnhancer/SetEnhancer.ts * @author: Mr Prince * @date: 2022-07-03 20:42:42 */ declare class SetEnhancer { /** * 并集 */ static union(a: Set, b: Set): Set; /** * 交集 */ static intersect(a: Set, b: Set): Set; /** * a 对 b 的补集 * b 有的但 a 没有 */ static complement(a: Set, b: Set): Set; /** * 同 complement */ static diff(a: Set, b: Set): Set; /** * b 是否是 a 的 子集 */ static isSubsetOf(a: Set, b: Set): boolean; /** * a 是否是 b的 超集 */ static isSupersetOf(a: Set, b: Set): boolean; /** * 笛卡尔积 */ static product(a: Set, b: Set): Set<[T, T]>; /** * Set 的 m 次方 */ static power(set: Set, m: number): Set | Set<[T, T]>; /** * 集合中的元素是否相等 */ static equals(a: Set, b: Set): boolean; /** * 过滤 */ static filter(set: Set, callback: (value: T) => boolean): Set; /** * 转化成数组 */ static toArray(set: Set): T[]; /** * 复制 */ static clone(set: Set): Set; } export default SetEnhancer;