/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @noformat * @oncall react_native * @generated SignedSource<<0fccda5d7f0eb38539316fa1fedae97b>> * * This file was translated from Flow by scripts/generateTypeScriptDefinitions.js * Original file: packages/metro/src/lib/CountingSet.js * To regenerate, run: * js1 build metro-ts-defs (internal) OR * yarn run build-ts-defs (OSS) */ export interface ReadOnlyCountingSet extends Iterable { has(item: T): boolean; readonly size: number; count(item: T): number; forEach( callbackFn: ( this: ThisT, value: T, key: T, set: ReadOnlyCountingSet, ) => unknown, thisArg: ThisT, ): void; } /** * A Set that only deletes a given item when the number of delete(item) calls * matches the number of add(item) calls. Iteration and `size` are in terms of * *unique* items. */ declare class CountingSet implements ReadOnlyCountingSet { constructor(items?: Iterable); has(item: T): boolean; add(item: T): void; delete(item: T): void; keys(): Iterator; values(): Iterator; entries(): Iterator<[T, T]>; [Symbol.iterator](): Iterator; get size(): number; count(item: T): number; clear(): void; forEach( callbackFn: (this: ThisT, value: T, key: T, set: CountingSet) => unknown, thisArg: ThisT, ): void; toJSON(): unknown; } export default CountingSet;