diff --git a/angular-google-analytics/index.d.ts b/angular-google-analytics/index.d.ts index d83753a7b7..08d050e7dc 100644 --- a/angular-google-analytics/index.d.ts +++ b/angular-google-analytics/index.d.ts @@ -17,13 +17,13 @@ declare module 'angular' { * @summary If logging is enabled then all outbound calls are accessible via an in-memory array. * This is useful for troubleshooting and seeing the order of outbound calls with parameters. */ - log: Array; + log: Object[]; /** * @summary If in offline mode then all calls are queued to an in-memory array for future processing. * All calls queued to the offlineQueue are not outbound calls yet and hence do not show up in the log. */ - offlineQueue: Array; + offlineQueue: Object[]; /** * @summary Returns the current URL that would be sent if a `trackPage` call was made. @@ -109,7 +109,7 @@ declare module 'angular' { * @param {Object} tracker The account identifier(s). * @return {angular.google.analytics.IAnalyticsProvider} The object instance. */ - setAccount(tracker: string | Object | Array): AnalyticsProvider; + setAccount(tracker: string | Object | Object[]): AnalyticsProvider; /** * @summary Set Cookie Configuration. @@ -121,10 +121,10 @@ declare module 'angular' { /** * @summary Set cross-linked domains. - * @param {Array} domains The domains. + * @param {string[]} domains The domains. * @return {angular.google.analytics.IAnalyticsProvider} The object instance. */ - setCrossLinkDomains(domains: Array): AnalyticsProvider; + setCrossLinkDomains(domains: string[]): AnalyticsProvider; /** * @summary Set currency. diff --git a/awesomplete/index.d.ts b/awesomplete/index.d.ts index d39389f008..60a1655f79 100644 --- a/awesomplete/index.d.ts +++ b/awesomplete/index.d.ts @@ -5,7 +5,7 @@ declare class Awesomplete { constructor(input: Element | HTMLElement | string, o?: AwesompleteOptions); - static all: Array; + static all: any[]; static $$: (expr: string | NodeSelector, con?: any) => NodeList; static ITEM: (text: string, input: string) => HTMLElement; static $: { diff --git a/babel-types/index.d.ts b/babel-types/index.d.ts index 7066a57de4..ca82d11dc8 100644 --- a/babel-types/index.d.ts +++ b/babel-types/index.d.ts @@ -967,13 +967,13 @@ export function exportDefaultDeclaration(declaration?: FunctionDeclaration | Cla export function exportNamedDeclaration(declaration?: Declaration, specifiers?: ExportSpecifier[], source?: StringLiteral): ExportNamedDeclaration; export function exportSpecifier(local?: Identifier, exported?: Identifier): ExportSpecifier; export function forOfStatement(left?: VariableDeclaration | LVal, right?: Expression, body?: Statement): ForOfStatement; -export function importDeclaration(specifiers?: Array, source?: StringLiteral): ImportDeclaration; +export function importDeclaration(specifiers?: (ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier)[], source?: StringLiteral): ImportDeclaration; export function importDefaultSpecifier(local?: Identifier): ImportDefaultSpecifier; export function importNamespaceSpecifier(local?: Identifier): ImportNamespaceSpecifier; export function importSpecifier(local?: Identifier, imported?: Identifier): ImportSpecifier; export function metaProperty(meta?: string, property?: string): MetaProperty; export function classMethod(kind?: "constructor" | "method" | "get" | "set", key?: Expression, params?: Pattern[], body?: BlockStatement, computed?: boolean, _static?: boolean): ClassMethod; -export function objectPattern(properties?: Array, typeAnnotation?: TypeAnnotation): ObjectPattern; +export function objectPattern(properties?: (AssignmentProperty | RestProperty)[], typeAnnotation?: TypeAnnotation): ObjectPattern; export function spreadElement(argument?: Expression): SpreadElement; export function taggedTemplateExpression(tag?: Expression, quasi?: TemplateLiteral): TaggedTemplateExpression; export function templateElement(value?: {cooked?: string; raw?: string}, tail?: boolean): TemplateElement; @@ -1022,7 +1022,7 @@ export function unionTypeAnnotation(types?: FlowTypeAnnotation[]): UnionTypeAnno export function voidTypeAnnotation(): VoidTypeAnnotation; export function jSXAttribute(name?: JSXIdentifier | JSXNamespacedName, value?: JSXElement | StringLiteral | JSXExpressionContainer): JSXAttribute; export function jSXClosingElement(name?: JSXIdentifier | JSXMemberExpression): JSXClosingElement; -export function jSXElement(openingElement?: JSXOpeningElement, closingElement?: JSXClosingElement, children?: Array, selfClosing?: boolean): JSXElement; +export function jSXElement(openingElement?: JSXOpeningElement, closingElement?: JSXClosingElement, children?: (JSXElement | JSXExpressionContainer | JSXText)[], selfClosing?: boolean): JSXElement; export function jSXEmptyExpression(): JSXEmptyExpression; export function jSXExpressionContainer(expression?: Expression): JSXExpressionContainer; export function jSXIdentifier(name?: string): JSXIdentifier; diff --git a/babylonjs/index.d.ts b/babylonjs/index.d.ts index b09f328993..cb2fe3b982 100644 --- a/babylonjs/index.d.ts +++ b/babylonjs/index.d.ts @@ -1609,7 +1609,7 @@ declare namespace BABYLON { private _trackConvolver; private _scene; id: number; - soundCollection: Array; + soundCollection: Sound[]; private _isMainTrack; private _connectedAnalyser; private _options; @@ -2164,7 +2164,7 @@ declare namespace BABYLON { boxMinimum: number[]; boxMaximum: number[]; worldMatrixFromCache: any; - subMeshes: Array; + subMeshes: SerializedSubMesh[]; checkCollisions: boolean; } interface SerializedSubMesh { @@ -4153,7 +4153,7 @@ declare namespace BABYLON { * @param type the type of simplification to run. * @param successCallback optional success callback to be called after the simplification finished processing all settings. */ - simplify(settings: Array, parallelProcessing?: boolean, simplificationType?: SimplificationType, successCallback?: (mesh?: Mesh, submeshIndex?: number) => void): void; + simplify(settings: ISimplificationSettings[], parallelProcessing?: boolean, simplificationType?: SimplificationType, successCallback?: (mesh?: Mesh, submeshIndex?: number) => void): void; /** * Optimization of the mesh's indices, in case a mesh has duplicated vertices. * The function will only reorder the indices and will not remove unused vertices to avoid problems with submeshes. @@ -4227,12 +4227,12 @@ declare namespace BABYLON { static Center(meshesOrMinMaxVector: any): Vector3; /** * Merge the array of meshes into a single mesh for performance reasons. - * @param {Array} meshes - The vertices source. They should all be of the same material. Entries can empty + * @param {Mesh[]} meshes - The vertices source. They should all be of the same material. Entries can empty * @param {boolean} disposeSource - When true (default), dispose of the vertices from the source meshes * @param {boolean} allow32BitsIndices - When the sum of the vertices > 64k, this must be set to true. * @param {Mesh} meshSubclass - When set, vertices inserted into this Mesh. Meshes can then be merged into a Mesh sub-class. */ - static MergeMeshes(meshes: Array, disposeSource?: boolean, allow32BitsIndices?: boolean, meshSubclass?: Mesh): Mesh; + static MergeMeshes(meshes: Mesh[], disposeSource?: boolean, allow32BitsIndices?: boolean, meshSubclass?: Mesh): Mesh; } } @@ -4648,7 +4648,7 @@ declare namespace BABYLON { constructor(quality: number, distance: number, optimizeMesh?: boolean); } interface ISimplificationTask { - settings: Array; + settings: ISimplificationSettings[]; simplificationType: SimplificationType; mesh: Mesh; successCallback?: () => void; @@ -4671,7 +4671,7 @@ declare namespace BABYLON { QUADRATIC = 0, } class DecimationTriangle { - vertices: Array; + vertices: DecimationVertex[]; normal: Vector3; error: number[]; deleted: boolean; @@ -4679,7 +4679,7 @@ declare namespace BABYLON { borderFactor: number; deletePending: boolean; originalOffset: number; - constructor(vertices: Array); + constructor(vertices: DecimationVertex[]); } class DecimationVertex { position: Vector3; @@ -6034,8 +6034,8 @@ declare namespace BABYLON { rootUrl: string; sceneFilename: string; loadedMeshes: AbstractMesh[]; - loadedParticleSystems: Array; - loadedSkeletons: Array; + loadedParticleSystems: ParticleSystem[]; + loadedSkeletons: Skeleton[]; onSuccess: (task: IAssetTask) => void; onError: (task: IAssetTask) => void; isCompleted: boolean; @@ -6472,7 +6472,7 @@ declare namespace BABYLON.Internals { declare namespace BABYLON { interface IAnimatable { - animations: Array; + animations: Animation[]; } interface ISize { width: number; diff --git a/babyparse/index.d.ts b/babyparse/index.d.ts index f43e506427..89fc94b4b1 100644 --- a/babyparse/index.d.ts +++ b/babyparse/index.d.ts @@ -120,7 +120,7 @@ declare namespace BabyParse { */ interface ParseResult { data: any[]; - errors: Array; + errors: ParseError[]; meta: ParseMeta; } interface ParserConstructor { new (config: ParseConfig): Parser; } diff --git a/bingmaps/Microsoft.Maps.AdvancedShapes.d.ts b/bingmaps/Microsoft.Maps.AdvancedShapes.d.ts index 32ac20a874..a304fdd18b 100644 --- a/bingmaps/Microsoft.Maps.AdvancedShapes.d.ts +++ b/bingmaps/Microsoft.Maps.AdvancedShapes.d.ts @@ -26,10 +26,10 @@ declare namespace Microsoft.Maps.AdvancedShapes { export class Polygon implements Entity { - constructor(locations: Array, options?: PolygonOptions); + constructor(locations: Location[], options?: PolygonOptions); getFillColor(): Color; - getLocations(): Array; + getLocations(): Location[]; getStrokeColor(): Color; getStrokeDashArray(): string; getStrokeThickness(): number; diff --git a/bingmaps/Microsoft.Maps.Directions.d.ts b/bingmaps/Microsoft.Maps.Directions.d.ts index f71c9f909c..8cbe641ae3 100644 --- a/bingmaps/Microsoft.Maps.Directions.d.ts +++ b/bingmaps/Microsoft.Maps.Directions.d.ts @@ -50,10 +50,10 @@ declare namespace Microsoft.Maps.Directions { export interface Disambiguation { - businessSuggestions?: Array; + businessSuggestions?: BusinessDisambiguationSuggestion[]; hasMoreSuggestions?: boolean; headerText?: string; - locationSuggestions?: Array; + locationSuggestions?: LocationDisambiguationSuggestion[]; } export interface WaypointEventArgs { @@ -149,7 +149,7 @@ declare namespace Microsoft.Maps.Directions { avoidTraffic?: boolean; distanceUnit?: DistanceUnit; maxRoutes?: number; - routeAvoidance?: Array; + routeAvoidance?: RouteAvoidance[]; routeDraggable?: boolean; routeIndex?: boolean; routeMode?: RouteMode; @@ -166,12 +166,12 @@ declare namespace Microsoft.Maps.Directions { calculateDirections(): void; clearDisplay(): void; dispose(): void; - getAllWaypoints(): Array; + getAllWaypoints(): Waypoint[]; getMap(): Map; getNearbyMajorRoads(location: Location, callback: any, errorCallback: any, userData: any): void; getRenderOptions(): DirectionsRenderOptions; getRequestOptions(): DirectionsRequestOptions; - getRouteResult(): Array; + getRouteResult(): Route[]; removeWaypoint(waypoint: Waypoint): void; removeWaypoint(index: number): void; resetDirections(options: ResetDirectionsOptions): void; @@ -197,8 +197,8 @@ declare namespace Microsoft.Maps.Directions { } export interface DirectionsEventArgs { - routeSummary: Array; - route: Array; + routeSummary: RouteSummary[]; + route: Route[]; } export interface DisambiguationRenderEventArgs { @@ -232,7 +232,7 @@ declare namespace Microsoft.Maps.Directions { export interface DirectionsStep { - childItineraryItems: Array; + childItineraryItems: DirectionsStep[]; coordinate: Location; distance: string; durationInSeconds: number; @@ -249,7 +249,7 @@ declare namespace Microsoft.Maps.Directions { transitStepIcon: string; transitStopId: string; transitTerminus: string; - warnings: Array; + warnings: DirectionsStepWarning[]; } export enum IconType { @@ -360,17 +360,17 @@ declare namespace Microsoft.Maps.Directions { } export interface Route { - routeLegs: Array; + routeLegs: RouteLeg[]; } export interface RouteLeg { endTime: Date; endWaypointLocation: Location; - itineraryItems: Array; + itineraryItems: DirectionsStep[]; originalRouteIndex: number; startTime: Date; startWaypointLocation: Location; - subLegs: Array; + subLegs: RouteSubLeg[]; summary: RouteSummary; } diff --git a/bingmaps/Microsoft.Maps.Search.d.ts b/bingmaps/Microsoft.Maps.Search.d.ts index df0b7d81ff..d954db105a 100644 --- a/bingmaps/Microsoft.Maps.Search.d.ts +++ b/bingmaps/Microsoft.Maps.Search.d.ts @@ -36,7 +36,7 @@ declare namespace Microsoft.Maps.Search { parsedAddress: Address; parsedKeyword: string; parsedSeparator: string; - results: Array; + results: PlaceResult[]; } export enum LocationPrecision { @@ -62,7 +62,7 @@ declare namespace Microsoft.Maps.Search { export interface PlaceResult { bestView: LocationRect; location: GeocodeLocation; - locations: Array; + locations: GeocodeLocation[]; matchCode: MatchCode; matchConfidence: MatchConfidence; name: string; @@ -93,7 +93,7 @@ declare namespace Microsoft.Maps.Search { export interface SearchRegion { address: Address; - geocodeLocations: Array; + geocodeLocations: GeocodeLocation[]; explicitLocation: GeocodeLocation; mapBounds: LocationRect; matchCode: MatchCode; @@ -115,12 +115,12 @@ declare namespace Microsoft.Maps.Search { } export interface SearchResponse { - alternateSearchRegions: Array; + alternateSearchRegions: SearchRegion[]; hasMore: boolean; - parseResults: Array; + parseResults: SearchParseResult[]; responseSummary: SearchResponseSummary; searchRegion: SearchRegion; - searchResults: Array; + searchResults: SearchResult[]; } export interface SearchResponseSummary { diff --git a/bingmaps/Microsoft.Maps.VenueMaps.d.ts b/bingmaps/Microsoft.Maps.VenueMaps.d.ts index 10c1db8dbc..22e518e57e 100644 --- a/bingmaps/Microsoft.Maps.VenueMaps.d.ts +++ b/bingmaps/Microsoft.Maps.VenueMaps.d.ts @@ -40,12 +40,12 @@ declare namespace Microsoft.Maps.VenueMaps { export interface Floor { name: string; - primitives: Array; + primitives: Primitive[]; zoomRange: number[]; } export interface Footprint { - polygons: Array; + polygons: Polygon[]; zoomRange: number[]; } @@ -54,7 +54,7 @@ declare namespace Microsoft.Maps.VenueMaps { CenterLongitude: number; DefaultFloor: string; FloorHeader: string; - Floors: Array; + Floors: Floor[]; Footprint: Footprint; MapId: string; MapType: string; @@ -68,7 +68,7 @@ declare namespace Microsoft.Maps.VenueMaps { } export interface NearbyVenueOptions { - callback?: (maps: Array) => any; + callback?: (maps: VenueMap[]) => any; location?: Location; map?: Map; radius?: number; @@ -77,7 +77,7 @@ declare namespace Microsoft.Maps.VenueMaps { export interface Polygon { bounds: LocationRect; center: Location; - locations: Array; + locations: Location[]; } export interface Primitive { @@ -89,7 +89,7 @@ declare namespace Microsoft.Maps.VenueMaps { center: Location; floor: Floor; id: string; - locations: Array; + locations: Location[]; name: string; highlight(): void; @@ -105,7 +105,7 @@ declare namespace Microsoft.Maps.VenueMaps { defaultFloor: string; directory: Directory; floorHeader: string; - floors: Array; + floors: Floor[]; footprint: Footprint; id: string; name: string; diff --git a/bingmaps/index.d.ts b/bingmaps/index.d.ts index 1ad9e43e85..8e39ba6a06 100644 --- a/bingmaps/index.d.ts +++ b/bingmaps/index.d.ts @@ -36,7 +36,7 @@ declare namespace Microsoft.Maps { static fromCorners(northwest: Location, southeast: Location): LocationRect; static fromEdges(north: number, west: number, south: number, east: number, altitude: number, altitudeReference: AltitudeReference): LocationRect; - static fromLocations(locations: Array): LocationRect; + static fromLocations(locations: Location[]): LocationRect; static fromString(value: string): LocationRect; clone(): LocationRect; @@ -139,9 +139,9 @@ declare namespace Microsoft.Maps { setOptions(options: MapOptions): void; setView(options: ViewOptions): void; tryLocationToPixel(locations: Location, reference?: PixelReference): Point; - tryLocationToPixel(locations: Array, reference?: PixelReference): Array; + tryLocationToPixel(locations: Location[], reference?: PixelReference): Point[]; tryPixelToLocation(points: Point, reference?: PixelReference): Location; - tryPixelToLocation(points: Array, reference?: PixelReference): Array; + tryPixelToLocation(points: Point[], reference?: PixelReference): Location[]; } export class MapMode { @@ -327,7 +327,7 @@ declare namespace Microsoft.Maps { export interface InfoboxOptions { - actions?: Array; + actions?: Action[]; description?: string; htmlContent?: string; id?: string; @@ -355,14 +355,14 @@ declare namespace Microsoft.Maps { export class Polyline implements Entity { - constructor(locations: Array, options?: PolylineOptions); + constructor(locations: Location[], options?: PolylineOptions); - getLocations(): Array; + getLocations(): Location[]; getStrokeColor(): Color; getStrokeDashArray(): string; getStrokeThickness(): number; getVisible(): boolean; - setLocations(locations: Array): void; + setLocations(locations: Location[]): void; setOptions(options: PolylineOptions): void; toString(): string; } @@ -381,10 +381,10 @@ declare namespace Microsoft.Maps { export class Polygon implements Entity { - constructor(locations: Array, options?: PolygonOptions); + constructor(locations: Location[], options?: PolygonOptions); getFillColor(): Color; - getLocations(): Array; + getLocations(): Location[]; getStrokeColor(): Color; getStrokeDashArray(): string; getStrokeThickness(): number; diff --git a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-3.0.0.d.ts b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-3.0.0.d.ts index 612c659d34..80d466209b 100644 --- a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-3.0.0.d.ts +++ b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-3.0.0.d.ts @@ -43,8 +43,8 @@ export interface DatetimepickerOptions { collapse?: boolean; language?: string; defaultDate?: moment.Moment | Date | string; - disabledDates?: Array; - enabledDates?: Array; + disabledDates?: (moment.Moment | Date | string)[]; + enabledDates?: (moment.Moment | Date | string)[]; icons?: DatetimepickerIcons; useStrict?: boolean; direction?: string; diff --git a/bootstrap.v3.datetimepicker/index.d.ts b/bootstrap.v3.datetimepicker/index.d.ts index 22f5b42495..b97e32980e 100644 --- a/bootstrap.v3.datetimepicker/index.d.ts +++ b/bootstrap.v3.datetimepicker/index.d.ts @@ -105,7 +105,7 @@ export interface Datetimepicker { */ defaultDate(date: string | Date | moment.Moment | boolean): void; /**Returns the options.disabledDates option. - * NOTES: probably should be: disabledDates(): boolean | Array; see: DatetimepickerOptions + * NOTES: probably should be: disabledDates(): boolean | moment.Moment[]; see: DatetimepickerOptions */ disabledDates(): boolean | any; /**Takes an array of values and disallows the user to select those days. @@ -113,7 +113,7 @@ export interface Datetimepicker { * Also calling this function removes the configuration of options.enabledDates if such exist. * Note: These values are matched with Day granularity. */ - disabledDates(dates: boolean | Array): void; + disabledDates(dates: boolean | (string | Date | moment.Moment)[]): void; /**Returns the options.disabledHours option. * NOTES: probably should be: disabledHours(): boolean | number[]; see: DatetimepickerOptions */ @@ -126,13 +126,13 @@ export interface Datetimepicker { * eg { "0": [, ], "1": [...] } * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1498 */ - disabledTimeIntervals(): boolean | Array>; + disabledTimeIntervals(): boolean | moment.Moment[][]; /**Disables time selection between the given moments * eg: [[moment({ h: 0 }), moment({ h: 8 })], [moment({ h: 18 }), moment({ h: 24 })]] */ - disabledTimeIntervals(value: boolean | Array>): void; + disabledTimeIntervals(value: boolean | moment.Moment[][]): void; /**Returns the options.enabledDates option - * NOTES: probably should be: enabledDates(): boolean | Array; see: DatetimepickerOptions + * NOTES: probably should be: enabledDates(): boolean | moment.Moment[]; see: DatetimepickerOptions */ enabledDates(): boolean | any; /**Takes an array of values and allows the user to select only from those days. @@ -140,7 +140,7 @@ export interface Datetimepicker { * Also calling this function removes the configuration of options.disabledDates if such exist. * Note: These values are matched with Day granularity. */ - enabledDates(dates: boolean | Array): void; + enabledDates(dates: boolean | (string | Date | moment.Moment)[]): void; /**Returns the options.enabledHours option. * NOTES: probably should be: enabledHours(): boolean | number[]; see: DatetimepickerOptions */ @@ -334,7 +334,7 @@ export interface DatetimepickerOptions { * eg disabledDates = ["2010-10-10"]; -> disabledDated will be { "2010-01-01": true } * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1499 */ - disabledDates?: boolean | Array | any; + disabledDates?: boolean | (moment.Moment | Date | string)[] | any; /**Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days * @default: false * IMPORTANT! The getter returns an Object NOT an Array, with keys being the hours, values being true. @@ -346,14 +346,14 @@ export interface DatetimepickerOptions { * eg: [[moment({ h: 0 }), moment({ h: 8 })], [moment({ h: 18 }), moment({ h: 24 })]] * @default: false */ - disabledTimeIntervals?: boolean | Array>; + disabledTimeIntervals?: boolean | moment.Moment[][]; /**Disables selection of dates NOT in the array, e.g. holidays * @default: false * IMPORTANT! The getter returns an Object NOT an Array, with keys being the dates, values being true. * eg enabledDates = ["2010-10-10"]; -> enabledDated will be { "2010-01-01": true } * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1499 */ - enabledDates?: boolean | Array | any; + enabledDates?: boolean | (moment.Moment | Date | string)[] | any; /**Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days * @default: false * IMPORTANT! The getter returns an Object NOT an Array, with keys being the hours, values being true. diff --git a/bytebuffer/index.d.ts b/bytebuffer/index.d.ts index f3c2b68c11..cf78d16dc0 100644 --- a/bytebuffer/index.d.ts +++ b/bytebuffer/index.d.ts @@ -139,7 +139,7 @@ declare class ByteBuffer { /** * Concatenates multiple ByteBuffers into one. */ - static concat( buffers: Array, encoding?: string | boolean, litteEndian?: boolean, noAssert?: boolean ): ByteBuffer; + static concat( buffers: (ByteBuffer | ArrayBuffer | Uint8Array | string)[], encoding?: string | boolean, litteEndian?: boolean, noAssert?: boolean ): ByteBuffer; /** * Decodes a base64 encoded string to a ByteBuffer. diff --git a/c3/index.d.ts b/c3/index.d.ts index 184cc1d747..52ed9bedbc 100644 --- a/c3/index.d.ts +++ b/c3/index.d.ts @@ -10,7 +10,7 @@ export as namespace c3; declare namespace c3 { - type PrimitiveArray = Array; + type PrimitiveArray = (string | boolean | number)[]; type FormatFunction = (v: any, id: string, i: number, j: number) => void; interface TargetIds { @@ -124,7 +124,7 @@ declare namespace c3 { * This option accepts array including object that has axis, start, end and class. The keys start, end and class are optional. * axis must be x, y or y2. start and end should be the value where regions start and end. If not specified, the edge values will be used. If timeseries x axis, date string, Date object and unixtime integer can be used. If class is set, the region element will have it as class. */ - regions?: Array; + regions?: RegionOptions[]; legend?: LegendOptions; @@ -262,11 +262,11 @@ declare namespace c3 { /** * Load data from a multidimensional array, with the first element containing the data names, the following containing related data in that order. */ - rows?: Array; + rows?: PrimitiveArray[]; /* * Load data from a multidimensional array, with each element containing an array consisting of a datum name and associated data values. */ - columns?: Array; + columns?: PrimitiveArray[]; /** * Used if loading JSON via data.url */ @@ -304,7 +304,7 @@ declare namespace c3 { /** * Set groups for the data for stacking. */ - groups?: Array; + groups?: string[][]; /** * Set y axis the data related to. y and y2 can be used. */ @@ -586,7 +586,7 @@ declare namespace c3 { * This option accepts array including object that has value, text, position and class. text, position and class are optional. For position, start, middle and end (default) are available. * If x axis is category axis, value can be category name. If x axis is timeseries axis, value can be date string, Date object and unixtime integer. */ - lines?: Array; + lines?: LineOptions[]; }; y?: { /** @@ -597,7 +597,7 @@ declare namespace c3 { * Show additional grid lines along y axis. * This option accepts array including object that has value, text, position and class. */ - lines?: Array; + lines?: LineOptions[]; }; } @@ -825,8 +825,8 @@ declare namespace c3 { url?: string; json?: Object; keys?: { x?: string; value: string[]; } - rows?: Array; - columns?: Array; + rows?: PrimitiveArray[]; + columns?: PrimitiveArray[]; classes?: { [key: string]: string }; categories?: string[]; axes?: { [key: string]: string }; @@ -856,8 +856,8 @@ declare namespace c3 { flow(args: { json?: Object; keys?: { x?: string; value: string[]; } - rows?: Array; - columns?: Array; + rows?: PrimitiveArray[]; + columns?: PrimitiveArray[]; to?: any; length?: number; duration?: number; @@ -891,7 +891,7 @@ declare namespace c3 { * Update groups for the targets. * @param groups This argument needs to be an Array that includes one or more Array that includes target ids to be grouped. */ - groups(groups: Array): void; + groups(groups: string[][]): void; xgrids: GridOperations; diff --git a/cachefactory/index.d.ts b/cachefactory/index.d.ts index 37e9f88a9d..dc5e07282b 100644 --- a/cachefactory/index.d.ts +++ b/cachefactory/index.d.ts @@ -370,7 +370,7 @@ declare namespace CacheFactory { * Call.removeExpired() on all registered caches.Returns a hash of any expired items, keyed by cache id. * @returns {} */ - removeExpiredFromAll(): Array<{ [key: string]: Array<{ [key: string]: any }> }>; + removeExpiredFromAll(): { [key: string]: { [key: string]: any }[] }[]; } export interface IUtils { @@ -391,7 +391,7 @@ declare namespace CacheFactory { export interface IBinaryHeap { (w?: IWeightFunc, c?: ICompareFunc): void; - heap: Array; + heap: HeapItem[]; weightFunc: IWeightFunc; compareFunc: ICompareFunc; diff --git a/canvas-gauges/index.d.ts b/canvas-gauges/index.d.ts index a21b0d93bb..10c6233aa4 100644 --- a/canvas-gauges/index.d.ts +++ b/canvas-gauges/index.d.ts @@ -198,7 +198,7 @@ declare namespace CanvasGauges { public pixelRatio: number; public static redraw(): any; - public static collection: Array; + public static collection: SmartCanvas[]; } export class DomObserver { diff --git a/cassandra-driver/index.d.ts b/cassandra-driver/index.d.ts index f0ecef7f61..09464a7724 100644 --- a/cassandra-driver/index.d.ts +++ b/cassandra-driver/index.d.ts @@ -47,8 +47,8 @@ export namespace policies { } interface DCAwareRoundRobinPolicy extends LoadBalancingPolicy { - localHostsArray: Array; - remoteHostsArray: Array; + localHostsArray: Host[]; + remoteHostsArray: Host[]; } interface RoundRobinPolicyStatic { @@ -346,15 +346,15 @@ export namespace types { warnings: string[], customPayload: any }; - rows: Array; + rows: Row[]; rowLength: number; - columns: Array<{ [key: string]: string; }>; + columns: { [key: string]: string }[]; pageState: string; nextPage: any; // function first(): Row; getPageState(): string; - getColumns(): Array<{ [key: string]: string; }>; + getColumns(): { [key: string]: string }[]; } interface ResultStreamStatic { @@ -370,12 +370,12 @@ export namespace types { } interface RowStatic { - new (columns: Array<{ [key: string]: string; }>): Row; + new (columns: { [key: string]: string }[]): Row; } interface Row { get(columnName: string | number): { [key: string]: any; }; - values(): Array<{ [key: string]: any; }>; + values(): { [key: string]: any; }[]; keys(): string[]; forEach(callback: Callback): void; } @@ -489,7 +489,7 @@ export interface QueryOptions { retry?: policies.retry.RetryPolicy; retryOnTimeout?: boolean; routingIndexes?: number[]; - routingKey?: Buffer | Array; + routingKey?: Buffer | Buffer[]; routingNames?: string[]; serialConsistency?: number; timestamp?: number | _Long; @@ -505,7 +505,7 @@ export interface Client extends events.EventEmitter { keyspace: string; metadata: metadata.Metadata; - batch(queries: string[] | Array<{ query: string, params?: any }>, options: QueryOptions, callback: ResultCallback): void; + batch(queries: string[] | { query: string, params?: any }[], options: QueryOptions, callback: ResultCallback): void; connect(callback: Callback): void; eachRow(query: string, params?: any, options?: QueryOptions, rowCallback?: Callback, callback?: Callback): void; execute(query: string, params?: any, options?: QueryOptions, callback?: ResultCallback): void; @@ -543,7 +543,7 @@ export interface HostMap extends events.EventEmitter { remove(key: string): void; removeMultiple(keys: string[]): void; set(key: string, value: Host): void; - values(): Array; + values(): Host[]; } export interface EncoderStatic { @@ -629,7 +629,7 @@ export namespace metadata { } interface Aggregate { - argumentTypes: Array<{ code: number, info: any }>; + argumentTypes: { code: number, info: any }[]; finalFunction: string; initCondition: string; keyspaceName: string; @@ -641,7 +641,7 @@ export namespace metadata { interface DataTypeInfo { code: number; - info: string | DataTypeInfo | Array; + info: string | DataTypeInfo | DataTypeInfo[]; options: { frozen: boolean, reversed: boolean @@ -656,9 +656,9 @@ export namespace metadata { interface DataCollection { bloomFilterFalsePositiveChance: number; caching: caching; - clusterKeys: Array<{ c: ColumnInfo, index: number, order: string }>; + clusterKeys: { c: ColumnInfo, index: number, order: string }[]; clusteringOrder: string[]; - columns: Array; + columns: ColumnInfo[]; columnsByName: { [key: string]: ColumnInfo }; comment: string; compactionClass: string; @@ -672,7 +672,7 @@ export namespace metadata { maxIndexInterval?: number; minIndexInterval?: number; name: string; - partitionKeys: Array<{ c: ColumnInfo, index: number }>; + partitionKeys: { c: ColumnInfo, index: number }[]; populateCacheOnFlush: boolean; readRepairChance: number; speculateRetry: string; @@ -687,8 +687,8 @@ export namespace metadata { interface IndexStatic { new (name: string, target: string, kind: IndexType, options: Object): Index; - fromRows(indexRows: Array): Array; - fromColumnRows(columnRows: Array, columnsByName: { [key: string]: ColumnInfo }): Array; + fromRows(indexRows: types.Row[]): Index[]; + fromColumnRows(columnRows: types.Row[], columnsByName: { [key: string]: ColumnInfo }): Index[]; } interface Index { @@ -715,9 +715,9 @@ export namespace metadata { interface Metadata { clearPrepared(): void; - getAggregate(keyspaceName: string, name: string, signature: string[] | Array<{ code: number, info: any }>, callback: Callback): void; + getAggregate(keyspaceName: string, name: string, signature: string[] | { code: number, info: any }[], callback: Callback): void; getAggregates(keyspaceName: string, name: string, callback: Callback): void; - getFunction(keyspaceName: string, name: string, signature: string[] | Array<{ code: number, info: any }>, callback: Callback): void; + getFunction(keyspaceName: string, name: string, signature: string[] | { code: number, info: any }[], callback: Callback): void; getFunctions(keyspaceName: string, name: string, callback: Callback): void; getMaterializedView(keyspaceName: string, name: string, callback: Callback): void; getReplicas(keyspaceName: string, tokenBuffer: Buffer): any[]; @@ -734,7 +734,7 @@ export namespace metadata { interface SchemaFunction { argumentNames: string[]; - argumentTypes: Array<{ code: number, info: any }>; + argumentTypes: { code: number, info: any }[]; body: string; calledOnNullInput: boolean; keyspaceName: string; @@ -749,7 +749,7 @@ export namespace metadata { } interface TableMetadata extends DataCollection { - indexes: Array; + indexes: Index[]; indexInterval?: number; isCompact: boolean; memtableFlushPeriod: number; diff --git a/code/index.d.ts b/code/index.d.ts index 174215f5d8..2417bbd29b 100644 --- a/code/index.d.ts +++ b/code/index.d.ts @@ -10,7 +10,7 @@ export function fail(message: string): void; /** Returns the total number of assertions created using the expect() method. */ export function count(): number; /** Returns an array of the locations where incomplete assertions were declared or null if no incomplete assertions found. */ -export function incomplete(): Array | null; +export function incomplete(): string[] | null; /** Returns the filename, line number, and column number of where the error was created. */ export function thrownAt(error?: Error): CodeError; /** Configure code. */ diff --git a/d3-array/index.d.ts b/d3-array/index.d.ts index 1d1aae3b67..665ecf8a5d 100644 --- a/d3-array/index.d.ts +++ b/d3-array/index.d.ts @@ -106,7 +106,7 @@ export function extent(array: T[]): [T, T] | [undefined, unde /** * Return the min and max simultaneously. */ -export function extent(array: Array): [T | Primitive, T | Primitive] | [undefined, undefined]; +export function extent(array: (T | Primitive)[]): [T | Primitive, T | Primitive] | [undefined, undefined]; /** * Return the min and max simultaneously. @@ -224,7 +224,7 @@ export function merge(arrays: T[][]): T[]; * For each adjacent pair of elements in the specified array, returns a new array of tuples of elements i and i - 1. * Returns the empty array if the input array has fewer than two elements. */ -export function pairs(array: T[]): Array<[T, T]>; +export function pairs(array: T[]): [T, T][]; /** * Given the specified array, return an array corresponding to the list of indices in 'keys'. @@ -282,7 +282,7 @@ export function zip(...arrays: T[][]): T[][]; // Histogram // -------------------------------------------------------------------------------------- -export interface Bin extends Array { +export interface Bin extends Datum[] { x0: Value; x1: Value; } @@ -300,7 +300,7 @@ export type ThresholdArrayGenerator = (values: Valu export interface HistogramGenerator { - (data: Datum[]): Array>; + (data: Datum[]): Bin[]; value(): (d: Datum, i: number, data: Datum[]) => Value; value(valueAccessor: (d: Datum, i: number, data: Datum[]) => Value): this; domain(): (values: Value[]) => [Value, Value]; diff --git a/d3-chord/index.d.ts b/d3-chord/index.d.ts index 727ec0bea8..22008a3f62 100644 --- a/d3-chord/index.d.ts +++ b/d3-chord/index.d.ts @@ -28,7 +28,7 @@ export interface ChordGroup { } export interface Chords extends Array { - groups: Array; + groups: ChordGroup[]; } export interface ChordLayout { diff --git a/d3-collection/index.d.ts b/d3-collection/index.d.ts index 8990598cbf..25ac3d7118 100644 --- a/d3-collection/index.d.ts +++ b/d3-collection/index.d.ts @@ -20,8 +20,8 @@ export function keys(object: Object): string[]; export function values(object: { [key: string]: T }): T[]; export function values(object: Object): any[]; -export function entries(object: { [key: string]: T }): Array<{ key: string, value: T }>; -export function entries(object: Object): Array<{ key: string, value: any }>; +export function entries(object: { [key: string]: T }): { key: string, value: T }[]; +export function entries(object: Object): { key: string, value: any }[]; // --------------------------------------------------------------------- // map / Map @@ -36,7 +36,7 @@ export interface Map { clear(): void; keys(): string[]; values(): T[]; - entries(): Array<{ key: string, value: T }>; + entries(): { key: string, value: T }[]; each(func: (value: T, key: string, map: Map) => void): void; empty(): boolean; size(): number; @@ -73,7 +73,7 @@ export interface Set { export function set(): Set; export function set(d3Set: Set): Set; -export function set(array: Array): Set; +export function set(array: (string | Stringifiable)[]): Set; export function set(array: T[], key: (value: T, index?: number, array?: T[]) => string): Set; // --------------------------------------------------------------------- @@ -93,14 +93,14 @@ export function set(array: T[], key: (value: T, index?: number, array?: T[]) // Also note, that the below return types for Nest.entries(...), Nest.map(...) and Nest.object(...) strictly only work, // if AT LEAST ONE KEY was set. This seems a reasonable constraint in practice, given the intent of the nest operator. -// Otherwise, an additional '| Array | RollupType` would have to be added to the union type. This would cover +// Otherwise, an additional '| Datum[] | RollupType` would have to be added to the union type. This would cover // cases (a) without key or rollup (b) without key but with rollup. However, again, the union types make it cumbersome // without much gain. -export interface NestedArray extends Array<{ key: string, values: NestedArray | Array | undefined, value: RollupType | undefined }> { } -export interface NestedMap extends Map | Array | RollupType> { } +export interface NestedArray extends Array<{ key: string, values: NestedArray | Datum[] | undefined, value: RollupType | undefined }> { } +export interface NestedMap extends Map | Datum[] | RollupType> { } export interface NestedObject { - [key: string]: NestedObject | Array | RollupType; + [key: string]: NestedObject | Datum[] | RollupType; } interface Nest { @@ -110,7 +110,7 @@ interface Nest { rollup(func: (values: Datum[]) => RollupType): this; map(array: Datum[]): Map; // more specifically it returns NestedMap object(array: Datum[]): { [key: string]: any }; // more specifically it returns NestedObject - entries(array: Datum[]): Array<{ key: string; values: any; value: RollupType | undefined }>; // more specifically it returns NestedArray + entries(array: Datum[]): { key: string; values: any; value: RollupType | undefined }[]; // more specifically it returns NestedArray } export function nest(): Nest; diff --git a/d3-dsv/index.d.ts b/d3-dsv/index.d.ts index 3dec5cb71f..a97457eb23 100644 --- a/d3-dsv/index.d.ts +++ b/d3-dsv/index.d.ts @@ -31,12 +31,12 @@ export function csvParse(csvString: string, row: (r // csvParseRows(...) ======================================================================== export function csvParseRows(csvString: string): string[][]; -export function csvParseRows(csvString: string, row: (rawRow: string[], index: number) => ParsedRow): Array; +export function csvParseRows(csvString: string, row: (rawRow: string[], index: number) => ParsedRow): ParsedRow[]; // csvFormat(...) ============================================================================ -export function csvFormat(rows: Array): string; -export function csvFormat(rows: Array, columns: string[]): string; +export function csvFormat(rows: DSVRowAny[]): string; +export function csvFormat(rows: DSVRowAny[], columns: string[]): string; // csvFormatRows(...) ======================================================================== @@ -54,12 +54,12 @@ export function tsvParse(tsvString: string, row: (r // tsvParseRows(...) ======================================================================== export function tsvParseRows(tsvString: string): string[][]; -export function tsvParseRows(tsvString: string, row: (rawRow: string[], index: number) => MappedRow): Array; +export function tsvParseRows(tsvString: string, row: (rawRow: string[], index: number) => MappedRow): MappedRow[]; // tsvFormat(...) ============================================================================ -export function tsvFormat(rows: Array): string; -export function tsvFormat(rows: Array, columns: string[]): string; +export function tsvFormat(rows: DSVRowAny[]): string; +export function tsvFormat(rows: DSVRowAny[], columns: string[]): string; // tsvFormatRows(...) ======================================================================== @@ -73,9 +73,9 @@ export interface DSV { parse(dsvString: string): DSVParsedArray; parse(dsvString: string, row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow): DSVParsedArray; parseRows(dsvString: string): string[][]; - parseRows(dsvString: string, row: (rawRow: string[], index: number) => ParsedRow): Array; - format(rows: Array): string; - format(rows: Array, columns: string[]): string; + parseRows(dsvString: string, row: (rawRow: string[], index: number) => ParsedRow): ParsedRow[]; + format(rows: DSVRowAny[]): string; + format(rows: DSVRowAny[], columns: string[]): string; formatRows(rows: string[][]): string; } diff --git a/d3-force/index.d.ts b/d3-force/index.d.ts index cde2539150..ff169270f5 100644 --- a/d3-force/index.d.ts +++ b/d3-force/index.d.ts @@ -114,7 +114,7 @@ export interface Simulation; + nodes(): NodeDatum[]; /** * Set the simulation’s nodes to the specified array of objects, initialize their positions and velocities if necessary, * and then re-initialize any bound forces; Returns the simulation. @@ -142,7 +142,7 @@ export interface Simulation): this; + nodes(nodesData: NodeDatum[]): this; /** * Return the current alpha of the simulation, which defaults to 1. @@ -307,7 +307,7 @@ export interface Simulation(nodesData?: Array): Simulation; +export function forceSimulation(nodesData?: NodeDatum[]): Simulation; /** * Create a new simulation with the specified array of nodes and no forces. * If nodes is not specified, it defaults to the empty array. @@ -321,7 +321,7 @@ export function forceSimulation(nodesData * * @param nodesData Optional array of nodes data, defaults to empty array. */ -export function forceSimulation>(nodesData?: Array): Simulation; +export function forceSimulation>(nodesData?: NodeDatum[]): Simulation; // ---------------------------------------------------------------------- // Forces @@ -351,7 +351,7 @@ export interface Force): void; + initialize?(nodes: NodeDatum[]): void; } @@ -421,7 +421,7 @@ export interface ForceCollide extends For /** * Returns the current radius accessor function. */ - radius(): (node: NodeDatum, i: number, nodes: Array) => number; + radius(): (node: NodeDatum, i: number, nodes: NodeDatum[]) => number; /** * Set the radius used in collision detection to a constant number for each node. * @@ -444,7 +444,7 @@ export interface ForceCollide extends For * @param radius A radius accessor function which is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. * The function returns a radius. */ - radius(radius: (node: NodeDatum, i: number, nodes: Array) => number): this; + radius(radius: (node: NodeDatum, i: number, nodes: NodeDatum[]) => number): this; /** * Return the current strength, which defaults to 0.7. @@ -514,7 +514,7 @@ export function forceCollide(radius: numb * @param radius A radius accessor function which is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. * The function returns a radius. */ -export function forceCollide(radius: (node: NodeDatum, i: number, nodes: Array) => number): ForceCollide; +export function forceCollide(radius: (node: NodeDatum, i: number, nodes: NodeDatum[]) => number): ForceCollide; // Link ---------------------------------------------------------------- @@ -530,7 +530,7 @@ export interface ForceLink; + links(): LinkDatum[]; /** * Set the array of links associated with this force, recompute the distance and strength parameters for each link, and return this force. * @@ -546,12 +546,12 @@ export interface ForceLink): this; + links(links: LinkDatum[]): this; /** * Return the current node id accessor, which defaults to the numeric index of the node. */ - id(): (node: NodeDatum, i: number, nodesData: Array) => (string | number); + id(): (node: NodeDatum, i: number, nodesData: NodeDatum[]) => (string | number); /** * Set the node id accessor to the specified function and return this force. * @@ -565,12 +565,12 @@ export interface ForceLink) => string): this; + id(id: (node: NodeDatum, i: number, nodesData: NodeDatum[]) => string): this; /** * Return the current distance accessor, which defaults to implying a default distance of 30. */ - distance(): (link: LinkDatum, i: number, links: Array) => number; + distance(): (link: LinkDatum, i: number, links: LinkDatum[]) => number; /** * Set the distance accessor to use the specified constant number for all links, * re-evaluates the distance accessor for each link, and returns this force. @@ -595,13 +595,13 @@ export interface ForceLink) => number): this; + distance(distance: (link: LinkDatum, i: number, links: LinkDatum[]) => number): this; /** * Return the current strength accessor. * For details regarding the default behavior see: {@link https://github.com/d3/d3-force#link_strength} */ - strength(): (link: LinkDatum, i: number, links: Array) => number; + strength(): (link: LinkDatum, i: number, links: LinkDatum[]) => number; /** * Set the strenght accessor to use the specified constant number for all links, * re-evaluates the strength accessor for each link, and returns this force. @@ -626,7 +626,7 @@ export interface ForceLink) => number): this; + strength(strength: (link: LinkDatum, i: number, links: LinkDatum[]) => number): this; /** * Return the current iteration count which defaults to 1. @@ -665,7 +665,7 @@ export function forceLink>(links: Array): ForceLink; +export function forceLink>(links: LinksDatum[]): ForceLink; // Many Body ---------------------------------------------------------------- @@ -684,7 +684,7 @@ export interface ForceManyBody extends Fo * * For details regarding the default behavior see: {@link https://github.com/d3/d3-force#manyBody_strength} */ - strength(): (d: NodeDatum, i: number, data: Array) => number; + strength(): (d: NodeDatum, i: number, data: NodeDatum[]) => number; /** * Set the strength accessor to the specified constant strength for all nodes, re-evaluates the strength accessor for each node, and * returns this force. @@ -719,7 +719,7 @@ export interface ForceManyBody extends Fo * @param strength A strength accessor function which is invoked for each node in the simulation, being passed the node, its zero-based index and the complete array of nodes. * The function returns the strength. */ - strength(strength: (d: NodeDatum, i: number, data: Array) => number): this; + strength(strength: (d: NodeDatum, i: number, data: NodeDatum[]) => number): this; /** * Return the current value of the Barnes–Hut approximation criterion , which defaults to 0.9 @@ -801,7 +801,7 @@ export interface ForceX extends Force) => number; + strength(): (d: NodeDatum, i: number, data: NodeDatum[]) => number; /** * Set the strength accessor to the specified constant strength for all nodes, re-evaluates the strength accessor for each node, and returns this force. * @@ -838,12 +838,12 @@ export interface ForceX extends Force) => number): this; + strength(strength: (d: NodeDatum, i: number, data: NodeDatum[]) => number): this; /** * Return the current x-accessor, which defaults to a function returning 0 for all nodes. */ - x(): (d: NodeDatum, i: number, data: Array) => number; + x(): (d: NodeDatum, i: number, data: NodeDatum[]) => number; /** * Set the x-coordinate accessor to the specified number, re-evaluates the x-accessor for each node, * and returns this force. @@ -868,7 +868,7 @@ export interface ForceX extends Force) => number): this; + x(x: (d: NodeDatum, i: number, data: NodeDatum[]) => number): this; } /** @@ -906,7 +906,7 @@ export function forceX(x: number): ForceX * @param x A x-coordinate accessor function which is invoked for each node in the simulation, being passed the node and its zero-based index. * The function returns the x-coordinate. */ -export function forceX(x: (d: NodeDatum, i: number, data: Array) => number): ForceX; +export function forceX(x: (d: NodeDatum, i: number, data: NodeDatum[]) => number): ForceX; /** * The y-positioning force pushes nodes towards a desired position along the given dimension with a configurable strength. @@ -919,7 +919,7 @@ export interface ForceY extends Force) => number; + strength(): (d: NodeDatum, i: number, data: NodeDatum[]) => number; /** * Set the strength accessor to the specified constant strength for all nodes, re-evaluates the strength accessor for each node, and returns this force. * @@ -956,12 +956,12 @@ export interface ForceY extends Force) => number): this; + strength(strength: (d: NodeDatum, i: number, data: NodeDatum[]) => number): this; /** * Return the current y-accessor, which defaults to a function returning 0 for all nodes. */ - y(): (d: NodeDatum, i: number, data: Array) => number; + y(): (d: NodeDatum, i: number, data: NodeDatum[]) => number; /** * Set the y-coordinate accessor to the specified number, re-evaluates the y-accessor for each node, * and returns this force. @@ -986,7 +986,7 @@ export interface ForceY extends Force) => number): this; + y(y: (d: NodeDatum, i: number, data: NodeDatum[]) => number): this; } /** @@ -1024,4 +1024,4 @@ export function forceY(y: number): ForceY * @param y A y-coordinate accessor function which is invoked for each node in the simulation, being passed the node and its zero-based index. * The function returns the y-coordinate. */ -export function forceY(y: (d: NodeDatum, i: number, data: Array) => number): ForceY; +export function forceY(y: (d: NodeDatum, i: number, data: NodeDatum[]) => number): ForceY; diff --git a/d3-hierarchy/index.d.ts b/d3-hierarchy/index.d.ts index 7eef444875..182cebfd4a 100644 --- a/d3-hierarchy/index.d.ts +++ b/d3-hierarchy/index.d.ts @@ -18,7 +18,7 @@ export interface HierarchyNode { readonly depth: number; readonly height: number; parent: HierarchyNode | null; - children?: Array>; + children?: HierarchyNode[]; /** * Aggregated numeric value as calculated by sum(value), * if previously invoked. @@ -29,11 +29,11 @@ export interface HierarchyNode { * hierarchical data was created from tabular data using stratify() */ readonly id?: string; - ancestors(): Array>; - descendants(): Array>; - leaves(): Array>; - path(target: HierarchyNode): Array>; - links(): Array>; + ancestors(): HierarchyNode[]; + descendants(): HierarchyNode[]; + leaves(): HierarchyNode[]; + path(target: HierarchyNode): HierarchyNode[]; + links(): HierarchyLink[]; sum(value: (d: Datum) => number): this; sort(compare: (a: HierarchyNode, b: HierarchyNode) => number): this; each(func: (node: HierarchyNode) => void): this; @@ -43,7 +43,7 @@ export interface HierarchyNode { } -export function hierarchy(data: Datum, children?: (d: Datum) => (Array | null)): HierarchyNode; +export function hierarchy(data: Datum, children?: (d: Datum) => (Datum[] | null)): HierarchyNode; // ----------------------------------------------------------------------- // Stratify @@ -53,11 +53,11 @@ export function hierarchy(data: Datum, children?: (d: Datum) => (Array { - (data: Array): HierarchyNode; - id(): (d: Datum, i: number, data: Array) => (string | null | '' | undefined); - id(id: (d: Datum, i?: number, data?: Array) => (string | null | '' | undefined)): this; - parentId(): (d: Datum, i: number, data: Array) => (string | null | '' | undefined); - parentId(parentId: (d: Datum, i?: number, data?: Array) => (string | null | '' | undefined)): this; + (data: Datum[]): HierarchyNode; + id(): (d: Datum, i: number, data: Datum[]) => (string | null | '' | undefined); + id(id: (d: Datum, i?: number, data?: Datum[]) => (string | null | '' | undefined)): this; + parentId(): (d: Datum, i: number, data: Datum[]) => (string | null | '' | undefined); + parentId(parentId: (d: Datum, i?: number, data?: Datum[]) => (string | null | '' | undefined)): this; } export function stratify(): StratifyOperator; @@ -78,7 +78,7 @@ export interface HierarchyPointNode { readonly depth: number; readonly height: number; parent: HierarchyPointNode | null; - children?: Array>; + children?: HierarchyPointNode[]; /** * Aggregated numeric value as calculated by sum(value), * if previously invoked. @@ -89,11 +89,11 @@ export interface HierarchyPointNode { * hierarchical data was created from tabular data using stratify() */ readonly id?: string; - ancestors(): Array>; - descendants(): Array>; - leaves(): Array>; - path(target: HierarchyPointNode): Array>; - links(): Array>; + ancestors(): HierarchyPointNode[]; + descendants(): HierarchyPointNode[]; + leaves(): HierarchyPointNode[]; + path(target: HierarchyPointNode): HierarchyPointNode[]; + links(): HierarchyPointLink[]; sum(value: (d: Datum) => number): this; sort(compare: (a: HierarchyPointNode, b: HierarchyPointNode) => number): this; each(func: (node: HierarchyPointNode) => void): this; @@ -148,7 +148,7 @@ export interface HierarchyRectangularNode { readonly depth: number; readonly height: number; parent: HierarchyRectangularNode | null; - children?: Array>; + children?: HierarchyRectangularNode[]; /** * Aggregated numeric value as calculated by sum(value), * if previously invoked. @@ -159,11 +159,11 @@ export interface HierarchyRectangularNode { * hierarchical data was created from tabular data using stratify() */ readonly id?: string; - ancestors(): Array>; - descendants(): Array>; - leaves(): Array>; - path(target: HierarchyRectangularNode): Array>; - links(): Array>; + ancestors(): HierarchyRectangularNode[]; + descendants(): HierarchyRectangularNode[]; + leaves(): HierarchyRectangularNode[]; + path(target: HierarchyRectangularNode): HierarchyRectangularNode[]; + links(): HierarchyRectangularLink[]; sum(value: (d: Datum) => number): this; sort(compare: (a: HierarchyRectangularNode, b: HierarchyRectangularNode) => number): this; each(func: (node: HierarchyRectangularNode) => void): this; @@ -256,7 +256,7 @@ export interface HierarchyCircularNode { readonly depth: number; readonly height: number; parent: HierarchyCircularNode | null; - children?: Array>; + children?: HierarchyCircularNode[]; /** * Aggregated numeric value as calculated by sum(value), * if previously invoked. @@ -267,11 +267,11 @@ export interface HierarchyCircularNode { * hierarchical data was created from tabular data using stratify() */ readonly id?: string; - ancestors(): Array>; - descendants(): Array>; - leaves(): Array>; - path(target: HierarchyCircularNode): Array>; - links(): Array>; + ancestors(): HierarchyCircularNode[]; + descendants(): HierarchyCircularNode[]; + leaves(): HierarchyCircularNode[]; + path(target: HierarchyCircularNode): HierarchyCircularNode[]; + links(): HierarchyCircularLink[]; sum(value: (d: Datum) => number): this; sort(compare: (a: HierarchyCircularNode, b: HierarchyCircularNode) => number): this; each(func: (node: HierarchyCircularNode) => void): this; @@ -310,6 +310,6 @@ export interface PackCircle { // For invocation of packEnclose the x and y coordinates are mandatory. It seems easier to just comment // on the mandatory nature, then to create separate interfaces and having to deal with recasting. -export function packSiblings(circles: Array): Array; +export function packSiblings(circles: Datum[]): Datum[]; -export function packEnclose(circles: Array): { r: number, x: number, y: number }; +export function packEnclose(circles: Datum[]): { r: number, x: number, y: number }; diff --git a/d3-interpolate/index.d.ts b/d3-interpolate/index.d.ts index 6059984077..2c68ad8d82 100644 --- a/d3-interpolate/index.d.ts +++ b/d3-interpolate/index.d.ts @@ -72,14 +72,14 @@ export function interpolateTransformSvg(a: string, b: string): ((t: number) => s export function interpolateZoom(a: ZoomView, b: ZoomView): ZoomInterpolator; -export function quantize(interpolator: ((t: number) => T), n: number): Array; +export function quantize(interpolator: ((t: number) => T), n: number): T[]; // Color interpolation related export var interpolateRgb: ColorGammaInterpolationFactory; -export function interpolateRgbBasis(colors: Array): ((t: number) => string); -export function interpolateRgbBasisClosed(colors: Array): ((t: number) => string); +export function interpolateRgbBasis(colors: (string | ColorCommonInstance)[]): ((t: number) => string); +export function interpolateRgbBasisClosed(colors: (string | ColorCommonInstance)[]): ((t: number) => string); export function interpolateHsl(a: string | ColorCommonInstance, b: string | ColorCommonInstance): ((t: number) => string); export function interpolateHslLong(a: string | ColorCommonInstance, b: string | ColorCommonInstance): ((t: number) => string); diff --git a/d3-polygon/index.d.ts b/d3-polygon/index.d.ts index 40dbaa4f4f..b75efdf2ee 100644 --- a/d3-polygon/index.d.ts +++ b/d3-polygon/index.d.ts @@ -10,14 +10,14 @@ * * @param polygon Array of coordinates , and so on. */ -export function polygonArea(polygon: Array<[number, number]>): number; +export function polygonArea(polygon: [number, number][]): number; /** * Returns the centroid of the specified polygon. * * @param polygon Array of coordinates , and so on. */ -export function polygonCentroid(polygon: Array<[number, number]>): [number, number]; +export function polygonCentroid(polygon: [number, number][]): [number, number]; /** * Returns the convex hull of the specified points using Andrew’s monotone chain algorithm. @@ -26,7 +26,7 @@ export function polygonCentroid(polygon: Array<[number, number]>): [number, numb * * @param points Array of coordinates , and so on. */ -export function polygonHull(points: Array<[number, number]>): Array<[number, number]> | null; +export function polygonHull(points: [number, number][]): [number, number][] | null; /** * Returns true if and only if the specified point is inside the specified polygon. @@ -34,11 +34,11 @@ export function polygonHull(points: Array<[number, number]>): Array<[number, num * @param polygon Array of coordinates , and so on. * @param point Coordinates of point */ -export function polygonContains(polygon: Array<[number, number]>, point: [number, number]): boolean; +export function polygonContains(polygon: [number, number][], point: [number, number]): boolean; /** * Returns the length of the perimeter of the specified polygon. * * @param polygon Array of coordinates , and so on. */ -export function polygonLength(polygon: Array<[number, number]>): number; +export function polygonLength(polygon: [number, number][]): number; diff --git a/d3-quadtree/index.d.ts b/d3-quadtree/index.d.ts index 5607060fd5..5d0b5a8853 100644 --- a/d3-quadtree/index.d.ts +++ b/d3-quadtree/index.d.ts @@ -31,12 +31,12 @@ export interface Quadtree { extent(extend: [[number, number], [number, number]]): this; cover(x: number, y: number): this; add(datum: T): this; - addAll(data: Array): this; + addAll(data: T[]): this; remove(datum: T): this; - removeAll(data: Array): this; + removeAll(data: T[]): this; copy(): Quadtree; root(): QuadtreeInternalNode | QuadtreeLeaf; - data(): Array; + data(): T[]; size(): number; find(x: number, y: number, radius?: number): T | undefined; visit(callback: (node: QuadtreeInternalNode | QuadtreeLeaf, x0: number, y0: number, x1: number, y1: number) => (void | boolean)): this; @@ -45,6 +45,6 @@ export interface Quadtree { export function quadtree(): Quadtree<[number, number]>; -export function quadtree(data: Array<[number, number]>): Quadtree<[number, number]>; +export function quadtree(data: [number, number][]): Quadtree<[number, number]>; export function quadtree(): Quadtree; -export function quadtree(data: Array, x?: (d: T) => number, y?: (d: T) => number): Quadtree; +export function quadtree(data: T[], x?: (d: T) => number, y?: (d: T) => number): Quadtree; diff --git a/d3-scale/index.d.ts b/d3-scale/index.d.ts index 81eda9f7a4..1f4996675e 100644 --- a/d3-scale/index.d.ts +++ b/d3-scale/index.d.ts @@ -28,14 +28,14 @@ export interface ScaleLinear { */ invert(value: number | { valueOf(): number }): number; domain(): number[]; - domain(domain: Array): this; - range(): Array; - range(range: Array): this; + domain(domain: (number | { valueOf(): number })[]): this; + range(): Range[]; + range(range: Range[]): this; /** * Important: While value should come out of range R, this is method is only applicable to * values that can be coerced to numeric. */ - rangeRound(range: Array): this; + rangeRound(range: (number | { valueOf(): number })[]): this; clamp(): boolean; clamp(clamp: boolean): ScaleLinear; interpolate(): InterpolatorFactory; @@ -64,14 +64,14 @@ export interface ScalePower { */ invert(value: number | { valueOf(): number }): number; domain(): number[]; - domain(domain: Array): this; - range(): Array; - range(range: Array): this; + domain(domain: (number | { valueOf(): number })[]): this; + range(): Range[]; + range(range: Range[]): this; /** * Important: While value should come out of range R, this is method is only applicable to * values that can be coerced to numeric. */ - rangeRound(range: Array): this; + rangeRound(range: (number | { valueOf(): number })[]): this; clamp(): boolean; clamp(clamp: boolean): this; interpolate(): InterpolatorFactory; @@ -107,14 +107,14 @@ export interface ScaleLogarithmic { */ invert(value: number | { valueOf(): number }): number; domain(): number[]; - domain(domain: Array): this; - range(): Array; - range(range: Array): this; + domain(domain: (number | { valueOf(): number })[]): this; + range(): Range[]; + range(range: Range[]): this; /** * Important: While value should come out of range R, this is method is only applicable to * values that can be coerced to numeric. */ - rangeRound(range: Array): this; + rangeRound(range: (number | { valueOf(): number })[]): this; clamp(): boolean; clamp(clamp: boolean): this; interpolate(): InterpolatorFactory; @@ -146,9 +146,9 @@ export interface ScaleIdentity { */ invert(value: number | { valueOf(): number }): number; domain(): number[]; - domain(domain: Array): this; + domain(domain: (number | { valueOf(): number })[]): this; range(): number[]; - range(range: Array): this; + range(range: (Range | { valueOf(): number })[]): this; ticks(count?: number): number[]; tickFormat(count?: number, specifier?: string): ((d: number | { valueOf(): number }) => string); nice(count?: number): this; @@ -169,23 +169,23 @@ export interface ScaleTime { * values that can be coerced to numeric. Otherwise, returns NaN */ invert(value: number | { valueOf(): number }): Date; - domain(): Array; - domain(domain: Array): this; - range(): Array; - range(range: Array): this; + domain(): Date[]; + domain(domain: Date[]): this; + range(): Range[]; + range(range: Range[]): this; /** * Important: While value should come out of range R, this is method is only applicable to * values that can be coerced to numeric. */ - rangeRound(range: Array): this; + rangeRound(range: (number | { valueOf(): number })[]): this; clamp(): boolean; clamp(clamp: boolean): this; interpolate(): InterpolatorFactory; interpolate(interpolate: InterpolatorFactory): this; interpolate(interpolate: InterpolatorFactory): ScaleTime; - ticks(): Array; - ticks(count: number): Array; - ticks(interval: TimeInterval): Array; + ticks(): Date[]; + ticks(count: number): Date[]; + ticks(interval: TimeInterval): Date[]; tickFormat(): ((d: Date) => string); tickFormat(count: number, specifier?: string): ((d: Date) => string); tickFormat(interval: TimeInterval, specifier?: string): ((d: Date) => string); @@ -256,8 +256,8 @@ export interface ScaleQuantize { invertExtent(value: Range): [number, number]; domain(): [number, number]; domain(domain: [number | { valueOf(): number }, number | { valueOf(): number }]): this; - range(): Array; - range(range: Array): this; + range(): Range[]; + range(range: Range[]): this; ticks(count?: number): number[]; tickFormat(count?: number, specifier?: string): ((d: number | { valueOf(): number }) => string); nice(count?: number): this; @@ -275,9 +275,9 @@ export interface ScaleQuantile { (value: number | { valueOf(): number }): Range; invertExtent(value: Range): [number, number]; domain(): number[]; - domain(domain: Array): this; - range(): Array; - range(range: Array): this; + domain(domain: (number | { valueOf(): number })[]): this; + range(): Range[]; + range(range: Range[]): this; quantiles(): number[]; copy(): ScaleQuantile; } @@ -297,10 +297,10 @@ export interface ScaleThreshold { * values that can be coerced to numeric. Otherwise, returns NaN */ invertExtent(value: Range): [Domain, Domain] | [undefined, Domain] | [Domain, undefined] | [undefined, undefined]; - domain(): Array; - domain(domain: Array): this; - range(): Array; - range(range: Array): this; + domain(): Domain[]; + domain(domain: Domain[]): this; + range(): Range[]; + range(range: Range[]): this; copy(): ScaleThreshold; } @@ -314,17 +314,17 @@ export function scaleThreshold(): export interface ScaleOrdinal { (x: Domain): Range; - domain(): Array; - domain(domain: Array): this; - range(): Array; - range(range: Array): this; + domain(): Domain[]; + domain(domain: Domain[]): this; + range(): Range[]; + range(range: Range[]): this; unknown(): Range | { name: 'implicit' }; unknown(value: Range | { name: 'implicit' }): this; copy(): ScaleOrdinal; } -export function scaleOrdinal(range?: Array): ScaleOrdinal; -export function scaleOrdinal(range?: Array): ScaleOrdinal; +export function scaleOrdinal(range?: Range[]): ScaleOrdinal; +export function scaleOrdinal(range?: Range[]): ScaleOrdinal; export const scaleImplicit: { name: 'implicit' }; @@ -335,8 +335,8 @@ export const scaleImplicit: { name: 'implicit' }; export interface ScaleBand { (x: Domain): number | undefined; - domain(): Array; - domain(domain: Array): this; + domain(): Domain[]; + domain(domain: Domain[]): this; range(): [number, number]; range(range: [number | { valueOf(): number }, number | { valueOf(): number }]): this; rangeRound(range: [number | { valueOf(): number }, number | { valueOf(): number }]): this; @@ -370,8 +370,8 @@ export function scaleBand(): ScaleBand { (x: Domain): number | undefined; - domain(): Array; - domain(domain: Array): this; + domain(): Domain[]; + domain(domain: Domain[]): this; range(): [number, number]; range(range: [number | { valueOf(): number }, number | { valueOf(): number }]): this; rangeRound(range: [number | { valueOf(): number }, number | { valueOf(): number }]): this; diff --git a/d3-selection/index.d.ts b/d3-selection/index.d.ts index bbad735dbb..f01fcbd7a8 100644 --- a/d3-selection/index.d.ts +++ b/d3-selection/index.d.ts @@ -65,7 +65,7 @@ export type CustomEventParameters = { /** * Callback type for selections and transitions */ -export type ValueFn = (this: Element, datum: Datum, index: number, groups: Array | ArrayLike) => Result; +export type ValueFn = (this: Element, datum: Datum, index: number, groups: Element[] | ArrayLike) => Result; /** @@ -239,7 +239,7 @@ interface Selection(selector: ValueFn | ArrayLike>): Selection; + selectAll(selector: ValueFn>): Selection; // Modifying ------------------------------- @@ -699,7 +699,7 @@ interface Selection(data: Array, key?: ValueFn): Selection; + data(data: NewDatum[], key?: ValueFn): Selection; /** * Joins the data returned by the specified value function with the selected elements, returning a new selection that it represents * the update selection: the elements successfully bound to data. Also defines the enter and exit selections on @@ -731,7 +731,7 @@ interface Selection(data: ValueFn>, key?: ValueFn): Selection; + data(data: ValueFn, key?: ValueFn): Selection; /** * Return the enter selection: placeholder nodes for each datum that had no corresponding DOM element @@ -850,7 +850,7 @@ interface Selection; + nodes(): GElement[]; /** * Returns the total number of elements in this selection. @@ -983,7 +983,7 @@ export function touch(container: ContainerElement, touches: TouchList, identifie * @param container Container element relative to which coordinates are calculated. * @param touches TouchList to be used. */ -export function touches(container: ContainerElement, touches?: TouchList): Array<[number, number]>; +export function touches(container: ContainerElement, touches?: TouchList): [number, number][]; // --------------------------------------------------------------------------- // local.js related diff --git a/d3-shape/index.d.ts b/d3-shape/index.d.ts index b66afe4bf2..ffb2f5daa8 100644 --- a/d3-shape/index.d.ts +++ b/d3-shape/index.d.ts @@ -61,25 +61,25 @@ export interface PieArcDatum { export interface Pie { - (this: This, data: Array, ...args: any[]): Array>; - value(): (d: Datum, i: number, data: Array) => number; + (this: This, data: Datum[], ...args: any[]): PieArcDatum[]; + value(): (d: Datum, i: number, data: Datum[]) => number; value(value: number): this; - value(value: (d: Datum, i: number, data: Array) => number): this; + value(value: (d: Datum, i: number, data: Datum[]) => number): this; sort(): ((a: Datum, b: Datum) => number) | null; sort(comparator: (a: Datum, b: Datum) => number): this; sort(comparator: null): this; sortValues(): ((a: number, b: number) => number) | null; sortValues(comparator: (a: number, b: number) => number): this; sortValues(comparator: null): this; - startAngle(): (this: This, data: Array, ...args: any[]) => number; + startAngle(): (this: This, data: Datum[], ...args: any[]) => number; startAngle(angle: number): this; - startAngle(angle: (this: This, data: Array, ...args: any[]) => number): this; - endAngle(): (this: This, data: Array, ...args: any[]) => number; + startAngle(angle: (this: This, data: Datum[], ...args: any[]) => number): this; + endAngle(): (this: This, data: Datum[], ...args: any[]) => number; endAngle(angle: number): this; - endAngle(angle: (this: This, data: Array, ...args: any[]) => number): this; - padAngle(): (this: This, data: Array, ...args: any[]) => number; + endAngle(angle: (this: This, data: Datum[], ...args: any[]) => number): this; + padAngle(): (this: This, data: Datum[], ...args: any[]) => number; padAngle(angle: number): this; - padAngle(angle: (this: This, data: Array, ...args: any[]) => number): this; + padAngle(angle: (this: This, data: Datum[], ...args: any[]) => number): this; } export function pie(): Pie; @@ -92,16 +92,16 @@ export function pie(): Pie; export interface Line { - (data: Array): string | undefined; - x(): (d: Datum, index: number, data: Array) => number; + (data: Datum[]): string | undefined; + x(): (d: Datum, index: number, data: Datum[]) => number; x(x: number): this; - x(x: (d: Datum, index: number, data: Array) => number): this; - y(): (d: Datum, index: number, data: Array) => number; + x(x: (d: Datum, index: number, data: Datum[]) => number): this; + y(): (d: Datum, index: number, data: Datum[]) => number; y(y: number): this; - y(y: (d: Datum, index: number, data: Array) => number): this; - defined(): (d: Datum, index: number, data: Array) => boolean; + y(y: (d: Datum, index: number, data: Datum[]) => number): this; + defined(): (d: Datum, index: number, data: Datum[]) => boolean; defined(defined: boolean): this; - defined(defined: (d: Datum, index: number, data: Array) => boolean): this; + defined(defined: (d: Datum, index: number, data: Datum[]) => boolean): this; curve(): CurveFactory | CurveFactoryLineOnly; curve(curve: CurveFactory | CurveFactoryLineOnly): this; context(): CanvasRenderingContext2D | null; @@ -113,16 +113,16 @@ export function line(): Line; export function line(): Line; export interface RadialLine { - (data: Array): string | undefined; - angle(): (d: Datum, index: number, data: Array) => number; + (data: Datum[]): string | undefined; + angle(): (d: Datum, index: number, data: Datum[]) => number; angle(angle: number): this; - angle(angle: (d: Datum, index: number, data: Array) => number): this; - radius(): (d: Datum, index: number, data: Array) => number; + angle(angle: (d: Datum, index: number, data: Datum[]) => number): this; + radius(): (d: Datum, index: number, data: Datum[]) => number; radius(radius: number): this; - radius(radius: (d: Datum, index: number, data: Array) => number): this; - defined(): (d: Datum, index: number, data: Array) => boolean; + radius(radius: (d: Datum, index: number, data: Datum[]) => number): this; + defined(): (d: Datum, index: number, data: Datum[]) => boolean; defined(defined: boolean): this; - defined(defined: (d: Datum, index: number, data: Array) => boolean): this; + defined(defined: (d: Datum, index: number, data: Datum[]) => boolean): this; curve(): CurveFactory | CurveFactoryLineOnly; curve(curve: CurveFactory | CurveFactoryLineOnly): this; context(): CanvasRenderingContext2D | null; @@ -139,28 +139,28 @@ export function radialLine(): RadialLine; export interface Area { - (data: Array): string | undefined; - x(): (d: Datum, index: number, data: Array) => number; + (data: Datum[]): string | undefined; + x(): (d: Datum, index: number, data: Datum[]) => number; x(x: number): this; - x(x: (d: Datum, index: number, data: Array) => number): this; - x0(): (d: Datum, index: number, data: Array) => number; + x(x: (d: Datum, index: number, data: Datum[]) => number): this; + x0(): (d: Datum, index: number, data: Datum[]) => number; x0(x0: number): this; - x0(x0: (d: Datum, index: number, data: Array) => number): this; - x1(): ((d: Datum, index: number, data: Array) => number) | null; + x0(x0: (d: Datum, index: number, data: Datum[]) => number): this; + x1(): ((d: Datum, index: number, data: Datum[]) => number) | null; x1(x: number): this; - x1(x: (d: Datum, index: number, data: Array) => number): this; - y(): (d: Datum, index: number, data: Array) => number; + x1(x: (d: Datum, index: number, data: Datum[]) => number): this; + y(): (d: Datum, index: number, data: Datum[]) => number; y(y: number): this; - y(y: (d: Datum, index: number, data: Array) => number): this; - y0(): (d: Datum, index: number, data: Array) => number; + y(y: (d: Datum, index: number, data: Datum[]) => number): this; + y0(): (d: Datum, index: number, data: Datum[]) => number; y0(y: number): this; - y0(y: (d: Datum, index: number, data: Array) => number): this; - y1(): (d: Datum, index: number, data: Array) => number; + y0(y: (d: Datum, index: number, data: Datum[]) => number): this; + y1(): (d: Datum, index: number, data: Datum[]) => number; y1(y: number): this; - y1(y: (d: Datum, index: number, data: Array) => number): this; - defined(): (d: Datum, index: number, data: Array) => boolean; + y1(y: (d: Datum, index: number, data: Datum[]) => number): this; + defined(): (d: Datum, index: number, data: Datum[]) => boolean; defined(defined: boolean): this; - defined(defined: (d: Datum, index: number, data: Array) => boolean): this; + defined(defined: (d: Datum, index: number, data: Datum[]) => boolean): this; curve(): CurveFactory; curve(curve: CurveFactory): this; context(): CanvasRenderingContext2D | null; @@ -177,28 +177,28 @@ export function area(): Area; export interface RadialArea { - (data: Array): string | undefined; - angle(): (d: Datum, index: number, data: Array) => number; + (data: Datum[]): string | undefined; + angle(): (d: Datum, index: number, data: Datum[]) => number; angle(angle: number): this; - angle(angle: (d: Datum, index: number, data: Array) => number): this; - startAngle(): (d: Datum, index: number, data: Array) => number; + angle(angle: (d: Datum, index: number, data: Datum[]) => number): this; + startAngle(): (d: Datum, index: number, data: Datum[]) => number; startAngle(angle: number): this; - startAngle(angle: (d: Datum, index: number, data: Array) => number): this; - endAngle(): ((d: Datum, index: number, data: Array) => number) | null; + startAngle(angle: (d: Datum, index: number, data: Datum[]) => number): this; + endAngle(): ((d: Datum, index: number, data: Datum[]) => number) | null; endAngle(angle: number): this; - endAngle(angle: (d: Datum, index: number, data: Array) => number): this; - radius(): (d: Datum, index: number, data: Array) => number; + endAngle(angle: (d: Datum, index: number, data: Datum[]) => number): this; + radius(): (d: Datum, index: number, data: Datum[]) => number; radius(radius: number): this; - radius(radius: (d: Datum, index: number, data: Array) => number): this; - innerRadius(): (d: Datum, index: number, data: Array) => number; + radius(radius: (d: Datum, index: number, data: Datum[]) => number): this; + innerRadius(): (d: Datum, index: number, data: Datum[]) => number; innerRadius(radius: number): this; - innerRadius(radius: (d: Datum, index: number, data: Array) => number): this; - outerRadius(): (d: Datum, index: number, data: Array) => number; + innerRadius(radius: (d: Datum, index: number, data: Datum[]) => number): this; + outerRadius(): (d: Datum, index: number, data: Datum[]) => number; outerRadius(radius: number): this; - outerRadius(radius: (d: Datum, index: number, data: Array) => number): this; - defined(): (d: Datum, index: number, data: Array) => boolean; + outerRadius(radius: (d: Datum, index: number, data: Datum[]) => number): this; + defined(): (d: Datum, index: number, data: Datum[]) => boolean; defined(defined: boolean): this; - defined(defined: (d: Datum, index: number, data: Array) => boolean): this; + defined(defined: (d: Datum, index: number, data: Datum[]) => boolean): this; curve(): CurveFactory; curve(curve: CurveFactory): this; context(): CanvasRenderingContext2D | null; @@ -308,7 +308,7 @@ export function symbol(): Symbol; export function symbol(): Symbol; export function symbol(): Symbol; -export var symbols: Array; +export var symbols: SymbolType[]; export var symbolCircle: SymbolType; @@ -329,7 +329,7 @@ export var symbolWye: SymbolType; // SeriesPoint is a [number, number] two-element Array with added // data and index properties related to the data element which formed the basis for the // SeriesPoint -export interface SeriesPoint extends number[] { +export interface SeriesPoint extends Array { 0: number; 1: number; index: number; @@ -341,15 +341,15 @@ export interface Series extends Array> { } export interface Stack { - (data: Array, ...args: any[]): Array>; + (data: Datum[], ...args: any[]): Series[]; - keys(): (this: This, data: Array, ...args: any[]) => Array; - keys(keys: Array): this; - keys(keys: (this: This, data: Array, ...args: any[]) => Array): this; + keys(): (this: This, data: Datum[], ...args: any[]) => Key[]; + keys(keys: Key[]): this; + keys(keys: (this: This, data: Datum[], ...args: any[]) => Key[]): this; - value(): (d: Datum, key: Key, j: number, data: Array) => number; + value(): (d: Datum, key: Key, j: number, data: Datum[]) => number; value(value: number): this; - value(value: (d: Datum, key: Key, j: number, data: Array) => number): this; + value(value: (d: Datum, key: Key, j: number, data: Datum[]) => number): this; order(): (series: Series) => number[]; order(order: null): this; diff --git a/d3-transition/index.d.ts b/d3-transition/index.d.ts index d0b05b07ce..f0b3cda6a8 100644 --- a/d3-transition/index.d.ts +++ b/d3-transition/index.d.ts @@ -126,7 +126,7 @@ export interface Transition(selector: ValueFn | ArrayLike>): Transition; + selectAll(selector: ValueFn>): Transition; /** * Return the selection corresponding to this transition. @@ -448,7 +448,7 @@ export interface Transition; + nodes(): GElement[]; /** * Returns the total number of elements in this transition. diff --git a/d3-voronoi/index.d.ts b/d3-voronoi/index.d.ts index 25393e9ec1..cf22264ada 100644 --- a/d3-voronoi/index.d.ts +++ b/d3-voronoi/index.d.ts @@ -23,7 +23,7 @@ export interface VoronoiPoint extends number[] { * for each point containing the respective x and y coordinates. However, it is used as a base for interface definitions, and * [[number, number], [number, number]] cannot be extended. */ -export interface VoronoiPointPair extends Array<[number, number]> { +export interface VoronoiPointPair extends [number, number][] { 0: [number, number]; 1: [number, number]; } @@ -35,7 +35,7 @@ export interface VoronoiPointPair extends Array<[number, number]> { * * The generic refers to the type of the data for the corresponding element. */ -export interface VoronoiPolygon extends Array<[number, number]> { +export interface VoronoiPolygon extends [number, number][] { /** * The input data corresponding to this Voronoi polygon. */ @@ -80,7 +80,7 @@ export interface VoronoiCell { /** * An array of indexes into diagram.edges representing the cell’s polygon. */ - halfEdges: Array; + halfEdges: number[]; } @@ -128,7 +128,7 @@ export interface VoronoiLayout { * Computes the Voronoi diagram for the specified data points. * @param data Array of data elements */ - (data: Array): VoronoiDiagram; + (data: T[]): VoronoiDiagram; /** * Return the current x-coordinate accessor, @@ -206,21 +206,21 @@ export interface VoronoiLayout { * * @param data Array of data points. */ - polygons(data: Array): Array>; + polygons(data: T[]): VoronoiPolygon[]; /** * Return the Delaunay triangulation of the specified data array as an array of triangles. * Each triangle is a three-element array of elements from data. * * @param data Array of data points. */ - triangles(data: Array): Array>; + triangles(data: T[]): VoronoiTriangle[]; /** * Return the Delaunay triangulation of the specified data array as an array of links. * Each link has source and target attributes referring to elements in data. * * @param data Array of data points. */ - links(data: Array): Array>; + links(data: T[]): VoronoiLink[]; } @@ -233,11 +233,11 @@ export interface VoronoiDiagram { /** * Array of Voronoi Edges */ - edges: Array>; + edges: VoronoiEdge[]; /** * Array of Voronoi Cells, one per input point; a cell may be null for a coincident point. */ - cells: Array | null>; + cells: (VoronoiCell | null)[]; /** * Return an array of polygons clipped to the extent, one for each cell in the diagram. * Each polygon is represented as an array of points [x, y] where x and y are the point coordinates, @@ -248,7 +248,7 @@ export interface VoronoiDiagram { * * If the cell’s site is coincident with an earlier site, the associated polygon is null. */ - polygons(): Array>; + polygons(): VoronoiPolygon[]; /** * Returns the Delaunay triangulation of the specified data array as an array of triangles. @@ -256,7 +256,7 @@ export interface VoronoiDiagram { * Since the triangulation is computed as the dual of the Voronoi diagram, and the Voronoi diagram is clipped by the extent, * a subset of the Delaunay triangulation is returned. */ - triangles(): Array>; + triangles(): VoronoiTriangle[]; /** * Returns the Delaunay triangulation of the specified data array as an array of links, one for each edge in the mesh. @@ -266,7 +266,7 @@ export interface VoronoiDiagram { * * Since the triangulation is computed as the dual of the Voronoi diagram, and the Voronoi diagram is clipped by the extent, a subset of the Delaunay links is returned. */ - links(): Array>; + links(): VoronoiLink[]; /** * Return the nearest Voronoi Site to point [x, y]. If radius is specified, only sites within radius distance are considered. diff --git a/d3/d3-v3.5.d.ts b/d3/d3-v3.5.d.ts index 5d47243790..0cced2ab9f 100644 --- a/d3/d3-v3.5.d.ts +++ b/d3/d3-v3.5.d.ts @@ -366,7 +366,7 @@ declare namespace d3 { * Creates a subselection by using a function to find descendent elements. Bound data is not inherited. * @param selector the function to find matching descendents */ - selectAll(selector: (datum: Datum, index: number, outerIndex: number) => Array | NodeList): Update; + selectAll(selector: (datum: Datum, index: number, outerIndex: number) => EventTarget[] | NodeList): Update; /** * Invoke the given function for each element in the selection. The return value of the function is ignored. @@ -766,7 +766,7 @@ declare namespace d3 { * Creates a subselection by using a function to find descendent elements. Bound data is not inherited. * @param selector the function to find matching descendents */ - selectAll(selector: (datum: Datum, index: number, outerIndex: number) => Array | NodeList): Selection; + selectAll(selector: (datum: Datum, index: number, outerIndex: number) => EventTarget[] | NodeList): Selection; /** * Creates a subselection by using a function to find descendent elements. Bound data is not inherited. @@ -774,7 +774,7 @@ declare namespace d3 { * Use this overload when data-binding a subselection (that is, sel.selectAll('.foo').data(d => ...)). The type will carry over. * @param selector the function to find matching descendents */ - selectAll(selector: (datum: Datum, index: number, outerIndex: number) => Array | NodeList): Selection; + selectAll(selector: (datum: Datum, index: number, outerIndex: number) => EventTarget[] | NodeList): Selection; /** * Invoke the given function for each element in the selection. The return value of the function is ignored. @@ -979,7 +979,7 @@ declare namespace d3 { * @param container the container element * @param touches an optional list of touches (defaults to d3.event.touches) */ - export function touches(container: EventTarget, touches?: TouchList): Array<[number, number]>; + export function touches(container: EventTarget, touches?: TouchList): [number, number][]; // NB. this is limited to primitive values due to D3's use of the <, >, and >= operators. Results get weird for object instances. /** @@ -1070,7 +1070,7 @@ declare namespace d3 { /** * Return the min and max simultaneously. */ - export function extent(array: Array): [T | Primitive, T | Primitive]; + export function extent(array: (T | Primitive)[]): [T | Primitive, T | Primitive]; /** * Return the min and max simultaneously. @@ -1340,7 +1340,7 @@ declare namespace d3 { * For each adjacent pair of elements in the specified array, returns a new array of tuples of elements i and i - 1. * Returns the empty array if the input array has fewer than two elements. */ - export function pairs(array: T[]): Array<[T, T]>; + export function pairs(array: T[]): [T, T][]; interface Nest { key(func: (datum: T) => string): Nest; @@ -1707,7 +1707,7 @@ declare namespace d3 { export function interpolate(a: number, b: number): (t: number) => number; export function interpolate(a: string, b: string): (t: number) => string; export function interpolate(a: string | Color, b: Color): (t: number) => string; - export function interpolate(a: Array, b: Color[]): (t: number) => string; + export function interpolate(a: (string | Color)[], b: Color[]): (t: number) => string; export function interpolate(a: Range[], b: Output[]): (t: number) => Output[]; export function interpolate(a: Range[], b: Range[]): (t: number) => Output[]; export function interpolate(a: { [key: string]: string | Color }, b: { [key: string]: Color }): (t: number) => { [key: string]: string }; @@ -1728,7 +1728,7 @@ declare namespace d3 { export function interpolateHcl(a: string | Color, b: string | Color): (t: number) => string; - export function interpolateArray(a: Array, b: Color[]): (t: number) => string[]; + export function interpolateArray(a: (string | Color)[], b: Color[]): (t: number) => string[]; export function interpolateArray(a: Range[], b: Range[]): (t: number) => Output[]; export function interpolateArray(a: Range[], b: Output[]): (t: number) => Output[]; @@ -1743,7 +1743,7 @@ declare namespace d3 { duration: number; }; - export var interpolators: Array<(a: any, b: any) => (t: number) => any>; + export var interpolators: ((a: any, b: any) => (t: number) => any)[]; export namespace time { export var second: Interval; @@ -1816,10 +1816,10 @@ declare namespace d3 { export function format(specifier: string): Format; export namespace format { - export function multi(formats: Array<[string, (d: Date) => boolean|number]>): Format; + export function multi(formats: [string, (d: Date) => boolean|number][]): Format; export function utc(specifier: string): Format; namespace utc { - export function multi(formats: Array<[string, (d: Date) => boolean|number]>): Format; + export function multi(formats: [string, (d: Date) => boolean|number][]): Format; } export var iso: Format; @@ -2219,7 +2219,7 @@ declare namespace d3 { y(x: number): Line; y(y: (d: T, i: number) => number): Line; - interpolate(): string | ((points: Array<[number, number]>) => string); + interpolate(): string | ((points: [number, number][]) => string); interpolate(interpolate: "linear"): Line; interpolate(interpolate: "linear-closed"): Line; interpolate(interpolate: "step"): Line; @@ -2233,7 +2233,7 @@ declare namespace d3 { interpolate(interpolate: "cardinal-open"): Line; interpolate(interpolate: "cardinal-closed"): Line; interpolate(interpolate: "monotone"): Line; - interpolate(interpolate: string | ((points: Array<[number, number]>) => string)): Line; + interpolate(interpolate: string | ((points: [number, number][]) => string)): Line; tension(): number; tension(tension: number): Line; @@ -2257,7 +2257,7 @@ declare namespace d3 { angle(angle: number): Radial; angle(angle: (d: T, i: number) => number): Radial; - interpolate(): string | ((points: Array<[number, number]>) => string); + interpolate(): string | ((points: [number, number][]) => string); interpolate(interpolate: "linear"): Radial; interpolate(interpolate: "linear-closed"): Radial; interpolate(interpolate: "step"): Radial; @@ -2271,7 +2271,7 @@ declare namespace d3 { interpolate(interpolate: "cardinal-open"): Radial; interpolate(interpolate: "cardinal-closed"): Radial; interpolate(interpolate: "monotone"): Radial; - interpolate(interpolate: string | ((points: Array<[number, number]>) => string)): Radial; + interpolate(interpolate: string | ((points: [number, number][]) => string)): Radial; tension(): number; tension(tension: number): Radial; @@ -2311,7 +2311,7 @@ declare namespace d3 { y1(y1: number): Area; y1(y1: (d: T, i: number) => number): Area; - interpolate(): string | ((points: Array<[number, number]>) => string); + interpolate(): string | ((points: [number, number][]) => string); interpolate(interpolate: "linear"): Area; interpolate(interpolate: "step"): Area; interpolate(interpolate: "step-before"): Area; @@ -2321,7 +2321,7 @@ declare namespace d3 { interpolate(interpolate: "cardinal"): Area; interpolate(interpolate: "cardinal-open"): Area; interpolate(interpolate: "monotone"): Area; - interpolate(interpolate: string | ((points: Array<[number, number]>) => string)): Area; + interpolate(interpolate: string | ((points: [number, number][]) => string)): Area; tension(): number; tension(tension: number): Area; @@ -2361,7 +2361,7 @@ declare namespace d3 { endAngle(endAngle: number): Radial; endAngle(endAngle: (d: T, i: number) => number): Radial; - interpolate(): string | ((points: Array<[number, number]>) => string); + interpolate(): string | ((points: [number, number][]) => string); interpolate(interpolate: "linear"): Radial; interpolate(interpolate: "step"): Radial; interpolate(interpolate: "step-before"): Radial; @@ -2371,7 +2371,7 @@ declare namespace d3 { interpolate(interpolate: "cardinal"): Radial; interpolate(interpolate: "cardinal-open"): Radial; interpolate(interpolate: "monotone"): Radial; - interpolate(interpolate: string | ((points: Array<[number, number]>) => string)): Radial; + interpolate(interpolate: string | ((points: [number, number][]) => string)): Radial; tension(): number; tension(tension: number): Radial; @@ -2757,7 +2757,7 @@ declare namespace d3 { timeFormat: { (specifier: string): time.Format; utc(specifier: string): time.Format; - multi(formats: Array<[string, (d: Date) => boolean|number]>): time.Format; + multi(formats: [string, (d: Date) => boolean|number][]): time.Format; }; } @@ -3145,20 +3145,20 @@ declare namespace d3 { values(): (layer: Series, index: number) => Value[]; values(accessor: (layer: Series, index: number) => Value[]): Stack; - offset(): (data: Array<[number, number]>) => number[]; + offset(): (data: [number, number][]) => number[]; offset(offset: "silhouette"): Stack; offset(offset: "wiggle"): Stack; offset(offset: "expand"): Stack; offset(offset: "zero"): Stack; offset(offset: string): Stack; - offset(offset: (data: Array<[number, number]>) => number[]): Stack; + offset(offset: (data: [number, number][]) => number[]): Stack; - order(): (data: Array<[number, number]>) => number[]; + order(): (data: [number, number][]) => number[]; order(order: "inside-out"): Stack; order(order: "reverse"): Stack; order(order: "default"): Stack; order(order: string): Stack; - order(order: (data: Array<[number, number]>) => number[]): Stack; + order(order: (data: [number, number][]) => number[]): Stack; x(): (value: Value, index: number) => number; x(accessor: (value: Value, index: number) => number): Stack; @@ -3290,7 +3290,7 @@ declare namespace d3 { } interface Voronoi { - (data: T[]): Array<[number, number]>; + (data: T[]): [number, number][]; x(): (vertex: T) => number; x(x: (vertex: T) => number): Voronoi; @@ -3303,13 +3303,13 @@ declare namespace d3 { links(data: T[]): voronoi.Link[]; - triangles(data: T[]): Array<[T, T, T]>; + triangles(data: T[]): [T, T, T][]; } /** * @deprecated use d3.geom.voronoi().triangles() instead */ - export function delaunay(vertices: Array<[number, number]>): Array<[[number, number], [number, number], [number, number]]>; + export function delaunay(vertices: [number, number][]): [[number, number], [number, number], [number, number]][]; export function quadtree(): Quadtree<[number, number]>; export function quadtree(nodes: T[], x1?: number, y1?: number, x2?: number, y2?: number): quadtree.Quadtree; @@ -3345,12 +3345,12 @@ declare namespace d3 { extent(extent: [[number, number], [number, number]]): Quadtree; } - export function hull(vertices: Array<[number, number]>): Array<[number, number]>; + export function hull(vertices: [number, number][]): [number, number][]; export function hull(): Hull<[number, number]>; export function hull(): Hull; interface Hull { - (vertices: T[]): Array<[number, number]>; + (vertices: T[]): [number, number][]; x(): (datum: T) => number; x(x: (datum: T) => number): Hull; @@ -3359,14 +3359,14 @@ declare namespace d3 { y(y: (datum: T) => number): Hull; } - export function polygon(vertices: Array<[number, number]>): Polygon; + export function polygon(vertices: [number, number][]): Polygon; interface Polygon { area(): number; centroid(): [number, number]; - clip(subject: Array<[number, number]>): Array<[number, number]>; + clip(subject: [number, number][]): [number, number][]; } } } diff --git a/d3kit/d3kit-v1.1.0.d.ts b/d3kit/d3kit-v1.1.0.d.ts index 04488cbf6b..ca89048506 100644 --- a/d3kit/d3kit-v1.1.0.d.ts +++ b/d3kit/d3kit-v1.1.0.d.ts @@ -116,7 +116,7 @@ declare namespace d3kit { constructor(container: d3.Selection, tag?: string); - create(config: string|string[]|LayerConfig|Array|any): d3.Selection|Array>; + create(config: string|string[]|LayerConfig|LayerConfig[]|any): d3.Selection|d3.Selection[]; get(name: string): d3.Selection; has(name: string): boolean; } @@ -140,7 +140,7 @@ declare namespace d3kit { export function trim(str: string, characters: string): string; export function dasherize(str: string): string; export function $(s: Element|string): Element; - export function $$(s: Array|NodeList): Array; + export function $$(s: Node[]|NodeList): Element[]; export function isArray(value: any): boolean; export function isNumber(value: any): boolean; export function isObject(value: any): boolean; diff --git a/dc/index.d.ts b/dc/index.d.ts index 2850efb1e0..83897d7cba 100644 --- a/dc/index.d.ts +++ b/dc/index.d.ts @@ -315,8 +315,8 @@ declare namespace DC { useRightAxisGridLines: IGetSet>; childOptions: IGetSet>; rightYAxisLabel: IGetSet>; - compose: IGetSet>, ICompositeChart>; - children(): Array>; + compose: IGetSet[], ICompositeChart>; + children(): BaseMixin[]; shareColors: IGetSet>; shareTitle: IGetSet>; rightY: IGetSet<(n: any) => any, ICompositeChart>; @@ -341,7 +341,7 @@ declare namespace DC { export interface GeoChoroplethChart extends ColorMixin, BaseMixin { overlayGeoJson(json: any, name: string, keyAccessor: Accessor): void; projection: IGetSet; - geoJsons(): Array; + geoJsons(): GeoChoroplethLayer[]; geoPath(): d3.geo.Path; removeGeoJson(name: string): void; } @@ -404,7 +404,7 @@ declare namespace DC { register(chart: BaseMixin, group?: string): void; deregister(chart: BaseMixin, group?: string): void; clear(group?: string): void; - list(group?: string): Array>; + list(group?: string): BaseMixin[]; } export interface Base { diff --git a/documentdb-server/index.d.ts b/documentdb-server/index.d.ts index b96969d5b1..83e52c0eff 100644 --- a/documentdb-server/index.d.ts +++ b/documentdb-server/index.d.ts @@ -41,7 +41,7 @@ interface IQueryAPI { callback?: (error: IFeedCallbackError, resources: Object[], options: IFeedCallbackOptions) => void): IQueryResponse; filter(predicate: (document: Object) => boolean, options?: IFeedOptions, - callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; + callback?: (error: IFeedCallbackError, resources: T[], options: IFeedCallbackOptions) => void): IQueryResponse; /** * Produce a new set of documents by mapping/projecting the properties of the documents in the input document stream through the given mapping predicate. * When map is called by itself, the input document stream is the set of all documents in the current document collection. When used in a chained call, the input document stream is the set of documents returned from the previous query function. @@ -54,7 +54,7 @@ interface IQueryAPI { callback?: (error: IFeedCallbackError, resources: Object[], options: IFeedCallbackOptions) => void): IQueryResponse; map(predicate: (document: Object) => Object, options?: IFeedOptions, - callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; + callback?: (error: IFeedCallbackError, resources: T[], options: IFeedCallbackOptions) => void): IQueryResponse; /** * Produce a new set of documents by extracting a single property from each document in the input document stream. This is equivalent to a map call that projects only propertyName. * When pluck is called by itself, the input document stream is the set of all documents in the current document collection. When used in a chained call, the input document stream is the set of documents returned from the previous query function. @@ -67,7 +67,7 @@ interface IQueryAPI { callback?: (error: IFeedCallbackError, resources: Object[], options: IFeedCallbackOptions) => void): IQueryResponse; pluck(propertyName: string, options?: IFeedOptions, - callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; + callback?: (error: IFeedCallbackError, resources: T[], options: IFeedCallbackOptions) => void): IQueryResponse; /** * Flatten nested arrays from each document in the input document stream. * When flatten is called by itself, the input document stream is the set of all documents in the current document collection. When used in a chained call, the input document stream is the set of documents returned from the previous query function. @@ -80,7 +80,7 @@ interface IQueryAPI { callback?: (error: IFeedCallbackError, resources: Object[], options: IFeedCallbackOptions) => void): IQueryResponse; flatten(isShallow?: boolean, options?: IFeedOptions, - callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; + callback?: (error: IFeedCallbackError, resources: T[], options: IFeedCallbackOptions) => void): IQueryResponse; /** * Produce a new set of documents by sorting the documents in the input document stream in ascending order using the given predicate. * When sortBy is called by itself, the input document stream is the set of all documents in the current document collection. When used in a chained call, the input document stream is the set of documents returned from the previous query function. @@ -96,10 +96,10 @@ interface IQueryAPI { callback?: (error: IFeedCallbackError, resources: Object[], options: IFeedCallbackOptions) => void): IQueryResponse; sortBy(predicate: (document: Object) => string, options?: IFeedOptions, - callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; + callback?: (error: IFeedCallbackError, resources: T[], options: IFeedCallbackOptions) => void): IQueryResponse; sortBy(predicate: (document: Object) => number, options?: IFeedOptions, - callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; + callback?: (error: IFeedCallbackError, resources: T[], options: IFeedCallbackOptions) => void): IQueryResponse; /** * Produce a new set of documents by sorting the documents in the input document stream in descending order using the given predicate. * When sortByDescending is called by itself, the input document stream is the set of all documents in the current document collection. When used in a chained call, the input document stream is the set of documents returned from the previous query function. @@ -115,10 +115,10 @@ interface IQueryAPI { callback?: (error: IFeedCallbackError, resources: Object[], options: IFeedCallbackOptions) => void): IQueryResponse; sortByDescending(predicate: (document: Object) => string, options?: IFeedOptions, - callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; + callback?: (error: IFeedCallbackError, resources: T[], options: IFeedCallbackOptions) => void): IQueryResponse; sortByDescending(predicate: (document: Object) => number, options?: IFeedOptions, - callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; + callback?: (error: IFeedCallbackError, resources: T[], options: IFeedCallbackOptions) => void): IQueryResponse; /** * Terminating call for a chained query. Should be used in conjunction with the opening chain call to perform chained queries. * When value is called, the query is queued for execution with the given options and callback. @@ -128,7 +128,7 @@ interface IQueryAPI { value(options?: IFeedOptions, callback?: (error: IFeedCallbackError, resources: Object[], options: IFeedCallbackOptions) => void): IQueryResponse; value(options?: IFeedOptions, - callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): IQueryResponse; + callback?: (error: IFeedCallbackError, resources: T[], options: IFeedCallbackOptions) => void): IQueryResponse; } /** @@ -221,7 +221,7 @@ interface ICollection extends IQueryAPI { queryDocuments(collectionLink: string, filterQuery: string, options?: IFeedOptions, - callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): boolean; + callback?: (error: IFeedCallbackError, resources: T[], options: IFeedCallbackOptions) => void): boolean; queryDocuments(collectionLink: string, filterQuery: IParameterizedQuery, options?: IFeedOptions, @@ -229,7 +229,7 @@ interface ICollection extends IQueryAPI { queryDocuments(collectionLink: string, filterQuery: IParameterizedQuery, options?: IFeedOptions, - callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): boolean; + callback?: (error: IFeedCallbackError, resources: T[], options: IFeedCallbackOptions) => void): boolean; /** * Read an Attachment. @@ -275,7 +275,7 @@ interface ICollection extends IQueryAPI { callback?: (error: IFeedCallbackError, resources: Object[], options: IFeedCallbackOptions) => void): boolean; readDocuments(collectionLink: string, options?: IFeedOptions, - callback?: (error: IFeedCallbackError, resources: Array, options: IFeedCallbackOptions) => void): boolean; + callback?: (error: IFeedCallbackError, resources: T[], options: IFeedCallbackOptions) => void): boolean; /** * Replace an attachment. @@ -500,7 +500,7 @@ interface IParameterizedQuery { /** SQL query string. */ query: string; /** Parameters */ - parameters: Array; + parameters: IQueryParam[]; } /** Parameter interface for parameterized queries */ diff --git a/dot-object/index.d.ts b/dot-object/index.d.ts index bcede9dd75..19e61a6c56 100644 --- a/dot-object/index.d.ts +++ b/dot-object/index.d.ts @@ -28,7 +28,7 @@ declare namespace DotObject { * @param {Function|Array} mods * @param {Boolean} merge */ - copy(source: string, target: string, obj1: any, obj2: any, mods?: ModifierFunctionWrapper | Array, merge?: boolean): void; + copy(source: string, target: string, obj1: any, obj2: any, mods?: ModifierFunctionWrapper | ModifierFunctionWrapper[], merge?: boolean): void; /** * * Convert object to dotted-key/value pair @@ -68,7 +68,7 @@ declare namespace DotObject { * @param {Function|Array} mods * @param {Boolean} merge */ - move(source: string, target: string, obj: any, mods?: ModifierFunctionWrapper | Array, merge?: boolean): void; + move(source: string, target: string, obj: any, mods?: ModifierFunctionWrapper | ModifierFunctionWrapper[], merge?: boolean): void; /** * * Converts an object with dotted-key/value pairs to it's expanded version @@ -91,7 +91,7 @@ declare namespace DotObject { * @param {Object} obj * @param {Object} mods */ - object(obj: any, mods?: ModifierFunctionWrapper | Array): void; + object(obj: any, mods?: ModifierFunctionWrapper | ModifierFunctionWrapper[]): void; /** * * Pick a value from an object using dot notation. @@ -118,7 +118,7 @@ declare namespace DotObject { * @param {Object} obj object to be modified * @param {Function|Array} mods optional modifier */ - str(path: string, v: any, obj: Object, mods?: ModifierFunctionWrapper | Array): void; + str(path: string, v: any, obj: Object, mods?: ModifierFunctionWrapper | ModifierFunctionWrapper[]): void; /** * * Transfer a property from one object to another object. @@ -133,7 +133,7 @@ declare namespace DotObject { * @param {Function|Array} mods * @param {Boolean} merge */ - transfer(source: string, target: string, obj1: any, obj2: any, mods?: ModifierFunctionWrapper | Array, merge?: boolean): void; + transfer(source: string, target: string, obj1: any, obj2: any, mods?: ModifierFunctionWrapper | ModifierFunctionWrapper[], merge?: boolean): void; /** * * Transform an object @@ -158,7 +158,7 @@ declare namespace DotObject { * @param {Object} obj Object to be transformed * @param {Array} mods modifiers for the target */ - transform(recipe: any, obj: any, mods?: ModifierFunctionWrapper | Array): void; + transform(recipe: any, obj: any, mods?: ModifierFunctionWrapper | ModifierFunctionWrapper[]): void; } } diff --git a/draft-js/draft-js-0.2.2.d.ts b/draft-js/draft-js-0.2.2.d.ts index 2035230298..c10e48443c 100644 --- a/draft-js/draft-js-0.2.2.d.ts +++ b/draft-js/draft-js-0.2.2.d.ts @@ -47,7 +47,7 @@ declare module "draft-js" { } interface BlockMapBuilder { - createFromArray(blocks: Array): BlockMap; + createFromArray(blocks: ContentBlock[]): BlockMap; } interface CharacterMetadata { @@ -93,7 +93,7 @@ declare module "draft-js" { interface ContentState { createFromText(text: string): ContentState; - createFromBlockArray(blocks: Array): ContentState; + createFromBlockArray(blocks: ContentBlock[]): ContentState; getBlockMap(): BlockMap; getSelectionBefore(): SelectionState; @@ -106,7 +106,7 @@ declare module "draft-js" { getBlockBefore(key: string): ContentBlock; getBlockAfter(key: string): ContentBlock; - getBlocksAsArray(): Array; + getBlocksAsArray(): ContentBlock[]; getPlainText(): string; hasText(): boolean; @@ -224,8 +224,8 @@ declare module "draft-js" { handleReturn?: (e: any) => boolean; handleKeyCommand?: (command: string) => boolean; handleBeforeInput?: (chars: string) => boolean; - handlePastedFiles?: (files: Array) => boolean; - handleDroppedFiles?: (selection: SelectionState, files: Array) => boolean; + handlePastedFiles?: (files: Blob[]) => boolean; + handleDroppedFiles?: (selection: SelectionState, files: Blob[]) => boolean; handleDrop?: (selection: SelectionState, dataTransfer: any, isInternal: any) => boolean; onEscape?: (e: any) => void; @@ -265,7 +265,7 @@ declare module "draft-js" { var Modifier: Modifier; var RichUtils: RichUtils; - function convertFromRaw(rawState: any): Array; + function convertFromRaw(rawState: any): ContentBlock[]; function convertToRaw(contentState: ContentState): any; diff --git a/draft-js/index.d.ts b/draft-js/index.d.ts index fc888a5fac..2a7a54d8d8 100644 --- a/draft-js/index.d.ts +++ b/draft-js/index.d.ts @@ -124,10 +124,10 @@ declare namespace Draft { handlePastedText?(text: string, html?: string): boolean; - handlePastedFiles?(files: Array): boolean; + handlePastedFiles?(files: Blob[]): boolean; // Handle dropped files - handleDroppedFiles?(selection: SelectionState, files: Array): boolean; + handleDroppedFiles?(selection: SelectionState, files: Blob[]): boolean; // Handle other drops to prevent default text movement/insertion behaviour handleDrop?(selection: SelectionState, dataTransfer: Object, isInternal: DraftDragType): boolean; @@ -369,7 +369,7 @@ declare namespace Draft { * preserved and the new match is discarded. */ class CompositeDraftDecorator { - constructor(decorators: Array); + constructor(decorators: DraftDecorator[]); getDecorations(block: ContentBlock): Immutable.List; getComponentForKey(key: string): Function; @@ -426,8 +426,8 @@ declare namespace Draft { type: DraftBlockType; text: string; depth: number; - inlineStyleRanges: Array; - entityRanges: Array; + inlineStyleRanges: InlineStyleRange[]; + entityRanges: EntityRange[]; data?: Object; } @@ -441,11 +441,11 @@ declare namespace Draft { * immutable objects. */ interface RawDraftContentState { - blocks: Array; + blocks: RawDraftContentBlock[]; entityMap: { [key: string]: RawDraftEntity }; } - function convertFromHTMLtoContentBlocks(html: string, DOMBuilder: Function, blockRenderMap?: DraftBlockRenderMap): Array; + function convertFromHTMLtoContentBlocks(html: string, DOMBuilder: Function, blockRenderMap?: DraftBlockRenderMap): ContentBlock[]; function convertFromRawToDraftState(rawState: RawDraftContentState): ContentState; function convertFromDraftStateToRaw(contentState: ContentState): RawDraftContentState; } @@ -685,7 +685,7 @@ declare namespace Draft { } class ContentState extends Record { - static createFromBlockArray(blocks: Array): ContentState; + static createFromBlockArray(blocks: ContentBlock[]): ContentState; static createFromText(text: string, delimiter?: string): ContentState; getBlockMap(): BlockMap; @@ -698,7 +698,7 @@ declare namespace Draft { getBlockAfter(key: string): ContentBlock; getBlockBefore(key: string): ContentBlock; - getBlocksAsArray(): Array; + getBlocksAsArray(): ContentBlock[]; getFirstBlock(): ContentBlock; getLastBlock(): ContentBlock; getPlainText(delimiter?: string): string; @@ -768,7 +768,7 @@ declare namespace Draft { "undo"; interface BlockMapBuilder { - createFromArray(blocks: Array): BlockMap; + createFromArray(blocks: ContentBlock[]): BlockMap; } const DefaultDraftBlockRenderMap: Immutable.Map; diff --git a/dygraphs/index.d.ts b/dygraphs/index.d.ts index 77ffc7e9f6..df229f42c3 100644 --- a/dygraphs/index.d.ts +++ b/dygraphs/index.d.ts @@ -224,7 +224,7 @@ declare namespace dygraphs { pixels: number, opts: (name: string) => any, dygraph: Dygraph, - vals: number[]) => Array<{v: number, label: string}>; + vals: number[]) => {v: number, label: string}[]; /** diff --git a/dynatable/index.d.ts b/dynatable/index.d.ts index 1f32117220..286085f099 100644 --- a/dynatable/index.d.ts +++ b/dynatable/index.d.ts @@ -129,7 +129,7 @@ declare namespace JQueryDynatable { */ defaultColumnIdStyle?: string; /** Generated internally by the plugin, will be reset by the DomColumns at init */ - columns?: Array; + columns?: JQueryDynatable.Column[]; /** * Selector used by dynatable in order to find the table header row * @@ -499,7 +499,7 @@ declare namespace JQueryDynatable { * return '' + tr + ''; * }; */ - _rowWriter?: (rowIndex: number, record: any, columns: Array, cellWriter: Function) => string; + _rowWriter?: (rowIndex: number, record: any, columns: Column[], cellWriter: Function) => string; /** * Function that returns the HTML code that will be injected for the cell * diff --git a/ej.web.all/index.d.ts b/ej.web.all/index.d.ts index a79afa9862..98e093316b 100644 --- a/ej.web.all/index.d.ts +++ b/ej.web.all/index.d.ts @@ -2308,7 +2308,7 @@ export interface MultiColumnSettings { /** Field and Header Text collections can be defined and customized through columns field. */ - columns?: Array; + columns?: MultiColumnSettingsColumn[]; } enum Animation{ @@ -11278,7 +11278,7 @@ export interface Model { /** Specifies the contextual tabs and tab set to the ribbon control with the background color and border color. Refer to the tabs section for adding tabs into the contextual tab and contextual tab set. * @Default {array} */ - contextualTabs?: Array; + contextualTabs?: ContextualTab[]; /** Specifies the index or indexes to disable the given index tab or indexes tabs in the ribbon control. * @Default {0} @@ -11298,7 +11298,7 @@ export interface Model { /** Specifies the tabs and its groups. Also specifies the control details that has to be placed in the tab area in the ribbon control. * @Default {array} */ - tabs?: Array; + tabs?: Tab[]; /** Gets or sets a value that indicates whether to customizing the user interface (UI) as locale-specific in order to display regional data i.e. in a language and culture specific to a particular country or region and it will need to use the user's preference. * @Default {en-US} @@ -11783,7 +11783,7 @@ export interface ApplicationTabBackstageSettings { /** Specifies the ribbon backstage page with its tab and button elements. * @Default {array} */ - pages?: Array; + pages?: ApplicationTabBackstageSettingsPage[]; /** Specifies the width of backstage page header that contains tabs and buttons. * @Default {null} @@ -12465,7 +12465,7 @@ export interface Model { /** Gets or sets an object that indicates to render the Kanban with specified columns. * @Default {array} */ - columns?: Array; + columns?: Column[]; /** Gets or sets an object that indicates whether to Customize the card settings. * @Default {Object} @@ -13451,7 +13451,7 @@ export interface ContextMenuSettings { /** Gets or sets a value that indicates whether to add custom contextMenu items. * @Default {array} */ - customMenuItems?: Array; + customMenuItems?: ContextMenuSettingsCustomMenuItem[]; } export interface ColumnsConstraints { @@ -20687,7 +20687,7 @@ export interface Model { /** Gets or sets an object that indicates to render the grid with specified columns * @Default {[]} */ - columns?: Array; + columns?: Column[]; /** Gets or sets an object that indicates whether to customize the context menu behavior of the grid. */ @@ -26077,17 +26077,17 @@ export interface DataSource { /** Lists out the items to be displayed as segments of PivotChart. * @Default {[]} */ - rows?: Array; + rows?: DataSourceRow[]; /** Lists out the items supports calculation in PivotChart. * @Default {[]} */ - values?: Array; + values?: DataSourceValue[]; /** Lists out the items which supports filtering of values without displaying the members in UI in PivotChart. * @Default {[]} */ - filters?: Array; + filters?: DataSourceFilter[]; } export interface ServiceMethodSettings { @@ -27403,17 +27403,17 @@ export interface DataSource { /** Lists out the items to bind in rows section. * @Default {[]} */ - rows?: Array; + rows?: DataSourceRow[]; /** Lists out the items supports calculation in PivotGauge. * @Default {[]} */ - values?: Array; + values?: DataSourceValue[]; /** Lists out the items which supports filtering of values without displaying the members in UI in PivotGauge. * @Default {[]} */ - filters?: Array; + filters?: DataSourceFilter[]; } export interface LabelFormatSettings { @@ -27811,17 +27811,17 @@ export interface DataSource { /** Lists out the items to be displayed as segments of PivotTreeMap. * @Default {[]} */ - rows?: Array; + rows?: DataSourceRow[]; /** Lists out the items supports calculation in PivotTreeMap. * @Default {[]} */ - values?: Array; + values?: DataSourceValue[]; /** Lists out the items which supports filtering of values without displaying the members in UI in PivotTreeMap. * @Default {[]} */ - filters?: Array; + filters?: DataSourceFilter[]; } export interface ServiceMethodSettings { @@ -32149,7 +32149,7 @@ export interface Model { /** Option for adding columns; each column has the option to bind to a field in the dataSource. */ - columns?: Array; + columns?: Column[]; /** To Specify the column fields to be displayed in the dialog while inserting a column using column menu. * @Default {[]} diff --git a/epub/index.d.ts b/epub/index.d.ts index 8b91adcd53..e22112086b 100644 --- a/epub/index.d.ts +++ b/epub/index.d.ts @@ -49,7 +49,7 @@ declare module "epub" { manifest: Object; spine: Object; flow: Object[]; - toc: Array; + toc: TocElement[]; parse(): void; diff --git a/es6-shim/index.d.ts b/es6-shim/index.d.ts index 2ba310b395..340eaa5f0f 100644 --- a/es6-shim/index.d.ts +++ b/es6-shim/index.d.ts @@ -145,7 +145,7 @@ interface ArrayConstructor { * @param mapfn A mapping function to call on every element of the array. * @param thisArg Value of 'this' used to invoke the mapfn. */ - from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): Array; + from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; /** * Creates an array from an iterable object. @@ -153,25 +153,25 @@ interface ArrayConstructor { * @param mapfn A mapping function to call on every element of the array. * @param thisArg Value of 'this' used to invoke the mapfn. */ - from(iterable: IterableShim, mapfn: (v: T, k: number) => U, thisArg?: any): Array; + from(iterable: IterableShim, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; /** * Creates an array from an array-like object. * @param arrayLike An array-like object to convert to an array. */ - from(arrayLike: ArrayLike): Array; + from(arrayLike: ArrayLike): T[]; /** * Creates an array from an iterable object. * @param iterable An iterable object to convert to an array. */ - from(iterable: IterableShim): Array; + from(iterable: IterableShim): T[]; /** * Returns a new array from a set of elements. * @param items A set of elements to include in the new array object. */ - of(...items: T[]): Array; + of(...items: T[]): T[]; } interface Array { @@ -184,7 +184,7 @@ interface Array { * @param thisArg If provided, it will be used as the this value for each invocation of * predicate. If it is not provided, undefined is used instead. */ - find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; + find(predicate: (value: T, index: number, obj: T[]) => boolean, thisArg?: any): T; /** * Returns the index of the first element in the array where predicate is true, and undefined @@ -633,7 +633,7 @@ declare namespace Reflect { function getPrototypeOf(target: any): any; function has(target: any, propertyKey: PropertyKey): boolean; function isExtensible(target: any): boolean; - function ownKeys(target: any): Array; + function ownKeys(target: any): PropertyKey[]; function preventExtensions(target: any): boolean; function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean; function setPrototypeOf(target: any, proto: any): boolean; @@ -661,7 +661,7 @@ declare module "es6-shim" { function getPrototypeOf(target: any): any; function has(target: any, propertyKey: PropertyKey): boolean; function isExtensible(target: any): boolean; - function ownKeys(target: any): Array; + function ownKeys(target: any): PropertyKey[]; function preventExtensions(target: any): boolean; function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean; function setPrototypeOf(target: any, proto: any): boolean; diff --git a/esprima/index.d.ts b/esprima/index.d.ts index f03fd096f9..36c2d7e637 100644 --- a/esprima/index.d.ts +++ b/esprima/index.d.ts @@ -14,7 +14,7 @@ declare namespace esprima { const version: string; function parse(code: string, options?: Options): ESTree.Program; - function tokenize(code: string, options?: Options): Array; + function tokenize(code: string, options?: Options): Token[]; interface Token { type: string; diff --git a/estree/flow.d.ts b/estree/flow.d.ts index 76c76008e6..3345a09c41 100644 --- a/estree/flow.d.ts +++ b/estree/flow.d.ts @@ -41,7 +41,7 @@ declare namespace ESTree { id: Identifier; typeParameters?: TypeParameterDeclaration; body: ObjectTypeAnnotation; - extends: Array; + extends: InterfaceExtends[]; } interface DeclareFunction extends FlowDeclaration { @@ -58,7 +58,7 @@ declare namespace ESTree { } interface FunctionTypeAnnotation extends FlowTypeAnnotation { - params: Array; + params: FunctionTypeParam[]; returnType: FlowTypeAnnotation; rest?: FunctionTypeParam; typeParameters?: TypeParameterDeclaration; @@ -83,12 +83,12 @@ declare namespace ESTree { interface InterfaceDeclaration extends FlowDeclaration { id: Identifier; typeParameters?: TypeParameterDeclaration; - extends: Array; + extends: InterfaceExtends[]; body: ObjectTypeAnnotation; } interface IntersectionTypeAnnotation extends FlowTypeAnnotation { - types: Array; + types: FlowTypeAnnotation[]; } interface MixedTypeAnnotation extends FlowBaseTypeAnnotation {} @@ -106,7 +106,7 @@ declare namespace ESTree { interface StringTypeAnnotation extends FlowBaseTypeAnnotation {} interface TupleTypeAnnotation extends FlowTypeAnnotation { - types: Array; + types: FlowTypeAnnotation[]; } interface TypeofTypeAnnotation extends FlowTypeAnnotation { @@ -129,17 +129,17 @@ declare namespace ESTree { } interface TypeParameterDeclaration extends Node { - params: Array; + params: Identifier[]; } interface TypeParameterInstantiation extends Node { - params: Array; + params: FlowTypeAnnotation[]; } interface ObjectTypeAnnotation extends FlowTypeAnnotation { - properties: Array; - indexers: Array; - callProperties: Array; + properties: ObjectTypeProperty[]; + indexers: ObjectTypeIndexer[]; + callProperties: ObjectTypeCallProperty[]; } interface ObjectTypeCallProperty extends Node { @@ -167,7 +167,7 @@ declare namespace ESTree { } interface UnionTypeAnnotation extends FlowTypeAnnotation { - types: Array; + types: FlowTypeAnnotation[]; } interface VoidTypeAnnotation extends FlowBaseTypeAnnotation {} diff --git a/estree/index.d.ts b/estree/index.d.ts index 26bccf1731..8591816af9 100644 --- a/estree/index.d.ts +++ b/estree/index.d.ts @@ -26,8 +26,8 @@ interface BaseNode { // The type property should be a string literal. For example, Identifier // has: `type: "Identifier"` - leadingComments?: Array; - trailingComments?: Array; + leadingComments?: Comment[]; + trailingComments?: Comment[]; loc?: SourceLocation; range?: [number, number]; } @@ -57,11 +57,11 @@ export interface Position { export interface Program extends BaseNode { type: "Program"; sourceType: "script" | "module"; - body: Array; + body: (Statement | ModuleDeclaration)[]; } interface BaseFunction extends BaseNode { - params: Array; + params: Pattern[]; generator?: boolean; async?: boolean; // The body is either BlockStatement or Expression because arrow functions @@ -88,7 +88,7 @@ export interface EmptyStatement extends BaseStatement { export interface BlockStatement extends BaseStatement { type: "BlockStatement"; - body: Array; + body: Statement[]; } export interface ExpressionStatement extends BaseStatement { @@ -128,7 +128,7 @@ export interface WithStatement extends BaseStatement { export interface SwitchStatement extends BaseStatement { type: "SwitchStatement"; discriminant: Expression; - cases: Array; + cases: SwitchCase[]; } export interface ReturnStatement extends BaseStatement { @@ -194,7 +194,7 @@ export interface FunctionDeclaration extends BaseFunction, BaseDeclaration { export interface VariableDeclaration extends BaseDeclaration { type: "VariableDeclaration"; - declarations: Array; + declarations: VariableDeclarator[]; kind: "var" | "let" | "const"; } @@ -220,12 +220,12 @@ export interface ThisExpression extends BaseExpression { export interface ArrayExpression extends BaseExpression { type: "ArrayExpression"; - elements: Array; + elements: (Expression | SpreadElement)[]; } export interface ObjectExpression extends BaseExpression { type: "ObjectExpression"; - properties: Array; + properties: Property[]; } export interface Property extends BaseNode { @@ -246,7 +246,7 @@ export interface FunctionExpression extends BaseFunction, BaseExpression { export interface SequenceExpression extends BaseExpression { type: "SequenceExpression"; - expressions: Array; + expressions: Expression[]; } export interface UnaryExpression extends BaseExpression { @@ -293,7 +293,7 @@ export interface ConditionalExpression extends BaseExpression { interface BaseCallExpression extends BaseExpression { callee: Expression | Super; - arguments: Array; + arguments: (Expression | SpreadElement)[]; } export type CallExpression = SimpleCallExpression | NewExpression; @@ -320,7 +320,7 @@ interface BasePattern extends BaseNode { } export interface SwitchCase extends BaseNode { type: "SwitchCase"; test?: Expression; - consequent: Array; + consequent: Statement[]; } export interface CatchClause extends BaseNode { @@ -395,8 +395,8 @@ export interface YieldExpression extends BaseExpression { export interface TemplateLiteral extends BaseExpression { type: "TemplateLiteral"; - quasis: Array; - expressions: Array; + quasis: TemplateElement[]; + expressions: Expression[]; } export interface TaggedTemplateExpression extends BaseExpression { @@ -422,12 +422,12 @@ export interface AssignmentProperty extends Property { export interface ObjectPattern extends BasePattern { type: "ObjectPattern"; - properties: Array; + properties: AssignmentProperty[]; } export interface ArrayPattern extends BasePattern { type: "ArrayPattern"; - elements: Array; + elements: Pattern[]; } export interface RestElement extends BasePattern { @@ -449,7 +449,7 @@ interface BaseClass extends BaseNode { export interface ClassBody extends BaseNode { type: "ClassBody"; - body: Array; + body: MethodDefinition[]; } export interface MethodDefinition extends BaseNode { @@ -491,7 +491,7 @@ interface BaseModuleSpecifier extends BaseNode { export interface ImportDeclaration extends BaseModuleDeclaration { type: "ImportDeclaration"; - specifiers: Array; + specifiers: (ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier)[]; source: Literal; } @@ -511,7 +511,7 @@ export interface ImportNamespaceSpecifier extends BaseModuleSpecifier { export interface ExportNamedDeclaration extends BaseModuleDeclaration { type: "ExportNamedDeclaration"; declaration?: Declaration; - specifiers: Array; + specifiers: ExportSpecifier[]; source?: Literal; } diff --git a/expect/index.d.ts b/expect/index.d.ts index 6b030dd4e0..83e26504b9 100644 --- a/expect/index.d.ts +++ b/expect/index.d.ts @@ -48,7 +48,7 @@ export interface Call { export interface Spy { __isSpy: Boolean; - calls: Array; + calls: Call[]; andCall(fn: Function): Spy; andCallThrough(): Spy; andThrow(object: Object): Spy; diff --git a/falcor-json-graph/index.d.ts b/falcor-json-graph/index.d.ts index d2bb47563b..afa083e0f9 100644 --- a/falcor-json-graph/index.d.ts +++ b/falcor-json-graph/index.d.ts @@ -34,17 +34,17 @@ declare namespace FalcorJsonGraph { /** * A part of a {@link PathSet} that can be either a {@link Key}, {@link Range}, or Array of either. **/ - type KeySet = Key | Range | Array; + type KeySet = Key | Range | (Key | Range)[]; /** * An ordered list of {@link Key}s that point to a value in a {@link JSONGraph}. **/ - type Path = Array; + type Path = Key[]; /** * An ordered list of {@link KeySet}s that point to location(s) in the {@link JSONGraph}. It enables pointing to multiple locations in a more terse format than a set of {@link Path}s and is generally more efficient to evaluate. **/ - type PathSet = Array; + type PathSet = KeySet[]; /** * A wrapper around a path and its value. @@ -71,8 +71,8 @@ declare namespace FalcorJsonGraph { **/ interface JSONGraphEnvelope { jsonGraph: JSONGraph; - paths?: Array; - invalidate?: Array; + paths?: PathSet[]; + invalidate?: PathSet[]; } /** diff --git a/falcor-router/index.d.ts b/falcor-router/index.d.ts index f247a1946a..4c68e76b79 100644 --- a/falcor-router/index.d.ts +++ b/falcor-router/index.d.ts @@ -10,7 +10,7 @@ import DataSource = FalcorModel.DataSource; declare class FalcorRouter extends DataSource { - constructor(routes: Array, options?: FalcorRouter.RouterOptions); + constructor(routes: FalcorRouter.RouteDefinition[], options?: FalcorRouter.RouterOptions); /** * When a route misses on a call, get, or set the unhandledDataSource will @@ -18,7 +18,7 @@ declare class FalcorRouter extends DataSource { **/ routeUnhandledPathsTo(dataSource: DataSource): void; - static createClass(routes?: Array): typeof FalcorRouter.CreatedRouter; + static createClass(routes?: FalcorRouter.RouteDefinition[]): typeof FalcorRouter.CreatedRouter; } declare namespace FalcorRouter { @@ -46,7 +46,7 @@ declare namespace FalcorRouter { } type RouteDefinition = GetRoute | SetRoute | CallRoute; - type RouteResult = FalcorJsonGraph.PathValue | Array | FalcorJsonGraph.JSONEnvelope; + type RouteResult = FalcorJsonGraph.PathValue | FalcorJsonGraph.PathValue[] | FalcorJsonGraph.JSONEnvelope; interface RouterOptions { debug?: boolean; diff --git a/falcor/index.d.ts b/falcor/index.d.ts index 0db99171d1..6d1265f18a 100644 --- a/falcor/index.d.ts +++ b/falcor/index.d.ts @@ -41,7 +41,7 @@ declare namespace FalcorModel { /** * The get method retrieves values from the DataSource's associated JSONGraph object. **/ - get(pathSets: Array): Observable; + get(pathSets: PathSet[]): Observable; /** @@ -53,7 +53,7 @@ declare namespace FalcorModel { /** * Invokes a function in the DataSource's JSONGraph object. **/ - call(functionPath: Path, args?: any[], refSuffixes?: Array, thisPaths?: Array): Observable; + call(functionPath: Path, args?: any[], refSuffixes?: PathSet[], thisPaths?: PathSet[]): Observable; } @@ -101,35 +101,35 @@ declare namespace FalcorModel { /** * The get method retrieves several {@link Path}s or {@link PathSet}s from a {@link Model}. The get method loads each value into a JSON object and returns in a ModelResponse. **/ - get(...path: Array): ModelResponse>; - get(...path: Array): ModelResponse>; + get(...path: (string | PathSet)[]): ModelResponse>; + get(...path: (string | PathSet)[]): ModelResponse>; /** * Sets the value at one or more places in the JSONGraph model. The set method accepts one or more {@link PathValue}s, each of which is a combination of a location in the document and the value to place there. In addition to accepting {@link PathValue}s, the set method also returns the values after the set operation is complete. **/ - set(...args: Array): ModelResponse>; - set(...args: Array): ModelResponse>; + set(...args: PathValue[]): ModelResponse>; + set(...args: PathValue[]): ModelResponse>; set(jsonGraph: JSONGraph): ModelResponse>; set(jsonGraph: JSONGraph): ModelResponse>; /** * The preload method retrieves several {@link Path}s or {@link PathSet}s from a {@link Model} and loads them into the Model cache. **/ - preload(...path: Array): void; + preload(...path: PathSet[]): void; /** * Invokes a function in the JSON Graph. **/ - // NOTE: In http://netflix.github.io/falcor/doc/Model.html#call, it says that refPaths should be an array. - // However, model implementation returns an error with setting refPaths as Array and it works with refPaths as PathSet. + // NOTE: In http://netflix.github.io/falcor/doc/Model.html#call, it says that refPaths should be a PathSet[]. + // However, model implementation returns an error with setting refPaths as PathSet[] and it works with refPaths as PathSet. // So refPaths is defined as a PathSet in this .d.ts. - call(functionPath: string | Path, args?: any[], refPaths?: PathSet, thisPaths?: Array): ModelResponse>; - call(functionPath: string | Path, args?: any[], refPaths?: PathSet, thisPaths?: Array): ModelResponse>; + call(functionPath: string | Path, args?: any[], refPaths?: PathSet, thisPaths?: PathSet[]): ModelResponse>; + call(functionPath: string | Path, args?: any[], refPaths?: PathSet, thisPaths?: PathSet[]): ModelResponse>; /** * The invalidate method synchronously removes several {@link Path}s or {@link PathSet}s from a {@link Model} cache. **/ - invalidate(...path: Array): void; + invalidate(...path: PathSet[]): void; /** * Returns a new {@link Model} bound to a location within the {@link JSONGraph}. The bound location is never a {@link Reference}: any {@link Reference}s encountered while resolving the bound {@link Path} are always replaced with the {@link Reference}s target value. For subsequent operations on the {@link Model}, all paths will be evaluated relative to the bound path. Deref allows you to: @@ -159,7 +159,7 @@ declare namespace FalcorModel { /** * Get the local {@link JSONGraph} cache. This method can be a useful to store the state of the cache. **/ - getCache(...path: Array): JSONGraph; + getCache(...path: PathSet[]): JSONGraph; /** * Retrieves a number which is incremented every single time a value is changed underneath the Model or the object at an optionally-provided Path beneath the Model. diff --git a/fetch-mock/index.d.ts b/fetch-mock/index.d.ts index c88c177ae0..c0ece97d1e 100644 --- a/fetch-mock/index.d.ts +++ b/fetch-mock/index.d.ts @@ -109,8 +109,8 @@ interface MockOptions { type MockCall = [string, MockRequest]; interface MatchedRoutes { - matched: Array; - unmatched: Array; + matched: MockCall[]; + unmatched: MockCall[]; } interface MockOptionsMethodGet extends MockOptions { @@ -225,7 +225,7 @@ interface FetchMockStatic { /** * Returns all calls to fetch matching matcherName. */ - calls(matcherName?: string): Array; + calls(matcherName?: string): MockCall[]; /** * Returns a Boolean indicating whether fetch was called and a route was matched. diff --git a/first-mate/index.d.ts b/first-mate/index.d.ts index cff70644eb..000bc01f40 100644 --- a/first-mate/index.d.ts +++ b/first-mate/index.d.ts @@ -53,7 +53,7 @@ declare namespace AtomFirstMate { * @param text A string containing one or more lines. * @return An array of token arrays, one token array per line. */ - tokenizeLines(text: string): Array>; + tokenizeLines(text: string): IToken[][]; /** * Tokenizes a line of text. * diff --git a/flightplan/index.d.ts b/flightplan/index.d.ts index bc6b7f5bec..903e1f1943 100644 --- a/flightplan/index.d.ts +++ b/flightplan/index.d.ts @@ -33,9 +33,9 @@ declare namespace FlightplanInterfaces { exec(command: string, options?: { exec: any }): CommandResult; sudo(command: string, options?: SudoOptions): CommandResult; - transfer(files: CommandResult, remoteDir: string, options?: CommandOptions): Array; - transfer(files: CommandResult[], remoteDir: string, options?: CommandOptions): Array; - transfer(files: string[], remoteDir: string, options?: CommandOptions): Array; + transfer(files: CommandResult, remoteDir: string, options?: CommandOptions): CommandResult[]; + transfer(files: CommandResult[], remoteDir: string, options?: CommandOptions): CommandResult[]; + transfer(files: string[], remoteDir: string, options?: CommandOptions): CommandResult[]; prompt(message: string, options?: PromptOptions): string; waitFor(fn: (done: (result: any) => void) => void): any; diff --git a/fluxxor/index.d.ts b/fluxxor/index.d.ts index 4c8f773b1d..823cebaa66 100644 --- a/fluxxor/index.d.ts +++ b/fluxxor/index.d.ts @@ -21,7 +21,7 @@ declare namespace Fluxxor { class Flux extends EventEmitter3.EventEmitter { constructor(stores: any, actions: any); addActions(actions: any): void; - addAction(...args: Array): void; + addAction(...args: (string | Function)[]): void; addAction(names: string[], action: Function): void; store(name: string): any; addStore(name: string, store: Store): void; @@ -31,8 +31,8 @@ declare namespace Fluxxor { } interface Store extends EventEmitter3.EventEmitter { - bindActions(...args: Array): void; - bindActions(args: Array): void; + bindActions(...args: (string | Function)[]): void; + bindActions(args: (string | Function)[]): void; waitFor(stores: string[], fn: Function): void; } diff --git a/fromjs/index.d.ts b/fromjs/index.d.ts index d2de8cc024..35abee6a6c 100644 --- a/fromjs/index.d.ts +++ b/fromjs/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Glenn Dierckx // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare function from(results: Array): FromJS.IQueryable; +declare function from(results: T[]): FromJS.IQueryable; declare function from(results: any): FromJS.IQueryable; declare namespace FromJS { @@ -17,7 +17,7 @@ declare namespace FromJS { select(item: (item: T) => TResult): IQueryable; orderByDesc(item: (item: T) => TResult): IOrderedQueryable; orderBy(item: (item: T) => TResult): IOrderedQueryable; - selectMany(item: (item: T) => Array): IQueryable; + selectMany(item: (item: T) => TResult[]): IQueryable; skip(count: Number): IQueryable; take(count: Number): IQueryable; single(): T; @@ -34,8 +34,8 @@ declare namespace FromJS { firstOrDefault(): T; each(action: (value: T, key: TKey) => void): void; each(action: (item: T) => void, a?: boolean): void; - toArray(): Array; - concat(second: Array): IQueryable; + toArray(): T[]; + concat(second: T[]): IQueryable; sum(): T; distinct(): IQueryable; any(): boolean; diff --git a/fullcalendar/index.d.ts b/fullcalendar/index.d.ts index 7eb9f72033..8eecc4c3b7 100644 --- a/fullcalendar/index.d.ts +++ b/fullcalendar/index.d.ts @@ -50,7 +50,7 @@ export interface Options extends AgendaOptions, EventDraggingResizingOptions, Dr weekMode?: string; weekNumbers?: boolean; weekNumberCalculation?: any; // String/Function - businessHours?: boolean | BusinessHours | Array; + businessHours?: boolean | BusinessHours | BusinessHours[]; height?: number; contentHeight?: number; aspectRatio?: number; @@ -366,12 +366,12 @@ declare global { /** * Retrieves events that FullCalendar has in memory. */ - fullCalendar(method: 'clientEvents', idOrfilter?: any): Array; + fullCalendar(method: 'clientEvents', idOrfilter?: any): EventObject[]; /** * Retrieves events that FullCalendar has in memory. */ - fullCalendar(method: 'clientEvents', idOrfilter?: (e: EventObject) => boolean): Array; + fullCalendar(method: 'clientEvents', idOrfilter?: (e: EventObject) => boolean): EventObject[]; /** * Removes events from the calendar. diff --git a/fullcalendar/v1/fullCalendar.d.ts b/fullcalendar/v1/fullCalendar.d.ts index 3515eb950d..c648f4a331 100644 --- a/fullcalendar/v1/fullCalendar.d.ts +++ b/fullcalendar/v1/fullCalendar.d.ts @@ -373,12 +373,12 @@ interface JQuery { /** * Retrieves events that FullCalendar has in memory. */ - fullCalendar(method: 'clientEvents', idOrfilter?: any): Array; + fullCalendar(method: 'clientEvents', idOrfilter?: any): FullCalendar.EventObject[]; /** * Retrieves events that FullCalendar has in memory. */ - fullCalendar(method: 'clientEvents', idOrfilter?: (e: FullCalendar.EventObject) => boolean): Array; + fullCalendar(method: 'clientEvents', idOrfilter?: (e: FullCalendar.EventObject) => boolean): FullCalendar.EventObject[]; /** * Removes events from the calendar. diff --git a/gijgo/index.d.ts b/gijgo/index.d.ts index 0566267831..c88d5612ed 100644 --- a/gijgo/index.d.ts +++ b/gijgo/index.d.ts @@ -51,7 +51,7 @@ declare namespace Gijgo { //Configuration options autoGenerateColumns?: boolean; autoLoad?: boolean; - columns?: Array; + columns?: GridColumn[]; dataSource?: any; defaultColumnSettings?: GridColumn; defaultParams?: GridDefaultParams; @@ -80,8 +80,8 @@ declare namespace Gijgo { cellDataChanged?: (e: any, $cell: JQuery, column: GridColumn, record: Entity, oldValue: any, newValue: any) => any; columnHide?: (e: any, column: GridColumn) => any; columnShow?: (e: any, column: GridColumn) => any; - dataBinding?: (e: any, records: Array) => any; - dataBound?: (e: any, records: Array, totalRecords: number) => any; + dataBinding?: (e: any, records: Entity[]) => any; + dataBound?: (e: any, records: Entity[], totalRecords: number) => any; destroying?: (e: any) => any; detailCollapse?: (e: any, detailWrapper: JQuery, record: Entity) => any; detailExpand?: (e: any, detailWrapper: JQuery, record: Entity) => any; @@ -101,9 +101,9 @@ declare namespace Gijgo { count(): number; destroy(keepTableTag?: boolean, keepWrapperTag?: boolean): void; //get(position: number): Entity; //TODO: rename to getByPosition to avoid conflicts with jquery.get - getAll(): Array; + getAll(): Entity[]; getById(id: string): Entity; - getChanges(): Array; + getChanges(): Entity[]; getSelected(): string; getSelections(): string[]; hideColumn(field: string): Grid; diff --git a/go/index.d.ts b/go/index.d.ts index 1d13ace5d8..bd97adcb24 100644 --- a/go/index.d.ts +++ b/go/index.d.ts @@ -958,9 +958,9 @@ declare namespace go { /** * Highlight all of the Parts supplied in the given collection, and clear all other highlighted Parts. - * @param {Iterable|Array} coll an Iterable of Parts + * @param {Iterable|Part[]} coll an Iterable of Parts */ - highlightCollection(coll: Iterable | Array): void; + highlightCollection(coll: Iterable | Part[]): void; /** * This static function declares that a class (constructor function) derives from another class -- but please note that most classes do not support inheritance. @@ -1079,10 +1079,10 @@ declare namespace go { /** * This method removes from this Diagram all of the Parts in a collection. - * @param {Iterable|Array} coll A List or Set or Iterator of Parts. + * @param {Iterable|Part[]} coll A List or Set or Iterator of Parts. * @param {boolean} check Whether to check Part.canDelete on each part. */ - removeParts(coll: Iterable | Array, check: boolean): void; + removeParts(coll: Iterable | Part[], check: boolean): void; /** * Requests that in the near-future the diagram makes sure all GraphObjects are arranged, @@ -1126,9 +1126,9 @@ declare namespace go { /** * Select all of the Parts supplied in the given collection. - * @param {Iterable|Array} coll a List or Set of Parts to be selected. + * @param {Iterable|Part[]} coll a List or Set of Parts to be selected. */ - selectCollection(coll: Iterable | Array): void; + selectCollection(coll: Iterable | Part[]): void; /** * This method sets a collection of properties according to the property/value pairs that have been set on the given Object, @@ -2292,7 +2292,7 @@ declare namespace go { protected computeCorner(): number; // undocumented protected computeShortLength(from: boolean): number; // undocumented findMidLabel(): GraphObject; // undocumented - protected arrangeBundledLinks(links: Array, reroute: boolean): void; // undocumented + protected arrangeBundledLinks(links: Link[], reroute: boolean): void; // undocumented protected setPointAt(i: number, x: number, y: number): void; // undocumented protected insertPointAt(i: number, x: number, y: number): void; // undocumented protected addPointAt(x: number, y: number): void; // undocumented @@ -5202,7 +5202,7 @@ declare namespace go { * This method only works if .linkLabelKeysProperty has been set to something other than an empty string. * @param {Object} linkdata a JavaScript object representing a link. */ - getLabelKeysForLinkData(linkdata: Object): Array; + getLabelKeysForLinkData(linkdata: Object): Key[]; /** * From a link data retrieve a value uniquely identifying the node data @@ -5323,7 +5323,7 @@ declare namespace go { * @param {Object} linkdata a JavaScript object representing a link. * @param arr an Array of node keys; an empty Array if the property was not present. */ - setLabelKeysForLinkData(linkdata: Object, arr: Array): void; + setLabelKeysForLinkData(linkdata: Object, arr: Key[]): void; /** * Change the node key that the given link data references as the @@ -6459,7 +6459,7 @@ declare namespace go { * @param Array<*> layerRects an Array of Rects with the bounds of each of the "layers" * @param {Point} offset the position of the top-left corner of the banded area relative to the coordinates given by the layerRects */ - commitLayers(layerRects: Array, offset: Point): void; + commitLayers(layerRects: Rect[], offset: Point): void; /** * Updates the physical location of "real" nodes and links to reflect the layout. @@ -7128,7 +7128,7 @@ declare namespace go { * @param Array<*> layerRects an Array of Rects with the bounds of each of the "layers" * @param {Point} offset the position of the top-left corner of the banded area relative to the coordinates given by the layerRects */ - commitLayers(layerRects: Array, offset: Point): void; + commitLayers(layerRects: Rect[], offset: Point): void; /** * Set the fromSpot and toSpot for each Vertex, position each Node according to the Vertex position, and then position the Links. @@ -7279,7 +7279,7 @@ declare namespace go { childPortSpot: Spot; /**Gets or sets the logical children for this node.*/ - children: Array; + children: TreeVertex[]; /**This read-only property returns the number of immediate children this node has.*/ childrenCount: number; @@ -7288,7 +7288,7 @@ declare namespace go { commentMargin: number; /**Gets or sets an array of Nodes that will be positioned near this node.*/ - comments: Array; + comments: Node[]; /**Gets or sets the space to leave between consecutive comments.*/ commentSpacing: number; @@ -8951,9 +8951,9 @@ declare namespace go { /** * Adds all of the values of a collection (either an Iterable or an Array) to the end of this List. - * @param {Iterable|Array} coll + * @param {Iterable|T[]} coll */ - addAll(coll: Iterable | Array): List; + addAll(coll: Iterable | T[]): List; /** * This is true if all invocations of the given predicate on items in the collection are true. @@ -9114,7 +9114,7 @@ declare namespace go { /** * Produces a JavaScript Array from the contents of this List. */ - toArray(): Array; + toArray(): T[]; /** * Converts the List to a Set. @@ -9187,7 +9187,7 @@ declare namespace go { * Adds all of the key-value pairs of another Map to this Map. * @param {Iterable.>|Array} coll */ - addAll(coll: Iterable> | Array>): Map; + addAll(coll: Iterable> | KeyValuePair[]): Map; /** * This is true if all invocations of the given predicate on key-value pairs in the collection are true. @@ -9289,7 +9289,7 @@ declare namespace go { /** * Produces a JavaScript Array of key/value pair objects from the contents of this Map. */ - toArray(): Array>; + toArray(): KeyValuePair[]; /** * Produces a Set that provides a read-only view onto the keys of this Map. @@ -9330,9 +9330,9 @@ declare namespace go { /** * Adds all of the values of a collection (either an Iterable or an Array) to this Set. - * @param {Iterable|Array} coll + * @param {Iterable|T[]} coll */ - addAll(coll: Iterable | Array): Set; + addAll(coll: Iterable | T[]): Set; /** * This is true if all invocations of the given predicate on items in the collection are true. @@ -9432,9 +9432,9 @@ declare namespace go { /** * Removes all of the values of a collection from this Set. - * @param {Array} coll + * @param {T[]} coll */ - removeAll(coll: Array): Set; + removeAll(coll: T[]): Set; /** * Removes from this Set all items that are not in the given collection. @@ -9445,7 +9445,7 @@ declare namespace go { /** * Produces a JavaScript Array from the contents of this Set. */ - toArray(): Array; + toArray(): T[]; /** * Converts the Set to a List. diff --git a/google-drive-realtime-api/index.d.ts b/google-drive-realtime-api/index.d.ts index 5df3c547a5..364deaf16e 100644 --- a/google-drive-realtime-api/index.d.ts +++ b/google-drive-realtime-api/index.d.ts @@ -319,10 +319,10 @@ declare namespace gapi.drive.realtime { create(ref: string|Function, ...var_args: any[]): any; // Creates a collaborative list. - createList(opt_initialValue?: Array): CollaborativeList; + createList(opt_initialValue?: T[]): CollaborativeList; // Creates a collaborative map. - createMap(opt_initialValue?: Array<[string, T]>): CollaborativeMap; + createMap(opt_initialValue?: [string, T][]): CollaborativeMap; // Creates a collaborative string. createString(opt_initialValue?: string): CollaborativeString; diff --git a/googlemaps/index.d.ts b/googlemaps/index.d.ts index e493045d12..951e67f699 100644 --- a/googlemaps/index.d.ts +++ b/googlemaps/index.d.ts @@ -1590,7 +1590,7 @@ declare namespace google.maps { getVisible(): boolean; getZoom(): number; registerPanoProvider(provider: (input: string) => StreetViewPanoramaData): void; - setLinks(links: Array): void; + setLinks(links: StreetViewLink[]): void; setOptions(options: StreetViewPanoramaOptions): void; setPano(pano: string): void; setPosition(latLng: LatLng|LatLngLiteral): void; diff --git a/graphene-pk11/index.d.ts b/graphene-pk11/index.d.ts index 01ea054606..49e701d607 100644 --- a/graphene-pk11/index.d.ts +++ b/graphene-pk11/index.d.ts @@ -381,7 +381,7 @@ declare class SessionObject extends HandleObject { declare class SessionObjectCollection extends Collection { session: Session; - constructor(items: Array, session: Session, lib: pkcs11.PKCS11, classType?: any); + constructor(items: Handle[], session: Session, lib: pkcs11.PKCS11, classType?: any); items(index: number): SessionObject; } @@ -2108,7 +2108,7 @@ declare class Slot extends HandleObject { declare class SlotCollection extends Collection { module: Module; items(index: number): Slot; - constructor(items: Array, module: Module, lib: pkcs11.PKCS11, classType?: any); + constructor(items: Buffer[], module: Module, lib: pkcs11.PKCS11, classType?: any); } declare enum TokenFlag { diff --git a/graphql/index.d.ts b/graphql/index.d.ts index 316cc6fead..14b29144eb 100644 --- a/graphql/index.d.ts +++ b/graphql/index.d.ts @@ -1140,7 +1140,7 @@ declare module "graphql/type/definition" { GraphQLEnumType | GraphQLInputObjectType; - export function getNamedType(type: GraphQLType): GraphQLNamedType; + export function getNamedType(type: GraphQLType): GraphQLNamedType /** * Used while defining GraphQL types to allow for circular references in @@ -2584,7 +2584,7 @@ declare module "graphql/utilities/introspectionQuery" { interface IntrospectionQuery { - __schema: IntrospectionSchema; + __schema: IntrospectionSchema } interface IntrospectionSchema { @@ -2649,7 +2649,7 @@ declare module "graphql/utilities/introspectionQuery" { type IntrospectionTypeRef = IntrospectionNamedTypeRef | IntrospectionListTypeRef | - IntrospectionNonNullTypeRef; + IntrospectionNonNullTypeRef interface IntrospectionNamedTypeRef { kind: string; @@ -2708,7 +2708,7 @@ declare module "graphql/utilities/isValidJSValue" { function isValidJSValue( value: any, type: GraphQLInputType - ): Array; + ): Array } declare module "graphql/utilities/isValidLiteralValue" { diff --git a/grunt/index.d.ts b/grunt/index.d.ts index 85e294b4a0..4336b2eadd 100644 --- a/grunt/index.d.ts +++ b/grunt/index.d.ts @@ -456,7 +456,7 @@ declare namespace grunt { * @see FileModule.expand method documentation for an explanation of how the patterns * and options arguments may be specified. */ - expandMapping(patterns: string[], dest: string, options: IExpandedFilesConfig): Array; + expandMapping(patterns: string[], dest: string, options: IExpandedFilesConfig): IFileMap[]; /** * Match one or more globbing patterns against one or more file paths. @@ -837,7 +837,7 @@ declare namespace grunt { * Normalizes a task target configuration object into an array of src-dest file mappings. * This method is used internally by the multi task system this.files / grunt.task.current.files property. */ - normalizeMultiTaskFiles(data: grunt.config.IProjectConfig, targetname?: string): Array; + normalizeMultiTaskFiles(data: grunt.config.IProjectConfig, targetname?: string): grunt.file.IFileMap[]; /** * The currently running task or multitask. diff --git a/gulp-useref/index.d.ts b/gulp-useref/index.d.ts index ba95c68308..270c9a1c95 100644 --- a/gulp-useref/index.d.ts +++ b/gulp-useref/index.d.ts @@ -11,7 +11,7 @@ interface Options { base?: string; noAssets?: boolean; noconcat?: boolean; - additionalStreams?: Array; + additionalStreams?: NodeJS.ReadWriteStream[]; transformPath?: (filePath: string) => void; } diff --git a/hapi/hapi-8.2.0.d.ts b/hapi/hapi-8.2.0.d.ts index 720055ccd8..a29a53163f 100644 --- a/hapi/hapi-8.2.0.d.ts +++ b/hapi/hapi-8.2.0.d.ts @@ -120,7 +120,7 @@ export interface IServerOptions { sharedif true, allows multiple cache users to share the same segment (e.g. multiple methods using the same cache storage container). Default to false. other options passed to the catbox strategy used. an array of the above object for configuring multiple cache instances, each with a unique name. When an array of objects is provided, multiple cache connections are established and each array item (except one) must include a name. */ - cache?: string | ICatBoxCacheOptions | Array | any; + cache?: string | ICatBoxCacheOptions | ICatBoxCacheOptions[] | any; /** sets the default connections configuration which can be overridden by each connection where: */ connections?: IConnectionConfigurationServerDefaults; /** determines which logged events are sent to the console (this should only be used for development and does not affect which events are actually logged internally and recorded). Set to false to disable all console logging, or to an object*/ @@ -779,7 +779,7 @@ export interface IRouteHandlerConfig { plugins: { [name: string]: any; }; - pre: Array<() => void>; + pre: (() => void)[]; validate: { headers: any; params: any; @@ -1415,7 +1415,7 @@ export declare class Response extends Events.EventEmitter { /** replacer(method) - sets the JSON.stringify() replacer argument where: method - the replacer function or array. Defaults to none.*/ - replacer(method: Function | Array): void; + replacer(method: Function | Function[]): void; /** spaces(count) - sets the JSON.stringify() space argument where: count - the number of spaces to indent nested object keys. Defaults to no indentation. */ @@ -1462,7 +1462,7 @@ export declare class Server extends Events.EventEmitter { // server.connections.length === 2 var a = server.select('a'); // a.connections.length === 1*/ - connections: Array; + connections: ISeverConnectionOptions[]; /** When the server contains exactly one connection, info is an object containing information about the sole connection. * When the server contains more than one connection, each server.connections array member provides its own connection.info. var server = new Hapi.Server(); @@ -2032,9 +2032,9 @@ export declare class Server extends Events.EventEmitter { });*/ method(methods: { name: string; method: IServerMethod; options?: IServerMethodOptions - } | Array<{ + } | { name: string; method: IServerMethod; options?: IServerMethodOptions - }>): void; + }[]): void; /**server.path(relativeTo) Sets the path prefix used to locate static resources (files and view templates) when relative paths are used where: relativeTo - the path prefix added to any relative file path starting with '.'. diff --git a/hapi/index.d.ts b/hapi/index.d.ts index 47c1b6f105..0a437f301b 100644 --- a/hapi/index.d.ts +++ b/hapi/index.d.ts @@ -171,7 +171,7 @@ export interface IServerOptions { sharedif true, allows multiple cache users to share the same segment (e.g. multiple methods using the same cache storage container). Default to false. other options passed to the catbox strategy used. an array of the above object for configuring multiple cache instances, each with a unique name. When an array of objects is provided, multiple cache connections are established and each array item (except one) must include a name. */ - cache?: string | ICatBoxCacheOptions | Array | any; + cache?: string | ICatBoxCacheOptions | ICatBoxCacheOptions[] | any; /** sets the default connections configuration which can be overridden by each connection where: */ connections?: IConnectionConfigurationServerDefaults; /** determines which logged events are sent to the console (this should only be used for development and does not affect which events are actually logged internally and recorded). Set to false to disable all console logging, or to an object*/ @@ -871,7 +871,7 @@ export interface IRouteHandlerConfig { plugins: { [name: string]: any; }; - pre: Array<() => void>; + pre: (() => void)[]; validate: { headers: any; params: any; @@ -1532,7 +1532,7 @@ export class Response extends Events.EventEmitter { /** replacer(method) - sets the JSON.stringify() replacer argument where: method - the replacer function or array. Defaults to none.*/ - replacer(method: Function | Array): Response; + replacer(method: Function | Function[]): Response; /** spaces(count) - sets the JSON.stringify() space argument where: count - the number of spaces to indent nested object keys. Defaults to no indentation. */ @@ -1677,7 +1677,7 @@ export class Server extends Events.EventEmitter { // server.connections.length === 2 var a = server.select('a'); // a.connections.length === 1*/ - connections: Array; + connections: ServerConnection[]; /** When the server contains exactly one connection, info is an object containing information about the sole connection. * When the server contains more than one connection, each server.connections array member provides its own connection.info. var server = new Hapi.Server(); @@ -2279,9 +2279,9 @@ export class Server extends Events.EventEmitter { });*/ method(methods: { name: string; method: IServerMethod; options?: IServerMethodOptions - } | Array<{ + } | { name: string; method: IServerMethod; options?: IServerMethodOptions - }>): void; + }[]): void; /**server.path(relativeTo) Sets the path prefix used to locate static resources (files and view templates) when relative paths are used where: diff --git a/html-minifier/index.d.ts b/html-minifier/index.d.ts index 6acddc6419..ed71dc540a 100644 --- a/html-minifier/index.d.ts +++ b/html-minifier/index.d.ts @@ -83,10 +83,10 @@ declare namespace HTMLMinifier { minifyURLs?: boolean | RelateUrl.Options; // Array of regex'es that allow to ignore certain comments, when matched - ignoreCustomComments?: Array; + ignoreCustomComments?: RegExp[]; // Array of regex'es that allow to ignore certain fragments, when matched (e.g. , {{ ... }}, etc.) - ignoreCustomFragments?: Array; + ignoreCustomFragments?: RegExp[]; // Array of strings corresponding to types of script elements to process through minifier (e.g. text/ng-template, text/x-handlebars-template, etc.) processScripts?: string[]; @@ -95,10 +95,10 @@ declare namespace HTMLMinifier { maxLineLength?: number; // Arrays of regex'es that allow to support custom attribute assign expressions (e.g. '
') - customAttrAssign?: Array; + customAttrAssign?: RegExp[]; // Arrays of regex'es that allow to support custom attribute surround expressions (e.g. ) - customAttrSurround?: Array; + customAttrSurround?: RegExp[]; // Regex that specifies custom attribute to strip newlines from (e.g. /ng\-class/) customAttrCollapse?: RegExp; diff --git a/immutable/index.d.ts b/immutable/index.d.ts index c6bb474788..cecfa02127 100644 --- a/immutable/index.d.ts +++ b/immutable/index.d.ts @@ -1565,7 +1565,7 @@ declare namespace Immutable { * ) * // Seq [ 1, 'A', 'X', 2, 'B', 'Y' ] */ - interleave(...iterables: Array>): this; + interleave(...iterables: Iterable[]): this; /** * Splice returns a new indexed Iterable by replacing a region of this @@ -1582,7 +1582,7 @@ declare namespace Immutable { splice( index: number, removeNum: number, - ...values: Array | T> + ...values: (Iterable.Indexed | T)[] ): this; /** @@ -2185,7 +2185,7 @@ declare namespace Immutable { * For Seqs, all entries will be present in * the resulting iterable, even if they have the same key. */ - concat(...valuesOrIterables: Array|V>): this; + concat(...valuesOrIterables: (Iterable|V)[]): this; /** * Flattens nested Iterables. diff --git a/jasmine/index.d.ts b/jasmine/index.d.ts index d646d7ef96..7c942428c2 100644 --- a/jasmine/index.d.ts +++ b/jasmine/index.d.ts @@ -122,7 +122,7 @@ declare namespace jasmine { } interface CustomMatcherFactory { - (util: MatchersUtil, customEqualityTesters: Array): CustomMatcher; + (util: MatchersUtil, customEqualityTesters: CustomEqualityTester[]): CustomMatcher; } interface CustomMatcherFactories { @@ -135,8 +135,8 @@ declare namespace jasmine { } interface MatchersUtil { - equals(a: any, b: any, customTesters?: Array): boolean; - contains(haystack: ArrayLike | string, needle: any, customTesters?: Array): boolean; + equals(a: any, b: any, customTesters?: CustomEqualityTester[]): boolean; + contains(haystack: ArrayLike | string, needle: any, customTesters?: CustomEqualityTester[]): boolean; buildFailureMessage(matcherName: string, isNot: boolean, actual: any, ...expected: any[]): string; } diff --git a/jquery/index.d.ts b/jquery/index.d.ts index 85a83c6073..2425c36e1e 100644 --- a/jquery/index.d.ts +++ b/jquery/index.d.ts @@ -327,7 +327,7 @@ interface JQueryPromise extends JQueryGenericPromise { * @param doneCallbacks1 A function, or array of functions, that are called when the Deferred is resolved. * @param doneCallbacks2 Optional additional functions, or arrays of functions, that are called when the Deferred is resolved. */ - done(doneCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...doneCallbackN: Array|JQueryPromiseCallback[]>): JQueryPromise; + done(doneCallback1?: JQueryPromiseCallback|JQueryPromiseCallback[], ...doneCallbackN: (JQueryPromiseCallback|JQueryPromiseCallback[])[]): JQueryPromise; /** * Add handlers to be called when the Deferred object is rejected. * @@ -831,7 +831,7 @@ interface JQueryStatic { * * @param deferreds One or more Deferred objects, or plain JavaScript objects. */ - when(...deferreds: Array/* as JQueryDeferred */>): JQueryPromise; + when(...deferreds: (T|JQueryPromise/* as JQueryDeferred */)[]): JQueryPromise; /** * Hook directly into jQuery to override how particular CSS properties are retrieved or set, normalize CSS property naming, or create custom properties. diff --git a/jsonschema/index.d.ts b/jsonschema/index.d.ts index 1c2f0f915e..21c7f0d9e6 100644 --- a/jsonschema/index.d.ts +++ b/jsonschema/index.d.ts @@ -5,9 +5,9 @@ declare module "jsonschema" { export interface IJSONSchemaResult { - errors: Array; + errors: IJSONSchemaValidationError[]; instance: any; - arguments: Array<{}>; + arguments: {}[]; propertyPath: string; name: string; schema: {}; @@ -49,7 +49,7 @@ declare module "jsonschema" { * } * }; * - * const validationResults: { errors: Array } = + * const validationResults: { errors: IJSONSchemaValidationError[] } = * v.validate({ key: "Name", value: "A10" }, {"type": "string"}); * */ @@ -91,7 +91,7 @@ declare module "jsonschema" { * Sets all the schemas of the Validator instance. * @param schemas */ - setSchemas (schemas: Array<{}>): void; + setSchemas (schemas: {}[]): void; /** * Returns the schema of a certain urn diff --git a/jsts/index.d.ts b/jsts/index.d.ts index 83ebf3bfe9..d5c7f8826f 100644 --- a/jsts/index.d.ts +++ b/jsts/index.d.ts @@ -1496,7 +1496,7 @@ declare namespace jsts { /** * @constructor */ - constructor(points: Array, factory?: any); + constructor(points: Coordinate[], factory?: any); /** * @return {jsts.geom.Coordinate} The n'th coordinate of this @@ -1574,7 +1574,7 @@ declare namespace jsts { /** * @constructor */ - constructor(shell: LinearRing, holes?: Array, factory?: any); + constructor(shell: LinearRing, holes?: LinearRing[], factory?: any); /** * Gets the exterior ring. diff --git a/jug/index.d.ts b/jug/index.d.ts index c46b4cdd73..c261b23b83 100644 --- a/jug/index.d.ts +++ b/jug/index.d.ts @@ -9,7 +9,7 @@ */ interface VertexStructure { level: number; - edge: Array; + edge: Vertex[]; data: VertexData; parent: Vertex; } @@ -101,26 +101,26 @@ interface Vertex { * @param {string} type - object type. * @param {Object} query - _.where query object. */ - find(type: string | void, query: Object): Array; + find(type: string | void, query: Object): VertexData[]; /** * Get siblings of specified edge. * @param {number} index - edge index. */ - getSiblingsOf(index: number): Array; + getSiblingsOf(index: number): VertexData[]; /** * Getting childs of an specified edge. * @param egde - target vertex; */ - getChildsOf(egde: number): Array; + getChildsOf(egde: number): VertexData[]; /** * Getting parents of an specified level and edge. * @param {number} level - max level. * @param {number} edge - edge index. */ - getParentsFrom(level: number, edge: number): Array; + getParentsFrom(level: number, edge: number): VertexData[]; /** * Getting the length of childs of an specified edge. diff --git a/nvd3/index.d.ts b/nvd3/index.d.ts index 9f7c18b1b3..732a01d335 100644 --- a/nvd3/index.d.ts +++ b/nvd3/index.d.ts @@ -638,7 +638,7 @@ id(value: number|string): this; /* options include 'silhouette', 'wiggle', 'expand', 'zero', or a custom function*/ stackOffset(offset: string): this; /* options include 'silhouette', 'wiggle', 'expand', 'zero', or a custom function*/ - stackOffset(offset: (data: Array<[number, number]>) => number[]): this; + stackOffset(offset: (data: [number, number][]) => number[]): this; /* The width the graph or component created inside the SVG should be made*/ width(): number; /*The width the graph or component created inside the SVG should be made.*/ @@ -730,7 +730,7 @@ id(value: number|string): this; /* options include 'silhouette', 'wiggle', 'expand', 'zero', or a custom function*/ stackOffset(offset: string): this; /* options include 'silhouette', 'wiggle', 'expand', 'zero', or a custom function*/ - stackOffset(offset: (data: Array<[number, number]>) => number[]): this; + stackOffset(offset: (data: [number, number][]) => number[]): this; /*D3 Format object for the label of pie/donut, discrete bar and multibar charts.*/ valueFormat(): string; /*D3 Format object for the label of pie/donut, discrete bar and multibar charts.*/ @@ -1233,7 +1233,7 @@ id(value: number|string): this; /* options include 'silhouette', 'wiggle', 'expand', 'zero', or a custom function*/ offset(offset: string): this; /* options include 'silhouette', 'wiggle', 'expand', 'zero', or a custom function*/ - offset(offset: (data: Array<[number, number]>) => number[]): this; + offset(offset: (data: [number, number][]) => number[]): this; order(): string; order(value: string): this; style(offset: 'stack'): this; @@ -2499,7 +2499,7 @@ id(value: number|string): this; /* options include 'silhouette', 'wiggle', 'expand', 'zero', or a custom function*/ stackOffset(offset: string): this; /* options include 'silhouette', 'wiggle', 'expand', 'zero', or a custom function*/ - stackOffset(offset: (data: Array<[number, number]>) => number[]): this; + stackOffset(offset: (data: [number, number][]) => number[]): this; /*Makes the X labels stagger at different distances from the axis so they're less likely to overlap.*/ staggerLabels(): boolean; /*Makes the X labels stagger at different distances from the axis so they're less likely to overlap.*/