AK-21/Graphite-Industrial-Intelligence
0
1/*! *****************************************************************************2Copyright (c) Microsoft Corporation. All rights reserved.3Licensed under the Apache License, Version 2.0 (the "License"); you may not use4this file except in compliance with the License. You may obtain a copy of the5License at http://www.apache.org/licenses/LICENSE-2.06 7THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY8KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED9WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,10MERCHANTABILITY OR NON-INFRINGEMENT.11 12See the Apache Version 2.0 License for specific language governing permissions13and limitations under the License.14***************************************************************************** */15 16 17/// <reference lib="es2024.collection" />18 19interface ReadonlySetLike<T> {20 /**21 * Despite its name, returns an iterator of the values in the set-like.22 */23 keys(): Iterator<T>;24 /**25 * @returns a boolean indicating whether an element with the specified value exists in the set-like or not.26 */27 has(value: T): boolean;28 /**29 * @returns the number of (unique) elements in the set-like.30 */31 readonly size: number;32}33 34interface Set<T> {35 /**36 * @returns a new Set containing all the elements in this Set and also all the elements in the argument.37 */38 union<U>(other: ReadonlySetLike<U>): Set<T | U>;39 /**40 * @returns a new Set containing all the elements which are both in this Set and in the argument.41 */42 intersection<U>(other: ReadonlySetLike<U>): Set<T & U>;43 /**44 * @returns a new Set containing all the elements in this Set which are not also in the argument.45 */46 difference<U>(other: ReadonlySetLike<U>): Set<T>;47 /**48 * @returns a new Set containing all the elements which are in either this Set or in the argument, but not in both.49 */50 symmetricDifference<U>(other: ReadonlySetLike<U>): Set<T | U>;51 /**52 * @returns a boolean indicating whether all the elements in this Set are also in the argument.53 */54 isSubsetOf(other: ReadonlySetLike<unknown>): boolean;55 /**56 * @returns a boolean indicating whether all the elements in the argument are also in this Set.57 */58 isSupersetOf(other: ReadonlySetLike<unknown>): boolean;59 /**60 * @returns a boolean indicating whether this Set has no elements in common with the argument.61 */62 isDisjointFrom(other: ReadonlySetLike<unknown>): boolean;63}64 65interface ReadonlySet<T> {66 /**67 * @returns a new Set containing all the elements in this Set and also all the elements in the argument.68 */69 union<U>(other: ReadonlySetLike<U>): Set<T | U>;70 /**71 * @returns a new Set containing all the elements which are both in this Set and in the argument.72 */73 intersection<U>(other: ReadonlySetLike<U>): Set<T & U>;74 /**75 * @returns a new Set containing all the elements in this Set which are not also in the argument.76 */77 difference<U>(other: ReadonlySetLike<U>): Set<T>;78 /**79 * @returns a new Set containing all the elements which are in either this Set or in the argument, but not in both.80 */81 symmetricDifference<U>(other: ReadonlySetLike<U>): Set<T | U>;82 /**83 * @returns a boolean indicating whether all the elements in this Set are also in the argument.84 */85 isSubsetOf(other: ReadonlySetLike<unknown>): boolean;86 /**87 * @returns a boolean indicating whether all the elements in the argument are also in this Set.88 */89 isSupersetOf(other: ReadonlySetLike<unknown>): boolean;90 /**91 * @returns a boolean indicating whether this Set has no elements in common with the argument.92 */93 isDisjointFrom(other: ReadonlySetLike<unknown>): boolean;94}95 