From 27e6fddf22d2ff6f3fa90f3ca8555e2c0b4a3884 Mon Sep 17 00:00:00 2001 From: Michael Dodge Date: Mon, 23 Apr 2018 12:29:43 -0600 Subject: [PATCH 01/20] Add definitions for axios-token-interceptor --- .../axios-token-interceptor-tests.ts | 18 +++++++++++ types/axios-token-interceptor/index.d.ts | 31 +++++++++++++++++++ types/axios-token-interceptor/package.json | 6 ++++ types/axios-token-interceptor/tsconfig.json | 23 ++++++++++++++ types/axios-token-interceptor/tslint.json | 1 + 5 files changed, 79 insertions(+) create mode 100644 types/axios-token-interceptor/axios-token-interceptor-tests.ts create mode 100644 types/axios-token-interceptor/index.d.ts create mode 100644 types/axios-token-interceptor/package.json create mode 100644 types/axios-token-interceptor/tsconfig.json create mode 100644 types/axios-token-interceptor/tslint.json diff --git a/types/axios-token-interceptor/axios-token-interceptor-tests.ts b/types/axios-token-interceptor/axios-token-interceptor-tests.ts new file mode 100644 index 0000000000..58d67e02ad --- /dev/null +++ b/types/axios-token-interceptor/axios-token-interceptor-tests.ts @@ -0,0 +1,18 @@ +import tokenProvider, { tokenCache } from 'axios-token-interceptor'; + +tokenProvider(); // $ExpectError + +const validOptions = { + getToken: () => Promise.resolve('qwerty'), +}; +tokenProvider(validOptions); // $ExpectType TokenProvider + +tokenCache(); // $ExpectError + +const getToken = Promise.resolve('qwerty'); +const validCacheOptions = { + maxAge: 3600, +}; +const cache = tokenCache(getToken, validCacheOptions); // $Expect TokenCache + +cache.reset(); // $ExpectType void diff --git a/types/axios-token-interceptor/index.d.ts b/types/axios-token-interceptor/index.d.ts new file mode 100644 index 0000000000..8b63c5cc67 --- /dev/null +++ b/types/axios-token-interceptor/index.d.ts @@ -0,0 +1,31 @@ +// Type definitions for axios-token-interceptor 0.1 +// Project: https://github.com/sandrinodimattia/axios-token-interceptor#readme +// Definitions by: Mike Dodge +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { AxiosRequestConfig } from 'axios'; + +/*~ If this module has methods, declare them as functions like so. + */ + +export default function tokenProvider(Options: InterceptorOptions): TokenProvider; +export function tokenCache(getToken: Promise, options: TokenCacheOptions): TokenCache; + +/*~ You can declare types that are available via importing the module */ +export interface InterceptorOptions { + token?: string; + getToken?: () => string | Promise; + header?: string; + headerFormatter?: (token: string) => string; +} + +export type TokenProvider = (config: AxiosRequestConfig) => Promise; + +export interface TokenCacheOptions { + getMaxAge?: () => number; + maxAge?: number; +} + +export interface TokenCache { + reset(): void; +} diff --git a/types/axios-token-interceptor/package.json b/types/axios-token-interceptor/package.json new file mode 100644 index 0000000000..bd5a40b16d --- /dev/null +++ b/types/axios-token-interceptor/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "axios": "^0.16.2" + } +} diff --git a/types/axios-token-interceptor/tsconfig.json b/types/axios-token-interceptor/tsconfig.json new file mode 100644 index 0000000000..509608e7d6 --- /dev/null +++ b/types/axios-token-interceptor/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "axios-token-interceptor-tests.ts" + ] +} diff --git a/types/axios-token-interceptor/tslint.json b/types/axios-token-interceptor/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/axios-token-interceptor/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 3ec28e76de08d0cf5b50dd04390cc3f172db8cfb Mon Sep 17 00:00:00 2001 From: Michael Dodge Date: Mon, 23 Apr 2018 12:59:39 -0600 Subject: [PATCH 02/20] Use namespace to add tokenCache as prop of default export function --- .../axios-token-interceptor-tests.ts | 4 ++-- types/axios-token-interceptor/index.d.ts | 12 +++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/types/axios-token-interceptor/axios-token-interceptor-tests.ts b/types/axios-token-interceptor/axios-token-interceptor-tests.ts index 58d67e02ad..63f40c611a 100644 --- a/types/axios-token-interceptor/axios-token-interceptor-tests.ts +++ b/types/axios-token-interceptor/axios-token-interceptor-tests.ts @@ -1,4 +1,4 @@ -import tokenProvider, { tokenCache } from 'axios-token-interceptor'; +import tokenProvider from 'axios-token-interceptor'; tokenProvider(); // $ExpectError @@ -13,6 +13,6 @@ const getToken = Promise.resolve('qwerty'); const validCacheOptions = { maxAge: 3600, }; -const cache = tokenCache(getToken, validCacheOptions); // $Expect TokenCache +const cache = tokenProvider.tokenCache(getToken, validCacheOptions); // $Expect TokenCache cache.reset(); // $ExpectType void diff --git a/types/axios-token-interceptor/index.d.ts b/types/axios-token-interceptor/index.d.ts index 8b63c5cc67..c2bcd259d2 100644 --- a/types/axios-token-interceptor/index.d.ts +++ b/types/axios-token-interceptor/index.d.ts @@ -5,13 +5,15 @@ import { AxiosRequestConfig } from 'axios'; -/*~ If this module has methods, declare them as functions like so. - */ +// Module +export function AxiosTokenProvider(Options: InterceptorOptions): TokenProvider; +export namespace AxiosTokenProvider { + function tokenCache(getToken: Promise, options: TokenCacheOptions): TokenCache; +} +export default AxiosTokenProvider; -export default function tokenProvider(Options: InterceptorOptions): TokenProvider; -export function tokenCache(getToken: Promise, options: TokenCacheOptions): TokenCache; +// Interfaces -/*~ You can declare types that are available via importing the module */ export interface InterceptorOptions { token?: string; getToken?: () => string | Promise; From 27d4663769c6920ba46cc6d2a1088114325ca4cb Mon Sep 17 00:00:00 2001 From: Jared Szechy Date: Wed, 16 May 2018 15:17:55 -0400 Subject: [PATCH 03/20] Add typings for cesium --- types/cesium/index.d.ts | 5114 ++++++++++++++++++++++++++++++++++++ types/cesium/tsconfig.json | 23 + types/cesium/tslint.json | 1 + 3 files changed, 5138 insertions(+) create mode 100644 types/cesium/index.d.ts create mode 100644 types/cesium/tsconfig.json create mode 100644 types/cesium/tslint.json diff --git a/types/cesium/index.d.ts b/types/cesium/index.d.ts new file mode 100644 index 0000000000..08bc2706d7 --- /dev/null +++ b/types/cesium/index.d.ts @@ -0,0 +1,5114 @@ +// Type definitions for cesium 1.44 +// Project: http://cesiumjs.org +// Definitions by: Aigars Zeiza +// Harry Nicholls +// Jared Szechy +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +declare namespace Cesium { + type RenderState = any; + + interface Proxy { + getURL(resource: string): string; + } + + class ArcGisImageServerTerrainProvider extends TerrainProvider { + constructor(options: { url: string; token?: string; proxy?: any; tilingScheme?: TilingScheme; ellipsoid?: Ellipsoid; credit?: Credit | string }); + } + + class AssociativeArray { + length: number; + values: any[]; + contains(key: string | number): boolean; + set(key: string | number, value: any): void; + get(key: string | number): any; + remove(key: string | number): boolean; + removeAll(): void; + } + + class AxisAlignedBoundingBox { + minimum: Cartesian3; + maximum: Cartesian3; + center: Cartesian3; + constructor(minimum?: Cartesian3, maximum?: Cartesian3, center?: Cartesian3); + clone(result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox; + intersect(plane: Cartesian4): Intersect; + equals(right?: AxisAlignedBoundingBox): boolean; + static fromPoints(positions: Cartesian3[], result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox; + static clone(box: AxisAlignedBoundingBox, result?: AxisAlignedBoundingBox): AxisAlignedBoundingBox; + static equals(left?: AxisAlignedBoundingBox, right?: AxisAlignedBoundingBox): boolean; + static intersect(box: AxisAlignedBoundingBox, plane: Cartesian4): Intersect; + } + + class BoundingRectangle { + x: number; + y: number; + width: number; + height: number; + constructor(x?: number, y?: number, width?: number, height?: number); + clone(result?: BoundingRectangle): BoundingRectangle; + intersect(right: BoundingRectangle): Intersect; + equals(right?: BoundingRectangle): boolean; + static fromPoints(positions: Cartesian2[], result?: BoundingRectangle): BoundingRectangle; + static fromRectangle(rectangle: Rectangle, projection?: any, result?: BoundingRectangle): BoundingRectangle; + static clone(rectangle: BoundingRectangle, result?: BoundingRectangle): BoundingRectangle; + static union(left: BoundingRectangle, right: BoundingRectangle, result?: BoundingRectangle): BoundingRectangle; + static expand(rectangle: BoundingRectangle, point: Cartesian2, result?: BoundingRectangle): BoundingRectangle; + static intersect(left: BoundingRectangle, right: BoundingRectangle): Intersect; + static equals(left?: BoundingRectangle, right?: BoundingRectangle): boolean; + } + + class BoundingSphere extends Packable { + center: Cartesian3; + radius: number; + constructor(center?: Cartesian3, radius?: number); + intersect(plane: Cartesian4): Intersect; + equals(right?: BoundingSphere): boolean; + clone(result?: BoundingSphere): BoundingSphere; + static fromPoints(positions: Cartesian3[], result?: BoundingSphere): BoundingSphere; + static fromRectangle2D(rectangle: Rectangle, projection?: any, result?: BoundingSphere): BoundingSphere; + static fromRectangleWithHeights2D(rectangle: Rectangle, projection?: any, minimumHeight?: number, maximumHeight?: number, result?: BoundingSphere): BoundingSphere; + static fromRectangle3D(rectangle: Rectangle, ellipsoid?: Ellipsoid, surfaceHeight?: number, result?: BoundingSphere): BoundingSphere; + static fromVertices(positions: Cartesian3[], center?: Cartesian3, stride?: number, result?: BoundingSphere): BoundingSphere; + static fromCornerPoints(corner?: number, oppositeCorner?: number, result?: BoundingSphere): BoundingSphere; + static fromEllipsoid(ellipsoid: Ellipsoid, result?: BoundingSphere): BoundingSphere; + static fromBoundingSpheres(boundingSpheres: BoundingSphere[], result?: BoundingSphere): BoundingSphere; + static clone(sphere: BoundingSphere, result?: BoundingSphere): BoundingSphere; + static pack(value: BoundingSphere, array: number[], startingIndex?: number): number[]; + static unpack(array: number[], startingIndex?: number, result?: BoundingSphere): BoundingSphere; + static union(left: BoundingSphere, right: BoundingSphere, result?: BoundingSphere): BoundingSphere; + static expand(sphere: BoundingSphere, point: Cartesian3, result?: BoundingSphere): BoundingSphere; + static intersect(sphere: BoundingSphere, plane: Cartesian4): Intersect; + static transform(sphere: BoundingSphere, transform: Matrix4, result?: BoundingSphere): BoundingSphere; + static distanceSquaredTo(sphere: BoundingSphere, cartesian: Cartesian3): number; + static transformWithoutScale(sphere: BoundingSphere, transform: Matrix4, result?: BoundingSphere): BoundingSphere; + static computePlaneDistances(sphere: BoundingSphere, position: Cartesian3, direction: Cartesian3, result?: Cartesian2): Interval; + static projectTo2D(sphere: BoundingSphere, projection?: any, result?: BoundingSphere): BoundingSphere; + static equals(left?: BoundingSphere, right?: BoundingSphere): boolean; + } + + class BoxGeometry extends Packable { + constructor(options: { minimumCorner: Cartesian3; maximumCorner: Cartesian3; vertexFormat?: VertexFormat }); + static fromDimensions(): void; + static unpack(array: number[], startingIndex?: number, result?: BoxGeometry): BoxGeometry; + static createGeometry(boxGeometry: BoxGeometry): Geometry; + } + + class BoxOutlineGeometry extends Packable { + constructor(); + static fromDimensions(): void; + static unpack(array: number[], startingIndex?: number, result?: BoxOutlineGeometry): BoxOutlineGeometry; + static createGeometry(boxGeometry: BoxOutlineGeometry): Geometry; + } + + class Cartesian2 extends Packable { + x: number; + y: number; + static ZERO: Cartesian2; + static UNIT_X: Cartesian2; + static UNIT_Y: Cartesian2; + constructor(x?: number, y?: number); + clone(result?: Cartesian2): Cartesian2; + equals(right?: Cartesian2): boolean; + equalsEpsilon(right: Cartesian2, relativeEpsilon: number, absoluteEpsilon?: number): boolean; + toString(): string; + static fromElements(x: number, y: number, result?: Cartesian2): Cartesian2; + static clone(cartesian: Cartesian2, result?: Cartesian2): Cartesian2; + static fromCartesian3(cartesian: Cartesian3, result?: Cartesian2): Cartesian2; + static fromCartesian4(cartesian: Cartesian4, result?: Cartesian2): Cartesian2; + static pack(value: Cartesian2, array: number[], startingIndex?: number): number[]; + static unpack(array: number[], startingIndex?: number, result?: Cartesian2): Cartesian2; + static fromArray(array: number[], startingIndex?: number, result?: Cartesian2): Cartesian2; + static maximumComponent(cartesian: Cartesian2): number; + static minimumComponent(cartesian: Cartesian2): number; + static minimumByComponent(first: Cartesian2, second: Cartesian2, result: Cartesian2): Cartesian2; + static maximumByComponent(first: Cartesian2, second: Cartesian2, result: Cartesian2): Cartesian2; + static magnitudeSquared(cartesian: Cartesian2): number; + static magnitude(cartesian: Cartesian2): number; + static distance(left: Cartesian2, right: Cartesian2): number; + static distanceSquared(left: Cartesian2, right: Cartesian2): number; + static normalize(cartesian: Cartesian2, result: Cartesian2): Cartesian2; + static dot(left: Cartesian2, right: Cartesian2): number; + static multiplyComponents(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2; + static add(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2; + static subtract(left: Cartesian2, right: Cartesian2, result: Cartesian2): Cartesian2; + static multiplyByScalar(cartesian: Cartesian2, scalar: number, result: Cartesian2): Cartesian2; + static divideByScalar(cartesian: Cartesian2, scalar: number, result: Cartesian2): Cartesian2; + static negate(cartesian: Cartesian2, result: Cartesian2): Cartesian2; + static abs(cartesian: Cartesian2, result: Cartesian2): Cartesian2; + static lerp(start: Cartesian2, end: Cartesian2, t: number, result: Cartesian2): Cartesian2; + static angleBetween(left: Cartesian2, right: Cartesian2): number; + static mostOrthogonalAxis(cartesian: Cartesian2, result: Cartesian2): Cartesian2; + static equals(left?: Cartesian2, right?: Cartesian2): boolean; + static equalsEpsilon(left: Cartesian2, right: Cartesian2, relativeEpsilon: number, absoluteEpsilon?: number): boolean; + } + + class Cartesian3 extends Packable implements PositionProperty { + x: number; + y: number; + z: number; + static ZERO: Cartesian3; + static UNIT_X: Cartesian3; + static UNIT_Y: Cartesian3; + static UNIT_Z: Cartesian3; + constructor(x?: number, y?: number, z?: number); + clone(result?: Cartesian3): Cartesian3; + equals(right?: Cartesian3): boolean; + equalsEpsilon(right: Cartesian3, relativeEpsilon: number, absoluteEpsilon?: number): boolean; + toString(): string; + static fromSpherical(spherical: Spherical, result?: Cartesian3): Cartesian3; + static fromElements(x: number, y: number, z: number, result?: Cartesian3): Cartesian3; + static clone(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + static fromCartesian4(cartesian: Cartesian4, result?: Cartesian3): Cartesian3; + static pack(value: Cartesian3, array: number[], startingIndex?: number): number[]; + static unpack(array: number[], startingIndex?: number, result?: Cartesian3): Cartesian3; + static fromArray(array: number[], startingIndex?: number, result?: Cartesian3): Cartesian3; + static maximumComponent(cartesian: Cartesian3): number; + static minimumComponent(cartesian: Cartesian3): number; + static minimumByComponent(first: Cartesian3, second: Cartesian3, result: Cartesian3): Cartesian3; + static maximumByComponent(first: Cartesian3, second: Cartesian3, result: Cartesian3): Cartesian3; + static magnitudeSquared(cartesian: Cartesian3): number; + static magnitude(cartesian: Cartesian3): number; + static distance(left: Cartesian3, right: Cartesian3): number; + static distanceSquared(left: Cartesian3, right: Cartesian3): number; + static normalize(cartesian: Cartesian3, result: Cartesian3): Cartesian3; + static dot(left: Cartesian3, right: Cartesian3): number; + static multiplyComponents(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3; + static add(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3; + static subtract(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3; + static multiplyByScalar(cartesian: Cartesian3, scalar: number, result: Cartesian3): Cartesian3; + static divideByScalar(cartesian: Cartesian3, scalar: number, result: Cartesian3): Cartesian3; + static negate(cartesian: Cartesian3, result: Cartesian3): Cartesian3; + static abs(cartesian: Cartesian3, result: Cartesian3): Cartesian3; + static lerp(start: Cartesian3, end: Cartesian3, t: number, result: Cartesian3): Cartesian3; + static angleBetween(left: Cartesian3, right: Cartesian3): number; + static mostOrthogonalAxis(cartesian: Cartesian3, result: Cartesian3): Cartesian3; + static equals(left?: Cartesian3, right?: Cartesian3): boolean; + static equalsEpsilon(left: Cartesian3, right: Cartesian3, relativeEpsilon: number, absoluteEpsilon?: number): boolean; + static cross(left: Cartesian3, right: Cartesian3, result: Cartesian3): Cartesian3; + static fromDegrees(longitude: number, latitude: number, height?: number, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3; + static fromRadians(longitude: number, latitude: number, height?: number, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3; + static fromDegreesArray(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[]; + static fromRadiansArray(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[]; + static fromDegreesArrayHeights(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[]; + static fromRadiansArrayHeights(coordinates: number[], ellipsoid?: Ellipsoid, result?: Cartesian3[]): Cartesian3[]; + isConstant: boolean; + definitionChanged: Event; + referenceFrame: ReferenceFrame; + getValue(time: JulianDate, result?: Cartesian3): Cartesian3; + getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3; + } + + class Cartesian4 extends Packable { + x: number; + y: number; + z: number; + w: number; + static ZERO: Cartesian4; + static UNIT_X: Cartesian4; + static UNIT_Y: Cartesian4; + static UNIT_Z: Cartesian4; + static UNIT_W: Cartesian4; + constructor(x?: number, y?: number, z?: number, w?: number); + clone(result?: Cartesian4): Cartesian4; + equals(right?: Cartesian4): boolean; + equalsEpsilon(right: Cartesian4, relativeEpsilon: number, absoluteEpsilon?: number): boolean; + toString(): string; + static fromElements(x: number, y: number, z: number, w: number, result?: Cartesian4): Cartesian4; + static fromColor(color: Color, result?: Cartesian4): Cartesian4; + static clone(cartesian: Cartesian4, result?: Cartesian4): Cartesian4; + static pack(value: Cartesian4, array: number[], startingIndex?: number): number[]; + static unpack(array: number[], startingIndex?: number, result?: Cartesian4): Cartesian4; + static fromArray(array: number[], startingIndex?: number, result?: Cartesian4): Cartesian4; + static maximumComponent(cartesian: Cartesian4): number; + static minimumComponent(cartesian: Cartesian4): number; + static minimumByComponent(first: Cartesian4, second: Cartesian4, result: Cartesian4): Cartesian4; + static maximumByComponent(first: Cartesian4, second: Cartesian4, result: Cartesian4): Cartesian4; + static magnitudeSquared(cartesian: Cartesian4): number; + static magnitude(cartesian: Cartesian4): number; + static distance(left: Cartesian4, right: Cartesian4): number; + static distanceSquared(left: Cartesian4, right: Cartesian4): number; + static normalize(cartesian: Cartesian4, result: Cartesian4): Cartesian4; + static dot(left: Cartesian4, right: Cartesian4): number; + static multiplyComponents(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4; + static add(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4; + static subtract(left: Cartesian4, right: Cartesian4, result: Cartesian4): Cartesian4; + static multiplyByScalar(cartesian: Cartesian4, scalar: number, result: Cartesian4): Cartesian4; + static divideByScalar(cartesian: Cartesian4, scalar: number, result: Cartesian4): Cartesian4; + static negate(cartesian: Cartesian4, result: Cartesian4): Cartesian4; + static abs(cartesian: Cartesian4, result: Cartesian4): Cartesian4; + static lerp(start: Cartesian4, end: Cartesian4, t: number, result: Cartesian4): Cartesian4; + static mostOrthogonalAxis(cartesian: Cartesian4, result: Cartesian4): Cartesian4; + static equals(left?: Cartesian4, right?: Cartesian4): boolean; + static equalsEpsilon(left: Cartesian4, right: Cartesian4, relativeEpsilon: number, absoluteEpsilon?: number): boolean; + } + + class Cartographic { + longitude: number; + latitude: number; + height: number; + static ZERO: Cartographic; + constructor(longitude?: number, latitude?: number, height?: number); + clone(result?: Cartographic): Cartographic; + equals(right?: Cartographic): boolean; + equalsEpsilon(right: Cartographic, epsilon: number): boolean; + toString(): string; + static fromRadians(longitude: number, latitude: number, height?: number, result?: Cartographic): Cartographic; + static fromDegrees(longitude: number, latitude: number, height?: number, result?: Cartographic): Cartographic; + static clone(cartographic: Cartographic, result?: Cartographic): Cartographic; + static equals(left?: Cartographic, right?: Cartographic): boolean; + static equalsEpsilon(left: Cartographic, right: Cartographic, epsilon: number): boolean; + } + + class CatmullRomSpline { + times: number[]; + points: Cartesian3[]; + firstTangent: Cartesian3; + lastTangent: Cartesian3; + constructor(options: { times: number[]; points: Cartesian3[]; firstTangent?: Cartesian3; lastTangent?: Cartesian3 }); + findTimeInterval(time: number): number; + evaluate(time: number, result?: Cartesian3): Cartesian3; + } + + class CesiumTerrainProvider extends TerrainProvider { + requestVertexNormals: boolean; + requestWaterMask: boolean; + constructor(options: { url: string; proxy?: Proxy; requestVertexNormals?: boolean; requestWaterMask?: boolean; ellipsoid?: Ellipsoid; credit?: Credit | string }); + } + + class CircleGeometry extends Packable { + constructor(options: { + center: Cartesian3; + radius: number; + ellipsoid?: Ellipsoid; + height?: number; + granularity?: number; + vertexFormat?: VertexFormat; + extrudedHeight?: number; + stRotation?: number + }); + static unpack(array: number[], startingIndex?: number, result?: CircleGeometry): number[]; + static createGeometry(circleGeometry: CircleGeometry): Geometry; + } + + class CircleOutlineGeometry extends Packable { + constructor(options: { center: Cartesian3; radius: number; ellipsoid?: Ellipsoid; height?: number; granularity?: number; extrudedHeight?: number; numberOfVerticalLines?: number }); + static unpack(array: number[], startingIndex?: number, result?: CircleOutlineGeometry): number[]; + static createGeometry(circleGeometry: CircleOutlineGeometry): Geometry; + } + + class Clock { + startTime: JulianDate; + stopTime: JulianDate; + currentTime: JulianDate; + multiplier: number; + clockStep: ClockStep; + clockRange: ClockRange; + canAnimate: boolean; + shouldAnimate: boolean; + onTick: Event; + constructor(options: { + startTime?: JulianDate; + stopTime?: JulianDate; + currentTime?: JulianDate; + multiplier?: number; + clockStep?: ClockStep; + clockRange?: ClockRange; + canAnimate?: boolean; + shouldAnimate?: + boolean + }); + tick(): JulianDate; + } + + class Color extends Packable { + red: number; + green: number; + blue: number; + alpha: number; + static ALICEBLUE: Color; + static ANTIQUEWHITE: Color; + static AQUA: Color; + static AQUAMARINE: Color; + static AZURE: Color; + static BEIGE: Color; + static BISQUE: Color; + static BLACK: Color; + static BLANCHEDALMOND: Color; + static BLUE: Color; + static BLUEVIOLET: Color; + static BROWN: Color; + static BURLYWOOD: Color; + static CADETBLUE: Color; + static CHARTREUSE: Color; + static CHOCOLATE: Color; + static CORAL: Color; + static CORNFLOWERBLUE: Color; + static CORNSILK: Color; + static CRIMSON: Color; + static CYAN: Color; + static DARKBLUE: Color; + static DARKCYAN: Color; + static DARKGOLDENROD: Color; + static DARKGRAY: Color; + static DARKGREEN: Color; + static DARKGREY: Color; + static DARKKHAKI: Color; + static DARKMAGENTA: Color; + static DARKOLIVEGREEN: Color; + static DARKORANGE: Color; + static DARKORCHID: Color; + static DARKRED: Color; + static DARKSALMON: Color; + static DARKSEAGREEN: Color; + static DARKSLATEBLUE: Color; + static DARKSLATEGRAY: Color; + static DARKSLATEGREY: Color; + static DARKTURQUOISE: Color; + static DARKVIOLET: Color; + static DEEPPINK: Color; + static DEEPSKYBLUE: Color; + static DIMGRAY: Color; + static DIMGREY: Color; + static DODGERBLUE: Color; + static FIREBRICK: Color; + static FLORALWHITE: Color; + static FORESTGREEN: Color; + static FUSCHIA: Color; + static GAINSBORO: Color; + static GHOSTWHITE: Color; + static GOLD: Color; + static GOLDENROD: Color; + static GRAY: Color; + static GREEN: Color; + static GREENYELLOW: Color; + static GREY: Color; + static HONEYDEW: Color; + static HOTPINK: Color; + static INDIANRED: Color; + static INDIGO: Color; + static IVORY: Color; + static KHAKI: Color; + static LAVENDER: Color; + static LAVENDAR_BLUSH: Color; + static LAWNGREEN: Color; + static LEMONCHIFFON: Color; + static LIGHTBLUE: Color; + static LIGHTCORAL: Color; + static LIGHTCYAN: Color; + static LIGHTGOLDENRODYELLOW: Color; + static LIGHTGRAY: Color; + static LIGHTGREEN: Color; + static LIGHTGREY: Color; + static LIGHTPINK: Color; + static LIGHTSEAGREEN: Color; + static LIGHTSKYBLUE: Color; + static LIGHTSLATEGRAY: Color; + static LIGHTSLATEGREY: Color; + static LIGHTSTEELBLUE: Color; + static LIGHTYELLOW: Color; + static LIME: Color; + static LIMEGREEN: Color; + static LINEN: Color; + static MAGENTA: Color; + static MAROON: Color; + static MEDIUMAQUAMARINE: Color; + static MEDIUMBLUE: Color; + static MEDIUMORCHID: Color; + static MEDIUMPURPLE: Color; + static MEDIUMSEAGREEN: Color; + static MEDIUMSLATEBLUE: Color; + static MEDIUMSPRINGGREEN: Color; + static MEDIUMTURQUOISE: Color; + static MEDIUMVIOLETRED: Color; + static MIDNIGHTBLUE: Color; + static MINTCREAM: Color; + static MISTYROSE: Color; + static MOCCASIN: Color; + static NAVAJOWHITE: Color; + static NAVY: Color; + static OLDLACE: Color; + static OLIVE: Color; + static OLIVEDRAB: Color; + static ORANGE: Color; + static ORANGERED: Color; + static ORCHID: Color; + static PALEGOLDENROD: Color; + static PALEGREEN: Color; + static PALETURQUOISE: Color; + static PALEVIOLETRED: Color; + static PAPAYAWHIP: Color; + static PEACHPUFF: Color; + static PERU: Color; + static PINK: Color; + static PLUM: Color; + static POWDERBLUE: Color; + static PURPLE: Color; + static RED: Color; + static ROSYBROWN: Color; + static ROYALBLUE: Color; + static SADDLEBROWN: Color; + static SALMON: Color; + static SANDYBROWN: Color; + static SEAGREEN: Color; + static SEASHELL: Color; + static SIENNA: Color; + static SILVER: Color; + static SKYBLUE: Color; + static SLATEBLUE: Color; + static SLATEGRAY: Color; + static SLATEGREY: Color; + static SNOW: Color; + static SPRINGGREEN: Color; + static STEELBLUE: Color; + static TAN: Color; + static TEAL: Color; + static THISTLE: Color; + static TOMATO: Color; + static TURQUOISE: Color; + static VIOLET: Color; + static WHEAT: Color; + static WHITE: Color; + static WHITESMOKE: Color; + static YELLOW: Color; + static YELLOWGREEN: Color; + static TRANSPARENT: Color; + static add(left: Color, right: Color, result?: Color): Color; + static byteToFloat(number: number): number; + static clone(color: Color, result?: Color): Color; + static divide(left: Color, right: Color, result?: Color): Color; + static divideByScalar(color: Color, scalar: number, result?: Color): Color; + static equals(left: Color, right: Color): boolean; + static floatToByte(number: number): number; + static fromAlpha(color: Color, alpha: number, result?: Color): Color; + static fromBytes(red?: number, green?: number, blue?: number, alpha?: number, result?: Color): Color; + static fromCartesian4(cartesian: Cartesian4, result?: Color): Color; + static fromCssColorString(color: string): Color; + static fromHsl(hue?: number, saturation?: number, lightness?: number, alpha?: number): Color; + static fromRandom(options?: { + red?: number; + minimumRed?: number; + maximumRed?: number; + green?: number; + minimumGreen?: number; + maximumGreen?: number; + blue?: number; + minimumBlue?: number; + maximumBlue?: number; + alpha?: number; + minimumAlpha?: number; + maximumAlpha?: number + }, result?: Color): Color; + static fromRgba(rgba: number): Color; + static mod(left: Color, right: Color, result?: Color): Color; + static multiply(left: Color, right: Color, result?: Color): Color; + static multiplyByScalar(color: Color, scalar: number, result?: Color): Color; + static pack(value: Color, array: number[], startingIndex?: number): number[]; + static subtract(left: Color, right: Color, result?: Color): Color; + static unpack(array: number[], startingIndex?: number, result?: Color): Color; + constructor(red?: number, green?: number, blue?: number, alpha?: number); + brighten(magnitude: number, result: Color): Color; + clone(result?: Color): Color; + darken(magnitude: number, result: Color): Color; + equals(other: Color): boolean; + equalsEpsilon(other: Color, epsilon?: number): boolean; + toBytes(result?: number[]): number[]; + toCssColorString(): string; + toRgba(): number; + toString(): string; + withAlpha(alpha: number, result?: Color): Color; + } + + class ColorGeometryInstanceAttribute { + value: Uint8Array; + componentDatatype: ComponentDatatype; + componentsPerAttribute: number; + normalize: boolean; + constructor(red?: number, green?: number, blue?: number, alpha?: number); + static fromColor(color: Color): ColorGeometryInstanceAttribute; + static toValue(color: Color, result?: Uint8Array): Uint8Array; + } + + class CorridorGeometry extends Packable { + constructor(options: { + positions: Cartesian3[]; + width: number; + ellipsoid?: Ellipsoid; + granularity?: number; + height?: number; + extrudedHeight?: number; + vertexFormat?: VertexFormat; + cornerType?: CornerType + }); + static unpack(array: number[], startingIndex?: number, result?: CorridorGeometry): CorridorGeometry; + static createGeometry(corridorGeometry: CorridorGeometry): Geometry; + } + + class CorridorOutlineGeometry extends Packable { + constructor(options: { + positions: Cartesian3[]; + width: number; + ellipsoid?: Ellipsoid; + granularity?: number; + height?: number; + extrudedHeight?: number; + cornerType?: CornerType + }); + static unpack(array: number[], startingIndex?: number, result?: CorridorOutlineGeometry): CorridorOutlineGeometry; + static createGeometry(corridorOutlineGeometry: CorridorOutlineGeometry): Geometry; + } + + class Credit { + readonly element: HTMLElement; + readonly html: string; + readonly imageUrl: string; + readonly link: string; + readonly showOnScreen: boolean; + readonly text: string; + constructor(html: string, showOnScreen?: boolean); + static equals(left: Credit, right: Credit): boolean; + equals(credits: Credit): boolean; + hasImage(): boolean; + hasLink(): boolean; + } + + class CylinderGeometry extends Packable { + constructor(options: { length: number; topRadius: number; bottomRadius: number; slices?: number; vertexFormat?: VertexFormat }); + static unpack(array: number[], startingIndex?: number, result?: CylinderGeometry): CylinderGeometry; + static createGeometry(cylinderGeometry: CylinderGeometry): Geometry; + } + + class CylinderOutlineGeometry extends Packable { + constructor(options: { length: number; topRadius: number; bottomRadius: number; slices?: number; numberOfVerticalLines?: number }); + static unpack(array: number[], startingIndex?: number, result?: CylinderOutlineGeometry): CylinderOutlineGeometry; + static createGeometry(cylinderGeometry: CylinderOutlineGeometry): Geometry; + } + + class DefaultProxy { + constructor(proxy: string); + getURL(resource: string): string; + } + + class DeveloperError { + name: string; + message: string; + stack: string; + constructor(message?: string); + } + + class EllipseGeometry extends Packable { + constructor(options: { + center: Cartesian3; + semiMajorAxis: number; + semiMinorAxis: number; + ellipsoid?: Ellipsoid; + height?: number; + extrudedHeight?: number; + rotation?: number; + stRotation?: number; + granularity?: number; + vertexFormat?: VertexFormat + }); + static unpack(array: number[], startingIndex?: number, result?: EllipseGeometry): EllipseGeometry; + static createGeometry(ellipseGeometry: EllipseGeometry): Geometry; + } + + class EllipseOutlineGeometry extends Packable { + constructor(options: { + center: Cartesian3; + semiMajorAxis: number; + semiMinorAxis: number; + ellipsoid?: Ellipsoid; + height?: number; + extrudedHeight?: number; + rotation?: number; + granularity?: number; + numberOfVerticalLines?: number + }); + static unpack(array: number[], startingIndex?: number, result?: EllipseOutlineGeometry): EllipseOutlineGeometry; + static createGeometry(ellipseGeometry: EllipseOutlineGeometry): Geometry; + } + + class Ellipsoid extends Packable { + radii: Cartesian3; + radiiSquared: Cartesian3; + radiiToTheFourth: Cartesian3; + oneOverRadii: Cartesian3; + oneOverRadiiSquared: Cartesian3; + minimumRadius: number; + maximumRadius: number; + static WGS84: Ellipsoid; + static UNIT_SPHERE: Ellipsoid; + static MOON: Ellipsoid; + constructor(x?: number, y?: number, z?: number); + clone(result?: Ellipsoid): Ellipsoid; + geocentricSurfaceNormal(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + geodeticSurfaceNormalCartographic(cartographic: Cartographic, result?: Cartesian3): Cartesian3; + geodeticSurfaceNormal(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + cartographicToCartesian(cartographic: Cartographic, result?: Cartesian3): Cartesian3; + cartographicArrayToCartesianArray(cartographics: Cartographic[], result?: Cartesian3[]): Cartesian3[]; + cartesianToCartographic(cartesian: Cartesian3, result?: Cartographic): Cartographic; + cartesianArrayToCartographicArray(cartesians: Cartesian3[], result?: Cartographic[]): Cartographic[]; + scaleToGeodeticSurface(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + scaleToGeocentricSurface(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + transformPositionToScaledSpace(position: Cartesian3, result?: Cartesian3): Cartesian3; + transformPositionFromScaledSpace(position: Cartesian3, result?: Cartesian3): Cartesian3; + equals(right?: Ellipsoid): boolean; + toString(): string; + static clone(ellipsoid: Ellipsoid, result?: Ellipsoid): Ellipsoid; + static fromCartesian3(radii?: Cartesian3): Ellipsoid; + static unpack(array: number[], startingIndex?: number, result?: Ellipsoid): Ellipsoid; + } + + class EllipsoidGeodesic { + surfaceDistance: number; + start: Cartographic; + end: Cartographic; + startHeading: number; + endHeading: number; + constructor(start?: Cartographic, end?: Cartographic, ellipsoid?: Ellipsoid); + setEndPoints(start: Cartographic, end: Cartographic): void; + interpolateUsingFraction(fraction: number): Cartographic; + interpolateUsingSurfaceDistance(distance: number): Cartographic; + } + + class EllipsoidGeometry extends Packable { + constructor(options?: { radii?: Cartesian3; stackPartitions?: number; slicePartitions?: number; vertexFormat?: VertexFormat }); + static unpack(array: number[], startingIndex?: number, result?: EllipsoidGeometry): EllipsoidGeometry; + static createGeometry(ellipsoidGeometry: EllipsoidGeometry): Geometry; + } + + class EllipsoidOutlineGeometry extends Packable { + constructor(options?: { radii?: Cartesian3; stackPartitions?: number; slicePartitions?: number; subdivisions?: number }); + static unpack(array: number[], startingIndex?: number, result?: EllipsoidOutlineGeometry): EllipsoidOutlineGeometry; + static createGeometry(ellipsoidGeometry: EllipsoidOutlineGeometry): Geometry; + } + + class EllipsoidTangentPlane { + ellipsoid: Ellipsoid; + origin: Cartesian3; + constructor(ellipsoid: Ellipsoid, origin: Cartesian3); + projectPointOntoPlane(cartesian: Cartesian3, result?: Cartesian2): Cartesian2; + projectPointsOntoPlane(cartesians: Cartesian3[], result?: Cartesian2[]): Cartesian2[]; + projectPointsOntoEllipsoid(cartesians: Cartesian2[], result?: Cartesian3[]): Cartesian3[]; + static fromPoints(ellipsoid: Ellipsoid, cartesians: Cartesian3): EllipsoidTangentPlane; + } + + class EllipsoidTerrainProvider extends TerrainProvider { + constructor(options?: { tilingScheme?: TilingScheme; ellipsoid?: Ellipsoid }); + } + + class Event { + numberOfListeners: number; + addEventListener(listener: () => void, scope?: any): Event.RemoveCallback; + removeEventListener(listener: () => void, scope?: any): boolean; + raiseEvent(...args: any[]): void; + } + + namespace Event { + type RemoveCallback = () => void; + } + + class EventHelper { + add(event: Event, listener: () => void, scope?: any): EventHelper.RemoveCallback; + removeAll(): void; + } + + namespace EventHelper { + type RemoveCallback = () => void; + } + + class GeographicProjection { + ellipsoid: Ellipsoid; + constructor(ellipsoid?: Ellipsoid); + project(cartographic: Cartographic, result?: Cartesian3): Cartesian3; + unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic; + } + + class GeographicTilingScheme { + ellipsoid: Ellipsoid; + rectangle: Rectangle; + projection: MapProjection; + constructor(options?: { ellipsoid?: Ellipsoid; rectangle?: Rectangle; numberOfLevelZeroTilesX?: number; numberOfLevelZeroTilesY?: number }); + getNumberOfXTilesAtLevel(level: number): number; + getNumberOfYTilesAtLevel(level: number): number; + rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle; + tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle; + tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle; + positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2; + } + + class Geometry { + attributes: GeometryAttributes; + indices: any[]; + primitiveType: PrimitiveType; + boundingSphere: BoundingSphere; + constructor(options: { attributes: GeometryAttributes; primitiveType?: PrimitiveType; indices?: Uint16Array | Uint32Array; boundingSphere?: BoundingSphere }); + static computeNumberOfVertices(geometry: Cartesian3): number; + } + + class GeometryAttribute { + componentDatatype: ComponentDatatype; + componentsPerAttribute: number; + normalize: boolean; + values: any[]; + constructor(options?: { componentDatatype?: ComponentDatatype; componentsPerAttribute?: number; normalize?: boolean; values?: number[] }); + } + + class GeometryAttributes { + position: GeometryAttribute; + normal: GeometryAttribute; + st: GeometryAttribute; + binormal: GeometryAttribute; + tangent: GeometryAttribute; + color: GeometryAttribute; + } + + class GeometryInstance { + geometry: Geometry; + modelMatrix: Matrix4; + id: any; + attributes: any; + constructor(options: { geometry: Geometry; modelMatrix?: Matrix4; id?: any; attributes?: any }); + } + + class GeometryInstanceAttribute { + componentDatatype: ComponentDatatype; + componentsPerAttribute: number; + normalize: boolean; + value: number[]; + constructor(options: { componentDatatype?: ComponentDatatype; componentsPerAttribute?: number; normalize?: boolean; value?: number[] }); + } + + class GregorianDate { + year: number; + month: number; + day: number; + hour: number; + minute: number; + second: number; + millisecond: number; + isLeapSecond: boolean; + } + + class HeightmapTerrainData { + waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement; + constructor(options: { + buffer: Int8Array | Uint8Array | Int16Array | Uint16Array | Float32Array | Float64Array; + width: number; + height: number; + childTileMask?: number; + structure?: any; + structureheightScale?: number; + structureheightOffset?: number; + structureelementsPerHeight?: number; + structurestride?: number; + structureelementMultiplier?: number; + structureisBigEndian?: boolean; + createdByUpsampling?: boolean + }); + createMesh(tilingScheme: TilingScheme, x: number, y: number, level: number): Promise; + interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number; + upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise; + isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean; + wasCreatedByUpsampling(): boolean; + } + + class HermiteSpline { + times: number[]; + points: Cartesian3[]; + inTangents: Cartesian3[]; + outTangents: Cartesian3[]; + constructor(options: { times: number[]; points: Cartesian3[]; inTangents: Cartesian3[]; outTangents: Cartesian3[] }); + findTimeInterval(time: number): number; + evaluate(time: number, result?: Cartesian3): Cartesian3; + static createC1(): HermiteSpline; + static createNaturalCubic(): HermiteSpline | LinearSpline; + static createClampedCubic(): HermiteSpline | LinearSpline; + } + + class IonImageryProvider extends ImageryProvider { + constructor(options: {assetId: number, accessToken?: string, server?: string}) + } + + class Interval { + start: number; + stop: number; + constructor(start?: number, stop?: number); + } + + class JulianDate { + dayNumber: number; + secondsOfDay: number; + static leapSeconds: LeapSecond[]; + constructor(julianDayNumber?: number, secondsOfDay?: number, timeStandard?: TimeStandard); + clone(result?: JulianDate): JulianDate; + equals(right?: JulianDate): boolean; + equalsEpsilon(right: JulianDate, epsilon: number): boolean; + toString(): string; + static fromDate(date: Date, result?: JulianDate): JulianDate; + static fromIso8601(iso8601String: string, result?: JulianDate): JulianDate; + static now(result?: JulianDate): JulianDate; + static toGregorianDate(julianDate: JulianDate, result?: GregorianDate): GregorianDate; + static toDate(julianDate: JulianDate): Date; + static toIso8601(julianDate: JulianDate, precision?: number): string; + static clone(julianDate: JulianDate, result?: JulianDate): JulianDate; + static compare(left: JulianDate, right: JulianDate): number; + static equals(left?: JulianDate, right?: JulianDate): boolean; + static equalsEpsilon(left: JulianDate, right: JulianDate, epsilon: number): boolean; + static totalDays(julianDate: JulianDate): number; + static secondsDifference(left: JulianDate, right: JulianDate): number; + static daysDifference(left: JulianDate, right: JulianDate): number; + static computeTaiMinusUtc(julianDate: JulianDate): number; + static addSeconds(julianDate: JulianDate, seconds: number, result: JulianDate): JulianDate; + static addMinutes(julianDate: JulianDate, minutes: number, result: JulianDate): JulianDate; + static addHours(julianDate: JulianDate, hours: number, result: JulianDate): JulianDate; + static addDays(julianDate: JulianDate, days: number, result: JulianDate): JulianDate; + static lessThan(left: JulianDate, right: JulianDate): boolean; + static lessThanOrEquals(left: JulianDate, right: JulianDate): boolean; + static greaterThan(left: JulianDate, right: JulianDate): boolean; + static greaterThanOrEquals(left: JulianDate, right: JulianDate): boolean; + } + + class LeapSecond { + julianDate: JulianDate; + offset: number; + constructor(date?: JulianDate, offset?: number); + } + + class LinearSpline { + times: number[]; + points: Cartesian3[]; + constructor(); + findTimeInterval(time: number): number; + evaluate(time: number, result?: Cartesian3): Cartesian3; + } + + class MapProjection { + ellipsoid: Ellipsoid; + project(cartographic: Cartographic, result?: Cartesian3): Cartesian3; + unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic; + } + + class Matrix2 extends Packable { + static IDENTITY: Matrix2; + static COLUMN0ROW0: number; + static COLUMN0ROW1: number; + static COLUMN1ROW0: number; + static COLUMN1ROW1: number; + constructor(column0Row0?: number, column1Row0?: number, column0Row1?: number, column1Row1?: number); + clone(result?: Matrix2): Matrix2; + equals(right?: Matrix2): boolean; + equalsEpsilon(right: Matrix2, epsilon: number): boolean; + toString(): string; + static pack(value: Matrix2, array: number[], startingIndex?: number): number[]; + static unpack(array: number[], startingIndex?: number, result?: Matrix2): Matrix2; + static clone(matrix: Matrix2, result?: Matrix2): Matrix2; + static fromArray(array: number[], startingIndex?: number, result?: Matrix2): Matrix2; + static fromColumnMajorArray(values: number[], result?: Matrix2): Matrix2; + static fromRowMajorArray(values: number[], result?: Matrix2): Matrix2; + static fromScale(scale: Cartesian2, result?: Matrix2): Matrix2; + static fromUniformScale(scale: number, result?: Matrix2): Matrix2; + static fromRotation(angle: number, result?: Matrix2): Matrix2; + static toArray(matrix: Matrix2, result?: number[]): number[]; + static getElementIndex(row: number, column: number): number; + static getColumn(matrix: Matrix2, index: number, result: Cartesian2): Cartesian2; + static setColumn(matrix: Matrix2, index: number, cartesian: Cartesian2, result: Cartesian2): Matrix2; + static getRow(matrix: Matrix2, index: number, result: Cartesian2): Cartesian2; + static setRow(matrix: Matrix2, index: number, cartesian: Cartesian2, result: Matrix2): Matrix2; + static getScale(matrix: Matrix2, result: Cartesian2): Cartesian2; + static getMaximumScale(matrix: Matrix2): number; + static multiply(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2; + static add(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2; + static subtract(left: Matrix2, right: Matrix2, result: Matrix2): Matrix2; + static multiplyByVector(matrix: Matrix2, cartesian: Cartesian2, result: Cartesian2): Cartesian2; + static multiplyByScalar(matrix: Matrix2, scalar: number, result: Matrix2): Matrix2; + static negate(matrix: Matrix2, result: Matrix2): Matrix2; + static transpose(matrix: Matrix2, result: Matrix2): Matrix2; + static abs(matrix: Matrix2, result: Matrix2): Matrix2; + static equals(left?: Matrix2, right?: Matrix2): boolean; + static equalsEpsilon(left: Matrix2, right: Matrix2, epsilon: number): boolean; + } + + class Matrix3 extends Packable { + static IDENTITY: Matrix3; + static COLUMN0ROW0: number; + static COLUMN0ROW1: number; + static COLUMN0ROW2: number; + static COLUMN1ROW0: number; + static COLUMN1ROW1: number; + static COLUMN1ROW2: number; + static COLUMN2ROW0: number; + static COLUMN2ROW1: number; + static COLUMN2ROW2: number; + constructor(column0Row0?: number, column1Row0?: number, column2Row0?: number, column0Row1?: number, column1Row1?: number, + column2Row1?: number, column0Row2?: number, column1Row2?: number, column2Row2?: number); + clone(result?: Matrix3): Matrix3; + equals(right?: Matrix3): boolean; + equalsEpsilon(right: Matrix3, epsilon: number): boolean; + toString(): string; + static pack(value: Matrix3, array: number[], startingIndex?: number): number[]; + static unpack(array: number[], startingIndex?: number, result?: Matrix3): Matrix3; + static clone(matrix: Matrix3, result?: Matrix3): Matrix3; + static fromArray(array: number[], startingIndex?: number, result?: Matrix3): Matrix3; + static fromColumnMajorArray(values: number[], result?: Matrix3): Matrix3; + static fromRowMajorArray(values: number[], result?: Matrix3): Matrix3; + static fromQuaternion(quaternion: Quaternion): Matrix3; + static fromScale(scale: Cartesian3, result?: Matrix3): Matrix3; + static fromUniformScale(scale: number, result?: Matrix3): Matrix3; + static fromCrossProduct(the: Cartesian3, result?: Matrix3): Matrix3; + static fromRotationX(angle: number, result?: Matrix3): Matrix3; + static fromRotationY(angle: number, result?: Matrix3): Matrix3; + static fromRotationZ(angle: number, result?: Matrix3): Matrix3; + static toArray(matrix: Matrix3, result?: number[]): number[]; + static getElementIndex(row: number, column: number): number; + static getColumn(matrix: Matrix3, index: number, result: Cartesian3): Cartesian3; + static setColumn(matrix: Matrix3, index: number, cartesian: Cartesian3, result: Cartesian3): Matrix3; + static getRow(matrix: Matrix3, index: number, result: Cartesian3): Cartesian3; + static setRow(matrix: Matrix3, index: number, cartesian: Cartesian3, result: Cartesian3): Matrix3; + static getScale(matrix: Matrix3, result: Cartesian3): Cartesian3; + static getMaximumScale(matrix: Matrix3): number; + static multiply(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3; + static add(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3; + static subtract(left: Matrix3, right: Matrix3, result: Matrix3): Matrix3; + static multiplyByVector(matrix: Matrix3, cartesian: Cartesian3, result: Cartesian3): Cartesian3; + static multiplyByScalar(matrix: Matrix3, scalar: number, result: Matrix3): Matrix3; + static negate(matrix: Matrix3, result: Matrix3): Matrix3; + static transpose(matrix: Matrix3, result: Matrix3): Matrix3; + static computeEigenDecomposition(matrix: Matrix3, result?: any): any; + static abs(matrix: Matrix3, result: Matrix3): Matrix3; + static determinant(matrix: Matrix3): number; + static inverse(matrix: Matrix3, result: Matrix3): Matrix3; + static equals(left?: Matrix3, right?: Matrix3): boolean; + static equalsEpsilon(left: Matrix3, right: Matrix3, epsilon: number): boolean; + } + + class Matrix4 extends Packable { + static IDENTITY: Matrix4; + static COLUMN0ROW0: number; + static COLUMN0ROW1: number; + static COLUMN0ROW2: number; + static COLUMN0ROW3: number; + static COLUMN1ROW0: number; + static COLUMN1ROW1: number; + static COLUMN1ROW2: number; + static COLUMN1ROW3: number; + static COLUMN2ROW0: number; + static COLUMN2ROW1: number; + static COLUMN2ROW2: number; + static COLUMN2ROW3: number; + static COLUMN3ROW0: number; + static COLUMN3ROW1: number; + static COLUMN3ROW2: number; + static COLUMN3ROW3: number; + constructor(column0Row0?: number, column1Row0?: number, column2Row0?: number, column3Row0?: number, column0Row1?: number, + column1Row1?: number, column2Row1?: number, column3Row1?: number, column0Row2?: number, column1Row2?: number, + column2Row2?: number, column3Row2?: number, column0Row3?: number, column1Row3?: number, column2Row3?: number, + column3Row3?: number); + clone(result?: Matrix4): Matrix4; + equals(right?: Matrix4): boolean; + equalsEpsilon(right: Matrix4, epsilon: number): boolean; + toString(): string; + static pack(value: Matrix4, array: number[], startingIndex?: number): number[]; + static unpack(array: number[], startingIndex?: number, result?: Matrix4): Matrix4; + static clone(matrix: Matrix4, result?: Matrix4): Matrix4; + static fromArray(array: number[], startingIndex?: number, result?: Matrix4): Matrix4; + static fromColumnMajorArray(values: number[], result?: Matrix4): Matrix4; + static fromRowMajorArray(values: number[], result?: Matrix4): Matrix4; + static fromRotationTranslation(rotation: Matrix3, translation?: Cartesian3, result?: Matrix4): Matrix4; + static fromTranslationQuaternionRotationScale(translation: Cartesian3, rotation: Quaternion, scale: Cartesian3, result?: Matrix4): Matrix4; + static fromTranslation(translation: Cartesian3, result?: Matrix4): Matrix4; + static fromScale(scale: Cartesian3, result?: Matrix4): Matrix4; + static fromUniformScale(scale: number, result?: Matrix4): Matrix4; + static fromCamera(camera: Camera, result?: Matrix4): Matrix4; + static computePerspectiveFieldOfView(fovY: number, aspectRatio: number, near: number, far: number, result: Matrix4): Matrix4; + static computeOrthographicOffCenter(left: number, right: number, bottom: number, top: number, near: number, far: number, result: Matrix4): Matrix4; + static computePerspectiveOffCenter(left: number, right: number, bottom: number, top: number, near: number, far: number, result: Matrix4): Matrix4; + static computeInfinitePerspectiveOffCenter(left: number, right: number, bottom: number, top: number, near: number, far: number, result: Matrix4): Matrix4; + static computeViewportTransformation(viewport: any, nearDepthRange: number, farDepthRange: number, result: Matrix4): Matrix4; + static toArray(matrix: Matrix4, result?: number[]): number[]; + static getElementIndex(row: number, column: number): number; + static getColumn(matrix: Matrix4, index: number, result: Cartesian4): Cartesian4; + static setColumn(matrix: Matrix4, index: number, cartesian: Cartesian4, result: Cartesian4): Matrix4; + static getRow(matrix: Matrix4, index: number, result: Cartesian4): Cartesian4; + static setRow(matrix: Matrix4, index: number, cartesian: Cartesian4, result: Cartesian4): Matrix4; + static getScale(matrix: Matrix4, result: Cartesian3): Cartesian3; + static getMaximumScale(matrix: Matrix4): number; + static multiply(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4; + static add(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4; + static subtract(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4; + static multiplyTransformation(left: Matrix4, right: Matrix4, result: Matrix4): Matrix4; + static multiplyByMatrix3(matrix: Matrix4, rotation: Matrix3, result: Matrix4): Matrix4; + static multiplyByTranslation(matrix: Matrix4, translation: Cartesian3, result: Matrix4): Matrix4; + static multiplyByUniformScale(matrix: Matrix4, scale: number, result: Matrix4): Matrix4; + static multiplyByScale(matrix: Matrix4, scale: Cartesian3, result: Matrix4): Matrix4; + static multiplyByVector(matrix: Matrix4, cartesian: Cartesian4, result: Cartesian4): Cartesian4; + static multiplyByPointAsVector(matrix: Matrix4, cartesian: Cartesian3, result: Cartesian3): Cartesian3; + static multiplyByPoint(matrix: Matrix4, cartesian: Cartesian3, result: Cartesian3): Cartesian3; + static multiplyByScalar(matrix: Matrix4, scalar: number, result: Matrix4): Matrix4; + static negate(matrix: Matrix4, result: Matrix4): Matrix4; + static transpose(matrix: Matrix4, result: Matrix4): Matrix4; + static abs(matrix: Matrix4, result: Matrix4): Matrix4; + static equals(left?: Matrix4, right?: Matrix4): boolean; + static equalsEpsilon(left: Matrix4, right: Matrix4, epsilon: number): boolean; + static getTranslation(matrix: Matrix4, result: Cartesian3): Cartesian3; + static getRotation(matrix: Matrix4, result: Matrix3): Matrix3; + static inverse(matrix: Matrix4, result: Matrix4): Matrix4; + static inverseTransformation(matrix: Matrix4, result: Matrix4): Matrix4; + } + + class NearFarScalar extends Packable { + near: number; + nearValue: number; + far: number; + farValue: number; + constructor(near?: number, nearValue?: number, far?: number, farValue?: number); + clone(result?: NearFarScalar): NearFarScalar; + equals(right?: NearFarScalar): boolean; + static clone(nearFarScalar: NearFarScalar, result?: NearFarScalar): NearFarScalar; + static pack(value: NearFarScalar, array: number[], startingIndex?: number): number[]; + static unpack(array: number[], startingIndex?: number, result?: NearFarScalar): NearFarScalar; + static equals(left?: NearFarScalar, right?: NearFarScalar): boolean; + } + + class ObjectOrientedBoundingBox { + rotation: Matrix3; + translation: Cartesian3; + scale: Cartesian3; + constructor(rotation?: Matrix3, translation?: Cartesian3, scale?: Cartesian3); + clone(result?: ObjectOrientedBoundingBox): ObjectOrientedBoundingBox; + equals(right?: ObjectOrientedBoundingBox): boolean; + static fromPoints(positions: Cartesian3[], result?: ObjectOrientedBoundingBox): ObjectOrientedBoundingBox; + static fromBoundingRectangle(boundingRectangle: BoundingRectangle, rotation?: number): ObjectOrientedBoundingBox; + static clone(box: ObjectOrientedBoundingBox, result?: ObjectOrientedBoundingBox): ObjectOrientedBoundingBox; + static intersect(left: ObjectOrientedBoundingBox, right: ObjectOrientedBoundingBox): boolean; + static equals(left: ObjectOrientedBoundingBox, right: ObjectOrientedBoundingBox): boolean; + } + + class Occluder { + position: Cartesian3; + radius: number; + cameraPosition: Cartesian3; + constructor(occluderBoundingSphere: BoundingSphere, cameraPosition: Cartesian3); + isPointVisible(occludee: Cartesian3): boolean; + isBoundingSphereVisible(occludee: BoundingSphere): boolean; + computeVisibility(occludeeBS: BoundingSphere): number; + static fromBoundingSphere(occluderBoundingSphere: BoundingSphere, cameraPosition: Cartesian3, result?: Occluder): Occluder; + static computeOccludeePoint(occluderBoundingSphere: BoundingSphere, occludeePosition: Cartesian3, positions: Cartesian3[]): any; + static computeOccludeePointFromRectangle(rectangle: Rectangle, ellipsoid?: Ellipsoid): any; + } + + class PinBuilder { + fromColor(color: Color, size: number): HTMLCanvasElement; + fromUrl(url: string, color: Color, size: number): HTMLCanvasElement | Promise; + fromMakiIconId(id: string, color: Color, size: number): HTMLCanvasElement | Promise; + fromText(text: string, color: Color, size: number): HTMLCanvasElement; + } + + class Plane { + normal: Cartesian3; + distance: number; + constructor(normal: Cartesian3, distance: number); + static fromPointNormal(point: Cartesian3, normal: Cartesian3, result?: Plane): Plane; + static getPointDistance(plane: Plane, point: Cartesian3): number; + } + + class PolygonGeometry extends Packable { + constructor(options: { + polygonHierarchy: PolygonHierarchy; + height?: number; + extrudedHeight?: number; + vertexFormat?: VertexFormat; + stRotation?: number; + ellipsoid?: Ellipsoid; + granularity?: number; + perPositionHeight?: boolean + }); + static fromPositions(options?: { + positions: Cartesian3[]; + height?: number; + extrudedHeight?: number; + vertexFormat?: VertexFormat; + stRotation?: number; + ellipsoid?: Ellipsoid; + granularity?: number; + perPositionHeight?: boolean; + closeTop?: boolean; + closeBottom?: boolean; + }): PolygonGeometry; + static unpack(array: number[], startingIndex?: number, result?: PolygonGeometry): PolygonGeometry; + static createGeometry(polygonGeometry: PolygonGeometry): Geometry; + } + + class PolygonHierarchy extends Property { + positions: Cartesian3[]; + holes: PolygonHierarchy[]; + constructor(positions?: Cartesian3[], holes?: PolygonHierarchy[]); + } + + class PolygonOutlineGeometry extends Packable { + constructor(options: { + polygonHierarchy: any; + height?: number; + extrudedHeight?: number; + vertexFormat?: VertexFormat; + ellipsoid?: Ellipsoid; + granularity?: number; + perPositionHeight?: boolean + }); + static unpack(array: number[], startingIndex?: number, result?: PolygonOutlineGeometry): PolygonOutlineGeometry; + static fromPositions(options?: { + positions: Cartesian3[]; + height?: number; + extrudedHeight?: number; + ellipsoid?: Ellipsoid; + granularity?: number; + perPositionHeight?: boolean; + }): PolygonOutlineGeometry; + static createGeometry(polygonGeometry: PolygonOutlineGeometry): Geometry; + } + + class PolylineGeometry extends Packable { + constructor(options: { positions: Cartesian3[]; width?: number; colors?: Color[]; colorsPerVertex?: boolean; followSurface?: boolean; granularity?: number; ellipsoid?: Ellipsoid }); + static unpack(array: number[], startingIndex?: number, result?: PolylineGeometry): PolylineGeometry; + static createGeometry(polylineGeometry: PolylineGeometry): Geometry; + } + + class PolylineVolumeGeometry extends Packable { + constructor(options: { polylinePositions: Cartesian3[]; shapePositions: Cartesian2[]; ellipsoid?: Ellipsoid; granularity?: number; vertexFormat?: VertexFormat; cornerType?: CornerType }); + static unpack(array: number[], startingIndex?: number, result?: PolylineVolumeGeometry): PolylineVolumeGeometry; + static createGeometry(polylineVolumeGeometry: PolylineVolumeGeometry): Geometry; + } + + class PolylineVolumeOutlineGeometry extends Packable { + constructor(options: { polylinePositions: Cartesian3[]; shapePositions: number; ellipsoid?: Ellipsoid; granularity?: number; cornerType?: CornerType }); + static unpack(array: number[], startingIndex?: number, result?: PolylineVolumeOutlineGeometry): PolylineVolumeOutlineGeometry; + static createGeometry(polylineVolumeOutlineGeometry: PolylineVolumeOutlineGeometry): Geometry; + } + + class QuantizedMeshTerrainData { + waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement; + constructor(options: { + quantizedVertices: Uint16Array; + indices: Uint16Array | Uint32Array; + minimumHeight: number; + maximumHeight: number; + boundingSphere: BoundingSphere; + horizonOcclusionPoint: Cartesian3; + westIndices: number[]; + southIndices: number[]; + eastIndices: number[]; + northIndices: number[]; + westSkirtHeight: number; + southSkirtHeight: number; + eastSkirtHeight: number; + northSkirtHeight: number; + childTileMask?: number; + createdByUpsampling?: boolean; + encodedNormals?: Uint8Array; + waterMask?: Uint8Array + }); + createMesh(tilingScheme: TilingScheme, x: number, y: number, level: number): Promise; + upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise; + interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number; + isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean; + wasCreatedByUpsampling(): boolean; + } + + class Quaternion extends Packable { + x: number; + y: number; + z: number; + w: number; + static packedInterpolationLength: number; + static ZERO: Quaternion; + static IDENTITY: Quaternion; + constructor(x?: number, y?: number, z?: number, w?: number); + clone(result?: Quaternion): Quaternion; + equals(right?: Quaternion): boolean; + equalsEpsilon(right: Quaternion, epsilon: number): boolean; + toString(): string; + static fromAxisAngle(axis: Cartesian3, angle: number, result?: Quaternion): Quaternion; + static fromRotationMatrix(matrix: Matrix3, result?: Quaternion): Quaternion; + static fromHeadingPitchRoll(heading: number, pitch: number, roll: number, result: Quaternion): Quaternion; + static pack(value: Quaternion, array: number[], startingIndex?: number): number[]; + static unpack(array: number[], startingIndex?: number, result?: Quaternion): Quaternion; + static convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): void; + static unpackInterpolationResult(array: number[], sourceArray: number[], startingIndex?: number, lastIndex?: number, result?: Quaternion): Quaternion; + static clone(quaternion: Quaternion, result?: Quaternion): Quaternion; + static conjugate(quaternion: Quaternion, result: Quaternion): Quaternion; + static magnitudeSquared(quaternion: Quaternion): number; + static magnitude(quaternion: Quaternion): number; + static normalize(quaternion: Quaternion, result: Quaternion): Quaternion; + static inverse(quaternion: Quaternion, result: Quaternion): Quaternion; + static add(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion; + static subtract(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion; + static negate(quaternion: Quaternion, result: Quaternion): Quaternion; + static dot(left: Quaternion, right: Quaternion): number; + static multiply(left: Quaternion, right: Quaternion, result: Quaternion): Quaternion; + static multiplyByScalar(quaternion: Quaternion, scalar: number, result: Quaternion): Quaternion; + static divideByScalar(quaternion: Quaternion, scalar: number, result: Quaternion): Quaternion; + static computeAxis(quaternion: Quaternion, result: Cartesian3): Cartesian3; + static computeAngle(quaternion: Quaternion): number; + static lerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion; + static slerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion; + static log(quaternion: Quaternion, result: Cartesian3): Cartesian3; + static exp(cartesian: Cartesian3, result: Quaternion): Quaternion; + static computeInnerQuadrangle(q0: Quaternion, q1: Quaternion, q2: Quaternion, result: Quaternion): Quaternion; + static squad(q0: Quaternion, q1: Quaternion, s0: Quaternion, s1: Quaternion, t: number, result: Quaternion): Quaternion; + static fastSlerp(start: Quaternion, end: Quaternion, t: number, result: Quaternion): Quaternion; + static fastSquad(q0: Quaternion, q1: Quaternion, s0: Quaternion, s1: Quaternion, t: number, result?: Quaternion): Quaternion; + static equals(left?: Quaternion, right?: Quaternion): boolean; + static equalsEpsilon(left: Quaternion, right: Quaternion, epsilon: number): boolean; + } + + class QuaternionSpline { + times: number[]; + points: Quaternion[]; + innerQuadrangles: Quaternion[]; + constructor(options: { times: number[]; points: Quaternion[]; firstInnerQuadrangle?: Quaternion; lastInnerQuadrangle?: Quaternion }); + findTimeInterval(time: number): number; + evaluate(time: number, result?: Quaternion): Quaternion; + } + + class Queue { + readonly length: number; + enqueue(item: any): void; + dequeue(): any; + contains(item: any): boolean; + clear(): void; + peek(): any; + sort(compareFunction: Queue.Comparator): void; + } + + namespace Queue { + type Comparator = (a: any, b: any) => number; + } + + class Ray { + origin: Cartesian3; + direction: Cartesian3; + constructor(origin?: Cartesian3, direction?: Cartesian3); + static getPoint(t: number, result?: Cartesian3): Cartesian3; + } + + class Rectangle extends Packable { + west: number; + south: number; + east: number; + north: number; + width: number; + height: number; + static MAX_VALUE: Rectangle; + constructor(west?: number, south?: number, east?: number, north?: number); + clone(result?: Rectangle): Rectangle; + equals(other?: Rectangle): boolean; + equalsEpsilon(other: Rectangle, epsilon: number): boolean; + static pack(value: Rectangle, array: number[], startingIndex?: number): number[]; + static unpack(array: number[], startingIndex?: number, result?: Rectangle): Rectangle; + static computeWidth(rectangle: Rectangle): number; + static computeHeight(rectangle: Rectangle): number; + static fromDegrees(west?: number, south?: number, east?: number, north?: number, result?: Rectangle): Rectangle; + static fromCartographicArray(cartographics: Cartographic[], result?: Rectangle): Rectangle; + static clone(rectangle: Rectangle, result?: Rectangle): Rectangle; + static equals(left?: Rectangle, right?: Rectangle): boolean; + static validate(rectangle: Rectangle): void; + static southwest(rectangle: Rectangle, result?: Cartographic): Cartographic; + static northwest(rectangle: Rectangle, result?: Cartographic): Cartographic; + static northeast(rectangle: Rectangle, result?: Cartographic): Cartographic; + static southeast(rectangle: Rectangle, result?: Cartographic): Cartographic; + static center(rectangle: Rectangle, result?: Cartographic): Cartographic; + static intersection(rectangle: Rectangle, otherRectangle: Rectangle, result?: Rectangle): Rectangle; + static contains(rectangle: Rectangle, cartographic: Cartographic): boolean; + static subsample(rectangle: Rectangle, ellipsoid?: Ellipsoid, surfaceHeight?: number, result?: Cartesian3[]): Cartesian3[]; + } + + class RectangleGeometry extends Packable { + constructor(options: { + rectangle: Rectangle; + vertexFormat?: VertexFormat; + ellipsoid?: Ellipsoid; + granularity?: number; + height?: number; + rotation?: number; + stRotation?: number; + extrudedHeight?: number + }); + static pack(value: BoundingSphere, array: number[], startingIndex?: number): number[]; + static unpack(array: number[], startingIndex?: number, result?: RectangleGeometry): RectangleGeometry; + static createGeometry(rectangleGeometry: RectangleGeometry): Geometry; + } + + class RectangleOutlineGeometry extends Packable { + constructor(options: { + rectangle: Rectangle; + ellipsoid?: Ellipsoid; + granularity?: number; + height?: number; + rotation?: number; + extrudedHeight?: number + }); + static pack(value: BoundingSphere, array: number[], startingIndex?: number): number[]; + static unpack(array: number[], startingIndex?: number, result?: RectangleGeometry): RectangleOutlineGeometry; + static createGeometry(rectangleGeometry: RectangleOutlineGeometry): Geometry; + } + + class RequestErrorEvent { + statusCode: number; + response: any; + responseHeaders: any; + constructor(statusCode?: number, response?: any, responseHeaders?: string | object); + toString(): string; + } + + class RuntimeError { + name: string; + message: string; + stack: string; + constructor(message?: string); + } + + class ScreenSpaceEventHandler { + constructor(element?: HTMLCanvasElement); + setInputAction(action: () => void, type: number, modifier?: number): void; + getInputAction(type: number, modifier?: number): () => void; + removeInputAction(type: number, modifier?: number): void; + isDestroyed(): boolean; + destroy(): void; + } + + class ShowGeometryInstanceAttribute { + value: Uint8Array; + componentDatatype: ComponentDatatype; + componentsPerAttribute: number; + normalize: boolean; + constructor(show?: boolean); + static toValue(show: boolean, result?: Uint8Array): Uint8Array; + } + + class SimplePolylineGeometry extends Packable { + constructor(options: { positions: Cartesian3[]; colors?: Color[]; colorsPerVertex?: boolean; followSurface?: boolean; granularity?: number; ellipsoid?: Ellipsoid }); + static unpack(array: number[], startingIndex?: number, result?: SimplePolylineGeometry): SimplePolylineGeometry; + static createGeometry(simplePolylineGeometry: SimplePolylineGeometry): Geometry; + } + + class SphereGeometry extends Packable { + constructor(options?: { radius?: number; stackPartitions?: number; slicePartitions?: number; vertexFormat?: VertexFormat }); + static unpack(array: number[], startingIndex?: number, result?: SphereGeometry): SphereGeometry; + static createGeometry(sphereGeometry: SphereGeometry): Geometry; + } + + class SphereOutlineGeometry extends Packable { + constructor(options?: { radius?: number; stackPartitions?: number; slicePartitions?: number; subdivisions?: number }); + static unpack(array: number[], startingIndex?: number, result?: SphereOutlineGeometry): SphereOutlineGeometry; + static createGeometry(sphereGeometry: SphereOutlineGeometry): Geometry; + } + + class Spherical { + constructor(clock?: number, cone?: number, magnitude?: number); + equals(other: Spherical): boolean; + clone(result?: Spherical): Spherical; + equalsEpsilon(other: Spherical, epsilon: number): boolean; + toString(): string; + static fromCartesian3(cartesian3: Cartesian3, spherical?: Spherical): Spherical; + static clone(spherical: Spherical, result?: Spherical): Spherical; + static normalize(spherical: Spherical, result?: Spherical): Spherical; + static equals(left: Spherical, right: Spherical): boolean; + static equalsEpsilon(left: Spherical, right: Spherical, epsilon?: number): boolean; + } + + class Spline { + times: number[]; + points: Cartesian3[] | Quaternion[]; + evaluate(time: number, result?: Cartesian3 | Quaternion): Cartesian3 | Quaternion; + findTimeInterval(time: number, startIndex: number): number; + } + + class TaskProcessor { + constructor(workerName: string, maximumActiveTasks?: number); + scheduleTask(parameters: any, transferableObjects?: any[]): Promise; + isDestroyed(): boolean; + destroy(): void; + } + + class TerrainData { + waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement; + interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number; + isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean; + createMesh(tilingScheme: TilingScheme, x: number, y: number, level: number): Promise; + upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise; + wasCreatedByUpsampling(): boolean; + } + + class TerrainMesh { + center: Cartesian3; + vertices: Float32Array; + stride: number; + indices: Uint16Array | Uint32Array; + minimumHeight: number; + maximumHeight: number; + boundingSphere3D: BoundingSphere; + occludeePointInScaledSpace: Cartesian3; + constructor(center: Cartesian3, vertices: Float32Array, indices: Uint16Array | Uint32Array, minimumHeight: number, + maximumHeight: number, boundingSphere3D: BoundingSphere, occludeePointInScaledSpace: Cartesian3, vertexStride?: number); + } + + abstract class TerrainProvider { + availability: any; // TileAvailability + credit: Credit; + errorEvent: Event; + hasVertexNormals: boolean; + hasWaterMask: boolean; + ready: boolean; + readonly readyPromise: Promise; + tilingScheme: TilingScheme; + static heightmapTerrainQuality: number; + static getEstimatedLevelZeroGeometricErrorForAHeightmap(ellipsoid: Ellipsoid, tileImageWidth: number, numberOfTilesAtLevelZero: number): number; + static getRegularGridIndices(width: number, height: number): Uint16Array; + getLevelMaximumGeometricError(level: number): number; + getTileDataAvailable(x: number, y: number, level: number): boolean; + requestTileGeometry(x: number, y: number, level: number, throttleRequests?: boolean): Promise; + } + + class TileProviderError { + provider: ImageryProvider | TerrainProvider; + message: string; + x: number; + y: number; + level: number; + timesRetried: number; + retry: boolean; + error: Error; + constructor(provider: ImageryProvider | TerrainProvider, message: string, x?: number, y?: number, level?: number, timesRetried?: number, error?: Error); + static handleError(previousError: TileProviderError, provider: ImageryProvider | TerrainProvider, event: Event, + message: string, x: number, y: number, level: number, retryFunction: TileProviderError.RetryFunction, + errorDetails?: Error): TileProviderError; + static handleSuccess(previousError: TileProviderError): void; + } + + namespace TileProviderError { + type RetryFunction = () => void; + } + + class TilingScheme { + ellipsoid: Ellipsoid; + rectangle: Rectangle; + projection: MapProjection; + getNumberOfXTilesAtLevel(level: number): number; + getNumberOfYTilesAtLevel(level: number): number; + rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle; + tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle; + tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle; + positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2; + } + + class TimeInterval { + start: JulianDate; + stop: JulianDate; + data: any; + isStartIncluded: boolean; + isStopIncluded: boolean; + isEmpty: boolean; + static EMPTY: TimeInterval; + constructor(options?: { start?: JulianDate; stop?: JulianDate; isStartIncluded?: boolean; isStopIncluded?: boolean; data?: any }); + clone(result?: TimeInterval): TimeInterval; + equals(right?: TimeInterval, dataComparer?: TimeInterval.DataComparer): boolean; + equalsEpsilon(right: TimeInterval, epsilon: number, dataComparer?: TimeInterval.DataComparer): boolean; + toString(): string; + static fromIso8601(options: { iso8601: string; isStartIncluded?: boolean; isStopIncluded?: boolean; data?: any }, result?: TimeInterval): TimeInterval; + static toIso8601(timeInterval: TimeInterval, precision?: number): string; + static clone(timeInterval?: TimeInterval, result?: TimeInterval): TimeInterval; + static equals(left?: TimeInterval, right?: TimeInterval, dataComparer?: TimeInterval.DataComparer): boolean; + static equalsEpsilon(left: TimeInterval, right: TimeInterval, epsilon: number, dataComparer?: TimeInterval.DataComparer): boolean; + static intersect(left: TimeInterval, right: TimeInterval, result: TimeInterval, mergeCallback?: TimeInterval.MergeCallback): TimeInterval; + static contains(timeInterval: TimeInterval, julianDate: JulianDate): boolean; + } + + namespace TimeInterval { + type MergeCallback = (leftData: any, rightData: any) => any; + type DataComparer = (leftData: any, rightData: any) => boolean; + } + + class TimeIntervalCollection { + readonly changedEvent: Event; + readonly start: JulianDate; + readonly isStartIncluded: boolean; + readonly stop: JulianDate; + readonly isStopIncluded: boolean; + readonly length: number; + readonly isEmpty: boolean; + constructor(intervals?: TimeInterval[]); + equals(right?: TimeIntervalCollection, dataComparer?: TimeInterval.DataComparer): boolean; + get(index: number): TimeInterval; + removeAll(): void; + findIntervalContainingDate(date: JulianDate): TimeInterval | undefined; + findDataForIntervalContainingDate(date: JulianDate): any; + contains(julianDate: JulianDate): boolean; + indexOf(date: JulianDate): number; + findInterval(options?: { start?: JulianDate; stop?: JulianDate; isStartIncluded?: boolean; isStopIncluded?: boolean }): TimeInterval; + addInterval(interval: TimeInterval, dataComparer?: TimeInterval.DataComparer): void; + removeInterval(interval: TimeInterval): void; + intersect(other: TimeIntervalCollection, dataComparer?: TimeInterval.DataComparer, mergeCallback?: TimeInterval.MergeCallback): TimeIntervalCollection; + } + + class VRTheWorldTerrainProvider extends TerrainProvider { + constructor(options: { url: string; proxy?: any; ellipsoid?: Ellipsoid; credit?: Credit | string }); + } + + class VertexFormat extends Packable { + position: boolean; + normal: boolean; + st: boolean; + binormal: boolean; + tangent: boolean; + color: boolean; + static POSITION_ONLY: VertexFormat; + static POSITION_AND_NORMAL: VertexFormat; + static POSITION_NORMAL_AND_ST: VertexFormat; + static POSITION_AND_ST: VertexFormat; + static POSITION_AND_COLOR: VertexFormat; + static ALL: VertexFormat; + static DEFAULT: VertexFormat; + constructor(options?: any); + static unpack(array: number[], startingIndex?: number, result?: VertexFormat): VertexFormat; + static clone(cartesian: VertexFormat, result?: VertexFormat): VertexFormat; + } + + class WallGeometry extends Packable { + constructor(options: { positions: Cartesian3[]; granularity?: number; maximumHeights?: number[]; minimumHeights?: number[]; ellipsoid?: Ellipsoid; vertexFormat?: VertexFormat }); + static unpack(array: number[], startingIndex?: number, result?: WallGeometry): WallGeometry; + static fromConstantHeights(positions: Cartesian3[], maximumHeight?: number, minimumHeight?: number, ellipsoid?: Ellipsoid): WallGeometry; + static createGeometry(wallGeometry: WallGeometry): Geometry; + } + + class WallOutlineGeometry extends Packable { + constructor(options: { positions: Cartesian3[]; granularity?: number; maximumHeights?: number[]; minimumHeights?: number[]; ellipsoid?: Ellipsoid }); + static unpack(array: number[], startingIndex?: number, result?: WallOutlineGeometry): WallOutlineGeometry; + static fromConstantHeights(positions: Cartesian3[], maximumHeight?: number, minimumHeight?: number, ellipsoid?: Ellipsoid): WallOutlineGeometry; + static createGeometry(wallGeometry: WallOutlineGeometry): Geometry; + } + + class WebMercatorProjection { + ellipsoid: Ellipsoid; + static MaximumLatitude: number; + constructor(ellipsoid?: Ellipsoid); + project(cartographic: Cartographic, result?: Cartesian3): Cartesian3; + unproject(cartesian: Cartesian3, result?: Cartographic): Cartographic; + static mercatorAngleToGeodeticLatitude(mercatorAngle: number): number; + static geodeticLatitudeToMercatorAngle(latitude: number): number; + } + + class WebMercatorTilingScheme { + ellipsoid: Ellipsoid; + rectangle: Rectangle; + projection: MapProjection; + constructor(options?: { ellipsoid?: Ellipsoid; + numberOfLevelZeroTilesX?: number; + numberOfLevelZeroTilesY?: number; + rectangleSouthwestInMeters?: Cartesian2; + rectangleNortheastInMeters?: Cartesian2 + }); + getNumberOfXTilesAtLevel(level: number): number; + getNumberOfYTilesAtLevel(level: number): number; + rectangleToNativeRectangle(rectangle: Rectangle, result?: Rectangle): Rectangle; + tileXYToNativeRectangle(x: number, y: number, level: number, result?: any): Rectangle; + tileXYToRectangle(x: number, y: number, level: number, result?: any): Rectangle; + positionToTileXY(position: Cartographic, level: number, result?: Cartesian2): Cartesian2; + } + + class BillboardGraphics { + definitionChanged: Event; + image: Property; + imageSubRegion: Property; + scale: Property; + rotation: Property; + alignedAxis: Property; + horizontalOrigin: Property; + verticalOrigin: Property; + color: Property; + eyeOffset: Property; + pixelOffset: Property; + show: Property; + width: Property; + height: Property; + scaleByDistance: Property; + translucencyByDistance: Property; + pixelOffsetScaleByDistance: Property; + constructor(options?: { image?: Property; + show?: Property; + scale?: Property; + horizontalOrigin?: Property; + verticalOrigin?: Property; + eyeOffset?: Property; + pixelOffset?: Property; + rotation?: Property; + alignedAxis?: Property; + width?: Property; + height?: Property; + color?: Property; + scaleByDistance?: Property; + translucencyByDistance?: Property; + pixelOffsetScaleByDistance?: Property; + imageSubRegion?: Property + }); + clone(result?: BillboardGraphics): BillboardGraphics; + merge(source: BillboardGraphics): BillboardGraphics; + } + + class BillboardVisualizer extends Visualizer { + constructor(entityCluster: EntityCluster, entityCollection: EntityCollection); + } + + class BoxGeometryUpdater extends GeometryUpdater { + constructor(entity: Entity, scene: Scene); + } + + class BoxGraphics { + definitionChanged: Event; + show: Property; + dimensions: Property; + material: MaterialProperty; + fill: Property; + outline: Property; + outlineColor: Property; + outlineWidth: Property; + constructor(options?: { + dimensions?: Property; + show?: Property; + fill?: Property; + material?: MaterialProperty; + outline?: Property; + outlineColor?: Property; + outlineWidth?: Property + }); + clone(result?: BoxGraphics): BoxGraphics; + merge(source: BoxGraphics): BoxGraphics; + } + + class CallbackProperty extends Property { + constructor(callback: CallbackProperty.Callback, isConstant: boolean); + setCallback(callback: CallbackProperty.Callback, isConstant: boolean): void; + } + + namespace CallbackProperty { + type Callback = (time?: JulianDate, result?: any) => any; + } + + class CheckerboardMaterialProperty extends MaterialProperty { + evenColor: Color; + oddColor: Color; + repeat: Property; + constructor(options?: { evenColor?: Color; oddColor?: Color; repeat?: Property }); + } + + class ColorMaterialProperty extends MaterialProperty { + color: Color; + constructor(color?: Color); + } + + class CompositeEntityCollection { + collectionChanged: Event; + id: string; + values: Entity[]; + constructor(collections?: EntityCollection[]); + addCollection(collection: EntityCollection, index?: number): void; + removeCollection(collection: EntityCollection): boolean; + removeAllCollections(): void; + containsCollection(collection: EntityCollection): boolean; + contains(entity: Entity): boolean; + indexOfCollection(collection: EntityCollection): number; + getCollection(index: number): EntityCollection; + getCollectionsLength(): number; + raiseCollection(collection: EntityCollection): void; + lowerCollection(collection: EntityCollection): void; + raiseCollectionToTop(collection: EntityCollection): void; + lowerCollectionToBottom(collection: EntityCollection): void; + suspendEvents(): void; + resumeEvents(): void; + computeAvailability(): TimeInterval; + getById(id: any): Entity; + } + + class CompositeMaterialProperty extends MaterialProperty { + intervals: TimeIntervalCollection; + } + + class CompositePositionProperty { + isConstant: boolean; + definitionChanged: Event; + intervals: TimeIntervalCollection; + referenceFrame: ReferenceFrame; + getValue(time: JulianDate, result?: any): any; + getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3; + equals(other?: Property): boolean; + } + + class CompositeProperty extends Property { + intervals: TimeIntervalCollection; + } + + class ConstantPositionProperty { + isConstant: boolean; + definitionChanged: Event; + referenceFrame: ReferenceFrame; + constructor(value?: Cartesian3, referenceFrame?: ReferenceFrame); + getValue(time: JulianDate, result?: any): any; + setValue(value: Cartesian3, referenceFrame?: ReferenceFrame): void; + getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3; + equals(other?: Property): boolean; + } + + class ConstantProperty extends Property { + constructor(value?: any); + setValue(value: any): void; + } + + class CorridorGeometryUpdater extends GeometryUpdater { + constructor(entity: Entity, scene: Scene); + } + + class CorridorGraphics { + definitionChanged: Event; + show: Property; + material: MaterialProperty; + positions: Property; + height: Property; + extrudedHeight: Property; + granularity: Property; + width: Property; + fill: Property; + outline: Property; + outlineColor: Property; + outlineWidth: Property; + cornerType: Property; + constructor(options?: { + positions?: Property; + width?: Property; + cornerType?: Property; + height?: Property; + extrudedHeight?: Property; + show?: Property; + fill?: Property; + material?: MaterialProperty; + outline?: Property; + outlineColor?: Property; + outlineWidth?: Property; + granularity?: Property + }); + clone(result?: CorridorGraphics): CorridorGraphics; + merge(source: CorridorGraphics): CorridorGraphics; + } + + class CustomDataSource extends DataSource { + constructor(name?: string); + } + + class CylinderGeometryUpdater extends GeometryUpdater { + constructor(entity: Entity, scene: Scene); + } + + class CylinderGraphics { + definitionChanged: Event; + length: Property; + topRadius: Property; + bottomRadius: Property; + numberOfVerticalLines: Property; + slices: Property; + show: Property; + material: MaterialProperty; + fill: Property; + outline: Property; + outlineColor: Property; + outlineWidth: Property; + constructor(options?: { length?: Property; + topRadius?: Property; + bottomRadius?: Property; + show?: Property; + fill?: Property; + material?: MaterialProperty; + outline?: Property; + outlineColor?: Property; + outlineWidth?: Property; + numberOfVerticalLines?: Property; + slices?: Property + }); + clone(result?: CylinderGraphics): CylinderGraphics; + merge(source: CylinderGraphics): CylinderGraphics; + } + + class CzmlDataSource extends DataSource { + static updaters: any[]; + static load(czml: Resource | string | object, options?: { sourceUri?: string }): Promise; + static processMaterialPacketData(object: object, propertyName: string, packetData: object, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void; + static processPacketData(type: () => any, object: object, propertyName: string, packetData: object, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void; + static processPositionPacketData(object: object, propertyName: string, packetData: object, interval: TimeInterval, sourceUri: string, entityCollection: EntityCollection): void; + constructor(name?: string); + load(czml: Resource | string | object, options?: { sourceUri?: string }): Promise; + process(czml: Resource | string | object, options?: { sourceUri?: string }): Promise; + } + + abstract class DataSource { + changedEvent: Event; + clock: DataSourceClock; + clustering: EntityCluster; + entities: EntityCollection; + errorEvent: Event; + isLoading: boolean; + loadingEvent: Event; + name: string; + show: boolean; + update(time: JulianDate): boolean; + } + + class DataSourceClock { + definitionChanged: Event; + startTime: JulianDate; + stopTime: JulianDate; + currentTime: JulianDate; + clockRange: ClockRange; + clockStep: ClockStep; + multiplier: number; + clone(result?: DataSourceClock): DataSourceClock; + equals(other: DataSourceClock): boolean; + merge(source: DataSourceClock): DataSourceClock; + getValue(): Clock; + } + + class DataSourceCollection { + length: number; + dataSourceAdded: Event; + dataSourceRemoved: Event; + add(dataSource: DataSource | Promise): Promise; + remove(dataSource: DataSource, destroy?: boolean): boolean; + removeAll(destroy?: boolean): void; + contains(dataSource: DataSource): boolean; + indexOf(dataSource: DataSource): number; + get(index: number): DataSource; + isDestroyed(): boolean; + destroy(): void; + } + + class DataSourceDisplay { + scene: Scene; + dataSources: DataSourceCollection; + defaultDataSource: CustomDataSource; + static defaultVisualizersCallback: DataSourceDisplay.VisualizersCallback; + constructor(options: { scene: Scene; dataSourceCollection: DataSourceCollection; visualizersCallback?: DataSourceDisplay.VisualizersCallback }); + isDestroyed(): boolean; + destroy(): void; + update(time: JulianDate): boolean; + } + + namespace DataSourceDisplay { + type VisualizersCallback = (scene: Scene, dataSource: DataSource) => Visualizer[]; + } + + class DynamicGeometryUpdater { + update(time: JulianDate): void; + isDestroyed(): boolean; + destroy(): void; + } + + class EllipseGeometryUpdater extends GeometryUpdater { + readonly onTerrain: boolean; + constructor(entity: Entity, scene: Scene); + } + + class EllipseGraphics { + definitionChanged: Event; + semiMajorAxis: Property; + semiMinorAxis: Property; + rotation: Property; + show: Property; + material: MaterialProperty; + height: Property; + extrudedHeight: Property; + granularity: Property; + stRotation: Property; + fill: Property; + outline: Property; + outlineColor: Property; + outlineWidth: Property; + numberOfVerticalLines: Property; + constructor(options?: { + semiMajorAxis?: number; + semiMinorAxis?: number; + height?: Property; + extrudedHeight?: Property; + show?: Property; + fill?: Property; + material?: MaterialProperty; + outline?: Property; + outlineColor?: Property; + outlineWidth?: Property; + numberOfVerticalLines?: Property; + rotation?: Property; + stRotation?: Property; + granularity?: Property + }); + clone(result?: EllipseGraphics): EllipseGraphics; + merge(source: EllipseGraphics): EllipseGraphics; + } + + class EllipsoidGeometryUpdater extends GeometryUpdater { + constructor(entity: Entity, scene: Scene); + createFillGeometryInstance(time: JulianDate, skipModelMatrix?: boolean, modelMatrixResult?: Matrix4): GeometryInstance; + createOutlineGeometryInstance(time: JulianDate, skipModelMatrix?: boolean, modelMatrixResult?: Matrix4): GeometryInstance; + } + + class EllipsoidGraphics { + definitionChanged: Event; + show: Property; + radii: Property; + material: MaterialProperty; + fill: Property; + outline: Property; + outlineColor: Property; + outlineWidth: Property; + stackPartitions: Property; + slicePartitions: Property; + subdivisions: Property; + constructor(options?: { + radii?: Property; + show?: Property; + fill?: Property; + material?: MaterialProperty; + outline?: Property; + outlineColor?: Property; + outlineWidth?: Property; + subdivisions?: Property; + stackPartitions?: Property; + slicePartitions?: Property + }); + clone(result?: EllipsoidGraphics): EllipsoidGraphics; + merge(source: EllipsoidGraphics): EllipsoidGraphics; + } + + class Entity { + availability: TimeIntervalCollection; + billboard: BillboardGraphics; + box: BoxGraphics; + corridor: CorridorGraphics; + cylinder: CylinderGraphics; + readonly definitionChanged: Event; + description: Property; + ellipse: EllipseGraphics; + ellipsoid: EllipsoidGraphics; + entityCollection: EntityCollection; + id: string; + isShowing: boolean; + label: LabelGraphics; + model: ModelGraphics; + name: string; + orientation: Property; + parent: Entity; + path: PathGraphics; + plane: any; + point: PointGraphics; + polygon: PolygonGraphics; + polyline: PolylineGraphics; + polylineVolume: PolylineVolumeGraphics; + position: PositionProperty; + properties: any; + propertyNames: any[]; + rectangle: RectangleGraphics; + show: boolean; + viewFrom: Property; + wall: WallGraphics; + constructor(options?: { + id?: string; + name?: string; + availability?: TimeIntervalCollection; + show?: boolean; + description?: Property; + position?: PositionProperty; + orientation?: Property; + viewFrom?: Property; + parent?: Entity; + billboard?: BillboardGraphics; + box?: BoxGraphics; + corridor?: CorridorGraphics; + cylinder?: CylinderGraphics; + ellipse?: EllipseGraphics; + ellipsoid?: EllipsoidGraphics; + label?: LabelGraphics; + model?: ModelGraphics; + path?: PathGraphics; + plane?: any; + point?: PointGraphics; + polygon?: PolygonGraphics; + polyline?: PolylineGraphics; + polylineVolume?: PolylineVolumeGraphics; + rectangle?: RectangleGraphics; + wall?: WallGraphics + }); + addProperty(propertyName: string): void; + computeModelMatrix(time: JulianDate, result?: Matrix4): Matrix4; + isAvailable(time: JulianDate): boolean; + merge(source: Entity): Entity; + removeProperty(propertyName: string): void; + } + + class EntityCluster { + clusterBillboards: boolean; + clusterEvent: Event; + clusterLabels: boolean; + clusterPoints: boolean; + enabled: boolean; + minimumClusterSize: number; + pixelRange: number; + constructor(options?: { enabled?: boolean; pixelRange?: number; minimumClusterSize?: number; clusterBillboards?: boolean; clusterLabels?: boolean; clusterPoints?: boolean }); + destroy(): void; + // newClusterCallback(clusteredEntities, cluster) + } + + class EntityCollection { + readonly collectionChanged: Event; + readonly id: string; + readonly owner: DataSource | CompositeEntityCollection; + show: boolean; + readonly values: Entity[]; + static collectionChangedEventCallback(collection: EntityCollection, added: Entity[], removed: Entity[], changed: Entity[]): void; + constructor(owner: DataSource | CompositeEntityCollection); + add(entity: Entity): Entity; + computeAvailability(): TimeInterval; + contains(entity: Entity): boolean; + getById(id: string): Entity; + getOrCreateEntity(id: string): Entity; + remove(entity: Entity): boolean; + removeAll(): void; + removeById(id: string): boolean; + resumeEvents(): void; + suspendEvents(): void; + } + + class EntityView { + entity: Entity; + scene: Scene; + ellipsoid: Ellipsoid; + boundingSphere: Entity; + static defaultOffset3D: Cartesian3; + constructor(entity: Entity, scene: Scene, ellipsoid?: Ellipsoid, boundingSphere?: BoundingSphere); + update(time: JulianDate): void; + } + + class GeoJsonDataSource extends DataSource { + static clampToGround: boolean; + static crsLinkHrefs: any; + static crsLinkTypes: any; + static crsNames: any; + static fill: Color; + static markerColor: Color; + static markerSize: number; + static markerSymbol: string; + static stroke: Color; + static strokeWidth: number; + static load(data: Resource | string | object, options?: { + sourceUri?: string; + markerSize?: number; + markerSymbol?: string; + markerColor?: Color; + stroke?: Color; + strokeWidth?: number; + fill?: Color; + clampToGround?: boolean + }): Promise; + constructor(name?: string); + load(data: Resource | string | object, options?: { + sourceUri?: string; + markerSize?: number; + markerSymbol?: string; + markerColor?: Color; + stroke?: Color; + strokeWidth?: number; + fill?: Color; + clampToGround?: boolean + }): Promise; + } + + class GeometryUpdater { + readonly classificationTypeProperty: Property; + readonly readonlydistanceDisplayConditionProperty: Property; + readonly entity: Entity; + readonly fillEnabled: boolean; + readonly fillMaterialProperty: MaterialProperty; + readonly geometryChanged: boolean; + readonly hasConstantFill: boolean; + readonly hasConstantOutline: boolean; + readonly id: string; + readonly isClosed: boolean; + readonly isDynamic: boolean; + readonly outlineColorProperty: Property; + readonly outlineEnabled: boolean; + readonly outlineWidth: number; + readonly shadowsProperty: Property; + constructor(options: { entity: Entity; scene: Scene; geometryOptions: any; geometryPropertyName: string; observedPropertyNames: string[] }); + createDynamicUpdater(primitives: PrimitiveCollection, groundPrimitives: PrimitiveCollection): DynamicGeometryUpdater; + destroy(): void; + isDestroyed(): boolean; + isFilled(time: JulianDate): boolean; + isOutlineVisible(time: JulianDate): boolean; + createFillGeometryInstance(time: JulianDate): GeometryInstance; + createOutlineGeometryInstance(time: JulianDate): GeometryInstance; + } + + class GeometryVisualizer extends Visualizer { + constructor(scene: Scene, entityCollection: EntityCollection, primitives?: PrimitiveCollection, groundPrimitives?: PrimitiveCollection); + } + + class GridMaterialProperty extends MaterialProperty { + color: Color; + cellAlpha: Property; + lineCount: Property; + lineThickness: Property; + lineOffset: Property; + constructor(options?: { color?: Property; cellAlpha?: Property; lineCount?: Property; lineThickness?: Property; lineOffset?: Property }); + } + + class ImageMaterialProperty extends MaterialProperty { + image: Property; + repeat: Property; + constructor(options?: { image?: Property; repeat?: Property }); + } + + class KmlDataSource extends DataSource { + refreshEvent: Event; + unsupportedNodeEvent: Event; + constructor(options?: {camera?: Camera, canvas?: HTMLCanvasElement; ellipsoid?: Ellipsoid}); + static load(data: Resource | string | Document | Blob, + options?: { camera: Camera, canvas: HTMLCanvasElement; sourceUri?: string, clampToGround?: boolean; ellipsoid?: Ellipsoid }): Promise; + load(data: Resource | string | Document | Blob, options?: { sourceUri?: string, clampToGround?: boolean, ellipsoid?: Ellipsoid }): Promise; + } + + class KmlFeatureData { + author: { name: string; uri: string; email: string }; + link: { href: string; hreflang: string; rel: string; type: string; title: string; length: string }; + address: string; + phoneNumber: string; + snippet: string; + extendedData: string; + } + + class LabelGraphics { + definitionChanged: Event; + text: Property; + font: Property; + style: Property; + fillColor: Property; + outlineColor: Property; + outlineWidth: Property; + horizontalOrigin: Property; + verticalOrigin: Property; + eyeOffset: Property; + pixelOffset: Property; + scale: Property; + show: Property; + translucencyByDistance: Property; + pixelOffsetScaleByDistance: Property; + constructor(options?: { + text?: Property; + font?: Property; + style?: Property; + fillColor?: Property; + outlineColor?: Property; + outlineWidth?: Property; + show?: Property; + scale?: Property; + horizontalOrigin?: Property; + verticalOrigin?: Property; + eyeOffset?: Property; + pixelOffset?: Property; + translucencyByDistance?: Property; + pixelOffsetScaleByDistance?: Property + }); + clone(result?: LabelGraphics): LabelGraphics; + merge(source: LabelGraphics): LabelGraphics; + } + + class LabelVisualizer extends Visualizer { + constructor(entityCluster: EntityCluster, entityCollection: EntityCollection); + } + + class MaterialProperty extends Property { + getType(time: JulianDate): string; + } + + class ModelGraphics { + clampAnimations: Property | boolean; + clippingPlanes: Property; + color: Property; + colorBlendAmount: Property | number; + colorBlendMode: Property; + readonly definitionChanged: Event; + distanceDisplayCondition: Property; + heightReference: Property; + incrementallyLoadTextures: Property | boolean; + maximumScale: Property | number; + minimumScale: Property | number; + minimumPixelSize: Property | number; + nodeTransformations: any; // PropertyBag + runAnimations: Property | boolean; + scale: Property | number; + shadows: Property; + show: Property | boolean; + silhouetteColor: Property; + silhouetteSize: Property | number; + uri: Property | string; + constructor(options?: { + uri?: Property | string; + show?: Property | boolean; + scale?: Property | number; + minimumPixelSize?: Property | number; + maximumScale?: Property | number; + incrementallyLoadTextures?: Property | boolean; + runAnimations?: Property | boolean; + clampAnimations?: Property | boolean; + nodeTransformations?: Property; + shadows?: Property; + heightReference?: Property; + distanceDisplayCondition?: Property; + silhouetteColor?: Property; + silhouetteSize?: Property | number; + color?: Property; + colorBlendMode?: Property; + colorBlendAmount?: Property | number; + clippingPlanes?: Property; + }); + clone(result?: ModelGraphics): ModelGraphics; + merge(source: ModelGraphics): ModelGraphics; + } + + class ModelVisualizer extends Visualizer { + constructor(scene: Scene, entityCollection: EntityCollection); + } + + class PathGraphics { + readonly definitionChanged: Event; + distanceDisplayCondition: Property; + leadTime: Property | number; + material: MaterialProperty; + resolution: Property | number; + trailTime: Property | number; + show: Property | boolean; + width: Property | number; + constructor(options?: { + leadTime?: Property | number; + trailTime?: Property | number; + show?: Property | boolean; + width?: Property | number; + material?: MaterialProperty; + resolution?: Property | number; + distanceDisplayCondition?: Property; + }); + clone(result?: PathGraphics): PathGraphics; + merge(source: PathGraphics): PathGraphics; + } + + class PathVisualizer extends Visualizer { + constructor(scene: Scene, entityCollection: EntityCollection); + } + + class PointGraphics { + color: Property; + readonly definitionChanged: Event; + disableDepthTestDistance: Property; + distanceDisplayCondition: Property; + heightReference: Property; + outlineColor: Property; + outlineWidth: Property; + pixelSize: Property; + scaleByDistance: Property; + show: Property; + translucencyByDistance: Property; + constructor(options?: { + color?: Color; + pixelSize?: number; + outlineColor?: Color; + outlineWidth?: number; + show?: boolean; + scaleByDistance?: Property; + translucencyByDistance?: Property; + heightReference?: HeightReference; + distanceDisplayCondition?: Property; + disableDepthTestDistance?: Property + }); + clone(result?: PointGraphics): PointGraphics; + merge(source: PointGraphics): PointGraphics; + } + + class PointVisualizer extends Visualizer { + constructor(entityCluster: EntityCluster, entityCollection: EntityCollection); + } + + class PolygonGeometryUpdater extends GeometryUpdater { + constructor(entity: Entity, scene: Scene); + } + + class PolygonGraphics { + definitionChanged: Event; + show: Property; + material: MaterialProperty; + positions: Property; + hierarchy: Property; + height: Property; + extrudedHeight: Property; + granularity: Property; + stRotation: Property; + fill: Property; + outline: Property; + outlineColor: Property; + outlineWidth: Property; + perPositionHeight: Property; + constructor(options?: { + hierarchy?: Property; + height?: number; + extrudedHeight?: Property; + show?: Property; + fill?: Property; + material?: MaterialProperty; + outline?: boolean; + outlineColor?: Property; + outlineWidth?: number; + stRotation?: Property; + granularity?: Property; + perPositionHeight?: Property + }); + clone(result?: PolygonGraphics): PolygonGraphics; + merge(source: PolygonGraphics): PolygonGraphics; + } + + class PolylineArrowMaterialProperty extends MaterialProperty { + color: Property; + constructor(color?: Property); + } + + class PolylineGeometryUpdater extends GeometryUpdater { + readonly depthFailMaterialProperty: MaterialProperty; + readonly distanceDisplayConditionProperty: Property; + constructor(entity: Entity, scene: Scene); + } + + class PolylineGlowMaterialProperty extends MaterialProperty { + color: Color; + glowPower: Property; + constructor(options?: { color?: Property; glowPower?: Property }); + } + + class PolylineGraphics { + definitionChanged: Event; + show: Property; + material: MaterialProperty; + positions: Property; + width: number; + followSurface: Property; + granularity: Property; + constructor(options?: { positions?: Cartesian3[]; followSurface?: Property; width?: number; show?: Property; material?: MaterialProperty; granularity?: Property }); + clone(result?: PolylineGraphics): PolylineGraphics; + merge(source: PolylineGraphics): PolylineGraphics; + } + + class PolylineOutlineMaterialProperty extends MaterialProperty { + color: Color; + outlineColor: Color; + outlineWidth: Property; + constructor(options?: { color?: Property; outlineColor?: Property; outlineWidth?: Property }); + } + + class PolylineVolumeGeometryUpdater extends GeometryUpdater { + constructor(entity: Entity, scene: Scene); + } + + class PolylineVolumeGraphics { + definitionChanged: Event; + show: Property; + material: MaterialProperty; + positions: Property; + shape: Property; + granularity: Property; + fill: Property; + outline: Property; + outlineColor: Property; + outlineWidth: Property; + cornerType: Property; + constructor(options?: { + positions?: Property; + shape?: Property; + cornerType?: Property; + show?: Property; + fill?: Property; + material?: MaterialProperty; + outline?: Property; + outlineColor?: Property; + outlineWidth?: Property; + granularity?: Property + }); + clone(result?: PolylineVolumeGraphics): PolylineVolumeGraphics; + merge(source: PolylineVolumeGraphics): PolylineVolumeGraphics; + } + + abstract class PositionProperty extends Property { + referenceFrame: ReferenceFrame; + getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3; + } + + class PositionPropertyArray extends PositionProperty { + constructor(value?: Property[]); + getValue(time?: JulianDate, result?: Cartesian3[]): Cartesian3[]; + setValue(value: Property[]): void; + } + + abstract class Property { + readonly isConstant: boolean; + readonly definitionChanged: Event; + getValue(time: JulianDate, result?: any): any; + equals(other?: Property): boolean; + } + + class PropertyArray extends Property { + constructor(value?: Property[]); + getValue(time?: JulianDate, result?: any[]): any[]; + setValue(value: Property[]): void; + } + + class RectangleGeometryUpdater extends GeometryUpdater { + constructor(entity: Entity, scene: Scene); + } + + class RectangleGraphics { + definitionChanged: Event; + show: Property; + coordinates: Property; + material: MaterialProperty; + height: Property; + extrudedHeight: Property; + granularity: Property; + stRotation: Property; + rotation: Property; + fill: Property; + outline: Property; + outlineColor: Property; + outlineWidth: Property; + closeTop: Property; + closeBottom: Property; + constructor(options?: { + coordinates?: Property; + height?: Property; + extrudedHeight?: Property; + closeTop?: Property; + closeBottom?: Property; + show?: Property; + fill?: Property; + material?: MaterialProperty; + outline?: Property; + outlineColor?: Property; + outlineWidth?: Property; + rotation?: Property; + stRotation?: Property; + granularity?: Property + }); + clone(result?: RectangleGraphics): RectangleGraphics; + merge(source: RectangleGraphics): RectangleGraphics; + } + + class ReferenceProperty extends Property { + readonly referenceFrame: ReferenceFrame; + readonly targetId: string; + readonly targetCollection: EntityCollection; + readonly targetPropertyNames: string[]; + readonly resolvedProperty: Property; + constructor(targetCollection: EntityCollection, targetId: string, targetPropertyNames: string); + getValueInReferenceFrame(time: JulianDate, referenceFrame: ReferenceFrame, result?: Cartesian3): Cartesian3; + getType(time: JulianDate): string; + static fromString(targetCollection: Entity, referenceString: string): ReferenceProperty; + } + + class SampledPositionProperty extends SampledProperty { + numberOfDerivatives: boolean; + constructor(referenceFrame?: ReferenceFrame, numberOfDerivatives?: number); + addSample(time: JulianDate, position: Cartesian3, derivatives?: Cartesian3[]): void; + addSamples(times: JulianDate[], positions: Cartesian3[], derivatives?: any[][]): void; + addSamplesPackedArray(packedSamples: number[], epoch?: JulianDate): void; + } + + class SampledProperty extends PositionProperty { + type: any; + derivativeTypes: Packable[]; + interpolationDegree: number; + interpolationAlgorithm: InterpolationAlgorithm; + forwardExtrapolationType: ExtrapolationType; + forwardExtrapolationDuration: number; + backwardExtrapolationType: ExtrapolationType; + backwardExtrapolationDuration: number; + constructor(type: number | Packable, derivativeTypes?: Packable[]); + setInterpolationOptions(options?: { interpolationAlgorithm?: InterpolationAlgorithm; interpolationDegree?: number }): void; + addSample(time: JulianDate, value: Packable, derivatives?: Packable[]): void; + addSamples(times: JulianDate[], values: Packable[], derivativeValues?: any[][]): void; + addSamplesPackedArray(packedSamples: number[], epoch?: JulianDate): void; + } + + class StripeMaterialProperty extends MaterialProperty { + orientation: Property; + evenColor: Color; + oddColor: Color; + offset: Property; + repeat: number; + constructor(options?: { evenColor?: Property; oddColor?: Property; repeat?: Property; offset?: Property; orientation?: Property }); + } + + class TimeIntervalCollectionPositionProperty extends PositionProperty { + intervals: TimeIntervalCollection; + constructor(referenceFrame?: ReferenceFrame); + } + + class TimeIntervalCollectionProperty extends Property { + intervals: TimeIntervalCollection; + } + + class VelocityOrientationProperty extends Property { + position: Property; + ellipsoid: Property; + constructor(position?: Property, ellipsoid?: Ellipsoid); + getValue(time?: JulianDate, result?: Quaternion): Quaternion; + } + + abstract class Visualizer { + update(time: JulianDate): boolean; + isDestroyed(): boolean; + destroy(): void; + } + + class WallGeometryUpdater extends GeometryUpdater { + constructor(entity: Entity, scene: Scene); + } + + class WallGraphics { + readonly definitionChanged: Event; + show: Property; + material: MaterialProperty; + positions: Property; + minimumHeights: Property; + maximumHeights: Property; + granularity: Property; + fill: Property; + outline: Property; + outlineColor: Property; + outlineWidth: Property; + constructor(options?: { + positions?: Property; + maximumHeights?: Property; + minimumHeights?: Property; + show?: Property; + fill?: Property; + material?: MaterialProperty; + outline?: Property; + outlineColor?: Property; + outlineWidth?: Property; + granularity?: Property + }); + clone(result?: WallGraphics): WallGraphics; + merge(source: WallGraphics): WallGraphics; + } + + class Appearance { + readonly closed: boolean; + readonly fragmentShaderSource: string; + material: Material; + readonly renderState: any; + translucent: boolean; + readonly vertexShaderSource: string; + constructor(options?: { translucent?: boolean; closed?: boolean; material?: Material; vertexShaderSource?: string; fragmentShaderSource?: string; renderState?: RenderState }); + getFragmentShaderSource(): string; + isTranslucent(): boolean; + getRenderState(): any; + } + + class ArcGisMapServerImageryProvider extends ImageryProvider { + url: string; + usingPrecachedTiles: boolean; + constructor(options: { + url: string; + tileDiscardPolicy?: TileDiscardPolicy; + proxy?: Proxy; + usePreCachedTilesIfAvailable?: boolean; + enablePickFeatures?: boolean; + rectangle?: Rectangle; + tilingScheme?: TilingScheme; + ellipsoid?: Ellipsoid; + tileWidth?: number; + tileHeight?: number; + maximumLevel?: number + }, layers?: string); + } + + class DistanceDisplayCondition extends Packable { + far: number; + near: number; + constructor(near: number, far: number); + static clone(value?: DistanceDisplayCondition, result?: DistanceDisplayCondition): DistanceDisplayCondition; + static equals(left: DistanceDisplayCondition, right: DistanceDisplayCondition): boolean; + static pack(value: DistanceDisplayCondition, array: number[], startingIndex: number): number[]; + static unpack(array: number[], startingIndex: number, result: DistanceDisplayCondition): DistanceDisplayCondition; + clone(result: DistanceDisplayCondition): DistanceDisplayCondition; + equals(other: DistanceDisplayCondition): boolean; + } + + class Billboard { + alignedAxis: Cartesian3; + color: Color; + disableDepthTestDistance: number; + distanceDisplayCondition: DistanceDisplayCondition; + eyeOffset: Cartesian3; + height: number; + heightReference: HeightReference; + horizontalOrigin: HorizontalOrigin; + id: any; + image: string; + pixelOffset: Cartesian2; + pixelOffsetScaleByDistance: NearFarScalar; + position: Cartesian3; + readonly ready: boolean; + rotation: number; + scale: number; + scaleByDistance: NearFarScalar; + show: boolean; + sizeInMeters: boolean; + translucencyByDistance: NearFarScalar; + verticalOrigin: VerticalOrigin; + width: number; + computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2; + equals(other: Billboard): boolean; + setImage(id: string, image: HTMLImageElement | HTMLCanvasElement | string | Billboard.CreateImageCallback): void; + setImageSubRegion(id: string, subRegion: BoundingRectangle): void; + } + + namespace Billboard { + type CreateImageCallback = (id: string) => HTMLImageElement | HTMLCanvasElement | Promise; + } + + class BillboardCollection { + blendOption: BlendOption; + debugShowBoundingVolume: boolean; + length: number; + modelMatrix: Matrix4; + constructor(options?: { modelMatrix?: Matrix4; debugShowBoundingVolume?: boolean; scene?: Scene; blendOption?: BlendOption }); + add(billboard?: any): Billboard; + contains(billboard?: Billboard): boolean; + destroy(): void; + get(index: number): Billboard; + isDestroyed(): boolean; + remove(billboard: Billboard): boolean; + removeAll(): void; + update(): void; + } + + class BingMapsImageryProvider extends ImageryProvider { + readonly url: string; + readonly key: string; + readonly mapStyle: BingMapsStyle; + readonly culture: string; + constructor(options: { url: string; key?: string; tileProtocol?: string; mapStyle?: string; culture?: string; ellipsoid?: Ellipsoid; tileDiscardPolicy?: TileDiscardPolicy; proxy?: Proxy }); + static tileXYToQuadKey(x: number, y: number, level: number): string; + static quadKeyToTileXY(quadkey: string): {x: number, y: number, level: number}; + } + + // tslint:disable-next-line no-unnecessary-class + class EasingFunction { + static BACK_IN: EasingFunction.Callback; + static BACK_IN_OUT: EasingFunction.Callback; + static BACK_OUT: EasingFunction.Callback; + static BOUNCE_IN: EasingFunction.Callback; + static BOUNCE_IN_OUT: EasingFunction.Callback; + static BOUNCE_OUT: EasingFunction.Callback; + static CIRCULAR_IN: EasingFunction.Callback; + static CIRCULAR_IN_OUT: EasingFunction.Callback; + static CIRCULAR_OUT: EasingFunction.Callback; + static CUBIC_IN: EasingFunction.Callback; + static CUBIC_IN_OUT: EasingFunction.Callback; + static CUBIR_OUT: EasingFunction.Callback; + static ELASTIC_IN: EasingFunction.Callback; + static ELASTIC_IN_OUT: EasingFunction.Callback; + static ELASTIC_OUT: EasingFunction.Callback; + static EXPONENTIAL_IN: EasingFunction.Callback; + static EXPONENTIAL_IN_OUT: EasingFunction.Callback; + static EXPONENTIAL_OUT: EasingFunction.Callback; + static LINEAR_NONE: EasingFunction.Callback; + static QUADRATIC_IN: EasingFunction.Callback; + static QUADRATIC_IN_OUT: EasingFunction.Callback; + static QUADRATIC_OUT: EasingFunction.Callback; + static QUARTIC_IN: EasingFunction.Callback; + static QUARTIC_IN_OUT: EasingFunction.Callback; + static QUARTIC_OUT: EasingFunction.Callback; + static QUINTIC_IN: EasingFunction.Callback; + static QUINTIC_IN_OUT: EasingFunction.Callback; + static QUINTIC_OUT: EasingFunction.Callback; + static SINUSOIDAL_IN: EasingFunction.Callback; + static SINUSOIDAL_IN_OUT: EasingFunction.Callback; + static SINUSOIDAL_OUT: EasingFunction.Callback; + } + + namespace EasingFunction { + type Callback = (time: number) => number; + } + + class Camera { + position: Cartesian3; + direction: Cartesian3; + up: Cartesian3; + right: Cartesian3; + frustum: Frustum; + defaultMoveAmount: number; + defaultLookAmount: number; + defaultRotateAmount: number; + defaultZoomAmount: number; + constrainedAxis: Cartesian3; + maximumTranslateFactor: number; + maximumZoomFactor: number; + readonly transform: Matrix4; + readonly inverseTransform: Matrix4; + readonly viewMatrix: Matrix4; + readonly inverseViewMatrix: Matrix4; + readonly positionCartographic: Cartographic; + readonly positionWC: Cartesian3; + percentageChanged: number; + readonly directionWC: Cartesian3; + readonly upWC: Cartesian3; + readonly rightWC: Cartesian3; + readonly heading: number; + readonly pitch: number; + readonly roll: number; + readonly moveStart: Event; + readonly moveEnd: Event; + static DEFAULT_OFFSET: HeadingPitchRange; + static DEFAULT_VIEW_RECTANGLE: Rectangle; + static DEFAULT_VIEW_FACTOR: number; + readonly changed: Event; + constructor(scene: Scene); + cameraToWorldCoordinates(cartesian: Cartesian4, result?: Cartesian4): Cartesian4; + cameraToWorldCoordinatesPoint(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + cameraToWorldCoordinatesVector(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + cancelFlight(): void; + computeViewRectangle(ellipsoid?: Ellipsoid, result?: Rectangle): Rectangle | undefined; + distanceToBoundingSphere(boundingSphere: BoundingSphere): number; + flyHome(duration: number): void; + flyTo(options: { + destination: Cartesian3 | Rectangle; + orientation?: any; + duration?: number; + complete?: Camera.FlightCompleteCallback; + cancel?: Camera.FlightCancelledCallback; + endTransform?: Matrix4; + maximumHeight?: number; + pitchAdjustHeight?: number; + flyOverLongitude?: number; + flyOverLongitudeWeight?: number; + easingFunction?: EasingFunction + }): void; + flyToBoundingSphere(boundingSphere: BoundingSphere, options?: { + duration?: number; + offset?: HeadingPitchRange; + complete?: Camera.FlightCompleteCallback; + cancel?: Camera.FlightCancelledCallback; + endTransform?: Matrix4; + maximumHeight?: number; + pitchAdjustHeight?: number; + flyOverLongitude?: number; + flyOverLongitudeWeight?: number; + easingFunction?: EasingFunction + }): void; + getMagnitude(): number; + getPickRay(windowPosition: Cartesian2, result?: Ray): Ray; + getPixelSize(boundingSphere: BoundingSphere, drawingBufferWidth: number, drawingBufferHeight: number): number; + getRectangleCameraCoordinates(rectangle: Rectangle, result?: Cartesian3): Cartesian3; + look(axis: Cartesian3, angle?: number): void; + lookAt(target: Cartesian3, offset: Cartesian3 | HeadingPitchRange): void; + lookAtTransform(transform: Matrix4, offset: Cartesian3 | HeadingPitchRange): void; + lookDown(amount?: number): void; + lookLeft(amount?: number): void; + lookRight(amount?: number): void; + lookUp(amount?: number): void; + move(direction: Cartesian3, amount?: number): void; + moveBackward(amount?: number): void; + moveDown(amount?: number): void; + moveForward(amount?: number): void; + moveLeft(amount?: number): void; + moveRight(amount?: number): void; + moveUp(amount?: number): void; + pickEllipsoid(windowPosition: Cartesian2, ellipsoid?: Ellipsoid, result?: Cartesian3): Cartesian3; + rotate(axis: Cartesian3, angle?: number): void; + rotateDown(angle?: number): void; + rotateLeft(angle?: number): void; + rotateRight(angle?: number): void; + rotateUp(angle?: number): void; + setView(options: {destination?: Cartesian3 | Rectangle; orientation?: any; endTransform?: Matrix4}): void; + switchToOrthographicFrustum(): void; + switchToPerspectiveFrustum(): void; + twistLeft(amount?: number): void; + twistRight(amount?: number): void; + viewBoundingSphere(boundingSphere: BoundingSphere, offset?: HeadingPitchRange): void; + worldToCameraCoordinates(cartesian: Cartesian4, result?: Cartesian4): Cartesian4; + worldToCameraCoordinatesPoint(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + worldToCameraCoordinatesVector(cartesian: Cartesian3, result?: Cartesian3): Cartesian3; + zoomIn(amount?: number): void; + zoomOut(amount?: number): void; + } + + namespace Camera { + type FlightCancelledCallback = () => void; + type FlightCompleteCallback = () => void; + } + + class CameraEventAggregator { + currentMousePosition: Cartesian2; + anyButtonDown: boolean; + constructor(element?: HTMLCanvasElement); + isMoving(type: CameraEventType, modifier?: KeyboardEventModifier): boolean; + getMovement(type: CameraEventType, modifier?: KeyboardEventModifier): any; + getLastMovement(type: CameraEventType, modifier?: KeyboardEventModifier): any; + isButtonDown(type: CameraEventType, modifier?: KeyboardEventModifier): boolean; + getStartMousePosition(type: CameraEventType, modifier?: KeyboardEventModifier): Cartesian2; + getButtonPressTime(type: CameraEventType, modifier?: KeyboardEventModifier): Date; + getButtonReleaseTime(type: CameraEventType, modifier?: KeyboardEventModifier): Date; + reset(): void; + isDestroyed(): boolean; + destroy(): void; + } + + class CreditDisplay { + static cesiumCredit: Credit; + container: HTMLElement; + constructor(container: HTMLElement, delimiter?: string, viewport?: HTMLElement); + addCredit(credit: Credit): void; + addDefaultCredit(credit: Credit): void; + beginFrame(credit: Credit): void; + destroy(): void; + endFrame(credit: Credit): void; + isDestroyed(): boolean; + removeDefaultCredit(credit: Credit): void; + update(): void; + } + + class CullingVolume { + planes: Cartesian4[]; + constructor(planes: Cartesian4[]); + computeVisibility(boundingVolume: any): Intersect; + } + + class DebugAppearance extends Appearance { + readonly attributeName: string; + readonly glslDatatype: string; + constructor(options: { attributeName: string; glslDatatype?: string; vertexShaderSource?: string; fragmentShaderSource?: string; renderState?: RenderState }); + } + + class DebugModelMatrixPrimitive { + length: number; + width: number; + show: boolean; + modelMatrix: Matrix4; + id: any; + constructor(options?: { length?: number; width?: number; modelMatrix?: Matrix4; show?: boolean; id?: any }); + isDestroyed(): boolean; + destroy(): void; + } + + class DiscardMissingTileImagePolicy { + constructor(options: { missingImageUrl: Resource | string; pixelsToCheck: Cartesian2[]; disableCheckIfAllPixelsAreTransparent?: boolean }); + isReady(): boolean; + shouldDiscardImage(image: HTMLImageElement): boolean; + } + + class EllipsoidPrimitive { + center: Cartesian3; + radii: Cartesian3; + modelMatrix: Matrix4; + show: boolean; + material: Material; + id: any; + debugShowBoundingVolume: boolean; + constructor(options?: { center?: Cartesian3; radii?: Cartesian3; modelMatrix?: Matrix4; show?: boolean; material?: Material; id?: any; debugShowBoundingVolume?: boolean }); + update(): void; + isDestroyed(): boolean; + destroy(): void; + } + + class EllipsoidSurfaceAppearance extends Appearance { + readonly vertexFormat: VertexFormat; + readonly flat: boolean; + readonly faceForward: boolean; + readonly aboveGround: boolean; + static VERTEX_FORMAT: VertexFormat; + constructor(options?: { + flat?: boolean; + faceForward?: boolean; + translucent?: boolean; + aboveGround?: boolean; + material?: Material; + vertexShaderSource?: string; + fragmentShaderSource?: string; + renderState?: RenderState + }); + } + + class FrameRateMonitor { + samplingWindow: number; + quietPeriod: number; + warmupPeriod: number; + minimumFrameRateDuringWarmup: number; + minimumFrameRateAfterWarmup: number; + scene: Scene; + lowFrameRate: Event; + nominalFrameRate: Event; + lastFramesPerSecond: number; + static defaultSettings: any; + constructor(options?: { + scene: Scene; + samplingWindow?: number; + quietPeriod?: number; + warmupPeriod?: number; + minimumFrameRateDuringWarmup?: number; + minimumFrameRateAfterWarmup?: number + }); + pause(): void; + unpause(): void; + isDestroyed(): boolean; + destroy(): void; + static fromScene(scene: Scene): FrameRateMonitor; + } + + // tslint:disable-next-line no-unnecessary-class + class GetFeatureInfoFormat { + constructor(type: string, format?: string, callback?: (res: any) => any); + } + + class Globe { + terrainProvider: TerrainProvider; + northPoleColor: Cartesian3; + southPoleColor: Cartesian3; + show: boolean; + oceanNormalMapUrl: string; + depthTestAgainstTerrain: boolean; + maximumScreenSpaceError: number; + tileCacheSize: number; + enableLighting: boolean; + lightingFadeOutDistance: number; + lightingFadeInDistance: number; + showWaterEffect: boolean; + ellipsoid: Ellipsoid; + imageryLayers: ImageryLayerCollection; + baseColor: Color; + constructor(ellipsoid?: Ellipsoid); + pick(ray: Ray, scene: Scene, result?: Cartesian3): Cartesian3; + getHeight(cartographic: Cartographic): number; + isDestroyed(): boolean; + destroy(): void; + } + + class GoogleEarthEnterpriseImageryProvider extends ImageryProvider { + url: string; + path: string; + channel: number; + version: number; + requestType: string; + constructor(options: { + url: string; + channel: number; + path?: string; + maximumLevel?: number; + tileDiscardPolicy?: TileDiscardPolicy; + ellipsoid?: Ellipsoid; + proxy?: Proxy + }); + } + + class GridImageryProvider extends ImageryProvider { + constructor(options?: { + tilingScheme?: TilingScheme; + ellipsoid?: Ellipsoid; + cells?: number; + color?: Color; + glowColor?: Color; + glowWidth?: number; + tileWidth?: number; + tileHeight?: number; + canvasSize?: number + }, backgroundColor?: Color); + } + + class HeadingPitchRange { + heading: number; + pitch: number; + range: number; + constructor(heading?: number, pitch?: number, range?: number); + static clone(hpr: HeadingPitchRange, result?: HeadingPitchRange): HeadingPitchRange; + } + + class ImageryLayer { + alpha: number; + brightness: number; + contrast: number; + hue: number; + saturation: number; + gamma: number; + show: boolean; + imageryProvider: ImageryProvider; + rectangle: Rectangle; + static DEFAULT_BRIGHTNESS: number; + static DEFAULT_CONTRAST: number; + static DEFAULT_HUE: number; + static DEFAULT_SATURATION: number; + static DEFAULT_GAMMA: number; + constructor(imageryProvider: ImageryProvider, options?: { + rectangle?: Rectangle; + alpha?: number | ImageryLayer.ValueFunc; + brightness?: number | ImageryLayer.ValueFunc; + contrast?: number | ImageryLayer.ValueFunc; + hue?: number | ImageryLayer.ValueFunc; + saturation?: number | ImageryLayer.ValueFunc; + gamma?: number | ImageryLayer.ValueFunc; + show?: boolean; + maximumAnisotropy?: number; + minimumTerrainLevel?: number; + maximumTerrainLevel?: number + }); + isBaseLayer(): boolean; + isDestroyed(): boolean; + destroy(): void; + } + + namespace ImageryLayer { + type ValueFunc = (frameState: any, layer: ImageryLayer, x: number, y: number, level: number) => number; + } + + class ImageryLayerCollection { + layerAdded: Event; + layerRemoved: Event; + layerMoved: Event; + layerShownOrHidden: Event; + length: number; + add(layer: ImageryLayer, index?: number): void; + addImageryProvider(imageryProvider: ImageryProvider, index?: number): ImageryLayer; + remove(layer: ImageryLayer, destroy?: boolean): boolean; + removeAll(destroy?: boolean): void; + contains(layer: ImageryLayer): boolean; + indexOf(layer: ImageryLayer): number; + get(index: number): ImageryLayer; + raise(layer: ImageryLayer): void; + lower(layer: ImageryLayer): void; + raiseToTop(layer: ImageryLayer): void; + lowerToBottom(layer: ImageryLayer): void; + pickImageryLayerFeatures(ray: Ray, scene: Scene): Promise | undefined; + isDestroyed(): boolean; + destroy(): void; + } + + class ImageryLayerFeatureInfo { + name: string; + description: string; + position: Cartographic; + data: any; + configureNameFromProperties(properties: any): void; + configureDescriptionFromProperties(properties: any): void; + } + + abstract class ImageryProvider { + credit: Credit; + defaultAlpha: number; + defaultBrightness: number; + defaultContrast: number; + defaultGamma: number; + defaultHue: number; + defaultSaturation: number; + defaultMagnificationFilter: any; + defaultMinificationFilter: any; + readonly errorEvent: Event; + readonly hasAlphaChannel: boolean; + readonly maximumLevel: number; + readonly minimumLevel: number; + readonly proxy: Proxy; + readonly ready: boolean; + readonly readyPromise: Promise; + readonly rectangle: Rectangle; + readonly tileDiscardPolicy: TileDiscardPolicy; + readonly tileWidth: number; + readonly tileHeight: number; + readonly tilingScheme: TilingScheme; + getTileCredits(x: number, y: number, level: number): Credit[]; + requestImage(x: number, y: number, level: number): Promise; + pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise; + static loadImage(url: string): Promise; + } + + class Label { + show: boolean; + position: Cartesian3; + text: string; + font: string; + fillColor: Color; + outlineColor: Color; + outlineWidth: number; + style: LabelStyle; + pixelOffset: Cartesian2; + translucencyByDistance: NearFarScalar; + pixelOffsetScaleByDistance: NearFarScalar; + eyeOffset: Cartesian3; + horizontalOrigin: HorizontalOrigin; + verticalOrigin: VerticalOrigin; + scale: number; + id: any; + computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2; + equals(other: Label): boolean; + isDestroyed(): boolean; + } + + class LabelCollection { + modelMatrix: Matrix4; + debugShowBoundingVolume: boolean; + length: number; + constructor(options?: { modelMatrix?: Matrix4; debugShowBoundingVolume?: boolean }); + add(options?: any): Label; + remove(label: Label): boolean; + removeAll(): void; + contains(label: Label): boolean; + get(index: number): Label; + isDestroyed(): boolean; + destroy(): void; + } + + class Material { + type: string; + shaderSource: string; + materials: any; + uniforms: any; + translucent: boolean; + static DefaultImageId: string; + static DefaultCubeMapId: string; + static ColorType: string; + static ImageType: string; + static DiffuseMapType: string; + static AlphaMapType: string; + static SpecularMapType: string; + static EmissionMapType: string; + static BumpMapType: string; + static NormalMapType: string; + static GridType: string; + static StripeType: string; + static CheckerboardType: string; + static DotType: string; + static WaterType: string; + static RimLightingType: string; + static FadeType: string; + static PolylineArrowType: string; + static PolylineGlowType: string; + static PolylineOutlineType: string; + constructor(options?: { strict?: boolean; translucent?: boolean; fabric: any }); + isTranslucent(): boolean; + isDestroyed(): boolean; + destroy(): void; + static fromType(type: string, uniforms?: any): Material; + } + + class MaterialAppearance extends Appearance { + readonly materialSupport: MaterialAppearance.MaterialSupport; + readonly vertexFormat: VertexFormat; + readonly flat: boolean; + readonly faceForward: boolean; + constructor(options?: { + flat?: boolean; + faceForward?: boolean; + translucent?: boolean; + closed?: boolean; + materialSupport?: MaterialAppearance.MaterialSupport; + material?: Material; + vertexShaderSource?: string; + fragmentShaderSource?: string; + renderState?: RenderState + }); + } + + namespace MaterialAppearance { + enum MaterialSupport { + BASIC, + TEXTURED, + ALL + } + } + + class Model { + show: boolean; + modelMatrix: Matrix4; + scale: number; + minimumPixelSize: number; + id: any; + activeAnimations: ModelAnimationCollection; + debugShowBoundingVolume: boolean; + debugWireframe: boolean; + gltf: any; + basePath: string; + boundingSphere: BoundingSphere; + ready: boolean; + readyPromise: Promise; + asynchronous: boolean; + allowPicking: boolean; + constructor(options?: { + gltf?: any; + basePath?: string; + show?: boolean; + modelMatrix?: Matrix4; + scale?: number; + minimumPixelSize?: number; + id?: any; + allowPicking?: boolean; + asynchronous?: boolean; + debugShowBoundingVolume?: boolean; + debugWireframe?: boolean + }); + getNode(name: string): ModelNode; + getMesh(name: string): ModelMesh; + getMaterial(name: string): ModelMaterial; + update(): void; + isDestroyed(): boolean; + destroy(): void; + static fromGltf(options: { + url: string; + headers?: any; + show?: boolean; + modelMatrix?: Matrix4; + scale?: number; + minimumPixelSize?: number; + allowPicking?: boolean; + asynchronous?: boolean; + debugShowBoundingVolume?: boolean; + debugWireframe?: boolean + }): Model; + } + + class ModelAnimation { + removeOnStop: boolean; + start: Event; + update: Event; + stop: Event; + name: string; + startTime: JulianDate; + delay: number; + stopTime: JulianDate; + speedup: number; + reverse: boolean; + loop: ModelAnimationLoop; + } + + class ModelAnimationCollection { + animationAdded: Event; + animationRemoved: Event; + length: number; + add(options: { + name: string; + startTime?: JulianDate; + delay?: number; + stopTime?: JulianDate; + removeOnStop?: boolean; + speedup?: number; + reverse?: boolean; + loop?: ModelAnimationLoop + }): ModelAnimation; + addAll(options?: { + startTime?: JulianDate; + delay?: number; + stopTime?: JulianDate; + removeOnStop?: boolean; + speedup?: number; + reverse?: boolean; + loop?: ModelAnimationLoop + }): ModelAnimation[]; + remove(animation: ModelAnimation): boolean; + removeAll(): void; + contains(animation: ModelAnimation): boolean; + get(index: number): ModelAnimation; + } + + class ModelMaterial { + readonly name: string; + readonly id: string; + setValue(name: string, value?: any): void; + getValue(name: string): any; + } + + class ModelMesh { + name: string; + id: string; + materials: ModelMaterial[]; + } + + class ModelNode { + name: string; + id: string; + show: boolean; + matrix: Matrix4; + } + + class Moon { + show: boolean; + textureUrl: string; + onlySunLighting: boolean; + ellipsoid: Ellipsoid; + constructor(options?: { show?: boolean; textureUrl?: string; ellipsoid?: Ellipsoid; onlySunLighting?: boolean }); + isDestroyed(): boolean; + destroy(): void; + } + + class NeverTileDiscardPolicy { + isReady(): boolean; + shouldDiscardImage(image: HTMLImageElement | Promise): Promise; + } + + class PerInstanceColorAppearance extends Appearance { + readonly vertexFormat: VertexFormat; + readonly flat: boolean; + readonly faceForward: boolean; + static VERTEX_FORMAT: VertexFormat; + static FLAT_VERTEX_FORMAT: VertexFormat; + constructor(options?: { flat?: boolean; + faceForward?: boolean; + translucent?: boolean; + closed?: boolean; + vertexShaderSource?: string; + fragmentShaderSource?: string; + renderState?: RenderState + }); + } + + abstract class Frustum { + near: number; + far: number; + readonly projectionMatrix: Matrix4; + computeCullingVolume(position: Cartesian3, direction: Cartesian3, up: Cartesian3): CullingVolume; + getPixelDimensions(drawingBufferWidth: number, drawingBufferHeight: number, distance: number, result: Cartesian2): Cartesian2; + } + + class OrthographicFrustum extends Frustum { + aspectRatio: number; + width: number; + static packedLength: number; + constructor(options?: {width: number; aspectRatio: number; near: number; far: number}); + pack(value: OrthographicFrustum, array: number[], startingIndex: number): number[]; + unpack(array: number[], startingIndex: number, result: OrthographicFrustum): OrthographicFrustum; + clone(result?: OrthographicFrustum): OrthographicFrustum; + equals(other?: OrthographicFrustum): boolean; + } + + class PerspectiveFrustum extends Frustum { + fov: number; + aspectRatio: number; + xOffset: number; + yOffset: number; + readonly infiniteProjectionMatrix: Matrix4; + readonly fovy: number; + static packedLength: number; + constructor(options?: {fov: number; aspectRatio: number; near: number; far: number; xOffset: number; yOffset: number}); + pack(value: PerspectiveFrustum, array: number[], startingIndex: number): number[]; + unpack(array: number[], startingIndex: number, result: PerspectiveFrustum): PerspectiveFrustum; + clone(result?: PerspectiveFrustum): PerspectiveFrustum; + equals(other?: PerspectiveFrustum): boolean; + } + + class PerspectiveOffCenterFrustum extends Frustum { + left: number; + right: number; + top: number; + bottom: number; + readonly infiniteProjectionMatrix: Matrix4; + constructor(options?: {left: number; right: number; top: number; bottom: number; near: number; far: number}); + clone(result?: PerspectiveOffCenterFrustum): PerspectiveOffCenterFrustum; + equals(other?: PerspectiveOffCenterFrustum): boolean; + } + + class PointPrimitive { + color: Color; + disableDepthTestDistance: number; + distanceDisplayCondition: DistanceDisplayCondition; + id: any; + outlineColor: Color; + outlineWidth: number; + pixelSize: number; + position: Cartesian3; + scaleByDistance: NearFarScalar; + show: boolean; + translucencyByDistance: NearFarScalar; + computeScreenSpacePosition(scene: Scene, result?: Cartesian2): Cartesian2; + equals(other: PointPrimitive): boolean; + } + + class PointPrimitiveCollection { + blendOption: BlendOption; + debugShowBoundingVolume: boolean; + length: number; + modelMatrix: Matrix4; + constructor(options?: { modelMatrix?: Matrix4; debugShowBoundingVolume?: boolean, blendOption?: BlendOption }); + add(pointPrimitive?: any): PointPrimitive; + contains(pointPrimitive?: PointPrimitive): boolean; + destroy(): void; + get(index: number): PointPrimitive; + isDestroyed(): boolean; + remove(pointPrimitive: PointPrimitive): boolean; + removeAll(): void; + } + + class Polyline { + show: boolean; + positions: Cartesian3[]; + material: Material; + width: number; + loop: boolean; + id: any; + constructor(options?: { show?: boolean; width?: number; loop?: boolean; material?: Material; positions?: Cartesian3[]; id?: any }); + } + + class PolylineCollection { + modelMatrix: Matrix4; + debugShowBoundingVolume: boolean; + length: number; + constructor(options?: { modelMatrix?: Matrix4; debugShowBoundingVolume?: boolean }); + add(polyline?: any): Polyline; + remove(polyline: Polyline): boolean; + removeAll(): void; + contains(polyline: Polyline): boolean; + get(index: number): Polyline; + isDestroyed(): boolean; + destroy(): void; + } + + class PolylineColorAppearance extends Appearance { + readonly vertexFormat: VertexFormat; + static VERTEX_FORMAT: VertexFormat; + constructor(options?: { translucent?: boolean; vertexShaderSource?: string; fragmentShaderSource?: string; renderState?: RenderState }); + } + + class PolylineMaterialAppearance extends Appearance { + readonly vertexFormat: VertexFormat; + static VERTEX_FORMAT: VertexFormat; + constructor(options?: { translucent?: boolean; material?: Material; vertexShaderSource?: string; fragmentShaderSource?: string; renderState?: RenderState }); + } + + class Primitive { + readonly allowPicking: boolean; + appearance: Appearance; + readonly asynchronous: boolean; + readonly compressVertices: boolean; + cull: boolean; + debugShowBoundingVolume: boolean; + depthFailAppearance: Appearance; + readonly geometryInstances: GeometryInstance[] | GeometryInstance; + readonly interleave: boolean; + modelMatrix: Matrix4; + readonly ready: boolean; + readonly readyPromise: Promise; + readonly releaseGeometryInstances: boolean; + shadows: ShadowMode; + show: boolean; + readonly vertexCacheOptimize: boolean; + constructor(options?: { + geometryInstances?: any[] | GeometryInstance; + appearance?: Appearance; + show?: boolean; + modelMatrix?: Matrix4; + vertexCacheOptimize?: boolean; + interleave?: boolean; + compressVertices?: boolean; + releaseGeometryInstances?: boolean; + allowPicking?: boolean; + cull?: boolean; + asynchronous?: boolean; + debugShowBoundingVolume?: boolean; + shadows: ShadowMode + }); + destroy(): void; + getGeometryInstanceAttributes(id: any): any; + isDestroyed(): boolean; + update(): void; + } + + class PrimitiveCollection { + show: boolean; + destroyPrimitives: boolean; + readonly length: number; + constructor(options?: { show?: boolean; destroyPrimitives?: boolean }); + add(primitive: any): any; + remove(primitive?: any): boolean; + removeAll(): void; + contains(primitive?: any): boolean; + raise(primitive?: any): void; + raiseToTop(primitive?: any): void; + lower(primitive?: any): void; + lowerToBottom(primitive?: any): void; + get(index: number): any; + isDestroyed(): boolean; + destroy(): void; + } + + class RectanglePrimitive { + ellipsoid: Ellipsoid; + rectangle: Rectangle; + granularity: number; + height: number; + rotation: number; + textureRotationAngle: number; + show: boolean; + material: Material; + id: any; + asynchronous: boolean; + debugShowBoundingVolume: boolean; + constructor(options?: { + ellipsoid?: Ellipsoid; + rectangle?: Rectangle; + granularity?: number; + height?: number; + rotation?: number; + textureRotationAngle?: number; + show?: boolean; + material?: Material; + id?: any; + asynchronous?: boolean; + debugShowBoundingVolume?: boolean + }); + update(): void; + isDestroyed(): boolean; + destroy(): void; + } + + class Scene { + backgroundColor: Color; + readonly camera: Camera; + readonly canvas: Element; + completeMorphOnUserInput: boolean; + debugCommandFilter: (command: any) => boolean; + readonly debugFrustumStatistics: any; + debugShowCommands: boolean; + debugShowDepthFrustum: number; + debugShowFramesPerSecond: boolean; + debugShowFrustumPlanes: boolean; + debugShowFrustums: boolean; + readonly drawingBufferHeight: number; + readonly drawingBufferWidth: number; + eyeSeparation: number; + farToNearRatio: number; + focalLength: number; + fog: Fog; + fxaa: boolean; + globe: Globe; + readonly groundPrimitives: PrimitiveCollection; + readonly id: string; + readonly imageryLayers: ImageryLayerCollection; + imagerySplitPosition: number; + invertClassification: boolean; + invertClassificationColor: Color; + readonly lastRenderTime: JulianDate; + logarithmicDepthFarToNearRatio: number; + mapMode2D: boolean; + readonly mapProjection: MapProjection; + readonly maximumAliasedLineWidth: number; + readonly maximumCubeMapSize: number; + maximumRenderTimeChange: number; + minimumDisableDepthTestDistance: number; + mode: SceneMode; + moon: Moon; + morphComplete: Event; + morphStart: Event; + morphTime: number; + nearToFarDistance2D: number; + readonly orderIndependentTranslucency: boolean; + readonly pickPositionSupported: boolean; + pickTranslucentDepth: boolean; + readonly postRender: Event; + readonly preRender: Event; + readonly preUpdate: Event; + readonly primitives: PrimitiveCollection; + readonly renderError: Event; + requestRenderMode: boolean; + rethrowRenderErrors: boolean; + readonly scene3DOnly: boolean; + readonly screenSpaceCameraController: ScreenSpaceCameraController; + shadowMap: ShadowMap; + skyAtmosphere: SkyAtmosphere; + skyBox: SkyBox; + sun: Sun; + sunBloom: boolean; + terrainExaggeration: number; + terrainProvider: TerrainProvider; + readonly terrainProviderChanged: Event; + useDepthPicking: boolean; + useWebVR: boolean; + constructor(options?: { + canvas: HTMLCanvasElement; + contextOptions?: any; + creditContainer?: Element; + creditViewport?: Element; + mapProjection?: MapProjection; + orderIndependentTranslucency?: boolean; + scene3DOnly?: boolean; + terrainExaggeration?: number; + shadows?: boolean; + mapMode2D?: MapMode2D; + requestRenderMode?: boolean; + maximumRenderTimeChange?: number + }); + cartesianToCanvasCoordinates(position: Cartesian3, result?: Cartesian2): Cartesian2; + completeMorph(): void; + destroy(): void; + drillPick(windowPosition: Cartesian2, limit?: number): any[]; + getCompressedTextureFormatSupported(format: string): boolean; + isDestroyed(): boolean; + morphTo2D(duration?: number): void; + morphTo3D(duration?: number): void; + morphToColumbusView(duration?: number): void; + pick(windowPosition: Cartesian2, width?: number, height?: number): any; + pickPosition(windowPosition: Cartesian2, result?: Cartesian3): Cartesian3; + requestRender(): void; + } + + class ScreenSpaceCameraController { + enableInputs: boolean; + enableTranslate: boolean; + enableZoom: boolean; + enableRotate: boolean; + enableTilt: boolean; + enableLook: boolean; + inertiaSpin: number; + inertiaTranslate: number; + inertiaZoom: number; + maximumMovementRatio: number; + bounceAnimationTime: number; + minimumZoomDistance: number; + maximumZoomDistance: number; + translateEventTypes: CameraEventType | any[]; + zoomEventTypes: CameraEventType | any[]; + rotateEventTypes: CameraEventType | any[]; + tiltEventTypes: CameraEventType | any[]; + lookEventTypes: CameraEventType | any[]; + minimumPickingTerrainHeight: number; + minimumCollisionTerrainHeight: number; + minimumTrackBallHeight: number; + enableCollisionDetection: boolean; + constructor(scene: Scene); + isDestroyed(): boolean; + destroy(): void; + } + + class SingleTileImageryProvider extends ImageryProvider { + url: string; + constructor(options: { url: string; rectangle?: Rectangle; credit?: Credit | string; ellipsoid?: Ellipsoid; proxy?: any }); + } + + class SkyAtmosphere { + show: boolean; + ellipsoid: Ellipsoid; + constructor(ellipsoid?: Ellipsoid); + isDestroyed(): boolean; + destroy(): void; + } + + class SkyBox { + sources: any; + show: boolean; + constructor(options: { sources?: any; show?: boolean }); + update(): void; + isDestroyed(): boolean; + destroy(): void; + } + + class Sun { + show: boolean; + glowFactor: number; + isDestroyed(): boolean; + destroy(): void; + } + + class Fog { + density: number; + enabled: boolean; + minimumBrightness: number; + screenSpaceErrorFactor: number; + } + + class TileCoordinatesImageryProvider extends ImageryProvider { + constructor(options?: { tilingScheme?: TilingScheme; ellipsoid?: Ellipsoid; color?: Color; tileWidth?: number; tileHeight?: number }); + } + + class TileDiscardPolicy { + isReady(): boolean; + shouldDiscardImage(image: HTMLImageElement | Promise): Promise; + } + + class TileMapServiceImageryProvider extends ImageryProvider { + url: string; + constructor(options?: { + url?: string; + fileExtension?: string; + proxy?: any; + credit?: Credit | string; + minimumLevel?: number; + maximumLevel?: number; + rectangle?: Rectangle; + tilingScheme?: TilingScheme; + ellipsoid?: Ellipsoid; + tileWidth?: number; + tileHeight?: number + }); + } + + class ViewportQuad { + show: boolean; + rectangle: BoundingRectangle; + material: Material; + constructor(rectangle?: BoundingRectangle, material?: Material); + update(): void; + isDestroyed(): boolean; + destroy(): void; + } + + class WebMapServiceImageryProvider extends ImageryProvider { + readonly url: string; + static DefaultParameters: {service: string, version: string, request: string, styles: string, format: string}; + static GetFeatureInfoDefaultParameters: {service: string, version: string, request: string}; + constructor(options: { + url: string; + layers: string; + parameters?: any; + getFeatureInfoParameters?: any; + enablePickFeatures?: boolean; + getFeatureInfoFormats?: GetFeatureInfoFormat[]; + rectangle?: Rectangle; + tilingScheme?: TilingScheme; + ellipsoid?: Ellipsoid; + tileWidth?: number; + tileHeight?: number; + minimumLevel?: number; + maximumLevel?: number; + crs?: string; + srs?: string; + credit?: Credit | string; + subdomains?: string | string[] + }); + } + + class WebMapTileServiceImageryProvider extends ImageryProvider { + clock: Clock; + dimensions: any; + readonly format: string; + times: TimeIntervalCollection; + readonly url: string; + constructor(options: { + url: string; + format?: string; + layer: string; + style: string; + tileMatrixSetID: string; + tileMatrixLabels?: any[]; + clock?: Clock; + times?: TimeIntervalCollection; + dimensions?: any; + tileWidth?: number; + tileHeight?: number; + tilingScheme?: TilingScheme; + rectangle?: Rectangle; + minimumLevel?: number; + maximumLevel?: number; + ellipsoid?: Ellipsoid; + credit?: Credit | string; + subdomains?: string | string[] + }); + } + + class Animation { + readonly container: Element; + readonly viewModel: AnimationViewModel; + constructor(container: Element | string, viewModel: AnimationViewModel); + isDestroyed(): boolean; + destroy(): void; + resize(): void; + applyThemeChanges(): void; + } + + class AnimationViewModel { + shuttleRingDragging: boolean; + snapToTicks: boolean; + timeLabel: string; + dateLabel: string; + multiplierLabel: string; + shuttleRingAngle: number; + slower: Command; + faster: Command; + clockViewModel: ClockViewModel; + pauseViewModel: ToggleButtonViewModel; + playReverseViewModel: ToggleButtonViewModel; + playForwardViewModel: ToggleButtonViewModel; + playRealtimeViewModel: ToggleButtonViewModel; + dateFormatter: AnimationViewModel.DateFormatter; + timeFormatter: AnimationViewModel.TimeFormatter; + static defaultDateFormatter: AnimationViewModel.DateFormatter; + static defaultTicks: number[]; + static defaultTimeFormatter: AnimationViewModel.TimeFormatter; + constructor(clockViewModel: ClockViewModel); + getShuttleRingTicks(): number[]; + setShuttleRingTicks(positiveTicks: number[]): void; + } + + namespace AnimationViewModel { + type DateFormatter = (date: JulianDate, viewModel: AnimationViewModel) => string; + type TimeFormatter = (date: JulianDate, viewModel: AnimationViewModel) => string; + } + + class BaseLayerPicker { + container: Element; + viewModel: BaseLayerPickerViewModel; + constructor(container: Element, options: { + globe: Globe; + imageryProviderViewModels?: ProviderViewModel[]; + selectedImageryProviderViewModel?: ProviderViewModel; + terrainProviderViewModels?: ProviderViewModel[]; + selectedTerrainProviderViewModel?: ProviderViewModel + }); + isDestroyed(): boolean; + destroy(): void; + } + + class BaseLayerPickerViewModel { + imageryProviderViewModels: ProviderViewModel[]; + terrainProviderViewModels: ProviderViewModel[]; + dropDownVisible: boolean; + buttonTooltip: string; + buttonImageUrl: string; + selectedImagery: ProviderViewModel; + selectedTerrain: ProviderViewModel; + toggleDropDown: Command; + globe: Globe; + constructor(options: { + globe: Globe; + imageryProviderViewModels?: ProviderViewModel[]; + selectedImageryProviderViewModel?: ProviderViewModel; + terrainProviderViewModels?: ProviderViewModel[]; + selectedTerrainProviderViewModel?: ProviderViewModel + }); + } + + class ProviderViewModel { + name: string; + tooltip: string; + iconUrl: string; + creationCommand: Command; + constructor(options: { name: string; tooltip: string; iconUrl: string; creationFunction: ProviderViewModel.CreationFunction | Command }); + } + + namespace ProviderViewModel { + type CreationFunction = () => ImageryProvider | TerrainProvider | ImageryProvider[] | TerrainProvider[]; + } + + class CesiumInspector { + container: Element; + viewModel: CesiumInspectorViewModel; + constructor(container: Element | string, scene: Scene); + isDestroyed(): boolean; + destroy(): void; + } + + class CesiumInspectorViewModel { + frustums: boolean; + performance: boolean; + shaderCacheText: string; + primitiveBoundingSphere: boolean; + primitiveReferenceFrame: boolean; + filterPrimitive: boolean; + tileBoundingSphere: boolean; + filterTile: boolean; + wireframe: boolean; + suspendUpdates: boolean; + tileCoordinates: boolean; + frustumStatisticText: string; + tileText: string; + hasPickedPrimitive: boolean; + hasPickedTile: boolean; + pickPimitiveActive: boolean; + pickTileActive: boolean; + dropDownVisible: boolean; + generalVisible: boolean; + primitivesVisible: boolean; + terrainVisible: boolean; + generalSwitchText: string; + primitivesSwitchText: string; + terrainSwitchText: string; + scene: Scene; + performanceContainer: Element; + toggleDropDown: Command; + showFrustums: Command; + showPerformance: Command; + showPrimitiveBoundingSphere: Command; + showPrimitiveReferenceFrame: Command; + doFilterPrimitive: Command; + showWireframe: Command; + doSuspendUpdates: Command; + showTileCoordinates: Command; + showTileBoundingSphere: Command; + doFilterTile: Command; + toggleGeneral: Command; + togglePrimitives: Command; + toggleTerrain: Command; + pickPrimitive: Command; + pickTile: Command; + selectParent: Command; + selectNW: Command; + selectNE: Command; + selectSW: Command; + selectSE: Command; + primitive: Command; + tile: Command; + constructor(scene: Scene); + isDestroyed(): boolean; + destroy(): void; + } + + class CesiumWidget { + container: Element; + canvas: HTMLCanvasElement; + creditContainer: Element; + creditViewport: Element; + scene: Scene; + readonly imageryLayers: ImageryLayerCollection; + terrainProvider: TerrainProvider; + readonly camera: Camera; + clock: Clock; + screenSpaceEventHandler: ScreenSpaceEventHandler; + targetFrameRate: number; + useDefaultRenderLoop: boolean; + resolutionScale: number; + constructor(container: Element | string, options?: { + clock?: Clock; + imageryProvider?: ImageryProvider; + terrainProvider?: TerrainProvider; + skyBox?: SkyBox; + skyAtmosphere?: SkyAtmosphere; + sceneMode?: SceneMode; + scene3DOnly?: boolean; + orderIndependentTranslucency?: boolean; + mapProjection?: MapProjection; + globe?: Globe; + useDefaultRenderLoop?: boolean; + targetFrameRate?: number; + showRenderLoopErrors?: boolean; + contextOptions?: any; + creditContainer?: Element | string; + creditViewport?: Element | string; + terrainExaggeration?: number; + shadows?: boolean; + terrainShadows?: ShadowMode; + mapMode2D?: MapMode2D; + requestRenderMode?: boolean; + maximumRenderTimeChange?: number + }); + showErrorPanel(title: string, message: string, error?: string): void; + isDestroyed(): boolean; + destroy(): void; + resize(): void; + render(): void; + } + + class ClockViewModel { + systemTime: JulianDate; + startTime: JulianDate; + stopTime: JulianDate; + currentTime: JulianDate; + multiplier: number; + clockStep: ClockStep; + clockRange: ClockRange; + canAnimate: boolean; + shouldAnimate: boolean; + clock: Clock; + constructor(clock?: Clock); + synchronize(): void; + isDestroyed(): boolean; + destroy(): void; + } + + class Command { + canExecute: boolean; + beforeExecute: Event; + afterExecute: Event; + } + + class FullscreenButton { + container: Element; + viewModel: FullscreenButtonViewModel; + constructor(container: Element | string, fullscreenElement?: Element | string); + isDestroyed(): boolean; + destroy(): void; + } + + class FullscreenButtonViewModel { + isFullscreen: boolean; + isFullscreenEnabled: boolean; + tooltip: string; + fullscreenElement: Element; + command: Command; + constructor(fullscreenElement?: Element | string); + isDestroyed(): boolean; + destroy(): void; + } + + class Geocoder { + container: Element; + viewModel: GeocoderViewModel; + constructor(options: { container: Element | string; scene: Scene; url?: string; key?: string; flightDuration?: number }); + isDestroyed(): boolean; + destroy(): void; + } + + class GeocoderViewModel { + isSearchInProgress: boolean; + searchText: string; + flightDuration: number; + url: string; + key: string; + complete: Event; + scene: Scene; + search: Command; + constructor(options: { scene: Scene; url?: string; key?: string; flightDuration?: number }); + } + + class HomeButton { + container: Element; + viewModel: HomeButtonViewModel; + constructor(container: Element | string, scene: Scene, duration?: number); + isDestroyed(): boolean; + destroy(): void; + } + + class HomeButtonViewModel { + tooltip: string; + scene: Scene; + command: Command; + duration: number; + constructor(scene: Scene, duration?: number); + } + + class VRButton { + container: Element; + viewModel: VRButtonViewModel; + constructor(container: Element | string, scene: Scene, vrElement: Element | string); + destroy(): void; + isDestroyed(): boolean; + } + + class VRButtonViewModel { + command: Command; + isVREnabled: boolean; + isVRMode: boolean; + tooltip: string; + vrElement: Element; + constructor(scene: Scene, vrElement: Element | string); + destroy(): void; + isDestroyed(): boolean; + } + + class InfoBox { + container: Element; + viewModel: InfoBoxViewModel; + frame: HTMLIFrameElement; + constructor(container: Element | string); + isDestroyed(): boolean; + destroy(): void; + } + + class InfoBoxViewModel { + maxHeight: number; + enableCamera: boolean; + isCameraTracking: boolean; + showInfo: boolean; + titleText: string; + description: string; + cameraIconPath: string; + cameraClicked: Event; + closeClicked: Event; + maxHeightOffset(offset: number): string; + } + + class NavigationHelpButton { + container: Element; + viewModel: NavigationHelpButtonViewModel; + constructor(options: { container: Element | string; instructionsInitiallyVisible?: boolean }); + isDestroyed(): boolean; + destroy(): void; + } + + class NavigationHelpButtonViewModel { + showInstructions: boolean; + tooltip: string; + command: Command; + showClick: Command; + showTouch: Command; + } + + class PerformanceWatchdog { + container: Element; + viewModel: PerformanceWatchdogViewModel; + constructor(options?: { container: Element | string; scene: Scene; lowFrameRateMessage?: string }); + isDestroyed(): boolean; + destroy(): void; + } + + class PerformanceWatchdogViewModel { + lowFrameRateMessage: string; + lowFrameRateMessageDismissed: boolean; + showingLowFrameRateMessage: boolean; + scene: Scene; + dismissMessage: Command; + constructor(options?: { scene: Scene; lowFrameRateMessage?: string }); + } + + class ProjectionPicker { + container: Element; + viewModel: ProjectionPickerViewModel; + constructor(container: Element | string, scene: Scene); + destroy(): void; + isDestroyed(): boolean; + } + + class ProjectionPickerViewModel { + dropDownVisible: boolean; + isOrthographicProjection: Command; + scene: Scene; + sceneMode: SceneMode; + selectedTooltip: string; + switchToOrthographic: Command; + switchToPerspective: Command; + toggleDropdown: Command; + tooltipOrthographic: string; + tooltipPerspective: string; + constructor(scene: Scene); + destroy(): void; + isDestroyed(): boolean; + } + + class SceneModePicker { + container: Element; + viewModel: SceneModePickerViewModel; + constructor(container: Element | string, scene: Scene, duration?: number); + isDestroyed(): boolean; + destroy(): void; + } + + class SceneModePickerViewModel { + sceneMode: SceneMode; + dropDownVisible: boolean; + tooltip2D: string; + tooltip3D: string; + tooltipColumbusView: string; + selectedTooltip: string; + scene: Scene; + duration: number; + toggleDropDown: Command; + morphTo2D: Command; + morphTo3D: Command; + morphToColumbusView: Command; + constructor(scene: Scene, duration?: number); + isDestroyed(): boolean; + destroy(): void; + } + + class SelectionIndicator { + container: Element; + viewModel: SelectionIndicatorViewModel; + constructor(container: Element | string, scene: Scene); + isDestroyed(): boolean; + destroy(): void; + } + + class SelectionIndicatorViewModel { + position: Cartesian3; + showSelection: boolean; + isVisible: boolean; + computeScreenSpacePosition: SelectionIndicatorViewModel.ComputeScreenSpacePosition; + container: Element; + selectionIndicatorElement: Element; + scene: Scene; + constructor(scene: Scene, selectionIndicatorElement: Element, container: Element); + update(): void; + animateAppear(): void; + animateDepart(): void; + } + + namespace SelectionIndicatorViewModel { + type ComputeScreenSpacePosition = (position: Cartesian3, result: Cartesian2) => Cartesian2; + } + + class Timeline { + container: Element; + constructor(container: Element, clock: Clock); + isDestroyed(): boolean; + destroy(): void; + zoomTo(startTime: JulianDate, stopTime: JulianDate): void; + resize(): void; + } + + class ToggleButtonViewModel { + toggled: boolean; + tooltip: string; + command: Command; + constructor(command: Command, options?: { toggled?: boolean; tooltip?: string }); + } + + class Viewer { + readonly container: Element; + readonly bottomContainer: Element; + readonly cesiumWidget: CesiumWidget; + readonly selectionIndicator: SelectionIndicator; + readonly infoBox: InfoBox; + readonly geocoder: Geocoder; + readonly homeButton: HomeButton; + readonly sceneModePicker: SceneModePicker; + readonly projectionPicker: ProjectionPicker; + readonly navigationHelpButton: NavigationHelpButton; + readonly baseLayerPicker: BaseLayerPicker; + readonly animation: Animation; + readonly timeline: Timeline; + readonly fullscreenButton: FullscreenButton; + readonly dataSourceDisplay: DataSourceDisplay; + readonly entities: EntityCollection; + readonly dataSources: DataSourceCollection; + readonly canvas: HTMLCanvasElement; + readonly scene: Scene; + readonly imageryLayers: ImageryLayerCollection; + terrainProvider: TerrainProvider; + terrainShadows: ShadowMode; + readonly camera: Camera; + clockTrackedDataSource: DataSource; + readonly clockViewModel: ClockViewModel; + readonly clock: Clock; + readonly screenSpaceEventHandler: ScreenSpaceEventHandler; + targetFrameRate: number; + useDefaultRenderLoop: boolean; + resolutionScale: number; + allowDataSourcesToSuspendAnimation: boolean; + trackedEntity: Entity; + selectedEntity: Entity; + readonly trackedEntityChanged: Event; + readonly selectedEntityChanged: Event; + readonly shadowMap: ShadowMap; + readonly vrButton: VRButton; + shadows: boolean; + constructor(container: Element | string, options?: { + animation?: boolean; + baseLayerPicker?: boolean; + fullscreenButton?: boolean; + vrButton?: boolean; + geocoder?: boolean; + homeButton?: boolean; + infoBox?: boolean; + sceneModePicker?: boolean; + selectionIndicator?: boolean; + timeline?: boolean; + navigationHelpButton?: boolean; + navigationInstructionsInitiallyVisible?: boolean; + scene3DOnly?: boolean; + shouldAnimate?: boolean; + clockViewModel?: ClockViewModel; + selectedImageryProviderViewModel?: ProviderViewModel; + imageryProviderViewModels?: ProviderViewModel[]; + selectedTerrainProviderViewModel?: ProviderViewModel; + terrainProviderViewModels?: ProviderViewModel[]; + imageryProvider?: ImageryProvider; + terrainProvider?: TerrainProvider; + skyBox?: SkyBox; + skyAtmosphere?: SkyAtmosphere; + fullscreenElement?: Element | string; + useDefaultRenderLoop?: boolean; + targetFrameRate?: number; + showRenderLoopErrors?: boolean; + automaticallyTrackDataSourceClocks?: boolean; + contextOptions?: any; + sceneMode?: SceneMode; + mapProjection?: MapProjection; + globe?: Globe; + orderIndependentTranslucency?: boolean; + creditContainer?: Element | string; + creditViewport?: Element | string; + dataSources?: DataSourceCollection; + terrainExaggeration?: number; + shadows?: boolean; + terrainShadows?: ShadowMode; + mapMode2D?: MapMode2D; + projectionPicker?: boolean; + requestRenderMode?: boolean; + maximumRenderTimeChange?: number + }); + extend(mixin: Viewer.ViewerMixin, options: any): void; + resize(): void; + forceResize(): void; + render(): void; + isDestroyed(): boolean; + destroy(): void; + zoomTo(target: Entity | Entity[] | EntityCollection | DataSource | Promise, offset?: HeadingPitchRange): Promise; + flyTo(target: Entity | Entity[] | EntityCollection | DataSource | Promise, + options?: { duration?: number; maximumHeight?: number; offset?: HeadingPitchRange }): Promise; + } + + namespace Viewer { + type ViewerMixin = (viewer: Viewer, options: any) => void; + } + + function barycentricCoordinates(point: Cartesian2 | Cartesian3, p0: Cartesian2 | Cartesian3, p1: Cartesian2 | Cartesian3, p2: Cartesian2 | Cartesian3, result?: Cartesian3): Cartesian3; + + function binarySearch(array: any[], itemToFind: any, comparator: binarySearch.Comparator): number; + + namespace binarySearch { + type Comparator = (a: any, b: any) => number; + } + + function cancelAnimationFrame(requestID: number): undefined; + + function clone(object: any, deep?: boolean): any; + + function combine(object1?: any, object2?: any, deep?: boolean): any; + + function destroyObject(object: any, message?: string): undefined; + + function formatError(object: any): string; + + function getFilenameFromUri(uri: string): string; + + function getImagePixels(image: HTMLImageElement): number[]; + + function isArray(value: any): boolean; + + function isLeapYear(year: number): boolean; + + function jsonp(url: string, options?: { parameters?: any; callbackParameterName?: string; proxy?: any }): Promise; + + function loadArrayBuffer(url: string | Promise, headers?: any): Promise; + + function loadBlob(url: string | Promise, headers?: any): Promise; + + function loadImage(url: string | Promise, allowCrossOrigin?: boolean): Promise; + + function loadImageViaBlob(url: string | Promise): Promise; + + function loadJson(url: string | Promise, headers?: any): Promise; + + function loadText(url: string | Promise, headers?: any): Promise; + + function loadWithXhr(options: { url: string | Promise; responseType?: string; method?: string; data?: string; headers?: any; overrideMimeType?: string }): Promise; + + function loadXML(url: string | Promise, headers?: any): Promise; + + function mergeSort(array: any[], comparator: mergeSort.Comparator, userDefinedObject?: any): undefined; + + namespace mergeSort { + type Comparator = (a: any, b: any, userDefinedObject?: any) => number; + } + + function objectToQuery(obj: any): string; + + function pointInsideTriangle(point: Cartesian2 | Cartesian3, p0: Cartesian2 | Cartesian3, p1: Cartesian2 | Cartesian3, p2: Cartesian2 | Cartesian3): boolean; + + function queryToObject(queryString: string): any; + + function requestAnimationFrame(callback: requestAnimationFrame.Callback): number; + + namespace requestAnimationFrame { + type Callback = (timestamp: number) => void; + } + + function sampleTerrain(terrainProvider: TerrainProvider, level: number, positions: Cartographic[]): Promise; + + function subdivideArray(array: any[], numberOfArrays: number): undefined; + + function throttleRequestByServer(url: string, requestFunction: throttleRequestByServer.RequestFunction): Promise; + + namespace throttleRequestByServer { + type RequestFunction = (url: string) => Promise; + } + + function createTangentSpaceDebugPrimitive(options: { geometry: Geometry; length?: number; modelMatrix?: Matrix4 }): Primitive; + + function viewerCesiumInspectorMixin(viewer: Viewer): undefined; + + function viewerDragDropMixin(viewer: Viewer, options?: { dropTarget?: Element | string; clearOnDrop?: boolean; flyToOnDrop?: boolean; clampToGround?: boolean; proxy?: DefaultProxy }): undefined; + + function viewerPerformanceWatchdogMixin(viewer: Viewer): undefined; + + function createCommand(func: () => any, canExecute?: boolean): Command; + + function createTaskProcessorWorker(workerFunction: createTaskProcessorWorker.WorkerFunction): createTaskProcessorWorker.TaskProcessorWorkerFunction; + + namespace createTaskProcessorWorker { + type WorkerFunction = (parameters: any, transferableObjects: any[]) => any; + type TaskProcessorWorkerFunction = (event: any) => void; + } + + enum ClockRange { + UNBOUNDED, + CLAMPED, + LOOP_STOP, + } + + enum ClockStep { + TICK_DEPENDENT, + SYSTEM_CLOCK_MULTIPLIER, + SYSTEM_CLOCK, + } + + enum ComponentDatatype { + BYTE, + UNSIGNED_BYTE, + SHORT, + UNSIGNED_SHORT, + FLOAT, + DOUBLE, + } + + namespace ComponentDatatype { + function getSizeInBytes(componentDatatype: ComponentDatatype): number; + function fromTypedArray(array: Int8Array | Uint8Array | Int16Array | Uint16Array | Float32Array | Float64Array): ComponentDatatype; + function validate(componentDatatype: ComponentDatatype): boolean; + function createTypedArray(componentDatatype: ComponentDatatype, valuesOrLength: number | any[]): Int8Array | Uint8Array | Int16Array | Uint16Array | Float32Array | Float64Array; + function createArrayBufferView(componentDatatype: ComponentDatatype, buffer: ArrayBuffer, byteOffset?: number, length?: number): + Int8Array | Uint8Array | Int16Array | Uint16Array | Float32Array | Float64Array; + } + + enum CornerType { + ROUNDED, + MITERED, + BEVELED, + } + + namespace CubicRealPolynomial { + function computeDiscriminant(a: number, b: number, c: number, d: number): number; + function computeRealRoots(a: number, b: number, c: number, d: number): number[]; + } + + enum ExtrapolationType { + NONE, + HOLD, + EXTRAPOLATE, + } + + namespace FeatureDetection { + function supportsFullscreen(): boolean; + function supportsTypedArrays(): boolean; + function supportsWebAssembly(): boolean; + function supportsWebWorkers(): boolean; + } + + enum Fullscreen { + element, + changeEventName, + errorEventName, + enabled, + fullscreen, + } + + namespace Fullscreen { + function supportsFullscreen(): boolean; + function requestFullscreen(element: any): undefined; + function exitFullscreen(): undefined; + } + + namespace GeometryPipeline { + function toWireframe(geometry: Geometry): Geometry; + function createLineSegmentsForVectors(geometry: Geometry, attributeName?: string, length?: number): Geometry; + function createAttributeLocations(geometry: Geometry): any; + function reorderForPreVertexCache(geometry: Geometry): Geometry; + function reorderForPostVertexCache(geometry: Geometry, cacheCapacity?: number): Geometry; + function fitToUnsignedShortIndices(geometry: Geometry): Geometry[]; + function projectTo2D(geometry: Geometry, attributeName: string, attributeName3D: string, attributeName2D: string, projection?: any): Geometry; + function encodeAttribute(geometry: Geometry, attributeName: string, attributeHighName: string, attributeLowName: string): Geometry; + function transformToWorldCoordinates(instance: GeometryInstance): GeometryInstance; + function computeNormal(geometry: Geometry): Geometry; + function computeBinormalAndTangent(geometry: Geometry): Geometry; + function compressVertices(geometry: Geometry): Geometry; + } + + enum HeightmapTessellator { + DEFAULT_STRUCTURE, + } + + namespace HeightmapTessellator { + function computeVertices(options: { + vertices: any[] | Float32Array; + heightmap: Int8Array | Uint8Array | Int16Array | Uint16Array | Float32Array | Float64Array; + width: number; + height: number; + skirtHeight: number; + nativeRectangle: Rectangle; + rectangle?: Rectangle; + isGeographic?: boolean; + relativetoCenter?: Cartesian3; + ellipsoid?: Ellipsoid; + structure?: any; + structureheightScale?: number; + structureheightOffset?: number; + structureelementsPerHeight?: number; + structurestride?: number; + structureelementMultiplier?: number; + structureisBigEndian?: boolean + }): undefined; + } + + enum HeightReference { + CLAMP_TO_GROUND, + NONE, + RELATIVE_TO_GROUND + } + + class HermitePolynomialApproximation extends InterpolationAlgorithm { + static getRequiredDataPoints(degree: number, inputOrder?: number): number; + } + + enum IndexDatatype { + UNSIGNED_BYTE, + UNSIGNED_SHORT, + UNSIGNED_INT, + } + + namespace IndexDatatype { + function getSizeInBytes(indexDatatype: IndexDatatype): number; + function validate(indexDatatype: IndexDatatype): boolean; + function createTypedArray(numberOfVertices: number, indicesLengthOrArray: any): Uint16Array | Uint32Array; + function createTypedArrayFromArrayBuffer(numberOfVertices: number, sourceArray: ArrayBuffer, byteOffset: number, length: number): Uint16Array | Uint32Array; + } + + // tslint:disable-next-line no-unnecessary-class + class InterpolationAlgorithm { + static type: string; + static getRequiredDataPoints(degree: number): number; + static interpolateOrderZero(x: number, xTable: number[], yTable: number[], yStride: number, result?: number[]): number[]; + static interpolate(x: number, xTable: number[], yTable: number[], yStride: number, inputOrder: number, outputOrder: number, result?: number[]): number[]; + } + + enum Intersect { + OUTSIDE, + INTERSECTING, + INSIDE, + } + + namespace IntersectionTests { + function rayPlane(ray: Ray, plane: Plane, result?: Cartesian3): Cartesian3; + function rayTriangle(ray: Ray, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean, result?: Cartesian3): Cartesian3; + function lineSegmentTriangle(v0: Cartesian3, v1: Cartesian3, p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, cullBackFaces?: boolean, result?: Cartesian3): Cartesian3; + function raySphere(ray: Ray, sphere: BoundingSphere, result?: any): any; + function lineSegmentSphere(p0: Cartesian3, p1: Cartesian3, sphere: BoundingSphere, result?: any): any; + function rayEllipsoid(ray: Ray, ellipsoid: Ellipsoid): any; + function grazingAltitudeLocation(ray: Ray, ellipsoid: Ellipsoid): Cartesian3; + function lineSegmentPlane(endPoint0: Cartesian3, endPoint1: Cartesian3, plane: Plane, result?: Cartesian3): Cartesian3; + function trianglePlaneIntersection(p0: Cartesian3, p1: Cartesian3, p2: Cartesian3, plane: Plane): any; + } + + namespace Intersections2D { + function clipTriangleAtAxisAlignedThreshold(threshold: number, keepAbove: boolean, u0: number, u1: number, u2: number, result?: number[]): number[]; + function computeBarycentricCoordinates(x: number, y: number, x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, result?: Cartesian3): Cartesian3; + } + + enum Iso8601 { + MINIMUM_VALUE, + MAXIMUM_VALUE, + MAXIMUM_INTERVAL, + } + + enum KeyboardEventModifier { + SHIFT, + CTRL, + ALT, + } + + class LagrangePolynomialApproximation extends InterpolationAlgorithm {} + + class LinearApproximation extends InterpolationAlgorithm {} + + enum MapMode2D { + INFINITE_SCROLL, + ROTATE + } + + enum Math { + EPSILON1, + EPSILON2, + EPSILON3, + EPSILON4, + EPSILON5, + EPSILON6, + EPSILON7, + EPSILON8, + EPSILON9, + EPSILON10, + EPSILON11, + EPSILON12, + EPSILON13, + EPSILON14, + EPSILON15, + EPSILON16, + EPSILON17, + EPSILON18, + EPSILON19, + EPSILON20, + GRAVITATIONALPARAMETER, + SOLAR_RADIUS, + LUNAR_RADIUS, + SIXTY_FOUR_KILOBYTES, + PI, + ONE_OVER_PI, + PI_OVER_TWO, + PI_OVER_THREE, + PI_OVER_FOUR, + PI_OVER_SIX, + THREE_PI_OVER_TWO, + TWO_PI, + ONE_OVER_TWO_PI, + RADIANS_PER_DEGREE, + DEGREES_PER_RADIAN, + RADIANS_PER_ARCSECOND, + } + + namespace Math { + function sign(value: number): number; + function signNotZero(value: number): number; + function toSNorm(value: number): number; + function fromSNorm(value: number): number; + function sinh(value: number): number; + function cosh(value: number): number; + function lerp(p: number, q: number, time: number): number; + function toRadians(degrees: number): number; + function toDegrees(radians: number): number; + function convertLongitudeRange(angle: number): number; + function negativePiToPi(angle: number): number; + function zeroToTwoPi(angle: number): number; + function mod(m: number, n: number): number; + function equalsEpsilon(left: number, right: number, relativeEpsilon: number, absoluteEpsilon?: number): boolean; + function factorial(n: number): number; + function incrementWrap(n?: number, maximumValue?: number, minimumValue?: number): number; + function isPowerOfTwo(n: number): boolean; + function nextPowerOfTwo(n: number): number; + function clamp(value: number, min: number, max: number): number; + function setRandomNumberSeed(seed: number): undefined; + function nextRandomNumber(): number; + function acosClamped(value: number): number; + function asinClamped(value: number): number; + function chordLength(angle: number, radius: number): number; + } + + // tslint:disable-next-line no-unnecessary-class + abstract class Packable { + static packedLength: number; + static pack(value: any, array: number[], startingIndex?: number): number[]; + static unpack(array: number[], startingIndex?: number, result?: any): Packable; + } + + enum PackableForInterpolation { + packedInterpolationLength, + } + + namespace PackableForInterpolation { + function convertPackedArrayForInterpolation(packedArray: number[], startingIndex?: number, lastIndex?: number, result?: number[]): number[]; + function unpackInterpolationResult(array: number[], sourceArray: number[], startingIndex?: number, lastIndex?: number, result?: any): any; + } + + enum PixelFormat { + DEPTH_COMPONENT, + DEPTH_STENCIL, + ALPHA, + RGB, + RGBA, + LUMINANCE, + LUMINANCE_ALPHA, + } + + enum PrimitiveType { + POINTS, + LINES, + LINE_LOOP, + LINE_STRIP, + TRIANGLES, + TRIANGLE_STRIP, + TRIANGLE_FAN, + } + + namespace QuadraticRealPolynomial { + function computeDiscriminant(a: number, b: number, c: number): number; + function computeRealRoots(a: number, b: number, c: number): number[]; + } + + namespace QuarticRealPolynomial { + function computeDiscriminant(a: number, b: number, c: number, d: number, e: number): number; + function computeRealRoots(a: number, b: number, c: number, d: number, e: number): number[]; + } + + enum ReferenceFrame { + FIXED, + INERTIAL, + } + + enum ScreenSpaceEventType { + LEFT_DOWN, + LEFT_UP, + LEFT_CLICK, + LEFT_DOUBLE_CLICK, + RIGHT_DOWN, + RIGHT_UP, + RIGHT_CLICK, + RIGHT_DOUBLE_CLICK, + MIDDLE_DOWN, + MIDDLE_UP, + MIDDLE_CLICK, + MIDDLE_DOUBLE_CLICK, + MOUSE_MOVE, + WHEEL, + PINCH_START, + PINCH_END, + PINCH_MOVE, + } + + namespace Simon1994PlanetaryPositions { + function computeSunPositionInEarthInertialFrame(julianDate?: JulianDate, result?: Cartesian3): Cartesian3; + function computeMoonPositionInEarthInertialFrame(julianDate?: JulianDate, result?: Cartesian3): Cartesian3; + } + + class ShadowMap { + darkness: number; + enabled: boolean; + maximumDistance: number; + normalOffset: boolean; + size: number; + softShadows: boolean; + constructor(obtions: { + lightCamera: Camera; + enabled?: boolean; + isPointLight?: boolean; + pointLightRadius?: number; + cascadesEnabled?: boolean; + numberOfCascades?: number; + maximumDistance?: number; + size?: number; + softShadows?: boolean; + darkness?: number; + normalOffset?: boolean + }); + } + + enum ShadowMode { + CAST_ONLY, + DISABLED, + ENABLED, + RECEIVE_ONLY + } + + enum TimeStandard { + UTC, + TAI, + } + + namespace Transforms { + function eastNorthUpToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4; + function northEastDownToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4; + function northUpEastToFixedFrame(origin: Cartesian3, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4; + function headingPitchRollToFixedFrame(origin: Cartesian3, heading: number, pitch: number, roll: number, ellipsoid?: Ellipsoid, result?: Matrix4): Matrix4; + function headingPitchRollQuaternion(origin: Cartesian3, heading: number, pitch: number, roll: number, ellipsoid?: Ellipsoid, result?: Quaternion): Quaternion; + function computeTemeToPseudoFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3; + function preloadIcrfFixed(timeInterval: TimeInterval): Promise; + function computeIcrfToFixedMatrix(date: JulianDate, result?: Matrix3): Matrix3; + function computeFixedToIcrfMatrix(date: JulianDate, result?: Matrix3): Matrix3; + function pointToWindowCoordinates(modelViewProjectionMatrix: Matrix4, viewportTransformation: Matrix4, point: Cartesian3, result?: Cartesian2): Cartesian2; + } + + namespace TridiagonalSystemSolver { + function solve(diagonal: number[], lower: number[], upper: number[], right: Cartesian3[]): Cartesian3[]; + } + + enum Visibility { + NONE, + PARTIAL, + FULL, + } + + enum WindingOrder { + CLOCKWISE, + COUNTER_CLOCKWISE, + } + + enum StripeOrientation { + HORIZONTAL, + VERTICAL, + } + + enum BingMapsStyle { + AERIAL, + AERIAL_WITH_LABELS, + ROAD, + ORDNANCE_SURVEY, + COLLINS_BART, + } + + enum BlendEquation { + ADD, + SUBTRACT, + REVERSE_SUBTRACT, + } + + enum BlendFunction { + ZERO, + ONE, + SOURCE_COLOR, + ONE_MINUS_SOURCE_COLOR, + DESTINATION_COLOR, + ONE_MINUS_DESTINATION_COLOR, + SOURCE_ALPHA, + ONE_MINUS_SOURCE_ALPHA, + DESTINATION_ALPHA, + ONE_MINUS_DESTINATION_ALPHA, + CONSTANT_COLOR, + ONE_MINUS_CONSTANT_COLOR, + CONSTANT_ALPHA, + ONE_MINUS_CONSTANT_ALPHA, + SOURCE_ALPHA_SATURATE, + } + + enum BlendingState { + DISABLED, + ALPHA_BLEND, + PRE_MULTIPLIED_ALPHA_BLEND, + ADDITIVE_BLEND, + } + + enum BlendOption { + OPAQUE, + OPAQUE_AND_TRANSLUCENT, + TRANSLUCENT + } + + enum CameraEventType { + LEFT_DRAG, + RIGHT_DRAG, + MIDDLE_DRAG, + WHEEL, + PINCH, + } + + enum CullFace { + FRONT, + BACK, + FRONT_AND_BACK, + } + + enum DepthFunction { + NEVER, + LESS, + EQUAL, + LESS_OR_EQUAL, + GREATER, + NOT_EQUAL, + GREATER_OR_EQUAL, + ALWAYS, + } + + enum HorizontalOrigin { + CENTER, + LEFT, + RIGHT, + } + + enum LabelStyle { + FILL, + OUTLINE, + FILL_AND_OUTLINE, + } + + enum ModelAnimationLoop { + NONE, + REPEAT, + MIRRORED_REPEAT, + } + + enum SceneMode { + MORPHING, + COLUMBUS_VIEW, + SCENE2D, + SCENE3D, + } + + namespace SceneMode { + function getMorphTime(value: SceneMode): number; + } + + namespace SceneTransforms { + function wgs84ToWindowCoordinates(scene: Scene, position: Cartesian3, result?: Cartesian2): Cartesian2; + function wgs84ToDrawingBufferCoordinates(scene: Scene, position: Cartesian3, result?: Cartesian2): Cartesian2; + } + + enum StencilFunction { + NEVER, + LESS, + EQUAL, + LESS_OR_EQUAL, + GREATER, + NOT_EQUAL, + GREATER_OR_EQUAL, + ALWAYS, + } + + enum StencilOperation { + ZERO, + KEEP, + REPLACE, + INCREMENT, + DECREMENT, + INVERT, + INCREMENT_WRAP, + DECREMENT_WRAP, + } + + enum VerticalOrigin { + CENTER, + BOTTOM, + TOP, + } + + function createOpenStreetMapImageryProvider(options: { + url?: string, + fileExtension?: string, + rectangle?: Rectangle, + minimumLevel?: number, + maximumLevel?: number, + ellipsoid?: Ellipsoid, + credit?: Credit | string + }): UrlTemplateImageryProvider; + + function createTileMapServiceImageryProvider(options: { + url?: string, + fileExtension?: string, + credit?: Credit | string, + minimumLevel?: number, + maximumLevel?: number, + rectangle?: Rectangle, + tilingScheme?: TilingScheme, + ellipsoid?: Ellipsoid, + tileWidth?: number, + tileHeight?: number, + flipXY?: boolean + }): UrlTemplateImageryProvider; + + function createWorldImagery(options: { + style?: any // IonWorldImageryStyle + }): IonImageryProvider; + + function createWorldTerrain(options: { + requestVertexNormals?: boolean, + requestWaterMask?: boolean + }): CesiumTerrainProvider; + + class UrlTemplateImageryProvider extends ImageryProvider { + url: string; + pickFeaturesUrl: string; + urlSchemeZeroPadding: {}; + subdomains: string | string[]; + ellipsoid: Ellipsoid; + getFeatureInfoFormats: GetFeatureInfoFormat[]; + enablePickFeatures: boolean; + + constructor(options: { + url: string, + pickFeaturesUrl?: string, + urlSchemeZeroPadding?: {}, + subdomains?: string | string[] + proxy?: {}, + credit?: Credit | string, + minimumLevel?: number, + maximumLevel?: number, + rectangle?: Rectangle, + tilingScheme?: TilingScheme, + ellipsoid?: Ellipsoid, + tileWidth?: number, + tileHeight?: number, + hasAlphaChannel?: boolean, + getFeatureInfoFormats?: GetFeatureInfoFormat[], + enablePickFeatures?: boolean + }); + reinitialize(options: Promise | object): void; + } + + class Resource { + static DEFAULT: Resource; + static readonly isBlobSupported: boolean; + readonly extension: string; + hasHeaders: boolean; + headers: any; + isBlobUri: boolean; + isCrossOriginUrl: boolean; + isDataUri: boolean; + proxy: DefaultProxy; + readonly queryParameters: any; + request: Request; + retryAttempts: number; + retryCallback: () => void; + readonly templateValues: any; + url: string; + static delete(options?: { url: string; data?: any; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request; responseType?: string; overrideMimeType?: string }): Promise | undefined; + static fetch(options?: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request; responseType?: string; overrideMimeType?: string }): Promise | undefined; + static fetchArrayBuffer(options?: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request }): Promise | undefined; + static fetchBlob(options?: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request }): Promise | undefined; + static fetchImage(options?: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request; preferBlob?: boolean }): Promise | undefined; + static fetchJson(options?: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request }): Promise | undefined; + static fetchJsonp(options?: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request; callbackParameterName?: string }): Promise | undefined; + static fetchText(options?: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request }): Promise | undefined; + static fetchXml(options?: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request }): Promise | undefined; + static head(options?: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request; responseType?: string; overrideMimeType?: string }): Promise | undefined; + static options(options?: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request; responseType?: string; overrideMimeType?: string }): Promise | undefined; + static patch(options?: { url: string; data?: any; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request; responseType?: string; overrideMimeType?: string }): Promise | undefined; + static post(options?: { url: string; data?: any; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request; responseType?: string; overrideMimeType?: string }): Promise | undefined; + static put(options?: { url: string; data?: any; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request; responseType?: string; overrideMimeType?: string }): Promise | undefined; + constructor(options?: { url: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request }); + addQueryParameters(params: any, useAsDefault: boolean): void; + addTemplateValues(template: any, useAsDefault: boolean): void; + appendForwardSlash(): void; + appendQueryParameters(params: any): void; + clone(result: Resource): Resource; + delete(options?: { responseType?: string; headers?: any; overrideMimeType?: string }): Promise | undefined; + fetch(options?: { responseType?: string; headers?: any; overrideMimeType?: string }): Promise | undefined; + fetchArrayBuffer(): Promise | undefined; + fetchBlob(): Promise | undefined; + fetchImage(preferBlob: boolean): Promise | undefined; + fetchJson(): Promise | undefined; + fetchJsonp(callbackParameterName: string): Promise | undefined; + fetchText(): Promise | undefined; + fetchXml(): Promise | undefined; + getBaseUri(includeQuery: boolean): string; + getDerivedResource(options: {url?: string; queryParameters?: any; templateValues?: any; headers?: any; proxy?: DefaultProxy; retryCallback?: Resource.RetryCallback; + retryAttempts?: number; request?: Request; preserveQueryParameters?: boolean}): Resource; + getUrlComponent(query: boolean, proxy: boolean): string; + head(options?: {responseType?: string; headers?: any; overrideMimeType?: string}): Promise | undefined; + options(options?: { responseType?: string; headers?: any; overrideMimeType?: string }): Promise | undefined; + patch(data: any, options?: { responseType?: string; headers?: any; overrideMimeType?: string }): Promise | undefined; + post(data: any, options?: { data?: any; responseType?: string; headers?: any; overrideMimeType?: string }): Promise | undefined; + put(data: any, options?: { responseType?: string; headers?: any; overrideMimeType?: string }): Promise | undefined; + setQueryParameters(params: any, useAsDefault: boolean): void; + setTemplateValues(template: any, useAsDefault: boolean): void; + } + + namespace Resource { + type RetryCallback = (resource: Resource, error: Error) => void; + } + + function defined(value: any): boolean; + + namespace buildModuleUrl { + function setBaseUrl(value: string): undefined; + } +} diff --git a/types/cesium/tsconfig.json b/types/cesium/tsconfig.json new file mode 100644 index 0000000000..71e6b79545 --- /dev/null +++ b/types/cesium/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} diff --git a/types/cesium/tslint.json b/types/cesium/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/cesium/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 40432b21755010e3ffa0da4f7acd9092abab9810 Mon Sep 17 00:00:00 2001 From: Michael Dodge Date: Thu, 17 May 2018 16:08:03 -0600 Subject: [PATCH 04/20] Adjustments per rbuckton (https://github.com/DefinitelyTyped/DefinitelyTyped/pull/25849) --- .../axios-token-interceptor-tests.ts | 6 +-- types/axios-token-interceptor/index.d.ts | 45 +++++++++---------- 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/types/axios-token-interceptor/axios-token-interceptor-tests.ts b/types/axios-token-interceptor/axios-token-interceptor-tests.ts index 63f40c611a..036223b699 100644 --- a/types/axios-token-interceptor/axios-token-interceptor-tests.ts +++ b/types/axios-token-interceptor/axios-token-interceptor-tests.ts @@ -1,9 +1,9 @@ -import tokenProvider from 'axios-token-interceptor'; +import tokenProvider = require('axios-token-interceptor'); tokenProvider(); // $ExpectError const validOptions = { - getToken: () => Promise.resolve('qwerty'), + getToken: () => Promise.resolve('qwerty'), }; tokenProvider(validOptions); // $ExpectType TokenProvider @@ -11,7 +11,7 @@ tokenCache(); // $ExpectError const getToken = Promise.resolve('qwerty'); const validCacheOptions = { - maxAge: 3600, + maxAge: 3600, }; const cache = tokenProvider.tokenCache(getToken, validCacheOptions); // $Expect TokenCache diff --git a/types/axios-token-interceptor/index.d.ts b/types/axios-token-interceptor/index.d.ts index c2bcd259d2..85121f8165 100644 --- a/types/axios-token-interceptor/index.d.ts +++ b/types/axios-token-interceptor/index.d.ts @@ -6,28 +6,27 @@ import { AxiosRequestConfig } from 'axios'; // Module -export function AxiosTokenProvider(Options: InterceptorOptions): TokenProvider; -export namespace AxiosTokenProvider { +declare function AxiosTokenProvider(Options: AxiosTokenProvider.InterceptorOptions): AxiosTokenProvider.TokenProvider; +declare namespace AxiosTokenProvider { function tokenCache(getToken: Promise, options: TokenCacheOptions): TokenCache; + + // Interfaces + interface InterceptorOptions { + token?: string; + getToken?: () => string | Promise; + header?: string; + headerFormatter?: (token: string) => string; + } + + type TokenProvider = (config: AxiosRequestConfig) => Promise; + + interface TokenCacheOptions { + getMaxAge?: () => number; + maxAge?: number; + } + + interface TokenCache { + reset(): void; + } } -export default AxiosTokenProvider; - -// Interfaces - -export interface InterceptorOptions { - token?: string; - getToken?: () => string | Promise; - header?: string; - headerFormatter?: (token: string) => string; -} - -export type TokenProvider = (config: AxiosRequestConfig) => Promise; - -export interface TokenCacheOptions { - getMaxAge?: () => number; - maxAge?: number; -} - -export interface TokenCache { - reset(): void; -} +export = AxiosTokenProvider; From 5760bb169b56c8bf8333bf219ee442c6bf995d16 Mon Sep 17 00:00:00 2001 From: Jared Szechy Date: Tue, 22 May 2018 10:13:41 -0400 Subject: [PATCH 05/20] [cesium] add global test --- types/cesium/test/cesium-global.test.ts | 48 +++++++++++++++++++++++++ types/cesium/tsconfig.json | 3 +- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 types/cesium/test/cesium-global.test.ts diff --git a/types/cesium/test/cesium-global.test.ts b/types/cesium/test/cesium-global.test.ts new file mode 100644 index 0000000000..8974e56542 --- /dev/null +++ b/types/cesium/test/cesium-global.test.ts @@ -0,0 +1,48 @@ +Cesium.buildModuleUrl.setBaseUrl('/assets/cesium/'); + +const viewer = new Cesium.Viewer('#cesium', { + sceneMode: Cesium.SceneMode.COLUMBUS_VIEW, + imageryProvider: new Cesium.IonImageryProvider({ assetId: 3845 }), + baseLayerPicker: false, + geocoder: false, +}); + +const midnight = Cesium.JulianDate.fromDate(new Date(2018, 5, 14)); +const prop = new Cesium.SampledPositionProperty(); + +const pos = Cesium.Cartesian3.fromDegrees(1, 2, 3); +const time = Cesium.JulianDate.addSeconds(midnight, 12345, new Cesium.JulianDate()); +prop.addSample(time, pos); +viewer.entities.add(new Cesium.Entity({ + position: pos, + point: new Cesium.PointGraphics({ + color: Cesium.Color.fromCssColorString('#123123'), + pixelSize: 2 + }) +})); + +const objStart = Cesium.JulianDate.addSeconds(midnight, 12340, new Cesium.JulianDate()); +const objStop = Cesium.JulianDate.addSeconds(midnight, 12350, new Cesium.JulianDate()); + +const entity = new Cesium.Entity({ + name: 'TEST', + availability: new Cesium.TimeIntervalCollection([ + new Cesium.TimeInterval({ + start: objStart, + stop: objStop + }) + ]), + position: prop, + orientation: new Cesium.VelocityOrientationProperty(prop), + path: new Cesium.PathGraphics({ + resolution: 5, + width: 3, + material: new Cesium.ColorMaterialProperty(Cesium.Color.fromCssColorString('#223344')), + leadTime: 0 + }), + model: new Cesium.ModelGraphics({ + uri: 'http://assets.agi.com/models/rv1.gltf', + minimumPixelSize: 48 + }) +}); +viewer.entities.add(entity); diff --git a/types/cesium/tsconfig.json b/types/cesium/tsconfig.json index 71e6b79545..e8c231d442 100644 --- a/types/cesium/tsconfig.json +++ b/types/cesium/tsconfig.json @@ -18,6 +18,7 @@ "forceConsistentCasingInFileNames": true }, "files": [ - "index.d.ts" + "index.d.ts", + "test/cesium-global.test.ts" ] } From dd5fb06f5ad73a8ffdecd7bb6c442fcb6c4e349d Mon Sep 17 00:00:00 2001 From: Jared Szechy Date: Wed, 23 May 2018 08:45:12 -0400 Subject: [PATCH 06/20] [cesium] add module support --- types/cesium/index.d.ts | 3 ++ types/cesium/test/cesium-module.test.ts | 50 +++++++++++++++++++++++++ types/cesium/tsconfig.json | 3 +- 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 types/cesium/test/cesium-module.test.ts diff --git a/types/cesium/index.d.ts b/types/cesium/index.d.ts index 08bc2706d7..8e2f929c83 100644 --- a/types/cesium/index.d.ts +++ b/types/cesium/index.d.ts @@ -6,6 +6,9 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 +export = Cesium; +export as namespace Cesium; + declare namespace Cesium { type RenderState = any; diff --git a/types/cesium/test/cesium-module.test.ts b/types/cesium/test/cesium-module.test.ts new file mode 100644 index 0000000000..726daf7df2 --- /dev/null +++ b/types/cesium/test/cesium-module.test.ts @@ -0,0 +1,50 @@ +import * as Cesium from 'cesium'; + +Cesium.buildModuleUrl.setBaseUrl('/assets/cesium/'); + +const viewer = new Cesium.Viewer('#cesium', { + sceneMode: Cesium.SceneMode.COLUMBUS_VIEW, + imageryProvider: new Cesium.IonImageryProvider({ assetId: 3845 }), + baseLayerPicker: false, + geocoder: false, +}); + +const midnight = Cesium.JulianDate.fromDate(new Date(2018, 5, 14)); +const prop = new Cesium.SampledPositionProperty(); + +const pos = Cesium.Cartesian3.fromDegrees(1, 2, 3); +const time = Cesium.JulianDate.addSeconds(midnight, 12345, new Cesium.JulianDate()); +prop.addSample(time, pos); +viewer.entities.add(new Cesium.Entity({ + position: pos, + point: new Cesium.PointGraphics({ + color: Cesium.Color.fromCssColorString('#123123'), + pixelSize: 2 + }) +})); + +const objStart = Cesium.JulianDate.addSeconds(midnight, 12340, new Cesium.JulianDate()); +const objStop = Cesium.JulianDate.addSeconds(midnight, 12350, new Cesium.JulianDate()); + +const entity = new Cesium.Entity({ + name: 'TEST', + availability: new Cesium.TimeIntervalCollection([ + new Cesium.TimeInterval({ + start: objStart, + stop: objStop + }) + ]), + position: prop, + orientation: new Cesium.VelocityOrientationProperty(prop), + path: new Cesium.PathGraphics({ + resolution: 5, + width: 3, + material: new Cesium.ColorMaterialProperty(Cesium.Color.fromCssColorString('#223344')), + leadTime: 0 + }), + model: new Cesium.ModelGraphics({ + uri: 'http://assets.agi.com/models/rv1.gltf', + minimumPixelSize: 48 + }) +}); +viewer.entities.add(entity); diff --git a/types/cesium/tsconfig.json b/types/cesium/tsconfig.json index e8c231d442..e82d8ca16a 100644 --- a/types/cesium/tsconfig.json +++ b/types/cesium/tsconfig.json @@ -19,6 +19,7 @@ }, "files": [ "index.d.ts", - "test/cesium-global.test.ts" + "test/cesium-global.test.ts", + "test/cesium-module.test.ts" ] } From 2ad5fa0077d46d0d7148e0434a4502dcc4c72bcc Mon Sep 17 00:00:00 2001 From: Jared Szechy Date: Wed, 23 May 2018 09:49:17 -0400 Subject: [PATCH 07/20] [cesium] update linting config --- types/cesium/index.d.ts | 1 + types/cesium/tslint.json | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/types/cesium/index.d.ts b/types/cesium/index.d.ts index 8e2f929c83..21b80f7d05 100644 --- a/types/cesium/index.d.ts +++ b/types/cesium/index.d.ts @@ -6,6 +6,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 +// tslint:disable-next-line:export-just-namespace export = Cesium; export as namespace Cesium; diff --git a/types/cesium/tslint.json b/types/cesium/tslint.json index 3db14f85ea..4c4fc86ace 100644 --- a/types/cesium/tslint.json +++ b/types/cesium/tslint.json @@ -1 +1,6 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + "strict-export-declare-modifiers": false + } +} From 8c14e0808a942badfa59919724a070867ffa0e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Sm=C3=B3=C5=82ka?= Date: Thu, 24 May 2018 10:41:22 +0200 Subject: [PATCH 08/20] kendo-ui: CalendarOptions footer accepts boolean as well --- types/kendo-ui/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/kendo-ui/index.d.ts b/types/kendo-ui/index.d.ts index b854d92b29..5da967f60b 100644 --- a/types/kendo-ui/index.d.ts +++ b/types/kendo-ui/index.d.ts @@ -1848,7 +1848,7 @@ declare namespace kendo.ui { dates?: any; depth?: string; disableDates?: any|Function; - footer?: string|Function; + footer?: boolean|string|Function; format?: string; max?: Date; messages?: CalendarMessages; From 52e08c103853dd49fd77694e799189fd4058b8d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Sm=C3=B3=C5=82ka?= Date: Thu, 24 May 2018 08:54:55 +0200 Subject: [PATCH 09/20] kendo-ui gridoptions should allow string as well. #25123 Based on docs: Can be set to a string ("inline", "incell" or "popup") to specify the editing mode. --- types/kendo-ui/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/kendo-ui/index.d.ts b/types/kendo-ui/index.d.ts index b854d92b29..95f6d5c6a0 100644 --- a/types/kendo-ui/index.d.ts +++ b/types/kendo-ui/index.d.ts @@ -4046,7 +4046,7 @@ declare namespace kendo.ui { columnMenu?: boolean | GridColumnMenu; dataSource?: any|any|kendo.data.DataSource; detailTemplate?: string|Function; - editable?: boolean | GridEditable; + editable?: boolean | string | GridEditable; excel?: GridExcel; filterable?: boolean | GridFilterable; groupable?: boolean | GridGroupable; From bfea1b206873a901431feabfe193b06f4b17f422 Mon Sep 17 00:00:00 2001 From: Piotr Roszatycki Date: Sat, 2 Jun 2018 12:40:32 +0200 Subject: [PATCH 10/20] New attributes for SMTPServerSession and SMTPServerOptions --- types/smtp-server/index.d.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/types/smtp-server/index.d.ts b/types/smtp-server/index.d.ts index bbcee547e6..d7e25dd342 100644 --- a/types/smtp-server/index.d.ts +++ b/types/smtp-server/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for smtp-server 3.3 +// Type definitions for smtp-server 3.4 // Project: https://github.com/nodemailer/smtp-server // Definitions by: markisme // taisiias @@ -72,11 +72,19 @@ export interface SMTPServerSession { */ id: string; /** - * the IP address for the connected client + * local IP address for the connected client + */ + localAddress: string; + /** + * local port number for the connected client + */ + localPort: number; + /** + * remote IP address for the connected client */ remoteAddress: string; /** - * port number the connected client + * remote port number for the connected client */ remotePort: number; /** @@ -126,6 +134,8 @@ export interface SMTPServerOptions extends tls.TlsOptions { * createServer can be added directly onto this options object. */ secure?: boolean; + /** indicate an TLS server where TLS is handled upstream */ + secured?: boolean; /** optional private keys in PEM format */ key?: string | string[] | Buffer | Buffer[] | Array<{ pem: string | Buffer, passphrase: string }>; /** optional cert chains in PEM format */ From 529312a91e089e287d5de9adeef35b74c7f23d84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Magrin?= Date: Sat, 2 Jun 2018 12:51:10 +0200 Subject: [PATCH 11/20] Fix subfolder error --- types/react-navigation/index.d.ts | 497 +++++++++++------- .../react-navigation-tests.tsx | 41 +- types/react-navigation/tsconfig.json | 14 +- types/react-navigation/tslint.json | 8 +- types/react-navigation/{v2 => v1}/index.d.ts | 497 +++++++----------- .../{v2 => v1}/react-navigation-tests.tsx | 41 +- .../react-navigation/{v2 => v1}/tsconfig.json | 14 +- types/react-navigation/v1/tslint.json | 1 + types/react-navigation/v2/tslint.json | 7 - 9 files changed, 560 insertions(+), 560 deletions(-) rename types/react-navigation/{v2 => v1}/index.d.ts (67%) rename types/react-navigation/{v2 => v1}/react-navigation-tests.tsx (93%) rename types/react-navigation/{v2 => v1}/tsconfig.json (65%) create mode 100644 types/react-navigation/v1/tslint.json delete mode 100644 types/react-navigation/v2/tslint.json diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 1233ca39e3..561558d540 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-navigation 1.5 +// Type definitions for react-navigation 2.0 // Project: https://github.com/react-navigation/react-navigation // Definitions by: Huhuanming // mhcgrq @@ -16,11 +16,12 @@ // Armando Assuncao // Ciaran Liedeman // Edward Sammut Alessi +// Jérémy Magrin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 /** - * Reference: https://github.com/react-navigation/react-navigation/tree/3f3ef6485c8932f49fddc3dd2c508629110bf2b6 + * Reference: https://github.com/react-navigation/react-navigation/tree/a37473c5e4833f48796ee6c7c9cb4a8ac49d9c06 * * NOTE: Please update the commit/link above when updating to a new Flow * react-navigation/flow/react-navigation.js reference, so we can conveniently just look at diffs on @@ -43,15 +44,24 @@ export type AnimatedValue = any; export type HeaderMode = 'float' | 'screen' | 'none'; +export interface HeaderForceInset { + horizontal?: string; + vertical?: string; + left?: string; + right?: string; + top?: string; + bottom?: string; +} + export interface HeaderProps extends NavigationSceneRendererProps { mode: HeaderMode; - router: NavigationRouter< - NavigationState, - NavigationStackScreenOptions - >; - getScreenDetails: (navigationScene: NavigationScene) => NavigationScreenDetails< - NavigationStackScreenOptions - >; + router: NavigationRouter; + getScreenDetails: ( + navigationScene: NavigationScene + ) => NavigationScreenDetails; + leftInterpolator: (props: NavigationSceneRendererProps) => {}; + titleInterpolator: (props: NavigationSceneRendererProps) => {}; + rightInterpolator: (props: NavigationSceneRendererProps) => {}; style: StyleProp; } @@ -73,12 +83,14 @@ export interface NavigationState { * Index refers to the active child route in the routes array. */ index: number; - routes: any[]; + routes: NavigationRoute[]; } -export type NavigationRoute = NavigationLeafRoute | NavigationStateRoute; +export type NavigationRoute = + | NavigationLeafRoute + | NavigationStateRoute; -export interface NavigationLeafRoute { +export interface NavigationLeafRoute { /** * React's key used by some navigators. No need to specify these manually, * they will be defined by the router. @@ -100,7 +112,9 @@ export interface NavigationLeafRoute { params?: Params; } -export type NavigationStateRoute = NavigationLeafRoute & NavigationState; +export type NavigationStateRoute< + NavigationLeafRouteParams + > = NavigationLeafRoute & NavigationState; export type NavigationScreenOptionsGetter = ( navigation: NavigationScreenProp>, @@ -113,7 +127,10 @@ export interface NavigationRouter { * an optional previous state. When the action is considered handled but the * state is unchanged, the output state is null. */ - getStateForAction: (action: NavigationAction, lastState?: State) => (State | null); + getStateForAction: ( + action: NavigationAction, + lastState?: State + ) => State | null; /** * Maps a URI-like string to an action. This can be mapped to a state @@ -122,14 +139,14 @@ export interface NavigationRouter { getActionForPathAndParams: ( path: string, params?: NavigationParams - ) => (NavigationAction | null); + ) => NavigationAction | null; getPathAndParamsForState: ( state: State ) => { - path: string, - params?: NavigationParams, - }; + path: string; + params?: NavigationParams; + }; getComponentForRouteName: (routeName: string) => NavigationComponent; @@ -147,11 +164,8 @@ export interface NavigationRouter { } export type NavigationScreenOption = - T - | (( - navigation: NavigationScreenProp, - config: T - ) => T); + | T + | ((navigation: NavigationScreenProp, config: T) => T); export interface NavigationScreenDetails { options: T; @@ -159,7 +173,9 @@ export interface NavigationScreenDetails { navigation: NavigationScreenProp; } -export type NavigationScreenOptions = NavigationStackScreenOptions & NavigationTabScreenOptions & NavigationDrawerScreenOptions; +export type NavigationScreenOptions = NavigationStackScreenOptions & + NavigationTabScreenOptions & + NavigationDrawerScreenOptions; export interface NavigationScreenConfigProps { navigation: NavigationScreenProp; @@ -167,30 +183,34 @@ export interface NavigationScreenConfigProps { } export type NavigationScreenConfig = - Options - | ((navigationOptionsContainer: NavigationScreenConfigProps & { - navigationOptions: NavigationScreenProp, - }) => Options); + | Options + | (( + navigationOptionsContainer: NavigationScreenConfigProps & { + navigationOptions: NavigationScreenProp; + } + ) => Options); export type NavigationComponent = - NavigationScreenComponent - | NavigationNavigator; + | NavigationScreenComponent + | NavigationNavigator + | any; export type NavigationScreenComponent< - Params = NavigationParams, - Options = {}, - Props = {} -> = React.ComponentType & Props> & -{ navigationOptions?: NavigationScreenConfig }; + Params = NavigationParams, + Options = {}, + Props = {} + > = React.ComponentType & Props> & { + navigationOptions?: NavigationScreenConfig; + }; export type NavigationNavigator< - State = NavigationState, - Options = {}, - Props = {} -> = React.ComponentType & Props> & { - router: NavigationRouter, - navigationOptions?: NavigationScreenConfig, -}; + State = NavigationState, + Options = {}, + Props = {} + > = React.ComponentType & Props> & { + router: NavigationRouter; + navigationOptions?: NavigationScreenConfig; + }; export interface NavigationParams { [key: string]: any; @@ -206,7 +226,8 @@ export interface NavigationNavigateActionPayload { key?: string; } -export interface NavigationNavigateAction extends NavigationNavigateActionPayload { +export interface NavigationNavigateAction + extends NavigationNavigateActionPayload { type: 'Navigation/NAVIGATE'; } @@ -226,7 +247,8 @@ export interface NavigationSetParamsActionPayload { params?: NavigationParams; } -export interface NavigationSetParamsAction extends NavigationSetParamsActionPayload { +export interface NavigationSetParamsAction + extends NavigationSetParamsActionPayload { type: 'Navigation/SET_PARAMS'; } @@ -271,40 +293,70 @@ export interface NavigationPopToTopActionPayload { immediate?: boolean; } -export interface NavigationPopToTopAction extends NavigationPopToTopActionPayload { +export interface NavigationPopToTopAction + extends NavigationPopToTopActionPayload { type: 'Navigation/POP_TO_TOP'; } export interface NavigationStackViewConfig { mode?: 'card' | 'modal'; headerMode?: HeaderMode; + headerTransitionPreset?: 'fade-in-place' | 'uikit'; cardStyle?: StyleProp; transitionConfig?: ( transitionProps: NavigationTransitionProps, prevTransitionProps: NavigationTransitionProps, - isModal: boolean, + isModal: boolean ) => TransitionConfig; - onTransitionStart?: (transitionProps: NavigationTransitionProps, prevTransitionProps?: NavigationTransitionProps) => Promise | void; - onTransitionEnd?: (transitionProps: NavigationTransitionProps, prevTransitionProps?: NavigationTransitionProps) => void; + onTransitionStart?: ( + transitionProps: NavigationTransitionProps, + prevTransitionProps?: NavigationTransitionProps + ) => Promise | void; + onTransitionEnd?: ( + transitionProps: NavigationTransitionProps, + prevTransitionProps?: NavigationTransitionProps + ) => void; +} + +/** + * Switch Navigator + */ + +export interface NavigationSwitchRouterConfig { + initialRouteName?: string; + initialRouteParams?: NavigationParams; + paths?: NavigationPathsConfig; + navigationOptions?: NavigationScreenConfig; + order?: string[]; + backBehavior?: 'none' | 'initialRoute'; // defaults to `'none'` + resetOnBlur?: boolean; // defaults to `true` } export interface NavigationStackScreenOptions { title?: string; - header?: (React.ReactElement | ((headerProps: HeaderProps) => React.ReactElement)) | null; + header?: + | ( + | React.ReactElement + | ((headerProps: HeaderProps) => React.ReactElement)) + | null; headerTransparent?: boolean; headerTitle?: string | React.ReactElement; headerTitleStyle?: StyleProp; + headerTitleAllowFontScaling?: boolean; headerTintColor?: string; headerLeft?: React.ReactElement; headerBackTitle?: string | null; + headerBackImage?: React.ReactElement; headerTruncatedBackTitle?: string; headerBackTitleStyle?: StyleProp; headerPressColorAndroid?: string; headerRight?: React.ReactElement; headerStyle?: StyleProp; + headerForceInset?: HeaderForceInset; headerBackground?: React.ReactNode | React.ReactType; gesturesEnabled?: boolean; gestureResponseDistance?: { vertical?: number; horizontal?: number }; + gestureDirection?: 'default' | 'inverted'; } export interface NavigationStackRouterConfig { @@ -317,7 +369,7 @@ export interface NavigationStackRouterConfig { } export type NavigationStackAction = - NavigationInitAction + | NavigationInitAction | NavigationNavigateAction | NavigationBackAction | NavigationSetParamsAction @@ -326,25 +378,30 @@ export type NavigationStackAction = | NavigationPopToTopAction; export type NavigationTabAction = - NavigationInitAction + | NavigationInitAction | NavigationNavigateAction | NavigationBackAction; export type NavigationAction = - NavigationInitAction + | NavigationInitAction | NavigationStackAction | NavigationTabAction; -export type NavigationRouteConfig = NavigationComponent | ({ - navigationOptions?: NavigationScreenConfig, - path?: string, -} & NavigationScreenRouteConfig); +export type NavigationRouteConfig = + | NavigationComponent + | ({ + navigationOptions?: NavigationScreenConfig; + path?: string; + } & NavigationScreenRouteConfig); -export type NavigationScreenRouteConfig = NavigationComponent | { - screen: NavigationComponent, -} | { - getScreen: () => NavigationComponent, -}; +export type NavigationScreenRouteConfig = + | NavigationComponent + | { + screen: NavigationComponent; + } + | { + getScreen: () => NavigationComponent; + }; export interface NavigationPathsConfig { [routeName: string]: string; @@ -352,6 +409,7 @@ export interface NavigationPathsConfig { export interface NavigationTabRouterConfig { initialRouteName?: string; + initialRouteParams?: NavigationParams; paths?: NavigationPathsConfig; navigationOptions?: NavigationScreenConfig; order?: string[]; // todo: type these as the real route names rather than 'string' @@ -360,45 +418,48 @@ export interface NavigationTabRouterConfig { backBehavior?: 'none' | 'initialRoute'; // defaults `initialRoute` } export interface TabScene { - route: NavigationRoute; - focused: boolean; - index: number; - tintColor?: string; + route: NavigationRoute; + focused: boolean; + index: number; + tintColor?: string; } export interface NavigationTabScreenOptions { title?: string; tabBarIcon?: - React.ReactElement - | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< - any - > | null)); + | React.ReactElement + | (( + options: { tintColor: string | null; focused: boolean } + ) => React.ReactElement | null); tabBarLabel?: - string - | React.ReactElement - | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< - any - > | string | null)); + | string + | React.ReactElement + | (( + options: { tintColor: string | null; focused: boolean } + ) => React.ReactElement | string | null); tabBarVisible?: boolean; - tabBarTestIDProps?: { testID?: string, accessibilityLabel?: string }; - tabBarOnPress?: (options: { - scene: TabScene, - jumpToIndex: (index: number) => void - }) => void; + tabBarTestIDProps?: { testID?: string; accessibilityLabel?: string }; + tabBarOnPress?: ( + options: { + scene: TabScene; + jumpToIndex: (index: number) => void; + } + ) => void; } export interface NavigationDrawerScreenOptions { title?: string; drawerIcon?: - React.ReactElement - | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< - any - > | null)); + | React.ReactElement + | (( + options: { tintColor: string | null; focused: boolean } + ) => React.ReactElement | null); drawerLabel?: - string - | React.ReactElement - | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< - any - > | null)); + | string + | React.ReactElement + | (( + options: { tintColor: string | null; focused: boolean } + ) => React.ReactElement | null); + drawerLockMode?: 'unlocked' | 'locked-closed' | 'locked-open'; } export interface NavigationRouteConfigMap { @@ -413,22 +474,20 @@ export interface NavigationProp { } export type EventType = -| 'willFocus' -| 'didFocus' -| 'willBlur' -| 'didBlur' -| 'action'; + | 'willFocus' + | 'didFocus' + | 'willBlur' + | 'didBlur' + | 'action'; export interface NavigationEventPayload { type: EventType; action: NavigationAction; state: NavigationState; - lastState: NavigationState; + lastState: NavigationState | null | undefined; } -export type NavigationEventCallback = ( - payload: NavigationEventPayload -) => void; +export type NavigationEventCallback = (payload: NavigationEventPayload) => void; export interface NavigationEventSubscription { remove: () => void; @@ -438,8 +497,14 @@ export interface NavigationScreenProp { state: S; dispatch: NavigationDispatch; goBack: (routeKey?: string | null) => boolean; + dismiss: () => boolean; navigate(options: { - routeName: string; + routeName: string | { + routeName: string; + params?: NavigationParams; + action?: NavigationNavigateAction; + key?: string; + }; params?: NavigationParams; action?: NavigationAction; key?: string; @@ -447,8 +512,11 @@ export interface NavigationScreenProp { navigate( routeNameOrOptions: string, params?: NavigationParams, - action?: NavigationAction, + action?: NavigationAction ): boolean; + openDrawer: () => any; + closeDrawer: () => any; + toggleDrawer: () => any; getParam: (param: T, fallback?: P[T]) => P[T]; setParams: (newParams: P) => boolean; addListener: ( @@ -467,6 +535,7 @@ export interface NavigationScreenProp { ) => boolean; pop: (n?: number, params?: { immediate?: boolean }) => boolean; popToTop: (params?: { immediate?: boolean }) => boolean; + isFocused: () => boolean; } export interface NavigationNavigatorProps { @@ -550,6 +619,14 @@ export interface TransitionConfig { // How to animate position and opacity of the screen // based on the value generated by the transitionSpec screenInterpolator?: (props: NavigationSceneRendererProps) => any; + // How to animate position and opacity of the header componetns + // based on the value generated by the transitionSpec + headerLeftInterpolator?: (props: NavigationSceneRendererProps) => any; + headerTitleInterpolator?: (props: NavigationSceneRendererProps) => any; + headerRightInterpolator?: (props: NavigationSceneRendererProps) => any; + // The style of the container. Useful when a scene doesn't have + // 100% opacity and the underlying container is visible. + containerStyle?: StyleProp; } export type NavigationAnimationSetter = ( @@ -558,7 +635,7 @@ export type NavigationAnimationSetter = ( lastState: NavigationState ) => void; -export type NavigationSceneRenderer = () => (React.ReactElement | null); +export type NavigationSceneRenderer = () => React.ReactElement | null; export type NavigationStyleInterpolator = ( props: NavigationSceneRendererProps @@ -567,50 +644,49 @@ export type NavigationStyleInterpolator = ( export interface LayoutEvent { nativeEvent: { layout: { - x: number, - y: number, - width: number, - height: number, - }, + x: number; + y: number; + width: number; + height: number; + }; }; } export type NavigatorType = -| 'react-navigation/STACK' -| 'react-navigation/TABS' -| 'react-navigation/DRAWER'; + | 'react-navigation/STACK' + | 'react-navigation/TABS' + | 'react-navigation/DRAWER'; -export function addNavigationHelpers( - navigation: { - state: S; - dispatch: (action: NavigationAction) => any; - addListener?: ( - eventName: string, - callback: NavigationEventCallback - ) => NavigationEventSubscription; - } -): NavigationScreenProp; - -export interface NavigationContainerProps { +export interface NavigationContainerProps { uriPrefix?: string | RegExp; onNavigationStateChange?: ( prevNavigationState: NavigationState, nextNavigationState: NavigationState, - action: NavigationAction, - ) => void; + action: NavigationAction + ) => void | null | undefined; + navigation?: NavigationScreenProp; + persistenceKey?: string | null; + renderLoadingExperimental?: React.ComponentType; + screenProps?: any; + navigationOptions?: O; style?: StyleProp; } -export interface NavigationContainerComponent extends React.Component< +export interface NavigationContainerComponent + extends React.Component< NavigationContainerProps & NavigationNavigatorProps > { dispatch: NavigationDispatch; } -export interface NavigationContainer extends React.ComponentClass< +export interface NavigationContainer + extends React.ComponentClass< NavigationContainerProps & NavigationNavigatorProps > { - new(props: NavigationContainerProps & NavigationNavigatorProps, context?: any): NavigationContainerComponent; + new( + props: NavigationContainerProps & NavigationNavigatorProps, + context?: any + ): NavigationContainerComponent; router: NavigationRouter; screenProps: { [key: string]: any }; @@ -618,14 +694,21 @@ export interface NavigationContainer extends React.ComponentClass< state: { nav: NavigationState | null }; } -export interface StackNavigatorConfig extends NavigationStackViewConfig, NavigationStackRouterConfig { +export interface StackNavigatorConfig + extends NavigationStackViewConfig, + NavigationStackRouterConfig { containerOptions?: any; } // Return createNavigationContainer export function StackNavigator( routeConfigMap: NavigationRouteConfigMap, - stackConfig?: StackNavigatorConfig, + stackConfig?: StackNavigatorConfig +): NavigationContainer; + +export function createStackNavigator( + routeConfigMap: NavigationRouteConfigMap, + stackConfig?: StackNavigatorConfig ): NavigationContainer; export interface SwitchNavigatorConfig { @@ -636,11 +719,18 @@ export interface SwitchNavigatorConfig { } // Return createNavigationContainer +export type _SwitchNavigatorConfig = NavigationSwitchRouterConfig; + export function SwitchNavigator( routeConfigMap: NavigationRouteConfigMap, switchConfig?: SwitchNavigatorConfig ): NavigationContainer; +export function createSwitchNavigator( + routeConfigMap: NavigationRouteConfigMap, + switchConfig?: SwitchNavigatorConfig +): NavigationContainer; + // DrawerItems export const DrawerItems: React.ReactType; @@ -655,21 +745,28 @@ export interface DrawerViewConfig { contentOptions?: any; style?: StyleProp; } -export interface DrawerNavigatorConfig extends NavigationTabRouterConfig, DrawerViewConfig { +export interface DrawerNavigatorConfig + extends NavigationTabRouterConfig, + DrawerViewConfig { containerConfig?: any; contentOptions?: { - activeTintColor?: string, - activeBackgroundColor?: string, - inactiveTintColor?: string, - inactiveBackgroundColor?: string, - style?: StyleProp, - labelStyle?: StyleProp, + activeTintColor?: string; + activeBackgroundColor?: string; + inactiveTintColor?: string; + inactiveBackgroundColor?: string; + style?: StyleProp; + labelStyle?: StyleProp; }; } export function DrawerNavigator( routeConfigMap: NavigationRouteConfigMap, - drawerConfig?: DrawerNavigatorConfig, + drawerConfig?: DrawerNavigatorConfig +): NavigationContainer; + +export function createDrawerNavigator( + routeConfigMap: NavigationRouteConfigMap, + drawerConfig?: DrawerNavigatorConfig ): NavigationContainer; /** @@ -681,23 +778,23 @@ export interface TabViewConfig { tabBarComponent?: React.ReactType; tabBarPosition?: 'top' | 'bottom'; tabBarOptions?: { - activeTintColor?: string, - allowFontScaling?: boolean, - activeBackgroundColor?: string, - inactiveTintColor?: string, - inactiveBackgroundColor?: string, - showLabel?: boolean, - style?: StyleProp, - labelStyle?: StyleProp, - iconStyle?: StyleProp, + activeTintColor?: string; + allowFontScaling?: boolean; + activeBackgroundColor?: string; + inactiveTintColor?: string; + inactiveBackgroundColor?: string; + showLabel?: boolean; + style?: StyleProp; + labelStyle?: StyleProp; + iconStyle?: StyleProp; // Top - showIcon?: boolean, - upperCaseLabel?: boolean, - pressColor?: string, - pressOpacity?: number, - scrollEnabled?: boolean, - tabStyle?: StyleProp, - indicatorStyle?: StyleProp, + showIcon?: boolean; + upperCaseLabel?: boolean; + pressColor?: string; + pressOpacity?: number; + scrollEnabled?: boolean; + tabStyle?: StyleProp; + indicatorStyle?: StyleProp; }; swipeEnabled?: boolean; animationEnabled?: boolean; @@ -705,16 +802,33 @@ export interface TabViewConfig { } // From navigators/TabNavigator.js -export interface TabNavigatorConfig extends NavigationTabRouterConfig, TabViewConfig { +export interface TabNavigatorConfig + extends NavigationTabRouterConfig, + TabViewConfig { lazy?: boolean; removeClippedSubviews?: boolean; - initialLayout?: { height: number, width: number }; + initialLayout?: { height: number; width: number }; } // From navigators/TabNavigator.js export function TabNavigator( routeConfigMap: NavigationRouteConfigMap, - drawConfig?: TabNavigatorConfig, + drawConfig?: TabNavigatorConfig +): NavigationContainer; + +export function createTabNavigator( + routeConfigMap: NavigationRouteConfigMap, + drawConfig?: TabNavigatorConfig +): NavigationContainer; + +export function createBottomTabNavigator( + routeConfigMap: NavigationRouteConfigMap, + drawConfig?: TabNavigatorConfig +): NavigationContainer; + +export function createMaterialTopNavigator( + routeConfigMap: NavigationRouteConfigMap, + drawConfig?: TabNavigatorConfig ): NavigationContainer; export interface TabBarTopProps { @@ -729,15 +843,17 @@ export interface TabBarTopProps { tabBarPosition: string; navigation: NavigationScreenProp; jumpToIndex: (index: number) => void; - getLabel: (scene: TabScene) => (React.ReactNode | string); + getLabel: (scene: TabScene) => React.ReactNode | string; getOnPress: ( previousScene: NavigationRoute, scene: TabScene - ) => (args: { - previousScene: NavigationRoute, - scene: TabScene, - jumpToIndex: (index: number) => void, - }) => void; + ) => ( + args: { + previousScene: NavigationRoute; + scene: TabScene; + jumpToIndex: (index: number) => void; + } + ) => void; renderIcon: (scene: TabScene) => React.ReactElement; labelStyle?: TextStyle; iconStyle?: ViewStyle; @@ -754,15 +870,17 @@ export interface TabBarBottomProps { position: AnimatedValue; navigation: NavigationScreenProp; jumpToIndex: (index: number) => void; - getLabel: (scene: TabScene) => (React.ReactNode | string); + getLabel: (scene: TabScene) => React.ReactNode | string; getOnPress: ( previousScene: NavigationRoute, scene: TabScene - ) => (args: { - previousScene: NavigationRoute, - scene: TabScene, - jumpToIndex: (index: number) => void, - }) => void; + ) => ( + args: { + previousScene: NavigationRoute; + scene: TabScene; + jumpToIndex: (index: number) => void; + } + ) => void; getTestIDProps: (scene: TabScene) => (scene: TabScene) => any; renderIcon: (scene: TabScene) => React.ReactNode; style?: ViewStyle; @@ -789,12 +907,18 @@ export namespace NavigationActions { const POP_TO_TOP: 'Navigation/POP_TO_TOP'; function init(options?: NavigationInitActionPayload): NavigationInitAction; - function navigate(options: NavigationNavigateActionPayload): NavigationNavigateAction; + function navigate( + options: NavigationNavigateActionPayload + ): NavigationNavigateAction; function reset(options: NavigationResetActionPayload): NavigationResetAction; function back(options?: NavigationBackActionPayload): NavigationBackAction; - function setParams(options: NavigationSetParamsActionPayload): NavigationSetParamsAction; + function setParams( + options: NavigationSetParamsActionPayload + ): NavigationSetParamsAction; function pop(options: NavigationPopActionPayload): NavigationPopAction; - function popToTop(options: NavigationPopToTopActionPayload): NavigationPopToTopAction; + function popToTop( + options: NavigationPopToTopActionPayload + ): NavigationPopToTopAction; } /** @@ -807,8 +931,14 @@ export interface TransitionerProps { prevTransitionProps?: NavigationTransitionProps ) => NavigationTransitionSpec; navigation: NavigationScreenProp; - onTransitionStart?: (transitionProps: NavigationTransitionProps, prevTransitionProps?: NavigationTransitionProps) => Promise | void; - onTransitionEnd?: (transitionProps: NavigationTransitionProps, prevTransitionProps?: NavigationTransitionProps) => void; + onTransitionStart?: ( + transitionProps: NavigationTransitionProps, + prevTransitionProps?: NavigationTransitionProps + ) => Promise | void; + onTransitionEnd?: ( + transitionProps: NavigationTransitionProps, + prevTransitionProps?: NavigationTransitionProps + ) => void; render: ( transitionProps: NavigationTransitionProps, prevTransitionProps?: NavigationTransitionProps @@ -826,7 +956,7 @@ export interface TransitionerState { export class Transitioner extends React.Component< TransitionerProps, TransitionerState -> { } + > { } /** * Tab Router @@ -853,12 +983,23 @@ export function StackRouter( * * @see https://github.com/react-navigation/react-navigation/blob/master/src/navigators/createNavigator.js */ -export function createNavigator( +export interface NavigationDescriptor { + key: string; + state: NavigationLeafRoute | NavigationStateRoute; + navigation: NavigationScreenProp; + getComponent: () => React.ComponentType; +} + +export type NavigationView = React.ComponentType<{ + descriptors: { [key: string]: NavigationDescriptor }; +} & NavigationInjectedProps>; + +export function createNavigator( + view: NavigationView, router: NavigationRouter, - routeConfigs?: NavigationRouteConfigMap, navigatorConfig?: {} | null, navigatorType?: NavigatorType -): (NavigationView: React.ComponentClass) => NavigationNavigator; +): any; /** * Create an HOC that injects the navigation and manages the navigation state @@ -879,7 +1020,10 @@ export function createNavigationContainer( * BEGIN CUSTOM CONVENIENCE INTERFACES */ -export interface NavigationScreenProps { +export interface NavigationScreenProps< + Params = NavigationParams, + Options = any + > { navigation: NavigationScreenProp, Params>; screenProps?: { [key: string]: any }; navigationOptions?: NavigationScreenConfig; @@ -936,6 +1080,7 @@ export interface SafeAreaViewProps extends ViewProps { horizontal?: SafeAreaViewForceInsetValue; vertical?: SafeAreaViewForceInsetValue; }; + children?: React.ReactNode; } export const SafeAreaView: React.ComponentClass; diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index b00b0a27fc..b59474bd11 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -5,7 +5,7 @@ import { ViewStyle, } from 'react-native'; import { - DrawerNavigator, + createDrawerNavigator, DrawerNavigatorConfig, NavigationAction, NavigationActions, @@ -22,15 +22,14 @@ import { NavigationStackScreenOptions, NavigationTabScreenOptions, NavigationTransitionProps, - StackNavigator, + createStackNavigator, StackNavigatorConfig, - SwitchNavigator, + createSwitchNavigator, SwitchNavigatorConfig, TabBarTop, - TabNavigator, + createTabNavigator, TabNavigatorConfig, Transitioner, - addNavigationHelpers, HeaderBackButton, Header, NavigationContainer, @@ -128,7 +127,7 @@ const routeConfigMap: NavigationRouteConfigMap = { screen: NextScreen, }, }; -export const AppNavigator = StackNavigator( +export const AppNavigator = createStackNavigator( routeConfigMap, { initialRouteName: ROUTE_NAME_START_SCREEN, @@ -147,7 +146,7 @@ const StatelessScreen: NavigationScreenComponent = (props StatelessScreen.navigationOptions = { title: 'Stateless' }; -const SimpleStackNavigator = StackNavigator( +const SimpleStackNavigator = createStackNavigator( { simple: { screen: StatelessScreen, @@ -155,20 +154,6 @@ const SimpleStackNavigator = StackNavigator( } ); -/** - * Router. - */ -const Router = (props: any) => ( - true, - state: {}, - }) - } - /> -); - /** * Tab navigator. */ @@ -204,7 +189,7 @@ const tabNavigatorConfigWithNavigationOptions: TabNavigatorConfig = { }, }; -const BasicTabNavigator = TabNavigator( +const BasicTabNavigator = createTabNavigator( routeConfigMap, tabNavigatorConfig, ); @@ -232,7 +217,7 @@ const stackNavigatorConfig: StackNavigatorConfig = { navigationOptions: stackNavigatorScreenOptions, }; -const BasicStackNavigator = StackNavigator( +const BasicStackNavigator = createStackNavigator( routeConfigMap, stackNavigatorConfig, ); @@ -252,7 +237,7 @@ const stackNavigatorConfigWithNavigationOptionsAsFunction: StackNavigatorConfig navigationOptions: ({navigationOptions, navigation, screenProps}) => (stackNavigatorScreenOptions), }; -const AdvancedStackNavigator = StackNavigator( +const AdvancedStackNavigator = createStackNavigator( routeConfigMap, stackNavigatorConfigWithNavigationOptionsAsFunction ); @@ -276,7 +261,7 @@ const switchNavigatorConfig: SwitchNavigatorConfig = { backBehavior: 'none' }; -const BasicSwitchNavigator = SwitchNavigator( +const BasicSwitchNavigator = createSwitchNavigator( routeConfigMap, switchNavigatorConfig, ); @@ -296,7 +281,7 @@ const switchNavigatorConfigWithInitialRoute: SwitchNavigatorConfig = { backBehavior: 'initialRoute' }; -const SwitchNavigatorWithInitialRoute = SwitchNavigator( +const SwitchNavigatorWithInitialRoute = createSwitchNavigator( routeConfigMap, switchNavigatorConfigWithInitialRoute, ); @@ -326,7 +311,7 @@ const drawerNavigatorConfig: DrawerNavigatorConfig = { }, }; -const BasicDrawerNavigator = DrawerNavigator( +const BasicDrawerNavigator = createDrawerNavigator( routeConfigMap, stackNavigatorConfig, ); @@ -449,7 +434,7 @@ const popToTopAction: NavigationPopToTopAction = NavigationActions.popToTop({ class Page1 extends React.Component { } -const RootNavigator: NavigationContainer = SwitchNavigator({ +const RootNavigator: NavigationContainer = createSwitchNavigator({ default: { getScreen: () => Page1 }, }); diff --git a/types/react-navigation/tsconfig.json b/types/react-navigation/tsconfig.json index ac0fcf1f1f..1afd5d30f6 100644 --- a/types/react-navigation/tsconfig.json +++ b/types/react-navigation/tsconfig.json @@ -9,12 +9,20 @@ "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": false, - "baseUrl": "../", + "baseUrl": "../../", "jsx": "react", "typeRoots": [ - "../" + "../../" ], "types": [], + "paths": { + "react-navigation": [ + "react-navigation/v2" + ], + "react-navigation/*": [ + "react-navigation/v2/*" + ] + }, "noEmit": true, "forceConsistentCasingInFileNames": true }, @@ -22,4 +30,4 @@ "index.d.ts", "react-navigation-tests.tsx" ] -} \ No newline at end of file +} diff --git a/types/react-navigation/tslint.json b/types/react-navigation/tslint.json index 3db14f85ea..b1439230db 100644 --- a/types/react-navigation/tslint.json +++ b/types/react-navigation/tslint.json @@ -1 +1,7 @@ -{ "extends": "dtslint/dt.json" } +{ + "extends": "dtslint/dt.json", + "rules": { + // TODO + "no-any-union": false + } +} diff --git a/types/react-navigation/v2/index.d.ts b/types/react-navigation/v1/index.d.ts similarity index 67% rename from types/react-navigation/v2/index.d.ts rename to types/react-navigation/v1/index.d.ts index 561558d540..1233ca39e3 100644 --- a/types/react-navigation/v2/index.d.ts +++ b/types/react-navigation/v1/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-navigation 2.0 +// Type definitions for react-navigation 1.5 // Project: https://github.com/react-navigation/react-navigation // Definitions by: Huhuanming // mhcgrq @@ -16,12 +16,11 @@ // Armando Assuncao // Ciaran Liedeman // Edward Sammut Alessi -// Jérémy Magrin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 /** - * Reference: https://github.com/react-navigation/react-navigation/tree/a37473c5e4833f48796ee6c7c9cb4a8ac49d9c06 + * Reference: https://github.com/react-navigation/react-navigation/tree/3f3ef6485c8932f49fddc3dd2c508629110bf2b6 * * NOTE: Please update the commit/link above when updating to a new Flow * react-navigation/flow/react-navigation.js reference, so we can conveniently just look at diffs on @@ -44,24 +43,15 @@ export type AnimatedValue = any; export type HeaderMode = 'float' | 'screen' | 'none'; -export interface HeaderForceInset { - horizontal?: string; - vertical?: string; - left?: string; - right?: string; - top?: string; - bottom?: string; -} - export interface HeaderProps extends NavigationSceneRendererProps { mode: HeaderMode; - router: NavigationRouter; - getScreenDetails: ( - navigationScene: NavigationScene - ) => NavigationScreenDetails; - leftInterpolator: (props: NavigationSceneRendererProps) => {}; - titleInterpolator: (props: NavigationSceneRendererProps) => {}; - rightInterpolator: (props: NavigationSceneRendererProps) => {}; + router: NavigationRouter< + NavigationState, + NavigationStackScreenOptions + >; + getScreenDetails: (navigationScene: NavigationScene) => NavigationScreenDetails< + NavigationStackScreenOptions + >; style: StyleProp; } @@ -83,14 +73,12 @@ export interface NavigationState { * Index refers to the active child route in the routes array. */ index: number; - routes: NavigationRoute[]; + routes: any[]; } -export type NavigationRoute = - | NavigationLeafRoute - | NavigationStateRoute; +export type NavigationRoute = NavigationLeafRoute | NavigationStateRoute; -export interface NavigationLeafRoute { +export interface NavigationLeafRoute { /** * React's key used by some navigators. No need to specify these manually, * they will be defined by the router. @@ -112,9 +100,7 @@ export interface NavigationLeafRoute { params?: Params; } -export type NavigationStateRoute< - NavigationLeafRouteParams - > = NavigationLeafRoute & NavigationState; +export type NavigationStateRoute = NavigationLeafRoute & NavigationState; export type NavigationScreenOptionsGetter = ( navigation: NavigationScreenProp>, @@ -127,10 +113,7 @@ export interface NavigationRouter { * an optional previous state. When the action is considered handled but the * state is unchanged, the output state is null. */ - getStateForAction: ( - action: NavigationAction, - lastState?: State - ) => State | null; + getStateForAction: (action: NavigationAction, lastState?: State) => (State | null); /** * Maps a URI-like string to an action. This can be mapped to a state @@ -139,14 +122,14 @@ export interface NavigationRouter { getActionForPathAndParams: ( path: string, params?: NavigationParams - ) => NavigationAction | null; + ) => (NavigationAction | null); getPathAndParamsForState: ( state: State ) => { - path: string; - params?: NavigationParams; - }; + path: string, + params?: NavigationParams, + }; getComponentForRouteName: (routeName: string) => NavigationComponent; @@ -164,8 +147,11 @@ export interface NavigationRouter { } export type NavigationScreenOption = - | T - | ((navigation: NavigationScreenProp, config: T) => T); + T + | (( + navigation: NavigationScreenProp, + config: T + ) => T); export interface NavigationScreenDetails { options: T; @@ -173,9 +159,7 @@ export interface NavigationScreenDetails { navigation: NavigationScreenProp; } -export type NavigationScreenOptions = NavigationStackScreenOptions & - NavigationTabScreenOptions & - NavigationDrawerScreenOptions; +export type NavigationScreenOptions = NavigationStackScreenOptions & NavigationTabScreenOptions & NavigationDrawerScreenOptions; export interface NavigationScreenConfigProps { navigation: NavigationScreenProp; @@ -183,34 +167,30 @@ export interface NavigationScreenConfigProps { } export type NavigationScreenConfig = - | Options - | (( - navigationOptionsContainer: NavigationScreenConfigProps & { - navigationOptions: NavigationScreenProp; - } - ) => Options); + Options + | ((navigationOptionsContainer: NavigationScreenConfigProps & { + navigationOptions: NavigationScreenProp, + }) => Options); export type NavigationComponent = - | NavigationScreenComponent - | NavigationNavigator - | any; + NavigationScreenComponent + | NavigationNavigator; export type NavigationScreenComponent< - Params = NavigationParams, - Options = {}, - Props = {} - > = React.ComponentType & Props> & { - navigationOptions?: NavigationScreenConfig; - }; + Params = NavigationParams, + Options = {}, + Props = {} +> = React.ComponentType & Props> & +{ navigationOptions?: NavigationScreenConfig }; export type NavigationNavigator< - State = NavigationState, - Options = {}, - Props = {} - > = React.ComponentType & Props> & { - router: NavigationRouter; - navigationOptions?: NavigationScreenConfig; - }; + State = NavigationState, + Options = {}, + Props = {} +> = React.ComponentType & Props> & { + router: NavigationRouter, + navigationOptions?: NavigationScreenConfig, +}; export interface NavigationParams { [key: string]: any; @@ -226,8 +206,7 @@ export interface NavigationNavigateActionPayload { key?: string; } -export interface NavigationNavigateAction - extends NavigationNavigateActionPayload { +export interface NavigationNavigateAction extends NavigationNavigateActionPayload { type: 'Navigation/NAVIGATE'; } @@ -247,8 +226,7 @@ export interface NavigationSetParamsActionPayload { params?: NavigationParams; } -export interface NavigationSetParamsAction - extends NavigationSetParamsActionPayload { +export interface NavigationSetParamsAction extends NavigationSetParamsActionPayload { type: 'Navigation/SET_PARAMS'; } @@ -293,70 +271,40 @@ export interface NavigationPopToTopActionPayload { immediate?: boolean; } -export interface NavigationPopToTopAction - extends NavigationPopToTopActionPayload { +export interface NavigationPopToTopAction extends NavigationPopToTopActionPayload { type: 'Navigation/POP_TO_TOP'; } export interface NavigationStackViewConfig { mode?: 'card' | 'modal'; headerMode?: HeaderMode; - headerTransitionPreset?: 'fade-in-place' | 'uikit'; cardStyle?: StyleProp; transitionConfig?: ( transitionProps: NavigationTransitionProps, prevTransitionProps: NavigationTransitionProps, - isModal: boolean + isModal: boolean, ) => TransitionConfig; - onTransitionStart?: ( - transitionProps: NavigationTransitionProps, - prevTransitionProps?: NavigationTransitionProps - ) => Promise | void; - onTransitionEnd?: ( - transitionProps: NavigationTransitionProps, - prevTransitionProps?: NavigationTransitionProps - ) => void; -} - -/** - * Switch Navigator - */ - -export interface NavigationSwitchRouterConfig { - initialRouteName?: string; - initialRouteParams?: NavigationParams; - paths?: NavigationPathsConfig; - navigationOptions?: NavigationScreenConfig; - order?: string[]; - backBehavior?: 'none' | 'initialRoute'; // defaults to `'none'` - resetOnBlur?: boolean; // defaults to `true` + onTransitionStart?: (transitionProps: NavigationTransitionProps, prevTransitionProps?: NavigationTransitionProps) => Promise | void; + onTransitionEnd?: (transitionProps: NavigationTransitionProps, prevTransitionProps?: NavigationTransitionProps) => void; } export interface NavigationStackScreenOptions { title?: string; - header?: - | ( - | React.ReactElement - | ((headerProps: HeaderProps) => React.ReactElement)) - | null; + header?: (React.ReactElement | ((headerProps: HeaderProps) => React.ReactElement)) | null; headerTransparent?: boolean; headerTitle?: string | React.ReactElement; headerTitleStyle?: StyleProp; - headerTitleAllowFontScaling?: boolean; headerTintColor?: string; headerLeft?: React.ReactElement; headerBackTitle?: string | null; - headerBackImage?: React.ReactElement; headerTruncatedBackTitle?: string; headerBackTitleStyle?: StyleProp; headerPressColorAndroid?: string; headerRight?: React.ReactElement; headerStyle?: StyleProp; - headerForceInset?: HeaderForceInset; headerBackground?: React.ReactNode | React.ReactType; gesturesEnabled?: boolean; gestureResponseDistance?: { vertical?: number; horizontal?: number }; - gestureDirection?: 'default' | 'inverted'; } export interface NavigationStackRouterConfig { @@ -369,7 +317,7 @@ export interface NavigationStackRouterConfig { } export type NavigationStackAction = - | NavigationInitAction + NavigationInitAction | NavigationNavigateAction | NavigationBackAction | NavigationSetParamsAction @@ -378,30 +326,25 @@ export type NavigationStackAction = | NavigationPopToTopAction; export type NavigationTabAction = - | NavigationInitAction + NavigationInitAction | NavigationNavigateAction | NavigationBackAction; export type NavigationAction = - | NavigationInitAction + NavigationInitAction | NavigationStackAction | NavigationTabAction; -export type NavigationRouteConfig = - | NavigationComponent - | ({ - navigationOptions?: NavigationScreenConfig; - path?: string; - } & NavigationScreenRouteConfig); +export type NavigationRouteConfig = NavigationComponent | ({ + navigationOptions?: NavigationScreenConfig, + path?: string, +} & NavigationScreenRouteConfig); -export type NavigationScreenRouteConfig = - | NavigationComponent - | { - screen: NavigationComponent; - } - | { - getScreen: () => NavigationComponent; - }; +export type NavigationScreenRouteConfig = NavigationComponent | { + screen: NavigationComponent, +} | { + getScreen: () => NavigationComponent, +}; export interface NavigationPathsConfig { [routeName: string]: string; @@ -409,7 +352,6 @@ export interface NavigationPathsConfig { export interface NavigationTabRouterConfig { initialRouteName?: string; - initialRouteParams?: NavigationParams; paths?: NavigationPathsConfig; navigationOptions?: NavigationScreenConfig; order?: string[]; // todo: type these as the real route names rather than 'string' @@ -418,48 +360,45 @@ export interface NavigationTabRouterConfig { backBehavior?: 'none' | 'initialRoute'; // defaults `initialRoute` } export interface TabScene { - route: NavigationRoute; - focused: boolean; - index: number; - tintColor?: string; + route: NavigationRoute; + focused: boolean; + index: number; + tintColor?: string; } export interface NavigationTabScreenOptions { title?: string; tabBarIcon?: - | React.ReactElement - | (( - options: { tintColor: string | null; focused: boolean } - ) => React.ReactElement | null); + React.ReactElement + | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< + any + > | null)); tabBarLabel?: - | string - | React.ReactElement - | (( - options: { tintColor: string | null; focused: boolean } - ) => React.ReactElement | string | null); + string + | React.ReactElement + | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< + any + > | string | null)); tabBarVisible?: boolean; - tabBarTestIDProps?: { testID?: string; accessibilityLabel?: string }; - tabBarOnPress?: ( - options: { - scene: TabScene; - jumpToIndex: (index: number) => void; - } - ) => void; + tabBarTestIDProps?: { testID?: string, accessibilityLabel?: string }; + tabBarOnPress?: (options: { + scene: TabScene, + jumpToIndex: (index: number) => void + }) => void; } export interface NavigationDrawerScreenOptions { title?: string; drawerIcon?: - | React.ReactElement - | (( - options: { tintColor: string | null; focused: boolean } - ) => React.ReactElement | null); + React.ReactElement + | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< + any + > | null)); drawerLabel?: - | string - | React.ReactElement - | (( - options: { tintColor: string | null; focused: boolean } - ) => React.ReactElement | null); - drawerLockMode?: 'unlocked' | 'locked-closed' | 'locked-open'; + string + | React.ReactElement + | ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement< + any + > | null)); } export interface NavigationRouteConfigMap { @@ -474,20 +413,22 @@ export interface NavigationProp { } export type EventType = - | 'willFocus' - | 'didFocus' - | 'willBlur' - | 'didBlur' - | 'action'; +| 'willFocus' +| 'didFocus' +| 'willBlur' +| 'didBlur' +| 'action'; export interface NavigationEventPayload { type: EventType; action: NavigationAction; state: NavigationState; - lastState: NavigationState | null | undefined; + lastState: NavigationState; } -export type NavigationEventCallback = (payload: NavigationEventPayload) => void; +export type NavigationEventCallback = ( + payload: NavigationEventPayload +) => void; export interface NavigationEventSubscription { remove: () => void; @@ -497,14 +438,8 @@ export interface NavigationScreenProp { state: S; dispatch: NavigationDispatch; goBack: (routeKey?: string | null) => boolean; - dismiss: () => boolean; navigate(options: { - routeName: string | { - routeName: string; - params?: NavigationParams; - action?: NavigationNavigateAction; - key?: string; - }; + routeName: string; params?: NavigationParams; action?: NavigationAction; key?: string; @@ -512,11 +447,8 @@ export interface NavigationScreenProp { navigate( routeNameOrOptions: string, params?: NavigationParams, - action?: NavigationAction + action?: NavigationAction, ): boolean; - openDrawer: () => any; - closeDrawer: () => any; - toggleDrawer: () => any; getParam: (param: T, fallback?: P[T]) => P[T]; setParams: (newParams: P) => boolean; addListener: ( @@ -535,7 +467,6 @@ export interface NavigationScreenProp { ) => boolean; pop: (n?: number, params?: { immediate?: boolean }) => boolean; popToTop: (params?: { immediate?: boolean }) => boolean; - isFocused: () => boolean; } export interface NavigationNavigatorProps { @@ -619,14 +550,6 @@ export interface TransitionConfig { // How to animate position and opacity of the screen // based on the value generated by the transitionSpec screenInterpolator?: (props: NavigationSceneRendererProps) => any; - // How to animate position and opacity of the header componetns - // based on the value generated by the transitionSpec - headerLeftInterpolator?: (props: NavigationSceneRendererProps) => any; - headerTitleInterpolator?: (props: NavigationSceneRendererProps) => any; - headerRightInterpolator?: (props: NavigationSceneRendererProps) => any; - // The style of the container. Useful when a scene doesn't have - // 100% opacity and the underlying container is visible. - containerStyle?: StyleProp; } export type NavigationAnimationSetter = ( @@ -635,7 +558,7 @@ export type NavigationAnimationSetter = ( lastState: NavigationState ) => void; -export type NavigationSceneRenderer = () => React.ReactElement | null; +export type NavigationSceneRenderer = () => (React.ReactElement | null); export type NavigationStyleInterpolator = ( props: NavigationSceneRendererProps @@ -644,49 +567,50 @@ export type NavigationStyleInterpolator = ( export interface LayoutEvent { nativeEvent: { layout: { - x: number; - y: number; - width: number; - height: number; - }; + x: number, + y: number, + width: number, + height: number, + }, }; } export type NavigatorType = - | 'react-navigation/STACK' - | 'react-navigation/TABS' - | 'react-navigation/DRAWER'; +| 'react-navigation/STACK' +| 'react-navigation/TABS' +| 'react-navigation/DRAWER'; -export interface NavigationContainerProps { +export function addNavigationHelpers( + navigation: { + state: S; + dispatch: (action: NavigationAction) => any; + addListener?: ( + eventName: string, + callback: NavigationEventCallback + ) => NavigationEventSubscription; + } +): NavigationScreenProp; + +export interface NavigationContainerProps { uriPrefix?: string | RegExp; onNavigationStateChange?: ( prevNavigationState: NavigationState, nextNavigationState: NavigationState, - action: NavigationAction - ) => void | null | undefined; - navigation?: NavigationScreenProp; - persistenceKey?: string | null; - renderLoadingExperimental?: React.ComponentType; - screenProps?: any; - navigationOptions?: O; + action: NavigationAction, + ) => void; style?: StyleProp; } -export interface NavigationContainerComponent - extends React.Component< +export interface NavigationContainerComponent extends React.Component< NavigationContainerProps & NavigationNavigatorProps > { dispatch: NavigationDispatch; } -export interface NavigationContainer - extends React.ComponentClass< +export interface NavigationContainer extends React.ComponentClass< NavigationContainerProps & NavigationNavigatorProps > { - new( - props: NavigationContainerProps & NavigationNavigatorProps, - context?: any - ): NavigationContainerComponent; + new(props: NavigationContainerProps & NavigationNavigatorProps, context?: any): NavigationContainerComponent; router: NavigationRouter; screenProps: { [key: string]: any }; @@ -694,21 +618,14 @@ export interface NavigationContainer state: { nav: NavigationState | null }; } -export interface StackNavigatorConfig - extends NavigationStackViewConfig, - NavigationStackRouterConfig { +export interface StackNavigatorConfig extends NavigationStackViewConfig, NavigationStackRouterConfig { containerOptions?: any; } // Return createNavigationContainer export function StackNavigator( routeConfigMap: NavigationRouteConfigMap, - stackConfig?: StackNavigatorConfig -): NavigationContainer; - -export function createStackNavigator( - routeConfigMap: NavigationRouteConfigMap, - stackConfig?: StackNavigatorConfig + stackConfig?: StackNavigatorConfig, ): NavigationContainer; export interface SwitchNavigatorConfig { @@ -719,18 +636,11 @@ export interface SwitchNavigatorConfig { } // Return createNavigationContainer -export type _SwitchNavigatorConfig = NavigationSwitchRouterConfig; - export function SwitchNavigator( routeConfigMap: NavigationRouteConfigMap, switchConfig?: SwitchNavigatorConfig ): NavigationContainer; -export function createSwitchNavigator( - routeConfigMap: NavigationRouteConfigMap, - switchConfig?: SwitchNavigatorConfig -): NavigationContainer; - // DrawerItems export const DrawerItems: React.ReactType; @@ -745,28 +655,21 @@ export interface DrawerViewConfig { contentOptions?: any; style?: StyleProp; } -export interface DrawerNavigatorConfig - extends NavigationTabRouterConfig, - DrawerViewConfig { +export interface DrawerNavigatorConfig extends NavigationTabRouterConfig, DrawerViewConfig { containerConfig?: any; contentOptions?: { - activeTintColor?: string; - activeBackgroundColor?: string; - inactiveTintColor?: string; - inactiveBackgroundColor?: string; - style?: StyleProp; - labelStyle?: StyleProp; + activeTintColor?: string, + activeBackgroundColor?: string, + inactiveTintColor?: string, + inactiveBackgroundColor?: string, + style?: StyleProp, + labelStyle?: StyleProp, }; } export function DrawerNavigator( routeConfigMap: NavigationRouteConfigMap, - drawerConfig?: DrawerNavigatorConfig -): NavigationContainer; - -export function createDrawerNavigator( - routeConfigMap: NavigationRouteConfigMap, - drawerConfig?: DrawerNavigatorConfig + drawerConfig?: DrawerNavigatorConfig, ): NavigationContainer; /** @@ -778,23 +681,23 @@ export interface TabViewConfig { tabBarComponent?: React.ReactType; tabBarPosition?: 'top' | 'bottom'; tabBarOptions?: { - activeTintColor?: string; - allowFontScaling?: boolean; - activeBackgroundColor?: string; - inactiveTintColor?: string; - inactiveBackgroundColor?: string; - showLabel?: boolean; - style?: StyleProp; - labelStyle?: StyleProp; - iconStyle?: StyleProp; + activeTintColor?: string, + allowFontScaling?: boolean, + activeBackgroundColor?: string, + inactiveTintColor?: string, + inactiveBackgroundColor?: string, + showLabel?: boolean, + style?: StyleProp, + labelStyle?: StyleProp, + iconStyle?: StyleProp, // Top - showIcon?: boolean; - upperCaseLabel?: boolean; - pressColor?: string; - pressOpacity?: number; - scrollEnabled?: boolean; - tabStyle?: StyleProp; - indicatorStyle?: StyleProp; + showIcon?: boolean, + upperCaseLabel?: boolean, + pressColor?: string, + pressOpacity?: number, + scrollEnabled?: boolean, + tabStyle?: StyleProp, + indicatorStyle?: StyleProp, }; swipeEnabled?: boolean; animationEnabled?: boolean; @@ -802,33 +705,16 @@ export interface TabViewConfig { } // From navigators/TabNavigator.js -export interface TabNavigatorConfig - extends NavigationTabRouterConfig, - TabViewConfig { +export interface TabNavigatorConfig extends NavigationTabRouterConfig, TabViewConfig { lazy?: boolean; removeClippedSubviews?: boolean; - initialLayout?: { height: number; width: number }; + initialLayout?: { height: number, width: number }; } // From navigators/TabNavigator.js export function TabNavigator( routeConfigMap: NavigationRouteConfigMap, - drawConfig?: TabNavigatorConfig -): NavigationContainer; - -export function createTabNavigator( - routeConfigMap: NavigationRouteConfigMap, - drawConfig?: TabNavigatorConfig -): NavigationContainer; - -export function createBottomTabNavigator( - routeConfigMap: NavigationRouteConfigMap, - drawConfig?: TabNavigatorConfig -): NavigationContainer; - -export function createMaterialTopNavigator( - routeConfigMap: NavigationRouteConfigMap, - drawConfig?: TabNavigatorConfig + drawConfig?: TabNavigatorConfig, ): NavigationContainer; export interface TabBarTopProps { @@ -843,17 +729,15 @@ export interface TabBarTopProps { tabBarPosition: string; navigation: NavigationScreenProp; jumpToIndex: (index: number) => void; - getLabel: (scene: TabScene) => React.ReactNode | string; + getLabel: (scene: TabScene) => (React.ReactNode | string); getOnPress: ( previousScene: NavigationRoute, scene: TabScene - ) => ( - args: { - previousScene: NavigationRoute; - scene: TabScene; - jumpToIndex: (index: number) => void; - } - ) => void; + ) => (args: { + previousScene: NavigationRoute, + scene: TabScene, + jumpToIndex: (index: number) => void, + }) => void; renderIcon: (scene: TabScene) => React.ReactElement; labelStyle?: TextStyle; iconStyle?: ViewStyle; @@ -870,17 +754,15 @@ export interface TabBarBottomProps { position: AnimatedValue; navigation: NavigationScreenProp; jumpToIndex: (index: number) => void; - getLabel: (scene: TabScene) => React.ReactNode | string; + getLabel: (scene: TabScene) => (React.ReactNode | string); getOnPress: ( previousScene: NavigationRoute, scene: TabScene - ) => ( - args: { - previousScene: NavigationRoute; - scene: TabScene; - jumpToIndex: (index: number) => void; - } - ) => void; + ) => (args: { + previousScene: NavigationRoute, + scene: TabScene, + jumpToIndex: (index: number) => void, + }) => void; getTestIDProps: (scene: TabScene) => (scene: TabScene) => any; renderIcon: (scene: TabScene) => React.ReactNode; style?: ViewStyle; @@ -907,18 +789,12 @@ export namespace NavigationActions { const POP_TO_TOP: 'Navigation/POP_TO_TOP'; function init(options?: NavigationInitActionPayload): NavigationInitAction; - function navigate( - options: NavigationNavigateActionPayload - ): NavigationNavigateAction; + function navigate(options: NavigationNavigateActionPayload): NavigationNavigateAction; function reset(options: NavigationResetActionPayload): NavigationResetAction; function back(options?: NavigationBackActionPayload): NavigationBackAction; - function setParams( - options: NavigationSetParamsActionPayload - ): NavigationSetParamsAction; + function setParams(options: NavigationSetParamsActionPayload): NavigationSetParamsAction; function pop(options: NavigationPopActionPayload): NavigationPopAction; - function popToTop( - options: NavigationPopToTopActionPayload - ): NavigationPopToTopAction; + function popToTop(options: NavigationPopToTopActionPayload): NavigationPopToTopAction; } /** @@ -931,14 +807,8 @@ export interface TransitionerProps { prevTransitionProps?: NavigationTransitionProps ) => NavigationTransitionSpec; navigation: NavigationScreenProp; - onTransitionStart?: ( - transitionProps: NavigationTransitionProps, - prevTransitionProps?: NavigationTransitionProps - ) => Promise | void; - onTransitionEnd?: ( - transitionProps: NavigationTransitionProps, - prevTransitionProps?: NavigationTransitionProps - ) => void; + onTransitionStart?: (transitionProps: NavigationTransitionProps, prevTransitionProps?: NavigationTransitionProps) => Promise | void; + onTransitionEnd?: (transitionProps: NavigationTransitionProps, prevTransitionProps?: NavigationTransitionProps) => void; render: ( transitionProps: NavigationTransitionProps, prevTransitionProps?: NavigationTransitionProps @@ -956,7 +826,7 @@ export interface TransitionerState { export class Transitioner extends React.Component< TransitionerProps, TransitionerState - > { } +> { } /** * Tab Router @@ -983,23 +853,12 @@ export function StackRouter( * * @see https://github.com/react-navigation/react-navigation/blob/master/src/navigators/createNavigator.js */ -export interface NavigationDescriptor { - key: string; - state: NavigationLeafRoute | NavigationStateRoute; - navigation: NavigationScreenProp; - getComponent: () => React.ComponentType; -} - -export type NavigationView = React.ComponentType<{ - descriptors: { [key: string]: NavigationDescriptor }; -} & NavigationInjectedProps>; - -export function createNavigator( - view: NavigationView, +export function createNavigator( router: NavigationRouter, + routeConfigs?: NavigationRouteConfigMap, navigatorConfig?: {} | null, navigatorType?: NavigatorType -): any; +): (NavigationView: React.ComponentClass) => NavigationNavigator; /** * Create an HOC that injects the navigation and manages the navigation state @@ -1020,10 +879,7 @@ export function createNavigationContainer( * BEGIN CUSTOM CONVENIENCE INTERFACES */ -export interface NavigationScreenProps< - Params = NavigationParams, - Options = any - > { +export interface NavigationScreenProps { navigation: NavigationScreenProp, Params>; screenProps?: { [key: string]: any }; navigationOptions?: NavigationScreenConfig; @@ -1080,7 +936,6 @@ export interface SafeAreaViewProps extends ViewProps { horizontal?: SafeAreaViewForceInsetValue; vertical?: SafeAreaViewForceInsetValue; }; - children?: React.ReactNode; } export const SafeAreaView: React.ComponentClass; diff --git a/types/react-navigation/v2/react-navigation-tests.tsx b/types/react-navigation/v1/react-navigation-tests.tsx similarity index 93% rename from types/react-navigation/v2/react-navigation-tests.tsx rename to types/react-navigation/v1/react-navigation-tests.tsx index b59474bd11..b00b0a27fc 100644 --- a/types/react-navigation/v2/react-navigation-tests.tsx +++ b/types/react-navigation/v1/react-navigation-tests.tsx @@ -5,7 +5,7 @@ import { ViewStyle, } from 'react-native'; import { - createDrawerNavigator, + DrawerNavigator, DrawerNavigatorConfig, NavigationAction, NavigationActions, @@ -22,14 +22,15 @@ import { NavigationStackScreenOptions, NavigationTabScreenOptions, NavigationTransitionProps, - createStackNavigator, + StackNavigator, StackNavigatorConfig, - createSwitchNavigator, + SwitchNavigator, SwitchNavigatorConfig, TabBarTop, - createTabNavigator, + TabNavigator, TabNavigatorConfig, Transitioner, + addNavigationHelpers, HeaderBackButton, Header, NavigationContainer, @@ -127,7 +128,7 @@ const routeConfigMap: NavigationRouteConfigMap = { screen: NextScreen, }, }; -export const AppNavigator = createStackNavigator( +export const AppNavigator = StackNavigator( routeConfigMap, { initialRouteName: ROUTE_NAME_START_SCREEN, @@ -146,7 +147,7 @@ const StatelessScreen: NavigationScreenComponent = (props StatelessScreen.navigationOptions = { title: 'Stateless' }; -const SimpleStackNavigator = createStackNavigator( +const SimpleStackNavigator = StackNavigator( { simple: { screen: StatelessScreen, @@ -154,6 +155,20 @@ const SimpleStackNavigator = createStackNavigator( } ); +/** + * Router. + */ +const Router = (props: any) => ( + true, + state: {}, + }) + } + /> +); + /** * Tab navigator. */ @@ -189,7 +204,7 @@ const tabNavigatorConfigWithNavigationOptions: TabNavigatorConfig = { }, }; -const BasicTabNavigator = createTabNavigator( +const BasicTabNavigator = TabNavigator( routeConfigMap, tabNavigatorConfig, ); @@ -217,7 +232,7 @@ const stackNavigatorConfig: StackNavigatorConfig = { navigationOptions: stackNavigatorScreenOptions, }; -const BasicStackNavigator = createStackNavigator( +const BasicStackNavigator = StackNavigator( routeConfigMap, stackNavigatorConfig, ); @@ -237,7 +252,7 @@ const stackNavigatorConfigWithNavigationOptionsAsFunction: StackNavigatorConfig navigationOptions: ({navigationOptions, navigation, screenProps}) => (stackNavigatorScreenOptions), }; -const AdvancedStackNavigator = createStackNavigator( +const AdvancedStackNavigator = StackNavigator( routeConfigMap, stackNavigatorConfigWithNavigationOptionsAsFunction ); @@ -261,7 +276,7 @@ const switchNavigatorConfig: SwitchNavigatorConfig = { backBehavior: 'none' }; -const BasicSwitchNavigator = createSwitchNavigator( +const BasicSwitchNavigator = SwitchNavigator( routeConfigMap, switchNavigatorConfig, ); @@ -281,7 +296,7 @@ const switchNavigatorConfigWithInitialRoute: SwitchNavigatorConfig = { backBehavior: 'initialRoute' }; -const SwitchNavigatorWithInitialRoute = createSwitchNavigator( +const SwitchNavigatorWithInitialRoute = SwitchNavigator( routeConfigMap, switchNavigatorConfigWithInitialRoute, ); @@ -311,7 +326,7 @@ const drawerNavigatorConfig: DrawerNavigatorConfig = { }, }; -const BasicDrawerNavigator = createDrawerNavigator( +const BasicDrawerNavigator = DrawerNavigator( routeConfigMap, stackNavigatorConfig, ); @@ -434,7 +449,7 @@ const popToTopAction: NavigationPopToTopAction = NavigationActions.popToTop({ class Page1 extends React.Component { } -const RootNavigator: NavigationContainer = createSwitchNavigator({ +const RootNavigator: NavigationContainer = SwitchNavigator({ default: { getScreen: () => Page1 }, }); diff --git a/types/react-navigation/v2/tsconfig.json b/types/react-navigation/v1/tsconfig.json similarity index 65% rename from types/react-navigation/v2/tsconfig.json rename to types/react-navigation/v1/tsconfig.json index 1afd5d30f6..ac0fcf1f1f 100644 --- a/types/react-navigation/v2/tsconfig.json +++ b/types/react-navigation/v1/tsconfig.json @@ -9,20 +9,12 @@ "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": false, - "baseUrl": "../../", + "baseUrl": "../", "jsx": "react", "typeRoots": [ - "../../" + "../" ], "types": [], - "paths": { - "react-navigation": [ - "react-navigation/v2" - ], - "react-navigation/*": [ - "react-navigation/v2/*" - ] - }, "noEmit": true, "forceConsistentCasingInFileNames": true }, @@ -30,4 +22,4 @@ "index.d.ts", "react-navigation-tests.tsx" ] -} +} \ No newline at end of file diff --git a/types/react-navigation/v1/tslint.json b/types/react-navigation/v1/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-navigation/v1/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-navigation/v2/tslint.json b/types/react-navigation/v2/tslint.json deleted file mode 100644 index b1439230db..0000000000 --- a/types/react-navigation/v2/tslint.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - // TODO - "no-any-union": false - } -} From e030f2b4de55de98595664b1a98136f06a62944a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Magrin?= Date: Sat, 2 Jun 2018 13:00:09 +0200 Subject: [PATCH 12/20] Fix dependencies --- types/react-navigation/tsconfig.json | 4 ++-- types/react-router-navigation-core/tsconfig.json | 4 ++-- types/react-router-navigation/tsconfig.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/types/react-navigation/tsconfig.json b/types/react-navigation/tsconfig.json index 1afd5d30f6..3fc9fba7ce 100644 --- a/types/react-navigation/tsconfig.json +++ b/types/react-navigation/tsconfig.json @@ -17,10 +17,10 @@ "types": [], "paths": { "react-navigation": [ - "react-navigation/v2" + "react-navigation/v1" ], "react-navigation/*": [ - "react-navigation/v2/*" + "react-navigation/v1/*" ] }, "noEmit": true, diff --git a/types/react-router-navigation-core/tsconfig.json b/types/react-router-navigation-core/tsconfig.json index b773967cc9..fb95df56d6 100644 --- a/types/react-router-navigation-core/tsconfig.json +++ b/types/react-router-navigation-core/tsconfig.json @@ -7,10 +7,10 @@ "types": [], "paths": { "react-navigation": [ - "react-navigation/v2" + "react-navigation/v1" ], "react-navigation/*": [ - "react-navigation/v2/*" + "react-navigation/v1/*" ] }, "module": "commonjs", diff --git a/types/react-router-navigation/tsconfig.json b/types/react-router-navigation/tsconfig.json index c55f423c19..5c345d9c7a 100644 --- a/types/react-router-navigation/tsconfig.json +++ b/types/react-router-navigation/tsconfig.json @@ -7,10 +7,10 @@ "types": [], "paths": { "react-navigation": [ - "react-navigation/v2" + "react-navigation/v1" ], "react-navigation/*": [ - "react-navigation/v2/*" + "react-navigation/v1/*" ] }, "module": "commonjs", From 418b3b2691f3f1eb5f488d2a1512c76f3c3c4c3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Magrin?= Date: Sat, 2 Jun 2018 13:03:44 +0200 Subject: [PATCH 13/20] Fix paths --- types/react-navigation/tsconfig.json | 12 ++---------- types/react-navigation/v1/tsconfig.json | 14 +++++++++++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/types/react-navigation/tsconfig.json b/types/react-navigation/tsconfig.json index 3fc9fba7ce..c1d4d83209 100644 --- a/types/react-navigation/tsconfig.json +++ b/types/react-navigation/tsconfig.json @@ -9,20 +9,12 @@ "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": false, - "baseUrl": "../../", + "baseUrl": "../", "jsx": "react", "typeRoots": [ - "../../" + "../" ], "types": [], - "paths": { - "react-navigation": [ - "react-navigation/v1" - ], - "react-navigation/*": [ - "react-navigation/v1/*" - ] - }, "noEmit": true, "forceConsistentCasingInFileNames": true }, diff --git a/types/react-navigation/v1/tsconfig.json b/types/react-navigation/v1/tsconfig.json index ac0fcf1f1f..3fc9fba7ce 100644 --- a/types/react-navigation/v1/tsconfig.json +++ b/types/react-navigation/v1/tsconfig.json @@ -9,12 +9,20 @@ "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": false, - "baseUrl": "../", + "baseUrl": "../../", "jsx": "react", "typeRoots": [ - "../" + "../../" ], "types": [], + "paths": { + "react-navigation": [ + "react-navigation/v1" + ], + "react-navigation/*": [ + "react-navigation/v1/*" + ] + }, "noEmit": true, "forceConsistentCasingInFileNames": true }, @@ -22,4 +30,4 @@ "index.d.ts", "react-navigation-tests.tsx" ] -} \ No newline at end of file +} From 79bd7180d09eb71a5b1d6da6fa2c9aab4442d647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Magrin?= Date: Sat, 2 Jun 2018 13:28:26 +0200 Subject: [PATCH 14/20] Fix createMaterialTopNavigator to createMaterialTopTabNavigator --- types/react-navigation/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 561558d540..90f440d006 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -826,7 +826,7 @@ export function createBottomTabNavigator( drawConfig?: TabNavigatorConfig ): NavigationContainer; -export function createMaterialTopNavigator( +export function createMaterialTopTabNavigator( routeConfigMap: NavigationRouteConfigMap, drawConfig?: TabNavigatorConfig ): NavigationContainer; From 502b45cf1534228e1e1033393b833900788d5e69 Mon Sep 17 00:00:00 2001 From: Bohdan Stupak Date: Sat, 2 Jun 2018 20:36:23 +0300 Subject: [PATCH 15/20] Add types to jquery.nicescroll --- types/jquery.nicescroll/index.d.ts | 105 ++++++++++++++++++ .../jquery.nicescroll-tests.ts | 41 +++++++ types/jquery.nicescroll/tsconfig.json | 24 ++++ types/jquery.nicescroll/tslint.json | 3 + 4 files changed, 173 insertions(+) create mode 100644 types/jquery.nicescroll/index.d.ts create mode 100644 types/jquery.nicescroll/jquery.nicescroll-tests.ts create mode 100644 types/jquery.nicescroll/tsconfig.json create mode 100644 types/jquery.nicescroll/tslint.json diff --git a/types/jquery.nicescroll/index.d.ts b/types/jquery.nicescroll/index.d.ts new file mode 100644 index 0000000000..1b5b714cb8 --- /dev/null +++ b/types/jquery.nicescroll/index.d.ts @@ -0,0 +1,105 @@ +// Type definitions for jquery.nicescroll 3.7.6 +// Project: https://nicescroll.areaaperta.com +// Definitions by: Bohdan Stupak +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +declare namespace JQueryNiceScroll { + interface NiceScrollPage { + maxw: number + maxh: number + width: number + height: number + w: number + h: number + } + + interface NiceScroll { + show(): NiceScroll + hide(): NiceScroll + toggle(): NiceScroll + onResize(e?: Event, page?: NiceScrollPage): NiceScroll + resize(e?: Event, page?: NiceScrollPage): NiceScroll + remove(): void + stop(): NiceScroll + doScrollPos(x: number, y: number, spd: number): void + doScrollLeft(x: number, duration: number): void + doScrollTop(x: number, duration: number): void + } + + interface NiceScrollOptions { + zindex?: "auto" | number + cursoropacitymin?: number + cursoropacitymax?: number + cursorcolor?: string + cursorwidth?: string + cursorborder?: string + cursorborderradius?: string + scrollspeed?: number + mousescrollstep?: number + touchbehavior?: boolean + emulatetouch?: boolean + hwacceleration?: boolean + usetransition?: boolean + boxzoom?: boolean + dblclickzoom?: boolean + gesturezoom?: boolean + grabcursorenabled?: boolean + autohidemode?: "leave" | "scroll" | "cursor" | "hidden" | boolean + background?: string + iframeautoresize?: boolean + cursorminheight?: number + preservenativescrolling?: boolean + railoffset?: boolean | { + top?: number + left?: number + } + railhoffset?: boolean | { + top?: number + left?: number + } + bouncescroll?: boolean + spacebarenabled?: boolean + railpadding?: { + top: number + right: number + left: number + bottom: number + } + disableoutline?: boolean + horizrailenabled?: boolean + railalign?: "right" | "left" | "top" | "bottom" + railvalign?: "right" | "left" | "top" | "bottom" + enabletranslate3d?: boolean + enablemousewheel?: boolean + enablekeyboard?: boolean + smoothscroll?: boolean + sensitiverail?: boolean + enablemouselockapi?: boolean + cursorfixedheight?: number + directionlockdeadzone?: number + hidecursordelay?: number + nativeparentscrolling?: boolean + enablescrollonselection?: boolean + overflowx?: "auto" | "hidden" | "inherit" | "initial" | "overlay" | "scroll" | "unset" | "visible" + overflowy?: "auto" | "hidden" | "inherit" | "initial" | "overlay" | "scroll" | "unset" | "visible" + cursordragspeed?: number + rtlmode?: "auto" | boolean + cursordragontouch?: boolean + oneaxismousemode?: "auto" | boolean + scriptpath?: string + preventmultitouchscrolling?: boolean + disablemutationobserver?: boolean + enableobserver?: boolean + scrollbarid?: string + scrollCLass?: string + } +} + +interface JQuery { + niceScroll(options?: JQueryNiceScroll.NiceScrollOptions) : JQueryNiceScroll.NiceScroll; + niceScroll(wrapper: string, options: JQueryNiceScroll.NiceScrollOptions) : JQueryNiceScroll.NiceScroll; + getNiceScroll(index?: number) : JQueryNiceScroll.NiceScroll; +} \ No newline at end of file diff --git a/types/jquery.nicescroll/jquery.nicescroll-tests.ts b/types/jquery.nicescroll/jquery.nicescroll-tests.ts new file mode 100644 index 0000000000..2d4599d8d6 --- /dev/null +++ b/types/jquery.nicescroll/jquery.nicescroll-tests.ts @@ -0,0 +1,41 @@ +//cases from documentation +// 1. Simple mode, it styles document scrollbar: +$(function() { + $("body").niceScroll(); +}); + +// 2. Instance with object returned: +let nice; +$(function() { + nice = $("body").niceScroll(); +}); + +// 3. Style a DIV and change cursor color: +$(function() { + $("#thisdiv").niceScroll({cursorcolor:"#00F"}); +}); + +// 4. DIV with "wrapper", formed by two divs, the first is the vieport, the latter is the content: +$(function() { + $("#viewportdiv").niceScroll("#wrapperdiv",{cursorcolor:"#00F"}); +}); + +// 5. Get nicescroll object: +nice = $("#mydiv").getNiceScroll(); + +// 6. Hide scrollbars: +$("#mydiv").getNiceScroll().hide(); + +// 7. Check for scrollbars resize (when content or position have changed): +$("#mydiv").getNiceScroll().resize(); + +// 8. Scrolling to a position: +$("#mydiv").getNiceScroll(0).doScrollLeft(1, 2); // Scroll X Axis +$("#mydiv").getNiceScroll(0).doScrollTop(1, 14); // Scroll Y Axis + +//other cases +$(".ui-grid-viewport").niceScroll({ + cursorcolor: "#fff", + cursorwidth: "8px", + autohidemode: "leave" +}); \ No newline at end of file diff --git a/types/jquery.nicescroll/tsconfig.json b/types/jquery.nicescroll/tsconfig.json new file mode 100644 index 0000000000..a5d8cb44a3 --- /dev/null +++ b/types/jquery.nicescroll/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jquery.nicescroll-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jquery.nicescroll/tslint.json b/types/jquery.nicescroll/tslint.json new file mode 100644 index 0000000000..8bc7a53d89 --- /dev/null +++ b/types/jquery.nicescroll/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json", +} From 7f45ca974743972bfcf521ed51fc4c4a9a7dcb0d Mon Sep 17 00:00:00 2001 From: Bohdan Stupak Date: Sat, 2 Jun 2018 22:11:27 +0300 Subject: [PATCH 16/20] Fixing tslint errors --- types/jquery.nicescroll/index.d.ts | 172 +++++++++--------- .../jquery.nicescroll-tests.ts | 18 +- types/jquery.nicescroll/tsconfig.json | 2 +- types/jquery.nicescroll/tslint.json | 4 +- 4 files changed, 98 insertions(+), 98 deletions(-) diff --git a/types/jquery.nicescroll/index.d.ts b/types/jquery.nicescroll/index.d.ts index 1b5b714cb8..8228ae5209 100644 --- a/types/jquery.nicescroll/index.d.ts +++ b/types/jquery.nicescroll/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jquery.nicescroll 3.7.6 +// Type definitions for jquery.nicescroll 3.7 // Project: https://nicescroll.areaaperta.com // Definitions by: Bohdan Stupak // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -8,98 +8,98 @@ declare namespace JQueryNiceScroll { interface NiceScrollPage { - maxw: number - maxh: number - width: number - height: number - w: number - h: number + maxw: number; + maxh: number; + width: number; + height: number; + w: number; + h: number; } - + interface NiceScroll { - show(): NiceScroll - hide(): NiceScroll - toggle(): NiceScroll - onResize(e?: Event, page?: NiceScrollPage): NiceScroll - resize(e?: Event, page?: NiceScrollPage): NiceScroll - remove(): void - stop(): NiceScroll - doScrollPos(x: number, y: number, spd: number): void - doScrollLeft(x: number, duration: number): void - doScrollTop(x: number, duration: number): void + show(): NiceScroll; + hide(): NiceScroll; + toggle(): NiceScroll; + onResize(e?: Event, page?: NiceScrollPage): NiceScroll; + resize(e?: Event, page?: NiceScrollPage): NiceScroll; + remove(): void; + stop(): NiceScroll; + doScrollPos(x: number, y: number, spd: number): void; + doScrollLeft(x: number, duration: number): void; + doScrollTop(x: number, duration: number): void; } - + interface NiceScrollOptions { - zindex?: "auto" | number - cursoropacitymin?: number - cursoropacitymax?: number - cursorcolor?: string - cursorwidth?: string - cursorborder?: string - cursorborderradius?: string - scrollspeed?: number - mousescrollstep?: number - touchbehavior?: boolean - emulatetouch?: boolean - hwacceleration?: boolean - usetransition?: boolean - boxzoom?: boolean - dblclickzoom?: boolean - gesturezoom?: boolean - grabcursorenabled?: boolean - autohidemode?: "leave" | "scroll" | "cursor" | "hidden" | boolean - background?: string - iframeautoresize?: boolean - cursorminheight?: number - preservenativescrolling?: boolean + zindex?: "auto" | number; + cursoropacitymin?: number; + cursoropacitymax?: number; + cursorcolor?: string; + cursorwidth?: string; + cursorborder?: string; + cursorborderradius?: string; + scrollspeed?: number; + mousescrollstep?: number; + touchbehavior?: boolean; + emulatetouch?: boolean; + hwacceleration?: boolean; + usetransition?: boolean; + boxzoom?: boolean; + dblclickzoom?: boolean; + gesturezoom?: boolean; + grabcursorenabled?: boolean; + autohidemode?: "leave" | "scroll" | "cursor" | "hidden" | boolean; + background?: string; + iframeautoresize?: boolean; + cursorminheight?: number; + preservenativescrolling?: boolean; railoffset?: boolean | { - top?: number - left?: number - } + top?: number; + left?: number; + }; railhoffset?: boolean | { - top?: number - left?: number - } - bouncescroll?: boolean - spacebarenabled?: boolean + top?: number; + left?: number; + }; + bouncescroll?: boolean; + spacebarenabled?: boolean; railpadding?: { - top: number - right: number - left: number - bottom: number - } - disableoutline?: boolean - horizrailenabled?: boolean - railalign?: "right" | "left" | "top" | "bottom" - railvalign?: "right" | "left" | "top" | "bottom" - enabletranslate3d?: boolean - enablemousewheel?: boolean - enablekeyboard?: boolean - smoothscroll?: boolean - sensitiverail?: boolean - enablemouselockapi?: boolean - cursorfixedheight?: number - directionlockdeadzone?: number - hidecursordelay?: number - nativeparentscrolling?: boolean - enablescrollonselection?: boolean - overflowx?: "auto" | "hidden" | "inherit" | "initial" | "overlay" | "scroll" | "unset" | "visible" - overflowy?: "auto" | "hidden" | "inherit" | "initial" | "overlay" | "scroll" | "unset" | "visible" - cursordragspeed?: number - rtlmode?: "auto" | boolean - cursordragontouch?: boolean - oneaxismousemode?: "auto" | boolean - scriptpath?: string - preventmultitouchscrolling?: boolean - disablemutationobserver?: boolean - enableobserver?: boolean - scrollbarid?: string - scrollCLass?: string - } + top: number; + right: number; + left: number; + bottom: number; + }; + disableoutline?: boolean; + horizrailenabled?: boolean; + railalign?: "right" | "left" | "top" | "bottom"; + railvalign?: "right" | "left" | "top" | "bottom"; + enabletranslate3d?: boolean; + enablemousewheel?: boolean; + enablekeyboard?: boolean; + smoothscroll?: boolean; + sensitiverail?: boolean; + enablemouselockapi?: boolean; + cursorfixedheight?: number; + directionlockdeadzone?: number; + hidecursordelay?: number; + nativeparentscrolling?: boolean; + enablescrollonselection?: boolean; + overflowx?: "auto" | "hidden" | "inherit" | "initial" | "overlay" | "scroll" | "unset" | "visible"; + overflowy?: "auto" | "hidden" | "inherit" | "initial" | "overlay" | "scroll" | "unset" | "visible"; + cursordragspeed?: number; + rtlmode?: "auto" | boolean; + cursordragontouch?: boolean; + oneaxismousemode?: "auto" | boolean; + scriptpath?: string; + preventmultitouchscrolling?: boolean; + disablemutationobserver?: boolean; + enableobserver?: boolean; + scrollbarid?: string; + scrollCLass?: string; + } } interface JQuery { - niceScroll(options?: JQueryNiceScroll.NiceScrollOptions) : JQueryNiceScroll.NiceScroll; - niceScroll(wrapper: string, options: JQueryNiceScroll.NiceScrollOptions) : JQueryNiceScroll.NiceScroll; - getNiceScroll(index?: number) : JQueryNiceScroll.NiceScroll; -} \ No newline at end of file + niceScroll(options?: JQueryNiceScroll.NiceScrollOptions): JQueryNiceScroll.NiceScroll; + niceScroll(wrapper: string, options: JQueryNiceScroll.NiceScrollOptions): JQueryNiceScroll.NiceScroll; + getNiceScroll(index?: number): JQueryNiceScroll.NiceScroll; +} diff --git a/types/jquery.nicescroll/jquery.nicescroll-tests.ts b/types/jquery.nicescroll/jquery.nicescroll-tests.ts index 2d4599d8d6..f4362530f9 100644 --- a/types/jquery.nicescroll/jquery.nicescroll-tests.ts +++ b/types/jquery.nicescroll/jquery.nicescroll-tests.ts @@ -1,23 +1,23 @@ -//cases from documentation +// cases from documentation // 1. Simple mode, it styles document scrollbar: -$(function() { +$(() => { $("body").niceScroll(); }); // 2. Instance with object returned: let nice; -$(function() { +$(() => { nice = $("body").niceScroll(); }); // 3. Style a DIV and change cursor color: -$(function() { - $("#thisdiv").niceScroll({cursorcolor:"#00F"}); +$(() => { + $("#thisdiv").niceScroll({cursorcolor: "#00F"}); }); // 4. DIV with "wrapper", formed by two divs, the first is the vieport, the latter is the content: -$(function() { - $("#viewportdiv").niceScroll("#wrapperdiv",{cursorcolor:"#00F"}); +$(() => { + $("#viewportdiv").niceScroll("#wrapperdiv", {cursorcolor: "#00F"}); }); // 5. Get nicescroll object: @@ -33,9 +33,9 @@ $("#mydiv").getNiceScroll().resize(); $("#mydiv").getNiceScroll(0).doScrollLeft(1, 2); // Scroll X Axis $("#mydiv").getNiceScroll(0).doScrollTop(1, 14); // Scroll Y Axis -//other cases +// other cases $(".ui-grid-viewport").niceScroll({ cursorcolor: "#fff", cursorwidth: "8px", autohidemode: "leave" -}); \ No newline at end of file +}); diff --git a/types/jquery.nicescroll/tsconfig.json b/types/jquery.nicescroll/tsconfig.json index a5d8cb44a3..9d94444fc2 100644 --- a/types/jquery.nicescroll/tsconfig.json +++ b/types/jquery.nicescroll/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/jquery.nicescroll/tslint.json b/types/jquery.nicescroll/tslint.json index 8bc7a53d89..e60c15844f 100644 --- a/types/jquery.nicescroll/tslint.json +++ b/types/jquery.nicescroll/tslint.json @@ -1,3 +1,3 @@ { - "extends": "dtslint/dt.json", -} + "extends": "dtslint/dt.json" +} \ No newline at end of file From a5c7386e2ed858e62c5591f53b78b6b9cdfd733f Mon Sep 17 00:00:00 2001 From: Oren Trutner Date: Thu, 24 May 2018 17:03:35 -0700 Subject: [PATCH 17/20] Add bin-pack typings --- types/bin-pack/bin-pack-tests.ts | 8 +++++ types/bin-pack/index.d.ts | 60 ++++++++++++++++++++++++++++++++ types/bin-pack/tsconfig.json | 23 ++++++++++++ types/bin-pack/tslint.json | 1 + 4 files changed, 92 insertions(+) create mode 100644 types/bin-pack/bin-pack-tests.ts create mode 100644 types/bin-pack/index.d.ts create mode 100644 types/bin-pack/tsconfig.json create mode 100644 types/bin-pack/tslint.json diff --git a/types/bin-pack/bin-pack-tests.ts b/types/bin-pack/bin-pack-tests.ts new file mode 100644 index 0000000000..f913d53520 --- /dev/null +++ b/types/bin-pack/bin-pack-tests.ts @@ -0,0 +1,8 @@ +import * as pack from "bin-pack"; + +// $ExpectType PackResult<{ width: number; height: number; }> +const packResult = pack([ + { width: 50, height: 50 }, + { width: 25, height: 25 }, + { width: 25, height: 20 } +]); diff --git a/types/bin-pack/index.d.ts b/types/bin-pack/index.d.ts new file mode 100644 index 0000000000..0d3df98899 --- /dev/null +++ b/types/bin-pack/index.d.ts @@ -0,0 +1,60 @@ +// Type definitions for bin-pack 1.0 +// Project: https://github.com/bryanburgers/bin-pack +// Definitions by: Oren Trutner +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** + * Packs objects that have a width and a height into as small of a square as + * possible, using a binary tree bin packing algorithm. After packing, each + * object is given an (x, y) coordinate of where it would be optimally packed. + * @param bins List of rectangular bins to pack + * @param options Packing options. Use inPlace: true to modify the bins + * argument in-place. + */ +declare function pack(bins: T[], options?: pack.Options): pack.PackResult; + +declare namespace pack { + /** Packing options. */ + interface Options { + /** Use inPlace=true to add x,y fields to the bins argument. */ + inPlace?: boolean; + } + + /** Specifies the dimensions of a bin to pack. */ + interface Bin { + width: number; + height: number; + } + + /** Describes the location of a packed bin. */ + interface PackedItem { + /** X coordinate of the packed bin. */ + x: number; + + /** Y coordinate of the packed bin. */ + y: number; + + /** Width of the bin. */ + width: number; + + /** Height of the bin. */ + height: number; + + /** The original bin object. */ + item: T; + } + + /** The return value from the pack function. */ + interface PackResult { + /** Width of the bounding box around all bins. */ + width: number; + + /** Height of the bounding box around all bins. */ + height: number; + + /** List of packed bins. */ + items: Array>; + } +} + +export = pack; diff --git a/types/bin-pack/tsconfig.json b/types/bin-pack/tsconfig.json new file mode 100644 index 0000000000..6c6a41a37a --- /dev/null +++ b/types/bin-pack/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "bin-pack-tests.ts" + ] +} diff --git a/types/bin-pack/tslint.json b/types/bin-pack/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/bin-pack/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From d83700ed3bffad6b8831b03c2618f8496d918828 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Sm=C3=B3=C5=82ka?= Date: Mon, 4 Jun 2018 09:41:04 +0200 Subject: [PATCH 18/20] Replaced string with "inline" | "incell" | "popup" --- types/kendo-ui/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/kendo-ui/index.d.ts b/types/kendo-ui/index.d.ts index 95f6d5c6a0..8249153105 100644 --- a/types/kendo-ui/index.d.ts +++ b/types/kendo-ui/index.d.ts @@ -4046,7 +4046,7 @@ declare namespace kendo.ui { columnMenu?: boolean | GridColumnMenu; dataSource?: any|any|kendo.data.DataSource; detailTemplate?: string|Function; - editable?: boolean | string | GridEditable; + editable?: boolean | "inline" | "incell" | "popup" | GridEditable; excel?: GridExcel; filterable?: boolean | GridFilterable; groupable?: boolean | GridGroupable; From 9d3e786e2903c364bb296949f624a9cd5152f2a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Sm=C3=B3=C5=82ka?= Date: Mon, 4 Jun 2018 09:44:43 +0200 Subject: [PATCH 19/20] Replaced boolean with false for CalendarOptions --- types/kendo-ui/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/kendo-ui/index.d.ts b/types/kendo-ui/index.d.ts index 5da967f60b..7f4c865313 100644 --- a/types/kendo-ui/index.d.ts +++ b/types/kendo-ui/index.d.ts @@ -1848,7 +1848,7 @@ declare namespace kendo.ui { dates?: any; depth?: string; disableDates?: any|Function; - footer?: boolean|string|Function; + footer?: false | string | Function; format?: string; max?: Date; messages?: CalendarMessages; From c0934c470f101ae29e331af41c1f22e8a5932773 Mon Sep 17 00:00:00 2001 From: Joey Jan Date: Mon, 4 Jun 2018 11:01:56 -0400 Subject: [PATCH 20/20] react-native: add getRunnable method to AppRegistry (#26213) * add getRunnable method to AppRegistry * Update index.d.ts --- types/react-native/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 168db34cc5..ef574ec807 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -479,6 +479,8 @@ export namespace AppRegistry { function runApplication(appKey: string, appParameters: any): void; function registerHeadlessTask(appKey: string, task: TaskProvider): void; + + function getRunnable(appKey: string): Runnable | undefined; } export interface LayoutAnimationTypes {