mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Merge branch 'master' into fix-ramda-invoker-function
This commit is contained in:
@@ -60,6 +60,12 @@
|
||||
"sourceRepoURL": "https://github.com/AlexTeixeira/Askmethat-Rating",
|
||||
"asOfVersion": "0.4.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "aurelia-knockout",
|
||||
"typingsPackageName": "aurelia-knockout",
|
||||
"sourceRepoURL": "https://github.com/code-chris/aurelia-knockout",
|
||||
"asOfVersion": "2.1.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "autobind-decorator",
|
||||
"typingsPackageName": "autobind-decorator",
|
||||
@@ -84,6 +90,12 @@
|
||||
"sourceRepoURL": "https://github.com/mzabriskie/axios",
|
||||
"asOfVersion": "0.14.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "axios-mock-adapter",
|
||||
"typingsPackageName": "axios-mock-adapter",
|
||||
"sourceRepoURL": "https://github.com/ctimmerm/axios-mock-adapter",
|
||||
"asOfVersion": "1.10.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "azure-mobile-apps",
|
||||
"typingsPackageName": "azure-mobile-apps",
|
||||
@@ -108,6 +120,12 @@
|
||||
"sourceRepoURL": "https://github.com/peterolson/BigInteger.js",
|
||||
"asOfVersion": "0.0.31"
|
||||
},
|
||||
{
|
||||
"libraryName": "Bowser",
|
||||
"typingsPackageName": "bowser",
|
||||
"sourceRepoURL": "https://github.com/ded/bowser",
|
||||
"asOfVersion": "1.1.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "Bugsnag Browser",
|
||||
"typingsPackageName": "bugsnag-js",
|
||||
@@ -138,6 +156,12 @@
|
||||
"sourceRepoURL": "https://github.com/mapbox/cheap-ruler",
|
||||
"asOfVersion": "2.5.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "chunked-dc",
|
||||
"typingsPackageName": "chunked-dc",
|
||||
"sourceRepoURL": "https://github.com/saltyrtc/chunked-dc-js",
|
||||
"asOfVersion": "0.2.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "commander",
|
||||
"typingsPackageName": "commander",
|
||||
@@ -150,12 +174,24 @@
|
||||
"sourceRepoURL": "https://github.com/blakeembrey/constant-case",
|
||||
"asOfVersion": "1.1.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "cypress",
|
||||
"typingsPackageName": "cypress",
|
||||
"sourceRepoURL": "https://cypress.io",
|
||||
"asOfVersion": "1.1.3"
|
||||
},
|
||||
{
|
||||
"libraryName": "date-fns",
|
||||
"typingsPackageName": "date-fns",
|
||||
"sourceRepoURL": "https://github.com/date-fns/date-fns",
|
||||
"asOfVersion": "2.6.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "decimal.js",
|
||||
"typingsPackageName": "decimal.js",
|
||||
"sourceRepoURL": "https://github.com/MikeMcl/decimal.js",
|
||||
"asOfVersion": "7.4.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "DevExtreme",
|
||||
"typingsPackageName": "devextreme",
|
||||
@@ -168,6 +204,12 @@
|
||||
"sourceRepoURL": "https://github.com/dfahlander/Dexie.js",
|
||||
"asOfVersion": "1.3.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "docker-file-parser",
|
||||
"typingsPackageName": "docker-file-parser",
|
||||
"sourceRepoURL": "https://github.com/joyent/docker-file-parser",
|
||||
"asOfVersion": "1.0.3"
|
||||
},
|
||||
{
|
||||
"libraryName": "dot-case",
|
||||
"typingsPackageName": "dot-case",
|
||||
@@ -222,6 +264,12 @@
|
||||
"sourceRepoURL": "https://github.com/ctavan/express-validator",
|
||||
"asOfVersion": "3.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "extended-listbox",
|
||||
"typingsPackageName": "extended-listbox",
|
||||
"sourceRepoURL": "https://github.com/code-chris/extended-listbox",
|
||||
"asOfVersion": "4.0.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "JSON-Patch",
|
||||
"typingsPackageName": "fast-json-patch",
|
||||
@@ -234,6 +282,12 @@
|
||||
"sourceRepoURL": "https://www.npmjs.com/package/fast-simplex-noise",
|
||||
"asOfVersion": "3.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "fecha",
|
||||
"typingsPackageName": "fecha",
|
||||
"sourceRepoURL": "https://github.com/taylorhakes/fecha",
|
||||
"asOfVersion": "2.3.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "FineUploader",
|
||||
"typingsPackageName": "fine-uploader",
|
||||
@@ -246,6 +300,12 @@
|
||||
"sourceRepoURL": "https://github.com/chmln/flatpickr",
|
||||
"asOfVersion": "3.1.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "flux-standard-action",
|
||||
"typingsPackageName": "flux-standard-action",
|
||||
"sourceRepoURL": "https://github.com/acdlite/flux-standard-action",
|
||||
"asOfVersion": "1.1.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "gaea-model",
|
||||
"typingsPackageName": "gaea-model",
|
||||
@@ -264,6 +324,18 @@
|
||||
"sourceRepoURL": "https://github.com/ivogabe/gulp-typescript",
|
||||
"asOfVersion": "2.13.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "http-status-codes",
|
||||
"typingsPackageName": "http-status-codes",
|
||||
"sourceRepoURL": "https://github.com/prettymuchbryce/node-http-status",
|
||||
"asOfVersion": "1.2.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "iconv-lite",
|
||||
"typingsPackageName": "iconv-lite",
|
||||
"sourceRepoURL": "https://github.com/ashtuchkin/iconv-lite",
|
||||
"asOfVersion": "0.4.14"
|
||||
},
|
||||
{
|
||||
"libraryName": "Facebook's Immutable",
|
||||
"typingsPackageName": "immutable",
|
||||
@@ -306,6 +378,12 @@
|
||||
"sourceRepoURL": "https://github.com/inversify/inversify-restify-utils",
|
||||
"asOfVersion": "2.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "Ionic",
|
||||
"typingsPackageName": "ionic",
|
||||
"sourceRepoURL": "http://ionicframework.com",
|
||||
"asOfVersion": "3.19.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "is-lower-case",
|
||||
"typingsPackageName": "is-lower-case",
|
||||
@@ -318,6 +396,12 @@
|
||||
"sourceRepoURL": "https://github.com/blakeembrey/is-upper-case",
|
||||
"asOfVersion": "1.1.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "jimp",
|
||||
"typingsPackageName": "jimp",
|
||||
"sourceRepoURL": "https://github.com/oliver-moran/jimp#readme",
|
||||
"asOfVersion": "0.2.28"
|
||||
},
|
||||
{
|
||||
"libraryName": "jpush-react-native",
|
||||
"typingsPackageName": "jpush-react-native",
|
||||
@@ -354,6 +438,12 @@
|
||||
"sourceRepoURL": "https://github.com/jsplumb/jsPlumb",
|
||||
"asOfVersion": "2.5.7"
|
||||
},
|
||||
{
|
||||
"libraryName": "keycloak-js",
|
||||
"typingsPackageName": "keycloak-js",
|
||||
"sourceRepoURL": "https://github.com/keycloak/keycloak",
|
||||
"asOfVersion": "3.4.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "knockout-paging",
|
||||
"typingsPackageName": "knockout-paging",
|
||||
@@ -372,6 +462,12 @@
|
||||
"sourceRepoURL": "https://github.com/elitechance/lambda-phi",
|
||||
"asOfVersion": "1.0.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "ldclient-js",
|
||||
"typingsPackageName": "ldclient-js",
|
||||
"sourceRepoURL": "https://github.com/launchdarkly/js-client",
|
||||
"asOfVersion": "1.1.11"
|
||||
},
|
||||
{
|
||||
"libraryName": "left-pad",
|
||||
"typingsPackageName": "left-pad",
|
||||
@@ -510,12 +606,24 @@
|
||||
"sourceRepoURL": "https://github.com/pillarjs/path-to-regexp",
|
||||
"asOfVersion": "1.7.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "pg-connection-string",
|
||||
"typingsPackageName": "pg-connection-string",
|
||||
"sourceRepoURL": "https://github.com/iceddev/pg-connection-string",
|
||||
"asOfVersion": "2.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "pg-promise",
|
||||
"typingsPackageName": "pg-promise",
|
||||
"sourceRepoURL": "https://github.com/vitaly-t/pg-promise",
|
||||
"asOfVersion": "5.4.3"
|
||||
},
|
||||
{
|
||||
"libraryName": "phonegap-plugin-push",
|
||||
"typingsPackageName": "phonegap-plugin-push",
|
||||
"sourceRepoURL": "https://github.com/phonegap/phonegap-plugin-push",
|
||||
"asOfVersion": "2.1.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "pixi-spine",
|
||||
"typingsPackageName": "pixi-spine",
|
||||
@@ -528,6 +636,12 @@
|
||||
"sourceRepoURL": "https://github.com/PeculiarVentures/pkcs11js",
|
||||
"asOfVersion": "1.0.4"
|
||||
},
|
||||
{
|
||||
"libraryName": "plottable",
|
||||
"typingsPackageName": "plottable",
|
||||
"sourceRepoURL": "http://plottablejs.org/",
|
||||
"asOfVersion": "3.7.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "poly2tri.js",
|
||||
"typingsPackageName": "poly2tri",
|
||||
@@ -582,6 +696,18 @@
|
||||
"sourceRepoURL": "https://github.com/react-native-training/react-native-elements",
|
||||
"asOfVersion": "0.18.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "react-native-google-analytics-bridge",
|
||||
"typingsPackageName": "react-native-google-analytics-bridge",
|
||||
"sourceRepoURL": "https://github.com/idehub/react-native-google-analytics-bridge",
|
||||
"asOfVersion": "5.3.3"
|
||||
},
|
||||
{
|
||||
"libraryName": "react-split-pane",
|
||||
"typingsPackageName": "react-split-pane",
|
||||
"sourceRepoURL": "https://github.com/tomkp/react-split-pane",
|
||||
"asOfVersion": "0.1.67"
|
||||
},
|
||||
{
|
||||
"libraryName": "realm",
|
||||
"typingsPackageName": "realm",
|
||||
@@ -600,6 +726,12 @@
|
||||
"sourceRepoURL": "https://github.com/tshelburne/redux-batched-actions",
|
||||
"asOfVersion": "0.1.5"
|
||||
},
|
||||
{
|
||||
"libraryName": "react-bootstrap",
|
||||
"typingsPackageName": "redux-bootstrap",
|
||||
"sourceRepoURL": "https://github.com/remojansen/redux-bootstrap",
|
||||
"asOfVersion": "1.1.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "redux-devtools-extension",
|
||||
"typingsPackageName": "redux-devtools-extension",
|
||||
@@ -708,6 +840,12 @@
|
||||
"sourceRepoURL": "https://github.com/blakeembrey/snake-case",
|
||||
"asOfVersion": "1.1.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "Spin.js",
|
||||
"typingsPackageName": "spin.js",
|
||||
"sourceRepoURL": "http://fgnass.github.com/spin.js/",
|
||||
"asOfVersion": "3.0.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "spotify-web-api-js",
|
||||
"typingsPackageName": "spotify-web-api-js",
|
||||
@@ -750,6 +888,12 @@
|
||||
"sourceRepoURL": "http://gcanti.github.io/tcomb/guide/index.html",
|
||||
"asOfVersion": "2.6.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "timezonecomplete",
|
||||
"typingsPackageName": "timezonecomplete",
|
||||
"sourceRepoURL": "https://github.com/SpiritIT/timezonecomplete",
|
||||
"asOfVersion": "5.5.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "title-case",
|
||||
"typingsPackageName": "title-case",
|
||||
@@ -798,6 +942,12 @@
|
||||
"sourceRepoURL": "https://github.com/blakeembrey/upper-case-first",
|
||||
"asOfVersion": "1.1.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "Validate.js",
|
||||
"typingsPackageName": "validate.js",
|
||||
"sourceRepoURL": "https://github.com/ansman/validate.js",
|
||||
"asOfVersion": "0.11.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "vso-node-api",
|
||||
"typingsPackageName": "vso-node-api",
|
||||
@@ -846,6 +996,12 @@
|
||||
"sourceRepoURL": "github.com/node-xmpp/node-xmpp/",
|
||||
"asOfVersion": "1.2.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "zetapush-js",
|
||||
"typingsPackageName": "zetapush-js",
|
||||
"sourceRepoURL": "https://github.com/zetapush/zetapush-js",
|
||||
"asOfVersion": "3.1.2"
|
||||
},
|
||||
{
|
||||
"libraryName": "Zone.js",
|
||||
"typingsPackageName": "zone.js",
|
||||
|
||||
7
types/amcharts/amcharts-tests.ts
Normal file
7
types/amcharts/amcharts-tests.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { AmCharts } from "amcharts";
|
||||
|
||||
// TODO: provide much more tests
|
||||
|
||||
const gauge = new AmCharts.AmAngularGauge({
|
||||
theme: "light"
|
||||
});
|
||||
210
types/amcharts/index.d.ts
vendored
210
types/amcharts/index.d.ts
vendored
@@ -1,31 +1,31 @@
|
||||
// Type definitions for amCharts
|
||||
// Type definitions for amCharts 3.21
|
||||
// Project: http://www.amcharts.com/
|
||||
// Definitions by: aleksey-bykov <https://github.com/aleksey-bykov>
|
||||
// ldrick <https://github.com/ldrick>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// AmCharts object (it's not a class) is create automatically when amcharts.js or amstock.js file is included in a web page.
|
||||
declare namespace AmCharts {
|
||||
|
||||
export namespace AmCharts {
|
||||
/** Set it to true if you have base href set for your page. This will fix rendering problems in Firefox caused by base href. */
|
||||
var baseHref: boolean;
|
||||
let baseHref: boolean;
|
||||
|
||||
/** Array of day names, used when formatting dates (if categoryAxis.parseDates is set to true) ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] */
|
||||
var dayNames: string[];
|
||||
let dayNames: string[];
|
||||
|
||||
/** Array of month names, used when formatting dates (if categoryAxis.parseDates is set to true) ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] */
|
||||
var monthNames: string[];
|
||||
let monthNames: string[];
|
||||
|
||||
/** Array of short versions of day names, used when formatting dates (if categoryAxis.parseDates is set to true) ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] */
|
||||
var shortDayNames: string[];
|
||||
let shortDayNames: string[];
|
||||
|
||||
/** Array of short versions of month names, used when formatting dates (if categoryAxis.parseDates is set to true) ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] */
|
||||
var shortMonthNames: string[];
|
||||
let shortMonthNames: string[];
|
||||
|
||||
/** Set it to true if you want UTC time to be used instead of local time. */
|
||||
var useUTC: boolean;
|
||||
let useUTC: boolean;
|
||||
|
||||
/** Object with themes */
|
||||
var themes: any;
|
||||
let themes: any;
|
||||
|
||||
/** Clears all the charts on page, removes listeners and intervals. */
|
||||
function clear(): void;
|
||||
@@ -40,16 +40,16 @@ declare namespace AmCharts {
|
||||
* When the method is called, the chart instance is passed as an attribute.
|
||||
* You can use this feature to preprocess chart data or do some other things you need
|
||||
* before initializing the chart.
|
||||
* @param {Function} handler - The method to be called.
|
||||
* @param {string[]} types - Which chart types should call this method. Defaults to all
|
||||
* @param handler - The method to be called.
|
||||
* @param types - Which chart types should call this method. Defaults to all
|
||||
* if none is passed.
|
||||
*/
|
||||
function addInitHandler(handler: Function, types: string[]): any;
|
||||
|
||||
/** AmPieChart class creates pie/donut chart. In order to display pie chart you need to set at least three properties - dataProvider, titleField and valueField.
|
||||
@example
|
||||
var chartData = [{title:"Pie I have eaten",value:70},{title:"Pie I haven\'t eaten",value:30}];
|
||||
var chart = new AmCharts.AmPieChart();
|
||||
let chartData = [{title:"Pie I have eaten",value:70},{title:"Pie I haven\'t eaten",value:30}];
|
||||
let chart = new AmCharts.AmPieChart();
|
||||
chart.valueField = "value";
|
||||
chart.titleField = "title";
|
||||
chart.dataProvider = chartData;
|
||||
@@ -223,8 +223,8 @@ declare namespace AmCharts {
|
||||
|
||||
/** AmRadarChart is the class you have to use for radar and polar chart types.
|
||||
@example
|
||||
var chart;
|
||||
var chartData = [
|
||||
let chart;
|
||||
let chartData = [
|
||||
{country:"Czech Republic",litres:156.90},
|
||||
{country:"Ireland",litres:131.10},
|
||||
{country:"Germany",litres:115.80},
|
||||
@@ -239,7 +239,7 @@ declare namespace AmCharts {
|
||||
chart.categoryField = "country";
|
||||
chart.startDuration = 2;
|
||||
|
||||
var valueAxis = new AmCharts.ValueAxis();
|
||||
let valueAxis = new AmCharts.ValueAxis();
|
||||
valueAxis.axisAlpha = 0.15;
|
||||
valueAxis.minimum = 0;
|
||||
valueAxis.dashLength = 3;
|
||||
@@ -247,7 +247,7 @@ declare namespace AmCharts {
|
||||
valueAxis.gridCount = 5;
|
||||
chart.addValueAxis(valueAxis);
|
||||
|
||||
var graph = new AmCharts.AmGraph();
|
||||
let graph = new AmCharts.AmGraph();
|
||||
graph.valueField = "litres";
|
||||
graph.bullet = "round";
|
||||
graph.balloonText = "[[value]] litres of beer per year"
|
||||
@@ -271,7 +271,7 @@ declare namespace AmCharts {
|
||||
|
||||
/** AmXYChart is the class you have to use for XY/Bubble/Scatter chart types. The chart supports simple and logarithmic scales, it can have multiple value axes.
|
||||
@example
|
||||
var chartData = [
|
||||
let chartData = [
|
||||
{x:10, y:14, value:59},
|
||||
{x:5, y:3, value:50},
|
||||
{x:-10, y:-3, value:19},
|
||||
@@ -281,23 +281,23 @@ declare namespace AmCharts {
|
||||
{x:1, y:6, value:35}
|
||||
];
|
||||
|
||||
var chart = new AmCharts.AmXYChart();
|
||||
let chart = new AmCharts.AmXYChart();
|
||||
chart.pathToImages = "../../amcharts/javascript/images/";
|
||||
chart.dataProvider = chartData;
|
||||
chart.marginLeft = 35;
|
||||
chart.startDuration = 1.5;
|
||||
|
||||
var xAxis = new AmCharts.ValueAxis();
|
||||
let xAxis = new AmCharts.ValueAxis();
|
||||
xAxis.position = "left";
|
||||
xAxis.autoGridCount = true;
|
||||
chart.addValueAxis(xAxis);
|
||||
|
||||
var yAxis = new AmCharts.ValueAxis();
|
||||
let yAxis = new AmCharts.ValueAxis();
|
||||
yAxis.position = "bottom";
|
||||
yAxis.autoGridCount = true;
|
||||
chart.addValueAxis(yAxis);
|
||||
|
||||
var graph = new AmCharts.AmGraph();
|
||||
let graph = new AmCharts.AmGraph();
|
||||
graph.valueField = "value";
|
||||
graph.xField = "x";
|
||||
graph.yField = "y";
|
||||
@@ -305,10 +305,10 @@ declare namespace AmCharts {
|
||||
graph.bullet = "round";
|
||||
chart.addGraph(graph);
|
||||
|
||||
var chartCursor = new AmCharts.ChartCursor();
|
||||
let chartCursor = new AmCharts.ChartCursor();
|
||||
chart.addChartCursor(chartCursor);
|
||||
|
||||
var chartScrollbar = new AmCharts.ChartScrollbar();
|
||||
let chartScrollbar = new AmCharts.ChartScrollbar();
|
||||
chartScrollbar.hideResizeGrips = false;
|
||||
chart.addChartScrollbar(chartScrollbar);
|
||||
|
||||
@@ -517,7 +517,6 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
visibleInLegend: boolean;
|
||||
}
|
||||
|
||||
|
||||
/** AmStockChart is a main class Stock chart. */
|
||||
class AmStockChart {
|
||||
/** Specifies if animation was already played. Animation is only played once, when chart is rendered for the first time. If you want the animation to be repeated, set this property to false. */
|
||||
@@ -578,8 +577,6 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
clear(): void;
|
||||
/** Hides event bullets. */
|
||||
hideStockEvents(): void;
|
||||
/** Removes event listener from the object. */
|
||||
removeListener(obj: any, type: string, handler: any): void;
|
||||
/** Removes panel from the stock chart. Requires stockChart.validateNow() method to be called after this action. */
|
||||
removePanel(panel: StockPanel): void;
|
||||
/** Shows event bullets. */
|
||||
@@ -712,18 +709,15 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
unit: string;
|
||||
/** Position of the unit. Possible values are "left" or "right". */
|
||||
unitPosition: string;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/** AmLegend is the class that displays legend of the chart. Legend to the chart should be added using chart.addLegend(legend) method.
|
||||
@example
|
||||
var chart = new AmCharts.AmSerialChart();
|
||||
var legend = new AmCharts.AmLegend();
|
||||
let chart = new AmCharts.AmSerialChart();
|
||||
let legend = new AmCharts.AmLegend();
|
||||
chart.addLegend(legend);
|
||||
*/
|
||||
class AmLegend {
|
||||
|
||||
/** Alignment of legend entries. Possible values are: "left", "center", "right". left */
|
||||
align: string;
|
||||
/** Used if chart is Serial or XY. In case true, margins of the legend are adjusted and made equal to chart's margins.
|
||||
@@ -850,10 +844,11 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
If the type if "rollOverMarker", dispatched when user clicks on a legend item marker and shows corresponding object.
|
||||
*/
|
||||
|
||||
/** Adds event listener of the type "showItem" to the object.
|
||||
@param type Always "showItem".
|
||||
@param handler
|
||||
*/
|
||||
/**
|
||||
* Adds event listener of the type "showItem" to the object.
|
||||
* @param type Always "showItem".
|
||||
* @param handler The event handler.
|
||||
*/
|
||||
addListener(type: string, handler: (e: {/** Always "showItem". */
|
||||
type: string; dataItem: Object; chart: AmChart;
|
||||
}) => void): void;
|
||||
@@ -863,18 +858,14 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
}
|
||||
|
||||
/** StockLegend is a legend of StockPanel. */
|
||||
|
||||
class StockLegend extends AmLegend {
|
||||
/** The text which will be displayed in the value portion of the legend when graph is comparable and at least one dataSet is selected for comparing. You can use tags like [[value]], [[open]], [[high]], [[low]], [[close]], [[percents.value/open/close/low/high]], [[description]]. [[percents.value]]% */
|
||||
|
||||
valueTextComparing: string;
|
||||
/** The text which will be displayed in the value portion of the legend. You can use tags like [[value]], [[open]], [[high]], [[low]], [[close]], [[percents]], [[description]]. [[value]] */
|
||||
|
||||
valueTextRegular: string;
|
||||
}
|
||||
|
||||
/** StockPanel class creates stock panels (charts). AmStockChart can have multiple Stock panels. */
|
||||
|
||||
class StockPanel extends AmSerialChart {
|
||||
/** Specifies whether x button will be displayed near the panel. This button allows turning panel off. */
|
||||
allowTurningOff: boolean;
|
||||
@@ -896,7 +887,6 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
@default true
|
||||
*/
|
||||
showCategoryAxis: boolean;
|
||||
/** */
|
||||
stockGraphs: StockGraph[];
|
||||
/** Stock chart legend. */
|
||||
stockLegend: StockLegend;
|
||||
@@ -991,7 +981,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
/** 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/";
|
||||
let 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.
|
||||
@@ -1035,23 +1025,25 @@ 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|string, y: number|string, text: string, align: string, size?: number, color?: string, rotation?: number, alpha?: number, bold?: boolean, url?: string): any;
|
||||
/** 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.)
|
||||
@param legend
|
||||
@param legendDivId - Id of the legend div (optional).
|
||||
*/
|
||||
addLabel(x: number | string, y: number | string, text: string, align: string, size?: number, color?: string, rotation?: number, alpha?: number, bold?: boolean, url?: string): any;
|
||||
/**
|
||||
* 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.)
|
||||
* @param legend - The legend.
|
||||
* @param legendDivId - Id of the legend div (optional).
|
||||
*/
|
||||
addLegend(legend: AmLegend, legendDivId?: string): void;
|
||||
/** 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.)
|
||||
@param legend
|
||||
@param legendDiv - Legend div (optional).
|
||||
/**
|
||||
* 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.)
|
||||
* @param legend - The legend.
|
||||
* @param legendDiv - Legend div (optional).
|
||||
*/
|
||||
addLegend(legend: AmLegend, legendDiv: HTMLElement): void;
|
||||
|
||||
/** 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. */
|
||||
/** 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: string, size: number, color: string, alpha: number, bold: boolean): void;
|
||||
/** Clears the chart area, intervals, etc. */
|
||||
clear(): void;
|
||||
@@ -1226,22 +1218,17 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
|
||||
/** SerialDataItem holds all the information about each series. When working with a chart, you do not create SerialDataItem objects or change it's properties directly. Consider properties of a SerialDataItem read-only - change values in chart's data provider if you need to. When serial chart parses dataProvider, it generates "chartData" array. Objects of this array are SerialDataItem objects. */
|
||||
class SerialDataItem {
|
||||
|
||||
/** You can access each GraphDataItem using this object. The data structure is: graphDataItem = serialDataItem.axes[axisId].graphs[graphId]. */
|
||||
axes: Object;
|
||||
|
||||
/** category value. String if parseDates is false, Date if true. */
|
||||
category: any;
|
||||
|
||||
/** Timestamp of a series date. Avalable only if parseDates property of CategoryAxis is set to true. */
|
||||
time: number;
|
||||
|
||||
/** Coordinate (horizontal or vertical, depends on chart's rotate property) of the series. */
|
||||
x: number;
|
||||
}
|
||||
|
||||
class CategoryAxis extends AxisBase {
|
||||
|
||||
/** When parse dates is on for the category axis, the chart will try to highlight the beginning of the periods, like month, in bold. Set this to false to disable the functionality.
|
||||
@default true
|
||||
*/
|
||||
@@ -1299,8 +1286,8 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
|
||||
/** ChartScrollbar class displays chart scrollbar. Supported by AmSerialChart and AmXYChart.
|
||||
@example
|
||||
var chart = new AmCharts.AmSerialChart();
|
||||
var chartScrollbar = new AmCharts.ChartScrollbar();
|
||||
let chart = new AmCharts.AmSerialChart();
|
||||
let chartScrollbar = new AmCharts.ChartScrollbar();
|
||||
chart.addChartScrollbar(chartScrollbar);
|
||||
*/
|
||||
class ChartScrollbar {
|
||||
@@ -1473,7 +1460,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
|
||||
/* 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].
|
||||
@example
|
||||
var trendLine = new AmCharts.TrendLine();
|
||||
let trendLine = new AmCharts.TrendLine();
|
||||
trendLine.initialDate = new Date(2012, 0, 2, 12); // 12 is hour - to start trend line in the middle of the day
|
||||
trendLine.finalDate = new Date(2012, 0, 11, 12);
|
||||
trendLine.initialValue = 10;
|
||||
@@ -1481,14 +1468,12 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
trendLine.lineColor = "#CC0000";
|
||||
chart.addTrendLine(trendLine);
|
||||
*/
|
||||
class TrendLine {
|
||||
|
||||
}
|
||||
class TrendLine { }
|
||||
|
||||
/** ChartCursor is a class which displays a cursor which follows the mouse. In case of Serial chart it also shows value and category balloons.
|
||||
@example
|
||||
var chart = new AmCharts.AmSerialChart();
|
||||
var chartCursor = new AmCharts.ChartCursor();
|
||||
let chart = new AmCharts.AmSerialChart();
|
||||
let chartCursor = new AmCharts.ChartCursor();
|
||||
chart.addChartCursor(chartCursor);
|
||||
*/
|
||||
class ChartCursor {
|
||||
@@ -1545,7 +1530,6 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
/** Indicates if currently user is selecting some chart area to zoom-in. */
|
||||
zooming: boolean;
|
||||
|
||||
|
||||
/** Hides cursor. */
|
||||
hideCursor(): void;
|
||||
/** You can force cursor to appear at specified cateogry or date. */
|
||||
@@ -1578,13 +1562,13 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
|
||||
/** AmSerialChart is the class you have to use for majority of chart types. The supported chart types are: line, area, column, bar, step line, smoothed line, candlestick and OHLC. The chart can be rotated by 90 degrees so the column chart becomes bar chart. The chart supports simple and logarithmic scales, it can have multiple value axes. The chart can place data points at equal intervals or can parse dates and place data points at irregular intervals.
|
||||
@example
|
||||
var chartData = [{title:"sample 1",value:130},{title:"sample 2",value:26}];
|
||||
let chartData = [{title:"sample 1",value:130},{title:"sample 2",value:26}];
|
||||
|
||||
var chart = new AmCharts.AmSerialChart();
|
||||
let chart = new AmCharts.AmSerialChart();
|
||||
chart.categoryField = "title";
|
||||
chart.dataProvider = chartData;
|
||||
|
||||
var graph = new AmCharts.AmGraph();
|
||||
let graph = new AmCharts.AmGraph();
|
||||
graph.valueField = "value";
|
||||
graph.type = "column";
|
||||
graph.fillAlphas = 1;
|
||||
@@ -1593,7 +1577,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
chart.write("chartdiv");
|
||||
*/
|
||||
class AmSerialChart extends AmRectangularChart {
|
||||
/** Date format of the graph balloon (if chart parses dates and you don't use chartCursor).
|
||||
/** Date format of the graph balloon (if chart parses dates and you don't use chartCursor).
|
||||
@default 'MMM DD, YYYY'
|
||||
*/
|
||||
balloonDateFormat: string;
|
||||
@@ -1679,7 +1663,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
{"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"}
|
||||
@default []
|
||||
*/
|
||||
allLabels: [Label]
|
||||
allLabels: [Label];
|
||||
|
||||
/** Array of arrows. */
|
||||
arrows: [GaugeArrow];
|
||||
@@ -1699,7 +1683,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
*/
|
||||
autoTransform: boolean;
|
||||
|
||||
/** Array of axes.
|
||||
/** Array of axes.
|
||||
@default [GaugeAxis]
|
||||
*/
|
||||
axes: [GaugeAxis];
|
||||
@@ -1753,9 +1737,9 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
dataLoader: Object;
|
||||
|
||||
/** 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.
|
||||
|
||||
|
||||
The data set data.
|
||||
|
||||
|
||||
Important: if you are using date/time-based category axis, the data points needs to come pre-ordered in ascending order. Data with incorrect order might result in visual and functional glitches on the chart. */
|
||||
dataProvider: [Object];
|
||||
|
||||
@@ -1836,7 +1820,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
/** Read-only. Reference to the div of the legend. */
|
||||
legendDiv: HTMLElement;
|
||||
|
||||
/** You can add listeners of events using this property. Example: listeners = [{"event":"dataUpdated", "method":handleEvent}];
|
||||
/** You can add listeners of events using this property. Example: listeners = [{"event":"dataUpdated", "method":handleEvent}];
|
||||
@default [Object]
|
||||
*/
|
||||
listeners: [Object];
|
||||
@@ -1874,14 +1858,14 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
/** 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.
|
||||
let AmCharts_path = "/libs/amcharts/";
|
||||
"path" parameter will be used by the charts to locate it's files, like images, plugins or patterns.
|
||||
@default 'amcharts/'
|
||||
*/
|
||||
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;
|
||||
|
||||
@@ -1916,7 +1900,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
processTimeout: number;
|
||||
|
||||
/** A config object for Responsive plugin. Please refer to the following page for more information. */
|
||||
responsive: Object
|
||||
responsive: Object;
|
||||
|
||||
/** Duration of arrow animation.
|
||||
@default 1
|
||||
@@ -1943,7 +1927,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
*/
|
||||
theme: string;
|
||||
|
||||
/** Thousands separator.
|
||||
/** Thousands separator.
|
||||
@default ,
|
||||
*/
|
||||
thousandsSeparator: string;
|
||||
@@ -1980,12 +1964,13 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
|
||||
/** 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.) */
|
||||
addLegend(legend: AmLegend, legendDivId?: string): void;
|
||||
/** 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.)
|
||||
@param legend
|
||||
@param legendDiv - Legend div (optional).
|
||||
*/
|
||||
/**
|
||||
* 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.)
|
||||
* @param legend - The legend.
|
||||
* @param legendDiv - Legend div (optional).
|
||||
*/
|
||||
addLegend(legend: AmLegend, legendDiv: HTMLElement): void;
|
||||
|
||||
/** Adds event listener to the object. */
|
||||
@@ -2041,7 +2026,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
/** Axis of the arrow. You can use reference to the axis or id of the axis. If you don't set any axis, the first axis of a chart will be used.
|
||||
@default GaugeAxis
|
||||
*/
|
||||
axis: GaugeAxis
|
||||
axis: GaugeAxis;
|
||||
|
||||
/** Opacity of arrow border.
|
||||
@default 1
|
||||
@@ -2177,7 +2162,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
centerY: any;
|
||||
|
||||
/** Specifies labels color of the axis. */
|
||||
color: string
|
||||
color: string;
|
||||
|
||||
/** Axis end angle. Valid values are from - 180 to 180.
|
||||
@default 120
|
||||
@@ -2235,7 +2220,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
/** Length of a minor tick.
|
||||
@default 5
|
||||
*/
|
||||
minorTickLength: number
|
||||
minorTickLength: number;
|
||||
|
||||
/** Axis radius.
|
||||
@default '95%'
|
||||
@@ -2243,7 +2228,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
radius: any;
|
||||
|
||||
/** Specifies if the first label should be shown.
|
||||
@default true
|
||||
@default true
|
||||
*/
|
||||
showFirstLabel: boolean;
|
||||
|
||||
@@ -2283,7 +2268,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
tickThickness: number;
|
||||
|
||||
/** Text displayed above the axis center. */
|
||||
topText: string
|
||||
topText: string;
|
||||
|
||||
/** Specifies if text should be bold.
|
||||
@default true
|
||||
@@ -2291,10 +2276,10 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
topTextBold: boolean;
|
||||
|
||||
/** Color of top text. */
|
||||
topTextColor: string
|
||||
topTextColor: string;
|
||||
|
||||
/** Font size of top text. */
|
||||
topTextFontSize: number
|
||||
topTextFontSize: number;
|
||||
|
||||
/** Y offset of top text.
|
||||
@default 0
|
||||
@@ -2318,19 +2303,19 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
valueInterval: number;
|
||||
|
||||
/** Adds event listener to the object. */
|
||||
addListener(type: string, handler: any);
|
||||
addListener(type: string, handler: any): void;
|
||||
|
||||
/** Removes event listener from chart object. */
|
||||
removeListener(chart: AmChart, type: string, handler: any);
|
||||
removeListener(chart: AmChart, type: string, handler: any): void;
|
||||
|
||||
/** Sets bottom text. */
|
||||
setBottomText(text: string);
|
||||
setBottomText(text: string): void;
|
||||
|
||||
/** Sets top text. */
|
||||
setTopText(textstring);
|
||||
setTopText(textstring: string): void;
|
||||
|
||||
/** Returns angle of the value. */
|
||||
value2angle(value: number);
|
||||
value2angle(value: number): void;
|
||||
}
|
||||
|
||||
class GaugeBand {
|
||||
@@ -2344,7 +2329,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
color: string;
|
||||
|
||||
/** End value of a fill. */
|
||||
endValue: number
|
||||
endValue: number;
|
||||
|
||||
/** Example: [-0.2, 0, -0.2]. Will make bands to be filled with color gradients. Negative value means the color will be darker than the original, and positive number means the color will be lighter.
|
||||
@default []
|
||||
@@ -2367,10 +2352,10 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
url: string;
|
||||
|
||||
/** Sets end value for the band. */
|
||||
setEndValue(value);
|
||||
setEndValue(value: number): void;
|
||||
|
||||
/** Sets start value for the band. */
|
||||
setStartValue(value);
|
||||
setStartValue(value: number): void;
|
||||
}
|
||||
|
||||
class PeriodSelector {
|
||||
@@ -2659,7 +2644,6 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
valueWidth: number;
|
||||
/** Vertical space between legend items, in pixels. */
|
||||
verticalGap: number;
|
||||
|
||||
}
|
||||
|
||||
/** DataSetSelector is a tool for selecting data set's as main and for comparing with main data set. */
|
||||
@@ -2684,9 +2668,9 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
|
||||
/** AmBalloon is the class which generates balloons (datatips). Balloon follows the mouse when you roll-over the pie slice/line bullet/column/etc, chart indicator of serial charts displays value balloons and category balloon. Balloon instance is created by the chart automatically and can be accessed via "balloon" property of AmChart. Chart shows/hides and sets position for every balloon automatically, so all you need to do is to change balloon appearance, if you want to.
|
||||
@example
|
||||
var chart = new AmCharts.AmSerialChart();
|
||||
let chart = new AmCharts.AmSerialChart();
|
||||
// get balloon intance
|
||||
var balloon = chart.balloon;
|
||||
let balloon = chart.balloon;
|
||||
// set properties
|
||||
balloon.adjustBorderColor = true;
|
||||
balloon.color = "#000000";
|
||||
@@ -2904,8 +2888,8 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
|
||||
/** AmGraph class displays all types of graphs - line, column, step line, smoothed line, ohlc and candlestick.
|
||||
@example
|
||||
var chart = new AmCharts.AmSerialChart();
|
||||
var graph = new AmCharts.AmGraph();
|
||||
let chart = new AmCharts.AmSerialChart();
|
||||
let graph = new AmCharts.AmGraph();
|
||||
graph.valueField = 'value';
|
||||
graph.type = 'column';
|
||||
graph.fillAlphas = 1;
|
||||
@@ -3434,16 +3418,12 @@ Your function should return string.*/
|
||||
|
||||
/** Adds guide to the axis. */
|
||||
addGuide(guide: Guide): void;
|
||||
/** 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: string, handler: any): void;
|
||||
/** Number, - value of coordinate. Returns value of the coordinate. coordinate - y or x coordinate, in pixels. */
|
||||
coordinateToValue(coordinate: number): void;
|
||||
/** Number - coordinate Returns coordinate of the value in pixels. value - Number */
|
||||
getCoordinate(value: number): void;
|
||||
/** Removes guide from the axis.*/
|
||||
removeGuide(guide: Guide): void;
|
||||
/** Removes event listener from the object. */
|
||||
removeListener(obj: any, type: string, handler: any): void;
|
||||
|
||||
/** One value axis can be synchronized with another value axis. You should set synchronizationMultiplyer in order for this to work. */
|
||||
synchronizeWithAxis(axis: ValueAxis): void;
|
||||
@@ -3490,6 +3470,6 @@ Your function should return string.*/
|
||||
menu: Object;
|
||||
config: any;
|
||||
capture(config: any, callback: () => void): any;
|
||||
toJPG(config: any, callback: (config:any) => void): any;
|
||||
toJPG(config: any, callback: (config: any) => void): any;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": false,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
@@ -18,6 +18,7 @@
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts"
|
||||
"index.d.ts",
|
||||
"amcharts-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,79 +1,9 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"interface-over-type-literal": false,
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-duplicate-variable": false,
|
||||
"no-empty-interface": false,
|
||||
"no-for-in-array": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": false,
|
||||
"no-irregular-whitespace": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-misused-new": false,
|
||||
"no-namespace": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-reference-import": false,
|
||||
"no-relative-import-in-test": false,
|
||||
"no-self-import": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-string-throw": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-useless-files": false,
|
||||
"no-var-keyword": false,
|
||||
"no-var-requires": false,
|
||||
"no-void-expression": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": false,
|
||||
"prefer-declare-function": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-template": false,
|
||||
"radix": false,
|
||||
"semicolon": false,
|
||||
"space-before-function-paren": false,
|
||||
"space-within-parens": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"trim-file": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false,
|
||||
"whitespace": false
|
||||
"unified-signatures": false
|
||||
}
|
||||
}
|
||||
|
||||
38717
types/arcgis-js-api/index.d.ts
vendored
38717
types/arcgis-js-api/index.d.ts
vendored
File diff suppressed because it is too large
Load Diff
12
types/async/index.d.ts
vendored
12
types/async/index.d.ts
vendored
@@ -11,7 +11,7 @@ export interface Dictionary<T> { [key: string]: T; }
|
||||
export interface ErrorCallback<T> { (err?: T): void; }
|
||||
export interface AsyncBooleanResultCallback<E> { (err?: E, truthValue?: boolean): void; }
|
||||
export interface AsyncResultCallback<T, E> { (err?: E, result?: T): void; }
|
||||
export interface AsyncResultArrayCallback<T, E> { (err?: E, results?: (T | undefined)[]): void; }
|
||||
export interface AsyncResultArrayCallback<T, E> { (err?: E, results?: Array<T | undefined>): void; }
|
||||
export interface AsyncResultObjectCallback<T, E> { (err: E | undefined, results: Dictionary<T | undefined>): void; }
|
||||
|
||||
export interface AsyncFunction<T, E> { (callback: (err?: E, result?: T) => void): void; }
|
||||
@@ -116,8 +116,12 @@ export const eachOfLimit: typeof forEachOfLimit;
|
||||
export function map<T, R, E>(arr: T[] | IterableIterator<T>, iterator: AsyncResultIterator<T, R, E>, callback?: AsyncResultArrayCallback<R, E>): void;
|
||||
export function map<T, R, E>(arr: Dictionary<T>, iterator: AsyncResultIterator<T, R, E>, callback?: AsyncResultArrayCallback<R, E>): void;
|
||||
export const mapSeries: typeof map;
|
||||
export function mapLimit<T, R, E>(arr: T[] | IterableIterator<T>, limit: number, iterator: AsyncResultIterator<T, R, E>, callback?: AsyncResultArrayCallback<R, E>): void;
|
||||
export function mapLimit<T, R, E>(arr: Dictionary<T>, limit: number, iterator: AsyncResultIterator<T, R, E>, callback?: AsyncResultArrayCallback<R, E>): void;
|
||||
export function mapLimit<T, R, E>(
|
||||
arr: T[] | Dictionary<T> | IterableIterator<T>,
|
||||
limit: number,
|
||||
iterator: AsyncResultIterator<T, R, E>,
|
||||
callback?: AsyncResultArrayCallback<R, E>
|
||||
): void;
|
||||
export function mapValuesLimit<T, R, E>(obj: Dictionary<T>, limit: number, iteratee: (value: T, key: string, callback: AsyncResultCallback<R, E>) => void, callback: AsyncResultObjectCallback<R, E>): void;
|
||||
export function mapValues<T, R, E>(obj: Dictionary<T>, iteratee: (value: T, key: string, callback: AsyncResultCallback<R, E>) => void, callback: AsyncResultObjectCallback<R, E>): void;
|
||||
export const mapValuesSeries: typeof mapValues;
|
||||
@@ -222,7 +226,7 @@ export function memoize(fn: Function, hasher?: Function): Function;
|
||||
export function unmemoize(fn: Function): Function;
|
||||
export function ensureAsync(fn: (... argsAndCallback: any[]) => void): Function;
|
||||
export function constant(...values: any[]): Function;
|
||||
export function asyncify(fn: Function): Function;
|
||||
export function asyncify(fn: Function): (...args: any[]) => any;
|
||||
export function wrapSync(fn: Function): Function;
|
||||
export function log(fn: Function, ...args: any[]): void;
|
||||
export function dir(fn: Function, ...args: any[]): void;
|
||||
|
||||
@@ -13,6 +13,7 @@ declare let element: HTMLElement;
|
||||
declare let elements: HTMLElement[];
|
||||
declare const div: HTMLDivElement;
|
||||
declare const event: KeyboardEvent;
|
||||
declare const mouseEvent: MouseEvent;
|
||||
|
||||
declare let buffer: Atom.TextBuffer;
|
||||
declare const color: Atom.Color;
|
||||
@@ -65,6 +66,9 @@ declare let subscription: Atom.Disposable;
|
||||
declare let subscriptions: Atom.CompositeDisposable;
|
||||
declare let tooltips: Atom.Tooltip[];
|
||||
declare let workspaceCenter: Atom.WorkspaceCenter;
|
||||
declare let pixelPos: Atom.PixelPosition;
|
||||
declare let textEditorElement: Atom.TextEditorElement;
|
||||
declare let textEditorComponent: Atom.TextEditorComponent;
|
||||
|
||||
// AtomEnvironment ============================================================
|
||||
function testAtomEnvironment() {
|
||||
@@ -196,6 +200,8 @@ function testAtomEnvironment() {
|
||||
}
|
||||
|
||||
atom.executeJavaScriptInDevTools("Test");
|
||||
|
||||
const path: string = atom.getConfigDirPath();
|
||||
}
|
||||
|
||||
// BufferedNodeProcess ========================================================
|
||||
@@ -267,6 +273,10 @@ function testCommandRegistry() {
|
||||
description: "A Command Test",
|
||||
displayName: "Command: Test",
|
||||
});
|
||||
atom.commands.add("atom-text-editor", {
|
||||
"test-function": (event) => event.currentTarget.getModel(),
|
||||
"test-function2": (event) => event.currentTarget.getComponent(),
|
||||
});
|
||||
|
||||
const commands = atom.commands.findCommands({ target: element });
|
||||
atom.commands.dispatch(element, "test:function");
|
||||
@@ -1056,6 +1066,10 @@ function testGrammar() {
|
||||
tokenizeLineResult.tokens;
|
||||
grammar.tokenizeLine("Test String", tokenizeLineResult.ruleStack);
|
||||
grammar.tokenizeLine("Test String", tokenizeLineResult.ruleStack, false);
|
||||
|
||||
let str: string;
|
||||
str = grammar.name;
|
||||
str = grammar.scopeName;
|
||||
}
|
||||
|
||||
// GrammarRegistry ============================================================
|
||||
@@ -1396,6 +1410,9 @@ function testPackageManager() {
|
||||
subscription = atom.packages.onDidDeactivatePackage(pack => pack.path);
|
||||
subscription = atom.packages.onDidLoadPackage(pack => pack.isCompatible());
|
||||
subscription = atom.packages.onDidUnloadPackage(pack => pack.name);
|
||||
subscription = atom.packages.onDidTriggerActivationHook(
|
||||
'language-javascript:grammar-used', () => {}
|
||||
);
|
||||
|
||||
// Package system data
|
||||
str = atom.packages.getApmPath();
|
||||
@@ -1587,7 +1604,8 @@ function testPanel() {
|
||||
}
|
||||
|
||||
// PathWatcher ================================================================
|
||||
function testPathWatcher() {
|
||||
async function testPathWatcher() {
|
||||
const pathWatcher = await pathWatcherPromise;
|
||||
pathWatcher.dispose();
|
||||
subscription = pathWatcher.onDidError((error) => str = error.name);
|
||||
|
||||
@@ -2352,14 +2370,14 @@ function testTextEditor() {
|
||||
// Mutating Text
|
||||
editor.setText("Test");
|
||||
|
||||
editor.setTextInBufferRange(range, "Test");
|
||||
editor.setTextInBufferRange([pos, pos], "Test");
|
||||
editor.setTextInBufferRange([pos, [0, 0]], "Test");
|
||||
editor.setTextInBufferRange([[0, 0], pos], "Test");
|
||||
editor.setTextInBufferRange([[0, 0], [0, 0]], "Test");
|
||||
editor.setTextInBufferRange(range, "Test", {});
|
||||
editor.setTextInBufferRange([pos, pos], "Test", { normalizeLineEndings: true });
|
||||
editor.setTextInBufferRange(range, "Test", { normalizeLineEndings: true,
|
||||
range = editor.setTextInBufferRange(range, "Test");
|
||||
range = editor.setTextInBufferRange([pos, pos], "Test");
|
||||
range = editor.setTextInBufferRange([pos, [0, 0]], "Test");
|
||||
range = editor.setTextInBufferRange([[0, 0], pos], "Test");
|
||||
range = editor.setTextInBufferRange([[0, 0], [0, 0]], "Test");
|
||||
range = editor.setTextInBufferRange(range, "Test", {});
|
||||
range = editor.setTextInBufferRange([pos, pos], "Test", { normalizeLineEndings: true });
|
||||
range = editor.setTextInBufferRange(range, "Test", { normalizeLineEndings: true,
|
||||
undo: "skip" });
|
||||
|
||||
editor.insertText("Test");
|
||||
@@ -2922,6 +2940,15 @@ function testTextEditor() {
|
||||
// TextEditor Rendering
|
||||
str = editor.getPlaceholderText();
|
||||
editor.setPlaceholderText("Test");
|
||||
|
||||
range = editor.bufferRangeForScopeAtPosition('source.js', [0, 0]);
|
||||
range = editor.bufferRangeForScopeAtPosition('source.js', {row: 10, column: 11});
|
||||
range = editor.bufferRangeForScopeAtPosition('source.js', pos);
|
||||
|
||||
let token: {value: string, scopes: string[]};
|
||||
token = editor.tokenForBufferPosition([5, 6]);
|
||||
token = editor.tokenForBufferPosition({row: 0, column: 1});
|
||||
token = editor.tokenForBufferPosition(pos);
|
||||
}
|
||||
|
||||
// ThemeManager ===============================================================
|
||||
@@ -2981,6 +3008,7 @@ function testViewRegistry() {
|
||||
});
|
||||
|
||||
element = atom.views.getView(element);
|
||||
textEditorElement = atom.views.getView(editor);
|
||||
}
|
||||
|
||||
// Workspace ==================================================================
|
||||
@@ -3213,10 +3241,46 @@ function testWorkspaceCenter() {
|
||||
}
|
||||
|
||||
// watchPath ==================================================================
|
||||
const pathWatcher = Atom.watchPath("/var/test", {}, (events) => {
|
||||
const pathWatcherPromise = Atom.watchPath("/var/test", {}, (events) => {
|
||||
for (const event of events) {
|
||||
str = event.path;
|
||||
str = event.action;
|
||||
if (event.oldPath) str = event.oldPath;
|
||||
}
|
||||
});
|
||||
|
||||
// TextEditorElement ==========================================================
|
||||
function testTextEditorElement() {
|
||||
textEditorComponent = textEditorElement.getComponent();
|
||||
editor = textEditorElement.getModel();
|
||||
|
||||
textEditorElement.getNextUpdatePromise().then(() => {});
|
||||
let num: number = textEditorElement.getBaseCharacterWidth();
|
||||
|
||||
textEditorElement.scrollToTop();
|
||||
textEditorElement.scrollToBottom();
|
||||
textEditorElement.setScrollTop(num);
|
||||
num = textEditorElement.getScrollTop();
|
||||
textEditorElement.setScrollLeft(num);
|
||||
num = textEditorElement.getScrollLeft();
|
||||
num = textEditorElement.getScrollHeight();
|
||||
|
||||
pixelPos = textEditorElement.pixelPositionForBufferPosition(pos);
|
||||
pixelPos = textEditorElement.pixelPositionForScreenPosition({row: 1, column: 2});
|
||||
pixelPos = textEditorElement.pixelPositionForScreenPosition(pos);
|
||||
|
||||
subscription = textEditorElement.onDidChangeScrollTop((scrollTop: number) => {});
|
||||
subscription = textEditorElement.onDidChangeScrollLeft((scrollLeft: number) => {});
|
||||
subscription = textEditorElement.onDidAttach(() => {});
|
||||
subscription = textEditorElement.onDidDetach(() => {});
|
||||
|
||||
textEditorElement = document.createElement('atom-text-editor');
|
||||
}
|
||||
|
||||
// TextEditorComponent ========================================================
|
||||
function testTextEditorComponent() {
|
||||
pixelPos = textEditorComponent.pixelPositionForMouseEvent(mouseEvent);
|
||||
pixelPos = textEditorComponent.pixelPositionForScreenPosition(pos);
|
||||
pos = textEditorComponent.screenPositionForMouseEvent(mouseEvent);
|
||||
pos = textEditorComponent.screenPositionForPixelPosition(pixelPos);
|
||||
}
|
||||
|
||||
124
types/atom/index.d.ts
vendored
124
types/atom/index.d.ts
vendored
@@ -1,7 +1,8 @@
|
||||
// Type definitions for Atom 1.22
|
||||
// Project: https://github.com/atom/atom
|
||||
// Definitions by: GlenCFL <https://github.com/GlenCFL>,
|
||||
// Definitions by: GlenCFL <https://github.com/GlenCFL>
|
||||
// smhxx <https://github.com/smhxx>
|
||||
// lierdakil <https://github.com/lierdakil>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -16,6 +17,10 @@ import { ChildProcess } from "child_process";
|
||||
|
||||
declare global {
|
||||
const atom: AtomEnvironment;
|
||||
|
||||
interface HTMLElementTagNameMap {
|
||||
"atom-text-editor": TextEditorElement;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -24,7 +29,7 @@ declare global {
|
||||
* Project::onDidChangeFiles instead.
|
||||
*/
|
||||
export function watchPath(rootPath: string, options: {}, eventCallback: (events:
|
||||
FilesystemChangeEvent) => void): PathWatcher;
|
||||
FilesystemChangeEvent) => void): Promise<PathWatcher>;
|
||||
|
||||
// Essential Classes ==========================================================
|
||||
|
||||
@@ -238,6 +243,9 @@ export interface AtomEnvironment {
|
||||
|
||||
/** Execute code in dev tools. */
|
||||
executeJavaScriptInDevTools(code: string): void;
|
||||
|
||||
/** Undocumented: get Atom config directory path */
|
||||
getConfigDirPath(): string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -252,21 +260,37 @@ export interface Color {
|
||||
toRGBAString(): string;
|
||||
}
|
||||
|
||||
export interface CommandRegistryTargetMap extends HTMLElementTagNameMap {
|
||||
[key: string]: EventTarget;
|
||||
}
|
||||
|
||||
export type CommandRegistryListener<TargetType extends EventTarget> = {
|
||||
didDispatch(event: CommandEvent<TargetType>): void,
|
||||
displayName?: string,
|
||||
description?: string,
|
||||
} | ((event: CommandEvent<TargetType>) => void);
|
||||
|
||||
/**
|
||||
* Associates listener functions with commands in a context-sensitive way
|
||||
* using CSS selectors.
|
||||
*/
|
||||
export interface CommandRegistry {
|
||||
/** Register a single command. */
|
||||
add(target: string|Node, commandName: string, listener: {
|
||||
didDispatch(event: CommandEvent): void,
|
||||
displayName?: string,
|
||||
description?: string,
|
||||
} | ((event: CommandEvent) => void)): Disposable;
|
||||
add<T extends keyof CommandRegistryTargetMap>(
|
||||
target: T, commandName: string,
|
||||
listener: CommandRegistryListener<CommandRegistryTargetMap[T]>
|
||||
): Disposable;
|
||||
add<T extends Node>(
|
||||
target: T, commandName: string,
|
||||
listener: CommandRegistryListener<T>
|
||||
): Disposable;
|
||||
|
||||
/** Register multiple commands. */
|
||||
add(target: string|Node, commands: {
|
||||
[key: string]: (event: CommandEvent) => void
|
||||
add<T extends keyof CommandRegistryTargetMap>(target: T, commands: {
|
||||
[key: string]: (event: CommandEvent<CommandRegistryTargetMap[T]>) => void
|
||||
}): CompositeDisposable;
|
||||
add<T extends Node>(target: T, commands: {
|
||||
[key: string]: (event: CommandEvent<T>) => void
|
||||
}): CompositeDisposable;
|
||||
|
||||
/** Find all registered commands matching a query. */
|
||||
@@ -1456,7 +1480,7 @@ export class TextEditor {
|
||||
|
||||
/** Set the text in the given Range in buffer coordinates. */
|
||||
setTextInBufferRange(range: RangeCompatible, text: string, options?:
|
||||
{ normalizeLineEndings?: boolean, undo?: "skip" }): void;
|
||||
{ normalizeLineEndings?: boolean, undo?: "skip" }): Range;
|
||||
|
||||
/* For each selection, replace the selected text with the given text. */
|
||||
insertText(text: string, options?: {
|
||||
@@ -2379,6 +2403,74 @@ export class TextEditor {
|
||||
* displayed when the editor has no content.
|
||||
*/
|
||||
setPlaceholderText(placeholderText: string): void;
|
||||
|
||||
/** Undocumented: Buffer range for syntax scope at position */
|
||||
bufferRangeForScopeAtPosition(scope: string, point: PointCompatible): Range;
|
||||
|
||||
/** Undocumented: Get syntax token at buffer position */
|
||||
tokenForBufferPosition(pos: PointCompatible): {value: string, scopes: string[]};
|
||||
}
|
||||
|
||||
export interface PixelPosition {
|
||||
left: number;
|
||||
top: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Undocumented: Rendering component for TextEditor
|
||||
*/
|
||||
export interface TextEditorComponent {
|
||||
/** Does not clip screenPosition, unlike similar method on TextEditorElement */
|
||||
pixelPositionForScreenPosition(screenPosition: PointLike): PixelPosition;
|
||||
screenPositionForPixelPosition(pos: PixelPosition): Point;
|
||||
pixelPositionForMouseEvent(event: {
|
||||
clientX: number, clientY: number
|
||||
}): PixelPosition;
|
||||
screenPositionForMouseEvent(event: {clientX: number, clientY: number}): Point;
|
||||
}
|
||||
|
||||
/**
|
||||
* Undocumented: Custom HTML elemnent for TextEditor, atom-text-editor
|
||||
*/
|
||||
export interface TextEditorElement extends HTMLElement {
|
||||
getModel(): TextEditor;
|
||||
getComponent(): TextEditorComponent;
|
||||
/**
|
||||
* Extended: Get a promise that resolves the next time the element's
|
||||
* DOM is updated in any way.
|
||||
*/
|
||||
getNextUpdatePromise(): Promise<void>;
|
||||
|
||||
/** Extended: get the width of an `x` character displayed in this element. */
|
||||
getBaseCharacterWidth(): number;
|
||||
|
||||
/** Essential: Scrolls the editor to the top. */
|
||||
scrollToTop(): void;
|
||||
|
||||
/** Essential: Scrolls the editor to the bottom. */
|
||||
scrollToBottom(): void;
|
||||
|
||||
setScrollTop(scrollTop: number): void;
|
||||
getScrollTop(): number;
|
||||
|
||||
setScrollLeft(scrollLeft: number): void;
|
||||
getScrollLeft(): number;
|
||||
|
||||
getScrollHeight(): number;
|
||||
|
||||
/** Extended: Converts a buffer position to a pixel position. */
|
||||
pixelPositionForBufferPosition(bufferPosition: PointLike): PixelPosition;
|
||||
|
||||
/** Extended: Converts a screen position to a pixel position. */
|
||||
pixelPositionForScreenPosition(screenPosition: PointLike): PixelPosition;
|
||||
|
||||
// Event subscription
|
||||
onDidChangeScrollTop(callback: (scrollTop: number) => void): Disposable;
|
||||
onDidChangeScrollLeft(callback: (scrollLeft: number) => void): Disposable;
|
||||
/** Called when the editor is attached to the DOM. */
|
||||
onDidAttach(callback: () => void): Disposable;
|
||||
/** Called when the editor is detached from the DOM. */
|
||||
onDidDetach(callback: () => void): Disposable;
|
||||
}
|
||||
|
||||
/** Experimental: This global registry tracks registered TextEditors. */
|
||||
@@ -2469,6 +2561,7 @@ export interface ViewRegistry {
|
||||
(instance: T) => HTMLElement|undefined): Disposable;
|
||||
|
||||
/** Get the view associated with an object in the workspace. */
|
||||
getView(obj: TextEditor): TextEditorElement;
|
||||
getView(obj: object): HTMLElement;
|
||||
}
|
||||
|
||||
@@ -3610,7 +3703,10 @@ export class GitRepository {
|
||||
/** Grammar that tokenizes lines of text. */
|
||||
export interface Grammar {
|
||||
/** The name of the Grammar. */
|
||||
name: string;
|
||||
readonly name: string;
|
||||
|
||||
/** Undocumented: scope name of the Grammar. */
|
||||
readonly scopeName: string;
|
||||
|
||||
// Event Subscription
|
||||
onDidUpdate(callback: () => void): Disposable;
|
||||
@@ -3938,6 +4034,9 @@ export interface PackageManager {
|
||||
/** Invoke the given callback when a package is unloaded. */
|
||||
onDidUnloadPackage(callback: (package: Package) => void): Disposable;
|
||||
|
||||
/** Undocumented: invoke the given callback when an activation hook is triggered */
|
||||
onDidTriggerActivationHook(hook: string, callback: () => void): Disposable;
|
||||
|
||||
// Package System Data
|
||||
/** Get the path to the apm command. */
|
||||
getApmPath(): string;
|
||||
@@ -5268,13 +5367,14 @@ export interface BufferStoppedChangingEvent {
|
||||
* intent to stop propagation so event bubbling can be properly simulated for
|
||||
* detached elements.
|
||||
*/
|
||||
export interface CommandEvent extends CustomEvent {
|
||||
export interface CommandEvent<CurrentTarget extends EventTarget = EventTarget> extends CustomEvent {
|
||||
keyBindingAborted: boolean;
|
||||
propagationStopped: boolean;
|
||||
|
||||
abortKeyBinding(): void;
|
||||
stopPropagation(): CustomEvent;
|
||||
stopImmediatePropagation(): CustomEvent;
|
||||
currentTarget: CurrentTarget;
|
||||
}
|
||||
|
||||
export interface CursorPositionChangedEvent {
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
export class ViewModel {
|
||||
constructor(private knockoutBindable: KnockoutBindable) {
|
||||
}
|
||||
|
||||
activate(settings: any): void {
|
||||
this.knockoutBindable.applyBindableValues(settings, this);
|
||||
this.knockoutBindable.applyBindableValues(settings, this, true);
|
||||
}
|
||||
}
|
||||
18
types/aurelia-knockout/index.d.ts
vendored
18
types/aurelia-knockout/index.d.ts
vendored
@@ -1,18 +0,0 @@
|
||||
// Type definitions for aurelia-knockout 2.0
|
||||
// Project: https://github.com/code-chris/aurelia-knockout
|
||||
// Definitions by: Christian Kotzbauer <https://github.com/code-chris>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface KnockoutBindable {
|
||||
/**
|
||||
* Applys all values from a data object (usually the activation data) to the corresponding instance fields
|
||||
* in the current view model if they are marked as @bindable. By default all matching values from the data object
|
||||
* are applied. To only apply observable values set the last parameter to `true`. Subscriptions are created
|
||||
* for all Knockout observables in the data object to update the view-model values respectively.
|
||||
*
|
||||
* @param data - the data object
|
||||
* @param target - the target view model
|
||||
* @param applyOnlyObservables - `true` if only observable values should be applied, false by default.
|
||||
*/
|
||||
applyBindableValues(data: any, target: any, applyOnlyObservables?: boolean): void;
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"aurelia-knockout-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,113 +0,0 @@
|
||||
import axios from "axios";
|
||||
import MockAdapter = require("axios-mock-adapter");
|
||||
|
||||
const instance = axios.create();
|
||||
const mock = new MockAdapter(instance);
|
||||
|
||||
namespace AllowsConstructing {
|
||||
new MockAdapter(instance);
|
||||
}
|
||||
|
||||
namespace AllowsConstructingWithOptions {
|
||||
new MockAdapter(instance, {
|
||||
delayResponse: 2000,
|
||||
});
|
||||
}
|
||||
|
||||
namespace ExposesAdapter {
|
||||
mock.adapter();
|
||||
}
|
||||
|
||||
namespace SupportsReset {
|
||||
mock.reset();
|
||||
}
|
||||
|
||||
namespace SupportsRestore {
|
||||
mock.restore();
|
||||
}
|
||||
|
||||
namespace SupportsAllHttpVerbs {
|
||||
mock.onGet;
|
||||
mock.onPost;
|
||||
mock.onPut;
|
||||
mock.onHead;
|
||||
mock.onDelete;
|
||||
mock.onPatch;
|
||||
}
|
||||
|
||||
namespace SupportsAnyVerb {
|
||||
mock.onAny;
|
||||
}
|
||||
|
||||
namespace AllowsVerbOnlyMatcher {
|
||||
mock.onGet();
|
||||
}
|
||||
|
||||
namespace AllowsUrlMatcher {
|
||||
mock.onGet("/foo");
|
||||
}
|
||||
|
||||
namespace AllowsUrlRegExpMatcher {
|
||||
mock.onGet(/\/fo+/);
|
||||
}
|
||||
|
||||
namespace AllowsStringBodyMatcher {
|
||||
mock.onPatch("/foo", "bar");
|
||||
}
|
||||
|
||||
namespace AllowsBodyMatcher {
|
||||
mock.onGet("/foo", {
|
||||
id: 4,
|
||||
name: "foo",
|
||||
});
|
||||
}
|
||||
|
||||
namespace AllowsParameterMatcher {
|
||||
mock.onGet("/foo", {
|
||||
params: {
|
||||
searchText: "John",
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
namespace AllowsReplyWithStatus {
|
||||
mock.onGet().reply(200);
|
||||
}
|
||||
|
||||
namespace SupportsReplyOnce {
|
||||
mock.onGet().replyOnce(200);
|
||||
}
|
||||
|
||||
namespace SupportsPassThrough {
|
||||
mock.onGet().passThrough();
|
||||
}
|
||||
|
||||
namespace SupportsTimeout {
|
||||
mock.onGet().timeout();
|
||||
}
|
||||
|
||||
namespace AllowsFunctionReply {
|
||||
mock.onGet().reply((config) => {
|
||||
return [
|
||||
200,
|
||||
{ data: "foo" },
|
||||
{ RequestedURL: config.url },
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
namespace AllowsPromiseReply {
|
||||
mock.onGet().reply((config) => {
|
||||
return Promise.resolve([
|
||||
200,
|
||||
{ data: "bar" },
|
||||
{ RequestedURL: config.url },
|
||||
]);
|
||||
});
|
||||
}
|
||||
|
||||
namespace SupportsChanining {
|
||||
mock
|
||||
.onGet("/users").reply(200, [/* users */])
|
||||
.onGet("/posts").reply(200, [/* posts */]);
|
||||
}
|
||||
51
types/axios-mock-adapter/index.d.ts
vendored
51
types/axios-mock-adapter/index.d.ts
vendored
@@ -1,51 +0,0 @@
|
||||
// Type definitions for axios-mock-adapter 1.9
|
||||
// Project: https://github.com/ctimmerm/axios-mock-adapter
|
||||
// Definitions by: Tomasz Kryskiewicz <https://github.com/tkryskiewicz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version 2.1
|
||||
|
||||
import { AxiosAdapter, AxiosInstance, AxiosRequestConfig } from "axios";
|
||||
|
||||
type CallbackResponseSpecFunc = (config: AxiosRequestConfig) => any[] | Promise<any[]>;
|
||||
|
||||
type ResponseSpecFunc = (statusOrCallback: number | CallbackResponseSpecFunc, data?: any, headers?: any) => MockAdapter;
|
||||
|
||||
interface RequestHandler {
|
||||
reply: ResponseSpecFunc;
|
||||
replyOnce: ResponseSpecFunc;
|
||||
|
||||
passThrough(): void;
|
||||
networkError(): void;
|
||||
timeout(): void;
|
||||
}
|
||||
|
||||
interface MockAdapterOptions {
|
||||
delayResponse?: number;
|
||||
}
|
||||
|
||||
interface RequestDataMatcher {
|
||||
[index: string]: any;
|
||||
params?: {
|
||||
[index: string]: any,
|
||||
};
|
||||
}
|
||||
|
||||
type RequestMatcherFunc = (matcher?: string | RegExp, body?: string | RequestDataMatcher) => RequestHandler;
|
||||
|
||||
declare class MockAdapter {
|
||||
constructor(axiosInstance: AxiosInstance, options?: MockAdapterOptions);
|
||||
|
||||
adapter(): AxiosAdapter;
|
||||
reset(): void;
|
||||
restore(): void;
|
||||
|
||||
onGet: RequestMatcherFunc;
|
||||
onPost: RequestMatcherFunc;
|
||||
onPut: RequestMatcherFunc;
|
||||
onHead: RequestMatcherFunc;
|
||||
onDelete: RequestMatcherFunc;
|
||||
onPatch: RequestMatcherFunc;
|
||||
onAny: RequestMatcherFunc;
|
||||
}
|
||||
|
||||
export = MockAdapter;
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"axios": "^0.16.2"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-namespace": false
|
||||
}
|
||||
}
|
||||
@@ -352,7 +352,7 @@ class CustomError extends Error {
|
||||
customField: number;
|
||||
}
|
||||
// $ExpectType Bluebird<void | Foo>
|
||||
fooProm.catch(CustomError, (reason: CustomError) => {
|
||||
fooProm.catch(CustomError, reason => {
|
||||
let a: number = reason.customField;
|
||||
});
|
||||
|
||||
@@ -366,7 +366,7 @@ class CustomErrorWithConstructor extends Error {
|
||||
}
|
||||
}
|
||||
// $ExpectType Bluebird<void | Foo>
|
||||
fooProm.catch(CustomErrorWithConstructor, (reason: CustomErrorWithConstructor) => {
|
||||
fooProm.catch(CustomErrorWithConstructor, reason => {
|
||||
let a: boolean = reason.arg1;
|
||||
let b: number = reason.arg2;
|
||||
});
|
||||
|
||||
262
types/bluebird/index.d.ts
vendored
262
types/bluebird/index.d.ts
vendored
@@ -35,6 +35,8 @@
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
type CatchFilter<E> = (new (...args: any[]) => E) | ((error: E) => boolean) | (object & E);
|
||||
|
||||
declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
|
||||
/**
|
||||
* Create a new promise. The passed in function will receive functions `resolve` and `reject` as its arguments which can be called to seal the fate of the created promise.
|
||||
@@ -77,128 +79,69 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
|
||||
*
|
||||
* Alias `.caught();` for compatibility with earlier ECMAScript version.
|
||||
*/
|
||||
catch<E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error, E5 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1),
|
||||
filter2: (new (...args: any[]) => E2),
|
||||
filter3: (new (...args: any[]) => E3),
|
||||
filter4: (new (...args: any[]) => E4),
|
||||
filter5: (new (...args: any[]) => E5),
|
||||
onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike<R>,
|
||||
): Bluebird<R>;
|
||||
catch<E1, E2, E3, E4, E5>(
|
||||
filter1: ((error: E1) => boolean) | (E1 & object),
|
||||
filter2: ((error: E2) => boolean) | (E2 & object),
|
||||
filter3: ((error: E3) => boolean) | (E3 & object),
|
||||
filter4: ((error: E4) => boolean) | (E4 & object),
|
||||
filter5: ((error: E5) => boolean) | (E5 & object),
|
||||
filter1: CatchFilter<E1>,
|
||||
filter2: CatchFilter<E2>,
|
||||
filter3: CatchFilter<E3>,
|
||||
filter4: CatchFilter<E4>,
|
||||
filter5: CatchFilter<E5>,
|
||||
onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike<R>,
|
||||
): Bluebird<R>;
|
||||
catch<U, E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error, E5 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1),
|
||||
filter2: (new (...args: any[]) => E2),
|
||||
filter3: (new (...args: any[]) => E3),
|
||||
filter4: (new (...args: any[]) => E4),
|
||||
filter5: (new (...args: any[]) => E5),
|
||||
onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
catch<U, E1, E2, E3, E4, E5>(
|
||||
filter1: ((error: E1) => boolean) | (E1 & object),
|
||||
filter2: ((error: E2) => boolean) | (E2 & object),
|
||||
filter3: ((error: E3) => boolean) | (E3 & object),
|
||||
filter4: ((error: E4) => boolean) | (E4 & object),
|
||||
filter5: ((error: E5) => boolean) | (E5 & object),
|
||||
filter1: CatchFilter<E1>,
|
||||
filter2: CatchFilter<E2>,
|
||||
filter3: CatchFilter<E3>,
|
||||
filter4: CatchFilter<E4>,
|
||||
filter5: CatchFilter<E5>,
|
||||
onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
|
||||
catch<E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1),
|
||||
filter2: (new (...args: any[]) => E2),
|
||||
filter3: (new (...args: any[]) => E3),
|
||||
filter4: (new (...args: any[]) => E4),
|
||||
onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike<R>,
|
||||
): Bluebird<R>;
|
||||
catch<E1, E2, E3, E4>(
|
||||
filter1: ((error: E1) => boolean) | (E1 & object),
|
||||
filter2: ((error: E2) => boolean) | (E2 & object),
|
||||
filter3: ((error: E3) => boolean) | (E3 & object),
|
||||
filter4: ((error: E4) => boolean) | (E4 & object),
|
||||
filter1: CatchFilter<E1>,
|
||||
filter2: CatchFilter<E2>,
|
||||
filter3: CatchFilter<E3>,
|
||||
filter4: CatchFilter<E4>,
|
||||
onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike<R>,
|
||||
): Bluebird<R>;
|
||||
catch<U, E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1),
|
||||
filter2: (new (...args: any[]) => E2),
|
||||
filter3: (new (...args: any[]) => E3),
|
||||
filter4: (new (...args: any[]) => E4),
|
||||
onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
|
||||
catch<U, E1, E2, E3, E4>(
|
||||
filter1: ((error: E1) => boolean) | (E1 & object),
|
||||
filter2: ((error: E2) => boolean) | (E2 & object),
|
||||
filter3: ((error: E3) => boolean) | (E3 & object),
|
||||
filter4: ((error: E4) => boolean) | (E4 & object),
|
||||
filter1: CatchFilter<E1>,
|
||||
filter2: CatchFilter<E2>,
|
||||
filter3: CatchFilter<E3>,
|
||||
filter4: CatchFilter<E4>,
|
||||
onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
|
||||
catch<E1 extends Error, E2 extends Error, E3 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1),
|
||||
filter2: (new (...args: any[]) => E2),
|
||||
filter3: (new (...args: any[]) => E3),
|
||||
onReject: (error: E1 | E2 | E3) => R | PromiseLike<R>,
|
||||
): Bluebird<R>;
|
||||
catch<E1, E2, E3>(
|
||||
filter1: ((error: E1) => boolean) | (E1 & object),
|
||||
filter2: ((error: E2) => boolean) | (E2 & object),
|
||||
filter3: ((error: E3) => boolean) | (E3 & object),
|
||||
filter1: CatchFilter<E1>,
|
||||
filter2: CatchFilter<E2>,
|
||||
filter3: CatchFilter<E3>,
|
||||
onReject: (error: E1 | E2 | E3) => R | PromiseLike<R>,
|
||||
): Bluebird<R>;
|
||||
catch<U, E1 extends Error, E2 extends Error, E3 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1),
|
||||
filter2: (new (...args: any[]) => E2),
|
||||
filter3: (new (...args: any[]) => E3),
|
||||
onReject: (error: E1 | E2 | E3) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
catch<U, E1, E2, E3>(
|
||||
filter1: ((error: E1) => boolean) | (E1 & object),
|
||||
filter2: ((error: E2) => boolean) | (E2 & object),
|
||||
filter3: ((error: E3) => boolean) | (E3 & object),
|
||||
filter1: CatchFilter<E1>,
|
||||
filter2: CatchFilter<E2>,
|
||||
filter3: CatchFilter<E3>,
|
||||
onReject: (error: E1 | E2 | E3) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
|
||||
catch<E1 extends Error, E2 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1),
|
||||
filter2: (new (...args: any[]) => E2),
|
||||
onReject: (error: E1 | E2) => R | PromiseLike<R>,
|
||||
): Bluebird<R>;
|
||||
catch<E1, E2>(
|
||||
filter1: ((error: E1) => boolean) | (E1 & object),
|
||||
filter2: ((error: E2) => boolean) | (E2 & object),
|
||||
filter1: CatchFilter<E1>,
|
||||
filter2: CatchFilter<E2>,
|
||||
onReject: (error: E1 | E2) => R | PromiseLike<R>,
|
||||
): Bluebird<R>;
|
||||
catch<U, E1 extends Error, E2 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1),
|
||||
filter2: (new (...args: any[]) => E2),
|
||||
onReject: (error: E1 | E2) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
catch<U, E1, E2>(
|
||||
filter1: ((error: E1) => boolean) | (E1 & object),
|
||||
filter2: ((error: E2) => boolean) | (E2 & object),
|
||||
filter1: CatchFilter<E1>,
|
||||
filter2: CatchFilter<E2>,
|
||||
onReject: (error: E1 | E2) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
|
||||
catch<E1 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1),
|
||||
onReject: (error: E1) => R | PromiseLike<R>,
|
||||
): Bluebird<R>;
|
||||
catch<E1>(
|
||||
filter1: ((error: E1) => boolean) | (E1 & object),
|
||||
filter1: CatchFilter<E1>,
|
||||
onReject: (error: E1) => R | PromiseLike<R>,
|
||||
): Bluebird<R>;
|
||||
catch<U, E1 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1),
|
||||
onReject: (error: E1) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
catch<U, E1>(
|
||||
filter1: ((error: E1) => boolean) | (E1 & object),
|
||||
filter1: CatchFilter<E1>,
|
||||
onReject: (error: E1) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
|
||||
@@ -209,144 +152,7 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
|
||||
*
|
||||
* Alias `.caught();` for compatibility with earlier ECMAScript version.
|
||||
*/
|
||||
caught(onReject: (error: any) => R | PromiseLike<R>): Bluebird<R>;
|
||||
caught<U>(onReject: ((error: any) => U | PromiseLike<U>) | undefined | null): Bluebird<U | R>;
|
||||
|
||||
/**
|
||||
* This extends `.catch` to work more like catch-clauses in languages like Java or C#.
|
||||
*
|
||||
* Instead of manually checking `instanceof` or `.name === "SomeError"`, you may specify a number of error constructors which are eligible for this catch handler.
|
||||
* The catch handler that is first met that has eligible constructors specified, is the one that will be called.
|
||||
*
|
||||
* This method also supports predicate-based filters. If you pass a predicate function instead of an error constructor, the predicate will receive the error as an argument.
|
||||
* The return result of the predicate will be used determine whether the error handler should be called.
|
||||
*
|
||||
* Alias `.caught();` for compatibility with earlier ECMAScript version.
|
||||
*/
|
||||
caught<E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error, E5 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1),
|
||||
filter2: (new (...args: any[]) => E2),
|
||||
filter3: (new (...args: any[]) => E3),
|
||||
filter4: (new (...args: any[]) => E4),
|
||||
filter5: (new (...args: any[]) => E5),
|
||||
onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike<R>,
|
||||
): Bluebird<R>;
|
||||
caught<E1, E2, E3, E4, E5>(
|
||||
filter1: ((error: E1) => boolean) | (E1 & object),
|
||||
filter2: ((error: E2) => boolean) | (E2 & object),
|
||||
filter3: ((error: E3) => boolean) | (E3 & object),
|
||||
filter4: ((error: E4) => boolean) | (E4 & object),
|
||||
filter5: ((error: E5) => boolean) | (E5 & object),
|
||||
onReject: (error: E1 | E2 | E3 | E4 | E5) => R | PromiseLike<R>,
|
||||
): Bluebird<R>;
|
||||
caught<U, E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error, E5 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1),
|
||||
filter2: (new (...args: any[]) => E2),
|
||||
filter3: (new (...args: any[]) => E3),
|
||||
filter4: (new (...args: any[]) => E4),
|
||||
filter5: (new (...args: any[]) => E5),
|
||||
onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
caught<U, E1, E2, E3, E4, E5>(
|
||||
filter1: ((error: E1) => boolean) | (E1 & object),
|
||||
filter2: ((error: E2) => boolean) | (E2 & object),
|
||||
filter3: ((error: E3) => boolean) | (E3 & object),
|
||||
filter4: ((error: E4) => boolean) | (E4 & object),
|
||||
filter5: ((error: E5) => boolean) | (E5 & object),
|
||||
onReject: (error: E1 | E2 | E3 | E4 | E5) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
|
||||
caught<E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1),
|
||||
filter2: (new (...args: any[]) => E2),
|
||||
filter3: (new (...args: any[]) => E3),
|
||||
filter4: (new (...args: any[]) => E4),
|
||||
onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike<R>,
|
||||
): Bluebird<R>;
|
||||
caught<E1, E2, E3, E4>(
|
||||
filter1: ((error: E1) => boolean) | (E1 & object),
|
||||
filter2: ((error: E2) => boolean) | (E2 & object),
|
||||
filter3: ((error: E3) => boolean) | (E3 & object),
|
||||
filter4: ((error: E4) => boolean) | (E4 & object),
|
||||
onReject: (error: E1 | E2 | E3 | E4) => R | PromiseLike<R>,
|
||||
): Bluebird<R>;
|
||||
caught<U, E1 extends Error, E2 extends Error, E3 extends Error, E4 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1),
|
||||
filter2: (new (...args: any[]) => E2),
|
||||
filter3: (new (...args: any[]) => E3),
|
||||
filter4: (new (...args: any[]) => E4),
|
||||
onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
caught<U, E1, E2, E3, E4>(
|
||||
filter1: ((error: E1) => boolean) | (E1 & object),
|
||||
filter2: ((error: E2) => boolean) | (E2 & object),
|
||||
filter3: ((error: E3) => boolean) | (E3 & object),
|
||||
filter4: ((error: E4) => boolean) | (E4 & object),
|
||||
onReject: (error: E1 | E2 | E3 | E4) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
|
||||
caught<E1 extends Error, E2 extends Error, E3 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1),
|
||||
filter2: (new (...args: any[]) => E2),
|
||||
filter3: (new (...args: any[]) => E3),
|
||||
onReject: (error: E1 | E2 | E3) => R | PromiseLike<R>,
|
||||
): Bluebird<R>;
|
||||
caught<E1, E2, E3>(
|
||||
filter1: ((error: E1) => boolean) | (E1 & object),
|
||||
filter2: ((error: E2) => boolean) | (E2 & object),
|
||||
filter3: ((error: E3) => boolean) | (E3 & object),
|
||||
onReject: (error: E1 | E2 | E3) => R | PromiseLike<R>,
|
||||
): Bluebird<R>;
|
||||
caught<U, E1 extends Error, E2 extends Error, E3 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1),
|
||||
filter2: (new (...args: any[]) => E2),
|
||||
filter3: (new (...args: any[]) => E3),
|
||||
onReject: (error: E1 | E2 | E3) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
caught<U, E1, E2, E3>(
|
||||
filter1: ((error: E1) => boolean) | (E1 & object),
|
||||
filter2: ((error: E2) => boolean) | (E2 & object),
|
||||
filter3: ((error: E3) => boolean) | (E3 & object),
|
||||
onReject: (error: E1 | E2 | E3) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
|
||||
caught<E1 extends Error, E2 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1),
|
||||
filter2: (new (...args: any[]) => E2),
|
||||
onReject: (error: E1 | E2) => R | PromiseLike<R>,
|
||||
): Bluebird<R>;
|
||||
caught<E1, E2>(
|
||||
filter1: ((error: E1) => boolean) | (E1 & object),
|
||||
filter2: ((error: E2) => boolean) | (E2 & object),
|
||||
onReject: (error: E1 | E2) => R | PromiseLike<R>,
|
||||
): Bluebird<R>;
|
||||
caught<U, E1 extends Error, E2 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1),
|
||||
filter2: (new (...args: any[]) => E2),
|
||||
onReject: (error: E1 | E2) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
caught<U, E1, E2>(
|
||||
filter1: ((error: E1) => boolean) | (E1 & object),
|
||||
filter2: ((error: E2) => boolean) | (E2 & object),
|
||||
onReject: (error: E1 | E2) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
|
||||
caught<E1 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1),
|
||||
onReject: (error: E1) => R | PromiseLike<R>,
|
||||
): Bluebird<R>;
|
||||
caught<E1>(
|
||||
filter1: ((error: E1) => boolean) | (E1 & object),
|
||||
onReject: (error: E1) => R | PromiseLike<R>,
|
||||
): Bluebird<R>;
|
||||
caught<U, E1 extends Error>(
|
||||
filter1: (new (...args: any[]) => E1),
|
||||
onReject: (error: E1) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
caught<U, E1>(
|
||||
filter1: ((error: E1) => boolean) | (E1 & object),
|
||||
onReject: (error: E1) => U | PromiseLike<U>,
|
||||
): Bluebird<U | R>;
|
||||
caught: Bluebird<R>["catch"];
|
||||
|
||||
/**
|
||||
* Like `.catch` but instead of catching all types of exceptions, it only catches those that don't originate from thrown errors but rather from explicit rejections.
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
bowser.msedge; // $ExpectType boolean
|
||||
bowser.test(['msie']); // $ExpectType boolean
|
||||
bowser.a === bowser.c;
|
||||
bowser.osversion > 10;
|
||||
bowser.osversion === '10.1A';
|
||||
bowser.compareVersions(['9.0', '10']);
|
||||
|
||||
bowser().android; // $ExpectType boolean
|
||||
bowser().x; // $ExpectType boolean
|
||||
bowser.check({msie: "11"}, window.navigator.userAgent);
|
||||
bowser.isUnsupportedBrowser({msie: "10"}, window.navigator.userAgent);
|
||||
101
types/bowser/index.d.ts
vendored
101
types/bowser/index.d.ts
vendored
@@ -1,101 +0,0 @@
|
||||
// Type definitions for Bowser 1.x
|
||||
// Project: https://github.com/ded/bowser
|
||||
// Definitions by: Paulo Cesar <https://github.com/pocesar>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare const bowser: bowser.IBowser;
|
||||
export = bowser;
|
||||
export as namespace bowser;
|
||||
|
||||
declare namespace bowser {
|
||||
interface IBowserOS {
|
||||
mac: boolean;
|
||||
/** other than Windows Phone */
|
||||
windows: boolean;
|
||||
windowsphone: boolean;
|
||||
/** other than android, chromeos, webos, tizen, and sailfish */
|
||||
linux: boolean;
|
||||
chromeos: boolean;
|
||||
android: boolean;
|
||||
/** also sets one of iphone/ipad/ipod */
|
||||
ios: boolean;
|
||||
blackberry: boolean;
|
||||
firefoxos: boolean;
|
||||
/** may also set touchpad */
|
||||
webos: boolean;
|
||||
bada: boolean;
|
||||
tizen: boolean;
|
||||
sailfish: boolean;
|
||||
}
|
||||
|
||||
interface IBowserVersions {
|
||||
chrome: boolean;
|
||||
firefox: boolean;
|
||||
msie: boolean;
|
||||
msedge: boolean;
|
||||
safari: boolean;
|
||||
android: boolean;
|
||||
ios: boolean;
|
||||
opera: boolean;
|
||||
phantom: boolean;
|
||||
blackberry: boolean;
|
||||
webos: boolean;
|
||||
silk: boolean;
|
||||
bada: boolean;
|
||||
tizen: boolean;
|
||||
seamonkey: boolean;
|
||||
sailfish: boolean;
|
||||
ucbrowser: boolean;
|
||||
qupzilla: boolean;
|
||||
vivaldi: boolean;
|
||||
sleipnir: boolean;
|
||||
kMeleon: boolean;
|
||||
}
|
||||
|
||||
interface IBowserEngines {
|
||||
/** IE <= 11 */
|
||||
msie: boolean;
|
||||
/** Chrome 0-27, Android <4.4, iOs, BB, etc. */
|
||||
webkit: boolean;
|
||||
/** Chrome >=28, Android >=4.4, Opera, etc. */
|
||||
blink: boolean;
|
||||
/** Firefox, etc. */
|
||||
gecko: boolean;
|
||||
/** IE > 11 */
|
||||
msedge: boolean;
|
||||
/** If a tablet device is detected, the flag tablet is set instead of mobile. */
|
||||
tablet: boolean;
|
||||
/** All detected mobile OSes are additionally flagged mobile, unless it's a tablet */
|
||||
mobile: boolean;
|
||||
}
|
||||
|
||||
interface IBowserGrade {
|
||||
/** Grade A browser */
|
||||
a: boolean;
|
||||
/** Grade C browser */
|
||||
c: boolean;
|
||||
/** Grade X browser */
|
||||
x: boolean;
|
||||
/** A human readable name for this browser. E.g. 'Chrome', '' */
|
||||
name: string;
|
||||
/** Version number for the browser. E.g. '32.0' */
|
||||
version: string | number;
|
||||
osversion: string | number;
|
||||
}
|
||||
|
||||
interface IBowserDetection extends IBowserGrade, IBowserEngines, IBowserOS, IBowserVersions { }
|
||||
|
||||
interface IBowserMinVersions {
|
||||
// { msie: "11", "firefox": "4" }
|
||||
[index: string]: string;
|
||||
}
|
||||
|
||||
interface IBowser extends IBowserDetection {
|
||||
(): IBowserDetection;
|
||||
test(browserList: string[]): boolean;
|
||||
_detect(ua: string): IBowser;
|
||||
compareVersions(versions: string[]): number;
|
||||
check(minVersions: IBowserMinVersions, strictMode?: boolean | string, ua?: string): boolean;
|
||||
isUnsupportedBrowser(minVersions: IBowserMinVersions, strictMode?: boolean | string, ua?: string): boolean;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// TODO
|
||||
"interface-name": false
|
||||
}
|
||||
}
|
||||
10
types/braces/braces-tests.ts
Normal file
10
types/braces/braces-tests.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import braces = require("braces");
|
||||
|
||||
const bracesOpts: braces.Options = {
|
||||
expand: true,
|
||||
};
|
||||
|
||||
let strArrResult: string[];
|
||||
|
||||
strArrResult = braces.expand('a/{x,y,z}/b');
|
||||
strArrResult = braces('a/{x,y,z}/b', bracesOpts);
|
||||
110
types/braces/index.d.ts
vendored
Normal file
110
types/braces/index.d.ts
vendored
Normal file
@@ -0,0 +1,110 @@
|
||||
// Type definitions for braces 2.3
|
||||
// Project: https://github.com/micromatch/braces
|
||||
// Definitions by: vemoo <https://github.com/vemoo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace braces {
|
||||
interface Options {
|
||||
/**
|
||||
* Generate an "expanded" brace pattern (this option is unncessary with the `.expand` method, which does the same thing).
|
||||
*
|
||||
* ```js
|
||||
* console.log(braces('a/{b,c}/d', {expand: true}));
|
||||
* //=> [ 'a/b/d', 'a/c/d' ]
|
||||
* ```
|
||||
*
|
||||
* @default undefined
|
||||
*/
|
||||
expand?: boolean;
|
||||
/**
|
||||
* Enabled by default.
|
||||
*
|
||||
* ```js
|
||||
* console.log(braces('a/{b,c}/d'));
|
||||
* //=> [ 'a/(b|c)/d' ]
|
||||
* ```
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
optimize?: boolean;
|
||||
/**
|
||||
* Duplicates are removed by default. To keep duplicates, pass `{nodupes: false}` on the options
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
nodupes?: boolean;
|
||||
/**
|
||||
* When `braces.expand()` is used, or `options.expand` is true, brace patterns will automatically be [optimized](#optionsoptimize)
|
||||
* when the difference between the range minimum and range maximum exceeds the `rangeLimit`.
|
||||
* This is to prevent huge ranges from freezing your application.
|
||||
*
|
||||
* You can set this to any number, or change `options.rangeLimit` to `Inifinity` to disable this altogether.
|
||||
*
|
||||
* @default 250
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* // pattern exceeds the "rangeLimit", so it's optimized automatically
|
||||
* console.log(braces.expand('{1..1000}'));
|
||||
* //=> ['([1-9]|[1-9][0-9]{1,2}|1000)']
|
||||
*
|
||||
* // pattern does not exceed "rangeLimit", so it's NOT optimized
|
||||
* console.log(braces.expand('{1..100}'));
|
||||
* //=> ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11' ... '89', 90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '100']
|
||||
* ```
|
||||
*/
|
||||
rangeLimit?: number;
|
||||
/**
|
||||
* Customize range expansion.
|
||||
*
|
||||
* ```js
|
||||
* var range = braces.expand('x{a..e}y', {
|
||||
* transform: function(str) {
|
||||
* return 'foo' + str;
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* console.log(range);
|
||||
* //=> [ 'xfooay', 'xfooby', 'xfoocy', 'xfoody', 'xfooey' ]
|
||||
* ```
|
||||
*
|
||||
* @default undefined
|
||||
*/
|
||||
transform?: (str: string) => string;
|
||||
/**
|
||||
* In regular expressions, quanitifiers can be used to specify how many times a token can be repeated. For example, `a{1,3}` will match the letter `a` one to three times.
|
||||
*
|
||||
* Unfortunately, regex quantifiers happen to share the same syntax as [Bash lists](#lists)
|
||||
*
|
||||
* The `quantifiers` option tells braces to detect when [regex quantifiers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#quantifiers)
|
||||
* are defined in the given pattern, and not to try to expand them as lists.
|
||||
*
|
||||
* @default undefined
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* var braces = require('braces');
|
||||
* console.log(braces('a/b{1,3}/{x,y,z}'));
|
||||
* //=> [ 'a/b(1|3)/(x|y|z)' ]
|
||||
* console.log(braces('a/b{1,3}/{x,y,z}', {quantifiers: true}));
|
||||
* //=> [ 'a/b{1,3}/(x|y|z)' ]
|
||||
* console.log(braces('a/b{1,3}/{x,y,z}', {quantifiers: true, expand: true}));
|
||||
* //=> [ 'a/b{1,3}/x', 'a/b{1,3}/y', 'a/b{1,3}/z' ]
|
||||
* ```
|
||||
*/
|
||||
quantifiers?: boolean;
|
||||
/**
|
||||
* Strip backslashes that were used for escaping from the result.
|
||||
*
|
||||
* @default undefined
|
||||
*/
|
||||
unescape?: boolean;
|
||||
}
|
||||
}
|
||||
interface Braces {
|
||||
(pattern: string, options?: braces.Options): string[];
|
||||
expand(pattern: string): string[];
|
||||
}
|
||||
declare const braces: Braces;
|
||||
export as namespace braces;
|
||||
export = braces;
|
||||
@@ -18,6 +18,6 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"jimp-tests.ts"
|
||||
"braces-tests.ts"
|
||||
]
|
||||
}
|
||||
3
types/braces/tslint.json
Normal file
3
types/braces/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
@@ -9,6 +9,11 @@
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"paths": {
|
||||
"micromatch": [
|
||||
"micromatch/v2"
|
||||
]
|
||||
},
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
// Chunker
|
||||
|
||||
let chunker = new Chunker(1337, Uint8Array.of(1, 2, 3), 2);
|
||||
for (const chunk of chunker) {
|
||||
// Do smoething with chunk
|
||||
}
|
||||
while (chunker.hasNext) {
|
||||
const chunk = chunker.next().value;
|
||||
}
|
||||
|
||||
// Unchunker
|
||||
|
||||
let unchunker = new Unchunker();
|
||||
unchunker.onMessage = (message: Uint8Array, context: any[]) => {
|
||||
// Do something with the received message
|
||||
};
|
||||
let chunk = Uint8Array.of(1, 2).buffer;
|
||||
unchunker.add(chunk);
|
||||
unchunker.gc(1024);
|
||||
53
types/chunked-dc/index.d.ts
vendored
53
types/chunked-dc/index.d.ts
vendored
@@ -1,53 +0,0 @@
|
||||
// Type definitions for chunked-dc 0.1
|
||||
// Project: https://github.com/saltyrtc/chunked-dc-js
|
||||
// Definitions by: Danilo Bargen <https://github.com/dbrgn>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// Interfaces
|
||||
declare namespace chunkedDc {
|
||||
/** common.ts */
|
||||
|
||||
interface CommonStatic {
|
||||
HEADER_LENGTH: number;
|
||||
}
|
||||
|
||||
/** chunker.ts */
|
||||
|
||||
interface Chunker extends IterableIterator<Uint8Array> {
|
||||
hasNext: boolean;
|
||||
next(): IteratorResult<Uint8Array>;
|
||||
[Symbol.iterator](): IterableIterator<Uint8Array>;
|
||||
}
|
||||
|
||||
interface ChunkerStatic {
|
||||
new(id: number, message: Uint8Array, chunkSize: number): Chunker;
|
||||
}
|
||||
|
||||
/** unchunker.ts */
|
||||
|
||||
type MessageListener = (message: Uint8Array, context?: any) => void;
|
||||
|
||||
interface Unchunker {
|
||||
onMessage: MessageListener;
|
||||
add(chunk: ArrayBuffer, context?: any): void;
|
||||
gc(maxAge: number): number;
|
||||
}
|
||||
|
||||
interface UnchunkerStatic {
|
||||
new(): Unchunker;
|
||||
}
|
||||
|
||||
/** main.ts */
|
||||
|
||||
interface Standalone {
|
||||
Chunker: ChunkerStatic;
|
||||
Unchunker: UnchunkerStatic;
|
||||
}
|
||||
}
|
||||
|
||||
// Entry point for the packed ES5 version:
|
||||
declare var chunkedDc: chunkedDc.Standalone;
|
||||
|
||||
// Entry point for the ES2015 version:
|
||||
declare var Chunker: chunkedDc.ChunkerStatic;
|
||||
declare var Unchunker: chunkedDc.UnchunkerStatic;
|
||||
@@ -0,0 +1,16 @@
|
||||
const newsEventname = 'openNewsListPage';
|
||||
universalLinks.subscribe(newsEventname, onNewsListPageRequested);
|
||||
|
||||
function onNewsListPageRequested(eventData: universalLinks.EventData) {
|
||||
alert('Did launch application with news link: ' + eventData.url);
|
||||
}
|
||||
|
||||
universalLinks.unsubscribe('openNewsListPage');
|
||||
|
||||
universalLinks.subscribe(null, onOtherLinkRequested);
|
||||
|
||||
function onOtherLinkRequested(eventData: universalLinks.EventData) {
|
||||
alert('Did launch application with other link: ' + eventData.url);
|
||||
}
|
||||
|
||||
universalLinks.unsubscribe(null);
|
||||
18
types/cordova-universal-links-plugin/index.d.ts
vendored
Normal file
18
types/cordova-universal-links-plugin/index.d.ts
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
// Type definitions for cordova-universal-links-plugin 1.2
|
||||
// Project: https://github.com/nordnet/cordova-universal-links-plugin#readme
|
||||
// Definitions by: David Broder-Rodgers <https://github.com/broder>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace universalLinks {
|
||||
function subscribe(eventName: string | null, callback: (data: EventData) => void): void;
|
||||
function unsubscribe(eventName: string | null): void;
|
||||
|
||||
interface EventData {
|
||||
url: string;
|
||||
scheme: string;
|
||||
host: string;
|
||||
path: string;
|
||||
params: { [key: string]: string };
|
||||
hash: string;
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,6 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"react-native-google-analytics-bridge-tests.ts"
|
||||
"cordova-universal-links-plugin-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
3
types/cordova-universal-links-plugin/tslint.json
Normal file
3
types/cordova-universal-links-plugin/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
// Samples taken from the cypress kitchen sink example (https://github.com/cypress-io/cypress-example-kitchensink)
|
||||
cy.title().should('include', 'Kitchen Sink');
|
||||
|
||||
cy
|
||||
.get('.query-list')
|
||||
.contains('bananas').should('have.class', 'third')
|
||||
.contains(/^b\w+/).should('have.class', 'third')
|
||||
.get('.query-list')
|
||||
.contains('apples').should('have.class', 'first')
|
||||
.get('#querying')
|
||||
.contains('ul', 'oranges').should('have.class', 'query-list')
|
||||
.get('.query-button')
|
||||
.contains('Save Form').should('have.class', 'btn')
|
||||
.trigger('mousemove', {clientX: 100, clientY: 200});
|
||||
|
||||
cy.location('host');
|
||||
|
||||
cy
|
||||
.get('form')
|
||||
.find('input')
|
||||
.then($input => $input.click())
|
||||
.then($input => $input.click(), {timeout: 12});
|
||||
|
||||
cy
|
||||
.wrap({ sum: (a: number, b: number, c: number) => a + b + c })
|
||||
.invoke('sum', 2, 4, 6);
|
||||
|
||||
cy
|
||||
.get('ul>li')
|
||||
.each(($el, index, $list) => {
|
||||
// $el is wrapped jquery element
|
||||
if ($el.someMethod() === "something") {
|
||||
// wrap this element so we can
|
||||
// use cypress commands on it
|
||||
cy.wrap($el).click();
|
||||
} else {
|
||||
// do something else
|
||||
}
|
||||
})
|
||||
.spread((x , y, z) => {
|
||||
x + y + z;
|
||||
});
|
||||
|
||||
cy.log('end');
|
||||
563
types/cypress/index.d.ts
vendored
563
types/cypress/index.d.ts
vendored
@@ -1,563 +0,0 @@
|
||||
// Type definitions for cypress 0.1
|
||||
// Project: https://cypress.io
|
||||
// Definitions by: Gert Hengeveld <https://github.com/ghengeveld>
|
||||
// Mike Woudenberg <https://github.com/mikewoudenberg>
|
||||
// Robbert van Markus <https://github.com/rvanmarkus>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
declare namespace Cypress {
|
||||
type FileContents = string | any[] | object;
|
||||
type HistoryDirection = "back" | "forward";
|
||||
type HttpMethod = "GET" | "POST" | "PUT" | "DELETE" | "OPTIONS" | "HEAD" | "TRACE" | "CONNECT";
|
||||
type RequestBody = string | object;
|
||||
type ViewportOrientation = "portrait" | "landscape";
|
||||
|
||||
interface Core {
|
||||
/**
|
||||
* @see https://on.cypress.io/api/config
|
||||
*/
|
||||
config(): object;
|
||||
config(key: string): any;
|
||||
config(key: string, value: any): void;
|
||||
config(Object: object): void;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/env
|
||||
*/
|
||||
env(): object;
|
||||
env(key: string): any;
|
||||
env(key: string, value: any): void;
|
||||
env(Object: object): void;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/commands
|
||||
*/
|
||||
addChildCommand(name: string, fn: (...args: any[]) => void): void;
|
||||
addDualCommand(name: string, fn: (...args: any[]) => void): void;
|
||||
addParentCommand(name: string, fn: (...args: any[]) => void): void;
|
||||
|
||||
_: any;
|
||||
$: any;
|
||||
minimatch: any;
|
||||
moment: any;
|
||||
Blob: any;
|
||||
Promise: any;
|
||||
Log: any;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/cookies
|
||||
*/
|
||||
Cookies: {
|
||||
debug(enabled: boolean, options?: DebugOptions): void;
|
||||
preserveOnce(...names: string[]): void;
|
||||
defaults(options: CookieDefaults): void;
|
||||
};
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/dom
|
||||
*/
|
||||
Dom: {
|
||||
isHidden(element: object): boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/api-server
|
||||
*/
|
||||
Server: {
|
||||
defaults(options: ServerOptions): void;
|
||||
};
|
||||
}
|
||||
|
||||
interface Chainable {
|
||||
/**
|
||||
* @see https://on.cypress.io/api/and
|
||||
*/
|
||||
and(chainers: string, value?: any): Chainable;
|
||||
and(chainers: string, method: string, value: any): Chainable;
|
||||
and(fn: (currentSubject?: any) => void): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/as
|
||||
*/
|
||||
as(alias: string): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/blur
|
||||
*/
|
||||
blur(options?: BlurOptions): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/check
|
||||
*/
|
||||
check(options?: CheckOptions): Chainable;
|
||||
check(value: string|string[]): Chainable; // no options
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/children
|
||||
*/
|
||||
children(options?: LoggableTimeoutable): Chainable;
|
||||
children(selector: string, options?: LoggableTimeoutable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/clear
|
||||
*/
|
||||
clear(options?: ClearOptions): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/clearcookie
|
||||
*/
|
||||
clearCookie(name: string, options?: LoggableTimeoutable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/clearcookies
|
||||
*/
|
||||
clearCookies(options?: LoggableTimeoutable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/clearlocalstorage
|
||||
*/
|
||||
clearLocalStorage(key?: string): Chainable;
|
||||
clearLocalStorage(re: RegExp): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/click
|
||||
*/
|
||||
click(options?: ClickOptions): Chainable;
|
||||
click(position: string, options?: ClickOptions): Chainable;
|
||||
click(x: number, y: number, options?: ClickOptions): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/closest
|
||||
*/
|
||||
closest(selector: string, options?: LoggableTimeoutable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/contains
|
||||
*/
|
||||
contains(text: string, options?: LoggableTimeoutable): Chainable;
|
||||
contains(num: number|RegExp): Chainable;
|
||||
contains(selector: string, text: string, options?: LoggableTimeoutable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/dblclick
|
||||
*/
|
||||
dblclick(options?: Loggable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/debug
|
||||
*/
|
||||
debug(options?: Loggable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/document
|
||||
*/
|
||||
document(options?: Loggable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/each
|
||||
*/
|
||||
each(fn: (element?: any, index?: number, $list?: any) => void): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/end
|
||||
*/
|
||||
end(): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/eq
|
||||
*/
|
||||
eq(index: number, options?: LoggableTimeoutable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/exec
|
||||
*/
|
||||
exec(command: string, options?: ExecOptions): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/filter
|
||||
*/
|
||||
filter(selector: string, options?: LoggableTimeoutable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/find
|
||||
*/
|
||||
find(selector: string, options?: LoggableTimeoutable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/first
|
||||
*/
|
||||
first(options?: LoggableTimeoutable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/fixture
|
||||
*/
|
||||
fixture(path: string, options?: Timeoutable): Chainable; // no log?
|
||||
fixture(path: string, encoding: string, options?: Timeoutable): Chainable; // no log?
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/focus
|
||||
*/
|
||||
focus(options?: Loggable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/focused
|
||||
*/
|
||||
focused(options?: Loggable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/get
|
||||
*/
|
||||
get(selector: string, options?: LoggableTimeoutable): Chainable;
|
||||
get(alias: string, options?: LoggableTimeoutable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/getcookie
|
||||
*/
|
||||
getCookie(name: string, options?: LoggableTimeoutable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/getcookies
|
||||
*/
|
||||
getCookies(options?: LoggableTimeoutable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/go
|
||||
*/
|
||||
go(direction: HistoryDirection|number, options?: LoggableTimeoutable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/hash
|
||||
*/
|
||||
hash(options?: Loggable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/invoke
|
||||
*/
|
||||
invoke(functionName: string, ...args: any[]): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/its
|
||||
*/
|
||||
its(propertyName: string): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/last
|
||||
*/
|
||||
last(options?: LoggableTimeoutable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/location
|
||||
*/
|
||||
location(options?: LoggableTimeoutable): Chainable;
|
||||
location(key: string, options?: LoggableTimeoutable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/log
|
||||
*/
|
||||
log(message: string, args?: any): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/next
|
||||
*/
|
||||
next(options?: LoggableTimeoutable): Chainable;
|
||||
next(selector: string, options?: LoggableTimeoutable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/not
|
||||
*/
|
||||
not(selector: string, options?: LoggableTimeoutable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/parent
|
||||
*/
|
||||
parent(options?: LoggableTimeoutable): Chainable;
|
||||
parent(selector: string, options?: LoggableTimeoutable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/parents
|
||||
*/
|
||||
parents(options?: LoggableTimeoutable): Chainable;
|
||||
parents(selector: string, options?: LoggableTimeoutable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/pause
|
||||
*/
|
||||
pause(options?: Loggable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/prev
|
||||
*/
|
||||
prev(options?: LoggableTimeoutable): Chainable;
|
||||
prev(selector: string, options?: LoggableTimeoutable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/readfile
|
||||
*/
|
||||
readFile(filePath: string, options?: Timeoutable): Chainable; // no log?
|
||||
readFile(filePath: string, encoding: string, options?: Timeoutable): Chainable; // no log?
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/reload
|
||||
*/
|
||||
reload(options?: LoggableTimeoutable): Chainable;
|
||||
reload(forceReload: boolean): Chainable; // no options?
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/request
|
||||
*/
|
||||
request(url: string, body?: RequestBody): Chainable;
|
||||
request(method: HttpMethod, url: string, body?: RequestBody): Chainable;
|
||||
request(options: RequestOptions): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/root
|
||||
*/
|
||||
root(options?: Loggable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/route
|
||||
*/
|
||||
route(url: string | RegExp, response?: any): Chainable;
|
||||
route(method: string, url: string | RegExp, response?: any): Chainable;
|
||||
route(fn: (() => RouteOptions) | RouteOptions): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/screenshot
|
||||
*/
|
||||
screenshot(options?: LoggableTimeoutable): Chainable;
|
||||
screenshot(fileName: string, options?: LoggableTimeoutable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/select
|
||||
*/
|
||||
select(text: string|string[], options?: SelectOptions): Chainable;
|
||||
select(value: string|string[], options?: SelectOptions): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/server
|
||||
*/
|
||||
server(options?: ServerOptions): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/setcookie
|
||||
*/
|
||||
setCookie(name: string, value: string, options?: SetCookieOptions): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/should
|
||||
*/
|
||||
should(chainers: string, value?: any): Chainable;
|
||||
should(chainers: string, method: string, value: any): Chainable;
|
||||
should(fn: (currentSubject?: any) => void): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/siblings
|
||||
*/
|
||||
siblings(options?: LoggableTimeoutable): Chainable;
|
||||
siblings(selector: string, options?: LoggableTimeoutable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/spread
|
||||
*/
|
||||
spread(fn: (...args: any[]) => any): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/submit
|
||||
*/
|
||||
submit(options?: Loggable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/then
|
||||
*/
|
||||
then(fn: (currentSubject: any) => any, options?: Timeoutable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/title
|
||||
*/
|
||||
title(options?: Loggable): Chainable;
|
||||
|
||||
/**
|
||||
* @description Trigger an event on a DOM element.
|
||||
* @see https://docs.cypress.io/api/commands/trigger.html
|
||||
*/
|
||||
trigger(eventName: string, position?: PositionType, x?: number, y?: number, options?: TriggerOptions): Chainable;
|
||||
trigger(eventName: string, eventObject: object): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/type
|
||||
*/
|
||||
type(text: string, options?: TypeOptions): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/uncheck
|
||||
*/
|
||||
uncheck(options?: CheckOptions): Chainable;
|
||||
uncheck(values: string[]): Chainable; // no options? missing single value variant
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/url
|
||||
*/
|
||||
url(options?: Loggable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/viewport
|
||||
*/
|
||||
viewport(width: number, height: number, options?: Loggable): Chainable;
|
||||
viewport(preset: string, orientation: ViewportOrientation, options?: Loggable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/visit
|
||||
*/
|
||||
visit(url: string, options?: VisitOptions): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/wait
|
||||
*/
|
||||
wait(ms: number|string[]): Chainable; // no options?
|
||||
wait(alias: string, options?: LoggableTimeoutable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/window
|
||||
*/
|
||||
window(options?: Loggable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/within
|
||||
*/
|
||||
within(fn: (currentSubject?: any) => void): Chainable;
|
||||
within(options: Loggable, fn: (currentSubject?: any) => void): Chainable; // inconsistent argument order
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/wrap
|
||||
*/
|
||||
wrap(Object: object, options?: Loggable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/writefile
|
||||
*/
|
||||
writeFile(filePath: string, contents: FileContents, options?: Timeoutable): Chainable;
|
||||
writeFile(filePath: string, contents: FileContents, encoding: string, options?: Timeoutable): Chainable;
|
||||
}
|
||||
|
||||
interface DebugOptions {
|
||||
verbose?: boolean;
|
||||
}
|
||||
|
||||
interface CookieDefaults {
|
||||
whitelist?: string | string[] | RegExp | ((cookie: any) => boolean);
|
||||
}
|
||||
|
||||
interface Loggable {
|
||||
log?: boolean;
|
||||
}
|
||||
|
||||
interface Timeoutable {
|
||||
timeout?: number;
|
||||
}
|
||||
|
||||
interface LoggableTimeoutable extends Loggable, Timeoutable {}
|
||||
|
||||
interface BlurOptions extends Loggable {
|
||||
force?: boolean;
|
||||
}
|
||||
|
||||
interface CheckOptions extends Loggable, Timeoutable {
|
||||
interval?: number;
|
||||
force?: boolean;
|
||||
}
|
||||
|
||||
interface ClearOptions extends Loggable, Timeoutable {
|
||||
force?: boolean;
|
||||
interval?: number;
|
||||
}
|
||||
|
||||
interface ClickOptions extends Loggable, Timeoutable {
|
||||
force?: boolean;
|
||||
multiple?: boolean;
|
||||
interval?: number;
|
||||
}
|
||||
|
||||
interface ExecOptions extends Loggable, Timeoutable {
|
||||
failOnNonZeroExit?: boolean;
|
||||
env?: object;
|
||||
}
|
||||
|
||||
interface RequestOptions extends Loggable, Timeoutable {
|
||||
auth?: object;
|
||||
body?: RequestBody;
|
||||
failOnStatusCode?: boolean;
|
||||
followRedirect?: boolean;
|
||||
form?: boolean;
|
||||
gzip?: boolean;
|
||||
headers?: object;
|
||||
method?: HttpMethod;
|
||||
qs?: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
interface RouteOptions {
|
||||
method?: HttpMethod;
|
||||
url?: string | RegExp;
|
||||
response?: any;
|
||||
status?: number;
|
||||
delay?: number;
|
||||
headers?: object;
|
||||
force404?: boolean;
|
||||
onRequest?(...args: any[]): void;
|
||||
onResponse?(...args: any[]): void;
|
||||
onAbort?(...args: any[]): void;
|
||||
}
|
||||
|
||||
interface SelectOptions extends Loggable, Timeoutable {
|
||||
force?: boolean;
|
||||
interval?: number;
|
||||
}
|
||||
|
||||
interface ServerOptions {
|
||||
delay?: number;
|
||||
method?: HttpMethod;
|
||||
status?: number;
|
||||
headers?: object;
|
||||
response?: any;
|
||||
onRequest?(...args: any[]): void;
|
||||
onResponse?(...args: any[]): void;
|
||||
onAbort?(...args: any[]): void;
|
||||
enable?: boolean;
|
||||
force404?: boolean;
|
||||
urlMatchingOptions?: object;
|
||||
whitelist?(...args: any[]): void;
|
||||
}
|
||||
|
||||
interface SetCookieOptions extends Loggable, Timeoutable {
|
||||
path?: string;
|
||||
domain?: string;
|
||||
secure?: boolean;
|
||||
httpOnly?: boolean;
|
||||
expiry?: number;
|
||||
}
|
||||
|
||||
interface TypeOptions extends Loggable, Timeoutable {
|
||||
delay?: number;
|
||||
force?: boolean;
|
||||
release?: boolean;
|
||||
interval?: number;
|
||||
}
|
||||
|
||||
interface VisitOptions extends Loggable, Timeoutable {
|
||||
onBeforeLoad?(args: any[]): void;
|
||||
onLoad?(args: any[]): void;
|
||||
}
|
||||
|
||||
interface TriggerOptions {
|
||||
log?: boolean;
|
||||
force?: boolean;
|
||||
bubbles?: boolean;
|
||||
cancable?: boolean;
|
||||
timeout?: number;
|
||||
}
|
||||
|
||||
type PositionType = "topLeft" | "top" | "topRight" | "left" | "center" | "right" | "bottomLeft" | "bottom" | "bottomRight";
|
||||
}
|
||||
|
||||
declare const cy: Cypress.Chainable;
|
||||
@@ -34,7 +34,7 @@ function tests_simple() {
|
||||
$('#demo').daterangepicker({
|
||||
"startDate": "05/06/2016",
|
||||
"endDate": "05/12/2016"
|
||||
}, function (start: string, end: string, label: string) {
|
||||
}, function (start: moment.Moment, end: moment.Moment, label: string) {
|
||||
console.log("New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')");
|
||||
});
|
||||
|
||||
|
||||
7
types/daterangepicker/index.d.ts
vendored
7
types/daterangepicker/index.d.ts
vendored
@@ -1,7 +1,8 @@
|
||||
// Type definitions for Date Range Picker v2.1.25
|
||||
// Type definitions for Date Range Picker v2.1.30
|
||||
// Project: http://www.daterangepicker.com/
|
||||
// Definitions by: SirMartin <https://github.com/SirMartin>
|
||||
// Steven Masala <https://github.com/smasala>
|
||||
// Grant Hutchins <https://github.com/nertzy>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
@@ -18,7 +19,7 @@ declare global {
|
||||
declare const daterangepicker: daterangepicker.DateRangePicker;
|
||||
|
||||
declare namespace daterangepicker {
|
||||
type DataRangePickerCallback = (start?: string | Date | moment.Moment, end?: string | Date | moment.Moment, label?: string) => any;
|
||||
type DataRangePickerCallback = (start: moment.Moment, end: moment.Moment, label: string | null) => any;
|
||||
|
||||
interface DateRangePicker {
|
||||
new (element: HTMLElement, settings?: daterangepicker.Settings, callback?: DataRangePickerCallback): DateRangePicker;
|
||||
@@ -26,7 +27,7 @@ declare namespace daterangepicker {
|
||||
startDate: moment.Moment;
|
||||
endDate: moment.Moment;
|
||||
container: JQuery;
|
||||
|
||||
|
||||
setStartDate(date: Date | moment.Moment | string): void;
|
||||
setEndDate(date: Date | moment.Moment | string): void;
|
||||
remove(): void;
|
||||
|
||||
@@ -1,401 +0,0 @@
|
||||
|
||||
var x = new Decimal(9)
|
||||
var y = new Decimal(x)
|
||||
|
||||
Decimal(435.345)
|
||||
|
||||
new Decimal('5032485723458348569331745.33434346346912144534543')
|
||||
new Decimal('4.321e+4')
|
||||
new Decimal('-735.0918e-430')
|
||||
new Decimal('5.6700000')
|
||||
new Decimal(Infinity)
|
||||
new Decimal(NaN)
|
||||
new Decimal('.5')
|
||||
new Decimal('+2')
|
||||
new Decimal(-10110100.1, 2)
|
||||
new Decimal('123412421.234324', 5)
|
||||
new Decimal('ff.8', 16)
|
||||
|
||||
Decimal.config({ precision: 5 })
|
||||
new Decimal(1.23456789)
|
||||
new Decimal(1.23456789, 10)
|
||||
|
||||
|
||||
Decimal.config({
|
||||
precision: 20,
|
||||
rounding: 4,
|
||||
toExpNeg: -7,
|
||||
toExpPos: 21,
|
||||
minE: -9e15,
|
||||
maxE: 9e15,
|
||||
errors: true,
|
||||
crypto: false,
|
||||
modulo: 1,
|
||||
format: {
|
||||
decimalSeparator: '.',
|
||||
groupSeparator: ',',
|
||||
groupSize: 3,
|
||||
secondaryGroupSize: 0,
|
||||
fractionGroupSeparator: '\xA0',
|
||||
fractionGroupSize: 0
|
||||
}
|
||||
});
|
||||
|
||||
Decimal.config({
|
||||
format: {
|
||||
|
||||
decimalSeparator: '.',
|
||||
|
||||
groupSeparator: ',',
|
||||
|
||||
groupSize: 3,
|
||||
|
||||
secondaryGroupSize: 0,
|
||||
|
||||
fractionGroupSeparator: ' ',
|
||||
|
||||
fractionGroupSize: 0
|
||||
}
|
||||
});
|
||||
Decimal.config({ rounding: Decimal.ROUND_CEIL })
|
||||
Decimal.config({ rounding: 2 })
|
||||
Decimal.rounding
|
||||
|
||||
x = new Decimal(1.3)
|
||||
x.ceil()
|
||||
y = new Decimal(-1.8)
|
||||
y.ceil()
|
||||
|
||||
x.comparedTo(y)
|
||||
x.comparedTo(x.minus(1))
|
||||
y.cmp(NaN)
|
||||
y.cmp('110', 2)
|
||||
|
||||
x.decimalPlaces()
|
||||
y.dp()
|
||||
|
||||
x.dividedBy(y)
|
||||
x.div(5)
|
||||
x.div(47, 16)
|
||||
|
||||
x.dividedToIntegerBy(y)
|
||||
x.divToInt(0.7)
|
||||
x.divToInt('0.f', 16)
|
||||
|
||||
x.equals('1e-324')
|
||||
new Decimal(-0).eq(x)
|
||||
new Decimal(255).eq('ff', 16)
|
||||
|
||||
y = new Decimal(NaN)
|
||||
y.equals(NaN)
|
||||
|
||||
x = new Decimal(1)
|
||||
x.exponential()
|
||||
y = new Decimal(2)
|
||||
y.exp()
|
||||
|
||||
x = new Decimal(1.8)
|
||||
x.floor()
|
||||
y = new Decimal(-1.3)
|
||||
y.floor()
|
||||
|
||||
x.greaterThan(Decimal(0.3).minus(0.2))
|
||||
new Decimal(0).gt(x)
|
||||
new Decimal(11, 3).gt(11.1, 2)
|
||||
|
||||
|
||||
x = new Decimal(0.3).minus(0.2)
|
||||
x.greaterThanOrEqualTo(0.1)
|
||||
new Decimal(1).gte(x)
|
||||
new Decimal(10, 18).gte('i', 36)
|
||||
|
||||
x = new Decimal(1)
|
||||
x.isFinite()
|
||||
y = new Decimal(Infinity)
|
||||
y.isFinite()
|
||||
|
||||
x = new Decimal(1)
|
||||
x.isInteger()
|
||||
y = new Decimal(123.456)
|
||||
y.isInt()
|
||||
|
||||
x = new Decimal(NaN)
|
||||
x.isNaN()
|
||||
y = new Decimal('Infinity')
|
||||
y.isNaN()
|
||||
|
||||
x = new Decimal(-0)
|
||||
x.isNegative()
|
||||
y = new Decimal(2)
|
||||
y.isNeg
|
||||
|
||||
x = new Decimal(-0)
|
||||
x.isZero() && x.isNeg()
|
||||
y = new Decimal(Infinity)
|
||||
y.isZero()
|
||||
|
||||
x.lessThan(0.1)
|
||||
new Decimal(0).lt(x)
|
||||
new Decimal(11.1, 2).lt(11, 3)
|
||||
|
||||
x.lessThan(0.1)
|
||||
new Decimal(0).lt(x)
|
||||
new Decimal(11.1, 2).lt(11, 3)
|
||||
|
||||
x = new Decimal(0.1)
|
||||
x.lessThanOrEqualTo(Decimal(0.3).minus(0.2))
|
||||
new Decimal(-1).lte(x)
|
||||
new Decimal(10, 18).lte('i', 36)
|
||||
|
||||
x = new Decimal(1000)
|
||||
x.logarithm()
|
||||
y = new Decimal(256)
|
||||
y.log(2)
|
||||
|
||||
x = new Decimal(0.3)
|
||||
x.minus(0.1)
|
||||
x.minus(0.6, 20)
|
||||
|
||||
x = new Decimal(1)
|
||||
x.modulo(0.9)
|
||||
|
||||
y = new Decimal(33)
|
||||
y.mod('a', 33)
|
||||
|
||||
x = new Decimal(8)
|
||||
y = new Decimal(-3)
|
||||
Decimal.modulo = 1
|
||||
x.mod(y)
|
||||
Decimal.modulo = 3
|
||||
x.mod(y)
|
||||
|
||||
x = new Decimal(10)
|
||||
x.naturalLogarithm()
|
||||
y = new Decimal('1.23e+30')
|
||||
y.ln()
|
||||
|
||||
x = new Decimal(1.8)
|
||||
x.negated()
|
||||
y = new Decimal(-1.3)
|
||||
y.neg()
|
||||
|
||||
x = new Decimal(0.1)
|
||||
y = x.plus(0.2)
|
||||
new Decimal(0.7).plus(x).plus(y)
|
||||
x.plus('0.1', 8)
|
||||
|
||||
x = new Decimal(1.234)
|
||||
x.precision()
|
||||
y = new Decimal(987000)
|
||||
y.sd()
|
||||
y.sd(true)
|
||||
|
||||
Decimal.config({ rounding: 4 })
|
||||
x.round()
|
||||
|
||||
Decimal.rounding = Decimal.ROUND_DOWN
|
||||
x.round()
|
||||
x
|
||||
|
||||
x = new Decimal(16)
|
||||
x.squareRoot()
|
||||
y = new Decimal(3)
|
||||
y.sqrt()
|
||||
y.sqrt().eq(y.pow(0.5))
|
||||
|
||||
x = new Decimal(0.6)
|
||||
y = x.times(3)
|
||||
new Decimal('7e+500').times(y)
|
||||
x.times('-a', 16)
|
||||
|
||||
x = new Decimal(12.24567)
|
||||
x.toDecimalPlaces(0)
|
||||
x.toDecimalPlaces(1, 0)
|
||||
|
||||
y = new Decimal(9876.54321)
|
||||
y.toDP(3)
|
||||
y.toDP(1, 0)
|
||||
y.toDP(1, Decimal.ROUND_DOWN)
|
||||
|
||||
y = new Decimal(x)
|
||||
x.toExponential()
|
||||
y.toExponential()
|
||||
x.toExponential(0)
|
||||
y.toExponential(0)
|
||||
x.toExponential(1)
|
||||
y.toExponential(1)
|
||||
y.toExponential(1, 1)
|
||||
x.toExponential(3)
|
||||
y.toExponential(3)
|
||||
|
||||
y = new Decimal(x)
|
||||
x.toFixed()
|
||||
y.toFixed()
|
||||
y.toFixed(0)
|
||||
x.toFixed(2)
|
||||
y.toFixed(2)
|
||||
y.toFixed(2, 1)
|
||||
x.toFixed(5)
|
||||
y.toFixed(5)
|
||||
|
||||
Decimal.config({
|
||||
format: {
|
||||
decimalSeparator: '.',
|
||||
groupSeparator: ',',
|
||||
groupSize: 3,
|
||||
secondaryGroupSize: 0,
|
||||
fractionGroupSeparator: ' ',
|
||||
fractionGroupSize: 0
|
||||
}
|
||||
});
|
||||
|
||||
x = new Decimal('123456789.123456789')
|
||||
x.toFormat()
|
||||
x.toFormat(1)
|
||||
|
||||
|
||||
Decimal.format.groupSeparator = ' ';
|
||||
Decimal.format.fractionGroupSize = 5;
|
||||
x.toFormat()
|
||||
|
||||
|
||||
Decimal.format = {
|
||||
decimalSeparator: ',',
|
||||
groupSeparator: '.',
|
||||
groupSize: 3,
|
||||
secondaryGroupSize: 2
|
||||
}
|
||||
|
||||
x.toFormat()
|
||||
|
||||
x.toFraction()
|
||||
|
||||
var pi = new Decimal('3.14159265358')
|
||||
pi.toFraction()
|
||||
pi.toFraction(100000)
|
||||
pi.toFraction(10000)
|
||||
pi.toFraction(100)
|
||||
pi.toFraction(10)
|
||||
pi.toFraction(1)
|
||||
|
||||
|
||||
|
||||
x = new Decimal('177.7e+457')
|
||||
y = new Decimal(235.4325)
|
||||
var z = new Decimal('0.0098074')
|
||||
|
||||
// Serialize an array of three Decimals
|
||||
var str = JSON.stringify([x, y, z])
|
||||
// "["1.777e+459","235.4325","0.0098074"]"
|
||||
|
||||
// Return an array of three Decimals
|
||||
JSON.parse(str, function(key, val) {
|
||||
return key === '' ? val : new Decimal(val)
|
||||
})
|
||||
|
||||
x = new Decimal(1.39)
|
||||
x.toNearest(0.25)
|
||||
|
||||
y = new Decimal(0.75)
|
||||
y.toNearest(0.5, 0)
|
||||
y.toNearest(0.5, 1)
|
||||
|
||||
x = new Decimal(456.789)
|
||||
x.toNumber()
|
||||
|
||||
y = new Decimal('45987349857634085409857349856430985')
|
||||
y.toNumber()
|
||||
|
||||
z = new Decimal(-0)
|
||||
1 / +z
|
||||
1 / z.toNumber()
|
||||
|
||||
Math.pow(0.7, 2)
|
||||
x = new Decimal(0.7)
|
||||
x.toPower(2)
|
||||
new Decimal(3).pow(-2)
|
||||
|
||||
new Decimal(1217652.23).pow('98765.489305603941')
|
||||
y = new Decimal(x)
|
||||
x.toPrecision()
|
||||
y.toPrecision()
|
||||
x.toPrecision(1)
|
||||
y.toPrecision(1)
|
||||
y.toPrecision(2, 0)
|
||||
y.toPrecision(2, 1)
|
||||
x.toPrecision(5)
|
||||
y.toPrecision(5)
|
||||
|
||||
Decimal.config({ precision: 5, rounding: 4 })
|
||||
x = new Decimal(9876.54321)
|
||||
|
||||
x.toSignificantDigits()
|
||||
x.toSignificantDigits(6)
|
||||
x.toSignificantDigits(6, Decimal.ROUND_UP)
|
||||
x.toSD(2)
|
||||
x.toSD(2, 1)
|
||||
|
||||
x = new Decimal(750000)
|
||||
x.toString()
|
||||
Decimal.config({ toExpPos: 5 })
|
||||
x.toString()
|
||||
|
||||
y = new Decimal(362.875)
|
||||
y.toString(2)
|
||||
y.toString(9)
|
||||
y.toString(32)
|
||||
|
||||
Decimal.config({ precision: 4 });
|
||||
z = new Decimal('1.23456789')
|
||||
z.toString()
|
||||
z.toString(10)
|
||||
|
||||
x = new Decimal(123.456)
|
||||
x.truncated()
|
||||
y = new Decimal(-12.3)
|
||||
y.trunc()
|
||||
|
||||
x = new Decimal('1.777e+457')
|
||||
x.valueOf()
|
||||
|
||||
x = Decimal.exp(3)
|
||||
y = new Decimal(3).exp()
|
||||
x.equals(y)
|
||||
|
||||
x = Decimal.ln(4.321)
|
||||
y = new Decimal(4.321).ln()
|
||||
x.equals(y)
|
||||
|
||||
x = Decimal.log(100, 2.5)
|
||||
y = new Decimal(100).log(2.5)
|
||||
x.equals(y)
|
||||
|
||||
x = new Decimal('3257869345.0378653')
|
||||
Decimal.max(4e9, x, '123456789.9')
|
||||
|
||||
var arr = [12, '13', new Decimal(14)]
|
||||
Decimal.max(arr)
|
||||
|
||||
x = new Decimal('3257869345.0378653')
|
||||
Decimal.min(4e9, x, '123456789.9')
|
||||
|
||||
arr = [2, new Decimal(-14), '-15.9999', -12]
|
||||
Decimal.min(arr)
|
||||
|
||||
x = new Decimal(2)
|
||||
var D = Decimal.noConflict()
|
||||
Decimal
|
||||
y = new D(3)
|
||||
|
||||
x = Decimal.pow(3257.4, 17.01)
|
||||
y = new Decimal(3257.4).pow(17.01)
|
||||
x.equals(y)
|
||||
|
||||
Decimal.config({ precision: 10 })
|
||||
Decimal.random()
|
||||
|
||||
Decimal.random(20)
|
||||
|
||||
x = Decimal.sqrt('987654321.123456789')
|
||||
y = new Decimal('987654321.123456789').sqrt()
|
||||
x.equals(y)
|
||||
767
types/decimal.js/index.d.ts
vendored
767
types/decimal.js/index.d.ts
vendored
@@ -1,767 +0,0 @@
|
||||
// Type definitions for decimal.js
|
||||
// Project: http://mikemcl.github.io/decimal.js
|
||||
// Definitions by: Joseph Rossi <https://github.com/musicist288>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare var Decimal: decimal.IDecimalStatic;
|
||||
|
||||
// Support AMD require
|
||||
declare module 'decimal.js' {
|
||||
export = Decimal;
|
||||
}
|
||||
|
||||
declare namespace decimal {
|
||||
|
||||
enum RoundingMode {
|
||||
/**
|
||||
* Rounds away from zero
|
||||
*/
|
||||
ROUND_UP = 0,
|
||||
|
||||
/**
|
||||
* Rounds towards zero
|
||||
*/
|
||||
ROUND_DOWN = 1,
|
||||
|
||||
/**
|
||||
* Rounds towards Infinity
|
||||
*/
|
||||
ROUND_CEIL = 2,
|
||||
|
||||
/**
|
||||
* Rounds towards -Infinity
|
||||
*/
|
||||
ROUND_FLOOR = 3,
|
||||
|
||||
/**
|
||||
* Rounds towards nearest neighbour.
|
||||
* If equidistant, rounds away from zero
|
||||
*/
|
||||
ROUND_HALF_UP = 4,
|
||||
|
||||
/**
|
||||
* Rounds towards nearest neighbour.
|
||||
* If equidistant, rounds towards zero
|
||||
*/
|
||||
ROUND_HALF_DOWN = 5,
|
||||
|
||||
/**
|
||||
* Rounds towards nearest neighbour.
|
||||
* If equidistant, rounds towards even neighbour
|
||||
*/
|
||||
ROUND_HALF_EVEN = 6,
|
||||
|
||||
/**
|
||||
* Rounds towards nearest neighbour.
|
||||
* If equidistant, rounds towards Infinity
|
||||
*/
|
||||
ROUND_HALF_CEIL = 7,
|
||||
|
||||
/**
|
||||
* Rounds towards nearest neighbour.
|
||||
* If equidistant, rounds towards -Infinity
|
||||
*/
|
||||
ROUND_HALF_FLOOR = 8,
|
||||
|
||||
/**
|
||||
* Not a rounding mode, see modulo
|
||||
*/
|
||||
EUCLID = 9,
|
||||
}
|
||||
|
||||
interface IFormatConfig {
|
||||
decimalSeparator?: string;
|
||||
groupSeparator?: string;
|
||||
groupSize?: number;
|
||||
secondaryGroupSize?: number;
|
||||
fractionGroupSeparator?: string;
|
||||
fractionGroupSize?: number;
|
||||
}
|
||||
|
||||
interface IDecimalConfig {
|
||||
/**
|
||||
* number: integer, 1 to 1e+9 inclusive
|
||||
* Default value: 20
|
||||
*
|
||||
* The maximum number of significant digits of the result of a calculation or base conversion.
|
||||
*
|
||||
* All methods which return a Decimal will round the return value to precision significant digits except absoluteValue, ceil, floor, negated, round, toDecimalPlaces, toNearest and truncated.
|
||||
*
|
||||
* A Decimal constructor will also not round to precision unless a base is specified.
|
||||
*/
|
||||
precision?: number;
|
||||
|
||||
/**
|
||||
* number: integer, 0 to 8 inclusive
|
||||
* Default value: 4 (ROUND_HALF_UP)
|
||||
*
|
||||
* The default rounding mode used when rounding the result of a calculation or base conversion to precision significant digits, and when rounding the return value of the round, toDecimalPlaces, toExponential, toFixed, toFormat, toNearest, toPrecision and toSignificantDigits methods.
|
||||
*
|
||||
* The rounding modes are available as enumerated properties of the constructor.
|
||||
*/
|
||||
rounding?: RoundingMode;
|
||||
|
||||
/**
|
||||
* number: integer, -9e15 to 0 inclusive
|
||||
* Default value: -7
|
||||
*
|
||||
* The negative exponent value at and below which toString returns exponential notation.
|
||||
* @type {[type]}
|
||||
*/
|
||||
toExpNeg?: number;
|
||||
|
||||
/**
|
||||
* number: integer, 0 to 9e15 inclusive
|
||||
* Default value: 20
|
||||
*
|
||||
* The positive exponent value at and above which toString returns exponential notation.
|
||||
*/
|
||||
toExpPos?: number;
|
||||
|
||||
/**
|
||||
* number: integer, -9e15 to 0 inclusive
|
||||
* Default value: -9e15
|
||||
*
|
||||
* The negative exponent limit, i.e. the exponent value below which underflow to zero occurs.
|
||||
*
|
||||
* If the Decimal to be returned by a calculation would have an exponent lower than minE then its value becomes zero.
|
||||
*
|
||||
* JavaScript numbers underflow to zero for exponents below -324.
|
||||
*/
|
||||
minE?: number;
|
||||
|
||||
/**
|
||||
* number: integer, 0 to 9e15 inclusive
|
||||
* Default value: 9e15
|
||||
*
|
||||
* The positive exponent limit, i.e. the exponent value above which overflow to Infinity occurs.
|
||||
*
|
||||
* If the Decimal to be returned by a calculation would have an exponent higher than maxE then its value becomes Infinity.
|
||||
*
|
||||
* JavaScript numbers overflow to Infinity for exponents above 308.
|
||||
*/
|
||||
maxE?: number;
|
||||
|
||||
/**
|
||||
* boolean/number: true, false, 1 or 0
|
||||
* Default value: true
|
||||
*
|
||||
* The value that determines whether Decimal Errors are thrown. If errors is false, this library will not throw errors.
|
||||
*/
|
||||
errors?: boolean | number;
|
||||
|
||||
/**
|
||||
* boolean/number: true, false, 1 or 0
|
||||
* Default value: false
|
||||
*
|
||||
* The value that determines whether cryptographically-secure pseudo-random number generation is used.
|
||||
*
|
||||
* If crypto is truthy then the random method will generate random digits using crypto.getRandomValues in browsers that support it, or crypto.randomBytes if using a version of Node.js that supports it.
|
||||
*
|
||||
* If neither function is supported by the host environment or if crypto is falsey then the source of randomness will be Math.random. If the crypto property is set directly (i.e. without using config) to true, then at the time the random method is called, if errors is true, an error will be thrown if the crypto methods are unavailable.
|
||||
*/
|
||||
crypto?: boolean | number;
|
||||
|
||||
/**
|
||||
* number: integer, 0 to 9 inclusive
|
||||
* Default value: 1 (ROUND_DOWN)
|
||||
*
|
||||
* The modulo mode used when calculating the modulus: a mod n.
|
||||
*
|
||||
* The quotient, q = a / n, is calculated according to the rounding mode that corresponds to the chosen modulo mode.
|
||||
*
|
||||
* The remainder, r, is calculated as: r = a - n * q.
|
||||
*
|
||||
* The modes that are most commonly used for the modulus/remainder operation are ROUND_UP, ROUND_DOWN, ROUND_FLOOR, ROUND_HALF_EVEN, and EUCLID. Although the other rounding modes can be used, they may not give useful results.
|
||||
*/
|
||||
modulo?: RoundingMode;
|
||||
|
||||
/**
|
||||
* The format object configures the format of the string returned by the toFormat method.
|
||||
*
|
||||
* The example below shows the properties of the format object that are recognised, and their default values.
|
||||
*
|
||||
* Unlike setting other properties using config, the values of the properties of the format object will not be checked for validity. The existing format object will simply be replaced by the object that is passed in. Only the toFormat method ever references a Decimal constructor's format object property.
|
||||
*
|
||||
* See toFormat for examples of usage, and of setting format properties individually and directly without using config.
|
||||
*/
|
||||
format?: IFormatConfig;
|
||||
}
|
||||
|
||||
interface IDecimalStatic extends IDecimalConfig {
|
||||
default: IDecimalStatic;
|
||||
|
||||
(value: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
new(value: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Configures the 'global' settings for this particular Decimal constructor.
|
||||
*
|
||||
* Returns this Decimal constructor.
|
||||
*/
|
||||
config(object: IDecimalConfig): IDecimalStatic;
|
||||
|
||||
/**
|
||||
* Returns a new independent Decimal constructor with configuration settings as described by object
|
||||
*/
|
||||
constructor(object: IDecimalConfig): IDecimalStatic;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the base e (Euler's number, the base of the natural logarithm) exponential of the value of this Decimal, rounded to precision significant digits using rounding mode rounding.
|
||||
*/
|
||||
exp(n: number | string | Decimal): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the natural logarithm of the value of this Decimal, rounded to precision significant digits using rounding mode rounding.
|
||||
*
|
||||
* The natual logarithm is the inverse of the exponential function.
|
||||
*/
|
||||
ln(n: number | string | Decimal): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the base n logarithm of the value of this Decimal, rounded to precision significant digits using rounding mode rounding.
|
||||
*
|
||||
* If n is null or undefined, then the base 10 logarithm of the value of this Decimal will be returned.
|
||||
*/
|
||||
log(n: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the maximum of arg1, arg2,... .
|
||||
*/
|
||||
max(...args: any[]): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the minimum of arg1, arg2,... .
|
||||
*/
|
||||
min(...args: any[]): Decimal;
|
||||
|
||||
/**
|
||||
* Reverts the Decimal variable to the value it had before this library was loaded and returns a reference to the original Decimal constructor so it can be assigned to a variable with a different name.
|
||||
*/
|
||||
noConflict(): IDecimalStatic;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal raised to the power n, rounded to precision significant digits using rounding mode rounding.
|
||||
*
|
||||
* The performance of this method degrades exponentially with increasing digits. For non-integer exponents in particular, the performance of this method may not be adequate.
|
||||
*/
|
||||
pow(base: number | string | Decimal, exponent: number | string | Decimal): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal with a pseudo-random value equal to or greater than 0 and less than 1. The return value will have dp decimal places (or less if trailing zeros are produced). If dp is omitted then the number of decimal places will default to the current precision setting.
|
||||
*
|
||||
* Depending on the value of a Decimal constructor's crypto property and the support for the crypto object in the host environment, the random digits of the return value are generated by either Math.random (fastest), crypto.getRandomValues (Web Cryptography API in recent browsers) or crypto.randomBytes (Node.js).
|
||||
*
|
||||
* If crypto is true, i.e. one of the crypto methods is to be used, the value of a returned Decimal should be cryptographically-secure and statistically indistinguishable from a random value.
|
||||
*/
|
||||
random(dp?: number): Decimal;
|
||||
|
||||
/**
|
||||
* The return value will be correctly rounded, i.e. rounded as if the result was first calculated to an infinite number of correct digits before rounding.
|
||||
*
|
||||
* This method is much faster than using the toPower method with an exponent of 0.5.
|
||||
*/
|
||||
sqrt(arg: number | string | Decimal): Decimal;
|
||||
|
||||
/**
|
||||
* A Decimal instance with value one.
|
||||
*/
|
||||
ONE: number;
|
||||
|
||||
/**
|
||||
* Rounds away from zero
|
||||
*/
|
||||
ROUND_UP: number;
|
||||
|
||||
/**
|
||||
* Rounds towards zero
|
||||
*/
|
||||
ROUND_DOWN: number;
|
||||
|
||||
/**
|
||||
* Rounds towards Infinity
|
||||
*/
|
||||
ROUND_CEIL: number;
|
||||
|
||||
/**
|
||||
* Rounds towards -Infinity
|
||||
*/
|
||||
ROUND_FLOOR: number;
|
||||
|
||||
/**
|
||||
* Rounds towards nearest neighbour.
|
||||
* If equidistant, rounds away from zero
|
||||
*/
|
||||
ROUND_HALF_UP: number;
|
||||
|
||||
/**
|
||||
* Rounds towards nearest neighbour.
|
||||
* If equidistant, rounds towards zero
|
||||
*/
|
||||
ROUND_HALF_DOWN: number;
|
||||
|
||||
/**
|
||||
* Rounds towards nearest neighbour.
|
||||
* If equidistant, rounds towards even neighbour
|
||||
*/
|
||||
ROUND_HALF_EVEN: number;
|
||||
|
||||
/**
|
||||
* Rounds towards nearest neighbour.
|
||||
* If equidistant, rounds towards Infinity
|
||||
*/
|
||||
ROUND_HALF_CEIL: number;
|
||||
|
||||
/**
|
||||
* Rounds towards nearest neighbour.
|
||||
* If equidistant, rounds towards -Infinity
|
||||
*/
|
||||
ROUND_HALF_FLOOR: number;
|
||||
|
||||
/**
|
||||
* Not a rounding mode, see modulo
|
||||
*/
|
||||
EUCLID: number;
|
||||
}
|
||||
|
||||
interface Decimal {
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the absolute value, i.e. the magnitude, of the value of this Decimal.
|
||||
*
|
||||
* The return value is not rounded.
|
||||
*/
|
||||
absoluteValue(): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the absolute value, i.e. the magnitude, of the value of this Decimal.
|
||||
*
|
||||
* The return value is not rounded.
|
||||
*/
|
||||
abs(): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal rounded to a whole number in the direction of positive Infinity.
|
||||
*
|
||||
* The return value is not rounded to precision.
|
||||
*/
|
||||
ceil(): Decimal;
|
||||
|
||||
/**
|
||||
* @return 1, -1, 0, or null
|
||||
* 1 If the value of this Decimal is greater than the
|
||||
* value of n
|
||||
* -1 If the value of this Decimal is less than the value
|
||||
* of n
|
||||
* 0 If this Decimal and n have the same value
|
||||
* null If the value of either this Decimal or n is NaN
|
||||
*/
|
||||
comparedTo(n: number | string | Decimal, base?: number): number;
|
||||
|
||||
/**
|
||||
* Returns 1, -1, 0, or null
|
||||
* 1 If the value of this Decimal is greater than the value
|
||||
* of n
|
||||
* -1 If the value of this Decimal is less than the value
|
||||
* of n
|
||||
* 0 If this Decimal and n have the same value
|
||||
* null If the value of either this Decimal or n is NaN
|
||||
*/
|
||||
cmp(n: number | string | Decimal, base?: number): number;
|
||||
|
||||
/**
|
||||
* Returns the number of decimal places, i.e. the number of digits after the decimal point, of the value of this Decimal.
|
||||
*/
|
||||
decimalPlaces(): number;
|
||||
|
||||
/**
|
||||
* Returns the number of decimal places, i.e. the number of digits after the decimal point, of the value of this Decimal.
|
||||
*/
|
||||
dp(): number;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal divided by n, rounded to precision significant digits using rounding mode rounding.
|
||||
*/
|
||||
dividedBy(n: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal divided by n, rounded to precision significant digits using rounding mode rounding.
|
||||
*/
|
||||
div(n: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Return a new Decimal whose value is the integer part of dividing this Decimal by n, rounded to precision significant digits using rounding mode rounding.
|
||||
*/
|
||||
dividedToIntegerBy(n: number | string| Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Return a new Decimal whose value is the integer part of dividing this Decimal by n, rounded to precision significant digits using rounding mode rounding.
|
||||
*/
|
||||
divToInt(n: number | string| Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Returns true if the value of this Decimal equals the value of n, otherwise returns false.
|
||||
*
|
||||
* As with JavaScript, NaN does not equal NaN.
|
||||
*
|
||||
* Note: This method uses the cmp method internally.
|
||||
*/
|
||||
equals(n: number | string | Decimal, base?: number): boolean;
|
||||
|
||||
/**
|
||||
* Returns true if the value of this Decimal equals the value of n, otherwise returns false.
|
||||
*
|
||||
* As with JavaScript, NaN does not equal NaN.
|
||||
*
|
||||
* Note: This method uses the cmp method internally.
|
||||
*/
|
||||
eq(n: number | string | Decimal, base?: number): boolean;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the base e (Euler's number, the base of the natural logarithm) exponential of the value of this Decimal, rounded to precision significant digits using rounding mode rounding.
|
||||
*/
|
||||
exponential(): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the base e (Euler's number, the base of the natural logarithm) exponential of the value of this Decimal, rounded to precision significant digits using rounding mode rounding.
|
||||
*/
|
||||
exp(): Decimal;
|
||||
|
||||
/**
|
||||
* The return value is not rounded to precision.
|
||||
*/
|
||||
floor(): Decimal;
|
||||
|
||||
|
||||
/**
|
||||
* Note: This method uses cmp method internally.
|
||||
*/
|
||||
greaterThan(n: number | string | Decimal, base?: number): boolean;
|
||||
|
||||
/**
|
||||
* Note: This method uses cmp method internally.
|
||||
*/
|
||||
gt(n: number | string | Decimal, base?: number): boolean;
|
||||
|
||||
/**
|
||||
* Note: This method uses cmp method internally.
|
||||
*/
|
||||
greaterThanOrEqualTo(n: number | string | Decimal, base?: number): boolean;
|
||||
|
||||
/**
|
||||
* Note: This method uses cmp method internally.
|
||||
*/
|
||||
gte(n: number | string | Decimal, base?: number): boolean;
|
||||
|
||||
/**
|
||||
* The only possible non-finite values of a Decimal are NaN, Infinity and -Infinity.
|
||||
*/
|
||||
isFinite(): boolean;
|
||||
|
||||
isInteger(): boolean;
|
||||
|
||||
isInt(): boolean;
|
||||
|
||||
isNaN(): boolean;
|
||||
|
||||
isNegative(): boolean;
|
||||
|
||||
isNeg(): boolean;
|
||||
|
||||
isZero(): boolean;
|
||||
|
||||
/**
|
||||
* Note: This method uses cmp method internally.
|
||||
*/
|
||||
lessThan(n: number | string | Decimal, base?: number): boolean;
|
||||
|
||||
/**
|
||||
* Note: This method uses cmp method internally.
|
||||
*/
|
||||
lt(n: number | string | Decimal, base?: number): boolean;
|
||||
|
||||
/**
|
||||
* Note: This method uses cmp method internally.
|
||||
*/
|
||||
lessThanOrEqualTo(n: number | string | Decimal, base?: number): boolean;
|
||||
|
||||
/**
|
||||
* Note: This method uses cmp method internally.
|
||||
*/
|
||||
lte(n: number | string | Decimal, base?: number): boolean;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the base n logarithm of the value of this Decimal, rounded to precision significant digits using rounding mode rounding.
|
||||
*
|
||||
* If n is null or undefined, then the base 10 logarithm of the value of this Decimal will be returned.
|
||||
*/
|
||||
logarithm(n?: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the base n logarithm of the value of this Decimal, rounded to precision significant digits using rounding mode rounding.
|
||||
*
|
||||
* If n is null or undefined, then the base 10 logarithm of the value of this Decimal will be returned.
|
||||
*/
|
||||
log(n?: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal minus n, rounded to precision significant digits using rounding mode rounding.
|
||||
*/
|
||||
minus(n: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal modulo n, rounded to precision significant digits using rounding mode rounding.
|
||||
*
|
||||
* The value returned, and in particular its sign, is dependent on the value of the modulo property of this Decimal's constructor. If it is 1 (default value), the result will have the same sign as this Decimal, and it will match that of Javascript's % operator (within the limits of double precision) and BigDecimal's remainder method.
|
||||
*/
|
||||
modulo(n: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal modulo n, rounded to precision significant digits using rounding mode rounding.
|
||||
*
|
||||
* The value returned, and in particular its sign, is dependent on the value of the modulo property of this Decimal's constructor. If it is 1 (default value), the result will have the same sign as this Decimal, and it will match that of Javascript's % operator (within the limits of double precision) and BigDecimal's remainder method.
|
||||
*/
|
||||
mod(n: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the natural logarithm of the value of this Decimal, rounded to precision significant digits using rounding mode rounding.
|
||||
*
|
||||
* The natual logarithm is the inverse of the exponential function.
|
||||
*/
|
||||
naturalLogarithm(): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the natural logarithm of the value of this Decimal, rounded to precision significant digits using rounding mode rounding.
|
||||
*
|
||||
* The natual logarithm is the inverse of the exponential function.
|
||||
*/
|
||||
ln(): Decimal;
|
||||
|
||||
/**
|
||||
* The return value is not rounded.
|
||||
*/
|
||||
negated(): Decimal;
|
||||
|
||||
/**
|
||||
* The return value is not rounded.
|
||||
*/
|
||||
neg(): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal plus n, rounded to precision significant digits using rounding mode rounding.
|
||||
*/
|
||||
plus(n: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* If include_zeros is true or 1 then any trailing zeros of the integer part of a number are counted as significant digits, otherwise they are not.
|
||||
*/
|
||||
precision(include_leading_zeros?: boolean | number): number;
|
||||
|
||||
/**
|
||||
* If include_zeros is true or 1 then any trailing zeros of the integer part of a number are counted as significant digits, otherwise they are not.
|
||||
*/
|
||||
sd(include_leading_zeros?: boolean | number): number;
|
||||
|
||||
round(): Decimal;
|
||||
|
||||
/**
|
||||
* The return value will be correctly rounded, i.e. rounded as if the result was first calculated to an infinite number of correct digits before rounding.
|
||||
*
|
||||
* This method is much faster than using the toPower method with an exponent of 0.5.
|
||||
*/
|
||||
squareRoot(): Decimal;
|
||||
|
||||
/**
|
||||
* The return value will be correctly rounded, i.e. rounded as if the result was first calculated to an infinite number of correct digits before rounding.
|
||||
*
|
||||
* This method is much faster than using the toPower method with an exponent of 0.5.
|
||||
*/
|
||||
sqrt(): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal times n, rounded to precision significant digits using rounding mode rounding.
|
||||
*/
|
||||
times(n: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal rounded to dp decimal places using rounding mode rm.
|
||||
*
|
||||
* If dp is omitted or is null or undefined, the return value will have the same value as this Decimal.
|
||||
*
|
||||
* If rm is omitted or is null or undefined, rounding mode rounding is used.
|
||||
*/
|
||||
toDecimalPlaces(dp?: number, rm?: RoundingMode): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal rounded to dp decimal places using rounding mode rm.
|
||||
*
|
||||
* If dp is omitted or is null or undefined, the return value will have the same value as this Decimal.
|
||||
*
|
||||
* If rm is omitted or is null or undefined, rounding mode rounding is used.
|
||||
*/
|
||||
toDP(dp?: number, rm?: RoundingMode): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a string representing the value of this Decimal in exponential notation rounded using rounding mode rm to dp decimal places, i.e with one digit before the decimal point and dp digits after it.
|
||||
*
|
||||
* If the value of this Decimal in exponential notation has fewer than dp fraction digits, the return value will be appended with zeros accordingly.
|
||||
*
|
||||
* If dp is omitted, or is null or undefined, the number of digits after the decimal point defaults to the minimum number of digits necessary to represent the value exactly.
|
||||
*
|
||||
* If rm is omitted or is null or undefined, rounding mode rounding is used.
|
||||
*/
|
||||
toExponential(dp?: number, rm?: RoundingMode): string;
|
||||
|
||||
/**
|
||||
* Returns a string representing the value of this Decimal in normal (fixed-point) notation rounded to dp decimal places using rounding mode rm.
|
||||
*
|
||||
* If the value of this Decimal in normal notation has fewer than dp fraction digits , the return value will be appended with zeros accordingly.
|
||||
*
|
||||
* Unlike Number.prototype.toFixed, which returns exponential notation if a number is greater or equal to 1021, this method will always return normal notation.
|
||||
*
|
||||
* If dp is omitted or is null or undefined, then the return value will be unrounded and in normal notation. This is unlike Number.prototype.toFixed, which returns the value to zero decimal places, but is useful when because of the current toExpNeg or toExpNeg values, toString returns exponential notation
|
||||
*
|
||||
* if rm is omitted or is null or undefined, rounding mode rounding is used.
|
||||
*/
|
||||
toFixed(dp?: number, rm?: RoundingMode): string;
|
||||
|
||||
/**
|
||||
* Returns a string representing the value of this Decimal in fixed-point notation rounded to dp decimal places using rounding mode rm (as toFixed), and formatted according to the properties of this Decimal's constructor's format object property.
|
||||
*
|
||||
* See the examples below for the properties of the format object, their types and their usage.
|
||||
*
|
||||
* If dp is omitted or is null or undefined, then the return value is not rounded to a fixed number of decimal places.
|
||||
*
|
||||
* if rm is omitted or is null or undefined, rounding mode rounding is used.
|
||||
*/
|
||||
toFormat(dp?: number, rm?: RoundingMode): string;
|
||||
|
||||
/**
|
||||
* Returns a string array representing the value of this Decimal as a simple fraction with an integer numerator and an integer denominator. The denominator will be a positive non-zero value less than or equal to max_denominator.
|
||||
*
|
||||
* If a maximum denominator is not specified, or is null or undefined, the denominator will be the lowest value necessary to represent the number exactly.
|
||||
*/
|
||||
toFraction(max_denominator?: number | string | Decimal): Decimal[];
|
||||
|
||||
toJSON(): string;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the nearest multiple of n to the value of this Decimal.
|
||||
*
|
||||
* If the value of this Decimal is equidistant from two multiples of n, the rounding mode rm, or rounding if rm is omitted or is null or undefined, determines the direction of the nearest.
|
||||
*
|
||||
* In this context, rounding mode ROUND_HALF_UP is interpreted the same as rounding mode ROUND_UP, and so on. I.e. the rounding is either up, own, to ceil, to floor or to even.
|
||||
*
|
||||
* The return value will always have the same sign as this Decimal, unless either this Decimal or n is NaN, in which case the return value will be also be NaN.
|
||||
*
|
||||
* The return value is not rounded to precision.
|
||||
*/
|
||||
toNearest(n: number | string | Decimal, rm?: RoundingMode): Decimal;
|
||||
|
||||
/**
|
||||
* Returns the value of this Decimal converted to a number primitive.
|
||||
*
|
||||
* Type coercion with, for example, JavaScript's unary plus operator will also work, except that a Decimal with the value minus zero will convert to positive zero.
|
||||
*/
|
||||
toNumber(): number;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal raised to the power n, rounded to precision significant digits using rounding mode rounding.
|
||||
*
|
||||
* The performance of this method degrades exponentially with increasing digits. For non-integer exponents in particular, the performance of this method may not be adequate.
|
||||
*/
|
||||
toPower(n: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal raised to the power n, rounded to precision significant digits using rounding mode rounding.
|
||||
*
|
||||
* The performance of this method degrades exponentially with increasing digits. For non-integer exponents in particular, the performance of this method may not be adequate.
|
||||
*/
|
||||
pow(n: number | string | Decimal, base?: number): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a string representing the value of this Decimal rounded to sd significant digits using rounding mode rm.
|
||||
*
|
||||
* If sd is less than the number of digits necessary to represent the integer part of the value in normal (fixed-point) notation, then exponential notation is used.
|
||||
*
|
||||
* If sd is omitted or is null or undefined, then the return value is the same as toString.
|
||||
*
|
||||
* if rm is omitted or is null or undefined, rounding mode rounding is used.
|
||||
*/
|
||||
toPrecision(sd?: number, rm?: RoundingMode): string;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal rounded to sd significant digits using rounding mode rm.
|
||||
*
|
||||
* If sd is omitted or is null or undefined, the return value will be rounded to precision significant digits.
|
||||
*
|
||||
* if rm is omitted or is null or undefined, rounding mode rounding will be used.
|
||||
*/
|
||||
toSignificantDigits(sd?: number, rm?: RoundingMode): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal rounded to sd significant digits using rounding mode rm.
|
||||
*
|
||||
* If sd is omitted or is null or undefined, the return value will be rounded to precision significant digits.
|
||||
*
|
||||
* if rm is omitted or is null or undefined, rounding mode rounding will be used.
|
||||
*/
|
||||
toSD(sd?: number, rm?: RoundingMode): Decimal;
|
||||
|
||||
/**
|
||||
* base: number: integer, 2 to 64 inclusive
|
||||
*
|
||||
* Returns a string representing the value of this Decimal in the specified base, or base 10 if base is omitted or is null or undefined.
|
||||
*
|
||||
* For bases above 10, values from 10 to 35 are represented by a-z (as with Number.prototype.toString), 36 to 61 by A-Z, and 62 and 63 by $ and _ respectively.
|
||||
*
|
||||
* If a base is specified the value is rounded to precision significant digits using rounding mode rounding.
|
||||
*
|
||||
* If a base is not specified and this Decimal has a positive exponent that is equal to or greater than toExpPos, or a negative exponent equal to or less than toExpNeg, then exponential notation is returned.
|
||||
*
|
||||
* If base is null or undefined it is ignored.
|
||||
*/
|
||||
toString(base?: number): string;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal truncated to a whole number.
|
||||
*
|
||||
* The return value is not rounded to precision.
|
||||
*/
|
||||
truncated(): Decimal;
|
||||
|
||||
/**
|
||||
* Returns a new Decimal whose value is the value of this Decimal truncated to a whole number.
|
||||
*
|
||||
* The return value is not rounded to precision.
|
||||
*/
|
||||
trunc(): Decimal;
|
||||
|
||||
/**
|
||||
* As toString, but does not accept a base argument.
|
||||
*/
|
||||
valueOf(): string;
|
||||
|
||||
/**
|
||||
* coefficient
|
||||
*
|
||||
* Array of integers, each 0 - 1e7
|
||||
*/
|
||||
c: number[];
|
||||
|
||||
/**
|
||||
* exponent
|
||||
*
|
||||
* Integer, -9e15 to 9e15 inclusive
|
||||
*/
|
||||
e: number;
|
||||
|
||||
/**
|
||||
* sign
|
||||
*
|
||||
* -1 or 1
|
||||
*/
|
||||
s: number;
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"decimal.js-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
import { parse, CommandEntry, ParseOptions } from 'docker-file-parser';
|
||||
|
||||
const file = `
|
||||
FROM node:8
|
||||
|
||||
ADD . /opt/
|
||||
WORKDIR /opt
|
||||
|
||||
RUN npm install --production
|
||||
|
||||
EXPOSE 8080
|
||||
VOLUME /opt/scripts
|
||||
|
||||
CMD ["npm", "start"]
|
||||
`;
|
||||
|
||||
const options: ParseOptions = {
|
||||
includeComments: false
|
||||
};
|
||||
|
||||
const result: CommandEntry[] = parse(file, options);
|
||||
const line1Name = result[0].name;
|
||||
const line1Number = result[0].lineno;
|
||||
const line1Args = result[0].args;
|
||||
const line1Raw = result[0].raw;
|
||||
21
types/docker-file-parser/index.d.ts
vendored
21
types/docker-file-parser/index.d.ts
vendored
@@ -1,21 +0,0 @@
|
||||
// Type definitions for docker-file-parser 1.0
|
||||
// Project: https://github.com/joyent/docker-file-parse
|
||||
// Definitions by: Yash Kulshrestha <https://github.com/yashdalfthegray>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface CommandEntry {
|
||||
name: string;
|
||||
args: string[];
|
||||
lineno: number;
|
||||
raw: string;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export interface ParseOptions {
|
||||
includeComments: boolean;
|
||||
}
|
||||
|
||||
export function parse(
|
||||
contents: string,
|
||||
options?: ParseOptions
|
||||
): CommandEntry[];
|
||||
3803
types/ember-data/index.d.ts
vendored
3803
types/ember-data/index.d.ts
vendored
File diff suppressed because it is too large
Load Diff
91
types/ember-data/test/module-api.ts
Normal file
91
types/ember-data/test/module-api.ts
Normal file
@@ -0,0 +1,91 @@
|
||||
/**
|
||||
* Tests for the Ember-Data "module API" introduced in v2.3
|
||||
* @see https://www.emberjs.com/blog/2016/01/12/ember-data-2-3-released.html#toc_importing-modules
|
||||
*/
|
||||
import DS from 'ember-data';
|
||||
// Adapters
|
||||
import Adapter from 'ember-data/adapter';
|
||||
import JSONAPIAdapter from 'ember-data/adapters/json-api';
|
||||
import RESTAdapter from 'ember-data/adapters/rest';
|
||||
// Serializers
|
||||
import Serializer from 'ember-data/serializer';
|
||||
import RESTSerializer from 'ember-data/serializers/rest';
|
||||
import JSONSerializer from 'ember-data/serializers/json';
|
||||
import JSONAPISerializer from 'ember-data/serializers/json-api';
|
||||
|
||||
// Model
|
||||
import Model from 'ember-data/model';
|
||||
// Model - attr
|
||||
import attr from 'ember-data/attr';
|
||||
// Model - relationships
|
||||
import { hasMany, belongsTo } from 'ember-data/relationships';
|
||||
|
||||
// Transforms
|
||||
import BooleanTransform from 'ember-data/transforms/boolean';
|
||||
import StringTransform from 'ember-data/transforms/string';
|
||||
import NumberTransform from 'ember-data/transforms/number';
|
||||
import DateTransform from 'ember-data/transforms/date';
|
||||
import Transform from 'ember-data/transforms/transform';
|
||||
|
||||
// Store
|
||||
import Store from 'ember-data/store';
|
||||
|
||||
// Errors
|
||||
import * as EDErrors from 'ember-data/adapters/errors';
|
||||
|
||||
import { assertType } from "./lib/assert";
|
||||
|
||||
// ADAPTERS
|
||||
// - identity
|
||||
assertType<typeof DS.Adapter>(Adapter);
|
||||
assertType<typeof DS.RESTAdapter>(RESTAdapter);
|
||||
assertType<typeof DS.JSONAPIAdapter>(JSONAPIAdapter);
|
||||
// - inheritance
|
||||
assertType<typeof DS.Adapter>(RESTAdapter);
|
||||
assertType<typeof DS.RESTAdapter>(JSONAPIAdapter);
|
||||
|
||||
// SERIALIZERS
|
||||
// - identity
|
||||
assertType<typeof DS.Serializer>(Serializer);
|
||||
assertType<typeof DS.RESTSerializer>(RESTSerializer);
|
||||
assertType<typeof DS.JSONSerializer>(JSONSerializer);
|
||||
assertType<typeof DS.JSONAPISerializer>(JSONAPISerializer);
|
||||
// - inheritance
|
||||
assertType<typeof DS.Serializer>(JSONSerializer);
|
||||
assertType<typeof DS.JSONSerializer>(RESTSerializer);
|
||||
assertType<typeof DS.JSONSerializer>(JSONAPISerializer);
|
||||
|
||||
// MODEL
|
||||
// - identity
|
||||
assertType<typeof DS.Model>(Model);
|
||||
// - attributes
|
||||
assertType<typeof DS.attr>(attr);
|
||||
// - relationships
|
||||
assertType<typeof DS.hasMany>(hasMany);
|
||||
assertType<typeof DS.belongsTo>(belongsTo);
|
||||
|
||||
// TRANSFORMS
|
||||
// - identity
|
||||
assertType<typeof DS.BooleanTransform>(BooleanTransform);
|
||||
assertType<typeof DS.NumberTransform>(NumberTransform);
|
||||
assertType<typeof DS.StringTransform>(StringTransform);
|
||||
assertType<typeof DS.DateTransform>(DateTransform);
|
||||
assertType<typeof DS.Transform>(Transform);
|
||||
|
||||
// STORE
|
||||
// - identity
|
||||
assertType<typeof DS.Store>(Store);
|
||||
|
||||
// ERRORS
|
||||
// - identity
|
||||
assertType<typeof DS.AdapterError>(EDErrors.AdapterError);
|
||||
assertType<typeof DS.InvalidError>(EDErrors.InvalidError);
|
||||
assertType<typeof DS.UnauthorizedError>(EDErrors.UnauthorizedError);
|
||||
assertType<typeof DS.ForbiddenError>(EDErrors.ForbiddenError);
|
||||
assertType<typeof DS.NotFoundError>(EDErrors.NotFoundError);
|
||||
assertType<typeof DS.ConflictError>(EDErrors.ConflictError);
|
||||
assertType<typeof DS.ServerError>(EDErrors.ServerError);
|
||||
assertType<typeof DS.TimeoutError>(EDErrors.TimeoutError);
|
||||
assertType<typeof DS.AbortError>(EDErrors.AbortError);
|
||||
assertType<typeof DS.errorsHashToArray>(EDErrors.errorsHashToArray);
|
||||
assertType<typeof DS.errorsArrayToHash>(EDErrors.errorsArrayToHash);
|
||||
@@ -19,6 +19,7 @@
|
||||
"index.d.ts",
|
||||
"test/lib/assert.ts",
|
||||
"test/model.ts",
|
||||
"test/module-api.ts",
|
||||
"test/adapter.ts",
|
||||
"test/serializer.ts",
|
||||
"test/transform.ts",
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
"only-arrow-functions": false,
|
||||
"no-empty-interface": false,
|
||||
"prefer-const": false,
|
||||
"no-unnecessary-generics": false
|
||||
"no-unnecessary-generics": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-self-import": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,10 @@ import {
|
||||
DocumentPicker,
|
||||
Facebook,
|
||||
FacebookAds,
|
||||
FileSystem
|
||||
FileSystem,
|
||||
ImagePicker,
|
||||
ImageManipulator,
|
||||
FaceDetector
|
||||
} from 'expo';
|
||||
|
||||
Accelerometer.addListener((obj) => {
|
||||
@@ -201,3 +204,43 @@ async () => {
|
||||
result.uri;
|
||||
result.md5;
|
||||
};
|
||||
|
||||
async () => {
|
||||
const result = await ImagePicker.launchImageLibraryAsync({
|
||||
mediaTypes: ImagePicker.MediaTypeOptions.Videos
|
||||
});
|
||||
|
||||
if (!result.cancelled) {
|
||||
result.uri;
|
||||
result.width;
|
||||
result.height;
|
||||
}
|
||||
};
|
||||
|
||||
async () => {
|
||||
const result = await ImageManipulator.manipulate('url', {
|
||||
rotate: 90
|
||||
}, {
|
||||
compress: 0.5
|
||||
});
|
||||
|
||||
result.height;
|
||||
result.uri;
|
||||
result.width;
|
||||
};
|
||||
|
||||
FaceDetector.Constants.Mode.fast;
|
||||
FaceDetector.Constants.Mode.accurate;
|
||||
FaceDetector.Constants.Landmarks.all;
|
||||
FaceDetector.Constants.Landmarks.none;
|
||||
FaceDetector.Constants.Classifications.all;
|
||||
FaceDetector.Constants.Classifications.none;
|
||||
async () => {
|
||||
const result = await FaceDetector.detectFaces('url', {
|
||||
mode: FaceDetector.Constants.Mode.fast,
|
||||
detectLandmarks: FaceDetector.Constants.Landmarks.all,
|
||||
runClassifications: FaceDetector.Constants.Classifications.none
|
||||
});
|
||||
|
||||
result.faces[0];
|
||||
};
|
||||
|
||||
138
types/expo/index.d.ts
vendored
138
types/expo/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for expo 23.0
|
||||
// Type definitions for expo 24.0
|
||||
// Project: https://github.com/expo/expo-sdk
|
||||
// Definitions by: Konstantin Kai <https://github.com/KonstantinKai>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -456,7 +456,11 @@ export namespace Constants {
|
||||
version?: string;
|
||||
orientation?: Orientation;
|
||||
primaryColor?: string;
|
||||
privacy?: 'public' | 'unlisted';
|
||||
scheme?: string;
|
||||
icon?: string;
|
||||
platforms?: string[];
|
||||
githubUrl?: string;
|
||||
notification?: {
|
||||
icon?: string,
|
||||
color?: string,
|
||||
@@ -472,13 +476,11 @@ export namespace Constants {
|
||||
hideExponentText?: boolean
|
||||
};
|
||||
appKey?: string;
|
||||
androidStatusBarColor?: string;
|
||||
androidStatusBar?: {
|
||||
barStyle?: 'lignt-content' | 'dark-content',
|
||||
backgroundColor?: string
|
||||
};
|
||||
androidHideExponentNotificationInShellApp?: boolean;
|
||||
scheme?: string;
|
||||
androidShowExponentNotificationInShellApp?: boolean;
|
||||
extra?: {
|
||||
[propName: string]: any
|
||||
};
|
||||
@@ -525,16 +527,16 @@ export namespace Constants {
|
||||
}
|
||||
}
|
||||
};
|
||||
facebookScheme: any;
|
||||
xde: boolean;
|
||||
developper?: {
|
||||
tool?: string,
|
||||
[propName: string]: any
|
||||
facebookScheme?: any;
|
||||
facebookAppId?: string;
|
||||
facebookDisplayName?: string;
|
||||
splash?: {
|
||||
backgroundColor?: string;
|
||||
resizeMode?: ResizeModeContain | ResizeModeCover;
|
||||
image?: string;
|
||||
};
|
||||
bundleUrl?: string;
|
||||
debuggerHost?: string;
|
||||
mainModuleName?: string;
|
||||
logUrl?: string;
|
||||
assetBundlePatterns?: string[];
|
||||
releaseChannel: string;
|
||||
[propName: string]: any;
|
||||
}
|
||||
const manifest: Manifest;
|
||||
@@ -968,10 +970,19 @@ export namespace ImagePicker {
|
||||
|
||||
type ImageResult = { cancelled: true } | ({ cancelled: false } & ImageInfo);
|
||||
|
||||
interface _MediaTypeOptions {
|
||||
All: 'All';
|
||||
Videos: 'Videos';
|
||||
Images: 'Images';
|
||||
}
|
||||
|
||||
const MediaTypeOptions: _MediaTypeOptions;
|
||||
|
||||
interface ImageLibraryOptions {
|
||||
allowsEditing?: boolean;
|
||||
aspect?: [number, number];
|
||||
quality?: number;
|
||||
mediaTypes?: keyof _MediaTypeOptions;
|
||||
}
|
||||
|
||||
function launchImageLibraryAsync(options?: ImageLibraryOptions): Promise<ImageResult>;
|
||||
@@ -1400,7 +1411,7 @@ export interface SvgCommonProps {
|
||||
originY?: number;
|
||||
}
|
||||
|
||||
export class Svg extends Component<{ width: number, heigth: number }> { }
|
||||
export class Svg extends Component<{ width: number, height: number }> { }
|
||||
export class Rect extends Component<SvgCommonProps> { }
|
||||
|
||||
export interface CircleProps extends SvgCommonProps {
|
||||
@@ -1479,3 +1490,102 @@ export namespace WebBrowser {
|
||||
function openAuthSessionAsync(url: string, redirectUrl?: string): Promise<{ type: 'cancelled' | 'dismissed' }>;
|
||||
function dismissBrowser(): Promise<{ type: 'dismissed' }>;
|
||||
}
|
||||
|
||||
/**
|
||||
* ImageManipulator
|
||||
*/
|
||||
export namespace ImageManipulator {
|
||||
interface ImageResult {
|
||||
uri: string;
|
||||
width: number;
|
||||
height: number;
|
||||
base64?: string;
|
||||
}
|
||||
interface SaveOptions {
|
||||
base64?: boolean;
|
||||
compress?: FloatFromZeroToOne;
|
||||
format?: 'jpeg' | 'png';
|
||||
}
|
||||
interface CropParameters {
|
||||
originX: number;
|
||||
originY: number;
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
interface ImageManipulationOptions {
|
||||
resize?: { width?: number; height?: number };
|
||||
rotate?: number;
|
||||
flip?: { vertical?: boolean; horizontal?: boolean };
|
||||
crop?: CropParameters;
|
||||
}
|
||||
function manipulate(uri: string, actions: ImageManipulationOptions, saveOptions?: SaveOptions): Promise<ImageResult>;
|
||||
}
|
||||
|
||||
/**
|
||||
* FaceDetector
|
||||
*/
|
||||
export namespace FaceDetector {
|
||||
interface Point {
|
||||
x: Axis;
|
||||
y: Axis;
|
||||
}
|
||||
interface Face {
|
||||
bounds: {
|
||||
size: {
|
||||
width: number;
|
||||
height: number;
|
||||
},
|
||||
origin: Point;
|
||||
};
|
||||
smilingProbability?: number;
|
||||
leftEarPosition?: Point;
|
||||
rightEarPosition?: Point;
|
||||
leftEyePosition?: Point;
|
||||
leftEyeOpenProbability?: number;
|
||||
rightEyePosition?: Point;
|
||||
rightEyeOpenProbability?: number;
|
||||
leftCheekPosition?: Point;
|
||||
rightCheekPosition?: Point;
|
||||
leftMouthPosition?: Point;
|
||||
mouthPosition?: Point;
|
||||
rightMouthPosition?: Point;
|
||||
bottomMouthPosition?: Point;
|
||||
noseBasePosition?: Point;
|
||||
yawAngle?: number;
|
||||
rollAngle?: number;
|
||||
}
|
||||
interface DetectFaceResult {
|
||||
faces: Face[];
|
||||
image: {
|
||||
uri: string;
|
||||
width: number;
|
||||
height: number;
|
||||
orientation: number;
|
||||
};
|
||||
}
|
||||
interface Mode {
|
||||
fast: 'fast';
|
||||
accurate: 'accurate';
|
||||
}
|
||||
interface _Shared {
|
||||
all: 'all';
|
||||
none: 'none';
|
||||
}
|
||||
type Landmarks = _Shared;
|
||||
type Classifications = _Shared;
|
||||
interface _Constants {
|
||||
Mode: Mode;
|
||||
Landmarks: Landmarks;
|
||||
Classifications: Classifications;
|
||||
}
|
||||
|
||||
const Constants: _Constants;
|
||||
|
||||
interface Options {
|
||||
mode?: keyof Mode;
|
||||
detectLandmarks?: keyof Landmarks;
|
||||
runClassifications?: keyof Classifications;
|
||||
}
|
||||
|
||||
function detectFaces(uri: string, options?: Options): Promise<DetectFaceResult>;
|
||||
}
|
||||
|
||||
204
types/expo/v23/expo-tests.tsx
Normal file
204
types/expo/v23/expo-tests.tsx
Normal file
@@ -0,0 +1,204 @@
|
||||
import * as React from 'react';
|
||||
|
||||
import {
|
||||
Accelerometer,
|
||||
Amplitude,
|
||||
Asset,
|
||||
AuthSession,
|
||||
Audio,
|
||||
AppLoading,
|
||||
BarCodeScanner,
|
||||
BlurViewProps,
|
||||
BlurView,
|
||||
Brightness,
|
||||
Camera,
|
||||
DocumentPicker,
|
||||
Facebook,
|
||||
FacebookAds,
|
||||
FileSystem,
|
||||
ImagePicker
|
||||
} from 'expo';
|
||||
|
||||
Accelerometer.addListener((obj) => {
|
||||
obj.x;
|
||||
obj.y;
|
||||
obj.z;
|
||||
});
|
||||
Accelerometer.removeAllListeners();
|
||||
Accelerometer.setUpdateInterval(1000);
|
||||
|
||||
Amplitude.initialize('key');
|
||||
Amplitude.setUserId('userId');
|
||||
Amplitude.setUserProperties({key: 1});
|
||||
Amplitude.clearUserProperties();
|
||||
Amplitude.logEvent('name');
|
||||
Amplitude.logEventWithProperties('event', {key: 'value'});
|
||||
Amplitude.setGroup('type', {key: 'value'});
|
||||
|
||||
const asset = Asset.fromModule(1);
|
||||
asset.downloadAsync();
|
||||
Asset.loadAsync(1);
|
||||
Asset.loadAsync([1, 2, 3]);
|
||||
const asset1 = new Asset({
|
||||
uri: 'uri',
|
||||
type: 'type',
|
||||
name: 'name',
|
||||
hash: 'hash',
|
||||
width: 122,
|
||||
height: 122
|
||||
});
|
||||
|
||||
const url = AuthSession.getRedirectUrl();
|
||||
AuthSession.dismiss();
|
||||
AuthSession.startAsync({
|
||||
authUrl: 'url1',
|
||||
returnUrl: 'url2'
|
||||
}).then(result => {
|
||||
switch (result.type) {
|
||||
case 'success':
|
||||
result.event;
|
||||
result.params;
|
||||
break;
|
||||
case 'error':
|
||||
result.errorCode;
|
||||
result.params;
|
||||
result.event;
|
||||
break;
|
||||
case 'dismissed':
|
||||
case 'cancel':
|
||||
result.type;
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
Audio.setAudioModeAsync({
|
||||
shouldDuckAndroid: false,
|
||||
playsInSilentModeIOS: true,
|
||||
interruptionModeIOS: 2,
|
||||
interruptionModeAndroid: 1,
|
||||
allowsRecordingIOS: true
|
||||
});
|
||||
Audio.setIsEnabledAsync(true);
|
||||
async () => {
|
||||
const result = await Audio.Sound.create('uri', {
|
||||
volume: 0.5,
|
||||
rate: 0.6
|
||||
}, null, true);
|
||||
|
||||
const sound = result.sound;
|
||||
const status = result.status;
|
||||
|
||||
if (!status.isLoaded) {
|
||||
status.error;
|
||||
} else {
|
||||
status.didJustFinish;
|
||||
// etc.
|
||||
}
|
||||
|
||||
const _status = await sound.getStatusAsync();
|
||||
await sound.loadAsync('uri');
|
||||
};
|
||||
|
||||
() => (
|
||||
<AppLoading
|
||||
startAsync={() => Promise.resolve()}
|
||||
onFinish={() => {}}
|
||||
onError={(error) => console.log(error)} />
|
||||
);
|
||||
() => (
|
||||
<AppLoading
|
||||
startAsync={null}
|
||||
onFinish={null}
|
||||
onError={null} />
|
||||
);
|
||||
|
||||
const barcodeReadCallback = () => {};
|
||||
() => (
|
||||
<BarCodeScanner
|
||||
type="front"
|
||||
torchMode="off"
|
||||
barCodeTypes={['s']}
|
||||
onBarCodeRead={barcodeReadCallback} />
|
||||
);
|
||||
|
||||
() => (
|
||||
<BlurView
|
||||
tint="dark"
|
||||
intensity={2} />
|
||||
);
|
||||
|
||||
async () => {
|
||||
await Brightness.setBrightnessAsync(.6);
|
||||
await Brightness.setSystemBrightnessAsync(.7);
|
||||
const br1 = await Brightness.getBrightnessAsync();
|
||||
const br2 = await Brightness.getSystemBrightnessAsync();
|
||||
};
|
||||
|
||||
Camera.Constants.AutoFocus;
|
||||
Camera.Constants.Type;
|
||||
Camera.Constants.FlashMode;
|
||||
Camera.Constants.WhiteBalance;
|
||||
Camera.Constants.VideoQuality;
|
||||
Camera.Constants.BarCodeType;
|
||||
() => {
|
||||
return(<Camera ref={(component: any) => {
|
||||
if (component) {
|
||||
component.recordAsync();
|
||||
}
|
||||
}} />);
|
||||
};
|
||||
|
||||
async () => {
|
||||
const result = await DocumentPicker.getDocumentAsync();
|
||||
|
||||
if (result.type === 'success') {
|
||||
result.name;
|
||||
result.uri;
|
||||
result.size;
|
||||
}
|
||||
};
|
||||
|
||||
async () => {
|
||||
const result = await Facebook.logInWithReadPermissionsAsync('appId');
|
||||
|
||||
if (result.type === 'success') {
|
||||
result.expires;
|
||||
result.token;
|
||||
}
|
||||
};
|
||||
|
||||
() => (
|
||||
<FacebookAds.BannerView
|
||||
type="large"
|
||||
placementId="str"
|
||||
onPress={() => {}}
|
||||
onError={() => {}} />
|
||||
);
|
||||
|
||||
async () => {
|
||||
const info = await FileSystem.getInfoAsync('file');
|
||||
|
||||
info.exists;
|
||||
info.isDirectory;
|
||||
|
||||
if (info.exists) {
|
||||
info.md5;
|
||||
info.uri;
|
||||
info.size;
|
||||
info.modificationTime;
|
||||
}
|
||||
|
||||
const string: string = await FileSystem.readAsStringAsync('file');
|
||||
await FileSystem.writeAsStringAsync('file', 'content');
|
||||
await FileSystem.deleteAsync('file');
|
||||
await FileSystem.moveAsync({ from: 'from', to: 'to'});
|
||||
await FileSystem.copyAsync({ from: 'from', to: 'to' });
|
||||
await FileSystem.makeDirectoryAsync('dir');
|
||||
const dirs: string[] = await FileSystem.readDirectoryAsync('dir');
|
||||
const result = await FileSystem.downloadAsync('from', 'to');
|
||||
|
||||
result.headers;
|
||||
result.status;
|
||||
result.uri;
|
||||
result.md5;
|
||||
};
|
||||
1482
types/expo/v23/index.d.ts
vendored
Normal file
1482
types/expo/v23/index.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
32
types/expo/v23/tsconfig.json
Normal file
32
types/expo/v23/tsconfig.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"jsx": "react",
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../../",
|
||||
"typeRoots": [
|
||||
"../../"
|
||||
],
|
||||
"paths": {
|
||||
"expo": [
|
||||
"expo/v23"
|
||||
],
|
||||
"expo/*": [
|
||||
"expo/v23/*"
|
||||
]
|
||||
},
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"expo-tests.tsx"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
import express = require("express");
|
||||
import flash = require("express-flash-notification");
|
||||
|
||||
const app = express();
|
||||
|
||||
// Simple initialization test
|
||||
app.use(flash(app));
|
||||
|
||||
// Incomplete object test
|
||||
app.use(flash(app, {
|
||||
sessionName: "to-flash",
|
||||
utilityName: "||",
|
||||
localsName: "!to-flash"
|
||||
}));
|
||||
|
||||
// Empty object test
|
||||
app.use(flash(app, {}));
|
||||
|
||||
// Functions test
|
||||
app.use(flash(app, {
|
||||
beforeSingleRender: (item, callback) => { callback(null, item); },
|
||||
afterAllRender: (htmlFragments, callback) => { callback(null, htmlFragments.join("\n")); }
|
||||
}));
|
||||
|
||||
// Full object test
|
||||
app.use(flash(app, {
|
||||
sessionName: "flash",
|
||||
utilityName: "flash",
|
||||
localsName: "flash",
|
||||
viewName: "flash",
|
||||
beforeSingleRender: (item, callback) => { callback(null, item); },
|
||||
afterAllRender: (htmlFragments, callback) => { callback(null, htmlFragments.join("\n")); }
|
||||
}));
|
||||
|
||||
app.use((req: express.Request, res: express.Response, next: express.NextFunction) => {
|
||||
req.flash("info");
|
||||
req.flash("info", "I am a pretty butterfly");
|
||||
req.flash("info", "I am a pretty butterfly", "/");
|
||||
req.flash("info", "I am a pretty butterfly", true);
|
||||
req.flash({
|
||||
type: "error",
|
||||
message: "Lets mix things up, shall we?"
|
||||
});
|
||||
|
||||
req.flash({
|
||||
type: "info",
|
||||
message: "if cats rules the world",
|
||||
redirect: false
|
||||
});
|
||||
|
||||
req.flash({
|
||||
type: "success",
|
||||
message: "Odd",
|
||||
redirect: true,
|
||||
url: "/"
|
||||
});
|
||||
});
|
||||
39
types/express-flash-notification/index.d.ts
vendored
Normal file
39
types/express-flash-notification/index.d.ts
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
// Type definitions for express-flash-notification 0.5
|
||||
// Project: https://github.com/carlosascari/express-flash-notification
|
||||
// Definitions by: Mister4Eyes <https://github.com/Mister4Eyes>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
import express = require("express");
|
||||
|
||||
interface efnOptions {
|
||||
sessionName?: string;
|
||||
utilityName?: string;
|
||||
localsName?: string;
|
||||
viewName?: string;
|
||||
beforeSingleRender?: (item: any, callback: (err: any, item: any) => void) => void;
|
||||
afterAllRender?: (htmlFragments: string[], callback: (err: any, html: string) => void) => void;
|
||||
}
|
||||
|
||||
declare function express_flash_notification(app: express.Application, options?: efnOptions, ...args: any[]): any;
|
||||
|
||||
declare namespace express_flash_notification {
|
||||
const prototype: {};
|
||||
}
|
||||
|
||||
declare global {
|
||||
namespace Express {
|
||||
interface FlashOptions {
|
||||
type?: string;
|
||||
message?: string;
|
||||
redirect?: boolean;
|
||||
url?: string;
|
||||
}
|
||||
interface Request {
|
||||
flash(type: string, message?: string, redirect?: string|boolean): void;
|
||||
flash(object: FlashOptions): void;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export = express_flash_notification;
|
||||
23
types/express-flash-notification/tsconfig.json
Normal file
23
types/express-flash-notification/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"express-flash-notification-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/express-flash-notification/tslint.json
Normal file
1
types/express-flash-notification/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
37
types/express-serve-static-core/index.d.ts
vendored
37
types/express-serve-static-core/index.d.ts
vendored
@@ -1,8 +1,11 @@
|
||||
// Type definitions for Express 4.x
|
||||
// Type definitions for Express 4.11
|
||||
// Project: http://expressjs.com
|
||||
// Definitions by: Boris Yankov <https://github.com/borisyankov>, Michał Lytek <https://github.com/19majkel94>, Kacper Polak <https://github.com/kacepe>
|
||||
// Definitions by: Boris Yankov <https://github.com/borisyankov>
|
||||
// Michał Lytek <https://github.com/19majkel94>
|
||||
// Kacper Polak <https://github.com/kacepe>
|
||||
// Satana Charuwichitratana <https://github.com/micksatana>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
// This extracts the core definitions from express to prevent a circular dependency between express and serve-static
|
||||
/// <reference types="node" />
|
||||
@@ -73,8 +76,12 @@ export interface IRouter extends RequestHandler {
|
||||
* });
|
||||
*/
|
||||
param(name: string, handler: RequestParamHandler): this;
|
||||
// Alternatively, you can pass only a callback, in which case you have the opportunity to alter the app.param() API
|
||||
// deprecated since express 4.11.0
|
||||
|
||||
/**
|
||||
* Alternatively, you can pass only a callback, in which case you have the opportunity to alter the app.param()
|
||||
*
|
||||
* @deprecated since version 4.11
|
||||
*/
|
||||
param(callback: (name: string, matcher: RegExp) => RequestParamHandler): this;
|
||||
|
||||
/**
|
||||
@@ -297,7 +304,7 @@ export interface Request extends http.IncomingMessage, Express.Request {
|
||||
accepted: MediaType[];
|
||||
|
||||
/**
|
||||
* @deprecated Use either req.params, req.body or req.query, as applicable.
|
||||
* @deprecated since 4.11 Use either req.params, req.body or req.query, as applicable.
|
||||
*
|
||||
* Return the value of param `name` when present or `defaultValue`.
|
||||
*
|
||||
@@ -807,6 +814,17 @@ export interface Response extends http.ServerResponse, Express.Response {
|
||||
vary(field: string): Response;
|
||||
|
||||
app: Application;
|
||||
|
||||
/**
|
||||
* Appends the specified value to the HTTP response header field.
|
||||
* If the header is not already set, it creates the header with the specified value.
|
||||
* The value parameter can be a string or an array.
|
||||
*
|
||||
* Note: calling res.set() after res.append() will reset the previously-set header value.
|
||||
*
|
||||
* @since 4.11.0
|
||||
*/
|
||||
append(field: string, value?: string[]|string): Response;
|
||||
}
|
||||
|
||||
export interface Handler extends RequestHandler { }
|
||||
@@ -882,7 +900,12 @@ export interface Application extends IRouter, Express.Application {
|
||||
get: ((name: string) => any) & IRouterMatcher<this>;
|
||||
|
||||
param(name: string | string[], handler: RequestParamHandler): this;
|
||||
// Alternatively, you can pass only a callback, in which case you have the opportunity to alter the app.param() API
|
||||
|
||||
/**
|
||||
* Alternatively, you can pass only a callback, in which case you have the opportunity to alter the app.param()
|
||||
*
|
||||
* @deprecated since version 4.11
|
||||
*/
|
||||
param(callback: (name: string, matcher: RegExp) => RequestParamHandler): this;
|
||||
|
||||
/**
|
||||
|
||||
@@ -119,6 +119,13 @@ namespace express_tests {
|
||||
router(req, res, next);
|
||||
});
|
||||
|
||||
// Test append function
|
||||
app.use((req, res, next) => {
|
||||
res.append('Link', ['<http://localhost/>', '<http://localhost:3000/>']);
|
||||
res.append('Set-Cookie', 'foo=bar; Path=/; HttpOnly');
|
||||
res.append('Warning', '199 Miscellaneous warning');
|
||||
});
|
||||
|
||||
app.use(router);
|
||||
|
||||
app.listen(3000);
|
||||
|
||||
2
types/express/index.d.ts
vendored
2
types/express/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Express 4.x
|
||||
// Type definitions for Express 4.11
|
||||
// Project: http://expressjs.com
|
||||
// Definitions by: Boris Yankov <https://github.com/borisyankov>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
@@ -1,134 +0,0 @@
|
||||
const testElement: HTMLElement = document.getElementById("test");
|
||||
|
||||
// Create Listbox with defaults
|
||||
let instance: SingleSelectListBox = new SingleSelectListBox(testElement);
|
||||
instance = new MultiSelectListBox(testElement);
|
||||
|
||||
|
||||
// Create with options
|
||||
let settings = <ListBoxSettings>{};
|
||||
settings.searchBar = false;
|
||||
settings.searchBarWatermark = "Search";
|
||||
settings.searchBarButton = { icon: "fa fa-search", visible: true, onClick: function () { alert(); } };
|
||||
settings.getItems = (): (string|ListBoxItem)[] => {
|
||||
return ["Test1"];
|
||||
};
|
||||
settings.onItemsChanged = (event: ListBoxEvent): void => {
|
||||
console.log(event.eventName);
|
||||
console.log(event.args);
|
||||
console.log(event.target);
|
||||
};
|
||||
settings.onFilterChanged = (event: ListBoxEvent): void => {
|
||||
console.log(event.args);
|
||||
};
|
||||
settings.onValueChanged = (event: ListBoxEvent): void => {
|
||||
console.log(event.args);
|
||||
};
|
||||
settings.onItemDoubleClicked = (event: ListBoxEvent): void => {
|
||||
console.log(event.args);
|
||||
};
|
||||
settings.onItemEnterPressed = (event: ListBoxEvent): void => {
|
||||
console.log(event.args);
|
||||
};
|
||||
|
||||
instance = new SingleSelectListBox(testElement, settings);
|
||||
instance = new MultiSelectListBox(testElement, settings);
|
||||
|
||||
|
||||
/////// NEW API ///////
|
||||
|
||||
// Add string item
|
||||
var id: string = instance.addItem("Test2");
|
||||
|
||||
|
||||
// Add item
|
||||
var item: ListBoxItem = <ListBoxItem>{};
|
||||
item.selected = true;
|
||||
item.disabled = false;
|
||||
item.childItems = [{ text: "Test4" }];
|
||||
item.groupHeader = false;
|
||||
item.id = "ouetioreit";
|
||||
item.index = 0;
|
||||
item.text = "Test3";
|
||||
id = instance.addItem(item);
|
||||
|
||||
|
||||
// Add string items
|
||||
var ids: string[] = instance.addItems(["Test2", "Test1"]);
|
||||
|
||||
|
||||
// Remove item
|
||||
instance.removeItem(id);
|
||||
|
||||
|
||||
// Remove items
|
||||
instance.removeItems([id, ids[0]]);
|
||||
|
||||
|
||||
// Get item
|
||||
var i: ListBoxItem = instance.getItem(id);
|
||||
|
||||
|
||||
// Get items
|
||||
var allItems: ListBoxItem[] = instance.getItems();
|
||||
|
||||
// Get selected items
|
||||
var allItems: ListBoxItem[] = instance.getSelection();
|
||||
|
||||
|
||||
// Move item up
|
||||
var newIndex: number = instance.moveItemUp(i.id);
|
||||
|
||||
|
||||
// Move item down
|
||||
newIndex = instance.moveItemDown(i.id);
|
||||
|
||||
|
||||
// Move item to top
|
||||
var newIndex: number = instance.moveItemToTop(i.id);
|
||||
|
||||
|
||||
// Move item to bottom
|
||||
newIndex = instance.moveItemToBottom(i.id);
|
||||
|
||||
|
||||
// Clear selection
|
||||
instance.clearSelection();
|
||||
|
||||
|
||||
// Enable
|
||||
instance.enable(false);
|
||||
|
||||
|
||||
// Destroy
|
||||
instance.destroy();
|
||||
|
||||
|
||||
// onValueChanged
|
||||
settings.onValueChanged = (event: ListBoxEvent) => {
|
||||
console.log(event.args);
|
||||
};
|
||||
|
||||
|
||||
// onItemsChanged
|
||||
settings.onItemsChanged = (event: ListBoxEvent) => {
|
||||
console.log(event.args);
|
||||
};
|
||||
|
||||
|
||||
// onFilterChanged
|
||||
settings.onFilterChanged = (event: ListBoxEvent) => {
|
||||
console.log(event.args);
|
||||
};
|
||||
|
||||
|
||||
// onItemEnterPressed
|
||||
settings.onItemEnterPressed = (event: ListBoxEvent) => {
|
||||
console.log(event.args);
|
||||
};
|
||||
|
||||
|
||||
// onItemDoubleClicked
|
||||
settings.onItemDoubleClicked = (event: ListBoxEvent) => {
|
||||
console.log(event.args);
|
||||
};
|
||||
141
types/extended-listbox/index.d.ts
vendored
141
types/extended-listbox/index.d.ts
vendored
@@ -1,141 +0,0 @@
|
||||
// Type definitions for extended-listbox 4.0.x
|
||||
// Project: https://github.com/code-chris/extended-listbox
|
||||
// Definitions by: Christian Kotzbauer <https://github.com/code-chris>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface ListBoxItem {
|
||||
/** display text */
|
||||
text?: string;
|
||||
|
||||
/** unique identifier, if not set it will be generated */
|
||||
id?: string;
|
||||
|
||||
/** index position from the item in the list; only used for manual addItem api calls */
|
||||
index?: number;
|
||||
|
||||
/** determines if the item should be clickable */
|
||||
disabled?: boolean;
|
||||
|
||||
/** determines if the item is selected */
|
||||
selected?: boolean;
|
||||
|
||||
/** determines if the item has childItems */
|
||||
groupHeader?: boolean;
|
||||
|
||||
/** display text or id of the parent; only used for manual addItem api calls */
|
||||
parentGroupId?: string;
|
||||
|
||||
/** list of childItems */
|
||||
childItems?: (string | ListBoxItem)[];
|
||||
}
|
||||
|
||||
interface ListBoxSearchBarButtonOptions {
|
||||
/** determines if the button is visible */
|
||||
visible?: boolean;
|
||||
|
||||
/** css class for the i-tag of the button */
|
||||
icon?: string;
|
||||
|
||||
/** callback for button click */
|
||||
onClick?: () => void;
|
||||
}
|
||||
|
||||
interface ListBoxSettings {
|
||||
/** determines if the searchBar is visible */
|
||||
searchBar?: boolean;
|
||||
|
||||
/** watermark (placeholder) for the searchBar */
|
||||
searchBarWatermark?: string;
|
||||
|
||||
/** settings for the searchBar button */
|
||||
searchBarButton?: ListBoxSearchBarButtonOptions;
|
||||
|
||||
/** function which returns a array of items */
|
||||
getItems?: () => (string | ListBoxItem)[];
|
||||
|
||||
/** callback for selection changes */
|
||||
onValueChanged?: (event: ListBoxEvent) => void;
|
||||
|
||||
/** callback for searchBar text changes */
|
||||
onFilterChanged?: (event: ListBoxEvent) => void;
|
||||
|
||||
/** callback for item changes (item added, item removed, item order) */
|
||||
onItemsChanged?: (event: ListBoxEvent) => void;
|
||||
|
||||
/** callback for enter keyPress event on an item */
|
||||
onItemEnterPressed?: (event: ListBoxEvent) => void;
|
||||
|
||||
/** callback for doubleClick event on an item */
|
||||
onItemDoubleClicked?: (event: ListBoxEvent) => void;
|
||||
}
|
||||
|
||||
interface ListBoxEvent {
|
||||
/** unique event name */
|
||||
eventName: string;
|
||||
|
||||
/** target object for which event is triggered */
|
||||
target: Element;
|
||||
|
||||
/** any object */
|
||||
args: any;
|
||||
}
|
||||
|
||||
interface BaseListBox {
|
||||
/** Adds a new item to the list */
|
||||
addItem(item: string | ListBoxItem): string;
|
||||
|
||||
/** Adds new items to the list */
|
||||
addItems(items: (string | ListBoxItem)[]): string[];
|
||||
|
||||
/** Removes a item from the list */
|
||||
removeItem(identifier: string): void;
|
||||
|
||||
/** Removes items from the list */
|
||||
removeItems(identifiers: string[]): void;
|
||||
|
||||
/** Reverts all changes from the DOM */
|
||||
destroy(): void;
|
||||
|
||||
/** Resets the selection state of all items */
|
||||
clearSelection(): void;
|
||||
|
||||
/** Returns a item object for the given id or display text */
|
||||
getItem(identifier: string): ListBoxItem;
|
||||
|
||||
/** Returns all item objects */
|
||||
getItems(): ListBoxItem[];
|
||||
|
||||
/** Decreases the index of the matching item by one */
|
||||
moveItemUp(identifier: string): number;
|
||||
|
||||
/** Increases the index of the matching item by one */
|
||||
moveItemDown(identifier: string): number;
|
||||
|
||||
/** Moves item to the bottom of the list */
|
||||
moveItemToBottom(identifier: string): number;
|
||||
|
||||
/** Moves item to the top of the list */
|
||||
moveItemToTop(identifier: string): number;
|
||||
|
||||
/** Enables or disables the whole list and all childs */
|
||||
enable(state: boolean): void;
|
||||
|
||||
/** Returns all ListBoxItem's which are selected */
|
||||
getSelection(): ListBoxItem[];
|
||||
}
|
||||
|
||||
interface SingleSelectListBox extends BaseListBox {
|
||||
}
|
||||
|
||||
interface MultiSelectListBox extends BaseListBox {
|
||||
}
|
||||
|
||||
declare var SingleSelectListBox: {
|
||||
prototype: SingleSelectListBox;
|
||||
new(domElement: HTMLElement, options?: ListBoxSettings): SingleSelectListBox;
|
||||
};
|
||||
|
||||
declare var MultiSelectListBox: {
|
||||
prototype: MultiSelectListBox;
|
||||
new(domElement: HTMLElement, options?: ListBoxSettings): MultiSelectListBox;
|
||||
};
|
||||
@@ -1,24 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"extended-listbox-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"interface-over-type-literal": false,
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-duplicate-variable": false,
|
||||
"no-empty-interface": false,
|
||||
"no-for-in-array": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": false,
|
||||
"no-irregular-whitespace": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-misused-new": false,
|
||||
"no-namespace": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-reference-import": false,
|
||||
"no-relative-import-in-test": false,
|
||||
"no-self-import": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-string-throw": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-useless-files": false,
|
||||
"no-var-keyword": false,
|
||||
"no-var-requires": false,
|
||||
"no-void-expression": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": false,
|
||||
"prefer-declare-function": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-template": false,
|
||||
"radix": false,
|
||||
"semicolon": false,
|
||||
"space-before-function-paren": false,
|
||||
"space-within-parens": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"trim-file": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false,
|
||||
"whitespace": false
|
||||
}
|
||||
}
|
||||
@@ -1,124 +0,0 @@
|
||||
import fecha = require('fecha');
|
||||
|
||||
// test fecha.parse
|
||||
fecha.parse("February 3rd, 2014", "MMMM Do, YYYY");
|
||||
fecha.parse("5/3/98", "shortDate");
|
||||
|
||||
// test override fecha.i18n
|
||||
fecha.i18n = {
|
||||
dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat"],
|
||||
dayNames: [
|
||||
"Sunday",
|
||||
"Monday",
|
||||
"Tuesday",
|
||||
"Wednesday",
|
||||
"Thursday",
|
||||
"Friday",
|
||||
"Saturday"
|
||||
],
|
||||
monthNamesShort: [
|
||||
"Jan",
|
||||
"Feb",
|
||||
"Mar",
|
||||
"Apr",
|
||||
"May",
|
||||
"Jun",
|
||||
"Jul",
|
||||
"Aug",
|
||||
"Sep",
|
||||
"Oct",
|
||||
"Nov",
|
||||
"Dec"
|
||||
],
|
||||
monthNames: [
|
||||
"January",
|
||||
"February",
|
||||
"March",
|
||||
"April",
|
||||
"May",
|
||||
"June",
|
||||
"July",
|
||||
"August",
|
||||
"September",
|
||||
"October",
|
||||
"November",
|
||||
"December"
|
||||
],
|
||||
amPm: ["am", "pm"],
|
||||
DoFn(D: number) {
|
||||
return D + "th";
|
||||
}
|
||||
};
|
||||
|
||||
// just change one default mask
|
||||
fecha.masks.shortDate = "M/D/YY";
|
||||
|
||||
// test override fecha.masks with an object. Must implement all keys.
|
||||
// if you want to implement partially, use
|
||||
// fecha.masks = Object.assign(fecha.masks, {shortDate: 'M/D/YY'}) for example.
|
||||
fecha.masks = {
|
||||
default: "ddd MMM DD YYYY HH:mm:ss",
|
||||
shortDate: "M/D/YY",
|
||||
mediumDate: "MMM D, YYYY",
|
||||
longDate: "MMMM D, YYYY",
|
||||
fullDate: "dddd, MMMM D, YYYY",
|
||||
shortTime: "HH:mm",
|
||||
mediumTime: "HH:mm:ss",
|
||||
longTime: "HH:mm:ss.SSS"
|
||||
};
|
||||
|
||||
// test add custom named mask.
|
||||
// fecha.masks.myMask = "HH:mm:ss YY/MM/DD"; does not work for now.
|
||||
fecha.masks['myMask'] = "HH:mm:ss YY/MM/DD";
|
||||
|
||||
// test fecha.format without i18nSettings, with Date object.
|
||||
fecha.format(new Date(2014, 5, 6, 14, 10, 45), "myMask");
|
||||
|
||||
// test fecha.format without i18nSettings with number.
|
||||
fecha.format(Date.now(), "myMask");
|
||||
|
||||
// test override i18nSettings with fecha.format
|
||||
fecha.format(new Date(2014, 5, 6, 14, 10, 45), "myMask", {
|
||||
dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat"],
|
||||
dayNames: [
|
||||
"Sunday",
|
||||
"Monday",
|
||||
"Tuesday",
|
||||
"Wednesday",
|
||||
"Thursday",
|
||||
"Friday",
|
||||
"Saturday"
|
||||
],
|
||||
monthNamesShort: [
|
||||
"Jan",
|
||||
"Feb",
|
||||
"Mar",
|
||||
"Apr",
|
||||
"May",
|
||||
"Jun",
|
||||
"Jul",
|
||||
"Aug",
|
||||
"Sep",
|
||||
"Oct",
|
||||
"Nov",
|
||||
"Dec"
|
||||
],
|
||||
monthNames: [
|
||||
"January",
|
||||
"February",
|
||||
"March",
|
||||
"April",
|
||||
"May",
|
||||
"June",
|
||||
"July",
|
||||
"August",
|
||||
"September",
|
||||
"October",
|
||||
"November",
|
||||
"December"
|
||||
],
|
||||
amPm: ["am", "pm"],
|
||||
DoFn(D: number) {
|
||||
return D + "th";
|
||||
}
|
||||
});
|
||||
52
types/fecha/index.d.ts
vendored
52
types/fecha/index.d.ts
vendored
@@ -1,52 +0,0 @@
|
||||
// Type definitions for fecha 2.3
|
||||
// Project: https://github.com/taylorhakes/fecha
|
||||
// Definitions by: Goh Yisheng <https://github.com/9y5>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export type Days = [string, string, string, string, string, string, string];
|
||||
|
||||
export type Months = [
|
||||
string,
|
||||
string,
|
||||
string,
|
||||
string,
|
||||
string,
|
||||
string,
|
||||
string,
|
||||
string,
|
||||
string,
|
||||
string,
|
||||
string,
|
||||
string
|
||||
];
|
||||
|
||||
export interface i18nSettings {
|
||||
amPm: [string, string];
|
||||
dayNames: Days;
|
||||
dayNamesShort: Days;
|
||||
monthNames: Months;
|
||||
monthNamesShort: Months;
|
||||
DoFn(D: number): string;
|
||||
}
|
||||
|
||||
export interface Masks {
|
||||
default: string;
|
||||
fullDate: string;
|
||||
longDate: string;
|
||||
longTime: string;
|
||||
mediumDate: string;
|
||||
mediumTime: string;
|
||||
shortDate: string;
|
||||
shortTime: string;
|
||||
[myMask: string]: string;
|
||||
}
|
||||
|
||||
export let masks: Masks;
|
||||
|
||||
export let i18n: i18nSettings;
|
||||
|
||||
export function format(dateObj: Date | number, mask: string, i18nSettings?: i18nSettings): string;
|
||||
|
||||
export function parse(dateStr: string, format: string, i18nSettings?: i18nSettings): Date;
|
||||
|
||||
export as namespace Fecha;
|
||||
@@ -1,39 +0,0 @@
|
||||
|
||||
//import action = require('flux-standard-action');
|
||||
import { isError, isFSA, Action, ErrorAction } from 'flux-standard-action';
|
||||
|
||||
interface TextPayload {
|
||||
text: string;
|
||||
}
|
||||
|
||||
var sample1: Action<TextPayload> = {
|
||||
type: 'ADD_TODO',
|
||||
payload: {
|
||||
text: 'Do something.'
|
||||
}
|
||||
};
|
||||
|
||||
var sample2: ErrorAction = {
|
||||
type: 'ADD_TODO',
|
||||
payload: new Error(),
|
||||
error: true
|
||||
};
|
||||
|
||||
var result1: boolean = isError(sample1);
|
||||
var result2: boolean = isFSA(sample1);
|
||||
var result3: boolean = isError(sample2);
|
||||
var result4: boolean = isFSA(sample2);
|
||||
|
||||
declare function alert (message: string): void
|
||||
|
||||
function unwrapAction(action: { type: string }) {
|
||||
if (isFSA(action)) {
|
||||
if (isError(action)) {
|
||||
alert(action.payload!.message)
|
||||
}
|
||||
return action.payload
|
||||
}
|
||||
}
|
||||
|
||||
var result5: TextPayload = unwrapAction(sample1)
|
||||
var result6: Error = unwrapAction(sample2)
|
||||
30
types/flux-standard-action/index.d.ts
vendored
30
types/flux-standard-action/index.d.ts
vendored
@@ -1,30 +0,0 @@
|
||||
// Type definitions for flux-standard-action 0.5.0
|
||||
// Project: https://github.com/acdlite/flux-standard-action
|
||||
// Definitions by: Qubo <https://github.com/tkqubo>
|
||||
// Simon Fridlund <https://github.com/zimme>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
export interface ErrorAction extends Action<Error> {
|
||||
error: true;
|
||||
}
|
||||
|
||||
export interface Action<T> {
|
||||
type: string;
|
||||
payload?: T;
|
||||
error?: boolean;
|
||||
}
|
||||
|
||||
/** Usage: `var action: Action<string> & AnyMeta;` */
|
||||
export interface AnyMeta {
|
||||
meta?: any;
|
||||
}
|
||||
|
||||
/** Usage: `var action: Action<string> & TypedMeta<string>;` */
|
||||
export interface TypedMeta<T> {
|
||||
meta?: T;
|
||||
}
|
||||
|
||||
export declare function isFSA(action: any): action is Action<any>;
|
||||
|
||||
export declare function isError(action: any): action is ErrorAction;
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"flux-standard-action-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"interface-over-type-literal": false,
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-duplicate-variable": false,
|
||||
"no-empty-interface": false,
|
||||
"no-for-in-array": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": false,
|
||||
"no-irregular-whitespace": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-misused-new": false,
|
||||
"no-namespace": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-reference-import": false,
|
||||
"no-relative-import-in-test": false,
|
||||
"no-self-import": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-string-throw": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-useless-files": false,
|
||||
"no-var-keyword": false,
|
||||
"no-var-requires": false,
|
||||
"no-void-expression": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": false,
|
||||
"prefer-declare-function": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-template": false,
|
||||
"radix": false,
|
||||
"semicolon": false,
|
||||
"space-before-function-paren": false,
|
||||
"space-within-parens": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"trim-file": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false,
|
||||
"whitespace": false
|
||||
}
|
||||
}
|
||||
10
types/form-urlencoded/form-urlencoded-tests.ts
Normal file
10
types/form-urlencoded/form-urlencoded-tests.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import encode, { FormEncodedOptions } from "form-urlencoded";
|
||||
|
||||
const opts: FormEncodedOptions = {
|
||||
sorted: true,
|
||||
skipIndex: false,
|
||||
ignorenull: true
|
||||
};
|
||||
|
||||
encode([1, 2, 3]);
|
||||
encode([1, 2, 3], opts);
|
||||
12
types/form-urlencoded/index.d.ts
vendored
Normal file
12
types/form-urlencoded/index.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
// Type definitions for form-urlencoded 2.0
|
||||
// Project: https://github.com/iambumblehead/form-urlencoded#readme
|
||||
// Definitions by: Antoine Lépée <https://github.com/alepee>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface FormEncodedOptions {
|
||||
sorted?: boolean;
|
||||
skipIndex?: boolean;
|
||||
ignorenull?: boolean;
|
||||
}
|
||||
|
||||
export default function(data: any, opts?: FormEncodedOptions): string;
|
||||
23
types/form-urlencoded/tsconfig.json
Normal file
23
types/form-urlencoded/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"form-urlencoded-tests.ts"
|
||||
]
|
||||
}
|
||||
26
types/fscreen/fscreen-tests.ts
Normal file
26
types/fscreen/fscreen-tests.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import fscreen from 'fscreen';
|
||||
|
||||
const element = document.createElement('div');
|
||||
|
||||
if (fscreen.fullscreenEnabled) {
|
||||
fscreen.addEventListener('fullscreenchange', handler, false);
|
||||
fscreen.requestFullscreen(element);
|
||||
}
|
||||
|
||||
function handler() {
|
||||
if (fscreen.fullscreenElement !== null) {
|
||||
// Entered fullscreen mode
|
||||
} else {
|
||||
// Exited fullscreen mode
|
||||
}
|
||||
}
|
||||
|
||||
fscreen.requestFullscreen(element);
|
||||
fscreen.requestFullscreenFunction(element);
|
||||
fscreen.exitFullscreen();
|
||||
fscreen.onfullscreenchange = handler;
|
||||
fscreen.addEventListener('fullscreenchange', handler);
|
||||
fscreen.removeEventListener('fullscreenchange', handler);
|
||||
fscreen.onfullscreenerror = handler;
|
||||
fscreen.addEventListener('fullscreenerror', handler);
|
||||
fscreen.removeEventListener('fullscreenerror', handler);
|
||||
22
types/fscreen/index.d.ts
vendored
Normal file
22
types/fscreen/index.d.ts
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
// Type definitions for fscreen 1.0
|
||||
// Project: https://github.com/rafrex/fscreen#readme
|
||||
// Definitions by: Joscha Feth <https://github.com/joscha>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
type Handler = () => void;
|
||||
|
||||
declare class Fscreen {
|
||||
readonly fullscreenElement: Element | undefined;
|
||||
readonly fullscreenEnabled: boolean;
|
||||
readonly exitFullscreen: Handler;
|
||||
onfullscreenchange: Handler;
|
||||
onfullscreenerror: Handler;
|
||||
|
||||
addEventListener(type: string, handler: Handler, useCapture?: boolean): void;
|
||||
removeEventListener(type: string, handler: Handler): void;
|
||||
requestFullscreen(element: Element): void;
|
||||
requestFullscreenFunction(element: Element): void;
|
||||
}
|
||||
|
||||
declare const fscreen: Fscreen;
|
||||
export default fscreen;
|
||||
@@ -1,15 +1,16 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"lib": [
|
||||
"es6"
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"target": "es6",
|
||||
"strictFunctionTypes": true,
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
@@ -19,6 +20,6 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"chunked-dc-tests.ts"
|
||||
"fscreen-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
8
types/googlemaps/index.d.ts
vendored
8
types/googlemaps/index.d.ts
vendored
@@ -2471,9 +2471,17 @@ declare namespace google.maps {
|
||||
description: string;
|
||||
matched_substrings: PredictionSubstring[];
|
||||
place_id: string;
|
||||
reference: string;
|
||||
structured_formatting: AutocompleteStructuredFormatting;
|
||||
terms: PredictionTerm[];
|
||||
types: string[];
|
||||
}
|
||||
|
||||
export interface AutocompleteStructuredFormatting {
|
||||
main_text: string;
|
||||
main_text_matched_substrings: PredictionSubstring[];
|
||||
secondary_text: string;
|
||||
}
|
||||
|
||||
export interface OpeningHours {
|
||||
open_now: boolean;
|
||||
|
||||
22
types/gulp-bump/gulp-bump-tests.ts
Normal file
22
types/gulp-bump/gulp-bump-tests.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import * as gulp from 'gulp';
|
||||
import * as GulpBump from 'gulp-bump';
|
||||
|
||||
gulp
|
||||
.src('package.json')
|
||||
.pipe(GulpBump())
|
||||
.pipe(gulp.dest('./'));
|
||||
|
||||
gulp
|
||||
.src('package.json')
|
||||
.pipe(GulpBump({regex: /^.+$/}))
|
||||
.pipe(gulp.dest('./'));
|
||||
|
||||
gulp
|
||||
.src('package.json')
|
||||
.pipe(GulpBump({version: '1.0.0', global: true}))
|
||||
.pipe(gulp.dest('./'));
|
||||
|
||||
gulp
|
||||
.src('package.json')
|
||||
.pipe(GulpBump({version: '1.0.0', case: true}))
|
||||
.pipe(gulp.dest('./'));
|
||||
15
types/gulp-bump/index.d.ts
vendored
Normal file
15
types/gulp-bump/index.d.ts
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
// Type definitions for gulp-bump 2.8
|
||||
// Project: https://github.com/stevelacy/gulp-bump
|
||||
// Definitions by: silkentrance <https://github.com/silkentrance>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node"/>
|
||||
|
||||
import * as BumpRegex from 'bump-regex';
|
||||
|
||||
declare function GulpBump(options?: BumpRegex.Options): NodeJS.ReadWriteStream;
|
||||
|
||||
declare namespace GulpBump {
|
||||
}
|
||||
|
||||
export = GulpBump;
|
||||
@@ -1,23 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "../",
|
||||
"types": [],
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"jsx": "react",
|
||||
"types": [],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true
|
||||
"strictFunctionTypes": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"noEmit": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"axios-mock-adapter-tests.ts"
|
||||
"gulp-bump-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
3
types/gulp-bump/tslint.json
Normal file
3
types/gulp-bump/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
@@ -15,6 +15,9 @@
|
||||
"paths": {
|
||||
"gulp": [
|
||||
"gulp/v3"
|
||||
],
|
||||
"micromatch": [
|
||||
"micromatch/v2"
|
||||
]
|
||||
},
|
||||
"types": [],
|
||||
|
||||
@@ -1,107 +0,0 @@
|
||||
import HttpStatusCodes = require("http-status-codes");
|
||||
|
||||
var ACCEPTED = HttpStatusCodes.ACCEPTED;
|
||||
var BAD_GATEWAY = HttpStatusCodes.BAD_GATEWAY;
|
||||
var BAD_REQUEST = HttpStatusCodes.BAD_REQUEST;
|
||||
var CONFLICT = HttpStatusCodes.CONFLICT;
|
||||
var CONTINUE = HttpStatusCodes.CONTINUE;
|
||||
var CREATED = HttpStatusCodes.CREATED;
|
||||
var EXPECTATION_FAILED = HttpStatusCodes.EXPECTATION_FAILED;
|
||||
var FAILED_DEPENDENCY = HttpStatusCodes.FAILED_DEPENDENCY ;
|
||||
var FORBIDDEN = HttpStatusCodes.FORBIDDEN;
|
||||
var GATEWAY_TIMEOUT = HttpStatusCodes.GATEWAY_TIMEOUT;
|
||||
var GONE = HttpStatusCodes.GONE;
|
||||
var HTTP_VERSION_NOT_SUPPORTED = HttpStatusCodes.HTTP_VERSION_NOT_SUPPORTED;
|
||||
var INSUFFICIENT_SPACE_ON_RESOURCE = HttpStatusCodes.INSUFFICIENT_SPACE_ON_RESOURCE;
|
||||
var INSUFFICIENT_STORAGE = HttpStatusCodes.INSUFFICIENT_STORAGE;
|
||||
var INTERNAL_SERVER_ERROR = HttpStatusCodes.INTERNAL_SERVER_ERROR;
|
||||
var LENGTH_REQUIRED = HttpStatusCodes.LENGTH_REQUIRED;
|
||||
var LOCKED = HttpStatusCodes.LOCKED;
|
||||
var METHOD_FAILURE = HttpStatusCodes.METHOD_FAILURE;
|
||||
var METHOD_NOT_ALLOWED = HttpStatusCodes.METHOD_NOT_ALLOWED;
|
||||
var MOVED_PERMANENTLY = HttpStatusCodes.MOVED_PERMANENTLY;
|
||||
var MOVED_TEMPORARILY = HttpStatusCodes.MOVED_TEMPORARILY;
|
||||
var MULTI_STATUS = HttpStatusCodes.MULTI_STATUS;
|
||||
var MULTIPLE_CHOICES = HttpStatusCodes.MULTIPLE_CHOICES;
|
||||
var NETWORK_AUTHENTICATION_REQUIRED = HttpStatusCodes.NETWORK_AUTHENTICATION_REQUIRED;
|
||||
var NO_CONTENT = HttpStatusCodes.NO_CONTENT;
|
||||
var NON_AUTHORITATIVE_INFORMATION = HttpStatusCodes.NON_AUTHORITATIVE_INFORMATION;
|
||||
var NOT_ACCEPTABLE = HttpStatusCodes.NOT_ACCEPTABLE;
|
||||
var NOT_FOUND = HttpStatusCodes.NOT_FOUND;
|
||||
var NOT_IMPLEMENTED = HttpStatusCodes.NOT_IMPLEMENTED;
|
||||
var NOT_MODIFIED = HttpStatusCodes.NOT_MODIFIED;
|
||||
var OK = HttpStatusCodes.OK;
|
||||
var PARTIAL_CONTENT = HttpStatusCodes.PARTIAL_CONTENT;
|
||||
var PAYMENT_REQUIRED = HttpStatusCodes.PAYMENT_REQUIRED;
|
||||
var PRECONDITION_FAILED = HttpStatusCodes.PRECONDITION_FAILED;
|
||||
var PRECONDITION_REQUIRED = HttpStatusCodes.PRECONDITION_REQUIRED;
|
||||
var PROCESSING = HttpStatusCodes.PROCESSING;
|
||||
var PROXY_AUTHENTICATION_REQUIRED = HttpStatusCodes.PROXY_AUTHENTICATION_REQUIRED;
|
||||
var REQUEST_HEADER_FIELDS_TOO_LARGE = HttpStatusCodes.REQUEST_HEADER_FIELDS_TOO_LARGE;
|
||||
var REQUEST_TIMEOUT = HttpStatusCodes.REQUEST_TIMEOUT;
|
||||
var REQUEST_TOO_LONG = HttpStatusCodes.REQUEST_TOO_LONG;
|
||||
var REQUEST_URI_TOO_LONG = HttpStatusCodes.REQUEST_URI_TOO_LONG;
|
||||
var REQUESTED_RANGE_NOT_SATISFIABLE = HttpStatusCodes.REQUESTED_RANGE_NOT_SATISFIABLE;
|
||||
var RESET_CONTENT = HttpStatusCodes.RESET_CONTENT;
|
||||
var SEE_OTHER = HttpStatusCodes.SEE_OTHER;
|
||||
var SERVICE_UNAVAILABLE = HttpStatusCodes.SERVICE_UNAVAILABLE;
|
||||
var SWITCHING_PROTOCOLS = HttpStatusCodes.SWITCHING_PROTOCOLS;
|
||||
var TEMPORARY_REDIRECT = HttpStatusCodes.TEMPORARY_REDIRECT;
|
||||
var TOO_MANY_REQUESTS = HttpStatusCodes.TOO_MANY_REQUESTS;
|
||||
var UNAUTHORIZED = HttpStatusCodes.UNAUTHORIZED;
|
||||
var UNPROCESSABLE_ENTITY = HttpStatusCodes.UNPROCESSABLE_ENTITY;
|
||||
var UNSUPPORTED_MEDIA_TYPE = HttpStatusCodes.UNSUPPORTED_MEDIA_TYPE;
|
||||
var USE_PROXY = HttpStatusCodes.USE_PROXY;
|
||||
|
||||
var ACCEPTED_Text = HttpStatusCodes.getStatusText(202);
|
||||
var BAD_GATEWAY_Text = HttpStatusCodes.getStatusText(502);
|
||||
var BAD_REQUEST_Text = HttpStatusCodes.getStatusText(400);
|
||||
var CONFLICT_Text = HttpStatusCodes.getStatusText(409);
|
||||
var CONTINUE_Text = HttpStatusCodes.getStatusText(100);
|
||||
var CREATED_Text = HttpStatusCodes.getStatusText(201);
|
||||
var EXPECTATION_FAILED_Text = HttpStatusCodes.getStatusText(417);
|
||||
var FAILED_DEPENDENCY_Text = HttpStatusCodes.getStatusText(424);
|
||||
var FORBIDDEN_Text = HttpStatusCodes.getStatusText(403);
|
||||
var GATEWAY_TIMEOUT_Text = HttpStatusCodes.getStatusText(504);
|
||||
var GONE_Text = HttpStatusCodes.getStatusText(410);
|
||||
var HTTP_VERSION_NOT_SUPPORTED_Text = HttpStatusCodes.getStatusText(505);
|
||||
var INSUFFICIENT_SPACE_ON_RESOURCE_Text = HttpStatusCodes.getStatusText(419);
|
||||
var INSUFFICIENT_STORAGE_Text = HttpStatusCodes.getStatusText(507);
|
||||
var INTERNAL_SERVER_ERROR_Text = HttpStatusCodes.getStatusText(500);
|
||||
var LENGTH_REQUIRED_Text = HttpStatusCodes.getStatusText(411);
|
||||
var LOCKED_Text = HttpStatusCodes.getStatusText(423);
|
||||
var METHOD_FAILURE_Text = HttpStatusCodes.getStatusText(420);
|
||||
var METHOD_NOT_ALLOWED_Text = HttpStatusCodes.getStatusText(405);
|
||||
var MOVED_PERMANENTLY_Text = HttpStatusCodes.getStatusText(301);
|
||||
var MOVED_TEMPORARILY_Text = HttpStatusCodes.getStatusText(302);
|
||||
var MULTI_STATUS_Text = HttpStatusCodes.getStatusText(207);
|
||||
var MULTIPLE_CHOICES_Text = HttpStatusCodes.getStatusText(300);
|
||||
var NETWORK_AUTHENTICATION_REQUIRED_Text = HttpStatusCodes.getStatusText(511);
|
||||
var NO_CONTENT_Text = HttpStatusCodes.getStatusText(204);
|
||||
var NON_AUTHORITATIVE_INFORMATION_Text = HttpStatusCodes.getStatusText(203);
|
||||
var NOT_ACCEPTABLE_Text = HttpStatusCodes.getStatusText(406);
|
||||
var NOT_FOUND_Text = HttpStatusCodes.getStatusText(404);
|
||||
var NOT_IMPLEMENTED_Text = HttpStatusCodes.getStatusText(501);
|
||||
var NOT_MODIFIED_Text = HttpStatusCodes.getStatusText(304);
|
||||
var OK_Text = HttpStatusCodes.getStatusText(200);
|
||||
var PARTIAL_CONTENT_Text = HttpStatusCodes.getStatusText(206);
|
||||
var PAYMENT_REQUIRED_Text = HttpStatusCodes.getStatusText(402);
|
||||
var PRECONDITION_FAILED_Text = HttpStatusCodes.getStatusText(412);
|
||||
var PRECONDITION_REQUIRED_Text = HttpStatusCodes.getStatusText(428);
|
||||
var PROCESSING_Text = HttpStatusCodes.getStatusText(102);
|
||||
var PROXY_AUTHENTICATION_REQUIRED_Text = HttpStatusCodes.getStatusText(407);
|
||||
var REQUEST_HEADER_FIELDS_TOO_LARGE_Text = HttpStatusCodes.getStatusText(431);
|
||||
var REQUEST_TIMEOUT_Text = HttpStatusCodes.getStatusText(408);
|
||||
var REQUEST_TOO_LONG_Text = HttpStatusCodes.getStatusText(413);
|
||||
var REQUEST_URI_TOO_LONG_Text = HttpStatusCodes.getStatusText(414);
|
||||
var REQUESTED_RANGE_NOT_SATISFIABLE_Text = HttpStatusCodes.getStatusText(416);
|
||||
var RESET_CONTENT_Text = HttpStatusCodes.getStatusText(205);
|
||||
var SEE_OTHER_Text = HttpStatusCodes.getStatusText(303);
|
||||
var SERVICE_UNAVAILABLE_Text = HttpStatusCodes.getStatusText(503);
|
||||
var SWITCHING_PROTOCOLS_Text = HttpStatusCodes.getStatusText(101);
|
||||
var TEMPORARY_REDIRECT_Text = HttpStatusCodes.getStatusText(307);
|
||||
var TOO_MANY_REQUESTS_Text = HttpStatusCodes.getStatusText(429);
|
||||
var UNAUTHORIZED_Text = HttpStatusCodes.getStatusText(401);
|
||||
var UNPROCESSABLE_ENTITY_Text = HttpStatusCodes.getStatusText(422);
|
||||
var UNSUPPORTED_MEDIA_TYPE_Text = HttpStatusCodes.getStatusText(415);
|
||||
var USE_PROXY_Text = HttpStatusCodes.getStatusText(305);
|
||||
60
types/http-status-codes/index.d.ts
vendored
60
types/http-status-codes/index.d.ts
vendored
@@ -1,60 +0,0 @@
|
||||
// Type definitions for Node.JS package http-status-codes v1.0.5
|
||||
// Project: https://github.com/prettymuchbryce/node-http-status
|
||||
// Definitions by: Josh McCullough <https://github.com/JoshMcCullough>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
export declare var ACCEPTED: number;
|
||||
export declare var BAD_GATEWAY: number;
|
||||
export declare var BAD_REQUEST: number;
|
||||
export declare var CONFLICT: number;
|
||||
export declare var CONTINUE: number;
|
||||
export declare var CREATED: number;
|
||||
export declare var EXPECTATION_FAILED: number;
|
||||
export declare var FAILED_DEPENDENCY: number;
|
||||
export declare var FORBIDDEN: number;
|
||||
export declare var GATEWAY_TIMEOUT: number;
|
||||
export declare var GONE: number;
|
||||
export declare var HTTP_VERSION_NOT_SUPPORTED: number;
|
||||
export declare var INSUFFICIENT_SPACE_ON_RESOURCE: number;
|
||||
export declare var INSUFFICIENT_STORAGE: number;
|
||||
export declare var INTERNAL_SERVER_ERROR: number;
|
||||
export declare var LENGTH_REQUIRED: number;
|
||||
export declare var LOCKED: number;
|
||||
export declare var METHOD_FAILURE: number;
|
||||
export declare var METHOD_NOT_ALLOWED: number;
|
||||
export declare var MOVED_PERMANENTLY: number;
|
||||
export declare var MOVED_TEMPORARILY: number;
|
||||
export declare var MULTI_STATUS: number;
|
||||
export declare var MULTIPLE_CHOICES: number;
|
||||
export declare var NETWORK_AUTHENTICATION_REQUIRED: number;
|
||||
export declare var NO_CONTENT: number;
|
||||
export declare var NON_AUTHORITATIVE_INFORMATION: number;
|
||||
export declare var NOT_ACCEPTABLE: number;
|
||||
export declare var NOT_FOUND: number;
|
||||
export declare var NOT_IMPLEMENTED: number;
|
||||
export declare var NOT_MODIFIED: number;
|
||||
export declare var OK: number;
|
||||
export declare var PARTIAL_CONTENT: number;
|
||||
export declare var PAYMENT_REQUIRED: number;
|
||||
export declare var PRECONDITION_FAILED: number;
|
||||
export declare var PRECONDITION_REQUIRED: number;
|
||||
export declare var PROCESSING: number;
|
||||
export declare var PROXY_AUTHENTICATION_REQUIRED: number;
|
||||
export declare var REQUEST_HEADER_FIELDS_TOO_LARGE: number;
|
||||
export declare var REQUEST_TIMEOUT: number;
|
||||
export declare var REQUEST_TOO_LONG: number;
|
||||
export declare var REQUEST_URI_TOO_LONG: number;
|
||||
export declare var REQUESTED_RANGE_NOT_SATISFIABLE: number;
|
||||
export declare var RESET_CONTENT: number;
|
||||
export declare var SEE_OTHER: number;
|
||||
export declare var SERVICE_UNAVAILABLE: number;
|
||||
export declare var SWITCHING_PROTOCOLS: number;
|
||||
export declare var TEMPORARY_REDIRECT: number;
|
||||
export declare var TOO_MANY_REQUESTS: number;
|
||||
export declare var UNAUTHORIZED: number;
|
||||
export declare var UNPROCESSABLE_ENTITY: number;
|
||||
export declare var UNSUPPORTED_MEDIA_TYPE: number;
|
||||
export declare var USE_PROXY: number;
|
||||
|
||||
export declare function getStatusText(statusCode: number): string;
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"http-status-codes-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"interface-over-type-literal": false,
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-duplicate-variable": false,
|
||||
"no-empty-interface": false,
|
||||
"no-for-in-array": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": false,
|
||||
"no-irregular-whitespace": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-misused-new": false,
|
||||
"no-namespace": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-reference-import": false,
|
||||
"no-relative-import-in-test": false,
|
||||
"no-self-import": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-string-throw": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-useless-files": false,
|
||||
"no-var-keyword": false,
|
||||
"no-var-requires": false,
|
||||
"no-void-expression": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": false,
|
||||
"prefer-declare-function": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-template": false,
|
||||
"radix": false,
|
||||
"semicolon": false,
|
||||
"space-before-function-paren": false,
|
||||
"space-within-parens": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"trim-file": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false,
|
||||
"whitespace": false
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
// Code examples from iconv-lite README
|
||||
|
||||
import * as iconv from "iconv-lite";
|
||||
|
||||
import * as assert from "assert";
|
||||
import * as fs from "fs";
|
||||
import * as http from "http";
|
||||
|
||||
// Basic API
|
||||
(() => {
|
||||
// Convert from an encoded buffer to js string.
|
||||
const str: string = iconv.decode(new Buffer([0x68, 0x65, 0x6c, 0x6c, 0x6f]), 'win1251');
|
||||
|
||||
// Convert from js string to an encoded buffer.
|
||||
const buf: Buffer = iconv.encode("Sample input string", 'win1251');
|
||||
|
||||
// Check if encoding is supported
|
||||
const exists: boolean = iconv.encodingExists("us-ascii");
|
||||
})();
|
||||
|
||||
// Streaming API
|
||||
(() => {
|
||||
// Decode stream (from binary stream to js strings)
|
||||
http.createServer(function(req, res) {
|
||||
var converterStream = iconv.decodeStream('win1251');
|
||||
req.pipe(converterStream);
|
||||
|
||||
converterStream.on('data', function(str: string) {
|
||||
console.log(str); // Do something with decoded strings, chunk-by-chunk.
|
||||
});
|
||||
});
|
||||
|
||||
// Convert encoding streaming example
|
||||
fs.createReadStream('file-in-win1251.txt')
|
||||
.pipe(iconv.decodeStream('win1251'))
|
||||
.pipe(iconv.encodeStream('ucs2'))
|
||||
.pipe(fs.createWriteStream('file-in-ucs2.txt'));
|
||||
|
||||
// Sugar: all encode/decode streams have .collect(cb) method to accumulate data.
|
||||
http.createServer(function(req, res) {
|
||||
req.pipe(iconv.decodeStream('win1251')).collect(function(err, body) {
|
||||
assert(typeof body == 'string');
|
||||
console.log(body); // full request body string
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
||||
// Extend Node.js own encodings
|
||||
(() => {
|
||||
iconv.extendNodeEncodings();
|
||||
iconv.undoExtendNodeEncodings();
|
||||
})();
|
||||
32
types/iconv-lite/index.d.ts
vendored
32
types/iconv-lite/index.d.ts
vendored
@@ -1,32 +0,0 @@
|
||||
// Type definitions for iconv-lite
|
||||
// Project: https://github.com/ashtuchkin/iconv-lite
|
||||
// Definitions by: Martin Poelstra <https://github.com/poelstra>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import stream = require("stream");
|
||||
|
||||
export interface Options {
|
||||
stripBOM: boolean;
|
||||
addBOM: boolean;
|
||||
defaultEncoding: string;
|
||||
}
|
||||
|
||||
export function decode(buffer: Buffer, encoding: string, options?: Options): string;
|
||||
export function encode(source: string, encoding: string, options?: Options): Buffer;
|
||||
export function encodingExists(encoding: string): boolean;
|
||||
|
||||
export class DecodeStream extends stream.Transform {
|
||||
collect(cb: (err: Error, decoded: string) => any): DecodeStream;
|
||||
}
|
||||
|
||||
export class EncodeStream extends stream.Transform {
|
||||
collect(cb: (err: Error, decoded: Buffer) => any): EncodeStream;
|
||||
}
|
||||
|
||||
export function decodeStream(encoding: string, options?: Options): DecodeStream;
|
||||
export function encodeStream(encoding: string, options?: Options): EncodeStream;
|
||||
|
||||
export function extendNodeEncodings(): void;
|
||||
export function undoExtendNodeEncodings(): void;
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"iconv-lite-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"interface-over-type-literal": false,
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-duplicate-variable": false,
|
||||
"no-empty-interface": false,
|
||||
"no-for-in-array": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": false,
|
||||
"no-irregular-whitespace": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-misused-new": false,
|
||||
"no-namespace": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-reference-import": false,
|
||||
"no-relative-import-in-test": false,
|
||||
"no-self-import": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-string-throw": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-useless-files": false,
|
||||
"no-var-keyword": false,
|
||||
"no-var-requires": false,
|
||||
"no-void-expression": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": false,
|
||||
"prefer-declare-function": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-template": false,
|
||||
"radix": false,
|
||||
"semicolon": false,
|
||||
"space-before-function-paren": false,
|
||||
"space-within-parens": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"trim-file": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false,
|
||||
"whitespace": false
|
||||
}
|
||||
}
|
||||
@@ -20,8 +20,11 @@ br.compress(Buffer.from('foo', 'utf8'), onCompress);
|
||||
|
||||
br.compress(Buffer.from('foo', 'utf8'), opts, onCompress);
|
||||
|
||||
const stream = br.compressStream();
|
||||
stream.flush();
|
||||
|
||||
createReadStream(__filename)
|
||||
.pipe(br.compressStream())
|
||||
.pipe(stream)
|
||||
.pipe(createWriteStream('foo.ts'));
|
||||
|
||||
createReadStream(__dirname)
|
||||
|
||||
7
types/iltorb/index.d.ts
vendored
7
types/iltorb/index.d.ts
vendored
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/MayhemYDG/iltorb
|
||||
// Definitions by: Arturas Molcanovas <https://github.com/Alorel>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/// <reference types="node"/>
|
||||
|
||||
@@ -16,6 +17,10 @@ export interface BrotliEncodeParams {
|
||||
size_hint?: number;
|
||||
}
|
||||
|
||||
export interface BrotliFlushable {
|
||||
flush(): void;
|
||||
}
|
||||
|
||||
export type IltorbCallback = (err: Error | null | undefined, output: Buffer) => void;
|
||||
|
||||
export function compress(buffer: Buffer, options: BrotliEncodeParams, callback: IltorbCallback): void;
|
||||
@@ -26,5 +31,5 @@ export function decompress(buffer: Buffer, callback: IltorbCallback): void;
|
||||
export function compressSync(buffer: Buffer, options?: BrotliEncodeParams): Buffer;
|
||||
export function decompressSync(buffer: Buffer): Buffer;
|
||||
|
||||
export function compressStream(options?: BrotliEncodeParams): Transform;
|
||||
export function compressStream(options?: BrotliEncodeParams): Transform & BrotliFlushable;
|
||||
export function decompressStream(): Transform;
|
||||
|
||||
398
types/ionic/index.d.ts
vendored
398
types/ionic/index.d.ts
vendored
@@ -1,398 +0,0 @@
|
||||
// Type definitions for Ionic
|
||||
// Project: http://ionicframework.com
|
||||
// Definitions by: Spencer Williams <https://github.com/spencerwi>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="angular" />
|
||||
|
||||
interface IonicStatic {
|
||||
/**
|
||||
* What Ionic package version is.
|
||||
*/
|
||||
version: string;
|
||||
Platform: {
|
||||
/**
|
||||
* Trigger a callback once the device is ready, or immediately
|
||||
* if the device is already ready. This method can be run from
|
||||
* anywhere and does not need to be wrapped by any additonal methods.
|
||||
* When the app is within a WebView (Cordova), it’ll fire
|
||||
* the callback once the device is ready. If the app is within
|
||||
* a web browser, it’ll fire the callback after window.load.
|
||||
* Please remember that Cordova features (Camera, FileSystem, etc) still
|
||||
* will not work in a web browser.
|
||||
*/
|
||||
ready(callback: ()=>any): void;
|
||||
/**
|
||||
* Set the grade of the device: ‘a’, ‘b’, or ‘c’. ‘a’ is the best
|
||||
* (most css features enabled), ‘c’ is the worst. By default, sets the grade
|
||||
* depending on the current device.
|
||||
*/
|
||||
setGrade(grade: string): void;
|
||||
/**
|
||||
* Return the current device (given by cordova).
|
||||
*/
|
||||
device(): any;
|
||||
/**
|
||||
* Check if the platform name provided is detected.
|
||||
*/
|
||||
is(platformName: string): boolean;
|
||||
/**
|
||||
* Check if we are running within a WebView (such as Cordova).
|
||||
*/
|
||||
isWebView(): boolean;
|
||||
/**
|
||||
* Whether we are running on iPad.
|
||||
*/
|
||||
isIPad(): boolean;
|
||||
/**
|
||||
* Whether we are running on iOS.
|
||||
*/
|
||||
isIOS(): boolean;
|
||||
/**
|
||||
* Whether we are running on Android.
|
||||
*/
|
||||
isAndroid(): boolean;
|
||||
/**
|
||||
* Whether we are running on Windows Phone.
|
||||
*/
|
||||
isWindowsPhone(): boolean;
|
||||
/**
|
||||
* The name of the current platform.
|
||||
*/
|
||||
platform(): string;
|
||||
/**
|
||||
* The version of the current device platform.
|
||||
*/
|
||||
version(): number;
|
||||
/**
|
||||
* Exit the app.
|
||||
*/
|
||||
exitApp(): void;
|
||||
/**
|
||||
* Shows or hides the device status bar (in Cordova). Requires cordova plugin add org.apache.cordova.statusbar
|
||||
*/
|
||||
showStatusBar(shouldShow: boolean): void;
|
||||
/**
|
||||
* Sets whether the app is fullscreen or not (in Cordova).
|
||||
*/
|
||||
fullScreen(showFullScreen?: boolean, showStatusBar?: boolean): void;
|
||||
/**
|
||||
* Whether the device is ready.
|
||||
*/
|
||||
isReady: boolean;
|
||||
/**
|
||||
* Whether the device is fullscreen.
|
||||
*/
|
||||
isFullScreen: boolean;
|
||||
/**
|
||||
* An array of all platforms found.
|
||||
*/
|
||||
platforms: Array<string>;
|
||||
/**
|
||||
* What grade the current platform is.
|
||||
*/
|
||||
grade: string;
|
||||
};
|
||||
}
|
||||
|
||||
declare var ionic: IonicStatic;
|
||||
|
||||
declare module 'ionic' {
|
||||
export = ionic;
|
||||
}
|
||||
|
||||
declare namespace ionic {
|
||||
namespace actionSheet {
|
||||
interface IonicActionSheetService {
|
||||
show(options: IonicActionSheetOptions): ()=>void;
|
||||
}
|
||||
interface IonicActionSheetButton {
|
||||
text: string;
|
||||
}
|
||||
interface IonicActionSheetOptions {
|
||||
buttons?: Array<IonicActionSheetButton>;
|
||||
titleText?: string;
|
||||
cancelText?: string;
|
||||
destructiveText?: string;
|
||||
cancel?: ()=>any;
|
||||
buttonClicked?: (index: number)=>boolean;
|
||||
destructiveButtonClicked?: ()=>boolean;
|
||||
cancelOnStateChange?: boolean;
|
||||
cssClass?: string;
|
||||
}
|
||||
}
|
||||
namespace backdrop {
|
||||
interface IonicBackdropService {
|
||||
retain(): void;
|
||||
release(): void;
|
||||
}
|
||||
}
|
||||
namespace gestures {
|
||||
interface IonicGestureService {
|
||||
on(eventType: string, callback: (e: any)=>any, $element: angular.IAugmentedJQuery, options: any): IonicGesture;
|
||||
off(gesture: IonicGesture, eventType: string, callback: (e: any)=>any): void;
|
||||
}
|
||||
|
||||
interface IonicGesture {
|
||||
element: Element;
|
||||
enabled: boolean;
|
||||
options: {stop_browser_behavior: string };
|
||||
on(gesture: string, handler: Function): IonicGesture;
|
||||
off(gesture: string, handler: Function): IonicGesture;
|
||||
trigger(gesture: string, eventData: any): IonicGesture;
|
||||
enable(state: boolean): IonicGesture;
|
||||
}
|
||||
|
||||
}
|
||||
namespace list {
|
||||
interface IonicListDelegate {
|
||||
showReorder(showReorder?: boolean): boolean;
|
||||
showDelete(showDelete?: boolean): boolean;
|
||||
canSwipeItems(canSwipeItems?: boolean): boolean;
|
||||
closeOptionButtons(): void;
|
||||
$getByHandle(handle: string): IonicListDelegate;
|
||||
}
|
||||
}
|
||||
namespace loading {
|
||||
interface IonicLoadingService {
|
||||
show(opts?: IonicLoadingOptions): void;
|
||||
hide(): void;
|
||||
}
|
||||
interface IonicLoadingOptions {
|
||||
template?: string;
|
||||
templateUrl?: string;
|
||||
scope?: any;
|
||||
noBackdrop?: boolean;
|
||||
hideOnStateChange?: boolean;
|
||||
delay?: number;
|
||||
duration?: number;
|
||||
}
|
||||
}
|
||||
namespace modal {
|
||||
interface IonicModalService {
|
||||
fromTemplate(templateString: string, options?: IonicModalOptions): IonicModalController;
|
||||
fromTemplateUrl(templateUrl: string, options?: IonicModalOptions): angular.IPromise<IonicModalController>;
|
||||
}
|
||||
|
||||
interface IonicModalController {
|
||||
initialize(options: IonicModalOptions): void;
|
||||
show(): angular.IPromise<void>;
|
||||
hide(): angular.IPromise<void>;
|
||||
remove(): angular.IPromise<void>;
|
||||
isShown(): boolean;
|
||||
}
|
||||
|
||||
interface IonicModalOptions {
|
||||
scope?: any;
|
||||
animation?: string;
|
||||
focusFirstInput?: boolean;
|
||||
backdropClickToClose?: boolean;
|
||||
hardwareBackButtonClose?: boolean;
|
||||
}
|
||||
}
|
||||
namespace navigation {
|
||||
interface IonicNavBarDelegate {
|
||||
align(direction?: string): void;
|
||||
showBackButton(show?: boolean): boolean;
|
||||
showBar(show?: boolean): boolean;
|
||||
title(title: string): void;
|
||||
}
|
||||
|
||||
interface IonicHistoryService {
|
||||
viewHistory(): any;
|
||||
|
||||
currentView(view?: any): any;
|
||||
currentHistoryId(): string;
|
||||
currentTitle(val?: string): string;
|
||||
|
||||
backView(view?: any): any;
|
||||
backTitle(): string;
|
||||
|
||||
forwardView(view?: any): any;
|
||||
|
||||
currentStateName(): string;
|
||||
|
||||
goBack(backCount?: number): void;
|
||||
removeBackView(): void;
|
||||
clearHistory(): void;
|
||||
clearCache(): angular.IPromise<any>;
|
||||
nextViewOptions(options: IonicHistoryNextViewOptions): void;
|
||||
}
|
||||
interface IonicHistoryNextViewOptions {
|
||||
disableAnimate?: boolean;
|
||||
disableBack?: boolean;
|
||||
historyRoot?: boolean;
|
||||
}
|
||||
}
|
||||
namespace platform {
|
||||
interface IonicPlatformService {
|
||||
onHardwareBackButton(callback: Function): void;
|
||||
offHardwareBackButton(callback: Function): void;
|
||||
registerBackButtonAction(callback: Function, priority: number, actionId?: any): Function;
|
||||
on(type: string, callback: Function): Function;
|
||||
ready(callback?: Function): angular.IPromise<any>;
|
||||
}
|
||||
}
|
||||
namespace popover {
|
||||
interface IonicPopoverService {
|
||||
fromTemplate(templateString: string, options: IonicPopoverOptions): IonicPopoverController;
|
||||
fromTemplateUrl(templateUrl: string, options: IonicPopoverOptions): angular.IPromise<IonicPopoverController>;
|
||||
}
|
||||
interface IonicPopoverController {
|
||||
initialize(options: IonicPopoverOptions): void;
|
||||
show($event?: any): angular.IPromise<any>;
|
||||
hide(): angular.IPromise<any>;
|
||||
isShown(): boolean;
|
||||
remove(): angular.IPromise<any>;
|
||||
}
|
||||
interface IonicPopoverOptions {
|
||||
scope?: any;
|
||||
focusFirstInput?: boolean;
|
||||
backdropClickToClose?: boolean;
|
||||
hardwareBackButtonClose?: boolean;
|
||||
}
|
||||
}
|
||||
namespace popup {
|
||||
interface IonicPopupService {
|
||||
show(options: IonicPopupFullOptions): IonicPopupPromise;
|
||||
alert(options: IonicPopupAlertOptions): IonicPopupPromise;
|
||||
confirm(options: IonicPopupConfirmOptions): IonicPopupConfirmPromise;
|
||||
prompt(options: IonicPopupPromptOptions): IonicPopupPromise;
|
||||
}
|
||||
|
||||
interface IonicPopupConfirmPromise extends angular.IPromise<boolean> {
|
||||
close(value?: boolean): void;
|
||||
}
|
||||
interface IonicPopupPromise extends angular.IPromise<any> {
|
||||
close(value?: any): any;
|
||||
}
|
||||
interface IonicPopupBaseOptions {
|
||||
title?: string;
|
||||
cssClass?: string;
|
||||
subTitle?: string;
|
||||
template?: string;
|
||||
templateUrl?: string;
|
||||
}
|
||||
interface IonicPopupFullOptions extends IonicPopupBaseOptions {
|
||||
scope?: any;
|
||||
buttons?: Array<IonicPopupButton>;
|
||||
}
|
||||
interface IonicPopupButton {
|
||||
text: string;
|
||||
type?: string;
|
||||
onTap?(event?: any): void;
|
||||
}
|
||||
interface IonicPopupAlertOptions extends IonicPopupBaseOptions {
|
||||
okText?: string;
|
||||
okType?: string;
|
||||
}
|
||||
interface IonicPopupConfirmOptions extends IonicPopupBaseOptions {
|
||||
cancelText?: string;
|
||||
cancelType?: string;
|
||||
okText?: string;
|
||||
okType?: string;
|
||||
}
|
||||
interface IonicPopupPromptOptions extends IonicPopupBaseOptions {
|
||||
inputType?: string;
|
||||
inputPlaceholder?: string;
|
||||
cancelText?: string;
|
||||
cancelType?: string;
|
||||
okText?: string;
|
||||
okType?: string;
|
||||
}
|
||||
}
|
||||
namespace scroll {
|
||||
interface IonicScrollDelegate {
|
||||
resize(): void;
|
||||
scrollTop(shouldAnimate?: boolean): void;
|
||||
scrollBottom(shouldAnimate?: boolean): void;
|
||||
scrollTo(left: number, top: number, shouldAnimate?: boolean): void;
|
||||
scrollBy(left: number, top: number, shouldAnimate?: boolean): void;
|
||||
zoomTo(level: number, animate?: boolean, originLeft?: number, originTop?: number): void;
|
||||
zoomBy(factor: number, animate?: boolean, originLeft?: number, originTop?: number): void;
|
||||
getScrollPosition(): {left: number; top: number};
|
||||
anchorScroll(shouldAnimate?: boolean): void;
|
||||
freezeScroll(shouldFreeze?: boolean): boolean;
|
||||
freezeAllScrolls(shouldFreeze?: boolean): boolean;
|
||||
getScrollView(): any;
|
||||
$getByHandle(handle: string): IonicScrollDelegate;
|
||||
}
|
||||
}
|
||||
namespace sideMenu {
|
||||
interface IonicSideMenuDelegate {
|
||||
toggleLeft(isOpen?: boolean): void;
|
||||
toggleRight(isOpen?: boolean): void;
|
||||
getOpenRatio(): number;
|
||||
isOpen(): boolean;
|
||||
isOpenLeft(): boolean;
|
||||
isOpenRight(): boolean;
|
||||
canDragContent(canDrag?: boolean): boolean;
|
||||
edgeDragThreshold(value?: boolean|number): boolean;
|
||||
$getByHandle(handle: string): IonicSideMenuDelegate;
|
||||
}
|
||||
}
|
||||
namespace slideBox {
|
||||
interface IonicSlideBoxDelegate {
|
||||
update(): void;
|
||||
slide(to: number, speed?: number): void;
|
||||
enableSlide(shouldEnable?: boolean): boolean;
|
||||
previous(speed?: number): void;
|
||||
next(speed?: number): void;
|
||||
stop(): void;
|
||||
start(): void;
|
||||
currentIndex(): number;
|
||||
slidesCount(): number;
|
||||
$getByHandle(handle: string): IonicSlideBoxDelegate;
|
||||
}
|
||||
}
|
||||
namespace tabs {
|
||||
interface IonicTabsDelegate {
|
||||
select(index: number): void;
|
||||
selectedIndex(): number;
|
||||
$getByHandle(handle: string): IonicTabsDelegate;
|
||||
showBar(show?: boolean): boolean;
|
||||
}
|
||||
}
|
||||
namespace utility {
|
||||
interface IonicConfigProvider {
|
||||
views: {
|
||||
transition(transition?: string): string;
|
||||
maxCache(maxNumber?: number): number;
|
||||
forwardCache(value?: boolean): boolean;
|
||||
swipeBackEnabled(value?: boolean): boolean;
|
||||
};
|
||||
scrolling: {
|
||||
jsScrolling(value?: boolean): boolean;
|
||||
};
|
||||
backButton: {
|
||||
icon(value?: string): string;
|
||||
text(value?: string): string;
|
||||
previousTitleText(value?: boolean): boolean;
|
||||
};
|
||||
form: {
|
||||
checkbox(value?: string): string;
|
||||
toggle(value?: string): string;
|
||||
};
|
||||
spinner: {
|
||||
icon(value?: string): string;
|
||||
};
|
||||
tabs: {
|
||||
style(value?: string): string;
|
||||
position(value?: string): string;
|
||||
};
|
||||
templates: {
|
||||
maxPrefetch(value?: number): number;
|
||||
};
|
||||
navBar: {
|
||||
alignTitle(value?: string): string;
|
||||
positionPrimaryButtons(value?: string): string;
|
||||
positionSecondaryButtons(value?: string): string;
|
||||
};
|
||||
}
|
||||
interface IonicPositionService {
|
||||
position(element: any): {top: number; left: number; width: number; height: number};
|
||||
offset(element: any): {top: number; left: number; width: number; height: number};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,417 +0,0 @@
|
||||
|
||||
|
||||
var testIonic = angular.module('testIonic', ['ionic']);
|
||||
|
||||
testIonic.config(['$ionicConfigProvider', ($ionicConfigProvider: ionic.utility.IonicConfigProvider)=>{
|
||||
var transition: string = $ionicConfigProvider.views.transition();
|
||||
$ionicConfigProvider.views.transition("transition");
|
||||
var maxCache: number = $ionicConfigProvider.views.maxCache();
|
||||
$ionicConfigProvider.views.maxCache(10);
|
||||
var forwardCache: boolean = $ionicConfigProvider.views.forwardCache();
|
||||
$ionicConfigProvider.views.forwardCache(true);
|
||||
var swipeBackEnabled: boolean = $ionicConfigProvider.views.swipeBackEnabled();
|
||||
$ionicConfigProvider.views.swipeBackEnabled(true);
|
||||
|
||||
var jsScrolling: boolean = $ionicConfigProvider.scrolling.jsScrolling();
|
||||
$ionicConfigProvider.scrolling.jsScrolling(true);
|
||||
|
||||
var backButtonIcon: string = $ionicConfigProvider.backButton.icon();
|
||||
$ionicConfigProvider.backButton.icon("icon");
|
||||
var backButtonText: string = $ionicConfigProvider.backButton.text();
|
||||
$ionicConfigProvider.backButton.text("back");
|
||||
var usePreviousTitleText: boolean = $ionicConfigProvider.backButton.previousTitleText();
|
||||
$ionicConfigProvider.backButton.previousTitleText(false);
|
||||
|
||||
var checkbox: string = $ionicConfigProvider.form.checkbox();
|
||||
$ionicConfigProvider.form.checkbox("square");
|
||||
var toggle: string = $ionicConfigProvider.form.toggle();
|
||||
$ionicConfigProvider.form.toggle("small");
|
||||
|
||||
var spinnerIcon: string = $ionicConfigProvider.spinner.icon();
|
||||
$ionicConfigProvider.spinner.icon("spiral");
|
||||
|
||||
var tabsStyle: string = $ionicConfigProvider.tabs.style();
|
||||
$ionicConfigProvider.tabs.style("standard");
|
||||
var tabsPosition: string = $ionicConfigProvider.tabs.position();
|
||||
$ionicConfigProvider.tabs.position("bottom");
|
||||
|
||||
var maxPrefetch: number = $ionicConfigProvider.templates.maxPrefetch();
|
||||
$ionicConfigProvider.templates.maxPrefetch(10);
|
||||
|
||||
var alignTitle: string = $ionicConfigProvider.navBar.alignTitle();
|
||||
$ionicConfigProvider.navBar.alignTitle("platform");
|
||||
var positionPrimaryButtons: string = $ionicConfigProvider.navBar.positionPrimaryButtons();
|
||||
$ionicConfigProvider.navBar.positionPrimaryButtons("platform");
|
||||
var positionSecondaryButtons: string = $ionicConfigProvider.navBar.positionSecondaryButtons();
|
||||
$ionicConfigProvider.navBar.positionSecondaryButtons("platform");
|
||||
}])
|
||||
|
||||
class IonicTestController {
|
||||
public static $inject = [
|
||||
'$ionicActionSheet',
|
||||
'$ionicBackdrop',
|
||||
'$ionicGesture',
|
||||
'$ionicListDelegate',
|
||||
'$ionicLoading',
|
||||
'$ionicModal',
|
||||
'$ionicNavBarDelegate',
|
||||
'$ionicHistory',
|
||||
'$ionicPlatform',
|
||||
'$ionicPopover',
|
||||
'$ionicPopup',
|
||||
'$ionicScrollDelegate',
|
||||
'$ionicSideMenuDelegate',
|
||||
'$ionicSlideBoxDelegate',
|
||||
'$ionicTabsDelegate',
|
||||
'$ionicPosition'
|
||||
];
|
||||
constructor(
|
||||
private $ionicActionSheet: ionic.actionSheet.IonicActionSheetService,
|
||||
private $ionicBackdrop: ionic.backdrop.IonicBackdropService,
|
||||
private $ionicGesture: ionic.gestures.IonicGestureService,
|
||||
private $ionicListDelegate: ionic.list.IonicListDelegate,
|
||||
private $ionicLoading: ionic.loading.IonicLoadingService,
|
||||
private $ionicModal: ionic.modal.IonicModalService,
|
||||
private $ionicNavBarDelegate: ionic.navigation.IonicNavBarDelegate,
|
||||
private $ionicHistory: ionic.navigation.IonicHistoryService,
|
||||
private $ionicPlatform: ionic.platform.IonicPlatformService,
|
||||
private $ionicPopover: ionic.popover.IonicPopoverService,
|
||||
private $ionicPopup: ionic.popup.IonicPopupService,
|
||||
private $ionicScrollDelegate: ionic.scroll.IonicScrollDelegate,
|
||||
private $ionicSideMenuDelegate: ionic.sideMenu.IonicSideMenuDelegate,
|
||||
private $ionicSlideBoxDelegate: ionic.slideBox.IonicSlideBoxDelegate,
|
||||
private $ionicTabsDelegate: ionic.tabs.IonicTabsDelegate,
|
||||
private $ionicPositionService: ionic.utility.IonicPositionService
|
||||
){}
|
||||
|
||||
private testActionSheet(): void {
|
||||
var closeActionSheetFn: ()=>void = this.$ionicActionSheet.show({
|
||||
buttons: [{ text: 'A button' }],
|
||||
titleText: "titleText",
|
||||
cancelText: "cancelText",
|
||||
destructiveText: "destructiveText",
|
||||
cancel: ()=>{ console.log("cancel"); },
|
||||
buttonClicked: (index)=>{
|
||||
console.log("buttonClicked");
|
||||
return index === 0;
|
||||
},
|
||||
destructiveButtonClicked: ()=>{
|
||||
console.log("destructiveButtonClicked");
|
||||
return false;
|
||||
},
|
||||
cancelOnStateChange: true,
|
||||
cssClass: "cssClass"
|
||||
});
|
||||
closeActionSheetFn();
|
||||
}
|
||||
private testBackdrop(): void {
|
||||
this.$ionicBackdrop.retain();
|
||||
this.$ionicBackdrop.release();
|
||||
}
|
||||
private testGesture(): void {
|
||||
var gesture: ionic.gestures.IonicGesture = this.$ionicGesture.on(
|
||||
'eventType',
|
||||
(e)=>{ return e; },
|
||||
angular.element("body"),
|
||||
{}
|
||||
);
|
||||
this.$ionicGesture.off(gesture, "eventType", (e) => { return e; });
|
||||
}
|
||||
private testList(): void {
|
||||
this.$ionicListDelegate.showReorder(true);
|
||||
var showReorder: boolean = this.$ionicListDelegate.showReorder();
|
||||
this.$ionicListDelegate.showDelete(true);
|
||||
var showDelete: boolean = this.$ionicListDelegate.showDelete();
|
||||
this.$ionicListDelegate.canSwipeItems(true);
|
||||
var canSwipeItems: boolean = this.$ionicListDelegate.canSwipeItems();
|
||||
this.$ionicListDelegate.closeOptionButtons();
|
||||
var foo: ionic.list.IonicListDelegate = this.$ionicListDelegate.$getByHandle("handle");
|
||||
}
|
||||
private testLoading(): void {
|
||||
this.$ionicLoading.show({
|
||||
template: "template",
|
||||
templateUrl: "templateUrl",
|
||||
scope: {},
|
||||
noBackdrop: false,
|
||||
hideOnStateChange: true,
|
||||
delay: 500,
|
||||
duration: 8000
|
||||
});
|
||||
this.$ionicLoading.hide();
|
||||
}
|
||||
private testModal(): void {
|
||||
var modalOptions: ionic.modal.IonicModalOptions = {
|
||||
scope: {},
|
||||
animation: "animation",
|
||||
focusFirstInput: true,
|
||||
backdropClickToClose: false,
|
||||
hardwareBackButtonClose: true
|
||||
};
|
||||
var ionicModalController: ionic.modal.IonicModalController = this.$ionicModal.fromTemplate("template", modalOptions);
|
||||
ionicModalController.initialize(modalOptions);
|
||||
ionicModalController.show().then(() => console.log("shown modal"))
|
||||
ionicModalController.hide().then(() => console.log("hid modal"))
|
||||
ionicModalController.remove().then(() => console.log("removed modal"))
|
||||
var isShown: boolean = ionicModalController.isShown();
|
||||
|
||||
this.$ionicModal.fromTemplateUrl("templateUrl", modalOptions)
|
||||
.then(modalCtrl => ionicModalController = modalCtrl);
|
||||
}
|
||||
private testNavigation(): void {
|
||||
this.$ionicNavBarDelegate.align("right");
|
||||
this.$ionicNavBarDelegate.showBackButton(true);
|
||||
var isBackButtonShown: boolean = this.$ionicNavBarDelegate.showBackButton();
|
||||
this.$ionicNavBarDelegate.showBar(true);
|
||||
var isBarShown: boolean = this.$ionicNavBarDelegate.showBar();
|
||||
this.$ionicNavBarDelegate.title("title");
|
||||
|
||||
var viewHistory = this.$ionicHistory.viewHistory();
|
||||
var currentView = this.$ionicHistory.currentView();
|
||||
this.$ionicHistory.currentView({viewId: 1});
|
||||
var currentHistoryId: string = this.$ionicHistory.currentHistoryId();
|
||||
this.$ionicHistory.currentTitle("currentTitle");
|
||||
var currentTitle: string = this.$ionicHistory.currentTitle();
|
||||
var backView = this.$ionicHistory.backView();
|
||||
this.$ionicHistory.backView({viewId: 1});
|
||||
var backTitle: string = this.$ionicHistory.backTitle();
|
||||
var forwardView = this.$ionicHistory.forwardView();
|
||||
this.$ionicHistory.forwardView({viewId: 1});
|
||||
var currentStateName: string = this.$ionicHistory.currentStateName();
|
||||
|
||||
this.$ionicHistory.goBack(5);
|
||||
this.$ionicHistory.removeBackView();
|
||||
this.$ionicHistory.clearHistory();
|
||||
this.$ionicHistory.clearCache().then(() => console.log("done clearing cache!"));
|
||||
this.$ionicHistory.nextViewOptions({
|
||||
disableAnimate: true,
|
||||
disableBack: true,
|
||||
historyRoot: true
|
||||
});
|
||||
}
|
||||
private testPlatform(): void {
|
||||
var callback: Function = () => console.log("on!");
|
||||
this.$ionicPlatform.onHardwareBackButton(callback);
|
||||
this.$ionicPlatform.offHardwareBackButton(callback);
|
||||
this.$ionicPlatform.registerBackButtonAction(callback, 1, "actionId");
|
||||
this.$ionicPlatform.on("type", callback);
|
||||
this.$ionicPlatform.ready(callback);
|
||||
this.$ionicPlatform.ready().then(() => console.log("ready!"));
|
||||
}
|
||||
private testPopover(): void {
|
||||
var popoverOptions: ionic.popover.IonicPopoverOptions = {
|
||||
scope: {},
|
||||
focusFirstInput: true,
|
||||
backdropClickToClose: false,
|
||||
hardwareBackButtonClose: true
|
||||
};
|
||||
var ionicPopoverController: ionic.popover.IonicPopoverController = this.$ionicPopover.fromTemplate("template", popoverOptions);
|
||||
ionicPopoverController.initialize(popoverOptions);
|
||||
ionicPopoverController.show(angular.element("body")).then(() => console.log("shown popover"));
|
||||
ionicPopoverController.hide().then(() => console.log("hid popover"));
|
||||
ionicPopoverController.remove().then(() => console.log("removed popover"));
|
||||
var isShown: boolean = ionicPopoverController.isShown();
|
||||
|
||||
this.$ionicPopover.fromTemplateUrl("templateUrl", popoverOptions)
|
||||
.then(popoverCtrl => ionicPopoverController = popoverCtrl);
|
||||
}
|
||||
private testPopup(): void {
|
||||
this.$ionicPopup.show({
|
||||
title: "title",
|
||||
subTitle: "subTitle",
|
||||
cssClass: "cssClass",
|
||||
template: "template",
|
||||
templateUrl: "templateUrl",
|
||||
scope: {},
|
||||
buttons: [{text: "text", type: "type", onTap: (e) => {console.log(e)}}]
|
||||
}).then(() => console.log("popover shown"));
|
||||
this.$ionicPopup.show({
|
||||
title: "title",
|
||||
subTitle: "subTitle",
|
||||
cssClass: "cssClass",
|
||||
template: "template",
|
||||
templateUrl: "templateUrl",
|
||||
scope: {},
|
||||
buttons: [{text: "text", type: "type", onTap: (e) => {console.log(e)}}]
|
||||
}).close("done");
|
||||
|
||||
this.$ionicPopup.alert({
|
||||
title: "title",
|
||||
subTitle: "subTitle",
|
||||
cssClass: "cssClass",
|
||||
template: "template",
|
||||
templateUrl: "templateUrl",
|
||||
okText: "OK",
|
||||
okType: "okType"
|
||||
}).then(() => console.log("popover shown"))
|
||||
this.$ionicPopup.alert({
|
||||
title: "title",
|
||||
subTitle: "subTitle",
|
||||
cssClass: "cssClass",
|
||||
template: "template",
|
||||
templateUrl: "templateUrl",
|
||||
okText: "OK",
|
||||
okType: "okType"
|
||||
}).close();
|
||||
|
||||
this.$ionicPopup.confirm({
|
||||
title: "title",
|
||||
subTitle: "subTitle",
|
||||
cssClass: "cssClass",
|
||||
template: "template",
|
||||
templateUrl: "templateUrl",
|
||||
okText: "OK",
|
||||
okType: "okType",
|
||||
cancelText: "Cancel",
|
||||
cancelType: "cancelType"
|
||||
}).then((result) => console.log(result === true ? "confirmed": "cancelled"))
|
||||
this.$ionicPopup.confirm({
|
||||
title: "title",
|
||||
subTitle: "subTitle",
|
||||
cssClass: "cssClass",
|
||||
template: "template",
|
||||
templateUrl: "templateUrl",
|
||||
okText: "OK",
|
||||
okType: "okType",
|
||||
cancelText: "Cancel",
|
||||
cancelType: "cancelType"
|
||||
}).close();
|
||||
|
||||
this.$ionicPopup.prompt({
|
||||
title: "title",
|
||||
subTitle: "subTitle",
|
||||
cssClass: "cssClass",
|
||||
template: "template",
|
||||
templateUrl: "templateUrl",
|
||||
okText: "OK",
|
||||
okType: "okType",
|
||||
cancelText: "Cancel",
|
||||
cancelType: "cancelType",
|
||||
inputType: "text",
|
||||
inputPlaceholder: "Type some text..."
|
||||
}).then(() => console.log("popover shown"))
|
||||
this.$ionicPopup.prompt({
|
||||
title: "title",
|
||||
subTitle: "subTitle",
|
||||
cssClass: "cssClass",
|
||||
template: "template",
|
||||
templateUrl: "templateUrl",
|
||||
okText: "OK",
|
||||
okType: "okType",
|
||||
cancelText: "Cancel",
|
||||
cancelType: "cancelType",
|
||||
inputType: "text",
|
||||
inputPlaceholder: "Type some text..."
|
||||
}).close();
|
||||
}
|
||||
|
||||
private testScroll(): void {
|
||||
this.$ionicScrollDelegate.resize();
|
||||
this.$ionicScrollDelegate.scrollTop();
|
||||
this.$ionicScrollDelegate.scrollTop(true);
|
||||
this.$ionicScrollDelegate.scrollBottom();
|
||||
this.$ionicScrollDelegate.scrollBottom(true);
|
||||
this.$ionicScrollDelegate.scrollTo(0, 0);
|
||||
this.$ionicScrollDelegate.scrollTo(0, 0, true);
|
||||
this.$ionicScrollDelegate.scrollBy(0, 0);
|
||||
this.$ionicScrollDelegate.scrollBy(0, 0, true);
|
||||
this.$ionicScrollDelegate.zoomTo(1);
|
||||
this.$ionicScrollDelegate.zoomTo(1, true);
|
||||
this.$ionicScrollDelegate.zoomTo(1, true, 0);
|
||||
this.$ionicScrollDelegate.zoomTo(1, true, 0, 0);
|
||||
this.$ionicScrollDelegate.zoomBy(0.5);
|
||||
this.$ionicScrollDelegate.zoomBy(0.5, true);
|
||||
this.$ionicScrollDelegate.zoomBy(0.5, true, 50);
|
||||
this.$ionicScrollDelegate.zoomBy(0.5, true, 50, 50);
|
||||
var {top: number, left: number} = this.$ionicScrollDelegate.getScrollPosition();
|
||||
this.$ionicScrollDelegate.anchorScroll();
|
||||
this.$ionicScrollDelegate.anchorScroll(true);
|
||||
var isScrollFrozen: boolean = this.$ionicScrollDelegate.freezeScroll();
|
||||
this.$ionicScrollDelegate.freezeScroll(false);
|
||||
var areAllScrollsFrozen: boolean = this.$ionicScrollDelegate.freezeAllScrolls();
|
||||
this.$ionicScrollDelegate.freezeAllScrolls(false);
|
||||
var scrollView: any = this.$ionicScrollDelegate.getScrollView();
|
||||
var scrollDelegate: ionic.scroll.IonicScrollDelegate = this.$ionicScrollDelegate.$getByHandle("handle");
|
||||
}
|
||||
private testSideMenu(): void {
|
||||
this.$ionicSideMenuDelegate.toggleLeft();
|
||||
this.$ionicSideMenuDelegate.toggleLeft(true);
|
||||
this.$ionicSideMenuDelegate.toggleRight();
|
||||
this.$ionicSideMenuDelegate.toggleRight(true);
|
||||
var openRatio: number = this.$ionicSideMenuDelegate.getOpenRatio();
|
||||
var isOpen: boolean = this.$ionicSideMenuDelegate.isOpen();
|
||||
var isOpenLeft: boolean = this.$ionicSideMenuDelegate.isOpenLeft();
|
||||
var isOpenRight: boolean = this.$ionicSideMenuDelegate.isOpenRight();
|
||||
var canDragContent: boolean = this.$ionicSideMenuDelegate.canDragContent();
|
||||
this.$ionicSideMenuDelegate.canDragContent(false);
|
||||
var edgeDragThreshold: boolean = this.$ionicSideMenuDelegate.edgeDragThreshold();
|
||||
this.$ionicSideMenuDelegate.edgeDragThreshold(true);
|
||||
this.$ionicSideMenuDelegate.edgeDragThreshold(500);
|
||||
var sideMenuDelegate: ionic.sideMenu.IonicSideMenuDelegate = this.$ionicSideMenuDelegate.$getByHandle("handle");
|
||||
}
|
||||
private testSlideBox(): void {
|
||||
this.$ionicSlideBoxDelegate.update();
|
||||
this.$ionicSlideBoxDelegate.slide(1);
|
||||
this.$ionicSlideBoxDelegate.slide(1, 500);
|
||||
var isSlideEnabled: boolean = this.$ionicSlideBoxDelegate.enableSlide();
|
||||
this.$ionicSlideBoxDelegate.enableSlide(true);
|
||||
this.$ionicSlideBoxDelegate.previous();
|
||||
this.$ionicSlideBoxDelegate.previous(500);
|
||||
this.$ionicSlideBoxDelegate.next();
|
||||
this.$ionicSlideBoxDelegate.next(500);
|
||||
this.$ionicSlideBoxDelegate.stop();
|
||||
this.$ionicSlideBoxDelegate.start();
|
||||
var currentIndex: number = this.$ionicSlideBoxDelegate.currentIndex();
|
||||
var slidesCount: number = this.$ionicSlideBoxDelegate.slidesCount();
|
||||
var slideBoxDelegate: ionic.slideBox.IonicSlideBoxDelegate = this.$ionicSlideBoxDelegate.$getByHandle("handle");
|
||||
}
|
||||
private testTabs(): void {
|
||||
this.$ionicTabsDelegate.select(1);
|
||||
var selectedIndex: number = this.$ionicTabsDelegate.selectedIndex();
|
||||
var ionicTabsDelegate: ionic.tabs.IonicTabsDelegate = this.$ionicTabsDelegate.$getByHandle("handle");
|
||||
this.$ionicTabsDelegate.showBar(true);
|
||||
var isBarShown: boolean = this.$ionicTabsDelegate.showBar();
|
||||
}
|
||||
private testUtility(): void {
|
||||
var {top: number, left: number, width: number, height: number} = this.$ionicPositionService.position(angular.element("body"));
|
||||
var {top: number, left: number, width: number, height: number} = this.$ionicPositionService.offset(angular.element("body"));
|
||||
}
|
||||
|
||||
/**
|
||||
* ionic.version
|
||||
*/
|
||||
private testStaticVersion(): void {
|
||||
var version: string = ionic.version;
|
||||
}
|
||||
|
||||
/**
|
||||
* ionic.Platform
|
||||
*/
|
||||
private testStaticPlaform(): void {
|
||||
var callbackWithoutReturn: ()=>void;
|
||||
var callbackWithReturn: ()=>boolean;
|
||||
var ready: void = ionic.Platform.ready(callbackWithoutReturn);
|
||||
ready = ionic.Platform.ready(callbackWithReturn);
|
||||
var setGrade: void = ionic.Platform.setGrade('iOS');
|
||||
var deviceInformation: string = ionic.Platform.device();
|
||||
var isBrowser: boolean = ionic.Platform.is('browser');
|
||||
var isWebView: boolean = ionic.Platform.isWebView();
|
||||
var isIPad: boolean = ionic.Platform.isIPad();
|
||||
var isIOS: boolean = ionic.Platform.isIOS();
|
||||
var isAndroid: boolean = ionic.Platform.isAndroid();
|
||||
var isWindowsPhone: boolean = ionic.Platform.isWindowsPhone();
|
||||
var currentPlatform: string = ionic.Platform.platform();
|
||||
var currentPlatformVersion: number = ionic.Platform.version();
|
||||
var exitApp: void = ionic.Platform.exitApp();
|
||||
var showStatusBar: void = ionic.Platform.showStatusBar(true);
|
||||
var showStatusBar: void = ionic.Platform.fullScreen();
|
||||
showStatusBar = ionic.Platform.fullScreen(true);
|
||||
showStatusBar = ionic.Platform.fullScreen(true, true);
|
||||
var isReady: boolean = ionic.Platform.isReady;
|
||||
var isFullScreen: boolean = ionic.Platform.isFullScreen;
|
||||
var platforms: Array<string> = ionic.Platform.platforms;
|
||||
var grade: string = ionic.Platform.grade;
|
||||
}
|
||||
}
|
||||
|
||||
testIonic.controller('ionicTestController', IonicTestController);
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"adjacent-overload-signatures": false,
|
||||
"array-type": false,
|
||||
"arrow-return-shorthand": false,
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"comment-format": false,
|
||||
"dt-header": false,
|
||||
"eofline": false,
|
||||
"export-just-namespace": false,
|
||||
"import-spacing": false,
|
||||
"interface-name": false,
|
||||
"interface-over-type-literal": false,
|
||||
"jsdoc-format": false,
|
||||
"max-line-length": false,
|
||||
"member-access": false,
|
||||
"new-parens": false,
|
||||
"no-any-union": false,
|
||||
"no-boolean-literal-compare": false,
|
||||
"no-conditional-assignment": false,
|
||||
"no-consecutive-blank-lines": false,
|
||||
"no-construct": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-duplicate-variable": false,
|
||||
"no-empty-interface": false,
|
||||
"no-for-in-array": false,
|
||||
"no-inferrable-types": false,
|
||||
"no-internal-module": false,
|
||||
"no-irregular-whitespace": false,
|
||||
"no-mergeable-namespace": false,
|
||||
"no-misused-new": false,
|
||||
"no-namespace": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
"no-padding": false,
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-redundant-undefined": false,
|
||||
"no-reference-import": false,
|
||||
"no-relative-import-in-test": false,
|
||||
"no-self-import": false,
|
||||
"no-single-declare-module": false,
|
||||
"no-string-throw": false,
|
||||
"no-unnecessary-callback-wrapper": false,
|
||||
"no-unnecessary-class": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"no-unnecessary-type-assertion": false,
|
||||
"no-useless-files": false,
|
||||
"no-var-keyword": false,
|
||||
"no-var-requires": false,
|
||||
"no-void-expression": false,
|
||||
"no-trailing-whitespace": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"object-literal-shorthand": false,
|
||||
"one-line": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"only-arrow-functions": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"prefer-const": false,
|
||||
"prefer-declare-function": false,
|
||||
"prefer-for-of": false,
|
||||
"prefer-method-signature": false,
|
||||
"prefer-template": false,
|
||||
"radix": false,
|
||||
"semicolon": false,
|
||||
"space-before-function-paren": false,
|
||||
"space-within-parens": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"trim-file": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"unified-signatures": false,
|
||||
"void-return": false,
|
||||
"whitespace": false
|
||||
}
|
||||
}
|
||||
99
types/iron/index.d.ts
vendored
Normal file
99
types/iron/index.d.ts
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
// Type definitions for iron 5.0
|
||||
// Project: https://github.com/hueniverse/iron
|
||||
// Definitions by: Simon Schick <https://github.com/simonschick>
|
||||
// Rafael Souza Fijalkowski <https://github.com/rafaelsouzaf>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
export interface SealOptionsSub {
|
||||
/**
|
||||
* the size of the salt (random buffer used to ensure that two identical objects will generate a different encrypted result.
|
||||
*/
|
||||
saltBits: number;
|
||||
/**
|
||||
* the algorithm used ('aes-256-cbc' for encryption and 'sha256' for integrity are the only two supported at this time).
|
||||
*/
|
||||
algorithm: keyof Algorithms;
|
||||
/**
|
||||
* the number of iterations used to derive a key from the password. Set to 1 by default. The number of ideal iterations
|
||||
* to use is dependent on your application's performance requirements. More iterations means it takes longer to generate the key.
|
||||
*/
|
||||
iterations: number;
|
||||
/**
|
||||
* minimum password size
|
||||
*/
|
||||
minPasswordlength: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* iron provides a few options for customizing the key derivation algorithm used to generate encryption and
|
||||
* integrity verification keys as well as the algorithms and salt sizes used.
|
||||
* For context [See docs](https://github.com/hueniverse/iron#options)
|
||||
*/
|
||||
export interface SealOptions {
|
||||
/**
|
||||
* defines the options used by the encryption process.
|
||||
*/
|
||||
encryption: SealOptionsSub;
|
||||
/**
|
||||
* defines the options used by the HMAC integrity verification process.
|
||||
*/
|
||||
integrity: SealOptionsSub;
|
||||
/**
|
||||
* sealed object lifetime in milliseconds where 0 means forever. Defaults to 0.
|
||||
*/
|
||||
ttl: number;
|
||||
/**
|
||||
* number of seconds of permitted clock skew for incoming expirations. Defaults to 60 seconds.
|
||||
*/
|
||||
timestampSkewSec: number;
|
||||
/**
|
||||
* local clock time offset, expressed in number of milliseconds (positive or negative). Defaults to 0.
|
||||
*/
|
||||
localtimeOffsetMsec: number;
|
||||
}
|
||||
|
||||
export interface Algorithms {
|
||||
'aes-128-ctr': {
|
||||
keyBits: number;
|
||||
ivBits: number;
|
||||
};
|
||||
'aes-256-cbc': {
|
||||
keyBits: number;
|
||||
ivBits: number;
|
||||
};
|
||||
'sha256': {
|
||||
keyBits: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface GenerateKeyOptions extends Pick<SealOptionsSub, 'algorithm' | 'iterations' | 'minPasswordlength'> {
|
||||
saltBits?: number;
|
||||
salt?: string;
|
||||
iv?: string;
|
||||
}
|
||||
|
||||
export interface Key {
|
||||
key: Buffer;
|
||||
salt: string;
|
||||
iv: string;
|
||||
}
|
||||
|
||||
export interface HMacResult {
|
||||
digest: string;
|
||||
salt: string;
|
||||
}
|
||||
|
||||
export const defaults: SealOptions;
|
||||
export const algorithms: Algorithms;
|
||||
export const macFormatVersion: string;
|
||||
export const macPrefix: string;
|
||||
|
||||
export function generateKey(password: string, options: GenerateKeyOptions): Promise<Key>;
|
||||
export function encrypt(password: string, options: GenerateKeyOptions, data: string): Promise<{ data: Buffer, key: Key }>;
|
||||
export function decrypt(password: string, options: GenerateKeyOptions, data: string): Promise<Buffer>;
|
||||
export function hmacWithPassword(password: string, options: GenerateKeyOptions, data: string): Promise<HMacResult>;
|
||||
export function seal(obj: object, password: string, options: SealOptions): Promise<string>;
|
||||
export function unseal(data: string, password: string, options: SealOptions): Promise<object>;
|
||||
78
types/iron/iron-tests.ts
Normal file
78
types/iron/iron-tests.ts
Normal file
@@ -0,0 +1,78 @@
|
||||
import * as Iron from "iron";
|
||||
|
||||
const options: Iron.SealOptions = {
|
||||
encryption: {
|
||||
saltBits: 256,
|
||||
algorithm: 'aes-256-cbc',
|
||||
iterations: 1,
|
||||
minPasswordlength: 32
|
||||
},
|
||||
integrity: {
|
||||
saltBits: 256,
|
||||
algorithm: 'sha256',
|
||||
iterations: 1,
|
||||
minPasswordlength: 32
|
||||
},
|
||||
ttl: 0,
|
||||
timestampSkewSec: 60,
|
||||
localtimeOffsetMsec: 0
|
||||
};
|
||||
|
||||
const algorithms: Iron.Algorithms = {
|
||||
'aes-128-ctr': { keyBits: 128, ivBits: 128 },
|
||||
'aes-256-cbc': { keyBits: 256, ivBits: 128 },
|
||||
sha256: { keyBits: 256 }
|
||||
};
|
||||
|
||||
const optionsGenerateKey: Iron.GenerateKeyOptions = {
|
||||
saltBits: 256,
|
||||
salt: '4d8nr9q384nr9q384nr93q8nruq9348run',
|
||||
algorithm: 'aes-128-ctr',
|
||||
iterations: 10000,
|
||||
iv: 'sdfsdfsdfsdfscdrgercgesrcgsercg',
|
||||
minPasswordlength: 32
|
||||
};
|
||||
|
||||
const obj: object = {
|
||||
a: 1,
|
||||
b: 2,
|
||||
c: [3, 4, 5],
|
||||
d: {
|
||||
e: 'f'
|
||||
}
|
||||
};
|
||||
|
||||
Iron.seal(obj, 'password', options)
|
||||
.then((sealed: string) => {
|
||||
console.log(sealed);
|
||||
});
|
||||
|
||||
Iron.unseal('data', 'password', Iron.defaults)
|
||||
.then((unsealed: object) => {
|
||||
console.log(unsealed);
|
||||
});
|
||||
|
||||
Iron.generateKey('password', options.encryption)
|
||||
.then((value: Iron.Key) => {
|
||||
console.log(value);
|
||||
});
|
||||
|
||||
Iron.generateKey('password', optionsGenerateKey)
|
||||
.then((value: Iron.Key) => {
|
||||
console.log(value);
|
||||
});
|
||||
|
||||
Iron.encrypt('password', Iron.defaults.encryption, 'data')
|
||||
.then((obj: { data: Buffer, key: Iron.Key }) => {
|
||||
console.log(obj);
|
||||
});
|
||||
|
||||
Iron.decrypt('password', Iron.defaults.encryption, 'data')
|
||||
.then((buffer: Buffer) => {
|
||||
console.log(buffer);
|
||||
});
|
||||
|
||||
Iron.hmacWithPassword('password', Iron.defaults.integrity, 'data')
|
||||
.then((value: Iron.HMacResult) => {
|
||||
console.log(value);
|
||||
});
|
||||
@@ -18,6 +18,6 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"cypress-tests.ts"
|
||||
"iron-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
3
types/iron/tslint.json
Normal file
3
types/iron/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
2
types/jest/index.d.ts
vendored
2
types/jest/index.d.ts
vendored
@@ -1046,6 +1046,8 @@ declare namespace jest {
|
||||
path: Path;
|
||||
}
|
||||
|
||||
// tslint:disable-next-line:no-empty-interface
|
||||
interface Set<T> {} // To allow non-ES6 users the Set below
|
||||
interface Reporter {
|
||||
onTestResult?(test: Test, testResult: TestResult, aggregatedResult: AggregatedResult): void;
|
||||
onRunStart?(results: AggregatedResult, options: ReporterOnStartOptions): void;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user