2016-11-20 17:49:21 -08:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
*
|
2018-02-16 18:24:55 -08:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2016-11-20 17:49:21 -08:00
|
|
|
*
|
2018-07-27 12:25:23 -07:00
|
|
|
* @flow strict
|
2016-11-20 17:49:21 -08:00
|
|
|
* @nolint
|
2018-05-10 15:44:53 -07:00
|
|
|
* @format
|
2016-11-20 17:49:21 -08:00
|
|
|
*/
|
|
|
|
|
2016-03-08 12:38:52 -08:00
|
|
|
// These annotations are copy/pasted from the built-in Flow definitions for
|
|
|
|
// Native Set.
|
|
|
|
|
2018-05-10 15:44:53 -07:00
|
|
|
declare module 'Set' {
|
2016-03-08 12:38:52 -08:00
|
|
|
// Use the name "SetPolyfill" so that we don't get confusing error
|
|
|
|
// messages about "Using Set instead of Set".
|
|
|
|
declare class SetPolyfill<T> {
|
|
|
|
@@iterator(): Iterator<T>;
|
2017-04-27 18:33:06 -07:00
|
|
|
constructor(iterable: ?Iterable<T>): void;
|
2016-03-08 12:38:52 -08:00
|
|
|
add(value: T): SetPolyfill<T>;
|
|
|
|
clear(): void;
|
|
|
|
delete(value: T): boolean;
|
|
|
|
entries(): Iterator<[T, T]>;
|
2018-05-10 15:44:53 -07:00
|
|
|
forEach(
|
|
|
|
callbackfn: (value: T, index: T, set: SetPolyfill<T>) => mixed,
|
|
|
|
thisArg?: any,
|
|
|
|
): void;
|
2016-03-08 12:38:52 -08:00
|
|
|
has(value: T): boolean;
|
|
|
|
keys(): Iterator<T>;
|
|
|
|
size: number;
|
|
|
|
values(): Iterator<T>;
|
|
|
|
}
|
|
|
|
|
2017-12-14 16:14:21 -08:00
|
|
|
declare module.exports: typeof SetPolyfill;
|
2016-03-08 12:38:52 -08:00
|
|
|
}
|