/** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ declare var undefined: void; // Well known Symbols. declare class $SymbolHasInstance mixins Symbol {} declare class $SymboIsConcatSpreadable mixins Symbol {} declare class $SymbolIterator mixins Symbol {} declare class $SymbolMatch mixins Symbol {} declare class $SymbolReplace mixins Symbol {} declare class $SymbolSearch mixins Symbol {} declare class $SymbolSpecies mixins Symbol {} declare class $SymbolSplit mixins Symbol {} declare class $SymbolToPrimitive mixins Symbol {} declare class $SymbolToStringTag mixins Symbol {} declare class $SymbolUnscopables mixins Symbol {} /* All the Array.prototype methods and properties that don't mutate the array. */ declare class $ReadOnlyArray<+T> { @@iterator(): Iterator; toLocaleString(): string; // concat creates a new array concat | S>(...items: Array): Array; entries(): Iterator<[number, T]>; every(callbackfn: (value: T, index: number, array: $ReadOnlyArray) => any, thisArg?: any): boolean; filter(callbackfn: typeof Boolean): Array<$NonMaybeType>; filter(callbackfn: (value: T, index: number, array: $ReadOnlyArray) => any, thisArg?: any): Array; find(callbackfn: (value: T, index: number, array: $ReadOnlyArray) => any, thisArg?: any): T | void; findIndex(callbackfn: (value: T, index: number, array: $ReadOnlyArray) => any, thisArg?: any): number; forEach(callbackfn: (value: T, index: number, array: $ReadOnlyArray) => any, thisArg?: any): void; includes(searchElement: mixed, fromIndex?: number): boolean; indexOf(searchElement: mixed, fromIndex?: number): number; join(separator?: string): string; keys(): Iterator; lastIndexOf(searchElement: mixed, fromIndex?: number): number; map(callbackfn: (value: T, index: number, array: $ReadOnlyArray) => U, thisArg?: any): Array; reduce( callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: $ReadOnlyArray) => T, initialValue: void ): T; reduce( callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: $ReadOnlyArray) => U, initialValue: U ): U; reduceRight( callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: $ReadOnlyArray) => T, initialValue: void ): T; reduceRight( callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: $ReadOnlyArray) => U, initialValue: U ): U; slice(start?: number, end?: number): Array; some(callbackfn: (value: T, index: number, array: $ReadOnlyArray) => any, thisArg?: any): boolean; values(): Iterator; +[key: number]: T; +length: number; } type RegExp$flags = $CharSet<"gimsuy">; type RegExp$matchResult = Array & {index: number, input: string, groups: ?{[name: string]: string}}; declare class CallSite { getThis(): any; getTypeName(): string; getFunction(): ?Function; getFunctionName(): string; getMethodName(): string; getFileName(): ?string; getLineNumber(): ?number; getColumnNumber(): ?number; getEvalOrigin(): ?CallSite; getScriptNameOrSourceURL(): ?string; isToplevel(): bool; isEval(): bool; isNative(): bool; isConstructor(): bool; toString(): string; } interface $Iterator<+Yield,+Return,-Next> { @@iterator(): $Iterator; next(value?: Next): IteratorResult; } interface $Iterable<+Yield,+Return,-Next> { @@iterator(): $Iterator; } declare function $iterate(p: Iterable): T; /* Async Iterable/Iterator/Generator */ interface $AsyncIterator<+Yield,+Return,-Next> { @@asyncIterator(): $AsyncIterator; next(value?: Next): Promise>; } interface $AsyncIterable<+Yield,+Return,-Next> { @@asyncIterator(): $AsyncIterator; } declare function $asyncIterator(p: AsyncIterable): T; /* Maps and Sets */ declare class $ReadOnlyMap { @@iterator(): Iterator<[K, V]>; entries(): Iterator<[K, V]>; forEach(callbackfn: (value: V, index: K, map: $ReadOnlyMap) => mixed, thisArg?: any): void; get(key: K): V | void; has(key: K): boolean; keys(): Iterator; size: number; values(): Iterator; } declare class $ReadOnlyWeakMap { get(key: K): V | void; has(key: K): boolean; } declare class $ReadOnlySet { @@iterator(): Iterator; entries(): Iterator<[T, T]>; forEach(callbackfn: (value: T, index: T, set: $ReadOnlySet) => mixed, thisArg?: any): void; has(value: T): boolean; keys(): Iterator; size: number; values(): Iterator; } declare class $ReadOnlyWeakSet { has(value: T): boolean; } // we use this signature when typing await expressions declare function $await(p: Promise | T): T; // This is a helper type to simplify the specification, it isn't an interface // and there are no objects implementing it. // https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView type $ArrayBufferView = $TypedArray | DataView; // The TypedArray intrinsic object is a constructor function, but does not have // a global name or appear as a property of the global object. // http://www.ecma-international.org/ecma-262/6.0/#sec-%typedarray%-intrinsic-object declare class $TypedArray { static BYTES_PER_ELEMENT: number; static from(iterable: Iterable, mapFn?: (element: number) => number, thisArg?: any): this; static of(...values: number[]): this; constructor(length: number): void; constructor(typedArray: $TypedArray): void; constructor(iterable: Iterable): void; constructor(buffer: ArrayBuffer, byteOffset?: number, length?: number): void; [index: number]: number; @@iterator(): Iterator; buffer: ArrayBuffer; byteLength: number; byteOffset: number; length: number; copyWithin(target: number, start: number, end?: number): void; entries(): Iterator<[number, number]>; every(callback: (value: number, index: number, array: this) => mixed, thisArg?: any): boolean; fill(value: number, start?: number, end?: number): this; filter(callback: (value: number, index: number, array: this) => mixed, thisArg?: any): this; find(callback: (value: number, index: number, array: this) => mixed, thisArg?: any): number | void; findIndex(callback: (value: number, index: number, array: this) => mixed, thisArg?: any): number; forEach(callback: (value: number, index: number, array: this) => mixed, thisArg?: any): void; includes(searchElement: number, fromIndex?: number): boolean; indexOf(searchElement: number, fromIndex?: number): number; // -1 if not present join(separator?: string): string; keys(): Iterator; lastIndexOf(searchElement: number, fromIndex?: number): number; // -1 if not present map(callback: (currentValue: number, index: number, array: this) => number, thisArg?: any): this; reduce( callback: (previousValue: number, currentValue: number, index: number, array: this) => number, initialValue: void ): number; reduce( callback: (previousValue: U, currentValue: number, index: number, array: this) => U, initialValue: U ): U; reduceRight( callback: (previousValue: number, currentValue: number, index: number, array: this) => number, initialValue: void ): number; reduceRight( callback: (previousValue: U, currentValue: number, index: number, array: this) => U, initialValue: U ): U; reverse(): this; set(array: Array | $TypedArray, offset?: number): void; slice(begin?: number, end?: number): this; some(callback: (value: number, index: number, array: this) => mixed, thisArg?: any): boolean; sort(compare?: (a: number, b: number) => number): void; subarray(begin?: number, end?: number): this; values(): Iterator; } declare opaque type TimeoutID; declare opaque type IntervalID; /* Proxy */ type Proxy$traps = { getPrototypeOf?: (target: T) => Object|null; setPrototypeOf?: (target: T, prototype: Object|null) => boolean; isExtensible?: (target: T) => boolean; preventExtensions?: (target: T) => boolean; getOwnPropertyDescriptor?: (target: T, property: string) => void | PropertyDescriptor; defineProperty?: (target: T, property: string, descriptor: PropertyDescriptor) => boolean; has?: (target: T, key: string) => boolean; get?: (target: T, property: string, receiver: Proxy) => any; set?: (target: T, property: string, value: any, receiver: Proxy) => boolean; deleteProperty?: (target: T, property: string) => boolean; ownKeys?: (target: T) => Array; apply?: (target: T, context: any, args: Array) => any; construct?: (target: T, args: Array, newTarget: Function) => Object; }; type Proxy$revocable = T & { revoke(): void; }; /* CommonJS */ declare var global: any; declare var module: { exports: any; require(id: string): any; id: string; filename: string; loaded: boolean; parent: any; children: Array; }; declare var require: { (id: string): any; resolve: (id: string) => string; cache: any; main: typeof module; }; declare var exports: any; /* Opaque type for module reference magic strings */ declare opaque type $Flow$ModuleRef;