Merge commit 'upstream/master~460' into types-2.0

This commit is contained in:
Mine Yalcinalp Starks 2016-11-18 14:06:56 -08:00
commit 02cc93be74
26 changed files with 8717 additions and 6286 deletions

View File

@ -76,7 +76,7 @@ declare module 'angular' {
}
interface IColorService {
applyThemeColors(element: Element|JQuery, colorExpression: IColorExpression): void;
applyThemeColors(element: Element | JQuery, colorExpression: IColorExpression): void;
getThemeColor(expression: string): string;
hasTheme(): boolean;
}
@ -224,7 +224,7 @@ declare module 'angular' {
hues: IThemeHues;
}
interface IBrowserColors{
interface IBrowserColors {
theme: string;
palette: string;
hue: string;
@ -354,6 +354,9 @@ declare module 'angular' {
removeClass(oldClass: string): void;
toggleClass(toggleClass: string): void;
updatePosition(position: IPanelPosition): void;
registerInterceptor(type: string, callback: () => angular.IPromise<any>): IPanelRef;
removeInterceptor(type: string, callback: () => angular.IPromise<any>): IPanelRef;
removeAllInterceptors(type?: string): IPanelRef;
}
interface IPanelPosition {
@ -369,8 +372,8 @@ declare module 'angular' {
centerVertically(): IPanelPosition;
center(): IPanelPosition;
addPanelPosition(xPosition: string, yPosition: string): IPanelPosition;
withOffsetX(offsetX: string): IPanelPosition;
withOffsetY(offsetY: string): IPanelPosition;
withOffsetX(offsetX: string | ((panel: IPanelPosition) => string)): IPanelPosition;
withOffsetY(offsetY: string | ((panel: IPanelPosition) => string)): IPanelPosition;
}
interface IPanelAnimation {
@ -403,6 +406,9 @@ declare module 'angular' {
SCALE: string,
FADE: string,
};
interceptorTypes: {
CLOSE: string,
};
}
}
}

View File

@ -1,4 +1,4 @@
// Type definitions for ArcGIS API for JavaScript v3.17
// Type definitions for ArcGIS API for JavaScript v3.18
// Project: http://js.arcgis.com
// Definitions by: Esri <http://www.esri.com>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@ -44,6 +44,7 @@ declare module "esri" {
import QueryTask = require("esri/tasks/QueryTask");
import TextSymbol = require("esri/symbols/TextSymbol");
import StandardGeographyQueryTask = require("esri/tasks/geoenrichment/StandardGeographyQueryTask");
import WCSConnection = require("esri/layers/WCSConnection");
import WMSLayerInfo = require("esri/layers/WMSLayerInfo");
import WMTSLayerInfo = require("esri/layers/WMTSLayerInfo");
@ -483,12 +484,14 @@ declare module "esri" {
featureLayers: FeatureLayer[];
/** Reference to the map object. */
map?: Map;
/** The point feature layer containing the origin points. */
originsLayer: FeatureLayer;
/** The point feature layers containing the origin points. */
originsLayers: FeatureLayer[];
/** The name of the output layer to be shown in the Result layer name input box. */
outputLayerName?: string;
/** The url to the ArcGIS.com site or in-house portal where the GP server is hosted. */
portalUrl?: string;
/** Indicates whether to display a drop down menu listing valid input analysis layers. */
showSelectAnalysisLayer?: boolean;
}
export interface CoordinatesLocationProviderOptions {
/** The attribute field in the graphic object that contains the longitude (X) values. */
@ -563,12 +566,14 @@ declare module "esri" {
export interface CreateWatershedsOptions {
/** The URL to the GPServer used to execute an analysis job. */
analysisGpServer?: string;
/** The feature layer containing input points used for calculating watersheds. */
inputLayer: FeatureLayer;
/** The feature layers containing input points used for calculating watersheds. */
inputLayers: FeatureLayer[];
/** Reference to the map object. */
map?: Map;
/** The url to the ArcGIS.com site or in-house portal where the GP server is hosted. */
portalUrl?: string;
/** Indicates whether to display a drop down menu listing valid input analysis layers. */
showSelectAnalysisLayer?: boolean;
}
export interface CutOptions {
/** The feature(s) added to the feature layer by the cut operation. */
@ -939,6 +944,10 @@ declare module "esri" {
outFields?: string[];
/** Displays or hides the attachment column. */
showAttachments?: boolean;
/** Displays or hides tooltips for column headers. */
showColumnHeaderTooltips?: boolean;
/** Shows or hides cyclical relationship. */
showCyclicalRelationships?: boolean;
/** Displays the data type of the field right under the field label. */
showDataTypes?: boolean;
/** Displays or hides total number of features and selected number of features in the grid header. */
@ -947,6 +956,8 @@ declare module "esri" {
showGridHeader?: boolean;
/** Displays or hides 'Options' drop-down menu of the FeatureTable. */
showGridMenu?: boolean;
/** Displays or hides the option to show related records in a table if the layer has pre-established relationship. */
showRelatedRecords?: boolean;
/** Displays or hides the 'Statistics' option in column menus for numeric fields. */
showStatistics?: boolean;
/** Enables an interaction between the map and the feature table. */
@ -1996,6 +2007,30 @@ declare module "esri" {
/** The URL to use for connecting to a socket. */
socketUrl?: string;
}
export interface StretchFilterOptions {
/** Indicates whether to perform dynamic range adjustment using the current pixel data. */
dra?: boolean;
/** An array of gamma values, for example [0.8, 0.8, 0.8]. */
gamma?: number[];
/** The maximum value of stretched pixels. */
max?: number;
/** Percent of pixels clipped on the right histogram tail, for example 0.25. */
maxPercent?: number;
/** The minimum value of stretched pixels. */
min?: number;
/** Percent of pixels clipped on the left histogram tail, for example 1.5. */
minPercent?: number;
/** The number of standard deviations for StandardDeviation stretch, for example 2.5. */
numberOfStandardDeviations?: number;
/** The output pixel type. */
outputPixelType?: string;
/** An array of arrays containing custom statistics objects. */
statistics?: any[][];
/** See the constants table for a list of possible stretchType values. */
stretchType?: number;
/** Indicates whether to perform non-linear gamma stretch. */
useGamma?: boolean;
}
export interface SummarizeNearbyOptions {
/** The URL to the GPServer used to execute an analysis job. */
analysisGpServer?: string;
@ -2023,6 +2058,8 @@ declare module "esri" {
showCredits?: boolean;
/** When true, the help links will be shown. */
showHelp?: boolean;
/** Indicates whether to display a drop down menu listing valid input analysis layers. */
showSelectAnalysisLayer?: boolean;
/** When true, the select folder dropdown will be shown. */
showSelectFolder?: boolean;
/** An array of possible statistics attribute field names and summary types that you wish to calculate for all nearby features. */
@ -2031,8 +2068,8 @@ declare module "esri" {
summaryLayer?: FeatureLayer;
/** An array of possible feature layers summarizing toward. */
summaryLayers: FeatureLayer[];
/** The point, line, or polygon feature layer from which distances will be measured to features in summarizeLayer. */
sumNearbyLayer: FeatureLayer;
/** The point, line, or polygon feature layers from which distances will be measured to features in summarizeLayer. */
sumNearbyLayers: FeatureLayer[];
/** If true. */
sumShape?: boolean;
/** Type of units shown as the defeault value in the Find nearest features using a option. */
@ -2184,27 +2221,37 @@ declare module "esri" {
/** Region of preview scale thumbnails. */
region?: string;
}
export interface WCSConnectionOptions {
/** The coverage identifier, defaults to the first coverage. */
coverageId?: string;
/** The version of WCSLayer, can be: 1.0.01.1.01.1.11.1.22.0.1 */
version?: string;
}
export interface WCSLayerOptions {
/** The coverage identifier, defaults to the first coverage. */
coverageId?: string;
/** Sets the layer's draw mode. */
drawMode?: boolean;
/** Sets the context of the Canvas. */
drawType?: string;
/** A function that takes a pixelData object as input and processes it. */
pixelFilter?: Function;
/** The version of WCSLayer, can be: 1.0.01.1.01.1.11.1.22.0.1 */
version?: string;
/** A WCS Connection object. */
wcsConnection?: WCSConnection;
}
export interface WFSLayerOptions {
/** Full WFS body request sent to WFS server via POST method. */
getFeatureRequest?: string;
/** URL used when executing getFeature request. */
getFeatureUrl?: string;
/** Use this to append custom parameters to WFS requests. */
customParameters?: any;
/** The template that defines the content to display in the map info window when the user clicks on a feature. */
infoTemplate?: InfoTemplate;
/** For "ondemand" mode only. */
inverseFilter?: boolean;
/** When true, the XY coordinates should be swapped (this is required for some WFS vendors, versions, and WKIDS). */
inverseResponse?: boolean;
/** Specifies the maximum number of features to return in one response. */
maxFeatures?: number;
/** The query mode for the WFS layer. */
mode?: string;
/** For "ondemand" mode only. */
nsGeometryFieldName?: string;
/** The full layer name including the namespace as a prefix. */
nsLayerName?: string;
/** When true, more details will be printed to console when the first connection to a WFS server is established. */
showDetails?: boolean;
/** The simple layer name (excluding the namespace). */
name?: string;
/** URL to the WFS server. */
url: string;
/** OGC WFS version number. */
@ -2235,6 +2282,10 @@ declare module "esri" {
title?: string;
}
export interface WMSLayerOptions {
/** The customLayerParameters object used for the WMS Layer. */
customLayerParameters?: any;
/** The customParameters object used for the WMS Layer. */
customParameters?: any;
/** Specify the map image format, valid options are png,jpg,bmp,gif,svg. */
format?: string;
/** An optional resourceInfo object. */
@ -2267,6 +2318,10 @@ declare module "esri" {
title?: string;
}
export interface WMTSLayerOptions {
/** The customLayerParameters object used for the WMTS Layer. */
customLayerParameters?: any;
/** The customParameters object used for the WMTS Layer. */
customParameters?: any;
/** A WMTSLayerInfo object that when ResourceInfo options are not specified the map will display the first layer in the WMTS capabilities that matches the properties specified by WMTSLayerInfo. */
layerInfo?: WMTSLayerInfo;
/** When true, tile resampling is enabled. */
@ -2783,7 +2838,7 @@ declare module "esri/TimeExtent" {
* Returns a new time extent indicating the intersection between "this" and the argument time extent.
* @param timeExtent The input time extent.
*/
intersection(timeExtent: number): TimeExtent;
intersection(timeExtent: TimeExtent): TimeExtent;
/**
* Returns a new time extent with the given offset from "this' time extent.
* @param offsetValue The length of time to offset from "this" time extent.
@ -2946,7 +3001,7 @@ declare module "esri/arcgis/Portal" {
/** The prefix selected by the organization's administrator to be used with the customBaseURL. */
urlKey: string;
/** User information for the accessing user is returned only when a token is passed in. */
user: any;
user: PortalUser;
/** If true, only simple where clauses that are complaint with SQL92 can be used when querying layers and tables. */
useStandardizedQuery: boolean;
/**
@ -3951,6 +4006,8 @@ declare module "esri/dijit/ElevationProfile" {
startup(): void;
/** Fires when the elevation profile is cleared. */
on(type: "clear-profile", listener: (event: { target: ElevationProfile }) => void): esri.Handle;
/** Fires after the profile is generated. */
on(type: "elevation-values", listener: (event: { data: any; target: ElevationProfile }) => void): esri.Handle;
/** Fires when the widget has fully loaded. */
on(type: "load", listener: (event: { target: ElevationProfile }) => void): esri.Handle;
/** Fires when the title of the elevation profile is changed */
@ -3967,6 +4024,7 @@ declare module "esri/dijit/FeatureTable" {
import FeatureLayer = require("esri/layers/FeatureLayer");
import Map = require("esri/map");
import FeatureEditResult = require("esri/layers/FeatureEditResult");
import Graphic = require("esri/graphic");
/** Creates an instance of the FeatureTable widget within the provided DOM node. */
class FeatureTable {
@ -4012,6 +4070,10 @@ declare module "esri/dijit/FeatureTable" {
selectedRows: any[];
/** Displays or hides the attachment column. */
showAttachments: boolean;
/** Displays or hides tooltips for column headers. */
showColumnHeaderTooltips: boolean;
/** Relies on showRelatedRecords property. */
showCyclicalRelationships: boolean;
/** Displays or hides the data type of the field right under the field label in the column header. */
showDataTypes: boolean;
/** Displays or hides total number of features and selected number of features in the grid header. */
@ -4020,6 +4082,8 @@ declare module "esri/dijit/FeatureTable" {
showGridHeader: boolean;
/** Displays or hides 'Options' drop-down menu of the FeatureTable. */
showGridMenu: boolean;
/** Displays or hides the option to show related records in a table if the layer has pre-established relationship. */
showRelatedRecords: boolean;
/** Displays or hides the 'Statistics' option in column menus for numeric fields. */
showStatistics: boolean;
/** Enables an interaction between the map and the feature table. */
@ -4032,35 +4096,55 @@ declare module "esri/dijit/FeatureTable" {
* @param srcNodeRef Reference or id of a HTML element that this dijit is rendered into.
*/
constructor(params: esri.FeatureTableOptions, srcNodeRef: Node | string);
/** Removes all current selections including subsets from filterSelectedRecords(). */
/** Centers the map on combined extent of selected rows. */
centerOnSelection(): void;
/** Removes all filters and selections in the table. */
clearFilter(): void;
/** Removes all selections. */
clearSelection(): void;
/** Destroys the FeatureTable widget. */
destroy(): void;
/**
* Allows users to see the sub-set of currently selected records (uses dGrid.query).
* @param toggle When true only a subset of currently selected features will be displayed in the FeatureTable.
* Filters the table based on the provided row ids.
* @param ids Array of row ids.
*/
filterSelectedRecords(toggle: boolean): void;
filterRecordsByIds(ids: number[]): void;
/** Allows users to see the sub-set of records. */
filterSelectedRecords(): void;
/**
* Queries and gets selected features from the FeatureLayer instead of the store.
* @param id Array of row ids
* @param id Row id or an array of row ids
*/
getFeatureDataById(id: number[]): any;
getFeatureDataById(id: number | number[]): any;
/**
* Gets row object by the row ID.
* @param id row ID
*/
getRowDataById(id: number): any;
/** Refreshes the data in the grid. */
/** Refreshes the data in the table. */
refresh(): void;
/** Resizes the grid's container. */
resize(): void;
/**
* Allows users to select rows(s) based on row id(s).
* @param ids Row id or an array of row ids
* @param scrollToRow Indicates whether the table should scroll to selected rows.
*/
selectRows(ids: number | number[], scrollToRow?: boolean): void;
/**
* Sorts a given field in ascending or descending order.
* @param field Name of the field
* @param descending Defines whether the specified field will be sorted in ascending or descending order.
*/
sort(field: string, descending?: boolean): void;
/** Finalizes the creation of the widget. */
startup(): void;
/** This event fires in response to clearSelection() method. */
on(type: "clear-selection", listener: (event: { target: FeatureTable }) => void): esri.Handle;
/** Fires when the grid column is resized. */
on(type: "column-resize", listener: (event: { target: FeatureTable }) => void): esri.Handle;
on(type: "column-resize", listener: (event: { resizeEvent: any; target: FeatureTable }) => void): esri.Handle;
/** Fires when a column is hidden or shown via 'Options' drop-down menu. */
on(type: "column-state-change", listener: (event: { target: FeatureTable }) => void): esri.Handle;
on(type: "column-state-change", listener: (event: { stateChangeEvent: any; target: FeatureTable }) => void): esri.Handle;
/** Fires when grid editor field loses focus after being changed. */
on(type: "data-change", listener: (event: { target: FeatureTable }) => void): esri.Handle;
/** Fires when grid editor is hidden. */
@ -4072,19 +4156,23 @@ declare module "esri/dijit/FeatureTable" {
/** Fires when an error occurs in the grid. */
on(type: "error", listener: (event: { target: FeatureTable }) => void): esri.Handle;
/** Fires when grid is filtered. */
on(type: "filter", listener: (event: { target: FeatureTable }) => void): esri.Handle;
on(type: "filter", listener: (event: { ids: number[]; target: FeatureTable }) => void): esri.Handle;
/** Fires when the FeatureTable is loaded. */
on(type: "load", listener: (event: { target: FeatureTable }) => void): esri.Handle;
/** Fires when the grid is refreshed. */
on(type: "refresh", listener: (event: { target: FeatureTable }) => void): esri.Handle;
/** Fires when a row is deselected. */
on(type: "row-deselect", listener: (event: { target: FeatureTable }) => void): esri.Handle;
on(type: "row-deselect", listener: (event: { event: any; target: FeatureTable }) => void): esri.Handle;
/** Fires when a row is selected. */
on(type: "row-select", listener: (event: { target: FeatureTable }) => void): esri.Handle;
on(type: "row-select", listener: (event: { event: any; target: FeatureTable }) => void): esri.Handle;
/** Fires when attachment is displayed in the table. */
on(type: "show-attachments", listener: (event: { attachments: any; dialog: any; featureId: number; target: FeatureTable }) => void): esri.Handle;
/** Fires when related records are displayed in the table. */
on(type: "show-related-records", listener: (event: { features: Graphic[]; relationship: any; row: any; target: FeatureTable }) => void): esri.Handle;
/** Fires when the statistics dialog box shows the calculated statistics on a column with numeric data. */
on(type: "show-statistics", listener: (event: { statistics: any; target: FeatureTable }) => void): esri.Handle;
/** Fires when a column is sorted. */
on(type: "sort", listener: (event: { target: FeatureTable }) => void): esri.Handle;
on(type: "sort", listener: (event: { sortEvent: any; target: FeatureTable }) => void): esri.Handle;
on(type: string, listener: (event: any) => void): esri.Handle;
}
export = FeatureTable;
@ -4168,7 +4256,7 @@ declare module "esri/dijit/Geocoder" {
import GraphicsLayer = require("esri/layers/GraphicsLayer");
import Symbol = require("esri/symbols/Symbol");
/** Starting with version 3.13, the Search Widget supersedes the Geocoder Widget and is deprecated. */
/** The Geocoder widget was deprecated in version 3.13 and replaced by the Search widget. */
class Geocoder {
/** Currently selected locator object. */
activeGeocoder: any;
@ -9403,6 +9491,8 @@ declare module "esri/layers/FeatureLayer" {
labelingInfo: LabelClass[];
/** Unique ID of the layer that the FeatureLayer was constructed against. */
layerId: number;
/** The maximum allowable offset, only applicable for layers that are not editable. */
maxAllowableOffset: number;
/** The maximum number of results that will be returned from a query. */
maxRecordCount: number;
/** Maximum visible scale for the layer. */
@ -10914,7 +11004,7 @@ declare module "esri/layers/VectorTileLayer" {
import SpatialReference = require("esri/SpatialReference");
import TileInfo = require("esri/layers/TileInfo");
/** A VectorTileLayer accesses cached tiles of data and renders it in vector format. */
/** A VectorTileLayer renders cached tiles of data. */
class VectorTileLayer extends Layer {
/** The full extent of the layer. */
fullExtent: Extent;
@ -10946,6 +11036,224 @@ declare module "esri/layers/VectorTileLayer" {
export = VectorTileLayer;
}
declare module "esri/layers/WCSConnection" {
import esri = require("esri");
import WCSCoverageDescription = require("esri/layers/WCSCoverageDescription");
import DimensionalDefinition = require("esri/layers/DimensionalDefinition");
/** (Currently in beta), a helper class to discover available coverages in an OGC Web Coverage Service. */
class WCSConnection {
/** Resamples pixel by bilinear interpolation. */
static INTERPOLATION_BILINEAR: any;
/** Resamples pixel by cubic convolution. */
static INTERPOLATION_CUBICCONVOLUTION: any;
/** Resamples pixel by nearest neighbor. */
static INTERPOLATION_NEARESTNEIGHBOR: any;
/** An array of coverages offered by the WCS server. */
coverages: WCSCoverageDescription[];
/** Multiple dimensional definitions are usually used to filter data. */
multidimensionalDefinition: DimensionalDefinition[];
/** The name of the WCS server. */
name: string;
/** Key-value pairs for URLs of different WCS operations: GetCapabilitiesDescribeCoverage */
onlineResources: any;
/** An array of string values indicating WCS 2.0.1 profiles. */
profiles: string[];
/** An array of supported formats by the server. */
supportedFormats: string[];
/** The interpolation method affects how the raster dataset is transformed when it undergoes warping or when it changes coordinate space. */
supportedInterpolations: number[];
/** An array of supported WCS versions by the server. */
supportedVersions: string[];
/** URL to a WCS Server endpoint. */
url: string;
/** The version of WCSLayer, can be: 1.0.01.1.01.1.11.1.22.0.1 */
version: string;
/**
* Creates a new WCSConnection.
* @param url URL to a WCS Server endpoint.
* @param options Optional parameters.
*/
constructor(url: string, options?: esri.WCSConnectionOptions);
/** Triggered when successfully retrieved list of coverages. */
on(type: "onConnected", listener: (event: { target: WCSConnection }) => void): esri.Handle;
/** Triggered when an error occurred. */
on(type: "onConnectionFailed", listener: (event: { error: Error; target: WCSConnection }) => void): esri.Handle;
on(type: string, listener: (event: any) => void): esri.Handle;
}
export = WCSConnection;
}
declare module "esri/layers/WCSCoverageDescription" {
import Extent = require("esri/geometry/Extent");
import Point = require("esri/geometry/Point");
import TimeInfo = require("esri/layers/TimeInfo");
/** (Currently in beta), the WCSCoverageDescription models the coverage properties offered by the WCS Server. */
class WCSCoverageDescription {
/** Resamples pixel by bilinear interpolation. */
static INTERPOLATION_BILINEAR: any;
/** Resamples pixel by cubic convolution. */
static INTERPOLATION_CUBICCONVOLUTION: any;
/** Resamples pixel by nearest neighbor. */
static INTERPOLATION_NEARESTNEIGHBOR: any;
/** An array of band names. */
bandInfo: string[];
/** Number of columns at the source resolution. */
columns: number;
/** The coverage description text. */
description: string;
/** Coverage extent in the native spatial reference. */
extent: Extent;
/** The coverage id. */
id: string;
/** Coverage extent in WGS84. */
lonLatEnvelope: Extent;
/** A parsed multidimensional object that describes variables and dimensions. */
multiDimensionalInfo: any;
/** A parsed coverage description object in a structure similar to WCS Coverage Description schema. */
nativeCoverageDescription: any;
/** Coverage's source resolution. */
resolution: Point;
/** Number of rows at the source resolution. */
rows: number;
/** Generalized from the following properties:SupportedFormats for WCS 1.0.0 and 1.1.xserviceParameters.supportedFormats for WCS 2.0.1. */
supportedFormats: string[];
/** The interpolation method affects how the raster dataset is transformed when it undergoes warping or when it changes coordinate space. */
supportedInterpolations: number[];
/** Temporal information for the layer, such as time extent. */
timeInfo: TimeInfo;
/** The current version of the coverage. */
version: string;
/**
* Creates a new WCSCoverageDescription.
* @param coverageDocument The coverage description XML.
* @param version The version of the coverage description document.
*/
constructor(coverageDocument: string, version: string);
}
export = WCSCoverageDescription;
}
declare module "esri/layers/WCSLayer" {
import esri = require("esri");
import WCSCoverageDescription = require("esri/layers/WCSCoverageDescription");
import Extent = require("esri/geometry/Extent");
import DimensionalDefinition = require("esri/layers/DimensionalDefinition");
import TimeInfo = require("esri/layers/TimeInfo");
import WCSConnection = require("esri/layers/WCSConnection");
import Point = require("esri/geometry/Point");
import Layer = require("esri/layers/layer");
/** (Currently in beta) The WCSLayer works with OGC Web Coverage Services. */
class WCSLayer {
/** Resamples pixel by bilinear interpolation. */
static INTERPOLATION_BILINEAR: any;
/** Resamples pixel by cubic convolution. */
static INTERPOLATION_CUBICCONVOLUTION: any;
/** Resamples pixel by nearest neighbor. */
static INTERPOLATION_NEARESTNEIGHBOR: any;
/** Zero-based array of current band selections. */
bandIds: number[];
/** A reference to a WCSCoverageDescription object. */
coverageDescription: WCSCoverageDescription;
/** The coverage identifier, defaults to the first coverage. */
coverageId: string;
/** The extent of the full coverage. */
extent: Extent;
/** Raster format of the layer. */
format: string;
/** Current interpolation method. */
interpolation: number;
/** When the layer is loaded, the value becomes "true", and layer properties can be accessed. */
loaded: boolean;
/** Multiple dimensional definitions are usually used to filter data. */
multidimensionalDefinition: DimensionalDefinition[];
/** Opacity or transparency of layer. */
opacity: number;
/** A function that takes a pixelData object as input and processes it. */
pixelFilter: Function;
/** The pixel type of the image service. */
pixelType: string;
/** The projected extent in the map's spatial reference. */
projectedFullExtent: Extent;
/** When true, the layer is suspended. */
suspended: boolean;
/** Temporal information for the layer, such as time extent. */
timeInfo: TimeInfo;
/** URL to a WCS Server endpoint. */
url: string;
/** The version of WCSLayer, can be: 1.0.01.1.01.1.11.1.22.0.1 */
version: string;
/** The visibility of the layer. */
visible: boolean;
/** A WCS Connection object. */
wcsConnection: WCSConnection;
/**
* Creates a new WCSLayer.
* @param url URL to a WCS Server endpoint.
* @param options Optional parameters.
*/
constructor(url: string, options?: esri.WCSLayerOptions);
/** Returns the context of the Canvas. */
getContext(): any;
/**
* Returns an array of graphics as a Promise.
* @param mapPoint The map point location in which to identify.
*/
identify(mapPoint: Point): any;
/** Resumes layer drawing. */
resume(): void;
/**
* Sets the opacity of the layer.
* @param opacity Value from 0 to 1, where 0 is 100% transparent and 1 has no transparency.
*/
setOpacity(opacity: number): void;
/**
* Sets a pixelFilter on the layer.
* @param pixelFilter The function defining the PixelFilter to set on the layer.
* @param doNotRefresh When true the layer will not refresh the map image.
*/
setPixelFilter(pixelFilter: Function, doNotRefresh?: boolean): void;
/**
* Determines if the layer will update its content based on the map's current time extent.
* @param use Use true to update the layer's content based on the map's current time extent.
*/
setUseMapTime(use: boolean): void;
/**
* Sets the visibility of the layer.
* @param isVisible Indicate whether to set layer visibility.
*/
setVisibility(isVisible: boolean): void;
/** Suspends layer drawing. */
suspend(): void;
/** Fires when there is a problem retrieving a layer. */
on(type: "error", listener: (event: { error: Error; target: WCSLayer }) => void): esri.Handle;
/** Fires after layer properties for the layer are successfully populated. */
on(type: "load", listener: (event: { layer: Layer; target: WCSLayer }) => void): esri.Handle;
/** Fires when the layer opacity has been changed, and returns an object with the opacity value. */
on(type: "opacity-change", listener: (event: { opacity: number; target: WCSLayer }) => void): esri.Handle;
/** This event is fired when the layer's refreshInterval is modified. */
on(type: "refresh-interval-change", listener: (event: { target: WCSLayer }) => void): esri.Handle;
/** Fires when a layer resumes drawing. */
on(type: "resume", listener: (event: { target: WCSLayer }) => void): esri.Handle;
/** Fires when a layer's minScale and/or maxScale is changed. */
on(type: "scale-range-change", listener: (event: { target: WCSLayer }) => void): esri.Handle;
/** Fires when a layer's scale visibility changes. */
on(type: "scale-visibility-change", listener: (event: { target: WCSLayer }) => void): esri.Handle;
/** Fires when a layer suspends drawing */
on(type: "suspend", listener: (event: { target: WCSLayer }) => void): esri.Handle;
/** Fires when a layer has finished updating its content. */
on(type: "update-end", listener: (event: { error: Error; target: WCSLayer }) => void): esri.Handle;
/** Fires when a layer begins to update its content. */
on(type: "update-start", listener: (event: { target: WCSLayer }) => void): esri.Handle;
/** Fires when the layer visibility has been changed, and returns an object with a Boolean visible property containing the new visibility value of the layer. */
on(type: "visibility-change", listener: (event: { visible: boolean; target: WCSLayer }) => void): esri.Handle;
on(type: string, listener: (event: any) => void): esri.Handle;
}
export = WCSLayer;
}
declare module "esri/layers/WFSLayer" {
import esri = require("esri");
import GraphicsLayer = require("esri/layers/GraphicsLayer");
@ -10957,6 +11265,8 @@ declare module "esri/layers/WFSLayer" {
/** (Currently in beta) A layer for OGC Web Feature Services (WFS). */
class WFSLayer extends GraphicsLayer {
/** Use this to append custom parameters to WFS requests. */
customParameters: any;
/** An array of fields in the layer. */
fields: Field[];
/** The full extent of the layer. */
@ -10987,6 +11297,11 @@ declare module "esri/layers/WFSLayer" {
redraw(): void;
/** Refreshes the features in the WFS layer. */
refresh(): void;
/**
* Sets the custom parameters used on the WFS layer.
* @param customParameters The customParameters object used append WFS requests.
*/
setCustomParameters(customParameters: any): void;
/** Sets the default line symbol to be used if no renderer is specified. */
setLineSymbol(): void;
/** Sets the default point symbol to be used if no renderer is specified. */
@ -11012,12 +11327,20 @@ declare module "esri/layers/WMSLayer" {
allExtents: Extent[];
/** Copyright of the WMS service. */
copyright: string;
/** Use this to append different custom parameters to WMS layer requests. */
customLayerParameters: any;
/** Use this to append custom parameters to all WMS requests. */
customParameters: any;
/** Description of the WMS service. */
description: string;
/** Extent of the WMS service. */
extent: Extent;
/** Feature info MIME type to request. */
featureInfoFormat: string;
/** The URL for the WMS GetFeatureInfo call. */
getFeatureInfoURL: string;
/** The URL for the WMS GetMap call. */
getMapUrl: string;
getMapURL: string;
/** The map image format. */
imageFormat: string;
/** List of layers in the WMS service. */
@ -11034,12 +11357,22 @@ declare module "esri/layers/WMSLayer" {
title: string;
/** Version of the WMS service. */
version: string;
/** A list of layer names that represent the layers to include in the exported map. */
visibleLayers: string[];
/**
* Creates a new WMSLayer object.
* @param url URL to the OGC Web Map Service.
* @param options Optional parameters.
*/
constructor(url: string, options?: esri.WMSLayerOptions);
/** Returns the current map image format. */
getImageFormat(): string;
/**
* Sets the custom parameters used on the WMS layer.
* @param customParameters The customParameters object used append WMS requests.
* @param customLayerParameters The customLayerParameters object used append specific WMS layer requests.
*/
setCustomParameters(customParameters: any, customLayerParameters?: any): void;
/**
* Set the map image format; valid values are "png", "jpg", "pdf", "bmp", "gif" and "svg".
* @param format The image format.
@ -11106,6 +11439,10 @@ declare module "esri/layers/WMTSLayer" {
class WMTSLayer extends TiledMapServiceLayer {
/** Copyright information for the service. */
copyright: string;
/** Use this to append different custom parameters to a WMTS tile request. */
customLayerParameters: any;
/** Use this to append custom parameters to all WMTS requests. */
customParameters: any;
/** The description of the active layer if specified in the capabilties file or the resource info. */
description: string;
/** The tile format. */
@ -11137,6 +11474,12 @@ declare module "esri/layers/WMTSLayer" {
* @param WMTSLayerInfo The WMTSLayerInfo for the layer to make active.
*/
setActiveLayer(WMTSLayerInfo: WMTSLayerInfo): void;
/**
* Sets the custom parameters used on the WMTS layer.
* @param customParameters The customParameters object used append WMTS requests.
* @param customLayerParameters The customLayerParameters object used append specific WMTS layer requests.
*/
setCustomParameters(customParameters: any, customLayerParameters?: any): void;
}
export = WMTSLayer;
}
@ -11315,6 +11658,47 @@ declare module "esri/layers/layer" {
export = Layer;
}
declare module "esri/layers/pixelfilters/StretchFilter" {
import esri = require("esri");
/** A stretch filter used to work with client -side pixel data to enhance raster/image appearances. */
class StretchFilter {
/** Indicates whether to perform dynamic range adjustment using the current pixel data. */
dra: boolean;
/** An array of gamma values, for example [0.8, 0.8, 0.8]. */
gamma: number[];
/** The maximum value of stretched pixels. */
max: number;
/** Percent of pixels clipped on the right histogram tail, for example 0.25. */
maxPercent: number;
/** The minimum value of stretched pixels. */
min: number;
/** Percent of pixels clipped on the left histogram tail, for example 1.5. */
minPercent: number;
/** The number of standard deviations for StandardDeviation stretch, for example 2.5. */
numberOfStandardDeviations: number;
/** The output pixel type. */
outputPixelType: string;
/** An array of arrays containing custom statistics objects. */
statistics: any[][];
/** Number indicating the various stretch types. */
stretchType: number;
/** Indicates whether to perform non-linear gamma stretch. */
useGamma: boolean;
/**
* Creates an instance of a StretchFilter.
* @param options Optional parameters.
*/
constructor(options?: esri.StretchFilterOptions);
/**
* It takes a pixelData object as input and processes it.
* @param pixelData The pixelData object used as filter input.
*/
filter(pixelData: any): void;
}
export = StretchFilter;
}
declare module "esri/map" {
import esri = require("esri");
import Attribution = require("esri/dijit/Attribution");
@ -11779,8 +12163,8 @@ declare module "esri/opsdashboard/ExtensionBase" {
static POLYLINE: any;
/** Read-only: Indicates if the host application is the Windows Operations Dashboard. */
isNative: boolean;
/** Read Only: It will list all of the Portal helper services. */
portalHelperServices: string;
/** Read-only: It will list all of the Portal helper services. */
portalHelperServices: any;
/** Read-only: The URL to the ArcGIS.com site or in-house portal that you are currently signed in to. */
portalUrl: string;
/** Get the collection of data sources from the host application. */
@ -11838,8 +12222,11 @@ declare module "esri/opsdashboard/ExtensionConfigurationBase" {
class ExtensionConfigurationBase extends ExtensionBase {
/** The object that will store the Widget/MapTool/FeatureAction configuration. */
config: any;
/** Indicates that the configuration is ready to be persisted or not. */
readyToPersistConfig: boolean;
/**
* Indicates if the configuration is ready to be persisted or not.
* @param ready Indicates that the configuration is ready to be persisted or not.
*/
readyToPersistConfig(ready: boolean): void;
}
export = ExtensionConfigurationBase;
}
@ -14127,6 +14514,8 @@ declare module "esri/tasks/FeatureSet" {
features: Graphic[];
/** Set of name-value pairs for the attribute's field and alias names. */
fieldAliases: any;
/** The array of fields. */
fields: any[];
/** The geometry type of the FeatureSet. */
geometryType: string;
/** When a FeatureSet is used as input to Geoprocessor, the spatial reference is set to the map's spatial reference by default. */
@ -14379,7 +14768,7 @@ declare module "esri/tasks/GeometryService" {
url: string;
/**
* Creates a new GeometryService object.
* @param url URL to the ArcGIS Server REST resource that represents a GeometryService, e.g., http://sampleserver6.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer.
* @param url URL to the ArcGIS Server REST resource that represents a GeometryService, https://utility.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer.
*/
constructor(url: string);
/**
@ -15165,6 +15554,7 @@ declare module "esri/tasks/PrintParameters" {
declare module "esri/tasks/PrintTask" {
import esri = require("esri");
import PrintParameters = require("esri/tasks/PrintParameters");
import DataFile = require("esri/tasks/DataFile");
/** The PrintTask class generates a printer-ready version of the map using an Export Web Map Task available with ArGIS Server 10.1 and later. */
class PrintTask {
@ -15184,7 +15574,7 @@ declare module "esri/tasks/PrintTask" {
*/
execute(printParameters: PrintParameters, callback?: Function, errback?: Function): any;
/** Fired when the print operation is complete. */
on(type: "complete", listener: (event: { url: string; target: PrintTask }) => void): esri.Handle;
on(type: "complete", listener: (event: { result: DataFile; target: PrintTask }) => void): esri.Handle;
/** Fired when an error occurs while executing the print task. */
on(type: "error", listener: (event: { error: Error; target: PrintTask }) => void): esri.Handle;
on(type: string, listener: (event: any) => void): esri.Handle;

53
d3-tip/d3-tip-tests.ts Normal file
View File

@ -0,0 +1,53 @@
/// <reference path="../d3/d3.d.ts" />
/// <reference path="d3-tip.d.ts" />
// test variables
interface dataType {
Title: string,
Number: number
}
let data: dataType[] = [ { Title: "one", Number: 1 }, { Title: "two", Number: 2} ];
let svgElement: SVGElement;
let root: HTMLElement;
// start tests
let d3tip: d3.Tooltip = d3.tip();
d3tip = d3tip.hide();
d3tip = d3tip.show();
d3tip = d3tip.show(data);
d3tip = d3tip.show(svgElement);
d3tip = d3tip.show(data, svgElement);
let attributeValue: string = d3tip.attr("library");
d3tip = d3tip.attr("library","d3");
d3tip = d3tip.attr("library", (d, i, o) => (d as dataType).Title);
d3tip = d3tip.attr<dataType>("library", (d, i, o) => d.Title);
let styleValue: string = d3tip.style("library");
d3tip = d3tip.style("library","d3");
d3tip = d3tip.style("library", (d, i, o) => (d as dataType).Title);
d3tip = d3tip.style<dataType>("library", (d, i, o) => d.Title);
let offsetValue: [number, number] = d3tip.offset();
d3tip = d3tip.offset([-1, -1]);
d3tip = d3tip.offset((d, i, o) => [-1, -1]);
let directionValue: ("n" | "s" | "e" | "w" | "nw" | "ne" | "sw" | "se") = d3tip.direction();
d3tip = d3tip.direction("n");
d3tip = d3tip.direction((d, i ,o) => "n");
let htmlValue: string = d3tip.html();
d3tip = d3tip.html("<html><html/>");
d3tip = d3tip.html((d, i ,o) => "<html><html/>");
let rootElementValue: HTMLElement = d3tip.rootElement();
d3tip = d3tip.rootElement(root);
d3tip = d3tip.rootElement<dataType>((d, i ,o) => root);
d3tip = d3tip.destroy();

40
d3-tip/d3-tip.d.ts vendored Normal file
View File

@ -0,0 +1,40 @@
// Type definitions for d3-tip
// Project: https://github.com/Caged/d3-tip
// Definitions by: Gert Braspenning <https://github.com/brspnnggrt>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../d3/d3.d.ts" />
declare namespace d3 {
type TooltipDirection = ("n" | "s" | "e" | "w" | "nw" | "ne" | "sw" | "se");
interface Tooltip {
hide(): Tooltip;
show(): Tooltip;
show<Datum>(data: Datum[]): Tooltip;
show(target: SVGElement): Tooltip;
show<Datum>(data: Datum[], target: SVGElement): Tooltip;
attr(name: string): string;
attr(name: string, value: Primitive): Tooltip;
attr<Datum>(name: string, value: (datum: Datum, index: number, outerIndex: number) => Primitive): Tooltip;
attr<Datum>(obj: { [key: string]: Primitive | ((datum: Datum, index: number, outerIndex: number) => Primitive) }): Tooltip;
style(name: string): string;
style(name: string, value: Primitive, priority?: string): Tooltip;
style<Datum>(name: string, value: (datum: Datum, index: number, outerIndex: number) => Primitive, priority?: string): Tooltip;
style<Datum>(obj: { [key: string]: Primitive | ((datum: Datum, index: number, outerIndex: number) => Primitive) }, priority?: string): Tooltip;
offset(): [number, number];
offset(tuple: [number, number]): Tooltip;
offset<Datum>(func: (datum: Datum, index: number, outerIndex: number) => [number, number]): Tooltip;
direction(): TooltipDirection;
direction(direction: TooltipDirection): Tooltip;
direction<Datum>(func: (datum: Datum, index: number, outerIndex: number) => TooltipDirection): Tooltip;
html(): string;
html(content: string): Tooltip;
html<Datum>(func: (datum: Datum, index: number, outerIndex: number) => string): Tooltip;
rootElement(): HTMLElement;
rootElement(element: HTMLElement): Tooltip;
rootElement<Datum>(func: (datum: Datum, index: number, outerIndex: number) => HTMLElement): Tooltip;
destroy(): Tooltip;
}
export function tip(): Tooltip;
}

View File

@ -189,4 +189,94 @@ dropzone.processFiles(addedFiles);
dropzone.processQueue();
dropzone.removeAllFiles(true);
dropzone
.on("drop", () => {
console.count('drop');
})
.on("dragstart", () => {
console.count('dragstart');
})
.on("dragend", () => {
console.count('dragend');
})
.on("dragenter", () => {
console.count('dragenter');
})
.on("dragover", () => {
console.count('dragover');
})
.on("dragleave", () => {
console.count('dragleave');
})
.on("paste", () => {
console.count('paste');
})
.on("reset", () => {
console.count('reset');
})
.on("addedfile", () => {
console.count('addedfile');
})
.on("addedfiles", () => {
console.count('addedfiles');
})
.on("removedfile", () => {
console.count('removedfile');
})
.on("thumbnail", () => {
console.count('thumbnail');
})
.on("error", () => {
console.count('error');
})
.on("errormultiple", () => {
console.count('errormultiple');
})
.on("processing", () => {
console.count('processing');
})
.on("processingmultiple", () => {
console.count('processingmultiple');
})
.on("uploadprogress", () => {
console.count('uploadprogress');
})
.on("totaluploadprogress", () => {
console.count('totaluploadprogress');
})
.on("sending", () => {
console.count('sending');
})
.on("sendingmultiple", () => {
console.count('sendingmultiple');
})
.on("success", () => {
console.count('success');
})
.on("successmultiple", () => {
console.count('successmultiple');
})
.on("canceled", () => {
console.count('canceled');
})
.on("canceledmultiple", () => {
console.count('canceledmultiple');
})
.on("complete", () => {
console.count('complete');
})
.on("completemultiple", () => {
console.count('completemultiple');
})
.on("maxfilesexceeded", () => {
console.count('maxfilesexceeded');
})
.on("maxfilesreached", () => {
console.count('maxfilesreached');
})
.on("queuecomplete", () => {
console.count('queuecomplete');
});
dropzone.destroy();

View File

@ -195,4 +195,93 @@ dropzone.processFiles(addedFiles);
dropzone.processQueue();
dropzone.removeAllFiles(true);
dropzone
.on("drop", () => {
console.count('drop');
})
.on("dragstart", () => {
console.count('dragstart');
})
.on("dragend", () => {
console.count('dragend');
})
.on("dragenter", () => {
console.count('dragenter');
})
.on("dragover", () => {
console.count('dragover');
})
.on("dragleave", () => {
console.count('dragleave');
})
.on("paste", () => {
console.count('paste');
})
.on("reset", () => {
console.count('reset');
})
.on("addedfile", () => {
console.count('addedfile');
})
.on("addedfiles", () => {
console.count('addedfiles');
})
.on("removedfile", () => {
console.count('removedfile');
})
.on("thumbnail", () => {
console.count('thumbnail');
})
.on("error", () => {
console.count('error');
})
.on("errormultiple", () => {
console.count('errormultiple');
})
.on("processing", () => {
console.count('processing');
})
.on("processingmultiple", () => {
console.count('processingmultiple');
})
.on("uploadprogress", () => {
console.count('uploadprogress');
})
.on("totaluploadprogress", () => {
console.count('totaluploadprogress');
})
.on("sending", () => {
console.count('sending');
})
.on("sendingmultiple", () => {
console.count('sendingmultiple');
})
.on("success", () => {
console.count('success');
})
.on("successmultiple", () => {
console.count('successmultiple');
})
.on("canceled", () => {
console.count('canceled');
})
.on("canceledmultiple", () => {
console.count('canceledmultiple');
})
.on("complete", () => {
console.count('complete');
})
.on("completemultiple", () => {
console.count('completemultiple');
})
.on("maxfilesexceeded", () => {
console.count('maxfilesexceeded');
})
.on("maxfilesreached", () => {
console.count('maxfilesreached');
})
.on("queuecomplete", () => {
console.count('queuecomplete');
});
dropzone.destroy();

122
dropzone/index.d.ts vendored
View File

@ -176,91 +176,91 @@ declare class Dropzone {
createThumbnailFromUrl(file:DropzoneFile, url:string, callback?:(...args:any[]) => void):any;
on(eventName:string, callback:(...args:any[]) => void):void;
on(eventName:string, callback:(...args:any[]) => void):Dropzone;
off(eventName:string):void;
off(eventName:string):Dropzone;
emit(eventName:string, ...args:any[]):void;
emit(eventName:string, ...args:any[]):Dropzone;
on(eventName:"drop", callback:(e:DragEvent) => any):void;
on(eventName:"dragstart", callback:(e:DragEvent) => any):void;
on(eventName:"dragend", callback:(e:DragEvent) => any):void;
on(eventName:"dragenter", callback:(e:DragEvent) => any):void;
on(eventName:"dragover", callback:(e:DragEvent) => any):void;
on(eventName:"dragleave", callback:(e:DragEvent) => any):void;
on(eventName:"paste", callback:(e:DragEvent) => any):void;
on(eventName:"drop", callback:(e:DragEvent) => any):Dropzone;
on(eventName:"dragstart", callback:(e:DragEvent) => any):Dropzone;
on(eventName:"dragend", callback:(e:DragEvent) => any):Dropzone;
on(eventName:"dragenter", callback:(e:DragEvent) => any):Dropzone;
on(eventName:"dragover", callback:(e:DragEvent) => any):Dropzone;
on(eventName:"dragleave", callback:(e:DragEvent) => any):Dropzone;
on(eventName:"paste", callback:(e:DragEvent) => any):Dropzone;
on(eventName:"reset"):void;
on(eventName:"reset"):Dropzone;
on(eventName:"addedfile", callback:(file:DropzoneFile) => any):void;
on(eventName:"addedfiles", callback:(files:DropzoneFile[]) => any):void;
on(eventName:"removedfile", callback:(file:DropzoneFile) => any):void;
on(eventName:"thumbnail", callback:(file:DropzoneFile, dataUrl:string) => any):void;
on(eventName:"addedfile", callback:(file:DropzoneFile) => any):Dropzone;
on(eventName:"addedfiles", callback:(files:DropzoneFile[]) => any):Dropzone;
on(eventName:"removedfile", callback:(file:DropzoneFile) => any):Dropzone;
on(eventName:"thumbnail", callback:(file:DropzoneFile, dataUrl:string) => any):Dropzone;
on(eventName:"error", callback:(file:DropzoneFile, message:string|Error) => any):void;
on(eventName:"errormultiple", callback:(files:DropzoneFile[], message:string|Error) => any):void;
on(eventName:"error", callback:(file:DropzoneFile, message:string|Error) => any):Dropzone;
on(eventName:"errormultiple", callback:(files:DropzoneFile[], message:string|Error) => any):Dropzone;
on(eventName:"processing", callback:(file:DropzoneFile) => any):void;
on(eventName:"processingmultiple", callback:(files:DropzoneFile[]) => any):void;
on(eventName:"processing", callback:(file:DropzoneFile) => any):Dropzone;
on(eventName:"processingmultiple", callback:(files:DropzoneFile[]) => any):Dropzone;
on(eventName:"uploadprogress", callback:(file:DropzoneFile, progress:number, bytesSent:number) => any):void;
on(eventName:"totaluploadprogress", callback:(totalProgress:number, totalBytes:number, totalBytesSent:number) => any):void;
on(eventName:"uploadprogress", callback:(file:DropzoneFile, progress:number, bytesSent:number) => any):Dropzone;
on(eventName:"totaluploadprogress", callback:(totalProgress:number, totalBytes:number, totalBytesSent:number) => any):Dropzone;
on(eventName:"sending", callback:(file:DropzoneFile, xhr:XMLHttpRequest, formData:FormData) => any):void;
on(eventName:"sendingmultiple", callback:(files:DropzoneFile[], xhr:XMLHttpRequest, formData:FormData) => any):void;
on(eventName:"sending", callback:(file:DropzoneFile, xhr:XMLHttpRequest, formData:FormData) => any):Dropzone;
on(eventName:"sendingmultiple", callback:(files:DropzoneFile[], xhr:XMLHttpRequest, formData:FormData) => any):Dropzone;
on(eventName:"success", callback:(file:DropzoneFile) => any):void;
on(eventName:"successmultiple", callback:(files:DropzoneFile[]) => any):void;
on(eventName:"success", callback:(file:DropzoneFile) => any):Dropzone;
on(eventName:"successmultiple", callback:(files:DropzoneFile[]) => any):Dropzone;
on(eventName:"canceled", callback:(file:DropzoneFile) => any):void;
on(eventName:"canceledmultiple", callback:(file:DropzoneFile[]) => any):void;
on(eventName:"canceled", callback:(file:DropzoneFile) => any):Dropzone;
on(eventName:"canceledmultiple", callback:(file:DropzoneFile[]) => any):Dropzone;
on(eventName:"complete", callback:(file:DropzoneFile) => any):void;
on(eventName:"completemultiple", callback:(file:DropzoneFile[]) => any):void;
on(eventName:"complete", callback:(file:DropzoneFile) => any):Dropzone;
on(eventName:"completemultiple", callback:(file:DropzoneFile[]) => any):Dropzone;
on(eventName:"maxfilesexceeded", callback:(file:DropzoneFile) => any):void;
on(eventName:"maxfilesreached", callback:(files:DropzoneFile[]) => any):void;
on(eventName:"queuecomplete"):void;
on(eventName:"maxfilesexceeded", callback:(file:DropzoneFile) => any):Dropzone;
on(eventName:"maxfilesreached", callback:(files:DropzoneFile[]) => any):Dropzone;
on(eventName:"queuecomplete"):Dropzone;
emit(eventName:"drop", e:DragEvent):void;
emit(eventName:"dragstart", e:DragEvent):void;
emit(eventName:"dragend", e:DragEvent):void;
emit(eventName:"dragenter", e:DragEvent):void;
emit(eventName:"dragover", e:DragEvent):void;
emit(eventName:"dragleave", e:DragEvent):void;
emit(eventName:"paste", e:DragEvent):void;
emit(eventName:"drop", e:DragEvent):Dropzone;
emit(eventName:"dragstart", e:DragEvent):Dropzone;
emit(eventName:"dragend", e:DragEvent):Dropzone;
emit(eventName:"dragenter", e:DragEvent):Dropzone;
emit(eventName:"dragover", e:DragEvent):Dropzone;
emit(eventName:"dragleave", e:DragEvent):Dropzone;
emit(eventName:"paste", e:DragEvent):Dropzone;
emit(eventName:"reset"):void;
emit(eventName:"reset"):Dropzone;
emit(eventName:"addedfile", file:DropzoneFile):void;
emit(eventName:"addedfiles", files:DropzoneFile[]):void;
emit(eventName:"removedfile", file:DropzoneFile):void;
emit(eventName:"thumbnail", file:DropzoneFile, dataUrl:string):void;
emit(eventName:"addedfile", file:DropzoneFile):Dropzone;
emit(eventName:"addedfiles", files:DropzoneFile[]):Dropzone;
emit(eventName:"removedfile", file:DropzoneFile):Dropzone;
emit(eventName:"thumbnail", file:DropzoneFile, dataUrl:string):Dropzone;
emit(eventName:"error", file:DropzoneFile, message:string|Error):void;
emit(eventName:"errormultiple", files:DropzoneFile[], message:string|Error):void;
emit(eventName:"error", file:DropzoneFile, message:string|Error):Dropzone;
emit(eventName:"errormultiple", files:DropzoneFile[], message:string|Error):Dropzone;
emit(eventName:"processing", file:DropzoneFile):void;
emit(eventName:"processingmultiple", files:DropzoneFile[]):void;
emit(eventName:"processing", file:DropzoneFile):Dropzone;
emit(eventName:"processingmultiple", files:DropzoneFile[]):Dropzone;
emit(eventName:"uploadprogress", file:DropzoneFile, progress:number, bytesSent:number):void;
emit(eventName:"totaluploadprogress", totalProgress:number, totalBytes:number, totalBytesSent:number):void;
emit(eventName:"uploadprogress", file:DropzoneFile, progress:number, bytesSent:number):Dropzone;
emit(eventName:"totaluploadprogress", totalProgress:number, totalBytes:number, totalBytesSent:number):Dropzone;
emit(eventName:"sending", file:DropzoneFile, xhr:XMLHttpRequest, formData:FormData):void;
emit(eventName:"sendingmultiple", files:DropzoneFile[], xhr:XMLHttpRequest, formData:FormData):void;
emit(eventName:"sending", file:DropzoneFile, xhr:XMLHttpRequest, formData:FormData):Dropzone;
emit(eventName:"sendingmultiple", files:DropzoneFile[], xhr:XMLHttpRequest, formData:FormData):Dropzone;
emit(eventName:"success", file:DropzoneFile):void;
emit(eventName:"successmultiple", files:DropzoneFile[]):void;
emit(eventName:"success", file:DropzoneFile):Dropzone;
emit(eventName:"successmultiple", files:DropzoneFile[]):Dropzone;
emit(eventName:"canceled", file:DropzoneFile):void;
emit(eventName:"canceledmultiple", file:DropzoneFile[]):void;
emit(eventName:"canceled", file:DropzoneFile):Dropzone;
emit(eventName:"canceledmultiple", file:DropzoneFile[]):Dropzone;
emit(eventName:"complete", file:DropzoneFile):void;
emit(eventName:"completemultiple", file:DropzoneFile[]):void;
emit(eventName:"complete", file:DropzoneFile):Dropzone;
emit(eventName:"completemultiple", file:DropzoneFile[]):Dropzone;
emit(eventName:"maxfilesexceeded", file:DropzoneFile):void;
emit(eventName:"maxfilesreached", files:DropzoneFile[]):void;
emit(eventName:"queuecomplete"):void;
emit(eventName:"maxfilesexceeded", file:DropzoneFile):Dropzone;
emit(eventName:"maxfilesreached", files:DropzoneFile[]):Dropzone;
emit(eventName:"queuecomplete"):Dropzone;
}

View File

@ -313,6 +313,7 @@ declare module Elasticsearch {
index: string;
type: string;
id: string;
parent?: string;
refresh?: boolean;
}

View File

@ -22,7 +22,7 @@ declare module "express-serve-static-core" {
}
interface RequestHandler {
(req: Request, res: Response, next?: NextFunction): any;
(req: Request, res: Response, next: NextFunction): any;
}
interface ErrorRequestHandler {
@ -822,6 +822,12 @@ declare module "express-serve-static-core" {
}
interface Application extends IRouter, Express.Application {
/**
* Express instance itself is a request handler, which could be invoked without
* third argument.
*/
(req: Request, res: Response): any;
/**
* Initialize the server.
*

12727
kendo-ui/index.d.ts vendored

File diff suppressed because it is too large Load Diff

77
knex/index.d.ts vendored
View File

@ -10,7 +10,7 @@ import * as events from "events";
type Callback = Function;
type Client = Function;
type Value = string | number | boolean | Date | Array<string> | Array<number> | Array<Date> | Array<boolean> | Buffer;
type Value = string | number | boolean | Date | Array<string> | Array<number> | Array<Date> | Array<boolean> | Buffer | Knex.Raw;
type ColumnName = string | Knex.Raw | Knex.QueryBuilder;
type TableName = string | Knex.Raw | Knex.QueryBuilder;
@ -29,7 +29,7 @@ interface Knex extends Knex.QueryInterface {
client: any;
migrate: Knex.Migrator;
seed: any;
fn: any;
fn: Knex.FunctionHelper;
on(eventName: string, callback: Function): Knex.QueryBuilder;
}
@ -326,9 +326,9 @@ declare namespace Knex {
}
interface Transaction extends QueryBuilder {
commit: any;
rollback: any;
raw: Knex.RawBuilder;
commit: any;
rollback: any;
raw: Knex.RawBuilder;
}
//
@ -345,40 +345,41 @@ declare namespace Knex {
table(tableName: string, callback: (tableBuilder: AlterTableBuilder) => any): Promise<void>;
dropTableIfExists(tableName: string): Promise<void>;
raw(statement: string): SchemaBuilder;
withSchema(schemaName: string): SchemaBuilder;
}
interface TableBuilder {
increments(columnName?: string): ColumnBuilder;
bigIncrements(columnName?: string): ColumnBuilder;
dropColumn(columnName: string): TableBuilder;
dropColumns(...columnNames: string[]): TableBuilder;
renameColumn(from: string, to: string): ColumnBuilder;
integer(columnName: string): ColumnBuilder;
bigInteger(columnName: string): ColumnBuilder;
text(columnName: string, textType?: string): ColumnBuilder;
string(columnName: string, length?: number): ColumnBuilder;
float(columnName: string, precision?: number, scale?: number): ColumnBuilder;
decimal(columnName: string, precision?: number, scale?: number): ColumnBuilder;
boolean(columnName: string): ColumnBuilder;
date(columnName: string): ColumnBuilder;
dateTime(columnName: string): ColumnBuilder;
time(columnName: string): ColumnBuilder;
timestamp(columnName: string): ColumnBuilder;
timestamps(): ColumnBuilder;
binary(columnName: string): ColumnBuilder;
enum(columnName: string, values: Value[]): ColumnBuilder;
enu(columnName: string, values: Value[]): ColumnBuilder;
json(columnName: string): ColumnBuilder;
jsonb(columnName: string): ColumnBuilder;
uuid(columnName: string): ColumnBuilder;
comment(val: string): TableBuilder;
specificType(columnName: string, type: string): ColumnBuilder;
primary(columnNames: string[]) : TableBuilder;
index(columnNames: string[], indexName?: string, indexType?: string) : TableBuilder;
unique(columnNames: string[], indexName?: string) : TableBuilder;
foreign(column: string): ForeignConstraintBuilder;
foreign(columns: string[]): MultikeyForeignConstraintBuilder;
dropForeign(columnNames: string[], foreignKeyName?: string): TableBuilder;
increments(columnName?: string): ColumnBuilder;
bigIncrements(columnName?: string): ColumnBuilder;
dropColumn(columnName: string): TableBuilder;
dropColumns(...columnNames: string[]): TableBuilder;
renameColumn(from: string, to: string): ColumnBuilder;
integer(columnName: string): ColumnBuilder;
bigInteger(columnName: string): ColumnBuilder;
text(columnName: string, textType?: string): ColumnBuilder;
string(columnName: string, length?: number): ColumnBuilder;
float(columnName: string, precision?: number, scale?: number): ColumnBuilder;
decimal(columnName: string, precision?: number, scale?: number): ColumnBuilder;
boolean(columnName: string): ColumnBuilder;
date(columnName: string): ColumnBuilder;
dateTime(columnName: string): ColumnBuilder;
time(columnName: string): ColumnBuilder;
timestamp(columnName: string): ColumnBuilder;
timestamps(): ColumnBuilder;
binary(columnName: string): ColumnBuilder;
enum(columnName: string, values: Value[]): ColumnBuilder;
enu(columnName: string, values: Value[]): ColumnBuilder;
json(columnName: string): ColumnBuilder;
jsonb(columnName: string): ColumnBuilder;
uuid(columnName: string): ColumnBuilder;
comment(val: string): TableBuilder;
specificType(columnName: string, type: string): ColumnBuilder;
primary(columnNames: string[]): TableBuilder;
index(columnNames: string[], indexName?: string, indexType?: string): TableBuilder;
unique(columnNames: string[], indexName?: string): TableBuilder;
foreign(column: string): ForeignConstraintBuilder;
foreign(columns: string[]): MultikeyForeignConstraintBuilder;
dropForeign(columnNames: string[], foreignKeyName?: string): TableBuilder;
}
interface CreateTableBuilder extends TableBuilder {
@ -544,6 +545,10 @@ declare namespace Knex {
status(config?: MigratorConfig): Promise<number>;
currentVersion(config?: MigratorConfig): Promise<string>;
}
interface FunctionHelper {
now(): Raw;
}
}
export = Knex;

View File

@ -411,11 +411,14 @@ knex.transaction(function(trx) {
console.error(error);
});
knex.schema.withSchema("public").hasTable("table") as Promise<boolean>;
knex.schema.createTable('users', function (table) {
table.increments();
table.string('name');
table.enu('favorite_color', ['red', 'blue', 'green']);
table.timestamps();
table.timestamp('created_at').defaultTo(knex.fn.now());
});
knex.schema.renameTable('users', 'old_users');

View File

@ -12,6 +12,13 @@ interface KnockoutStatic {
defineProperty<T>(obj: T, propertyName: string, options: KnockoutDefinePropertyOptions): T;
getObservable(obj: any, propertyName: string): KnockoutObservable<any>;
valueHasMutated(obj: any, propertyName: string): void;
es5: KnockoutEs5;
}
interface KnockoutEs5 {
getAllObservablesForObject<T>(obj: T, createIfNotDefined?: boolean): T;
notifyWhenPresentOrFutureArrayValuesMutate<T>(ko: KnockoutStatic, observable: KnockoutObservable<T>): void;
isTracked<T>(obj: T, propertyName: string): boolean;
}
interface KnockoutDefinePropertyOptions {

536
leaflet/index.d.ts vendored
View File

@ -199,17 +199,159 @@ declare namespace L {
export function bounds(points: BoundsLiteral): Bounds;
export interface Evented {
export type EventHandlerFn = (event: Event) => void;
export type EventHandlerFnMap = {[type: string]: EventHandlerFn};
/**
* A set of methods shared between event-powered classes (like Map and Marker).
* Generally, events allow you to execute some function when something happens
* with an object (e.g. the user clicks on the map, causing the map to fire
* 'click' event).
*/
export interface Evented {
/**
* Adds a listener function (fn) to a particular event type of the object.
* You can optionally specify the context of the listener (object the this
* keyword will point to). You can also pass several space-separated types
* (e.g. 'click dblclick').
*/
on(type: string, fn: EventHandlerFn, context?: Object): this;
/**
* Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
*/
on(eventMap: EventHandlerFnMap): this;
/**
* Removes a previously added listener function. If no function is specified,
* it will remove all the listeners of that particular event from the object.
* Note that if you passed a custom context to on, you must pass the same context
* to off in order to remove the listener.
*/
off(type: string, fn?: EventHandlerFn, context?: Object): this;
/**
* Removes a set of type/listener pairs.
*/
off(eventMap: EventHandlerFnMap): this;
/**
* Removes all listeners to all events on the object.
*/
off(): this;
/**
* Fires an event of the specified type. You can optionally provide a data
* object the first argument of the listener function will contain its properties.
* The event might can optionally be propagated to event parents.
*/
fire(type: string, data?: Object, propagate?: boolean): this;
/**
* Returns true if a particular event type has any listeners attached to it.
*/
listens(type: string): boolean;
/**
* Behaves as on(...), except the listener will only get fired once and then removed.
*/
once(type: string, fn: EventHandlerFn, context?: Object): this;
/**
* Behaves as on(...), except the listener will only get fired once and then removed.
*/
once(eventMap: EventHandlerFnMap): this;
/**
* Adds an event parent - an Evented that will receive propagated events
*/
addEventParent(obj: Evented): this;
/**
* Removes an event parent, so it will stop receiving propagated events
*/
removeEventParent(obj: Evented): this;
/**
* Alias for on(...)
*
* Adds a listener function (fn) to a particular event type of the object.
* You can optionally specify the context of the listener (object the this
* keyword will point to). You can also pass several space-separated types
* (e.g. 'click dblclick').
*/
addEventListener(type: string, fn: EventHandlerFn, context?: Object): this;
/**
* Alias for on(...)
*
* Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
*/
addEventListener(eventMap: EventHandlerFnMap): this;
/**
* Alias for off(...)
*
* Removes a previously added listener function. If no function is specified,
* it will remove all the listeners of that particular event from the object.
* Note that if you passed a custom context to on, you must pass the same context
* to off in order to remove the listener.
*/
removeEventListener(type: string, fn: EventHandlerFn, context?: Object): this;
/**
* Alias for off(...)
*
* Removes a set of type/listener pairs.
*/
removeEventListener(eventMap: EventHandlerFnMap): this;
/**
* Alias for off()
*
* Removes all listeners to all events on the object.
*/
clearAllEventListeners(): this;
/**
* Alias for once(...)
*
* Behaves as on(...), except the listener will only get fired once and then removed.
*/
addOneTimeEventListener(type: string, fn: EventHandlerFn, context?: Object): this;
/**
* Alias for once(...)
*
* Behaves as on(...), except the listener will only get fired once and then removed.
*/
addOneTimeEventListener(eventMap: EventHandlerFnMap): this;
/**
* Alias for fire(...)
*
* Fires an event of the specified type. You can optionally provide a data
* object the first argument of the listener function will contain its properties.
* The event might can optionally be propagated to event parents.
*/
fireEvent(type: string, data?: Object, propagate?: boolean): this;
/**
* Alias for listens(...)
*
* Returns true if a particular event type has any listeners attached to it.
*/
hasEventListeners(type: string): boolean;
}
interface LayerOptions {
pane?: string;
}
}
interface InteractiveLayerOptions extends LayerOptions {
interactive?: boolean;
}
}
export interface Layer extends Evented {
addTo(map: Map): this;
@ -303,11 +445,11 @@ declare namespace L {
zoomReverse?: boolean;
detectRetina?: boolean;
crossOrigin?: boolean;
}
}
export interface TileLayer extends GridLayer {
setUrl(url: string, noRedraw?: boolean): this;
}
}
export function tileLayer(urlTemplate: string, options?: TileLayerOptions): TileLayer;
@ -319,7 +461,7 @@ declare namespace L {
version?: string;
crs?: CRS;
uppercase?: boolean;
}
}
export interface WMS extends TileLayer {
setParams(params: Object, noRedraw?: boolean): this;
@ -355,7 +497,7 @@ declare namespace L {
export interface PathOptions extends InteractiveLayerOptions {
stroke?: boolean;
color?: string;
wight?: number;
weight?: number;
opacity?: number;
lineCap?: LineCapShape;
lineJoin?: LineJoinShape;
@ -366,7 +508,7 @@ declare namespace L {
fillOpacity?: number;
fillRule?: FillRule;
renderer?: Renderer;
className: string;
className?: string;
}
export interface Path extends Layer {
@ -485,6 +627,260 @@ declare namespace L {
export interface SVG extends Renderer {}
export namespace SVG {
export function create(name: string): SVGElement;
export function pointsToPath(rings: Array<Point>, close: boolean): string;
export function pointsToPath(rings: Array<PointTuple>, close: boolean): string;
}
export function svg(options?: RendererOptions): SVG;
export interface Canvas extends Renderer {}
export function canvas(options?: RendererOptions): Canvas;
/**
* Used to group several layers and handle them as one.
* If you add it to the map, any layers added or removed from the group will be
* added/removed on the map as well. Extends Layer.
*/
export interface LayerGroup extends Layer {
/**
* Returns a GeoJSON representation of the layer group (as a GeoJSON GeometryCollection).
*/
toGeoJSON(): Object; // should import GeoJSON typings
/**
* Adds the given layer to the group.
*/
addLayer(layer: Layer): this;
/**
* Removes the given layer from the group.
*/
removeLayer(layer: Layer): this;
/**
* Removes the layer with the given internal ID from the group.
*/
removeLayer(id: number): this;
/**
* Returns true if the given layer is currently added to the group.
*/
hasLayer(layer: Layer): boolean;
/**
* Removes all the layers from the group.
*/
clearLayers(): this;
/**
* Calls methodName on every layer contained in this group, passing any additional parameters.
* Has no effect if the layers contained do not implement methodName.
*/
invoke(methodName: string, ...params: Array<any>): this;
/**
* Iterates over the layers of the group,
* optionally specifying context of the iterator function.
*/
eachLayer(fn: (layer: Layer) => void, context?: Object): this;
/**
* Returns the layer with the given internal ID.
*/
getLayer(id: number): Layer;
/**
* Returns an array of all the layers added to the group.
*/
getLayers(): Array<Layer>;
/**
* Calls setZIndex on every layer contained in this group, passing the z-index.
*/
setZIndex(zIndex: number): this;
/**
* Returns the internal ID for a layer
*/
getLayerId(layer: Layer): number;
}
/**
* Create a layer group, optionally given an initial set of layers.
*/
export function layerGroup(layers: Array<Layer>): LayerGroup;
/**
* Extended LayerGroup that also has mouse events (propagated from
* members of the group) and a shared bindPopup method.
*/
export interface FeatureGroup extends LayerGroup {
/**
* Sets the given path options to each layer of the group that has a setStyle method.
*/
setStyle(style: PathOptions): this;
/**
* Brings the layer group to the top of all other layers
*/
bringToFront(): this;
/**
* Brings the layer group to the top [sic] of all other layers
*/
bringToBack(): this;
/**
* Returns the LatLngBounds of the Feature Group (created from
* bounds and coordinates of its children).
*/
getBounds(): LatLngBounds;
}
/**
* Create a feature group, optionally given an initial set of layers.
*/
export function featureGroup(layers?: Array<Layer>): FeatureGroup;
type StyleFunction = (feature: any) => PathOptions;
export interface GeoJSONOptions extends LayerOptions {
/**
* A Function defining how GeoJSON points spawn Leaflet layers.
* It is internally called when data is added, passing the GeoJSON point
* feature and its LatLng.
*
* The default is to spawn a default Marker:
*
* ```
* function(geoJsonPoint, latlng) {
* return L.marker(latlng);
* }
* ```
*/
pointToLayer?: (geoJsonPoint: Object, latlng: LatLng) => Layer; // should import GeoJSON typings
/**
* A Function defining the Path options for styling GeoJSON lines and polygons,
* called internally when data is added.
*
* The default value is to not override any defaults:
*
* ```
* function (geoJsonFeature) {
* return {}
* }
* ```
*/
style?: (geoJsonFeature: Object) => PathOptions;
/**
* A Function that will be called once for each created Feature, after it
* has been created and styled. Useful for attaching events and popups to features.
*
* The default is to do nothing with the newly created layers:
*
* ```
* function (feature, layer) {}
* ```
*/
onEachFeature?: (feature: Object, layer: Layer) => void;
/**
* A Function that will be used to decide whether to show a feature or not.
*
* The default is to show all features:
*
* ```
* function (geoJsonFeature) {
* return true;
* }
* ```
*/
filter?: (geoJsonFeature: Object) => boolean;
/**
* A Function that will be used for converting GeoJSON coordinates to LatLngs.
* The default is the coordsToLatLng static method.
*/
coordsToLatLng?: (coords: [number, number] | [number, number, number]) => LatLng; // check if LatLng has an altitude property
}
/**
* Represents a GeoJSON object or an array of GeoJSON objects.
* Allows you to parse GeoJSON data and display it on the map. Extends FeatureGroup.
*/
export interface GeoJSON extends FeatureGroup {}
export namespace GeoJSON {
/**
* Adds a GeoJSON object to the layer.
*/
export function addData(data: Object): Layer;
/**
* Resets the given vector layer's style to the original GeoJSON style,
* useful for resetting style after hover events.
*/
export function resetStyle(layer: Layer): Layer;
/**
* Changes styles of GeoJSON vector layers with the given style function.
*/
export function setStyle(style: PathOptions | StyleFunction): Layer;
/**
* Creates a Layer from a given GeoJSON feature. Can use a custom pointToLayer
* and/or coordsToLatLng functions if provided as options.
*/
export function geometryToLayer(featureData: Object, options?: GeoJSONOptions): Layer;
/**
* Creates a LatLng object from an array of 2 numbers (longitude, latitude) or
* 3 numbers (longitude, latitude, altitude) used in GeoJSON for points.
*/
export function coordsToLatLng(coords: [number, number] | [number, number, number]): LatLng;
/**
* Creates a multidimensional array of LatLngs from a GeoJSON coordinates array.
* levelsDeep specifies the nesting level (0 is for an array of points, 1 for an array of
* arrays of points, etc., 0 by default).
* Can use a custom coordsToLatLng function.
*/
export function coordsToLatLngs(coords: Array<number>, levelsDeep?: number, coordsToLatLng?: (coords: [number, number] | [number, number, number]) => LatLng): LatLng[]; // Not entirely sure how to define arbitrarily nested arrays
/**
* Reverse of coordsToLatLng
*/
export function latLngToCoords(latlng: LatLng): [number, number] | [number, number, number];
/**
* Reverse of coordsToLatLngs closed determines whether the first point should be
* appended to the end of the array to close the feature, only used when levelsDeep is 0.
* False by default.
*/
export function latLngsToCoords(latlngs: Array<LatLng>, levelsDeep?: number, closed?: boolean): [number, number] | [number, number, number];
/**
* Normalize GeoJSON geometries/features into GeoJSON features.
*/
export function asFeature(geojson: Object): Object;
}
/**
* Creates a GeoJSON layer.
*
* Optionally accepts an object in GeoJSON format to display on the
* map (you can alternatively add it later with addData method) and
* an options object.
*/
export function geoJSON(geojson?: Object, options?: GeoJSONOptions): GeoJSON;
type Zoom = boolean | 'center';
export interface MapOptions {
@ -544,8 +940,78 @@ declare namespace L {
bounceAtZoomLimits?: boolean;
}
export interface Control {
export type ControlPosition = 'topleft' | 'topright' | 'bottomleft' | 'bottomright';
export interface ControlOptions {
position?: ControlPosition;
}
export interface Control {
getPosition(): ControlPosition;
setPosition(position: ControlPosition): this;
getContainer(): HTMLElement;
addTo(map: Map): this;
remove(): this;
// Extension methods
onAdd(map: Map): HTMLElement;
onRemove(map: Map): void;
}
export namespace Control {
export interface ZoomOptions extends ControlOptions {
zoomInText?: string;
zoomInTitle?: string;
zoomOutText?: string;
zoomOutTitle?: string;
}
export interface Zoom extends Control {}
export interface AttributionOptions extends ControlOptions {
prefix?: string | boolean;
}
export interface Attribution extends Control {
setPrefix(prefix: string): this;
addAttribution(text: string): this;
removeAttribution(text: string): this;
}
export interface LayersOptions extends ControlOptions {
collapsed?: boolean;
autoZIndex?: boolean;
hideSingleBase?: boolean;
}
export interface Layers extends Control {
addBaseLayer(layer: Layer, name: string): this;
addOverlay(layer: Layer, name: string): this;
removeLayer(layer: Layer): this;
expand(): this;
collapse(): this;
}
export interface ScaleOptions extends ControlOptions {
maxWidth?: number;
metric?: boolean;
imperial?: boolean;
updateWhenIdle?: boolean;
}
export interface Scale extends Control {}
}
export namespace control {
export function zoom(options: Control.ZoomOptions): Control.Zoom;
export function attribution(options: Control.AttributionOptions): Control.Attribution;
type LayersObject = {[name: string]: Layer};
export function layers(baseLayers?: LayersObject, overlays?: LayersObject, options?: Control.LayersOptions): Control.Layers;
export function scale(options?: Control.ScaleOptions): Control.Scale;
}
interface DivOverlayOptions {
@ -920,8 +1386,58 @@ declare namespace L {
export function marker(latlng: LatLngLiteral, options?: MarkerOptions): Marker;
export function marker(latlng: LatLngTuple, options?: MarkerOptions): Marker;
export namespace Browser {
export const ie: boolean;
export const ielt9: boolean;
export const edge: boolean;
export const webkit: boolean;
export const gecko: boolean;
export const android: boolean;
export const android23: boolean;
export const chrome: boolean;
export const safari: boolean;
export const win: boolean;
export const ie3d: boolean;
export const webkit3d: boolean;
export const gecko3d: boolean;
export const opera12: boolean;
export const any3d: boolean;
export const mobile: boolean;
export const mobileWebkit: boolean;
export const mobiWebkit3d: boolean;
export const mobileOpera: boolean;
export const mobileGecko: boolean;
export const touch: boolean;
export const msPointer: boolean;
export const pointer: boolean;
export const retina: boolean;
export const canvas: boolean;
export const vml: boolean;
export const svg: boolean;
}
}
declare module 'leaflet' {
export = L;
export = L;
}

24
mathjax/index.d.ts vendored
View File

@ -578,6 +578,7 @@ declare namespace jax {
MMLorHTML?:IMMLorHTMLConfiguration;
NativeMML?:INativeMMLOutputProcessor;
"HTML-CSS"?:IHTMLCSSOutputProcessor;
CommonHTML?: ICommonHTMLOutputProcessor;
AsciiMath?:IAsciiMathInputProcessor;
MathML?:IMathMLInputProcessor;
TeX?:ITeXInputProcessor;
@ -1228,6 +1229,29 @@ declare namespace jax {
tooltip?:IToolTip;
}
export interface ICommonHTMLOutputProcessor {
/*The scaling factor (as a percentage) of math with respect to the surrounding text. The CommonHTML output
* processor tries to match the ex-size of the mathematics with that of the text where it is placed, but you may
* want to adjust the results using this scaling factor. The user can also adjust this value using the contextual
* menu item associated with the typeset mathematics.
*/
scale?:number;
/*This gives a minimum scale (as a percent) for the scaling used by MathJax to match the equation to the
* surrounding text. This will prevent MathJax from making the mathematics too small.
*/
minScaleAdjust?:number;
/*This setting controls whether <mtext> elements will be typeset using the math fonts or the font of the
* surrounding text. When false, the font for mathvariant="normal" will be used; when true, the font will be
* inherited from the surrounding paragraph.
*/
mtextFontInherit?:boolean;
/*This is an object that configures automatic linebreaking in the CommonHTML output. In order to be backward
* compatible with earlier versions of MathJax, only explicit line breaks are performed by default, so you must
* enable line breaks if you want automatic ones.
*/
linebreaks?:ILineBreaks;
}
export interface IAsciiMathInputProcessor {
/*Determines whether operators like summation symbols will have their limits above and below the operators
* (true) or to their right (false). The former is how they would appear in displayed equations that appear on

View File

@ -55,5 +55,6 @@ MathJax.Hub.Config({
MathJax.Hub.Config({
"HTML-CSS": { linebreaks: { automatic: true } },
CommonHTML: { linebreaks: { automatic: true } },
SVG: { linebreaks: { automatic: true } }
});

1
node/index.d.ts vendored
View File

@ -2834,6 +2834,7 @@ declare module "crypto" {
setPrivateKey(private_key: string, encoding: HexBase64Latin1Encoding): void;
}
export function createECDH(curve_name: string): ECDH;
export function timingSafeEqual(a: Buffer, b: Buffer): boolean;
export var DEFAULT_ENCODING: string;
}

View File

@ -542,6 +542,15 @@ namespace crypto_tests {
assert.deepEqual(clearText2, clearText);
}
{
let buffer1: Buffer = new Buffer([1, 2, 3, 4, 5]);
let buffer2: Buffer = new Buffer([1, 2, 3, 4, 5]);
let buffer3: Buffer = new Buffer([5, 4, 3, 2, 1]);
assert(crypto.timingSafeEqual(buffer1, buffer2))
assert(!crypto.timingSafeEqual(buffer1, buffer3))
}
}
//////////////////////////////////////////////////

39
openlayers/index.d.ts vendored
View File

@ -1255,6 +1255,7 @@ declare namespace olx {
fill?: ol.style.Fill;
image?: ol.style.Image;
stroke?: ol.style.Stroke;
circle?: ol.style.Circle;
text?: ol.style.Text;
zIndex?: number;
}
@ -3092,6 +3093,13 @@ declare namespace ol {
preventDefault(): void;
stopPropagation(): void;
}
class SelectEvent extends Event {
mapBrowserEvent: ol.MapBrowserEvent;
}
class DrawEvent extends Event {
feature: ol.Feature;
coordinate: ol.Coordinate;
}
}
namespace extent {
@ -3366,16 +3374,17 @@ declare namespace ol {
writeGeometryObject(geometry: ol.geom.Geometry, options?: olx.format.WriteOptions): JSON;
}
class GML {
class GML extends GMLBase {
}
class GML2 {
class GML2 extends GMLBase {
}
class GML3 {
class GML3 extends GMLBase{
}
class GMLBase {
class GMLBase extends ol.format.XMLFeature {
readFeatures(source: ol.source.Source, options?: olx.format.ReadOptions): Array<ol.Feature>;
}
class GPX {
@ -4089,6 +4098,8 @@ declare namespace ol {
* @param layout Layout.
*/
setCoordinates(coordinates: Array<Array<ol.Coordinate>>, layout?: ol.geom.GeometryLayout): void;
static fromCircle(circle: ol.geom.Circle, sides?: number, angle?: number): ol.geom.Polygon;
}
/**
* Abstract base class; only used for creating subclasses; do not instantiate
@ -4207,6 +4218,8 @@ declare namespace ol {
*/
class Draw extends ol.interaction.Pointer {
constructor(opt_options?: olx.interaction.DrawOptions);
static createRegularPolygon(sides?: number, angle?: number): ol.interaction.DrawGeometryFunctionType;
}
/**
* Events emitted by ol.interaction.Draw instances are instances of this type.
@ -5012,11 +5025,23 @@ declare namespace ol {
* @param Skip dispatching of removefeature events.
*/
clear(fast?: boolean): void;
/**
* Get the extent of the features currently in the source.
*/
getExtent(): ol.Extent;
/**
* Get all features whose geometry intersects the provided coordinate.
*/
getFeaturesAtCoordinate(coordinate: ol.Coordinate): ol.Feature[];
/**
* Get a feature by its identifier (the value returned by feature.getId()). Note that the index treats
* string and numeric identifiers as the same.
*/
getFeatureById(id: string | number): ol.Feature;
/**
* Get all features in the provided extent. Note that this returns all features whose bounding boxes
* intersect the given extent (so it may include features whose geometries do not intersect the extent).
@ -5033,6 +5058,12 @@ declare namespace ol {
* Get all features whose geometry intersects the provided coordinate.
*/
getFeaturesAtCoordinate(coordinate: ol.Coordinate): ol.Feature[];
/**
* Remove a single feature from the source. If you want to remove all features at once, use the source.clear()
* method instead.
*/
removeFeature(feature: ol.Feature): void;
}
class VectorEvent extends ol.events.Event {

View File

@ -2024,6 +2024,14 @@ declare module "react" {
export interface DrawerLayoutAndroidStatic extends React.ComponentClass<DrawerLayoutAndroidProperties> {
/**
* Specifies the side of the screen from which the drawer will slide in.
*/
positions: {
Left: number;
Right: number;
}
/**
* Opens the drawer.
*/

View File

@ -56,7 +56,7 @@ interface ComboBoxProps extends React.Props<ComboBoxClass> {
* textField` prop may also also used as to find an item in the list as you type. Providing
* an accessor function allows for computed text values
*/
textField?: string;
textField?: string | ((dataItem: any) => string);
/**
* This component is used to render each possible item in the Combobox. The default
* component renders the text of the selected item (specified by textfield)

View File

@ -39,7 +39,7 @@ interface DropdownListProps extends React.Props<DropdownListClass> {
* ThetextFieldprop may also also used as to find an item in the list as you type. Providing
* an accessor function allows for computed text values
*/
textField?: string;
textField?: string | ((dataItem: any) => string);
/**
* This component is used to render the selected value of the DropdownList. The default
* component renders the text of the selected item (specified by textfield)

3
react/index.d.ts vendored
View File

@ -2104,7 +2104,8 @@ declare namespace React {
stopOpacity?: number | string;
stroke?: string;
strokeDasharray?: string;
strokeLinecap?: string;
strokeLinecap?: "butt" | "round" | "square" | "inherit";
strokeLinejoin?: "miter" | "round" | "bevel" | "inherit";
strokeMiterlimit?: string;
strokeOpacity?: number | string;
strokeWidth?: number | string;

View File

@ -1,11 +1,11 @@
// Type definitions for TypeScript-STL v1.0.8
// Type definitions for TypeScript-STL v1.1.0
// Project: https://github.com/samchon/typescript-stl
// Definitions by: Jeongho Nam <http://samchon.org>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module "typescript-stl"
{
export = std;
export = std;
}
/**
@ -129,10 +129,21 @@ declare namespace std {
* <i>first</i> but not the element pointed by <i>last</i>.
* @param fn Unary function that accepts an element in the range as argument. This can either be a function p
* ointer or a move constructible function object. Its return value, if any, is ignored.
*
* @return Returns <i>fn</i>.
*/
function for_each<T, InputIterator extends Iterator<T>, Func extends (val: T) => any>(first: InputIterator, last: InputIterator, fn: Func): Func;
/**
* Apply function to range.
*
* Applies function *fn* to each of the elements in the range [*first*, *first + n*).
*
* @param first An {@link Iterator} to the initial position in a sequence.
* @param n the number of elements to apply the function to
* @param fn Unary function that accepts an element in the range as argument. This can either be a function p
* ointer or a move constructible function object. Its return value, if any, is ignored.
*
* @return first + n
*/
function for_each_n<T, InputIterator extends Iterator<T>>(first: InputIterator, n: number, fn: (val: T) => any): InputIterator;
/**
* <p> Test condition on all elements in range. </p>
*
@ -210,7 +221,7 @@ declare namespace std {
* @return <code>true</code> if all the elements in the range [<i>first1</i>, <i>last1</i>) compare equal to those
* of the range starting at <i>first2</i>, and <code>false</code> otherwise.
*/
function equal<T, Iterator1 extends Iterator<T>>(first1: Iterator1, last1: Iterator1, first2: Iterator<T>): boolean;
function equal<T, InputIterator extends Iterator<T>>(first1: InputIterator, last1: InputIterator, first2: Iterator<T>): boolean;
/**
* <p> Test whether the elements in two ranges are equal. </p>
*
@ -230,7 +241,7 @@ declare namespace std {
* @return <code>true</code> if all the elements in the range [<i>first1</i>, <i>last1</i>) compare equal to those
* of the range starting at <i>first2</i>, and <code>false</code> otherwise.
*/
function equal<T, Iterator1 extends Iterator<T>>(first1: Iterator1, last1: Iterator1, first2: Iterator<T>, pred: (x: T, y: T) => boolean): boolean;
function equal<T, InputIterator extends Iterator<T>>(first1: InputIterator, last1: InputIterator, first2: Iterator<T>, pred: (x: T, y: T) => boolean): boolean;
/**
* <p> Test whether range is permutation of another. </p>
*
@ -4434,8 +4445,8 @@ declare namespace std.base {
* {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index
* table like {@link RBTree tree} or {@link HashBuckets hash-table}. </p>
*
* <p> <a href="http://samchon.github.io/typescript-stl/images/class_diagram/map_containers.png" target="_blank">
* <img src="http://samchon.github.io/typescript-stl/images/class_diagram/map_containers.png" style="max-width: 100%" /></a> </p>
* <p> <a href="http://samchon.github.io/typescript-stl/images/design/class_diagram" target="_blank">
* <img src="http://samchon.github.io/typescript-stl/images/design/class_diagram" style="max-width: 100%" /></a> </p>
*
* <h3> Container properties </h3>
* <dl>
@ -4580,7 +4591,6 @@ declare namespace std.base {
* Return the number of elements in the map.
*/
size(): number;
protected _Get_data(): List<Pair<Key, T>>;
/**
* @inheritdoc
*/
@ -4589,6 +4599,84 @@ declare namespace std.base {
* @inheritdoc
*/
push<L extends Key, U extends T>(...args: [Key, T][]): number;
/**
* Construct and insert element with hint
*
* Inserts a new element in the {@link MapContainer map container}. This new element is constructed in
* place using *args* as the arguments for the element's constructor. *hint* points to a location in the
* container suggested as a hint on where to start the search for its insertion point (the container may or
* may not use this suggestion to optimize the insertion operation).
*
* A similar member function exists, {@link insert}, which either copies or moves an existing object into
* the container, and may also take a position *hint*.
*
* @param hint Hint for the position where the element can be inserted.
* @param key The key used both to look up and to insert if not found.
* @param value Value, the item.
*
* @return An iterator pointing to either the newly inserted element or to the element that already had an
* equivalent key in the {@link MapContainer}.
*/
emplace_hint(hint: MapIterator<Key, T>, key: Key, val: T): MapIterator<Key, T>;
/**
* Construct and insert element with hint
*
* Inserts a new element in the {@link MapContainer map container}. This new element is constructed in
* place using *args* as the arguments for the element's constructor. *hint* points to a location in the
* container suggested as a hint on where to start the search for its insertion point (the container may or
* may not use this suggestion to optimize the insertion operation).
*
* A similar member function exists, {@link insert}, which either copies or moves an existing object into
* the container, and may also take a position *hint*.
*
* @param hint Hint for the position where the element can be inserted.
* @param key The key used both to look up and to insert if not found.
* @param value Value, the item.
*
* @return An {@link MapIterator iterator} pointing to either the newly inserted element or to the element
* that already had an equivalent key in the {@link MapContainer}.
*/
emplace_hint(hint: MapReverseIterator<Key, T>, key: Key, val: T): MapReverseIterator<Key, T>;
/**
* Construct and insert element with hint
*
* Inserts a new element in the {@link MapContainer map container}. This new element is constructed in
* place using *args* as the arguments for the element's constructor. *hint* points to a location in the
* container suggested as a hint on where to start the search for its insertion point (the container may or
* may not use this suggestion to optimize the insertion operation).
*
* A similar member function exists, {@link insert}, which either copies or moves an existing object into
* the container, and may also take a position *hint*.
*
* @param hint Hint for the position where the element can be inserted.
* @param pair A single argument of a {@link Pair} type with a value for the *key* as
* {@link Pair.first first} member, and a *value* for the mapped value as
* {@link Pair.second second}.
*
* @return An iterator pointing to either the newly inserted element or to the element that already had an
* equivalent key in the {@link MapContainer}.
*/
emplace_hint(hint: MapIterator<Key, T>, pair: Pair<Key, T>): MapIterator<Key, T>;
/**
* Construct and insert element with hint
*
* Inserts a new element in the {@link MapContainer map container}. This new element is constructed in
* place using *args* as the arguments for the element's constructor. *hint* points to a location in the
* container suggested as a hint on where to start the search for its insertion point (the container may or
* may not use this suggestion to optimize the insertion operation).
*
* A similar member function exists, {@link insert}, which either copies or moves an existing object into
* the container, and may also take a position *hint*.
*
* @param hint Hint for the position where the element can be inserted.
* @param pair A single argument of a {@link Pair} type with a value for the *key* as
* {@link Pair.first first} member, and a *value* for the mapped value as
* {@link Pair.second second}.
*
* @return An {@link MapIterator iterator} pointing to either the newly inserted element or to the element
* that already had an equivalent key in the {@link MapContainer}.
*/
emplace_hint(hint: MapReverseIterator<Key, T>, pair: Pair<Key, T>): MapReverseIterator<Key, T>;
/**
* <p> Insert an element. </p>
*
@ -4596,7 +4684,9 @@ declare namespace std.base {
* by the number of element inserted (zero or one). </p>
*
* @param hint Hint for the position where the element can be inserted.
* @param pair {@link Pair} to be inserted as an element.
* @param pair A single argument of a {@link Pair} type with a value for the *key* as
* {@link Pair.first first} member, and a *value* for the mapped value as
* {@link Pair.second second}.
*
* @return An iterator pointing to either the newly inserted element or to the element that already had an
* equivalent key in the {@link MapContainer}.
@ -4609,7 +4699,9 @@ declare namespace std.base {
* by the number of element inserted (zero or one). </p>
*
* @param hint Hint for the position where the element can be inserted.
* @param pair {@link Pair} to be inserted as an element.
* @param pair A single argument of a {@link Pair} type with a value for the *key* as
* {@link Pair.first first} member, and a *value* for the mapped value as
* {@link Pair.second second}.
*
* @return An iterator pointing to either the newly inserted element or to the element that already had an
* equivalent key in the {@link MapContainer}.
@ -4753,12 +4845,12 @@ declare namespace std.base {
/**
* <p> Abstract method handling insertions for indexing. </p>
*
* <p> This method, {@link handle_insert} is designed to register the <i>first to last</i> to somewhere storing
* <p> This method, {@link _Handle_insert} is designed to register the <i>first to last</i> to somewhere storing
* those {@link MapIterator iterators} for indexing, fast accessment and retrievalance. </p>
*
* <p> When {@link insert} is called, new elements will be inserted into the {@link data_ list container} and new
* {@link MapIterator iterators} <i>first to last</i>, pointing the inserted elements, will be created and the
* newly created iterators <i>first to last</i> will be shifted into this method {@link handle_insert} after the
* newly created iterators <i>first to last</i> will be shifted into this method {@link _Handle_insert} after the
* insertions. </p>
*
* <p> If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link MapIterator iterators}
@ -4775,11 +4867,11 @@ declare namespace std.base {
/**
* <p> Abstract method handling deletions for indexing. </p>
*
* <p> This method, {@link handle_insert} is designed to unregister the <i>first to last</i> to somewhere storing
* <p> This method, {@link _Handle_erase} is designed to unregister the <i>first to last</i> to somewhere storing
* those {@link MapIterator iterators} for indexing, fast accessment and retrievalance. </p>
*
* <p> When {@link erase} is called with <i>first to last</i>, {@link MapIterator iterators} positioning somewhere
* place to be deleted, is memorized and shifted to this method {@link handle_erase} after the deletion process is
* place to be deleted, is memorized and shifted to this method {@link _Handle_erase} after the deletion process is
* terminated. </p>
*
* <p> If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link MapIterator iterators}
@ -4803,8 +4895,8 @@ declare namespace std {
/**
* <p> An iterator of {@link MapContainer map container}. </p>
*
* <p> <a href="http://samchon.github.io/typescript-stl/images/class_diagram/map_containers.png" target="_blank">
* <img src="http://samchon.github.io/typescript-stl/images/class_diagram/map_containers.png" style="max-width: 100%" /></a> </p>
* <p> <a href="http://samchon.github.io/typescript-stl/images/design/class_diagram" target="_blank">
* <img src="http://samchon.github.io/typescript-stl/images/design/class_diagram" style="max-width: 100%" /></a> </p>
*
* @author Jeongho Nam <http://samchon.org>
*/
@ -4874,8 +4966,8 @@ declare namespace std {
/**
* <p> A reverse-iterator of {@link MapContainer map container}. </p>
*
* <p> <a href="http://samchon.github.io/typescript-stl/images/class_diagram/map_containers.png" target="_blank">
* <img src="http://samchon.github.io/typescript-stl/images/class_diagram/map_containers.png" style="max-width: 100%" /></a> </p>
* <p> <a href="http://samchon.github.io/typescript-stl/images/design/class_diagram" target="_blank">
* <img src="http://samchon.github.io/typescript-stl/images/design/class_diagram" style="max-width: 100%" /></a> </p>
*
* @author Jeongho Nam <http://samchon.org>
*/
@ -4922,8 +5014,8 @@ declare namespace std.base {
* {@link List} and registering {@link ListIterator iterators} of the {@link data_ list container} to an index
* table like {@link RBTree tree} or {@link HashBuckets hash-table}. </p>
*
* <p> <a href="http://samchon.github.io/typescript-stl/images/class_diagram/map_containers.png" target="_blank">
* <img src="http://samchon.github.io/typescript-stl/images/class_diagram/map_containers.png" style="max-width: 100%" /></a> </p>
* <p> <a href="http://samchon.github.io/typescript-stl/images/design/class_diagram" target="_blank">
* <img src="http://samchon.github.io/typescript-stl/images/design/class_diagram" style="max-width: 100%" /></a> </p>
*
* <h3> Container properties </h3>
* <dl>
@ -5019,6 +5111,55 @@ declare namespace std.base {
* @hidden
*/
private extract_by_reverse_iterator(it);
/**
* Construct and insert element.
*
* Inserts a new element in the {@link UniqueMap} if its *key* is unique. This new element is constructed in
* place using args as the arguments for the construction of a *value_type* (which is an object of a
* {@link Pair} type).
*
* The insertion only takes place if no other element in the container has a *key equivalent* to the one
* being emplaced (*keys* in a {@link UniqueMap} container are unique).
*
* If inserted, this effectively increases the container {@link size} by one.
*
* A similar member function exists, {@link insert}, which either copies or moves existing objects into the
* container.
*
* @param key The key used both to look up and to insert if not found.
* @param value Value, the item.
*
* @return If the function successfully inserts the element (because no equivalent element existed already in
* the {@link UniqueMap}), the function returns a {@link Pair} of an {@link MapIterator iterator} to
* the newly inserted element and a value of true. Otherwise, it returns an
* {@link MapIterator iterator} to the equivalent element within the container and a value of false.
*/
emplace(key: Key, value: T): Pair<MapIterator<Key, T>, boolean>;
/**
* Construct and insert element.
*
* Inserts a new element in the {@link UniqueMap} if its *key* is unique. This new element is constructed in
* place using args as the arguments for the construction of a *value_type* (which is an object of a
* {@link Pair} type).
*
* The insertion only takes place if no other element in the container has a *key equivalent* to the one
* being emplaced (*keys* in a {@link UniqueMap} container are unique).
*
* If inserted, this effectively increases the container {@link size} by one.
*
* A similar member function exists, {@link insert}, which either copies or moves existing objects into the
* container.
*
* @param pair A single argument of a {@link Pair} type with a value for the *key* as
* {@link Pair.first first} member, and a *value* for the mapped value as
* {@link Pair.second second}.
*
* @return If the function successfully inserts the element (because no equivalent element existed already in
* the {@link UniqueMap}), the function returns a {@link Pair} of an {@link MapIterator iterator} to
* the newly inserted element and a value of true. Otherwise, it returns an
* {@link MapIterator iterator} to the equivalent element within the container and a value of false.
*/
emplace(pair: Pair<Key, T>): Pair<MapIterator<Key, T>, boolean>;
/**
* <p> Insert an element. </p>
*
@ -5032,7 +5173,9 @@ declare namespace std.base {
*
* <p> For a similar container allowing for duplicate elements, see {@link MultiMap}. </p>
*
* @param pair {@link Pair} to be inserted as an element.
* @param pair A single argument of a {@link Pair} type with a value for the *key* as
* {@link Pair.first first} member, and a *value* for the mapped value as
* {@link Pair.second second}.
*
* @return A {@link Pair}, with its member {@link Pair.first} set to an iterator pointing to either the newly
* inserted element or to the element with an equivalent key in the {@link UniqueMap}. The
@ -5198,13 +5341,49 @@ declare namespace std.base {
* @author Jeongho Nam <http://samchon.org>
*/
abstract class MultiMap<Key, T> extends MapContainer<Key, T> {
/**
* Construct and insert element.
*
* Inserts a new element in the {@link MultiMap}. This new element is constructed in place using <i>args</i>
* as the arguments for the element's constructor.
*
* This effectively increases the container {@link size} by one.
*
* A similar member function exists, {@link insert}, which either copies or moves existing objects into the
* container.
*
* @param key The key used both to look up and to insert if not found.
* @param value Value, the item.
*
* @return An {@link MapIterator iterator} to the newly inserted element.
*/
emplace(key: Key, value: T): MapIterator<Key, T>;
/**
* Construct and insert element.
*
* Inserts a new element in the {@link MultiMap}. This new element is constructed in place using <i>args</i>
* as the arguments for the element's constructor.
*
* This effectively increases the container {@link size} by one.
*
* A similar member function exists, {@link insert}, which either copies or moves existing objects into the
* container.
*
* @param pair A single argument of a {@link Pair} type with a value for the *key* as
* {@link Pair.first first} member, and a *value* for the mapped value as
* {@link Pair.second second}.
* @return An {@link MapIterator iterator} to the newly inserted element.
*/
emplace(pair: Pair<Key, T>): MapIterator<Key, T>;
/**
* <p> Insert elements. </p>
*
* <p> Extends the container by inserting new elements, effectively increasing the container {@link size} by
* the number of elements inserted. </p>
*
* @param pair {@link Pair} to be inserted as an element.
* @param pair A single argument of a {@link Pair} type with a value for the *key* as
* {@link Pair.first first} member, and a *value* for the mapped value as
* {@link Pair.second second}.
*
* @return An iterator pointing to the newly inserted element.
*/
@ -5459,8 +5638,8 @@ declare namespace std {
* <p> Elements with equivalent <i>keys</i> are grouped together in the same bucket and in such a way that
* an iterator can iterate through all of them. Iterators in the container are doubly linked iterators. </p>
*
* <p> <a href="http://samchon.github.io/typescript-stl/images/class_diagram/map_containers.png" target="_blank">
* <img src="http://samchon.github.io/typescript-stl/images/class_diagram/map_containers.png" style="max-width: 100%" /> </a>
* <p> <a href="http://samchon.github.io/typescript-stl/images/design/class_diagram" target="_blank">
* <img src="http://samchon.github.io/typescript-stl/images/design/class_diagram" style="max-width: 100%" /> </a>
* </p>
*
* <h3> Container properties </h3>
@ -5744,10 +5923,6 @@ declare namespace std.base {
* @inheritdoc
*/
size(): number;
/**
* @hidden
*/
_Get_data(): List<T>;
/**
* @inheritdoc
*/
@ -5854,12 +6029,12 @@ declare namespace std.base {
/**
* <p> Abstract method handling insertions for indexing. </p>
*
* <p> This method, {@link handle_insert} is designed to register the <i>first to last</i> to somewhere storing
* <p> This method, {@link _Handle_insert} is designed to register the <i>first to last</i> to somewhere storing
* those {@link SetIterator iterators} for indexing, fast accessment and retrievalance. </p>
*
* <p> When {@link insert} is called, new elements will be inserted into the {@link data_ list container} and new
* {@link SetIterator iterators} <i>first to last</i>, pointing the inserted elements, will be created and the
* newly created iterators <i>first to last</i> will be shifted into this method {@link handle_insert} after the
* newly created iterators <i>first to last</i> will be shifted into this method {@link _Handle_insert} after the
* insertions. </p>
*
* <p> If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link SetIterator iterators}
@ -5876,11 +6051,11 @@ declare namespace std.base {
/**
* <p> Abstract method handling deletions for indexing. </p>
*
* <p> This method, {@link handle_insert} is designed to unregister the <i>first to last</i> to somewhere storing
* <p> This method, {@link _Handle_erase} is designed to unregister the <i>first to last</i> to somewhere storing
* those {@link SetIterator iterators} for indexing, fast accessment and retrievalance. </p>
*
* <p> When {@link erase} is called with <i>first to last</i>, {@link SetIterator iterators} positioning somewhere
* place to be deleted, is memorized and shifted to this method {@link handle_erase} after the deletion process is
* place to be deleted, is memorized and shifted to this method {@link _Handle_erase} after the deletion process is
* terminated. </p>
*
* <p> If the derived one is {@link RBTree tree-based} like {@link TreeSet}, the {@link SetIterator iterators}
@ -7166,8 +7341,17 @@ declare namespace std {
* @author Jeongho Nam <http://samchon.org>
*/
class ListIterator<T> extends Iterator<T> {
/**
* @hidden
*/
private prev_;
/**
* @hidden
*/
private next_;
/**
* @hidden
*/
private value_;
/**
* <p> Construct from the source {@link List container}. </p>
@ -7204,14 +7388,6 @@ declare namespace std {
* @param val Value to set.
*/
value: T;
/**
* @hidden
*/
_Set_prev(it: ListIterator<T>): void;
/**
* @hidden
*/
_Set_next(it: ListIterator<T>): void;
/**
* @inheritdoc
*/
@ -8615,10 +8791,6 @@ declare namespace std {
* @inheritdoc
*/
equal_range(val: T): Pair<SetIterator<T>, SetIterator<T>>;
/**
* @hidden
*/
_Get_tree(): base.AtomicTree<T>;
/**
* @hidden
*/
@ -11440,7 +11612,6 @@ declare namespace std.base {
* Default Constructor.
*/
constructor(map: TreeMap<Key, T> | TreeMultiMap<Key, T>, compare?: (x: Key, y: Key) => boolean);
_Set_compare(val: (x: Key, y: Key) => boolean): void;
find(key: Key): XTreeNode<MapIterator<Key, T>>;
find(it: MapIterator<Key, T>): XTreeNode<MapIterator<Key, T>>;
/**
@ -11741,7 +11912,6 @@ declare namespace std.base {
* Default Constructor.
*/
constructor(set: TreeSet<T> | TreeMultiSet<T>, compare?: (x: T, y: T) => boolean);
_Set_compare(val: (x: T, y: T) => boolean): void;
find(val: T): XTreeNode<SetIterator<T>>;
find(it: SetIterator<T>): XTreeNode<SetIterator<T>>;
/**

View File

@ -0,0 +1,89 @@
/// <reference path="wiring-pi.d.ts" />
import * as wpi from 'wiring-pi';
console.log(wpi.VERSION);
// Setup
let ret: number = wpi.wiringPiSetup();
ret = wpi.wiringPiSetupGpio();
ret = wpi.wiringPiSetupPhys();
ret = wpi.wiringPiSetupSys();
ret = wpi.setup('wpi');
// Core functions
wpi.pinModeAlt(1, wpi.FSEL_ALT0);
wpi.pinMode(2, wpi.INPUT);
wpi.pullUpDnControl(2, wpi.PUD_UP);
let read: number = wpi.digitalRead(2);
wpi.pinMode(3, wpi.OUTPUT);
wpi.digitalWrite(3, wpi.HIGH);
wpi.pinMode(4, wpi.PWM_OUTPUT);
wpi.pwmWrite(4, 1023);
ret = wpi.gertboardAnalogSetup(5);
read = wpi.analogRead(5);
wpi.analogWrite(6, 100);
read = wpi.pulseIn(2, read);
wpi.delay(2);
wpi.delayMicroseconds(3);
ret = wpi.millis();
ret = wpi.micros();
// Interupts
wpi.wiringPiISR(2, wpi.INT_EDGE_BOTH, (delta: number) => console.log(delta));
wpi.wiringPiISRCancel(2);
// Raspberry Pi hardware specific functions
ret = wpi.piBoardRev();
let boardId: wpi.PiBoardId = wpi.piBoardId();
console.log(boardId.model === wpi.PI_MODEL_BP);
console.log(boardId.rev === wpi.PI_VERSION_2);
console.log(boardId.maker === wpi.PI_MAKER_SONY);
let pin: number = wpi.wpiPinToGpio(9);
pin = wpi.physPinToGpio(9);
wpi.setPadDrive(1, 7);
ret = wpi.getAlt(1);
wpi.digitalWriteByte(9);
wpi.pwmSetMode(wpi.PWM_MODE_MS);
wpi.pwmSetRange(100);
wpi.pwmSetClock(2);
wpi.pwmToneWrite(6, 1024);
wpi.gpioClockSet(6, 1024);
// I2C
let fd: number = wpi.wiringPiI2CSetup(2);
fd = wpi.wiringPiI2CSetupInterface('/dev/i2c-2', 2);
read = wpi.wiringPiI2CRead(fd);
ret = wpi.wiringPiI2CWrite(fd, read);
read = wpi.wiringPiI2CReadReg8(fd, 2);
read = wpi.wiringPiI2CReadReg16(fd, 2);
ret = wpi.wiringPiI2CWriteReg8(fd, 2, read);
ret = wpi.wiringPiI2CWriteReg16(fd, 2, read);
// SPI
fd = wpi.wiringPiSPIGetFd(2);
fd = wpi.wiringPiSPISetup(2, 32000000);
fd = wpi.wiringPiSPISetupMode(2, 32000000, 3);
let buff: Buffer = new Buffer("spi data");
ret = wpi.wiringPiSPIDataRW(2, buff);
console.log(buff.toString());
// Serial
fd = wpi.serialOpen('/dev/AMA0', 9600);
wpi.serialFlush(fd);
wpi.serialPutChar(fd, 'i'.charCodeAt(0));
wpi.serialPuts(fd, 'serial data');
wpi.serialPrintf(fd, 'more');
read = wpi.serialDataAvail(fd);
read = wpi.serialGetchar(fd);
wpi.serialClose(fd);
// Shift
ret = wpi.shiftIn(7, 8, wpi.MSBFIRST);
wpi.shiftOut(7, 8, wpi.LSBFIRST, ret);
// Soft PWM
wpi.pinMode(9, wpi.SOFT_PWM_OUTPUT);
ret = wpi.softPwmCreate(9, 100, 100);
wpi.softPwmWrite(9, 98);
wpi.softPwmStop(9);
// Soft Servo
ret = wpi.softServoSetup(10, 11, 12, 13, 14, 14, 16, 17);
wpi.softServoWrite(10, 100);
// Soft Tone
wpi.pinMode(18, wpi.SOFT_TONE_OUTPUT);
ret = wpi.softToneCreate(18);
wpi.softToneWrite(18, 98);
wpi.softToneStop(18);

314
wiring-pi/wiring-pi.d.ts vendored Normal file
View File

@ -0,0 +1,314 @@
// Type definitions for wiring-pi 2.1.1
// Project: https://github.com/eugeneware/wiring-pi
// Definitions by: Ivo Stratev <https://github.com/NoHomey>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
declare module 'wiring-pi' {
// Setup
export function wiringPiSetup(): number;
export function wiringPiSetupGpio(): number;
export function wiringPiSetupPhys(): number;
export function wiringPiSetupSys(): number;
export function setup(mode: string): number;
// Core functions
export function pinModeAlt(pin: number, mode: number): void;
export function pinMode(pin: number, mode: number): void;
export function pullUpDnControl(pin: number, pud: number): void;
export function digitalRead(pin: number): number;
export function digitalWrite(pin: number, state: number): void;
export function pwmWrite(pin: number, value: number): void;
export function analogRead(pin: number): number;
export function analogWrite(pin: number, value: number): void;
export function pulseIn(pin: number, state: number): number;
export function delay(ms: number): void;
export function delayMicroseconds(us: number): void;
export function millis(): number;
export function micros(): number;
// Interrupts
export function wiringPiISR(pin: number, edgeType: number, callback: (delta: number) => void): void;
export function wiringPiISRCancel(pin: number): void;
export const INST_EDGE_FALLING: number;
export const INT_EDGE_RISING: number;
export const INT_EDGE_BOTH: number;
export const INT_EDGE_SETUP: number;
// Raspberry Pi hardware specific functions
export function piBoardRev(): number;
export interface PiBoardId {
model: number;
rev: number;
mem: number;
maker: number;
overvolted: number;
}
export function piBoardId(): PiBoardId;
export function wpiPinToGpio(pin: number): number;
export function physPinToGpio(pin: number): number;
export function setPadDrive(group: number, value: number): void;
export function getAlt(pin: number): number;
export function digitalWriteByte(byte: number): void;
export function pwmSetMode(mode: number): void;
export function pwmSetRange(range: number): void;
export function pwmSetClock(divisor: number): void;
export function pwmToneWrite(pin: number, frequency: number): void;
export function gpioClockSet(pin: number, frequency: number): void;
// Constants
// WPI_MODEs
export const WPI_MODE_PINS: number;
export const WPI_MODE_PHYS: number;
export const WPI_MODE_GPIO: number;
export const WPI_MODE_GPIO_SYS: number;
export const WPI_MODE_PIFACE: number;
export const WPI_MODE_UNINITIALISED: number;
// pinMode
export const INPUT: number;
export const OUTPUT: number;
export const PWM_OUTPUT: number;
export const GPIO_CLOCK: number;
export const SOFT_PWM_OUTPUT: number;
export const SOFT_TONE_OUTPUT: number;
// pullUpDnControl
export const PUD_OFF: number;
export const PUD_DOWN: number;
export const PUD_UP: number;
// digitalRead/Write
export const HIGH: number;
export const LOW: number;
// pwmSetMode
export const PWM_MODE_BAL: number;
export const PWM_MODE_MS: number;
// PiBoardId.model
export const PI_MODEL_UNKNOWN: number;
export const PI_MODEL_A: number;
export const PI_MODEL_B: number;
export const PI_MODEL_BP: number;
export const PI_MODEL_CM: number;
export const PI_MODEL_AP: number;
export const PI_MODEL_2: number;
// PiBoardId.rev
export const PI_VERSION_UNKNOWN: number;
export const PI_VERSION_1: number;
export const PI_VERSION_1_1: number;
export const PI_VERSION_1_2: number;
export const PI_VERSION_2: number;
// PiBoardId,marker
export const PI_MAKER_UNKNOWN: number;
export const PI_MAKER_EGOMAN: number;
export const PI_MAKER_SONY: number;
export const PI_MAKER_QISDA: number;
export const PI_MAKER_MBEST: number;
// arrays
export const PI_MODEL_NAMES: string[];
export const PI_REVISION_NAMES: string[];
export const PI_MAKER_NAMES: string[];
// pinModeAlt
export const FSEL_INPT: number;
export const FSEL_OUTP: number;
export const FSEL_ALT0: number;
export const FSEL_ALT1: number;
export const FSEL_ALT2: number;
export const FSEL_ALT3: number;
export const FSEL_ALT4: number;
export const FSEL_ALT5: number;
// I2C
export function wiringPiI2CSetup(devId: number): number;
export function wiringPiI2CSetupInterface(device: string, devId: number): number;
export function wiringPiI2CRead(fd: number): number;
export function wiringPiI2CReadReg8(fd: number, reg: number): number;
export function wiringPiI2CReadReg16(fd: number, reg: number): number;
export function wiringPiI2CWrite(fd: number, data: number): number;
export function wiringPiI2CWriteReg8(fd: number, reg: number, data: number): number;
export function wiringPiI2CWriteReg16(fd: number, reg: number, data: number): number;
// SPI
export function wiringPiSPIGetFd(channel: number): number;
export function wiringPiSPIDataRW(channel: number, data: Buffer): number;
export function wiringPiSPISetup(channel: number, speed: number): number;
export function wiringPiSPISetupMode(channel: number, speed: number, mode: number): number;
// Serial
export function serialOpen(device: string, baudrate: number): number;
export function serialClose(fd: number): void;
export function serialFlush(fd: number): void;
export function serialPutChar(fd: number, character: number): void;
export function serialPuts(fd: number, data: string): void;
export function serialPrintf(fd: number, data: string): void;
export function serialDataAvail(fd: number): number;
export function serialGetchar(fd: number): number;
// Shift
export function shiftIn(dPin: number, cPin: number, order: number): number;
export function shiftOut(dPin: number, cPin: number, order: number, value: number): void;
export const LSBFIRST: number;
export const MSBFIRST: number;
// Soft PWM
export function softPwmCreate(pin: number, value: number, range: number): number;
export function softPwmWrite(pin: number, value: number): void;
export function softPwmStop(pin: number): void;
// Soft Servo
export function softServoWrite(pin: number, value: number): void;
export function softServoSetup(p0: number, p1: number, p2: number, p3: number, p4: number, p5: number, p6: number, p7: number): number;
// Soft Tone
export function softToneCreate(pin: number): number;
export function softToneWrite(pin: number, frequency: number): void;
export function softToneStop(pin: number): void;
// Extentions
// dac7678
export function dac7678Setup(pinBase: number, i2cAddress: number, vrefMode: number): number;
export const DAC7678_VREF_MODE_STATIC_ON: number;
export const DAC7678_VREF_MODE_STATIC_OFF: number;
export const DAC7678_VREF_MODE_FLEXIBLE_ON: number;
export const DAC7678_VREF_MODE_FLEXIBLE_ALWAYS_ON: number;
export const DAC7678_VREF_MODE_FLEXIBLE_ALWAYS_OFF: number;
// drcSerial
export function drcSerialSetup(pinBase: number, numPins: number, device: string, baudrate: number): number;
// max31855
export function max31855Setup(pinBase: number, spiChannel: number): number;
// max5322
export function max5322Setup(pinBase: number, spiChannel: number): number;
// mcp23008
export function mcp23008Setup(pinBase: number, i2cAddress: number): number;
// mpc23016
export function mpc23016Setup(pinBase: number, i2cAddress: number): number;
// mpc23017
export function mpc23017Setup(pinBase: number, i2cAddress: number): number;
// mcp23s08
export function mcp23s08Setup(pinBase: number, spiChannel: number, devId: number): number;
// mcp23s17
export function mcp23s17Setup(pinBase: number, spiChannel: number, devId: number): number;
// mcp3002
export function mcp3002Setup(pinBase: number, spiChannel: number): number;
// mcp3004/8
export function mcp3004Setup(pinBase: number, spiChannel: number): number;
// mcp3422
export function mcp3422Setup(pinBase: number, i2cAddress: number, sampleRate: number, gain: number): number;
export const MCP3422_SR_3_75: number;
export const MCP3422_SR_15: number;
export const MCP3422_SR_60: number;
export const MCP3422_SR_240: number;
export const MCP3422_GAIN_1: number;
export const MCP3422_GAIN_2: number;
export const MCP3422_GAIN_4: number;
export const MCP3422_GAIN_8: number;
// mcp4802
export function mcp4802Setup(pinBase: number, spiChannel: number): number;
// pca9685
export function pca9685Setuo(pinBase: number, i2cAddress: number, frequency: number): number;
// pcf8574
export function pcf8574Setup(pinBase: number, i2cAddress: number): number;
// pcf8591
export function pcf8591Setup(pinBase: number, i2cAddress: number): number;
// sn3218
export function sn3218Setup(pinBase: number): number;
// sr595
export function sr595Setup(pinBase: number, numPins: number, dataPin: number, clockPin: number, latchPin: number): number;
// DevLib
// ds1302
export function ds1302setup(clockPin: number, dataPin: number, csPin: number): void;
export function ds1302rtcRead(reg: number): number;
export function ds1302rtcWrite(reg: number, data: number): void;
export function ds1302ramRead(address: number): number;
export function ds1302ramWrite(address: number, data: number): void;
export function ds1302clockRead(): number[];
export function ds1302clockWrite(clcokData: number[]): void;
export function ds1302trickleCharge(diodes: number, resistors: number): void;
// GertBoard
export function gertboardAnalogSetup(pinBase: number): number;
// LCD
export function lcdInit(rows: number, cols: number, bits: number, rs: number, strb: number, d0: number, d1: number, d2: number, d3: number, d4: number, d5: number, d6: number, d7: number): number;
export function lcdHome(fd: number): void;
export function lcdClear(fd: number): void;
export function lcdDisplay(fd: number, state: number): void;
export function lcdCursor(fd: number, state: number): void;
export function lcdCursorBlink(fd: number, state: number): void;
export function lcdSendCommand(fd: number, command: number): void;
export function lcdPosition(fd: number, x: number, y: number): void;
export function lcdCharDef(fd: number, index: number, data: number[]): void;
export function lcdPutchar(fd: number, data: number): void;
export function lcdPuts(fd: number, data: string): void;
export function lcdPrintf(fd: number, data: string): void;
export const MAX_LCDS: number;
// LCD 128x64
export function lcd128x64setup(): number;
export function lcd128x64setOrigin(x: number, y: number): void;
export function lcd128x64setOrientation(orientation: number): void;
export function lcd128x64orientCoordinates(): number[];
export function lcd128x64getScreenSize(): number[];
export function lcd128x64point(x: number, y: number, color: number): void;
export function lcd128x64line(x0: number, y0: number, x1: number, y1: number, color: number): void;
export function lcd128x64lineTo(x: number, y: number, color: number): void;
export function lcd128x64rectangle(x1: number, y1: number, x2: number, y2: number, color: number, filled: number): void;
export function lcd128x64circle(x: number, y: number, r: number, color: number, filled: number): void;
export function lcd128x64ellipse(cx: number, cy: number, xRadius: number, yRadius: number, color: number, filled: number): void;
export function lcd128x64putchar(x: number, y: number, c: number, bgColor: number, fgColor: number): void;
export function lcd128x64puts(x: number, y: number, data: string, bgColor: number, fgColor: number): void;
export function lcd128x64update(): void;
export function lcd128x64clear(color: number): void;
// cd128x64clear
export function maxDetectRead(pin: number): number[];
export function readRHT03(pin: number): number[];
// piFace
export function piFaceSetup(pinBase: number): number;
// piGlow
export function piGlowSetup(clear: number): void;
export function piGlow1(leg: number, ring: number, intensity: number): void;
export function piGlowLeg(leg: number, intensity: number): void;
export function piGlowRing(ring: number, intensity: number): void;
export const PIGLOW_RED: number;
export const PIGLOW_YELLOW: number;
export const PIGLOW_ORANGE: number;
export const PIGLOW_GREEN: number;
export const PIGLOW_BLUE: number;
export const PIGLOW_WHITE: number;
// pinNes
export function setupNesJoystick(dPin: number, cPin: number, lPin: number): number;
export function readNesJoystick(joystick: number): number;
export const MAX_NES_JOYSTICKS: number;
export const NES_RIGHT: number;
export const NES_LEFT: number;
export const NES_DOWN: number;
export const NES_UP: number;
export const NES_START: number;
export const NES_SELECT: number;
export const NES_A: number;
export const NES_B: number;
// tcs34725
export function tcs34725Setup(i2cAddress: number, integrationTime: number, gain: number): number;
export interface tcs34725RGBC {
r: number;
g: number;
b: number;
c: number;
}
export function tcs34725ReadRGBC(id: number): tcs34725RGBC;
export interface tcs34725HSV {
h: number;
s: number;
v: number;
}
export function tcs34725ReadHSV(id: number): tcs34725HSV;
export function tcs34725GetCorrelatedColorTemperature(r: number, g: number, b: number): void;
export function tcs34725GetIlluminance(r: number, g: number, b: number): void;
export function tcs34725SetInterrupt(id: number, aien: number): void;
export function tcs34725ClearInterrupt(id: number): void;
export function tcs34725SetInterruptLimits(id: number, low: number, high: number): void;
export function tcs34725Enable(id: number): void;
export function tcs34725Disable(id: number): void;
export const TCS34725_ATIME_2_4MS: number;
export const TCS34725_ATIME_24MS: number;
export const TCS34725_ATIME_50MS: number;
export const TCS34725_ATIME_101MS: number;
export const TCS34725_ATIME_154MS: number;
export const TCS34725_ATIME_700MS: number;
export const TCS34725_GAIN_1: number;
export const TCS34725_GAIN_4: number;
export const TCS34725_GAIN_16: number;
export const TCS34725_GAIN_60: number;
export const TCS34725_MAX_TCS34725: number;
export const VERSION: string;
}