From d0ae397becba3600145a1a8336d7a5bfabe8be01 Mon Sep 17 00:00:00 2001 From: Peter Albert Date: Sun, 2 Aug 2015 14:11:59 +0200 Subject: [PATCH 001/126] Added missing types --- amcharts/AmCharts.d.ts | 62 +++++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/amcharts/AmCharts.d.ts b/amcharts/AmCharts.d.ts index 97dd3a3ff..b14bfbb26 100644 --- a/amcharts/AmCharts.d.ts +++ b/amcharts/AmCharts.d.ts @@ -178,15 +178,15 @@ declare module AmCharts { /** You can trigger the animation of the pie chart. */ animateAgain(); /** You can trigger the click on a slice from outside. index - the number of a slice or Slice object. */ - clickSlice(index); + clickSlice(index: number); /** Hides slice. index - the number of a slice or Slice object. */ - hideSlice(index); + hideSlice(index: number); /** You can simulate roll-out of a slice from outside. index - the number of a slice or Slice object. */ - rollOutSlice(index); + rollOutSlice(index: number); /** You can simulate roll-over a slice from outside. index - the number of a slice or Slice object. */ - rollOverSlice(index); + rollOverSlice(index: number); /** Shows slice. index - the number of a slice or Slice object. */ - showSlice(index); + showSlice(index: number); /** Adds event listener of the type "clickSlice" or "pullInSlice" or "pullOutSlice" to the object. @param type Always "clickSlice" or "pullInSlice" or "pullOutSlice". @@ -546,7 +546,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val /** Hides event bullets. */ hideStockEvents(); /** Removes event listener from the object. */ - removeListener(obj, type, handler); + removeListener(obj: any, type: string, handler: any); /** Removes panel from the stock chart. Requires stockChart.validateNow() method to be called after this action. */ removePanel(panel: StockPanel); /** Shows event bullets. */ @@ -556,7 +556,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val /** Method which forces the stock chart to rebuild. Should be called after properties are changed. */ validateNow(); /** Zooms chart to specified dates. startDate, endDate - Date objects. */ - zoom(startDate, endDate); + zoom(startDate: Date, endDate: Date); /** Zooms out the chart. */ zoomOut(); @@ -886,8 +886,11 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val /** AmChart is a base class of all charts. It can not be instantiated explicitly. AmCoordinateChart, AmPieChart and AmMap extend AmChart class. */ class AmChart { /** used when constructing a chart with a theme */ - constructor(theme: any); - /** Background color. You should set backgroundAlpha to >0 value in order background to be visible. We recommend setting background color directly on a chart's DIV instead of using this property. #FFFFFF */ + constructor(theme?: any); + /** Specifies, if class names should be added to chart elements. */ + addClassNames: boolean + + /** Background color. You should set backgroundAlpha to >0 value in order background to be visible. We recommend setting background color directly on a chart's DIV instead of using this property. #FFFFFF */ backgroundColor: string; /** The chart creates AmBalloon class itself. If you want to customize balloon, get balloon instance using this property, and then change balloon's properties. AmBalloon */ balloon: AmBalloon; @@ -938,7 +941,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val bold - specifies if text is bold (true/false), url - url */ - addLabel(x: number, y: number, text: string, align: string, size, color: string, rotation, alpha: number, bold: boolean, url: string); + addLabel(x: number, y: number, text: string, align: string, size: number, color: string, rotation: number, alpha: number, bold: boolean, url: string); /** Adds a legend to the chart. By default, you don't need to create div for your legend, however if you want it to be positioned in some different way, you can create div anywhere you want and pass id or reference to your div as a second parameter. (NOTE: This method will not work on StockPanel.) @@ -955,7 +958,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val addLegend(legend: AmLegend, legendDiv: HTMLElement); /** Adds title to the top of the chart. Pie, Radar positions are updated so that they won't overlap. Plot area of Serial/XY chart is also updated unless autoMargins property is set to false. You can add any number of titles - each of them will be placed in a new line. To remove titles, simply clear titles array: chart.titles = []; and call chart.validateNow() method. text - text of a title size - font size color - title color alpha - title opacity bold - boolean value indicating if title should be bold. */ - addTitle(text, size, color, alpha, bold); + addTitle(text: string, size: number, color: string, alpha: number, bold: boolean); /** Clears the chart area, intervals, etc. */ clear(); /** Removes all labels added to the chart. */ @@ -1186,16 +1189,16 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val startOnAxis: boolean; /** Number returns coordinate of a category. Works only if parseDates is false. If parseDates is true, use dateToCoordinate method. category - String */ - categoryToCoordinate(category); + categoryToCoordinate(category: string); /** date - Date object Returns Date of the coordinate, in case parseDates is set to true and equalSpacing is set to false. coordinate - Number */ - coordinateToDate(coordinate); + coordinateToDate(coordinate: number); /** Number Returns coordinate of the date, in case parseDates is set to true. if parseDates is false, use categoryToCoordinate method. date - Date object */ - dateToCoordinate(date); + dateToCoordinate(date: Date); /** Number Returns index of the category which is most close to specified coordinate. x - coordinate */ - xToIndex(x); + xToIndex(x: number); } /** ChartScrollbar class displays chart scrollbar. Supported by AmSerialChart and AmXYChart. @@ -1318,7 +1321,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val removeChartScrollbar(); /** Removes a trend line from a chart. You should call chart.validateNow() in order the changes to be visible. */ - removeTrendLine; + removeTrendLine(trendLine: TrendLine); } /* Trend lines are straight lines indicating trends, might also be used for some different purposes. Can be used by Serial and XY charts. To add/remove trend line, use chart.addTrendLine(trendLine)/chart.removeTrendLine(trendLine) methods or simply pass array of trend lines: chart.trendLines = [trendLine1, trendLine2]. @@ -1395,7 +1398,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val /** Hides cursor. */ hideCursor(); /** You can force cursor to appear at specified cateogry or date. */ - showCursorAt(category); + showCursorAt(category: string); /** Adds event listener of the type "changed" to the object. @param type Always "changed". @param handler Dispatched when cursor position is changed. "index" is a series index over which chart cursors currently is. "zooming" specifies if user is currently zooming (is selecting) the chart. mostCloseGraph property is set only when oneBalloonOnly is set to true.*/ @@ -1475,15 +1478,15 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val zoomOutOnDataUpdate: boolean; /** Number Returns index of the specified category value. value - series (category value) which index you want to find. */ - getCategoryIndexByValue(value); + getCategoryIndexByValue(value: number); /** Zooms out, charts shows all available data. */ zoomOut(); /** Zooms the chart by the value of the category axis. start - category value, String \\ end - category value, String */ - zoomToCategoryValues(start, end); + zoomToCategoryValues(start: Date, end: Date); /** Zooms the chart from one date to another. start - start date, Date object \\ end - end date, Date object */ - zoomToDates(start, end); + zoomToDates(start: Date, end: Date); /** Zooms the chart by the index of the category. start - start index, Number \\ end - end index, Number */ - zoomToIndexes(start, end); + zoomToIndexes(start: Date, end: Date); } class PeriodSelector { @@ -1522,7 +1525,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val . @param handler - Dispatched when dates in period selector input fields are changed or user clicks on one of the predefined period buttons. */ - addListener(type, handler: (e: { + addListener(type: string, handler: (e: { /** Always: "changed" */ type: string; @@ -2314,20 +2317,23 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val /** If true, values will always be formatted using scientific notation (5e+8, 5e-8...) Otherwise only values bigger then 1e+21 and smaller then 1e-7 will be displayed in scientific notation. */ useScientificNotation: boolean; + /** Adds guide to the axis. */ + addGuide(guide: Guide); /** Adds event listener to the object. type - string like 'axisChanged' (should be listed in 'events' section of this class or classes which extend this class). handler - function which is called when event happens */ - addListener(type, handler); + addListener(type: string, handler: any); /** Number, - value of coordinate. Returns value of the coordinate. coordinate - y or x coordinate, in pixels. */ - coordinateToValue(coordinate); + coordinateToValue(coordinate: number); /** Number - coordinate Returns coordinate of the value in pixels. value - Number */ - getCoordinate(value); - + getCoordinate(value: number); + /** Removes guide from the axis.*/ + removeGuide(guide: Guide); /** Removes event listener from the object. */ - removeListener(obj, type, handler); + removeListener(obj: any, type: string, handler: any); /** One value axis can be synchronized with another value axis. You should set synchronizationMultiplyer in order for this to work. */ synchronizeWithAxis(axis:ValueAxis); /** XY Chart only. Zooms-in the axis to the provided values. */ - zoomToValues(startValue, endValue); + zoomToValues(startValue: number, endValue: number); /** Adds event listener of the type "axisZoomed" to the object. @param type Always "axisZoomed". From e059177a21193ff2079fbd2deed2dc748325a671 Mon Sep 17 00:00:00 2001 From: Peter Albert Date: Sun, 2 Aug 2015 14:12:45 +0200 Subject: [PATCH 002/126] Added missing properties to Guide class --- amcharts/AmCharts.d.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/amcharts/AmCharts.d.ts b/amcharts/AmCharts.d.ts index b14bfbb26..9790a8c07 100644 --- a/amcharts/AmCharts.d.ts +++ b/amcharts/AmCharts.d.ts @@ -311,22 +311,32 @@ declare module AmCharts { If you do not set properties such as dashLength, lineAlpha, lineColor, etc - values of the axis are used.*/ class Guide { + /** If you set it to true, the guide will be displayed above the graphs. */ + above: boolean; /** Radar chart only. Specifies angle at which guide should start. Affects only fills, not lines. */ angle: number; /** Baloon fill color. */ balloonColor: string; /** The text which will be displayed if the user rolls-over the guide. */ balloonText: string; + /** Specifies if label should be bold or not. */ + boldLabel: boolean; /** Category of the guide (in case the guide is for category axis). */ category: string; /** Dash length. */ dashLength: number; /** Date of the guide (in case the guide is for category axis and parseDates is set to true). */ date: Date; + /** Works if a guide is added to CategoryAxis and this axis is non-date-based. If you set it to true, the guide will start (or be placed, if it's not a fill) on the beginning of the category cell and will end at the end of toCategory cell. */ + expand: boolean; /** Fill opacity. Value range is 0 - 1. */ fillAlpha: number; /** Fill color. */ fillColor: string; + /** Font size of guide label. */ + fontSize: number; + /** Unique id of a Guide. You don't need to set it, unless you want to. */ + id: string; /** Specifies whether label should be placed inside or outside plot area. */ inside: boolean; /** The label which will be displayed near the guide. */ @@ -339,6 +349,8 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val lineColor: string; /** Line thickness. */ lineThickness: number; + /** Position of guide label. Possible values are "left" or "right" for horizontal axis and "top" or "bottom" for vertical axis. */ + position: string; /** Tick length. */ tickLength: number; /** Radar chart only. Specifies angle at which guide should end. Affects only fills, not lines. */ @@ -351,6 +363,8 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val toValue: number; /** Value of the guide (in case the guide is for value axis). */ value: number; + /** Value axis of a guide. As you can add guides directly to the chart, you might need to specify which which value axis should be used. */ + valueAxis: ValueAxis; } /** ImagesSettings is a class which holds common settings of all MapImage objects. */ class ImagesSettings { From 66175c9e784f193d8a72e64461f277ca3f2be7c8 Mon Sep 17 00:00:00 2001 From: Peter Albert Date: Sun, 2 Aug 2015 14:12:58 +0200 Subject: [PATCH 003/126] added Label class --- amcharts/AmCharts.d.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/amcharts/AmCharts.d.ts b/amcharts/AmCharts.d.ts index 9790a8c07..56435e784 100644 --- a/amcharts/AmCharts.d.ts +++ b/amcharts/AmCharts.d.ts @@ -1712,6 +1712,31 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val urlTarget: string; } + /** Creates a label on the chart which can be placed anywhere, multiple can be assigned. */ + class Label { + /** Default: 'left' */ + align: string; + /** Default: 1 */ + alpha: number; + /** Specifies if label is bold or not. */ + bold: boolean; + /** Color of a label */ + color: string; + /** Unique id of a Label. You don't need to set it, unless you want to. */ + id: string; + /** Rotation angle. */ + rotation: number; + /** Text size */ + size: number; + /** Text of a label */ + text: string; + /** URL which will be access if user clicks on a label. */ + url: string; + /** X position of a label. */ + x: number|string; + /** y position of a label. */ + y: number|string; + } /** Common settings of legends. If you change a property after the chart is initialized, you should call stockChart.validateNow() method in order for it to work. If there is no default value specified, default value of StockLegend class will be used. */ class LegendSettings { /** Alignment of legend entries. Possible values are: "left", "right" and "center". */ From 54c3c1be101aefe1e693d472c805d1d628f64e04 Mon Sep 17 00:00:00 2001 From: Peter Albert Date: Sun, 2 Aug 2015 14:13:29 +0200 Subject: [PATCH 004/126] Added missing properties to class ValueAxis --- amcharts/AmCharts.d.ts | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/amcharts/AmCharts.d.ts b/amcharts/AmCharts.d.ts index 56435e784..b1fe9fea6 100644 --- a/amcharts/AmCharts.d.ts +++ b/amcharts/AmCharts.d.ts @@ -2311,24 +2311,43 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val durationUnits: Object; /** Radar chart only. Possible values are: "polygons" and "circles". Set "circles" for polar charts. polygons */ gridType: string; + /** Unique id of value axis. It is not required to set it, unless you need to tell the graph which exact value axis it should use. */ + id: string; /** Specifies whether guide values should be included when calculating min and max of the axis. */ includeGuidesInMinMax: boolean; /** If true, the axis will include hidden graphs when calculating min and max values. */ includeHidden: boolean; /** Specifies whether values on axis can only be integers or both integers and doubles. */ integersOnly: boolean; + /** You can use this function to format Value axis labels. This function is called and these parameters are passed: labelFunction(value, valueText, valueAxis); +Where value is numeric value, valueText is formatted string and valueAxis is a reference to valueAxis object. + +If axis type is "date", labelFunction will pass different arguments: +labelFunction(valueText, date, valueAxis) + +Your function should return string.*/ + labelFunction(value: number, valueText: string, valueAxis: ValueAxis): string; + labelFunction(valueText: string, data: Date, valueAxis: ValueAxis): string; /** Specifies if this value axis' scale should be logarithmic. */ logarithmic: boolean; /** Read-only. Maximum value of the axis. */ max: number; /** If you don't want max value to be calculated by the chart, set it using this property. This value might still be adjusted so that it would be possible to draw grid at rounded intervals. */ maximum: number; + /** If your value axis is date-based, you can specify maximum date of the axis. Can be set as date object, timestamp number or string if dataDateFormat is set. */ + maximumData: Date; /** Read-only. Minimum value of the axis. */ min: number; /** If you don't want min value to be calculated by the chart, set it using this property. This value might still be adjusted so that it would be possible to draw grid at rounded intervals. */ minimum: number; + /** If your value axis is date-based, you can specify minimum date of the axis. Can be set as date object, timestamp number or string if dataDateFormat is set. */ + minimumDate: Date; /** If set value axis scale (min and max numbers) will be multiplied by it. I.e. if set to 1.2 the scope of values will increase by 20%. */ minMaxMultiplier: number; + /** Works with radar charts only. If you set it to “middle”, labels and data points will be placed in the middle between axes. */ + pointPosition: string; + /** Possible values are: "top", "bottom", "left", "right". If axis is vertical, default position is "left". If axis is horizontal, default position is "bottom". */ + position: string; /** Precision (number of decimals) of values. */ precision: number; /** Radar chart only. Specifies if categories (axes' titles) should be displayed near axes) @@ -2343,10 +2362,22 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val stackType: string; /** Read-only. Value difference between two grid lines. */ step: number; + /** If you set minimum and maximum for your axis, chart adjusts them so that grid would start and end on the beginning and end of plot area and grid would be at equal intervals. If you set strictMinMax to true, the chart will not adjust minimum and maximum of value axis. */ + strictMinMax: boolean; /** In case you synchronize one value axis with another, you need to set the synchronization multiplier. Use synchronizeWithAxis method to set with which axis it should be synced. */ synchronizationMultiplier: number; + /** One value axis can be synchronized with another value axis. You can use both reference to your axis or id of the axis here. You should set synchronizationMultiplyer in order for this to work. */ + synchronizeWith: ValueAxis; /** If this value axis is stacked and has columns, setting valueAxis.totalText = "[[total]]" will make it to display total value above the most-top column. */ totalText: string; + /** Color of total text. */ + totalTextColor: string; + /** Distance from data point to total text. */ + totalTextOffset: number; + /** This allows you to have logarithmic value axis and have zero values in the data. You must set it to >0 value in order to work. */ + treatZeroAs: number; + /** Type of value axis. If your values in data provider are dates and you want this axis to show dates instead of numbers, set it to "date". */ + type: string; /** Unit which will be added to the value label. */ unit: string; /** Position of the unit. Possible values are "left" and "right". right */ From f04429e01622ba8c359ad5afc59cd36a0a01bb4d Mon Sep 17 00:00:00 2001 From: Peter Albert Date: Sun, 2 Aug 2015 14:38:45 +0200 Subject: [PATCH 005/126] Added title class --- amcharts/AmCharts.d.ts | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/amcharts/AmCharts.d.ts b/amcharts/AmCharts.d.ts index b1fe9fea6..ed068b574 100644 --- a/amcharts/AmCharts.d.ts +++ b/amcharts/AmCharts.d.ts @@ -2423,4 +2423,25 @@ Your function should return string.*/ /** Removes event listener from chart object. */ removeListener(chart: AmChart, type: string, handler: any); } -} + + class Title { + /** @default 1 */ + alpha: number; + /** Specifies if the tile is bold or not. + @default false*/ + bold: boolean; + /** Text color of a title. */ + color: string; + /** Unique id of a Title. You don't need to set it, unless you want to. */ + id: string; + /** Text size */ + size: number; + /** Text of a label */ + text: string; + } + class ExportSettings { + enabled: boolean; + libs: Object; + menu: Object; + } +} \ No newline at end of file From 6ab647be60cd0ccdbc9d5e068a37b69cef8a866e Mon Sep 17 00:00:00 2001 From: Peter Albert Date: Sun, 2 Aug 2015 14:39:03 +0200 Subject: [PATCH 006/126] Updated AmChart class --- amcharts/AmCharts.d.ts | 73 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 63 insertions(+), 10 deletions(-) diff --git a/amcharts/AmCharts.d.ts b/amcharts/AmCharts.d.ts index ed068b574..e39b6bcc7 100644 --- a/amcharts/AmCharts.d.ts +++ b/amcharts/AmCharts.d.ts @@ -903,7 +903,13 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val constructor(theme?: any); /** Specifies, if class names should be added to chart elements. */ addClassNames: boolean - + /** Array of Labels. Example of label object, with all possible properties: +{"x": 20, "y": 20, "text": "this is label", "align": "left", "size": 12, "color": "#CC0000", "alpha": 1, "rotation": 0, "bold": true, "url": "http://www.amcharts.com"} */ + allLabels: Label[]; + /** Set this to false if you don't want chart to resize itself whenever its parent container size changes. */ + autoResize: boolean; + /** Opacity of background. Set it to >0 value if you want backgroundColor to work. However we recommend changing div's background-color style for changing background color. */ + backgroundAlpha: number; /** Background color. You should set backgroundAlpha to >0 value in order background to be visible. We recommend setting background color directly on a chart's DIV instead of using this property. #FFFFFF */ backgroundColor: string; /** The chart creates AmBalloon class itself. If you want to customize balloon, get balloon instance using this property, and then change balloon's properties. AmBalloon */ @@ -912,32 +918,79 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val borderAlpha: number; /** Color of chart's border. You should set borderAlpha >0 in order border to be visible. We recommend setting border color directly on a chart's DIV instead of using this property. #000000 */ borderColor: string; + /** This prefix is added to all class names which are added to all visual elements of a chart in case addClassNames is set to true. */ + classNamePrefix: string /** Text color. #000000 */ color: string; /** Array of data objects, for example: [{country:"US", value:524},{country:"UK", value:624},{country:"Lithuania", value:824}]. You can have any number of fields and use any field names. In case of AmMap, data provider should be MapData object. */ dataProvider: any[]; + /** Decimal separator. + @Default . */ + decimalSeparator: string; + /** Using this property you can add any additional information to SVG, like SVG filters or clip paths. The structure of this object should be identical to XML structure of a object you are adding, only in JSON format. */ + defs: any; + /** Export config. Specifies how export to image/data export/print/annotate menu will look and behave. You can find a lot of examples in amcharts/plugins/export folder. */ + export: ExportSettings; /** Font family. Verdana */ fontFamily: string; /** Font size. @default 11 */ fontSize: number; - /** Height of a chart. "100%" means the chart's height will be equal to it's container's (DIV) height and will resize if height of the container changes. Set a number instead of percents if your chart's size needs to be fixed. - @default 1 + /** If you set this to true, the lines of the chart will be distorted and will produce hand-drawn effect. Try to adjust chart.handDrawScatter and chart.handDrawThickness properties for a more scattered result. + @Default false */ - height: any; + handDrawn: boolean; + /** Defines by how many pixels hand-drawn line (when handDrawn is set to true) will fluctuate. + @Default 2 + */ + handDrawScatter: number; + /** Defines by how many pixels line thickness will fluctuate (when handDrawn is set to true). + @Default 1 + */ + handDrawThickness: number; + /** Time, in milliseconds after which balloon is hidden if the user rolls-out of the object. Might be useful for AmMap to avoid balloon flickering while moving mouse over the areas. Note, this is not duration of fade-out. Duration of fade-out is set in AmBalloon class. + @Default 150 + */ + hideBalloonTime: number; + /** Legend of a chart. */ + legend: AmLegend; /** Reference to the div of the legend. */ legendDiv: HTMLElement; - /** Object with precision, decimalSeparator and thousandsSeparator set which will be used for number formatting. Precision set to -1 means that values won't be rounded. {precision:-1, decimalSeparator:'.', thousandsSeparator:','} */ - numberFormatter: Object; + /** You can add listeners of events using this property. Example: listeners = [{"event":"dataUpdated", "method":handleEvent}]; */ + listerns: Object[]; /** This setting affects touch-screen devices only. If a chart is on a page, and panEventsEnabled are set to true, the page won't move if the user touches the chart first. If a chart is big enough and occupies all the screen of your touch device, the user won’t be able to move the page at all. That's why the default value is "false". If you think that selecting/panning the chart or moving/pinching the map is a primary purpose of your users, you should set panEventsEnabled to true. */ panEventsEnabled: boolean; - /** Object with precision, decimalSeparator and thousandsSeparator set which will be used for formatting percent values. {precision:2, decimalSeparator:'.', thousandsSeparator:','} */ - percentFormatter: Object; + /** Specifies absolute or relative path to amCharts files, i.e. "amcharts/". (where all .js files are located) + If relative URLs are used, they will be relative to the current web page, displaying the chart. + You can also set path globally, using global JavaScript variable AmCharts_path. If this variable is set, and "path" is not set in chart config, the chart will assume the path from the global variable. This allows setting amCharts path globally. I.e.: + var AmCharts_path = "/libs/amcharts/"; + "path" parameter will be used by the charts to locate it's files, like images, plugins or patterns.*/ + path: string; + /** Specifies path to the folder where images like resize grips, lens and similar are. + IMPORTANT: Since V3.14.12, you should use "path" to point to amCharts directory instead. The "pathToImages" will be automatically set and does not need to be in the chart config, unless you keep your images separately from other amCharts files. */ + pathToImages: string; + /** Precision of percent values. -1 means percent values won't be rounded at all and show as they are. + @default 2 + */ + percentPrecision: number; + /** Precision of values. -1 means values won't be rounded at all and show as they are. + @Default 1*/ + precision: number; /** Prefixes which are used to make big numbers shorter: 2M instead of 2000000, etc. Prefixes are used on value axes and in the legend. To enable prefixes, set usePrefixes property to true. [{number:1e+3,prefix:"k"},{number:1e+6,prefix:"M"},{number:1e+9,prefix:"G"},{number:1e+12,prefix:"T"},{number:1e+15,prefix:"P"},{number:1e+18,prefix:"E"},{number:1e+21,prefix:"Z"},{number:1e+24,prefix:"Y"}] */ prefixesOfBigNumbers: any[]; /** Prefixes which are used to make small numbers shorter: 2μ instead of 0.000002, etc. Prefixes are used on value axes and in the legend. To enable prefixes, set usePrefixes property to true. [{number:1e-24, prefix:"y"},{number:1e-21, prefix:"z"},{number:1e-18, prefix:"a"},{number:1e-15, prefix:"f"},{number:1e-12, prefix:"p"},{number:1e-9, prefix:"n"},{number:1e-6, prefix:"μ"},{number:1e-3, prefix:"m"}] */ prefixesOfSmallNumbers: any[]; + /** Theme of a chart. Config files of themes can be found in amcharts/themes/ folder. More info about using themes. */ + theme: string; + /** Thousands separator. + @default . + */ + thousandsSeparator: string; + /** Array of Title objects. */ + titles: Title[]; + /** Type of a chart. Required when creating chart using JSON. Possible types are: serial, pie, xy, radar, funnel, gauge, map, stock. */ + type: string; /** If true, prefixes will be used for big and small numbers. You can set arrays of prefixes via prefixesOfSmallNumbers and prefixesOfBigNumbers properties. */ usePrefixes: boolean; /** Read-only. Indicates current version of a script. */ @@ -1714,9 +1767,9 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val /** Creates a label on the chart which can be placed anywhere, multiple can be assigned. */ class Label { - /** Default: 'left' */ + /** @Default 'left' */ align: string; - /** Default: 1 */ + /** @Default 1 */ alpha: number; /** Specifies if label is bold or not. */ bold: boolean; From b00ff5771ec630af76b25170532dad8a4e4887ca Mon Sep 17 00:00:00 2001 From: Peter Albert Date: Sun, 2 Aug 2015 14:45:02 +0200 Subject: [PATCH 007/126] Update class AmCoordinateChart --- amcharts/AmCharts.d.ts | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/amcharts/AmCharts.d.ts b/amcharts/AmCharts.d.ts index e39b6bcc7..8fc7df252 100644 --- a/amcharts/AmCharts.d.ts +++ b/amcharts/AmCharts.d.ts @@ -1066,34 +1066,22 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val /** AmCoordinateChart is a base class of AmRectangularChart. It can not be instantiated explicitly. */ class AmCoordinateChart extends AmChart { + /** Read-only. Array, holding processed chart's data. */ + chartData: Object[]; /** Specifies the colors of the graphs if the lineColor of a graph is not set. It there are more graphs then colors in this array, the chart picks random color. @default ['#FF6600', '#FCD202', '#B0DE09', '#0D8ECF', '#2A0CD0', '#CD0D74', '#CC0000', '#00CC00', '#0000CC', '#DDDDDD', '#999999', '#333333', '#990000'] */ - colors: any[]; + colors: string[]; /** The array of graphs belonging to this chart. To add/remove graph use addGraph/removeGraph methods instead of adding/removing graphs directly to array. */ - graphs: any[]; - /** The opacity of plot area's border. - Value range is 0 - 1. + graphs: AmGraph[]; + /** Specifies if grid should be drawn above the graphs or below. Will not work properly with 3D charts. + @default false */ - plotAreaBorderAlpha: number; - /** The color of the plot area's border. - Note, the it is invisible by default, as plotAreaBorderAlpha default value is 0. - Set it to a value higher than 0 to make it visible. - @default #000000 - */ - plotAreaBorderColor: string; - /** Opacity of plot area. - Plural form is used to keep the same property names as our Flex charts'. - Flex charts can accept array of numbers to generate gradients. - Although you can set array here, only first value of this array will be used. - */ - plotAreaFillAlphas: number; - /** You can set both one color if you need a solid color or array of colors to generate gradients, for example: ["#000000", "#0000CC"] - @default #FFFFFF - */ - plotAreaFillColors: any; + gridAboveGraphs: boolean; + /** Instead of adding guides to the axes, you can push all of them to this array. In case guide has category or date defined, it will automatically will be assigned to the category axis. Otherwise to first value axis, unless you specify a different valueAxis for the guide. */ + guides: Guide[]; /** Specifies whether the animation should be sequenced or all objects should appear at once. @default true */ @@ -1123,6 +1111,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val /** Adds a graph to the chart. */ addGraph(graph: AmGraph); + /** Adds a legend to the chart. By default, you don't need to create div for your legend, however if you want it to be positioned in some different way, you can create div anywhere you want and pass id or reference to your div as a second parameter. (NOTE: This method will not work on StockPanel.) */ /** Adds value axis to the chart. One value axis is created automatically, so if you don't want to change anything or add more value axes, you don't need to add it. */ From 928b46d983a51e139a1052761e8f3dd4d1653a1c Mon Sep 17 00:00:00 2001 From: Peter Albert Date: Sun, 2 Aug 2015 14:54:29 +0200 Subject: [PATCH 008/126] Updated AmRectangular class --- amcharts/AmCharts.d.ts | 65 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 58 insertions(+), 7 deletions(-) diff --git a/amcharts/AmCharts.d.ts b/amcharts/AmCharts.d.ts index 8fc7df252..28b43ddd1 100644 --- a/amcharts/AmCharts.d.ts +++ b/amcharts/AmCharts.d.ts @@ -1328,7 +1328,9 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val /** AmRectangularChart is a base class of AmSerialChart and AmXYChart. It can not be instantiated explicitly.*/ class AmRectangularChart extends AmCoordinateChart { - /** The angle of the 3D part of plot area. This creates a 3D effect (if the "depth3D" is > 0). */ + /** The angle of the 3D part of plot area. This creates a 3D effect (if the "depth3D" is > 0). + @default 0 + */ angle: number; /** Space left from axis labels/title to the chart's outside border, if autoMargins set to true. @default 10 @@ -1338,11 +1340,12 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val @default true */ autoMargins: boolean; - /** Chart cursor. */ + /** Cursor of a chart. */ chartCursor: ChartCursor; /** Chart scrollbar. */ chartScrollbar: ChartScrollbar; - /** The depth of the 3D part of plot area. This creates a 3D effect (if the "angle" is > 0). */ + /** The depth of the 3D part of plot area. This creates a 3D effect (if the "angle" is > 0). + @default 0*/ depth3D: number; /** Number of pixels between the container's bottom border and plot area. This space can be used for bottom axis' values. If autoMargin is true and bottom side has axis, this property is ignored. @default 20 @@ -1356,18 +1359,66 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val @default 20 */ marginRight: number; - /** Flag which should be set to false if you need margins to be recalculated on next chart.validateNow() call. */ + /** Flag which should be set to false if you need margins to be recalculated on next chart.validateNow() call. + @default false + */ marginsUpdated: boolean; /** Number of pixels between the container's top border and plot area. This space can be used for top axis' values. If autoMargin is true and top side has axis, this property is ignored. @default 20 */ marginTop: number; + /** The opacity of plot area's border. Value range is 0 - 1. + @default 0 + */ + plotAreaBorderAlpha: number; + /** The color of the plot area's border. Note, the it is invisible by default, as plotAreaBorderAlpha default value is 0. Set it to a value higher than 0 to make it visible. + @default '#000000'*/ + plotAreaBorderColor: string; + /** Opacity of plot area. Plural form is used to keep the same property names as our Flex charts'. Flex charts can accept array of numbers to generate gradients. Although you can set array here, only first value of this array will be used. + @default 0 + */ + plotAreaFillAlphas: number; + /** You can set both one color if you need a solid color or array of colors to generate gradients, for example: ["#000000", "#0000CC"] + @default '#FFFFFF' + */ + plotAreaFillColors: any; + /** If you are using gradients to fill the plot area, you can use this property to set gradient angle. The only allowed values are horizontal and vertical: 0, 90, 180, 270. + @default 0 + */ + plotAreaGradientAngle: number; /** Array of trend lines added to a chart. You can add trend lines to a chart using this array or access already existing trend lines */ - trendLines: any[]; - /** It's a simple object containing information about zoom-out button. Other available properties of this object are fontSize and color. color specifies text color of a button. {backgroundColor:'#b2e1ff',backgroundAlpha:1} */ - zoomOutButton: Object; + trendLines: TrendLine[]; + /** Opacity of zoom-out button background. + @default 0 + */ + zoomOutButtonAlpha: number; + /** Zoom-out button background color. + @default '#e5e5e5' + */ + zoomOutButtonColor: string; + /** Name of zoom-out button image. In the images folder there is another lens image, called lensWhite.png. You might want to have white lens when background is dark. Or you can simply use your own image. + @default lens.png + */ + zoomOutButtonImage: string; + /** Size of zoom-out button image + @default: 17 + */ + zoomOutButtonImageSize: number; + /** Padding around the text and image. + @default: 8 + */ + zoomOutButtonPadding: number; + /** Opacity of zoom-out button background when mouse is over it. + @default: 1 + */ + zoomOutButtonRollOverAlpha: number; /** Text in the zoom-out button. Show all */ zoomOutText: string; + + /** Adds a ChartCursor object to a chart */ + addChartCursor(cursor: ChartCursor) + /** Adds a ChartScrollbar to a chart */ + addChartScrollbar(scrollbar: ChartScrollbar) /** Adds a TrendLine to a chart. You should call chart.validateNow() after this method is called in order the trend line to be visible. */ addTrendLine(trendLine: TrendLine); From a0a4d1a3fbe69c938370b4e8cd9742506c1e3c48 Mon Sep 17 00:00:00 2001 From: Peter Albert Date: Sun, 2 Aug 2015 14:55:29 +0200 Subject: [PATCH 009/126] Added missing semicolons --- amcharts/AmCharts.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/amcharts/AmCharts.d.ts b/amcharts/AmCharts.d.ts index 28b43ddd1..4a3820816 100644 --- a/amcharts/AmCharts.d.ts +++ b/amcharts/AmCharts.d.ts @@ -902,7 +902,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val /** used when constructing a chart with a theme */ constructor(theme?: any); /** Specifies, if class names should be added to chart elements. */ - addClassNames: boolean + addClassNames: boolean; /** Array of Labels. Example of label object, with all possible properties: {"x": 20, "y": 20, "text": "this is label", "align": "left", "size": 12, "color": "#CC0000", "alpha": 1, "rotation": 0, "bold": true, "url": "http://www.amcharts.com"} */ allLabels: Label[]; @@ -919,7 +919,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val /** Color of chart's border. You should set borderAlpha >0 in order border to be visible. We recommend setting border color directly on a chart's DIV instead of using this property. #000000 */ borderColor: string; /** This prefix is added to all class names which are added to all visual elements of a chart in case addClassNames is set to true. */ - classNamePrefix: string + classNamePrefix: string; /** Text color. #000000 */ color: string; /** Array of data objects, for example: [{country:"US", value:524},{country:"UK", value:624},{country:"Lithuania", value:824}]. You can have any number of fields and use any field names. In case of AmMap, data provider should be MapData object. */ @@ -1416,9 +1416,9 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val zoomOutText: string; /** Adds a ChartCursor object to a chart */ - addChartCursor(cursor: ChartCursor) + addChartCursor(cursor: ChartCursor); /** Adds a ChartScrollbar to a chart */ - addChartScrollbar(scrollbar: ChartScrollbar) + addChartScrollbar(scrollbar: ChartScrollbar); /** Adds a TrendLine to a chart. You should call chart.validateNow() after this method is called in order the trend line to be visible. */ addTrendLine(trendLine: TrendLine); From 9119f1128b3e2aa7f55eb05a0080324b6f7826e8 Mon Sep 17 00:00:00 2001 From: Peter Albert Date: Sun, 2 Aug 2015 15:02:22 +0200 Subject: [PATCH 010/126] Updated AmSerialChart class --- amcharts/AmCharts.d.ts | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/amcharts/AmCharts.d.ts b/amcharts/AmCharts.d.ts index 4a3820816..c7294daa2 100644 --- a/amcharts/AmCharts.d.ts +++ b/amcharts/AmCharts.d.ts @@ -1549,20 +1549,26 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val chart.write("chartdiv"); */ class AmSerialChart extends AmRectangularChart { - /** Read-only. Chart creates category axis itself. If you want to change some properties, you should get this axis from the chart and set properties to this object. */ + /** Date format of the graph balloon (if chart parses dates and you don't use chartCursor). + @default 'MMM DD, YYYY' + */ + balloonDateFormat: string; + /** Read-only. Chart creates category axis itself. If you want to change some properties, you should get this axis from the chart and set properties to this object. */ categoryAxis: CategoryAxis; /** Category field name tells the chart the name of the field in your dataProvider object which will be used for category axis values. */ categoryField: string; - /** Read-only. Array of SerialDataItem objects generated from dataProvider. */ - chartData: any[]; /** The gap in pixels between two columns of the same category. @default 5 */ columnSpacing: number; - /** Relative width of columns. Value range is 0 - 1. 0.8 */ + /** Space between 3D stacked columns. + @default 0 + */ + columnSpacing3D: number; + /** Relative width of columns. Value range is 0 - 1. + @default 0.8 + */ columnWidth: number; - /** Array holding chart's data. */ - dataProvider: any[]; /** Read-only. If category axis parses dates endDate indicates date to which the chart is currently displayed. */ endDate: Date; /** Read-only. Category index to which the chart is currently displayed. */ @@ -1571,8 +1577,14 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val maxSelectedSeries: number; /** The longest time span allowed to select (in milliseconds) for example, 259200000 will limit selection to 3 days. */ maxSelectedTime: number; - /** The shortest time span allowed to select (in milliseconds) for example, 1000 will limit selection to 1 second. */ + /** The shortest time span allowed to select (in milliseconds) for example, 1000 will limit selection to 1 second. + @default 0 + */ minSelectedTime: number; + /** Specifies if scrolling of a chart with mouse wheel is enabled. If you press shift while rotating mouse wheel, the chart will zoom-in/out. */ + mouseWheelScrollEnabled: boolean; + /** Specifies if zooming of a chart with mouse wheel is enabled. If you press shift while rotating mouse wheel, the chart will scroll. */ + mouseWheelZoomEnabled: boolean; /** If you set this to true, the chart will be rotated by 90 degrees (the columns will become bars). */ rotate: boolean; /** Read-only. If category axis parses dates startDate indicates date from which the chart is currently displayed. */ From 374212576e05739fe90a58f0d3ca35d73594dbd5 Mon Sep 17 00:00:00 2001 From: Peter Albert Date: Sun, 2 Aug 2015 15:09:45 +0200 Subject: [PATCH 011/126] Added AmChart.creditsPosition property --- amcharts/AmCharts.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/amcharts/AmCharts.d.ts b/amcharts/AmCharts.d.ts index c7294daa2..15ddc47fa 100644 --- a/amcharts/AmCharts.d.ts +++ b/amcharts/AmCharts.d.ts @@ -922,6 +922,10 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val classNamePrefix: string; /** Text color. #000000 */ color: string; + /** Non-commercial version only. Specifies position of link to amCharts site. Allowed values are: top-left, top-right, bottom-left and bottom-right. + @default 'top-left' + */ + creditsPosition: string; /** Array of data objects, for example: [{country:"US", value:524},{country:"UK", value:624},{country:"Lithuania", value:824}]. You can have any number of fields and use any field names. In case of AmMap, data provider should be MapData object. */ dataProvider: any[]; /** Decimal separator. From 577100e5f46f3d213a753322f8a9d6aa500b4a1c Mon Sep 17 00:00:00 2001 From: Peter Albert Date: Sun, 2 Aug 2015 18:34:18 +0200 Subject: [PATCH 012/126] Changed fontSize from number to string --- amcharts/AmCharts.d.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/amcharts/AmCharts.d.ts b/amcharts/AmCharts.d.ts index 15ddc47fa..42c5b1b24 100644 --- a/amcharts/AmCharts.d.ts +++ b/amcharts/AmCharts.d.ts @@ -334,7 +334,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val /** Fill color. */ fillColor: string; /** Font size of guide label. */ - fontSize: number; + fontSize: string; /** Unique id of a Guide. You don't need to set it, unless you want to. */ id: string; /** Specifies whether label should be placed inside or outside plot area. */ @@ -395,7 +395,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val /** Font size of a label. @default 11 */ - labelFontSize: number; + labelfontSize: string; /** Position of the label. Allowed values are: left, right, top, bottom and middle. right */ labelPosition: string; /** Label roll-over color. #00CC00 */ @@ -730,7 +730,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val */ equalWidths: boolean; /** Font size. Will use chart's font size if not set. */ - fontSize: number; + fontSize: string; /** Horizontal space between legend item and left/right border. */ horizontalGap: number; /** The text which will be displayed in the legend. Tag [[title]] will be replaced with the title of the graph. [[title]] */ @@ -940,7 +940,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val /** Font size. @default 11 */ - fontSize: number; + fontSize: string; /** If you set this to true, the lines of the chart will be distorted and will produce hand-drawn effect. Try to adjust chart.handDrawScatter and chart.handDrawThickness properties for a more scattered result. @Default false */ @@ -1958,7 +1958,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val /** Balloon background color. Usually balloon background color is set by the chart. Only if "adjustBorderColor" is "true" this color will be used. #CC0000 */ fillColor: string; /** Size of text in the balloon. Chart's fontSize is used by default. */ - fontSize: number; + fontSize: string; /** Horizontal padding of the balloon. @default 8 3*/ @@ -2016,7 +2016,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val /** Fill color. Every second space between grid lines can be filled with color. Set fillAlpha to a value greater than 0 to see the fills. */ fillColor: string; /** Text size. */ - fontSize: number; + fontSize: string; /** Opacity of grid lines. */ gridAlpha: number; /** Color of grid lines. */ @@ -2096,7 +2096,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val */ enabled: boolean; /** Font size. */ - fontSize: number; + fontSize: string; /** Specifies which graph will be displayed in the scrollbar. */ graph: AmGraph; /** Graph fill opacity. */ @@ -2220,7 +2220,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val /** You can set another graph here and if fillAlpha is >0, the area from this graph to fillToGraph will be filled (instead of filling the area to the X axis). */ fillToGraph: AmGraph; /** Size of value labels text. Will use chart's fontSize if not set. */ - fontSize: number; + fontSize: string; /** Orientation of the gradient fills (only for "column" graph type). Possible values are "vertical" and "horizontal". vertical */ gradientOrientation: string; /** Specifies whether the graph is hidden. Do not use this to show/hide the graph, use hideGraph(graph) and showGraph(graph) methods instead. */ @@ -2344,7 +2344,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val /** Fill color. Every second space between grid lines can be filled with color. Set fillAlpha to a value greater than 0 to see the fills. #FFFFFF */ fillColor: string; /** Size of value labels text. Will use chart's fontSize if not set. */ - fontSize: number; + fontSize: string; /** Opacity of grid lines. 0.2 */ gridAlpha: number; /** Color of grid lines. #000000 */ @@ -2398,7 +2398,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val /** Color of axis title. Will use text color of chart if not set any. */ titleColor: string; /** Font size of axis title. Will use font size of chart plus two pixels if not set any. */ - titleFontSize: number; + titlefontSize: string; /** Adds guide to the axis. */ addGuide(guide:Guide); From 55ee7c2bc0575d2e05c52a18dfce757ee2573d2f Mon Sep 17 00:00:00 2001 From: Peter Albert Date: Sun, 2 Aug 2015 18:34:34 +0200 Subject: [PATCH 013/126] Added ballonFunction --- amcharts/AmCharts.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/amcharts/AmCharts.d.ts b/amcharts/AmCharts.d.ts index 42c5b1b24..647fc6e25 100644 --- a/amcharts/AmCharts.d.ts +++ b/amcharts/AmCharts.d.ts @@ -2155,6 +2155,8 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val alphaField: string; /** Value balloon color. Will use graph or data item color if not set. */ balloonColor: string; + /** If you set some function, the graph will call it and pass GraphDataItem and AmGraph object to it. This function should return a string which will be displayed in a balloon. */ + balloonFunction(graphDataItem: GraphDataItem, amGraph: AmGraph): string; /** Balloon text. You can use tags like [[value]], [[description]], [[percents]], [[open]], [[category]] [[value]] */ balloonText: string; /** Specifies if the line graph should be placed behind column graphs */ From 2682d3a8bac09468953ad1dd39c691c570381e42 Mon Sep 17 00:00:00 2001 From: Walker Burgin Date: Tue, 18 Aug 2015 23:57:07 -0700 Subject: [PATCH 014/126] Update definition to support instantiating StaticLocation --- react-router/react-router.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/react-router/react-router.d.ts b/react-router/react-router.d.ts index d8dd12c97..e0b1fb0f7 100644 --- a/react-router/react-router.d.ts +++ b/react-router/react-router.d.ts @@ -175,6 +175,7 @@ declare module ReactRouter { function create(options: RouterCreateOption): Router; function run(routes: Route, callback: RouterRunCallback): Router; function run(routes: Route, location: LocationBase, callback: RouterRunCallback): Router; + function run(routes: Route, location: string, callback: RouterRunCallback): Router; // @@ -198,7 +199,9 @@ declare module ReactRouter { interface HashLocation extends Location, LocationListener { } interface HistoryLocation extends Location, LocationListener { } interface RefreshLocation extends Location { } - interface StaticLocation extends LocationBase { } + interface StaticLocation extends LocationBase { + new(path: string): StaticLocation + } interface TestLocation extends Location, LocationListener { } var HashLocation: HashLocation; From 9703d2138d17fd6c3878e996f05c6b366c6bd985 Mon Sep 17 00:00:00 2001 From: Walker Burgin Date: Thu, 20 Aug 2015 22:58:58 -0700 Subject: [PATCH 015/126] Relax type checking on route properties --- react-router/react-router.d.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/react-router/react-router.d.ts b/react-router/react-router.d.ts index e0b1fb0f7..b58b2f7cb 100644 --- a/react-router/react-router.d.ts +++ b/react-router/react-router.d.ts @@ -67,14 +67,8 @@ declare module ReactRouter { interface RedirectClass extends React.ComponentClass {} // Route - interface RouteProp { - name?: string; - path?: string; - handler?: React.ComponentClass; - ignoreScrollBehavior?: boolean; - } - interface Route extends React.ReactElement {} - interface RouteClass extends React.ComponentClass {} + interface Route extends React.ReactElement {} + interface RouteClass extends React.ComponentClass {} var DefaultRoute: DefaultRouteClass; var NotFoundRoute: NotFoundRouteClass; @@ -310,7 +304,7 @@ declare module __React { // for Route function createElement( type: ReactRouter.RouteClass, - props: ReactRouter.RouteProp, + props: any, ...children: __React.ReactNode[]): ReactRouter.Route; // for RouteHandler @@ -348,7 +342,7 @@ declare module "react/addons" { // for Route function createElement( type: ReactRouter.RouteClass, - props: ReactRouter.RouteProp, + props: any, ...children: __React.ReactNode[]): ReactRouter.Route; // for RouteHandler From cf5c5f6f9a1dd433610d13d32f1d30da9f559fe3 Mon Sep 17 00:00:00 2001 From: Walker Burgin Date: Mon, 7 Sep 2015 01:54:46 -0700 Subject: [PATCH 016/126] Add react-bootstrap type definition --- react-bootstrap/react-bootstrap-test.tsx | 898 ++++++++++++++++++++++ react-bootstrap/react-bootstrap.d.ts | 903 +++++++++++++++++++++++ 2 files changed, 1801 insertions(+) create mode 100644 react-bootstrap/react-bootstrap-test.tsx create mode 100644 react-bootstrap/react-bootstrap.d.ts diff --git a/react-bootstrap/react-bootstrap-test.tsx b/react-bootstrap/react-bootstrap-test.tsx new file mode 100644 index 000000000..cdb1c7bae --- /dev/null +++ b/react-bootstrap/react-bootstrap-test.tsx @@ -0,0 +1,898 @@ +// React-Bootstrap Test +// ================================================================================ +/// +/// + +// Imports +// -------------------------------------------------------------------------------- +import * as React from 'react'; +import { Component, CSSProperties } from 'react'; +import { Button, ButtonToolbar, Modal, Well, ButtonGroup, DropdownButton, MenuItem, Panel, ListGroup, ListGroupItem, Accordion, Tooltip, OverlayTrigger, Popover, ProgressBar, Nav, NavItem, Navbar, NavDropdown, Tabs, Tab, Pager, PageItem, Pagination, Alert, Carousel, CarouselItem, Grid, Row, Col, Thumbnail, Label, Badge, Jumbotron, PageHeader, Glyphicon, Table, Input, ButtonInput } from 'react-bootstrap'; + + +export class ReactBootstrapTest extends Component { + callback() { + alert('Callback: ' + JSON.stringify(arguments)); + } + + public render() { + let style: CSSProperties = { padding: '50px' }; + let tooltip = (Holy guacamole! Check this info.); + + const innerGlyphicon = ; + const innerButton = ; + const innerDropdown = ( + + Item + + ); + const innerRadio = ; + const innerCheckbox = ; + + return ( +
+
+ + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ +
+ + + + +
+ + +
+ + + + +
+ + +
+ + + + + +
+ + +
+ + + + + + + + + + + + + + + + +
+ + // TODO: Start here + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + Dropdown link + Dropdown link + + + + + Dropdown link + Dropdown link + + + Dropdown link + Dropdown link + + +
+ +
+ + Action + Another action + Active Item + + Separated link + +
+ +
+
+
    + Header + link + + Header + link + disabled + + link with title + + + link that alerts + +
+
+
+ +
+ + Basic panel example + +
+ +
+
+ + Panel content + + + Panel content + +
+
+ +
+ + Panel content + +
+ +
+
+ + Panel content + + + + Panel content + + + + Panel content + + + + Panel content + + + + Panel content + + + + Panel content + +
+
+ +
+ + Some default panel content here. + + Item 1 + Item 2 + + + Some more panel content here. + +
+ +
+ + + Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer + farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. + + + Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer + farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. + + + Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer + farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. + + +
+ +
+
+ + + Modal title + + + + One fine body... + + + + + + + + +
+
+ +
+
+ + Tooltip right + + + + Tooltip top + + + + Tooltip left + + + + Tooltip bottom + +
+
+ +
+ + + + + + + + + + + + + + + + + +
+ +
+
+ + And here's some amazing content. It's very engaging. right? + +
+
+ +
+ + Holy guacamole! Check this info.}> + + + Holy guacamole! Check this info.}> + + + Holy guacamole! Check this info.}> + + + Holy guacamole! Check this info.}> + + + +
+ +
+ + Holy guacamole! Check this info.}> + + + Holy guacamole! Check this info.}> + + + Holy guacamole! Check this info.}> + + + Holy guacamole! Check this info.}> + + + +
+ +
+ +
+ +
+ +
+ +
+
+ + + + +
+
+ +
+
+ + + + +
+
+ +
+ +
+ +
+ + + + + +
+ +
+ +
+ +
+ +
+ +
+
+ +
+ +
+
+ +
+ + + +
+ +
+ + + +
+ +
+ + Previous + Next + +
+ +
+ + Tab 1 content + Tab 2 content + Tab 3 content + +
+ +
+ + Previous + Next + +
+ +
+ + ← Previous Page + Next Page → + +
+ +
+ + ← Previous + Next → + +
+ +
+
+ +
+ +
+ + +
+
+ +
+ + Holy guacamole! Best check yo self, you're not looking too good. + +
+ +
+ + + 900x500 +
+

First slide label

+

Nulla vitae elit libero, a pharetra augue mollis interdum.

+
+
+ + 900x500 +
+

Second slide label

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

+
+
+ + 900x500 +
+

Third slide label

+

Praesent commodo cursus magna, vel scelerisque nisl consectetur.

+
+
+
+
+ +
+ + + <{'Col xs={12} md={8}'} /> + <{'Col xs={6} md={4}'} /> + + + + <{'Col xs={6} md={4}'} /> + <{'Col xs={6} md={4}'} /> + <{'Col xs={6} md={4}'} /> + + + + <{'Col xs={6} xsOffset={6}'} /> + + + + <{'Col md={6} mdPush={6}'} /> + <{'Col md={6} mdPull={6}'} /> + + +
+ +
+ + + + + + + + + + + + + +
+ +
+ + Item 1 + Item 2 + ... + +
+ +
+ + Link 1 + Link 2 + + Trigger an alert + + +
+ +
+ + Link 1 + Link 2 + Link 3 + +
+ +
+ + Success + Info + Warning + Danger + +
+ +
+ + Some body text + Linked item + Danger styling + +
+ +
+
+

Label

+

Label

+

Label

+

Label

+
Label
+

Label

+
+
+ +
+
+   +   +   +   +   + +
+
+ +
+

Badges 42

+
+ +
+ +

Hello, world!

+

This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.

+

+
+
+ +
+ Example page header Subtext for header +
+ +
+ Look I'm in a well! +
+ +
+
+ Look I'm in a large well! + Look I'm in a small well! +
+
+ +
+
+ + + + + + + + + + + + + + + + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NumberFirst NameLast NameUsername
1MarkOtto@mdo
2JacobThornton@fat
3Larry the Bird@twitter
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NumberTable headingTable headingTable headingTable headingTable headingTable heading
1Table cellTable cellTable cellTable cellTable cellTable cell
2Table cellTable cellTable cellTable cellTable cellTable cell
3Table cellTable cellTable cellTable cellTable cellTable cell
+
+ +
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+
+ + Child Text + + + +
+ +
+
+ + + + + + + + +
+
+ +
+
+ + + +
+
+ +
+
+ + + +
+
+ +
+
+ + + +
+
+ +
+ + + + + + + + + + +
+
+ ); + } +} diff --git a/react-bootstrap/react-bootstrap.d.ts b/react-bootstrap/react-bootstrap.d.ts new file mode 100644 index 000000000..51a5a6da1 --- /dev/null +++ b/react-bootstrap/react-bootstrap.d.ts @@ -0,0 +1,903 @@ +// Type definitions for react-bootstrap +// Project: https://github.com/react-bootstrap/react-bootstrap +// Definitions by: Walker Burgin +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare module "react-bootstrap" { + // Import React + import React = require("react"); + + + //