mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Merge branch 'master' of https://github.com/DefinitelyTyped/DefinitelyTyped into types-vinyl-cleanup-lint-errors
This commit is contained in:
@@ -372,6 +372,12 @@
|
||||
"sourceRepoURL": "https://github.com/elitechance/lambda-phi",
|
||||
"asOfVersion": "1.0.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "left-pad",
|
||||
"typingsPackageName": "left-pad",
|
||||
"sourceRepoURL": "https://github.com/stevemao/left-pad",
|
||||
"asOfVersion": "1.2.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "Linq.JS",
|
||||
"typingsPackageName": "linq",
|
||||
@@ -708,6 +714,12 @@
|
||||
"sourceRepoURL": "https://github.com/JMPerez/spotify-web-api-js",
|
||||
"asOfVersion": "0.21.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "striptags",
|
||||
"typingsPackageName": "striptags",
|
||||
"sourceRepoURL": "https://github.com/ericnorris/striptags",
|
||||
"asOfVersion": "3.1.1"
|
||||
},
|
||||
{
|
||||
"libraryName": "Sugar",
|
||||
"typingsPackageName": "sugar",
|
||||
|
||||
Vendored
+6
-5
@@ -1,13 +1,14 @@
|
||||
// Type definitions for accepts 1.3
|
||||
// Project: https://github.com/jshttp/accepts
|
||||
// Definitions by: Stefan Reichel <https://github.com/bomret>
|
||||
// Brice BERNARD <https://github.com/brikou>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace accepts {
|
||||
interface Headers {
|
||||
[key: string]: string | string[];
|
||||
}
|
||||
/// <reference types="node" />
|
||||
|
||||
import { IncomingMessage } from "http";
|
||||
|
||||
declare namespace accepts {
|
||||
interface Accepts {
|
||||
/**
|
||||
* Return the first accepted charset. If nothing in `charsets` is accepted, then `false` is returned.
|
||||
@@ -55,6 +56,6 @@ declare namespace accepts {
|
||||
}
|
||||
}
|
||||
|
||||
declare function accepts(req: { headers: accepts.Headers }): accepts.Accepts;
|
||||
declare function accepts(req: IncomingMessage): accepts.Accepts;
|
||||
|
||||
export = accepts;
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
import addZero from "add-zero";
|
||||
|
||||
addZero(5, 2);
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
// Type definitions for add-zero 1.0
|
||||
// Project: https://github.com/rafaelrinaldi/add-zero#readme
|
||||
// Definitions by: Giles Roadnight <https://github.com/Roaders>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export default function addZero(value: string | number, digits?: number): string;
|
||||
@@ -6,7 +6,7 @@
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
@@ -18,6 +18,6 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"striptags-tests.ts"
|
||||
"add-zero-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
Vendored
+2
-2
@@ -113,8 +113,8 @@ declare class Agenda extends EventEmitter {
|
||||
* @param options The options for the job.
|
||||
* @param handler The handler to execute.
|
||||
*/
|
||||
define(name: string, handler: (job?: Agenda.Job, done?: (err?: Error) => void) => void): void;
|
||||
define(name: string, options: Agenda.JobOptions, handler: (job?: Agenda.Job, done?: (err?: Error) => void) => void): void;
|
||||
define(name: string, handler: (job: Agenda.Job, done: (err?: Error) => void) => void): void;
|
||||
define(name: string, options: Agenda.JobOptions, handler: (job: Agenda.Job, done: (err?: Error) => void) => void): void;
|
||||
|
||||
/**
|
||||
* Runs job name at the given interval. Optionally, data and options can be passed in.
|
||||
|
||||
Vendored
+722
-1
@@ -1549,7 +1549,7 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
/** Hides cursor. */
|
||||
hideCursor(): void;
|
||||
/** You can force cursor to appear at specified cateogry or date. */
|
||||
showCursorAt(category: string): void;
|
||||
showCursorAt(category: string | Date): void;
|
||||
/** Adds event listener of the type "changed" to the object.
|
||||
@param type Always "changed".
|
||||
@param handler Dispatched when cursor position is changed. "index" is a series index over which chart cursors currently is. "zooming" specifies if user is currently zooming (is selecting) the chart. mostCloseGraph property is set only when oneBalloonOnly is set to true.*/
|
||||
@@ -1652,6 +1652,727 @@ If you do not set properties such as dashLength, lineAlpha, lineColor, etc - val
|
||||
zoomToIndexes(start: Date, end: Date): void;
|
||||
}
|
||||
|
||||
// AmAngularGauge Extension for AmChart to create gauge charts.
|
||||
class AmAngularGauge extends AmChart {
|
||||
/** When enabled, chart adds aria-label attributes to columns, bullets or map objects. You can control values of these labels using properties like accessibleLabel of AmGraph. Note, not all screen readers support these tags. We tested this mostly with NVDA Screen reader. WAI-ARIA is now official W3 standard, so in future more readers will handle this well. We will be improving accessibility on our charts, so we would be glad to hear your feedback.
|
||||
@default true
|
||||
*/
|
||||
accessible: boolean;
|
||||
|
||||
/** Description which will be added to node of SVG element. Most of the screen readers will read this description. */
|
||||
accessibleDescription: string;
|
||||
|
||||
/** Description which is added to of a SVG element. Some of the screen readers will read this description. */
|
||||
accessibleTitle: string;
|
||||
|
||||
/** Specifies, if class names should be added to chart elements.
|
||||
@default false
|
||||
*/
|
||||
addClassNames: boolean;
|
||||
|
||||
/** Uses the whole space of the canvas to draw the gauge.
|
||||
@default true
|
||||
*/
|
||||
adjustSize: boolean;
|
||||
|
||||
/** Array of Labels. Example of label object, with all possible properties:
|
||||
{"x": 20, "y": 20, "text": "this is label", "align": "left", "size": 12, "color": "#CC0000", "alpha": 1, "rotation": 0, "bold": true, "url": "http://www.amcharts.com"}
|
||||
@default []
|
||||
*/
|
||||
allLabels: [Label]
|
||||
|
||||
/** Array of arrows. */
|
||||
arrows: [GaugeArrow];
|
||||
|
||||
/** If you set it to true the chart will automatically monitor changes of display style of chart’s container (or any of it’s parents) and will render chart correctly if it is changed from none to block. We recommend setting it to true if you change this style at a run time, as it affects performance a bit.
|
||||
@default false
|
||||
*/
|
||||
autoDisplay: boolean;
|
||||
|
||||
/** Set this to false if you don't want chart to resize itself whenever its parent container size changes.
|
||||
@default true
|
||||
*/
|
||||
autoResize: boolean;
|
||||
|
||||
/** If you set it to true and your chart div (or any of the parent div) has css scale applied, the chart will position mouse at a correct position. Default value is false because this operation consumes some CPU and quite a few people are using css transfroms.
|
||||
@default false
|
||||
*/
|
||||
autoTransform: boolean;
|
||||
|
||||
/** Array of axes.
|
||||
@default [GaugeAxis]
|
||||
*/
|
||||
axes: [GaugeAxis];
|
||||
|
||||
/** Opacity of background. Set it to >0 value if you want backgroundColor to work. However we recommend changing div's background-color style for changing background color.
|
||||
@default 0
|
||||
*/
|
||||
backgroundAlpha: number;
|
||||
|
||||
/** Background color. You should set backgroundAlpha to >0 value in order background to be visible. We recommend setting background color directly on a chart's DIV instead of using this property.
|
||||
@default #FFFFFF
|
||||
*/
|
||||
backgroundColor: string;
|
||||
|
||||
/** The chart creates AmBalloon class itself. If you want to customize balloon, get balloon instance using this property, and then change balloon's properties.
|
||||
@default AmBalloon
|
||||
*/
|
||||
balloon: AmBalloon;
|
||||
|
||||
/** Opacity of chart's border. Value range is 0 - 1.
|
||||
@default 0
|
||||
*/
|
||||
borderAlpha: number;
|
||||
|
||||
/** Color of chart's border. You should set borderAlpha >0 in order border to be visible. We recommend setting border color directly on a chart's DIV instead of using this property.
|
||||
@default #000000
|
||||
*/
|
||||
borderColor: string;
|
||||
|
||||
/** This prefix is added to all class names which are added to all visual elements of a chart in case addClassNames is set to true.
|
||||
@default amcharts
|
||||
*/
|
||||
classNamePrefix: string;
|
||||
|
||||
/** In case you use gauge to create a clock, set this to true.
|
||||
@default false
|
||||
*/
|
||||
clockWiseOnly: boolean;
|
||||
|
||||
/** Text color.
|
||||
@default #000000
|
||||
*/
|
||||
color: string;
|
||||
|
||||
/** Non-commercial version only. Specifies position of link to amCharts site. Allowed values are: top-left, top-right, bottom-left and bottom-right.
|
||||
@default 'top - left'
|
||||
*/
|
||||
creditsPosition: string;
|
||||
|
||||
/** A config object for Data Loader plugin. Please refer to the following page for more information. */
|
||||
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];
|
||||
|
||||
/** Decimal separator.
|
||||
@default .
|
||||
*/
|
||||
decimalSeparator: string;
|
||||
|
||||
/** Using this property you can add any additional information to SVG, like SVG filters or clip paths. The structure of this object should be identical to XML structure of a object you are adding, only in JSON format. */
|
||||
defs: Object;
|
||||
|
||||
/** Export config. Specifies how export to image/data export/print/annotate menu will look and behave. You can find a lot of examples in amcharts/plugins/export folder. More details can be found here. */
|
||||
export: ExportSettings;
|
||||
|
||||
/** Gauge face opacity.
|
||||
@default 0
|
||||
*/
|
||||
faceAlpha: number;
|
||||
|
||||
/** Gauge face border opacity.
|
||||
@default 0
|
||||
*/
|
||||
faceBorderAlpha: number;
|
||||
|
||||
/** Gauge face border color.
|
||||
@default #555555
|
||||
*/
|
||||
faceBorderColor: string;
|
||||
|
||||
/** Gauge face border width.
|
||||
@default 1
|
||||
*/
|
||||
faceBorderWidth: number;
|
||||
|
||||
/** Gauge face color, requires faceAlpha > 0
|
||||
@default #FAFAFA
|
||||
*/
|
||||
faceColor: string;
|
||||
|
||||
/** Gauge face image-pattern.
|
||||
Example: {"url":"../amcharts/patterns/black/pattern1.png", "width":4, "height":4}
|
||||
fontFamily String Verdana Font family.
|
||||
fontSize Number 11 Font size. */
|
||||
facePattern: Object;
|
||||
|
||||
/** Gauge's horizontal position in pixel, origin is the center. Centered by default. */
|
||||
gaugeX: number;
|
||||
|
||||
/** Gauge's vertical position in pixel, origin is the center. Centered by default. */
|
||||
gaugeY: number;
|
||||
|
||||
/** If you set this to true, the lines of the chart will be distorted and will produce hand-drawn effect. Try to adjust chart.handDrawScatter and chart.handDrawThickness properties for a more scattered result.
|
||||
@default false
|
||||
*/
|
||||
handDrawn: boolean;
|
||||
|
||||
/** Defines by how many pixels hand-drawn line (when handDrawn is set to true) will fluctuate.
|
||||
@default 2
|
||||
*/
|
||||
handDrawScatter: number;
|
||||
|
||||
/** Defines by how many pixels line thickness will fluctuate (when handDrawn is set to true).
|
||||
@default 1
|
||||
*/
|
||||
handDrawThickness: number;
|
||||
|
||||
/** Time, in milliseconds after which balloon is hidden if the user rolls-out of the object. Might be useful for AmMap to avoid balloon flickering while moving mouse over the areas. Note, this is not duration of fade-out. Duration of fade-out is set in AmBalloon class.
|
||||
@default 150
|
||||
*/
|
||||
hideBalloonTime: number;
|
||||
|
||||
/** Allows changing language easily. Note, you should include language js file from amcharts/lang or ammap/lang folder and then use variable name used in this file, like chart.language = "de"; Note, for maps this works differently - you use language only for country names, as there are no other strings in the maps application. */
|
||||
language: string;
|
||||
|
||||
/** Legend of a chart. */
|
||||
legend: AmLegend;
|
||||
|
||||
/** 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}];
|
||||
@default [Object]
|
||||
*/
|
||||
listeners: [Object];
|
||||
|
||||
/** Bottom spacing between chart and container.
|
||||
@default 10
|
||||
*/
|
||||
marginBottom: number;
|
||||
|
||||
/** Left-hand spacing between chart and container.
|
||||
@default 10
|
||||
*/
|
||||
marginLeft: number;
|
||||
|
||||
/** Right-hand spacing between chart and container.
|
||||
@default 10
|
||||
*/
|
||||
marginRight: number;
|
||||
|
||||
/** Top spacing between chart and container.
|
||||
@default 10
|
||||
*/
|
||||
marginTop: number;
|
||||
|
||||
/** Minimum radius of a gauge.
|
||||
@default 10
|
||||
*/
|
||||
minRadius: number;
|
||||
|
||||
/** This setting affects touch-screen devices only. If a chart is on a page, and panEventsEnabled are set to true, the page won't move if the user touches the chart first. If a chart is big enough and occupies all the screen of your touch device, the user won’t be able to move the page at all. If you think that selecting/panning the chart or moving/pinching the map is a primary purpose of your users, you should set panEventsEnabled to true, otherwise - false.
|
||||
@default true
|
||||
*/
|
||||
panEventsEnabled: boolean;
|
||||
|
||||
/** 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.
|
||||
@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;
|
||||
|
||||
/** Precision of percent values. -1 means percent values won't be rounded at all and show as they are.
|
||||
@default 2
|
||||
*/
|
||||
percentPrecision: number;
|
||||
|
||||
/** Precision of values. -1 means values won't be rounded at all and show as they are.
|
||||
@default -1
|
||||
*/
|
||||
precision: number;
|
||||
|
||||
/**Prefixes which are used to make big numbers shorter: 2M instead of 2000000, etc.Prefixes are used on value axes and in the legend.To enable prefixes, set usePrefixes property to true.
|
||||
@default [{ "number": 1e+3, "prefix": "k" }, { "number": 1e+6, "prefix": "M" }, { "number": 1e+9, "prefix": "G" }, { "number": 1e+12, "prefix": "T" }, { "number": 1e+15, "prefix": "P" }, { "number": 1e+18, "prefix": "E" }, { "number": 1e+21, "prefix": "Z" }, { "number": 1e+24, "prefix": "Y" }]
|
||||
*/
|
||||
prefixesOfBigNumbers: [Object];
|
||||
|
||||
/** Prefixes which are used to make small numbers shorter: 2μ instead of 0.000002, etc.Prefixes are used on value axes and in the legend.To enable prefixes, set usePrefixes property to true.
|
||||
@default [{ "number": 1e-24, "prefix": "y" }, { "number": 1e-21, "prefix": "z" }, { "number": 1e-18, "prefix": "a" }, { "number": 1e-15, "prefix": "f" }, { "number": 1e-12, "prefix": "p" }, { "number": 1e-9, "prefix": "n" }, { "number": 1e-6, "prefix": "μ" }, { "number": 1e-3, "prefix": "m" }]
|
||||
*/
|
||||
prefixesOfSmallNumbers: [Object];
|
||||
|
||||
/** If processTimeout is > 0, 1000 data items will be parsed at a time, then the chart will make pause and continue parsing data until it finishes.
|
||||
@default 1000
|
||||
*/
|
||||
processCount: number;
|
||||
|
||||
/** If you set it to 1 millisecond or some bigger value, chart will be built in chunks instead of all at once. This is useful if you work with a lot of data and the initial build of the chart takes a lot of time, which freezes the whole web application by not allowing other processes to do their job while the chart is busy.
|
||||
@default 0
|
||||
*/
|
||||
processTimeout: number;
|
||||
|
||||
/** A config object for Responsive plugin. Please refer to the following page for more information. */
|
||||
responsive: Object
|
||||
|
||||
/** Duration of arrow animation.
|
||||
@default 1
|
||||
*/
|
||||
startDuration: number;
|
||||
|
||||
/** Transition effect of the arrows, possible effects: easeOutSine, easeInSine, elastic, bounce.
|
||||
@default easeInSine
|
||||
*/
|
||||
startEffect: string;
|
||||
|
||||
/** Charts will use SVG icons (some are loaded from images folder and some are drawn inline) if browser supports SVG. his makes icons look good on retina displays on all resolutions.
|
||||
@default true
|
||||
*/
|
||||
svgIcons: boolean;
|
||||
|
||||
/** Charts which require gestures like swipe (charts with scrollbar/cursor) or pinch (maps) used to prevent regular page scrolling and could result page to stick to the same spot if the chart occupied whole screen. Now, in order these gestures to start working user has to touch the chart/maps once. Regular touch events like touching on the bar/slice/map area do not require the first tap and will show balloons and perform other tasks as usual. If you have a map or chart which occupies full screen and your page does not require scrolling, set tapToActivate to false – this will bring old behavior back.
|
||||
@default true
|
||||
*/
|
||||
tapToActivate: boolean;
|
||||
|
||||
/** Theme of a chart. Config files of themes can be found in amcharts/themes/ folder. More info about using themes.
|
||||
@default none
|
||||
*/
|
||||
theme: string;
|
||||
|
||||
/** Thousands separator.
|
||||
@default ,
|
||||
*/
|
||||
thousandsSeparator: string;
|
||||
|
||||
/** Array of Title objects.
|
||||
@default []
|
||||
*/
|
||||
titles: [Title];
|
||||
|
||||
/** If you set it to 200 (milliseconds) or so, the chart will fire clickGraphItem or clickSlice (AmSlicedChart) or clickMapObject only if user holds his/her finger for 0.2 seconds (200 ms) on the column/bullet/slice/map object.
|
||||
@default 0
|
||||
*/
|
||||
touchClickDuration: number;
|
||||
|
||||
/** Type of a chart. Required when creating chart using JSON. Possible types are: serial, pie, xy, radar, funnel, gauge, map, gantt, stock. */
|
||||
type: string;
|
||||
|
||||
/** If true, prefixes will be used for big and small numbers.You can set arrays of prefixes via prefixesOfSmallNumbers and prefixesOfBigNumbers properties.
|
||||
@default false
|
||||
*/
|
||||
usePrefixes: boolean;
|
||||
|
||||
/** Read-only. Indicates current version of a script. */
|
||||
version: string;
|
||||
|
||||
/** Adds arrow to the chart. */
|
||||
addArrow(arrow: GaugeArrow): void;
|
||||
|
||||
/** Adds axis to angular gauge. */
|
||||
addAxis(axis: GaugeAxis): void;
|
||||
|
||||
/** Adds a label on a chart. You can use it for labeling axes, adding chart title, etc. x and y coordinates can be set in number, percent, or a number with ! in front of it - coordinate will be calculated from right or bottom instead of left or top. */
|
||||
addLabel(x: number, y: number, text: string, align: string, size: number, color: string, rotation: number, alpha: number, bold: boolean, url: 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.) */
|
||||
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).
|
||||
*/
|
||||
addLegend(legend: AmLegend, legendDiv: HTMLElement): void;
|
||||
|
||||
/** Adds event listener to the object. */
|
||||
addListener(type: string, handler: Function): 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. */
|
||||
addTitle(text: string, size: number, color: string, alpha: number, bold: boolean): void;
|
||||
|
||||
/** Clears the chart area, intervals, etc. */
|
||||
clear(): void;
|
||||
|
||||
/** Removes all labels added to the chart. */
|
||||
clearLabels(): void;
|
||||
|
||||
/** Use this method to force the chart to resize to it's current container size. */
|
||||
invalidateSize(): void;
|
||||
|
||||
/** This method allows to create charts with a single config. */
|
||||
makeChart(container: string, config: any, delay: number): AmChart;
|
||||
|
||||
/** Removes arrow from the chart. */
|
||||
removeArrow(arrow: GaugeArrow): void;
|
||||
|
||||
/** Removes axis from the chart. */
|
||||
removeAxis(axis: GaugeAxis): void;
|
||||
|
||||
/** Removes chart's legend. */
|
||||
removeLegend(): void;
|
||||
|
||||
/** Removes event listener from chart object. */
|
||||
removeListener(chart: AmChart, type: string, handler: any): void;
|
||||
|
||||
/** This method should be called after data in your data provider changed or a new array was set to dataProvider. After calling this method the chart will parse data and redraw. */
|
||||
validateData(): void;
|
||||
|
||||
/** This method should be called after you changed one or more properties of any class. The chart will redraw after this method is called.Both attributes, validateData and skipEvents are optional (false by default). */
|
||||
validateNow(): void;
|
||||
|
||||
/** Adds chart to the specified DIV.
|
||||
@param container DIV object which will hold the chart. */
|
||||
write(container: HTMLElement): void;
|
||||
/** Adds chart to the specified DIV.
|
||||
@param container Id of a DIV which will hold the chart. */
|
||||
write(container: string): void;
|
||||
}
|
||||
|
||||
class GaugeArrow {
|
||||
/** Opacity of an arrow.
|
||||
@default 1
|
||||
*/
|
||||
alpha: number;
|
||||
|
||||
/** 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
|
||||
|
||||
/** Opacity of arrow border.
|
||||
@default 1
|
||||
*/
|
||||
borderAlpha: number;
|
||||
|
||||
/** In case you need the arrow to rotate only clock-wise, set this property to true.
|
||||
@default false
|
||||
*/
|
||||
clockWiseOnly: boolean;
|
||||
|
||||
/** Color of an arrow.
|
||||
@default #000000
|
||||
*/
|
||||
color: string;
|
||||
|
||||
/** Unique id of an arrow. */
|
||||
id: string;
|
||||
|
||||
/** Inner radius of an arrow.
|
||||
@default 0
|
||||
*/
|
||||
innerRadius: any;
|
||||
|
||||
/** Opacity of a nail, holding the arrow.
|
||||
@default 1
|
||||
*/
|
||||
nailAlpha: number;
|
||||
|
||||
/** Opacity of nail border.
|
||||
@default 0
|
||||
*/
|
||||
nailBorderAlpha: number;
|
||||
|
||||
/** Thickness of nail border.
|
||||
@default 1
|
||||
*/
|
||||
nailBorderThickness: number;
|
||||
|
||||
/** Radius of a nail, holding the arrow.
|
||||
@default 8
|
||||
*/
|
||||
nailRadius: number;
|
||||
|
||||
/** Radius of an arrow.
|
||||
@default '90%'
|
||||
*/
|
||||
radius: any;
|
||||
|
||||
/** Width of arrow root.
|
||||
@default 8
|
||||
*/
|
||||
startWidth: number;
|
||||
|
||||
/** Value to which the arrow should point at. */
|
||||
value: number;
|
||||
|
||||
/** Sets value for the arrow. Arrow will animate to this value if you do it after chart is written to it's container. */
|
||||
setValue(value: number): void;
|
||||
}
|
||||
|
||||
class GaugeAxis {
|
||||
/** Axis opacity.
|
||||
@default 1
|
||||
*/
|
||||
axisAlpha: number;
|
||||
|
||||
/** Axis color.
|
||||
@default #000000
|
||||
*/
|
||||
axisColor: string;
|
||||
|
||||
/** Thickness of the axis outline.
|
||||
@default 1
|
||||
*/
|
||||
axisThickness: number;
|
||||
|
||||
/** Opacity of band fills.
|
||||
@default 1
|
||||
*/
|
||||
bandAlpha: 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 []
|
||||
*/
|
||||
bandGradientRatio: [number];
|
||||
|
||||
/** Opacity of band outlines.
|
||||
@default 0
|
||||
*/
|
||||
bandOutlineAlpha: number;
|
||||
|
||||
/** Color of band outlines.
|
||||
@default #000000
|
||||
*/
|
||||
bandOutlineColor: string;
|
||||
|
||||
/** Thickness of band outlines.
|
||||
@default 0
|
||||
*/
|
||||
bandOutlineThickness: number;
|
||||
|
||||
/** Array of bands - GaugeBand objects. Bands are used to draw color fills between specified values. */
|
||||
bands: [GaugeBand];
|
||||
|
||||
/** Text displayed below the axis center. */
|
||||
bottomText: string;
|
||||
|
||||
/** Specifies if text should be bold.
|
||||
@default true
|
||||
*/
|
||||
bottomTextBold: boolean;
|
||||
|
||||
/** Bottom text color. */
|
||||
bottomTextColor: string;
|
||||
|
||||
/** Font size of bottom text. */
|
||||
bottomTextFontSize: number;
|
||||
|
||||
/** Y offset of bottom text.
|
||||
@default 0
|
||||
*/
|
||||
bottomTextYOffset: number;
|
||||
|
||||
/** X position of the axis, relative to the center of the gauge.
|
||||
@default '0%'
|
||||
*/
|
||||
centerX: any;
|
||||
|
||||
/** Y position of the axis, relative to the center of the gauge.
|
||||
@default '0%'
|
||||
*/
|
||||
centerY: any;
|
||||
|
||||
/** Specifies labels color of the axis. */
|
||||
color: string
|
||||
|
||||
/** Axis end angle. Valid values are from - 180 to 180.
|
||||
@default 120
|
||||
*/
|
||||
endAngle: number;
|
||||
|
||||
/** Axis end (max) value */
|
||||
endValue: number;
|
||||
|
||||
/** Font size for axis labels. */
|
||||
fontSize: number;
|
||||
|
||||
/** Number of grid lines. Note, GaugeAxis doesn't adjust gridCount, so you should check your values and choose a proper gridCount which would result grids at round numbers.
|
||||
@default 5
|
||||
*/
|
||||
gridCount: number;
|
||||
|
||||
/** Specifies if grid should be drawn inside or outside the axis.
|
||||
@default true
|
||||
*/
|
||||
gridInside: boolean;
|
||||
|
||||
/** Unique id of an axis. */
|
||||
id: any;
|
||||
|
||||
/** Specifies if labels should be placed inside or outside the axis.
|
||||
@default true
|
||||
*/
|
||||
inside: boolean;
|
||||
|
||||
/** Frequency of labels.
|
||||
@default 1
|
||||
*/
|
||||
labelFrequency: number;
|
||||
|
||||
/** You can use this function to format axis labels. This function is called and value is passed as a attribute: labelFunction(value); */
|
||||
labelFunction: Function;
|
||||
|
||||
/** Distance from axis to the labels.
|
||||
@default 15
|
||||
*/
|
||||
labelOffset: number;
|
||||
|
||||
/** Specifies if labels on the axis should be shown.
|
||||
@default true
|
||||
*/
|
||||
labelsEnabled: boolean;
|
||||
|
||||
/** You can add listeners of events using this property. Example: listeners = [{"event":"clickBand", "method":handleClick}]; */
|
||||
listeners: Object[];
|
||||
|
||||
/** Interval, at which minor ticks should be placed. */
|
||||
minorTickInterval: number;
|
||||
|
||||
/** Length of a minor tick.
|
||||
@default 5
|
||||
*/
|
||||
minorTickLength: number
|
||||
|
||||
/** Axis radius.
|
||||
@default '95%'
|
||||
*/
|
||||
radius: any;
|
||||
|
||||
/** Specifies if the first label should be shown.
|
||||
@default true
|
||||
*/
|
||||
showFirstLabel: boolean;
|
||||
|
||||
/** Specifies if the last label should be shown.
|
||||
@default true
|
||||
*/
|
||||
showLastLabel: boolean;
|
||||
|
||||
/** Axis start angle. Valid values are from - 180 to 180.
|
||||
@default -120
|
||||
*/
|
||||
startAngle: number;
|
||||
|
||||
/** Axis start (min) value.
|
||||
@default 0
|
||||
*/
|
||||
startValue: number;
|
||||
|
||||
/** Opacity of axis ticks.
|
||||
@default 1
|
||||
*/
|
||||
tickAlpha: number;
|
||||
|
||||
/** Color of axis ticks.
|
||||
@default #555555
|
||||
*/
|
||||
tickColor: string;
|
||||
|
||||
/** Length of a major tick.
|
||||
@default 10
|
||||
*/
|
||||
tickLength: number;
|
||||
|
||||
/** Tick thickness.
|
||||
@default 1
|
||||
*/
|
||||
tickThickness: number;
|
||||
|
||||
/** Text displayed above the axis center. */
|
||||
topText: string
|
||||
|
||||
/** Specifies if text should be bold.
|
||||
@default true
|
||||
*/
|
||||
topTextBold: boolean;
|
||||
|
||||
/** Color of top text. */
|
||||
topTextColor: string
|
||||
|
||||
/** Font size of top text. */
|
||||
topTextFontSize: number
|
||||
|
||||
/** Y offset of top text.
|
||||
@default 0
|
||||
*/
|
||||
topTextYOffset: number;
|
||||
|
||||
/** A string which can be placed next to axis labels. */
|
||||
unit: string;
|
||||
|
||||
/** Position of the unit.
|
||||
@default right
|
||||
*/
|
||||
unitPosition: string;
|
||||
|
||||
/** Specifies if small and big numbers should use prefixes to make them more readable.
|
||||
@default false
|
||||
*/
|
||||
usePrefixes: boolean;
|
||||
|
||||
/** Interval, at which ticks with values should be placed. */
|
||||
valueInterval: number;
|
||||
|
||||
/** Adds event listener to the object. */
|
||||
addListener(type: string, handler: any);
|
||||
|
||||
/** Removes event listener from chart object. */
|
||||
removeListener(chart: AmChart, type: string, handler: any);
|
||||
|
||||
/** Sets bottom text. */
|
||||
setBottomText(text: string);
|
||||
|
||||
/** Sets top text. */
|
||||
setTopText(textstring);
|
||||
|
||||
/** Returns angle of the value. */
|
||||
value2angle(value: number);
|
||||
}
|
||||
|
||||
class GaugeBand {
|
||||
/** Opacity of band fill. Will use axis.bandAlpha if not set any. */
|
||||
alpha: number;
|
||||
|
||||
/** When rolled-over, band will display balloon if you set some text for this property. */
|
||||
balloonText: string;
|
||||
|
||||
/** Color of a band. */
|
||||
color: string;
|
||||
|
||||
/** End value of a fill. */
|
||||
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 []
|
||||
*/
|
||||
gradientRatio: [number];
|
||||
|
||||
/** Unique id of a band. */
|
||||
id: string;
|
||||
|
||||
/** Inner radius of a band. If not set any, the band will end with the end of minor ticks. Set 0 if you want the band to be drawn to the axis center. */
|
||||
innerRadius: any;
|
||||
|
||||
/** Band radius. If not set any, the band will start with the axis outline. */
|
||||
radius: any;
|
||||
|
||||
/** Start value of a fill. */
|
||||
startValue: number;
|
||||
|
||||
/** Gauge band can be clickable and can lead to some page. */
|
||||
url: string;
|
||||
|
||||
/** Sets end value for the band. */
|
||||
setEndValue(value);
|
||||
|
||||
/** Sets start value for the band. */
|
||||
setStartValue(value);
|
||||
}
|
||||
|
||||
class PeriodSelector {
|
||||
/** Date format of date input fields. Check [[http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/formatters/DateFormatter.html DD-MM-YYYY */
|
||||
dateFormat: string;
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
* License: MIT
|
||||
*/
|
||||
|
||||
/* tslint:disable:no-empty no-shadowed-variable */
|
||||
|
||||
class AuthService {
|
||||
/**
|
||||
* Holds all the requests which failed due to 401 response,
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
import appdmg = require("appdmg");
|
||||
import { Options, Specification, SpecificationOptions } from "appdmg";
|
||||
|
||||
const proc = appdmg({
|
||||
target: "/foo/bar.dmg",
|
||||
basepath: "/baz",
|
||||
specification: {
|
||||
title: "Happy",
|
||||
icon: "happy.icns",
|
||||
background: "happy.tiff",
|
||||
format: "UDBZ",
|
||||
"icon-size": 98,
|
||||
contents: [
|
||||
{
|
||||
x: 405,
|
||||
y: 150,
|
||||
type: "link",
|
||||
path: "/Applications"
|
||||
},
|
||||
{
|
||||
x: 127,
|
||||
y: 150,
|
||||
type: "file",
|
||||
path: "/foo/bar.app"
|
||||
}
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
proc.on("progress", info => {
|
||||
if (info.type === "step-begin") {
|
||||
process.stdout.write(`${info.title}... `);
|
||||
}
|
||||
|
||||
if (info.type === "step-end") {
|
||||
process.stdout.write(`${info.status}\n`);
|
||||
}
|
||||
});
|
||||
|
||||
proc.on("finish", () => {
|
||||
console.log('Installer was created successfully!');
|
||||
});
|
||||
|
||||
proc.on("error", (err) => {
|
||||
console.error('Installer could not be created', err);
|
||||
process.exit(1);
|
||||
});
|
||||
Vendored
+70
@@ -0,0 +1,70 @@
|
||||
// Type definitions for appdmg 0.5
|
||||
// Project: https://github.com/LinusU/node-appdmg#readme
|
||||
// Definitions by: Daniel Perez Alvarez <https://github.com/unindented>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
declare namespace appdmg {
|
||||
interface Progress {
|
||||
current: number;
|
||||
total: number;
|
||||
type: "step-begin" | "step-end";
|
||||
title: string;
|
||||
status: "ok" | "skip" | "fail";
|
||||
}
|
||||
|
||||
interface EventEmitter extends NodeJS.EventEmitter {
|
||||
on(event: "progress", listener: (info: Progress) => void): this;
|
||||
on(event: "finish", listener: () => void): this;
|
||||
on(event: "error", listener: (err: any) => void): this;
|
||||
}
|
||||
|
||||
interface SpecificationOptions {
|
||||
app: string;
|
||||
background: string;
|
||||
icon: string;
|
||||
iconSize: number;
|
||||
title: string;
|
||||
}
|
||||
|
||||
interface SpecificationWindow {
|
||||
position?: { x: number; y: number };
|
||||
size?: { width: number; height: number };
|
||||
}
|
||||
|
||||
interface SpecificationContents {
|
||||
x: number;
|
||||
y: number;
|
||||
type: "link" | "file" | "position";
|
||||
path: string;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
interface SpecificationCodeSign {
|
||||
"signing-identity": string;
|
||||
identifier?: string;
|
||||
}
|
||||
|
||||
interface Specification {
|
||||
title: string;
|
||||
icon?: string;
|
||||
background?: string;
|
||||
"background-color"?: string;
|
||||
"icon-size"?: number;
|
||||
window?: SpecificationWindow;
|
||||
format: "UDRW" | "UDRO" | "UDCO" | "UDZO" | "UDBZ" | "ULFO";
|
||||
contents: SpecificationContents[];
|
||||
"code-sign"?: SpecificationCodeSign;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
target: string;
|
||||
basepath: string;
|
||||
specification: Specification;
|
||||
}
|
||||
}
|
||||
|
||||
declare function appdmg(options?: appdmg.Options): appdmg.EventEmitter;
|
||||
|
||||
export = appdmg;
|
||||
@@ -18,6 +18,6 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"left-pad-tests.ts"
|
||||
"appdmg-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as ascii2mathml from 'ascii2mathml';
|
||||
|
||||
const fn = ascii2mathml({}); // $ExpectType any
|
||||
const fn = ascii2mathml({}); // $ExpectType ascii2mathml
|
||||
fn(''); // $ExpectType string
|
||||
ascii2mathml('', {}); // $ExpectType string
|
||||
|
||||
|
||||
Vendored
+37
-37
@@ -9,16 +9,16 @@
|
||||
import { EventEmitter } from "events";
|
||||
|
||||
export abstract class AsyncIterator<T> extends NodeJS.EventEmitter {
|
||||
protected static STATES: ['INIT', 'OPEN', 'CLOSING', 'CLOSED', 'ENDED'];
|
||||
protected static INIT: 0;
|
||||
protected static OPEN: 1;
|
||||
protected static CLOSING: 2;
|
||||
protected static CLOSED: 3;
|
||||
protected static ENDED: 4;
|
||||
static STATES: ['INIT', 'OPEN', 'CLOSING', 'CLOSED', 'ENDED'];
|
||||
static INIT: 0;
|
||||
static OPEN: 1;
|
||||
static CLOSING: 2;
|
||||
static CLOSED: 3;
|
||||
static ENDED: 4;
|
||||
|
||||
protected _state: number;
|
||||
protected _readable: boolean;
|
||||
protected _destination?: AsyncIterator<any>;
|
||||
_state: number;
|
||||
_readable: boolean;
|
||||
_destination?: AsyncIterator<any>;
|
||||
|
||||
readable: boolean;
|
||||
closed: boolean;
|
||||
@@ -30,11 +30,11 @@ export abstract class AsyncIterator<T> extends NodeJS.EventEmitter {
|
||||
each(callback: (data: T) => void, self?: any): void;
|
||||
close(): void;
|
||||
|
||||
protected _changeState(newState: number, eventAsync?: boolean): void;
|
||||
_changeState(newState: number, eventAsync?: boolean): void;
|
||||
private _hasListeners(eventName: string | symbol): boolean;
|
||||
// tslint:disable-next-line ban-types
|
||||
private _addSingleListener(eventName: string | symbol, listener: Function): void;
|
||||
protected _end(): void;
|
||||
_end(): void;
|
||||
|
||||
getProperty(propertyName: string, callback?: (value: any) => void): any;
|
||||
setProperty(propertyName: string, value: any): void;
|
||||
@@ -43,7 +43,7 @@ export abstract class AsyncIterator<T> extends NodeJS.EventEmitter {
|
||||
copyProperties(source: AsyncIterator<any>, propertyNames: string[]): void;
|
||||
|
||||
toString(): string;
|
||||
protected _toStringDetails(): string;
|
||||
_toStringDetails(): string;
|
||||
|
||||
transform<T2>(options?: SimpleTransformIteratorOptions<T, T2>): SimpleTransformIterator<T, T2>;
|
||||
map<T2>(mapper: (item: T) => T2, self?: object): SimpleTransformIterator<T, T2>;
|
||||
@@ -78,9 +78,9 @@ export interface IntegerIteratorOptions {
|
||||
}
|
||||
|
||||
export class IntegerIterator extends AsyncIterator<number> {
|
||||
protected _step: number;
|
||||
protected _last: number;
|
||||
protected _next: number;
|
||||
_step: number;
|
||||
_last: number;
|
||||
_next: number;
|
||||
|
||||
constructor(options?: IntegerIteratorOptions);
|
||||
}
|
||||
@@ -92,16 +92,16 @@ export interface BufferedIteratorOptions {
|
||||
|
||||
export class BufferedIterator<T> extends AsyncIterator<T> {
|
||||
maxBufferSize: number;
|
||||
protected _pushedCount: number;
|
||||
protected _buffer: T[];
|
||||
_pushedCount: number;
|
||||
_buffer: T[];
|
||||
|
||||
protected _init(autoStart: boolean): void;
|
||||
protected _begin(done: () => void): void;
|
||||
protected _read(count: number, done: () => void): void;
|
||||
protected _push(item: T): void;
|
||||
protected _fillBuffer(): void;
|
||||
protected _completeClose(): void;
|
||||
protected _flush(done: () => void): void;
|
||||
_init(autoStart: boolean): void;
|
||||
_begin(done: () => void): void;
|
||||
_read(count: number, done: () => void): void;
|
||||
_push(item: T): void;
|
||||
_fillBuffer(): void;
|
||||
_completeClose(): void;
|
||||
_flush(done: () => void): void;
|
||||
|
||||
constructor(options?: BufferedIteratorOptions);
|
||||
}
|
||||
@@ -112,12 +112,12 @@ export interface TransformIteratorOptions<S> extends BufferedIteratorOptions {
|
||||
}
|
||||
|
||||
export class TransformIterator<S, T> extends BufferedIterator<T> {
|
||||
protected _optional: boolean;
|
||||
_optional: boolean;
|
||||
source: AsyncIterator<S>;
|
||||
|
||||
protected _validateSource(source: AsyncIterator<S>, allowDestination?: boolean): void;
|
||||
protected _transform(item: S, done: (result: T) => void): void;
|
||||
protected _closeWhenDone(): void;
|
||||
_validateSource(source: AsyncIterator<S>, allowDestination?: boolean): void;
|
||||
_transform(item: S, done: (result: T) => void): void;
|
||||
_closeWhenDone(): void;
|
||||
|
||||
constructor(source?: AsyncIterator<S> | TransformIteratorOptions<S>, options?: TransformIteratorOptions<S>);
|
||||
}
|
||||
@@ -134,16 +134,16 @@ export interface SimpleTransformIteratorOptions<S, T> extends TransformIteratorO
|
||||
}
|
||||
|
||||
export class SimpleTransformIterator<S, T> extends TransformIterator<S, T> {
|
||||
protected _offset: number;
|
||||
protected _limit: number;
|
||||
protected _prepender?: ArrayIterator<T>;
|
||||
protected _appender?: ArrayIterator<T>;
|
||||
_offset: number;
|
||||
_limit: number;
|
||||
_prepender?: ArrayIterator<T>;
|
||||
_appender?: ArrayIterator<T>;
|
||||
|
||||
protected _filter?(item: S): boolean;
|
||||
protected _map?(item: S): T;
|
||||
protected _transform(item: S, done: (result: T) => void): void;
|
||||
_filter?(item: S): boolean;
|
||||
_map?(item: S): T;
|
||||
_transform(item: S, done: (result: T) => void): void;
|
||||
|
||||
protected _insert(inserter: AsyncIterator<S>, done: () => void): void;
|
||||
_insert(inserter: AsyncIterator<S>, done: () => void): void;
|
||||
|
||||
constructor(source?: AsyncIterator<S> | SimpleTransformIteratorOptions<S, T>,
|
||||
options?: SimpleTransformIteratorOptions<S, T>);
|
||||
@@ -152,7 +152,7 @@ export class SimpleTransformIterator<S, T> extends TransformIterator<S, T> {
|
||||
export class MultiTransformIterator<S, T> extends TransformIterator<S, T> {
|
||||
_transformerQueue: S[];
|
||||
|
||||
protected _createTransformer(): AsyncIterator<S>;
|
||||
_createTransformer(element: S): AsyncIterator<T>;
|
||||
|
||||
constructor(source?: AsyncIterator<S> | TransformIteratorOptions<S>, options?: TransformIteratorOptions<S>);
|
||||
}
|
||||
|
||||
@@ -174,6 +174,23 @@ webAuth.login({username: 'bar', password: 'foo'}, (err, data) => {});
|
||||
|
||||
webAuth.crossOriginAuthenticationCallback();
|
||||
|
||||
webAuth.checkSession({
|
||||
audience: 'https://mystore.com/api/v2',
|
||||
scope: 'read:order write:order',
|
||||
redirectUri: 'https://example.com/auth/silent-callback'
|
||||
}, (err, authResult) => {
|
||||
// Authentication tokens or error
|
||||
});
|
||||
|
||||
webAuth.checkSession({
|
||||
audience: 'https://mystore.com/api/v2',
|
||||
scope: 'read:order write:order',
|
||||
redirectUri: 'https://example.com/auth/silent-callback',
|
||||
usePostMessage: true
|
||||
}, (err, authResult) => {
|
||||
// Renewed tokens or error
|
||||
});
|
||||
|
||||
const authentication = new auth0.Authentication({
|
||||
domain: 'me.auth0.com',
|
||||
clientID: '...',
|
||||
|
||||
Vendored
+15
@@ -268,6 +268,14 @@ export class WebAuth {
|
||||
* @param options:
|
||||
*/
|
||||
passwordlessVerify(options: PasswordlessVerifyOptions, callback: Auth0Callback<any>): void;
|
||||
|
||||
/**
|
||||
* Renews an existing session on Auth0's servers using `response_mode=web_message` (i.e. Auth0's hosted login page)
|
||||
*
|
||||
* @param options options used in {@link authorize} call
|
||||
* @param callback: any(err, token_payload)
|
||||
*/
|
||||
checkSession(options: CheckSessionOptions, callback: Auth0Callback<any>): void;
|
||||
}
|
||||
|
||||
export class Redirect {
|
||||
@@ -753,3 +761,10 @@ export interface AuthorizeOptions {
|
||||
scope?: string;
|
||||
audience?: string;
|
||||
}
|
||||
|
||||
export interface CheckSessionOptions extends AuthorizeOptions {
|
||||
/**
|
||||
* optional parameter for auth0 to use postMessage to communicate between the silent callback and the SPA.
|
||||
*/
|
||||
usePostMessage?: boolean;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,17 @@ lock.show();
|
||||
lock.hide();
|
||||
lock.logout(() => {});
|
||||
|
||||
lock.checkSession({}, function(error: auth0.Auth0Error, authResult: AuthResult): void {
|
||||
if (error || !authResult) {
|
||||
lock.show();
|
||||
} else {
|
||||
// user has an active session, so we can use the accessToken directly.
|
||||
lock.getUserInfo(authResult.accessToken, function(error, profile) {
|
||||
console.log(error, profile);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Show supports UI arguments
|
||||
|
||||
const showOptions : Auth0LockShowOptions = {
|
||||
@@ -37,7 +48,7 @@ lock.show(showOptions);
|
||||
|
||||
// "on" event-driven example
|
||||
|
||||
lock.on("authenticated", function(authResult : any) {
|
||||
lock.on("authenticated", function(authResult: AuthResult) {
|
||||
lock.getProfile(authResult.idToken, function(error: auth0.Auth0Error, profile: auth0.Auth0UserProfile) {
|
||||
if (error) {
|
||||
// Handle error
|
||||
@@ -49,7 +60,7 @@ lock.on("authenticated", function(authResult : any) {
|
||||
});
|
||||
});
|
||||
|
||||
lock.on("authenticated", function(authResult : any) {
|
||||
lock.on("authenticated", function(authResult: AuthResult) {
|
||||
lock.getUserInfo(authResult.accessToken, function(error, profile) {
|
||||
if (error) {
|
||||
// Handle error
|
||||
|
||||
Vendored
+1
@@ -154,6 +154,7 @@ interface Auth0LockStatic {
|
||||
// deprecated
|
||||
getProfile(token: string, callback: (error: auth0.Auth0Error, profile: auth0.Auth0UserProfile) => void): void;
|
||||
getUserInfo(token: string, callback: (error: auth0.Auth0Error, profile: auth0.Auth0UserProfile) => void): void;
|
||||
checkSession(options: any, callback: (error: auth0.Auth0Error, authResult: AuthResult | undefined) => void): void;
|
||||
// https://github.com/auth0/lock#resumeauthhash-callback
|
||||
resumeAuth(hash: string, callback: (error: auth0.Auth0Error, authResult: AuthResult) => void): void;
|
||||
show(options?: Auth0LockShowOptions): void;
|
||||
|
||||
@@ -109,6 +109,101 @@ str = apiGwEvt.queryStringParameters["example"];
|
||||
str = apiGwEvt.stageVariables["example"];
|
||||
apiGwEvtReqCtx = apiGwEvt.requestContext;
|
||||
|
||||
/* DynamoDB Stream Event */
|
||||
var dynamoDBStreamEvent: AWSLambda.DynamoDBStreamEvent = {
|
||||
Records: [
|
||||
{
|
||||
eventID: '1',
|
||||
eventVersion: '1.0',
|
||||
dynamodb: {
|
||||
Keys: {
|
||||
Id: {
|
||||
N: 101
|
||||
}
|
||||
},
|
||||
NewImage: {
|
||||
Message: {
|
||||
S: 'New item!'
|
||||
},
|
||||
Id: {
|
||||
N: 101
|
||||
}
|
||||
},
|
||||
StreamViewType: 'NEW_AND_OLD_IMAGES',
|
||||
SequenceNumber: '111',
|
||||
SizeBytes: 26
|
||||
},
|
||||
awsRegion: 'us-west-2',
|
||||
eventName: 'INSERT',
|
||||
eventSourceARN:
|
||||
'arn:aws:dynamodb:us-west-2:account-id:table/ExampleTableWithStream/stream/2015-06-27T00:48:05.899',
|
||||
eventSource: 'aws:dynamodb'
|
||||
},
|
||||
{
|
||||
eventID: '2',
|
||||
eventVersion: '1.0',
|
||||
dynamodb: {
|
||||
OldImage: {
|
||||
Message: {
|
||||
S: 'New item!'
|
||||
},
|
||||
Id: {
|
||||
N: 101
|
||||
}
|
||||
},
|
||||
SequenceNumber: '222',
|
||||
Keys: {
|
||||
Id: {
|
||||
N: 101
|
||||
}
|
||||
},
|
||||
SizeBytes: 59,
|
||||
NewImage: {
|
||||
Message: {
|
||||
S: 'This item has changed'
|
||||
},
|
||||
Id: {
|
||||
N: 101
|
||||
}
|
||||
},
|
||||
StreamViewType: 'NEW_AND_OLD_IMAGES'
|
||||
},
|
||||
awsRegion: 'us-west-2',
|
||||
eventName: 'MODIFY',
|
||||
eventSourceARN:
|
||||
'arn:aws:dynamodb:us-west-2:account-id:table/ExampleTableWithStream/stream/2015-06-27T00:48:05.899',
|
||||
eventSource: 'aws:dynamodb'
|
||||
},
|
||||
{
|
||||
eventID: '3',
|
||||
eventVersion: '1.0',
|
||||
dynamodb: {
|
||||
Keys: {
|
||||
Id: {
|
||||
N: 101
|
||||
}
|
||||
},
|
||||
SizeBytes: 38,
|
||||
SequenceNumber: '333',
|
||||
OldImage: {
|
||||
Message: {
|
||||
S: 'This item has changed'
|
||||
},
|
||||
Id: {
|
||||
N: 101
|
||||
}
|
||||
},
|
||||
StreamViewType: 'NEW_AND_OLD_IMAGES'
|
||||
},
|
||||
awsRegion: 'us-west-2',
|
||||
eventName: 'REMOVE',
|
||||
eventSourceARN:
|
||||
'arn:aws:dynamodb:us-west-2:account-id:table/ExampleTableWithStream/stream/2015-06-27T00:48:05.899',
|
||||
eventSource: 'aws:dynamodb'
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
/* SNS Event */
|
||||
snsEvtRecs = snsEvt.Records;
|
||||
|
||||
@@ -315,6 +410,131 @@ function customAuthorizerCallback(cb: AWSLambda.CustomAuthorizerCallback) {
|
||||
cb(null, authResponse);
|
||||
}
|
||||
|
||||
/* CloudFront events, see http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html */
|
||||
var CloudFrontRequestEvent: AWSLambda.CloudFrontRequestEvent = {
|
||||
"Records": [
|
||||
{
|
||||
"cf": {
|
||||
"config": {
|
||||
"distributionId": "EDFDVBD6EXAMPLE",
|
||||
"requestId": "MRVMF7KydIvxMWfJIglgwHQwZsbG2IhRJ07sn9AkKUFSHS9EXAMPLE=="
|
||||
},
|
||||
"request": {
|
||||
"clientIp": "2001:0db8:85a3:0:0:8a2e:0370:7334",
|
||||
"method": "GET",
|
||||
"uri": "/picture.jpg",
|
||||
"querystring": "size=large",
|
||||
"headers": {
|
||||
"host": [
|
||||
{
|
||||
"key": "Host",
|
||||
"value": "d111111abcdef8.cloudfront.net"
|
||||
}
|
||||
],
|
||||
"user-agent": [
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "curl/7.51.0"
|
||||
}
|
||||
]
|
||||
},
|
||||
"origin": {
|
||||
"custom": {
|
||||
"customHeaders": {
|
||||
"my-origin-custom-header": [
|
||||
{
|
||||
"key": "My-Origin-Custom-Header",
|
||||
"value": "Test"
|
||||
}
|
||||
]
|
||||
},
|
||||
"domainName": "example.com",
|
||||
"keepaliveTimeout": 5,
|
||||
"path": "/custom_path",
|
||||
"port": 443,
|
||||
"protocol": "https",
|
||||
"readTimeout": 5,
|
||||
"sslProtocols": [
|
||||
"TLSv1",
|
||||
"TLSv1.1"
|
||||
]
|
||||
},
|
||||
"s3": {
|
||||
"authMethod": "origin-access-identity",
|
||||
"customHeaders": {
|
||||
"my-origin-custom-header": [
|
||||
{
|
||||
"key": "My-Origin-Custom-Header",
|
||||
"value": "Test"
|
||||
}
|
||||
]
|
||||
},
|
||||
"domainName": "my-bucket.s3.amazonaws.com",
|
||||
"path": "/s3_path",
|
||||
"region": "us-east-1"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
var CloudFrontResponseEvent: AWSLambda.CloudFrontResponseEvent = {
|
||||
"Records": [
|
||||
{
|
||||
"cf": {
|
||||
"config": {
|
||||
"distributionId": "EDFDVBD6EXAMPLE",
|
||||
"requestId": "xGN7KWpVEmB9Dp7ctcVFQC4E-nrcOcEKS3QyAez--06dV7TEXAMPLE=="
|
||||
},
|
||||
"request": {
|
||||
"clientIp": "2001:0db8:85a3:0:0:8a2e:0370:7334",
|
||||
"method": "GET",
|
||||
"uri": "/picture.jpg",
|
||||
"querystring": "size=large",
|
||||
"headers": {
|
||||
"host": [
|
||||
{
|
||||
"key": "Host",
|
||||
"value": "d111111abcdef8.cloudfront.net"
|
||||
}
|
||||
],
|
||||
"user-agent": [
|
||||
{
|
||||
"key": "User-Agent",
|
||||
"value": "curl/7.18.1"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"response": {
|
||||
"status": "200",
|
||||
"statusDescription": "OK",
|
||||
"headers": {
|
||||
"server": [
|
||||
{
|
||||
"key": "Server",
|
||||
"value": "MyCustomOrigin"
|
||||
}
|
||||
],
|
||||
"set-cookie": [
|
||||
{
|
||||
"key": "Set-Cookie",
|
||||
"value": "theme=light"
|
||||
},
|
||||
{
|
||||
"key": "Set-Cookie",
|
||||
"value": "sessionToken=abc123; Expires=Wed, 09 Jun 2021 10:18:14 GMT"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
/* Compatibility functions */
|
||||
context.done();
|
||||
context.done(error);
|
||||
|
||||
Vendored
+98
@@ -8,8 +8,10 @@
|
||||
// Yoriki Yamaguchi <https://github.com/y13i>
|
||||
// wwwy3y3 <https://github.com/wwwy3y3>
|
||||
// Ishaan Malhi <https://github.com/OrthoDex>
|
||||
// Michael Marner <https://github.com/MichaelMarner>
|
||||
// Daniel Cottone <https://github.com/daniel-cottone>
|
||||
// Kostya Misura <https://github.com/kostya-misura>
|
||||
// Markus Tacker <https://github.com/coderbyheart>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
@@ -64,6 +66,53 @@ interface CustomAuthorizerEvent {
|
||||
requestContext?: APIGatewayEventRequestContext;
|
||||
}
|
||||
|
||||
// Context
|
||||
// http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_AttributeValue.html
|
||||
interface AttributeValue {
|
||||
B?: string;
|
||||
BS?: Array<string>;
|
||||
BOOL?: boolean;
|
||||
L?: Array<AttributeValue>;
|
||||
M?: { [id: string]: AttributeValue };
|
||||
N?: number;
|
||||
NS?: Array<string>;
|
||||
NULL?: boolean;
|
||||
S?: string;
|
||||
SS?: Array<string>;
|
||||
}
|
||||
|
||||
// Context
|
||||
// http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_StreamRecord.html
|
||||
interface StreamRecord {
|
||||
ApproximateCreationTime?: number;
|
||||
Keys?: { [key: string]: AttributeValue };
|
||||
NewImage?: { [key: string]: AttributeValue };
|
||||
OldImage?: { [key: string]: AttributeValue };
|
||||
SequenceNumber?: string;
|
||||
SizeBytes?: number;
|
||||
StreamViewType?: 'KEYS_ONLY' | 'NEW_IMAGE' | 'OLD_IMAGE' | 'NEW_AND_OLD_IMAGES';
|
||||
}
|
||||
|
||||
// Context
|
||||
// http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_streams_Record.html
|
||||
interface DynamoDBRecord {
|
||||
awsRegion?: string;
|
||||
dynamodb?: StreamRecord;
|
||||
eventID?: string;
|
||||
eventName?: 'INSERT' | 'MODIFY' | 'REMOVE';
|
||||
eventSource?: string;
|
||||
eventSourceARN?: string;
|
||||
eventVersion?: string;
|
||||
userIdentity?: any;
|
||||
}
|
||||
|
||||
// AWS Lambda Stream event
|
||||
// Context
|
||||
// http://docs.aws.amazon.com/lambda/latest/dg/eventsources.html#eventsources-ddb-update
|
||||
interface DynamoDBStreamEvent {
|
||||
Records: Array<DynamoDBRecord>;
|
||||
}
|
||||
|
||||
// SNS "event"
|
||||
interface SNSMessageAttribute {
|
||||
Type: string;
|
||||
@@ -346,6 +395,55 @@ interface AuthResponseContext {
|
||||
[name: string]: string | number | boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* CloudFront events
|
||||
* http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html
|
||||
*/
|
||||
type CloudFrontHeaders = {
|
||||
[name: string]: {
|
||||
key: string;
|
||||
value: string;
|
||||
}[]
|
||||
};
|
||||
|
||||
type CloudFrontResponse = {
|
||||
status: string;
|
||||
statusDescription: string;
|
||||
headers: CloudFrontHeaders;
|
||||
};
|
||||
|
||||
type CloudFrontRequest = {
|
||||
clientIp: string;
|
||||
method: string;
|
||||
uri: string;
|
||||
querystring: string;
|
||||
headers: CloudFrontHeaders;
|
||||
};
|
||||
|
||||
type CloudFrontEvent = {
|
||||
config: {
|
||||
distributionId: string;
|
||||
requestId: string;
|
||||
}
|
||||
}
|
||||
|
||||
export type CloudFrontResponseEvent = {
|
||||
Records: {
|
||||
cf: CloudFrontEvent & {
|
||||
request: CloudFrontRequest;
|
||||
response: CloudFrontResponse;
|
||||
}
|
||||
}[]
|
||||
};
|
||||
|
||||
export type CloudFrontRequestEvent = {
|
||||
Records: {
|
||||
cf: CloudFrontEvent & {
|
||||
request: CloudFrontRequest;
|
||||
}
|
||||
}[]
|
||||
};
|
||||
|
||||
/**
|
||||
* AWS Lambda handler function.
|
||||
* http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html
|
||||
|
||||
@@ -1,16 +1,82 @@
|
||||
import { Azure } from 'azure-sb';
|
||||
import AzureSB = require('azure-sb');
|
||||
|
||||
import Models = Azure.ServiceBus.Results.Models;
|
||||
|
||||
var nh = new Azure.ServiceBus.NotificationHubService();
|
||||
nh.send('tag', '<payload></payload>', function (error, result) {});
|
||||
nh.send('tag', '<payload></payload>', { headers: {} }, function (error, result) {});
|
||||
function createResultCallback<T>() {
|
||||
return (err: Error | null, result: T, response: Azure.ServiceBus.Response) => {
|
||||
};
|
||||
}
|
||||
|
||||
nh.apns.send('tag', { payload: { } }, function (error, result) {});
|
||||
nh.apns.send(['tag'], { payload: { } }, function (error, result) {});
|
||||
nh.gcm.send('tag', { }, function (error, result) {});
|
||||
nh.gcm.send(['tag'], { }, function (error, result) {});
|
||||
nh.wns.send('tag', '<payload></payload>', 'wns/toast', function (error, result) {});
|
||||
nh.wns.send(['tag'], '<payload></payload>', 'wns/toast', function (error, result) {});
|
||||
nh.wns.send('tag', '<payload></payload>', 'wns/toast', { headers: {} }, function (error, result) {});
|
||||
nh.wns.sendToastText01('tag', '<payload></payload>', function (error, result) {});
|
||||
nh.wns.sendToastText01(['tag'], '<payload></payload>', function (error, result) {});
|
||||
nh.wns.sendToastText01('tag', '<payload></payload>', { headers: {} }, function (error, result) {});
|
||||
function ResponseCallback(err: Error | null, response: Azure.ServiceBus.Response) {
|
||||
}
|
||||
|
||||
const ServiceBus = AzureSB.createServiceBusService('connectionstring');
|
||||
|
||||
// Queues
|
||||
ServiceBus.listQueues('', createResultCallback<Models.Queue[]>());
|
||||
ServiceBus.createQueue('test', createResultCallback<Models.Queue>());
|
||||
ServiceBus.createQueueIfNotExists('test', createResultCallback<boolean>());
|
||||
ServiceBus.getQueue('test', createResultCallback<Models.Queue>());
|
||||
ServiceBus.deleteQueue('test', ResponseCallback);
|
||||
|
||||
// Topics
|
||||
ServiceBus.listTopics('', createResultCallback<Models.Topic[]>());
|
||||
ServiceBus.createTopic('test', createResultCallback<Models.Topic>());
|
||||
ServiceBus.createTopicIfNotExists('test', createResultCallback<boolean>());
|
||||
ServiceBus.getTopic('test', createResultCallback<Models.Topic>());
|
||||
ServiceBus.deleteTopic('test', ResponseCallback);
|
||||
|
||||
// Subscriptions
|
||||
ServiceBus.listSubscriptions('test', createResultCallback<Models.Subscription[]>());
|
||||
ServiceBus.createSubscription('test', 'test', createResultCallback<Models.Subscription>());
|
||||
ServiceBus.createSubscription('test', 'test', {
|
||||
DefaultMessageTimeToLive: 'PT10M'
|
||||
}, createResultCallback<Models.Subscription>());
|
||||
ServiceBus.getSubscription('test', 'test', createResultCallback<Models.Subscription>());
|
||||
ServiceBus.deleteSubscription('test', 'test', ResponseCallback);
|
||||
|
||||
ServiceBus.listRules('testTopic', 'testSub', createResultCallback<Models.Rule[]>());
|
||||
ServiceBus.createRule('testTopic', 'testSub', 'testRule', createResultCallback<Models.Rule>());
|
||||
ServiceBus.getRule('testTopic', 'testSub', 'testRule', createResultCallback<Models.Rule>());
|
||||
ServiceBus.deleteRule('testTopic', 'testSub', 'testRule', ResponseCallback);
|
||||
|
||||
// Messages
|
||||
ServiceBus.sendQueueMessage('testTopic', 'My data', ResponseCallback);
|
||||
ServiceBus.sendQueueMessage('testTopic', {
|
||||
body: '{"data":"MyData"}',
|
||||
contentType: 'application/json',
|
||||
brokerProperties: {
|
||||
CorrelationId: '123'
|
||||
}
|
||||
}, ResponseCallback);
|
||||
ServiceBus.receiveQueueMessage('testQueue', createResultCallback<Azure.ServiceBus.Message>());
|
||||
|
||||
ServiceBus.sendTopicMessage('testTopic', 'My data', ResponseCallback);
|
||||
ServiceBus.sendTopicMessage('testTopic', {
|
||||
body: '{"data":"MyData"}',
|
||||
contentType: 'application/json',
|
||||
brokerProperties: {
|
||||
CorrelationId: '123'
|
||||
}
|
||||
}, ResponseCallback);
|
||||
ServiceBus.receiveSubscriptionMessage('testTopic', 'testSub', createResultCallback<Azure.ServiceBus.Message>());
|
||||
|
||||
ServiceBus.renewLockForMessage('test', ResponseCallback);
|
||||
ServiceBus.unlockMessage('test', ResponseCallback);
|
||||
ServiceBus.deleteMessage('test', ResponseCallback);
|
||||
|
||||
// NotificationHub
|
||||
const nh = AzureSB.createNotificationHubService('test');
|
||||
nh.send('tag', '<payload></payload>', ResponseCallback);
|
||||
nh.send('tag', '<payload></payload>', { headers: {} }, ResponseCallback);
|
||||
nh.apns.send('tag', { payload: {} }, ResponseCallback);
|
||||
nh.apns.send(['tag'], { payload: {} }, ResponseCallback);
|
||||
nh.gcm.send('tag', {}, ResponseCallback);
|
||||
nh.gcm.send(['tag'], {}, ResponseCallback);
|
||||
nh.wns.send('tag', '<payload></payload>', 'wns/toast', ResponseCallback);
|
||||
nh.wns.send(['tag'], '<payload></payload>', 'wns/toast', ResponseCallback);
|
||||
nh.wns.send('tag', '<payload></payload>', 'wns/toast', { headers: {} }, ResponseCallback);
|
||||
nh.wns.sendToastText01('tag', '<payload></payload>', ResponseCallback);
|
||||
nh.wns.sendToastText01(['tag'], '<payload></payload>', ResponseCallback);
|
||||
nh.wns.sendToastText01('tag', '<payload></payload>', { headers: {} }, ResponseCallback);
|
||||
|
||||
Vendored
+299
-149
@@ -2,172 +2,322 @@
|
||||
// Project: https://github.com/Azure/azure-sdk-for-node/tree/master/lib/services/serviceBus
|
||||
// Definitions by: Microsoft Azure <https://github.com/Azure>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
declare namespace Azure.ServiceBus {
|
||||
interface Callback {
|
||||
(error: any, response: any): void;
|
||||
export import ServiceBusService = require('./lib/servicebusservice');
|
||||
export import NotificationHubService = require('./lib/notificationhubservice');
|
||||
export import WrapService = require('./lib/wrapservice');
|
||||
|
||||
export function createServiceBusService(namespaceOrConnectionString?: string,
|
||||
accessKey?: string,
|
||||
issuer?: string,
|
||||
acsNamespace?: string,
|
||||
host?: string,
|
||||
authenticationProvider?: object): ServiceBusService;
|
||||
|
||||
export function createNotificationHubService(hubName: string,
|
||||
endpointOrConnectionString?: string,
|
||||
sharedAccessKeyName?: string,
|
||||
sharedAccessKeyValue?: string): NotificationHubService;
|
||||
|
||||
export function createWrapService(acsHost: string,
|
||||
issuer?: string,
|
||||
accessKey?: string): WrapService;
|
||||
|
||||
export namespace Azure.ServiceBus {
|
||||
export type Duration = string;
|
||||
export type DateString = string;
|
||||
|
||||
export interface Dictionary<T> {
|
||||
[k: string]: T;
|
||||
}
|
||||
|
||||
interface NotificationHubRegistration {
|
||||
RegistrationId: string;
|
||||
export interface ReceiveQueueMessageOptions {
|
||||
timeoutIntervalInS?: number;
|
||||
}
|
||||
|
||||
export interface ReceiveSubscriptionMessageOptions extends ReceiveQueueMessageOptions {
|
||||
isPeekLock?: boolean;
|
||||
}
|
||||
|
||||
interface IBrokerPropertiesResponse {
|
||||
readonly DeliveryCount: number;
|
||||
readonly LockedUntil: DateString;
|
||||
readonly LockToken: string;
|
||||
readonly SequenceNumber: number;
|
||||
}
|
||||
|
||||
interface IBrokerProperties {
|
||||
CorrelationId: string;
|
||||
Label: string;
|
||||
MessageId: string;
|
||||
PartitionKey: string;
|
||||
ReplyTo: string;
|
||||
ReplyToSessionId: string;
|
||||
ScheduledEnqueueTimeUtc: string;
|
||||
SessionId: string;
|
||||
TimeToLive: string;
|
||||
To: string;
|
||||
}
|
||||
|
||||
export interface Message {
|
||||
body: string;
|
||||
brokerProperties?: BrokerProperties;
|
||||
contentType?: string;
|
||||
customProperties?: Dictionary<any>;
|
||||
}
|
||||
|
||||
/*
|
||||
* Options interfaces
|
||||
*/
|
||||
|
||||
interface CreateOptions {
|
||||
DefaultMessageTimeToLive: string;
|
||||
DuplicateDetectionHistoryTimeWindow: string;
|
||||
EnablePartitioning: boolean;
|
||||
MaxSizeInMegaBytes: number;
|
||||
RequiresDuplicateDetection: boolean;
|
||||
}
|
||||
|
||||
interface IQueueOptions extends CreateOptions {
|
||||
AutoDeleteOnIdle: string;
|
||||
DeadLetteringOnMessageExpiration: boolean;
|
||||
LockDuration: string;
|
||||
RequiresSession: boolean;
|
||||
}
|
||||
|
||||
interface ICreateTopicOptions extends CreateOptions {
|
||||
EnableBatchedOperations: boolean;
|
||||
SizeInBytes: boolean;
|
||||
SupportOrdering: boolean;
|
||||
}
|
||||
|
||||
interface ICreateTopicIfNotExistsOptions extends ICreateTopicOptions {
|
||||
EnableDeadLetteringOnFilterEvaluationExceptions: boolean;
|
||||
EnableDeadLetteringOnMessageExpiration: boolean;
|
||||
MaxCorrelationFiltersPerTopic: number;
|
||||
MaxSqlFiltersPerTopic: number;
|
||||
MaxSubscriptionsPerTopic: number;
|
||||
}
|
||||
|
||||
interface ICreateSubscriptionOptions {
|
||||
DefaultMessageTimeToLive: string;
|
||||
EnableDeadLetteringOnFilterEvaluationExceptions: boolean;
|
||||
EnableDeadLetteringOnMessageExpiration: boolean;
|
||||
LockDuration: string;
|
||||
RequiresSession: boolean;
|
||||
}
|
||||
|
||||
interface PaginationOptions {
|
||||
top: number;
|
||||
skip: number;
|
||||
}
|
||||
|
||||
interface ICreateRuleOptions {
|
||||
trueFilter: string;
|
||||
falseFilter: string;
|
||||
sqlExpressionFilter: string;
|
||||
correlationIdFilter: string;
|
||||
sqlRuleAction: string;
|
||||
}
|
||||
|
||||
interface ICreateNotificationHubOptions {
|
||||
apns: Dictionary<string>;
|
||||
gcm: Dictionary<string>;
|
||||
mpns: Dictionary<string>;
|
||||
wns: Dictionary<string>;
|
||||
}
|
||||
|
||||
export interface NotificationHubRegistration {
|
||||
BodyTemplate?: any;
|
||||
ChannelUri?: string;
|
||||
DeviceToken?: string;
|
||||
gcmRegistrationId?: string;
|
||||
Tags?: string;
|
||||
BodyTemplate?: any;
|
||||
WnsHeaders?: any;
|
||||
MpnsHeaders?: any;
|
||||
Expiry?: Date;
|
||||
gcmRegistrationId?: string;
|
||||
MpnsHeaders?: any;
|
||||
RegistrationId: string;
|
||||
Tags?: string;
|
||||
WnsHeaders?: any;
|
||||
}
|
||||
|
||||
export class NotificationHubService {
|
||||
new(hubName: string, endpointOrConnectionString: string, sharedAccessKeyName?: string, sharedAccessKeyValue?: string): NotificationHubService;
|
||||
hubName: string;
|
||||
wns: Wns.Service;
|
||||
apns: Apns.Service;
|
||||
gcm: Gcm.Service;
|
||||
mpns: Mpns.Service;
|
||||
send(tags: string, payload: Object | string, optionsOrCallback?: { headers: Object } | Callback, callback?: Callback): void;
|
||||
|
||||
createOrUpdateInstallation(installation: string, options: any, callback?: Callback): void;
|
||||
patchInstallation(installationId: string, partialUpdateOperations: any[], options: any, callback?: Callback): void;
|
||||
deleteInstallation(installationId: string, options: any, callback?: Callback): void;
|
||||
getInstallation(installationId: string, options: any, callback?: Callback): void;
|
||||
|
||||
/*
|
||||
// old school?
|
||||
createRegistrationId(callback?: Callback): void;
|
||||
getRegistration(registrationId: string, options: any, callback?: Callback): void;
|
||||
deleteRegistration(registrationId: string, options?: { etag: any }, callback?: Callback): void;
|
||||
updateRegistration(registration: NotificationHubRegistration, options?: { etag: any }, callback?: Callback): void;
|
||||
createOrUpdateRegistration(registration: NotificationHubRegistration, options?: { etag: any }, callback?: Callback): void;
|
||||
listRegistrations(options?: { top: number, skip: number }, callback?: Callback): void;
|
||||
listRegistrationsByTag(tag: string, options?: { top: number, skip: number }, callback?: Callback): void;
|
||||
*/
|
||||
export interface Response {
|
||||
body: Dictionary<string | object>;
|
||||
headers: Dictionary<string>;
|
||||
isSuccessful: boolean;
|
||||
md5?: string;
|
||||
statusCode: number;
|
||||
}
|
||||
|
||||
export module Apns {
|
||||
interface Payload {
|
||||
expiry?: Date;
|
||||
aps?: Object;
|
||||
badge?: number;
|
||||
alert?: string;
|
||||
sound?: string;
|
||||
payload: Object;
|
||||
export interface ErrorResponse extends Response {
|
||||
body: {
|
||||
Error: {
|
||||
Code: string;
|
||||
Detail: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export namespace Results.Models {
|
||||
export enum EntityStatus {
|
||||
Active = 'Active',
|
||||
Creating = 'Creating',
|
||||
Deleting = 'Deleting',
|
||||
Disabled = 'Disabled',
|
||||
ReceiveDisabled = 'ReceiveDisabled',
|
||||
Renaming = 'Renaming',
|
||||
Restoring = 'Restoring',
|
||||
SendDisabled = 'SendDisabled',
|
||||
Unknown = 'Unknown'
|
||||
}
|
||||
|
||||
interface Service {
|
||||
new(service: NotificationHubService): Service;
|
||||
send(tags: string | string[], payload: Apns.Payload, callback?: Callback): void;
|
||||
createNativeRegistration(token: string, tags: string | string[], optionsOrCallback?: Object | Callback, callback?: Callback): void;
|
||||
createOrUpdateNativeRegistration(registrationId: string, token: string, tags: string | string[], optionsOrCallback?: Object | Callback, callback?: Callback): void;
|
||||
createTemplateRegistration(token: string, tags: string | string[], template: Apns.Payload, optionsOrCallback?: Object | Callback, callback?: Callback): void;
|
||||
createOrUpdateTemplateRegistration(registrationId: string, token: string, tags: string | string[], template: Apns.Payload, optionsOrCallback?: Object | Callback, callback?: Callback): void;
|
||||
updateTemplateRegistration(registrationId: string, token: string, tags: string | string[], template: Apns.Payload, optionsOrCallback?: Object | Callback, callback?: Callback): void;
|
||||
listRegistrationsByToken(token: string, optionsOrCallback?: { top: number, skip: number } | Callback, callback?: Callback): void;
|
||||
export enum EntityAvailabilityStatus {
|
||||
Available = 'Available',
|
||||
Limited = 'Limited',
|
||||
Renaming = 'Renaming',
|
||||
Restoring = 'Restoring',
|
||||
Unknown = 'Unknown'
|
||||
}
|
||||
}
|
||||
export module Gcm {
|
||||
interface Service {
|
||||
new(service: NotificationHubService): Service;
|
||||
send(tags: string | string[], payload: any, callback?: Callback): void;
|
||||
createNativeRegistration(gcmRegistrationId: string, tags: string | string[], optionsOrCallback?: Object | Callback, callback?: Callback): void;
|
||||
createOrUpdateNativeRegistration(registrationId: string, gcmRegistrationId: string, tags: string | string[], optionsOrCallback?: Object | Callback, callback?: Callback): void;
|
||||
createTemplateRegistration(gcmRegistrationId: string, tags: string | string[], template: any, optionsOrCallback?: Object | Callback, callback?: Callback): void;
|
||||
createOrUpdateTemplateRegistration(registrationId: string, gcmRegistrationId: string, tags: string | string[], template: any, optionsOrCallback?: Object | Callback, callback?: Callback): void;
|
||||
updateTemplateRegistration(registrationId: string, gcmRegistrationId: string, tags: string | string[], template: any, optionsOrCallback?: Object | Callback, callback?: Callback): void;
|
||||
listRegistrationsByGcmRegistrationId(gcmRegistrationId: string, optionsOrCallback?: { top: number, skip: number } | Callback, callback?: Callback): void;
|
||||
|
||||
interface Base {
|
||||
_: {
|
||||
ContentRootElement: string;
|
||||
id: string;
|
||||
title: string;
|
||||
published: DateString;
|
||||
updated: DateString;
|
||||
author?: {
|
||||
name: string;
|
||||
};
|
||||
link: string;
|
||||
};
|
||||
CreatedAt: DateString;
|
||||
}
|
||||
|
||||
interface ExtendedBase extends Base {
|
||||
AuthorizationRules: string;
|
||||
AutoDeleteOnIdle: string;
|
||||
DefaultMessageTimeToLive: string;
|
||||
DuplicateDetectionHistoryTimeWindow: Duration;
|
||||
EnableBatchedOperations: string;
|
||||
EnableExpress: string;
|
||||
EnablePartitioning: string;
|
||||
EntityAvailabilityStatus: string;
|
||||
IsAnonymousAccessible: string;
|
||||
MaxSizeInMegabytes: string;
|
||||
RequiresDuplicateDetection: string;
|
||||
SizeInBytes: string;
|
||||
Status: EntityStatus;
|
||||
UpdatedAt: DateString;
|
||||
}
|
||||
|
||||
// export interface Generic extends Base {
|
||||
// [x: string]: string | Dictionary<string | object>;
|
||||
// }
|
||||
|
||||
export interface Topic extends ExtendedBase {
|
||||
AccessedAt: DateString;
|
||||
CountDetails: {
|
||||
'd2p1:ActiveMessageCount': string;
|
||||
'd2p1:DeadLetterMessageCount': string;
|
||||
'd2p1:ScheduledMessageCount': string;
|
||||
'd2p1:TransferMessageCount': string;
|
||||
'd2p1:TransferDeadLetterMessageCount': string;
|
||||
};
|
||||
EnableSubscriptionPartitioning: string;
|
||||
FilteringMessagesBeforePublishing: string;
|
||||
IsExpress: string;
|
||||
SubscriptionCount: string;
|
||||
SupportOrdering: string;
|
||||
TopicName: string;
|
||||
}
|
||||
|
||||
export interface Queue extends ExtendedBase {
|
||||
DeadLetteringOnMessageExpiration: string;
|
||||
LockDuration: Duration;
|
||||
MaxDeliveryCount: string;
|
||||
MessageCount: string;
|
||||
QueueName: string;
|
||||
RequiresSession: string;
|
||||
SupportOrdering: string;
|
||||
}
|
||||
|
||||
export interface Subscription extends ExtendedBase {
|
||||
CountDetails: {
|
||||
'd3p1:ActiveMessageCount': string;
|
||||
'd3p1:DeadLetterMessageCount': string;
|
||||
'd3p1:ScheduledMessageCount': string;
|
||||
'd3p1:TransferMessageCount': string;
|
||||
'd3p1:TransferDeadLetterMessageCount': string;
|
||||
};
|
||||
DeadLetteringOnFilterEvaluationExceptions: string;
|
||||
DeadLetteringOnMessageExpiration: string;
|
||||
LockDuration: string;
|
||||
MaxDeliveryCount: string;
|
||||
MessageCount: string;
|
||||
RequiresSession: string;
|
||||
SubscriptionName: string;
|
||||
TopicName: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-messaging-sql-filter
|
||||
*/
|
||||
interface SqlFilter {
|
||||
readonly CompatibilityLevel: string;
|
||||
Parameters?: Dictionary<any>;
|
||||
RequiresPreprocessing?: string;
|
||||
SqlExpression: string;
|
||||
}
|
||||
|
||||
type CorrelationFilter = Partial<{
|
||||
ContentType: string;
|
||||
CorrelationId: string;
|
||||
Label: string;
|
||||
Properties: string;
|
||||
ReplyTo: string;
|
||||
ReplyToSessionId: string;
|
||||
RequiresPreprocessing: string;
|
||||
SessionId: string;
|
||||
To: string;
|
||||
}>;
|
||||
|
||||
export interface Rule extends Base {
|
||||
Action: string | SqlFilter;
|
||||
Filter: SqlFilter | CorrelationFilter;
|
||||
Name: string;
|
||||
TopicName: string;
|
||||
SubscriptionName: string;
|
||||
RuleName: string;
|
||||
}
|
||||
}
|
||||
|
||||
export module Mpns { interface Service { } }
|
||||
/*
|
||||
* Callbacks
|
||||
*/
|
||||
export type ResponseCallback = (error: Error | null, response: Response) => void;
|
||||
|
||||
export module Wns {
|
||||
interface Payload {
|
||||
text1?: string;
|
||||
text2?: string;
|
||||
text3?: string;
|
||||
text4?: string;
|
||||
image1src?: string;
|
||||
image1alt?: string;
|
||||
image2src?: string;
|
||||
image2alt?: string;
|
||||
image3src?: string;
|
||||
image3alt?: string;
|
||||
image4src?: string;
|
||||
image4alt?: string;
|
||||
lang?: string;
|
||||
type?: string;
|
||||
}
|
||||
export type ResultAndResponseCallback = (error: Error | null,
|
||||
result: boolean | Results.Models.Base | Results.Models.Base[],
|
||||
response: Response) => void;
|
||||
|
||||
interface Options {
|
||||
headers: Object;
|
||||
}
|
||||
export type TypedResultAndResponseCallback<T> = (error: Error | null,
|
||||
result: T,
|
||||
response: Response) => void;
|
||||
|
||||
interface Service {
|
||||
new(service: NotificationHubService): Service;
|
||||
sendTileSquareBlock(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileSquareText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileSquareText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileSquareText03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileSquareText04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideText03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideText04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideText05(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideText06(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideText07(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideText08(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideText09(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideText10(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideText11(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileSquareImage(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileSquarePeekImageAndText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileSquarePeekImageAndText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileSquarePeekImageAndText03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileSquarePeekImageAndText04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideImage(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideImageCollection(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideImageAndText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideImageAndText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideBlockAndText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideBlockAndText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideSmallImageAndText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideSmallImageAndText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideSmallImageAndText03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideSmallImageAndText04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWideSmallImageAndText05(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImageCollection01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImageCollection02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImageCollection03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImageCollection04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImageCollection05(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImageCollection06(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImageAndText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImageAndText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImage01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImage02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImage03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImage04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImage05(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendTileWidePeekImage06(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendToastText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendToastText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendToastText03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendToastText04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendToastImageAndText01(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendToastImageAndText02(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendToastImageAndText03(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendToastImageAndText04(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
// badges = ['none','activity','alert','available','away','busy','newMessage','paused','playing','unavailable','error', 'attention']
|
||||
sendBadge(tags: string | string[], value: string | number, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
sendRaw(tags: string | string[], payload: any, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
// types = ['wns/toast', 'wns/badge', 'wns/tile', 'wns/raw']
|
||||
send(tags: string | string[], payload: string, type: string, optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
createNativeRegistration(channel: string, tags: string | string[], optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
createOrUpdateNativeRegistration(registrationId: string, channel: string, tags: string | string[], optionsOrCallback?: Options | Callback, callback?: Callback): void;
|
||||
listRegistrationsByChannel(channel: string, optionsOrCallback?: { top: number, skip: number } | Callback, callback?: Callback): void;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Options interfaces with all properties as optional
|
||||
*/
|
||||
export type BrokerProperties = Partial<IBrokerProperties>;
|
||||
export type BrokerPropertiesResponse = IBrokerPropertiesResponse & Partial<IBrokerProperties>;
|
||||
export type CreateQueueOptions = Partial<IQueueOptions>;
|
||||
export type CreateTopicOptions = Partial<ICreateTopicOptions>;
|
||||
export type CreateTopicIfNotExistsOptions = Partial<ICreateTopicIfNotExistsOptions>;
|
||||
export type CreateSubscriptionOptions = Partial<ICreateSubscriptionOptions>;
|
||||
export type ListSubscriptionsOptions = Partial<PaginationOptions>;
|
||||
export type ListRulesOptions = Partial<PaginationOptions>;
|
||||
export type CreateRuleOptions = Partial<ICreateRuleOptions>;
|
||||
export type CreateNotificationHubOptions = Partial<ICreateNotificationHubOptions>;
|
||||
export type ListNotificationHubsOptions = Partial<PaginationOptions>;
|
||||
|
||||
export type MessageOrName = Message | string;
|
||||
}
|
||||
|
||||
Vendored
+83
@@ -0,0 +1,83 @@
|
||||
import { Azure } from '../index';
|
||||
import NotificationHubService = require('azure-sb/lib/notificationhubservice');
|
||||
import ResponseCallback = Azure.ServiceBus.ResponseCallback;
|
||||
import NotificationHubRegistration = Azure.ServiceBus.NotificationHubRegistration;
|
||||
import ListNotificationHubsOptions = Azure.ServiceBus.ListNotificationHubsOptions;
|
||||
import Dictionary = Azure.ServiceBus.Dictionary;
|
||||
|
||||
type Template = Partial<{
|
||||
expiry: Date;
|
||||
aps: object;
|
||||
badge: number;
|
||||
alert: string;
|
||||
sound: string;
|
||||
payload: object;
|
||||
}>;
|
||||
|
||||
declare class ApnsService {
|
||||
constructor(notificationHubService: NotificationHubService);
|
||||
|
||||
public notificationHubService: NotificationHubService;
|
||||
|
||||
public send(tags: string | string[],
|
||||
payload: object | string,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public send(tags: string | string[],
|
||||
payload: object | string,
|
||||
options: { headers: Dictionary<string> },
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public createNativeRegistration(token: string,
|
||||
tags: string | string[],
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public createNativeRegistration(token: string,
|
||||
tags: string | string[],
|
||||
options: object,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public createOrUpdateNativeRegistration(registrationId: string,
|
||||
token: string,
|
||||
tags: string | string[],
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public createOrUpdateNativeRegistration(registrationId: string,
|
||||
token: string,
|
||||
tags: string | string[],
|
||||
options: object,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public createTemplateRegistration(token: string,
|
||||
tags: string | string[],
|
||||
template: Template | string,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public createTemplateRegistration(token: string,
|
||||
tags: string | string[],
|
||||
template: Template | string,
|
||||
options: object,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public updateTemplateRegistration(registrationId: string,
|
||||
token: string,
|
||||
tags: string | string[],
|
||||
template: Template | string,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public updateTemplateRegistration(registrationId: string,
|
||||
token: string,
|
||||
tags: string | string[],
|
||||
template: Template | string,
|
||||
options: { headers: Dictionary<string> },
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public listRegistrationsByToken(token: string,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public listRegistrationsByToken(token: string,
|
||||
options: ListNotificationHubsOptions,
|
||||
callback: ResponseCallback): void;
|
||||
}
|
||||
|
||||
export = ApnsService;
|
||||
Vendored
+71
@@ -0,0 +1,71 @@
|
||||
import { Azure } from '../index';
|
||||
import NotificationHubService = require('azure-sb/lib/notificationhubservice');
|
||||
import ResponseCallback = Azure.ServiceBus.ResponseCallback;
|
||||
import NotificationHubRegistration = Azure.ServiceBus.NotificationHubRegistration;
|
||||
import ListNotificationHubsOptions = Azure.ServiceBus.ListNotificationHubsOptions;
|
||||
import Dictionary = Azure.ServiceBus.Dictionary;
|
||||
|
||||
type Template = Partial<{}>;
|
||||
|
||||
declare class GcmService {
|
||||
constructor(notificationHubService: NotificationHubService);
|
||||
|
||||
public notificationHubService: NotificationHubService;
|
||||
|
||||
public send(tags: string | string[],
|
||||
payload: object | string,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public createNativeRegistration(gcmRegistrationId: string,
|
||||
tags: string | string[],
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public createNativeRegistration(token: string,
|
||||
tags: string | string[],
|
||||
options: object,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public createOrUpdateNativeRegistration(registrationId: string,
|
||||
gcmRegistrationId: string,
|
||||
tags: string | string[],
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public createOrUpdateNativeRegistration(registrationId: string,
|
||||
gcmRegistrationId: string,
|
||||
tags: string | string[],
|
||||
options: object,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public createTemplateRegistration(gcmRegistrationId: string,
|
||||
tags: string | string[],
|
||||
template: Template | string,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public createTemplateRegistration(gcmRegistrationId: string,
|
||||
tags: string | string[],
|
||||
template: Template | string,
|
||||
options: object,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public updateTemplateRegistration(registrationId: string,
|
||||
gcmRegistrationId: string,
|
||||
tags: string | string[],
|
||||
template: Template | string,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public updateTemplateRegistration(registrationId: string,
|
||||
gcmRegistrationId: string,
|
||||
tags: string | string[],
|
||||
template: Template | string,
|
||||
options: { headers: Dictionary<string> },
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public listRegistrationsByGcmRegistrationId(gcmRegistrationId: string,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public listRegistrationsByGcmRegistrationId(gcmRegistrationId: string,
|
||||
options: ListNotificationHubsOptions,
|
||||
callback: ResponseCallback): void;
|
||||
}
|
||||
|
||||
export = GcmService;
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
//
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import { Azure } from 'azure-sb';
|
||||
import Dictionary = Azure.ServiceBus.Dictionary;
|
||||
|
||||
export namespace Azure.ServiceBus.Results {
|
||||
export interface AcsTokenResponse extends Dictionary<string | Dictionary<string>> {
|
||||
WrapAccessToken: Dictionary<string>;
|
||||
WrapAccessTokenExpiresIn: Dictionary<string>;
|
||||
}
|
||||
|
||||
export interface AcsTokenResult {
|
||||
parse(acsTokenQueryString: string): AcsTokenResponse;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
//
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import { Azure } from 'azure-sb';
|
||||
import Dictionary = Azure.ServiceBus.Dictionary;
|
||||
|
||||
export namespace Azure.ServiceBus.Results {
|
||||
export interface NotificationHubResult {
|
||||
serialize(resource: Azure.ServiceBus.CreateNotificationHubOptions): string;
|
||||
|
||||
parse(xml: object): object | object[];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
//
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Module dependencies.
|
||||
import { Azure } from 'azure-sb';
|
||||
import Dictionary = Azure.ServiceBus.Dictionary;
|
||||
|
||||
export namespace Azure.ServiceBus.Results {
|
||||
export interface QueueResponse {
|
||||
body: any;
|
||||
headers: Dictionary<string>
|
||||
}
|
||||
|
||||
export interface QueueMessageResponse {
|
||||
body: any;
|
||||
brokerProperties?: Azure.ServiceBus.BrokerProperties;
|
||||
customProperties?: Dictionary<any>;
|
||||
contentType?: string;
|
||||
location?: string;
|
||||
}
|
||||
|
||||
export interface QueueMessageResult {
|
||||
parse(responseObject: object): QueueMessageResponse;
|
||||
|
||||
isRFC1123(value: string | any): boolean;
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
//
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import { Azure } from 'azure-sb';
|
||||
import Dictionary = Azure.ServiceBus.Dictionary;
|
||||
|
||||
export namespace Azure.ServiceBus.Results {
|
||||
export interface QueueProperties {
|
||||
DeadLetteringOnMessageExpiration: string;
|
||||
DefaultMessageTimeToLive: string;
|
||||
DuplicateDetectionHistoryTimeWindow: string;
|
||||
EnableBatchedOperations: boolean;
|
||||
EnablePartitioning: boolean;
|
||||
LockDuration: string;
|
||||
MaxDeliveryCount: number;
|
||||
MaxSizeInMegabytes: number;
|
||||
MessageCount: number;
|
||||
RequiresDuplicateDetection: boolean;
|
||||
RequiresSession: boolean;
|
||||
SizeInBytes: number;
|
||||
}
|
||||
|
||||
export interface QueueResult {
|
||||
serialize(resource: QueueProperties): string;
|
||||
|
||||
parse(xml: object): object | object[];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
//
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import { Azure } from 'azure-sb';
|
||||
import Dictionary = Azure.ServiceBus.Dictionary;
|
||||
|
||||
export namespace Azure.ServiceBus.Results {
|
||||
export interface RegistrationResult {
|
||||
serialize(type: string, resource: object, properties: string[]): string;
|
||||
|
||||
parse(xml: object): object | object[];
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
//
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import { Azure } from 'azure-sb';
|
||||
import Dictionary = Azure.ServiceBus.Dictionary;
|
||||
|
||||
export namespace Azure.ServiceBus.Results {
|
||||
export interface ResourceResult {
|
||||
setName(entry: Dictionary<any> | { _: { id: string } }, nameProperty: string): void;
|
||||
|
||||
serialize(resourceName: string, resource: object, properties: string[]): string;
|
||||
|
||||
parse(resourceName: string, nameProperty: string, xml: object): object | object[];
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
//
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
// Module dependencies.
|
||||
import { Azure } from 'azure-sb';
|
||||
|
||||
export namespace Azure.ServiceBus.Results {
|
||||
export interface RuleResult {
|
||||
serialize(rule: Azure.ServiceBus.CreateRuleOptions): string;
|
||||
|
||||
parse(xml: object): object | object[];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
//
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import { Azure } from 'azure-sb';
|
||||
|
||||
export namespace Azure.ServiceBus.Results {
|
||||
export interface SubscriptionProperties {
|
||||
LockDuration: string;
|
||||
RequiresSession: boolean;
|
||||
DefaultMessageTimeToLive: string;
|
||||
DeadLetteringOnMessageExpiration: string;
|
||||
DeadLetteringOnFilterEvaluationExceptions: string;
|
||||
MessageCount: number;
|
||||
MaxDeliveryCount: number;
|
||||
EnableBatchedOperations: boolean;
|
||||
AutoDeleteOnIdle: boolean;
|
||||
}
|
||||
|
||||
export interface SubscriptionResult {
|
||||
serialize(resource: SubscriptionProperties): string;
|
||||
|
||||
parse(xml: object): object | object[];
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// Copyright (c) Microsoft and contributors. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
//
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
export namespace Azure.ServiceBus.Results {
|
||||
export interface TopicProperties {
|
||||
DefaultMessageTimeToLive: string;
|
||||
MaxSizeInMegabytes: number;
|
||||
RequiresDuplicateDetection: boolean;
|
||||
DuplicateDetectionHistoryTimeWindow: string;
|
||||
EnableBatchedOperations: boolean;
|
||||
SizeInBytes: number;
|
||||
SupportOrdering: boolean;
|
||||
EnablePartitioning: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export function serialize(resource: Azure.ServiceBus.Results.TopicProperties): string;
|
||||
|
||||
export function parse(xml: object): object | object[];
|
||||
Vendored
+116
@@ -0,0 +1,116 @@
|
||||
import { Azure } from '../index';
|
||||
import NotificationHubService = require('azure-sb/lib/notificationhubservice');
|
||||
import ResponseCallback = Azure.ServiceBus.ResponseCallback;
|
||||
import NotificationHubRegistration = Azure.ServiceBus.NotificationHubRegistration;
|
||||
import ListNotificationHubsOptions = Azure.ServiceBus.ListNotificationHubsOptions;
|
||||
import Dictionary = Azure.ServiceBus.Dictionary;
|
||||
|
||||
type Template = TileTemplate | FlipTileTemplate | ToastTemplate;
|
||||
|
||||
interface TileTemplate {
|
||||
backgroundImage: string;
|
||||
count: string;
|
||||
title: string;
|
||||
backBackgroundImage: string;
|
||||
backTitle: string;
|
||||
backContent: string;
|
||||
id: string;
|
||||
}
|
||||
|
||||
interface FlipTileTemplate extends TileTemplate {
|
||||
smallBackgroundImage: string;
|
||||
wideBackgroundImage: string;
|
||||
wideBackContent: string;
|
||||
wideBackBackgroundImage: string;
|
||||
}
|
||||
|
||||
interface ToastTemplate {
|
||||
text1: string;
|
||||
text2: string;
|
||||
param?: string;
|
||||
}
|
||||
|
||||
declare class MpnsService {
|
||||
constructor(notificationHubService: NotificationHubService);
|
||||
|
||||
public notificationHubService: NotificationHubService;
|
||||
|
||||
public send(tags: string | string[],
|
||||
payload: object | string,
|
||||
targetName: string,
|
||||
notificationClass: string,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public send(tags: string | string[],
|
||||
payload: object | string,
|
||||
targetName: string,
|
||||
notificationClass: string,
|
||||
options: { headers: Dictionary<string> },
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public createNativeRegistration(channel: string,
|
||||
tags: string | string[],
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public createNativeRegistration(channel: string,
|
||||
tags: string | string[],
|
||||
options: object,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public createOrUpdateNativeRegistration(registrationId: string,
|
||||
channel: string,
|
||||
tags: string | string[],
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public createOrUpdateNativeRegistration(registrationId: string,
|
||||
channel: string,
|
||||
tags: string | string[],
|
||||
options: object,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public createRawTemplateRegistration(channel: string,
|
||||
tags: string | string[],
|
||||
template: Template | string,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public createRawTemplateRegistration(channel: string,
|
||||
tags: string | string[],
|
||||
template: Template | string,
|
||||
options: object,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public createOrUpdateRawTemplateRegistration(registrationId: string,
|
||||
channel: string,
|
||||
tags: string | string[],
|
||||
template: Template | string,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public createOrUpdateRawTemplateRegistration(registrationId: string,
|
||||
channel: string,
|
||||
tags: string | string[],
|
||||
template: Template | string,
|
||||
options: object,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public updatesRawTemplateRegistration(registrationId: string,
|
||||
channel: string,
|
||||
tags: string | string[],
|
||||
template: Template | string,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public updatesRawTemplateRegistration(registrationId: string,
|
||||
channel: string,
|
||||
tags: string | string[],
|
||||
template: Template | string,
|
||||
options: object,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public listRegistrationsByChannel(channel: string,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public listRegistrationsByChannel(channel: string,
|
||||
options: ListNotificationHubsOptions,
|
||||
callback: ResponseCallback): void;
|
||||
}
|
||||
|
||||
export = MpnsService;
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
import { Azure } from 'azure-sb';
|
||||
import Callback = Azure.ServiceBus.ResponseCallback;
|
||||
import NotificationHubRegistration = Azure.ServiceBus.NotificationHubRegistration;
|
||||
import ListNotificationHubsOptions = Azure.ServiceBus.ListNotificationHubsOptions;
|
||||
|
||||
import ApnsService = require('./apnsservice');
|
||||
import GcmService = require('./gcmservice');
|
||||
import MpnsService = require('./mpnservice');
|
||||
import WnsService = require('./wnsservice');
|
||||
|
||||
declare class NotificationHubService {
|
||||
constructor(hubName: string,
|
||||
endpointOrConnectionString: string,
|
||||
sharedAccessKeyName: string,
|
||||
sharedAccessKeyValue: string);
|
||||
|
||||
public hubName: string;
|
||||
public wns: WnsService;
|
||||
public apns: ApnsService;
|
||||
public gcm: GcmService;
|
||||
public mpns: MpnsService;
|
||||
|
||||
public send(tags: string,
|
||||
payload: object | string,
|
||||
callback: Callback): void;
|
||||
|
||||
public send(tags: string,
|
||||
payload: object | string,
|
||||
options: { headers: object },
|
||||
callback: Callback): void;
|
||||
|
||||
public createOrUpdateInstallation(installation: string,
|
||||
callback: Callback): void;
|
||||
|
||||
public createOrUpdateInstallation(installation: string,
|
||||
options: any,
|
||||
callback: Callback): void;
|
||||
|
||||
public patchInstallation(installationId: string,
|
||||
partialUpdateOperations: any[],
|
||||
callback: Callback): void;
|
||||
|
||||
public patchInstallation(installationId: string,
|
||||
partialUpdateOperations: any[],
|
||||
options: any,
|
||||
callback: Callback): void;
|
||||
|
||||
public deleteInstallation(installationId: string,
|
||||
callback: Callback): void;
|
||||
|
||||
public deleteInstallation(installationId: string,
|
||||
options: any,
|
||||
callback: Callback): void;
|
||||
|
||||
public getInstallation(installationId: string,
|
||||
callback: Callback): void;
|
||||
|
||||
public getInstallation(installationId: string,
|
||||
options: any,
|
||||
callback: Callback): void;
|
||||
|
||||
public createRegistrationId(callback: Callback): void;
|
||||
|
||||
public getRegistration(registrationId: string,
|
||||
callback: Callback): void;
|
||||
|
||||
public getRegistration(registrationId: string,
|
||||
options: any,
|
||||
callback: Callback): void;
|
||||
|
||||
public deleteRegistration(registrationId: string,
|
||||
callback: Callback): void;
|
||||
|
||||
public deleteRegistration(registrationId: string,
|
||||
options: { etag: any },
|
||||
callback: Callback): void;
|
||||
|
||||
public updateRegistration(registration: NotificationHubRegistration,
|
||||
callback: Callback): void;
|
||||
|
||||
public updateRegistration(registration: NotificationHubRegistration,
|
||||
options: { etag: any },
|
||||
callback: Callback): void;
|
||||
|
||||
public createOrUpdateRegistration(registration: NotificationHubRegistration,
|
||||
options: { etag: any },
|
||||
callback: Callback): void;
|
||||
|
||||
public listRegistrations(callback: Callback): void;
|
||||
|
||||
public listRegistrations(options: ListNotificationHubsOptions,
|
||||
callback: Callback): void;
|
||||
|
||||
public listRegistrationsByTag(tag: string,
|
||||
callback: Callback): void;
|
||||
|
||||
public listRegistrationsByTag(tag: string,
|
||||
options: ListNotificationHubsOptions,
|
||||
callback: Callback): void;
|
||||
}
|
||||
|
||||
export = NotificationHubService;
|
||||
+206
@@ -0,0 +1,206 @@
|
||||
import { Azure } from '../index';
|
||||
|
||||
import ServiceBusServiceBase = require('./servicebusservicebase');
|
||||
|
||||
import CreateNotificationHubOptions = Azure.ServiceBus.CreateNotificationHubOptions;
|
||||
import CreateQueueOptions = Azure.ServiceBus.CreateQueueOptions;
|
||||
import CreateRuleOptions = Azure.ServiceBus.CreateRuleOptions;
|
||||
import CreateSubscriptionOptions = Azure.ServiceBus.CreateSubscriptionOptions;
|
||||
import CreateTopicIfNotExistsOptions = Azure.ServiceBus.CreateTopicIfNotExistsOptions;
|
||||
import CreateTopicOptions = Azure.ServiceBus.CreateTopicOptions;
|
||||
import ListNotificationHubsOptions = Azure.ServiceBus.ListNotificationHubsOptions;
|
||||
import ListRulesOptions = Azure.ServiceBus.ListRulesOptions;
|
||||
import ListSubscriptionsOptions = Azure.ServiceBus.ListSubscriptionsOptions;
|
||||
import MessageOrName = Azure.ServiceBus.MessageOrName;
|
||||
import Queue = Azure.ServiceBus.Results.Models.Queue;
|
||||
import ReceiveQueueMessageOptions = Azure.ServiceBus.ReceiveQueueMessageOptions;
|
||||
import ReceiveSubscriptionMessageOptions = Azure.ServiceBus.ReceiveSubscriptionMessageOptions;
|
||||
import ResponseCallback = Azure.ServiceBus.ResponseCallback;
|
||||
import ResultAndResponseCallback = Azure.ServiceBus.ResultAndResponseCallback;
|
||||
import Rule = Azure.ServiceBus.Results.Models.Rule;
|
||||
import Subscription = Azure.ServiceBus.Results.Models.Subscription;
|
||||
import Topic = Azure.ServiceBus.Results.Models.Topic;
|
||||
import TypedResultAndResponseCallback = Azure.ServiceBus.TypedResultAndResponseCallback;
|
||||
import Message = Azure.ServiceBus.Message;
|
||||
|
||||
declare class ServiceBusService extends ServiceBusServiceBase {
|
||||
constructor(configOrNamespaceOrConnectionString?: string,
|
||||
accessKey?: string,
|
||||
issuer?: string,
|
||||
acsNamespace?: string,
|
||||
host?: string,
|
||||
authenticationProvider?: object);
|
||||
|
||||
public receiveQueueMessage(queuePath: string,
|
||||
callback: TypedResultAndResponseCallback<Message>): void;
|
||||
|
||||
public receiveQueueMessage(queuePath: string,
|
||||
options: ReceiveQueueMessageOptions,
|
||||
callback: TypedResultAndResponseCallback<Message>): void;
|
||||
|
||||
public receiveSubscriptionMessage(topicPath: string,
|
||||
subscriptionPath: string,
|
||||
callback: TypedResultAndResponseCallback<Message>): void;
|
||||
|
||||
public receiveSubscriptionMessage(topicPath: string,
|
||||
subscriptionPath: string,
|
||||
options: ReceiveSubscriptionMessageOptions,
|
||||
callback: TypedResultAndResponseCallback<Message>): void;
|
||||
|
||||
public deleteMessage(message: MessageOrName,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public unlockMessage(message: MessageOrName,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public renewLockForMessage(message: MessageOrName,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public sendQueueMessage(queuePath: string,
|
||||
message: MessageOrName,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public sendTopicMessage(topicPath: string,
|
||||
message: MessageOrName,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
/*
|
||||
* Queue Management functions
|
||||
*/
|
||||
|
||||
public createQueue(queuePath: string,
|
||||
callback: TypedResultAndResponseCallback<Queue>): void;
|
||||
|
||||
public createQueue(queuePath: string,
|
||||
options: CreateQueueOptions,
|
||||
callback: TypedResultAndResponseCallback<Queue>): void;
|
||||
|
||||
public createQueueIfNotExists(queuePath: string,
|
||||
callback: TypedResultAndResponseCallback<boolean>): void;
|
||||
|
||||
public createQueueIfNotExists(queuePath: string,
|
||||
options: CreateQueueOptions,
|
||||
callback: TypedResultAndResponseCallback<boolean>): void;
|
||||
|
||||
public deleteQueue(queuePath: string,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public getQueue(queuePath: string,
|
||||
callback: TypedResultAndResponseCallback<Queue>): void;
|
||||
|
||||
public listQueues(queuePath: string,
|
||||
callback: TypedResultAndResponseCallback<Queue[]>): void;
|
||||
|
||||
/*
|
||||
* Topic Management functions
|
||||
*/
|
||||
|
||||
public createTopic(topicPath: string,
|
||||
callback: TypedResultAndResponseCallback<Topic>): void;
|
||||
|
||||
public createTopic(topicPath: string,
|
||||
options: CreateTopicOptions,
|
||||
callback: TypedResultAndResponseCallback<Topic>): void;
|
||||
|
||||
public createTopicIfNotExists(topicPath: string,
|
||||
callback: TypedResultAndResponseCallback<boolean>): void;
|
||||
|
||||
public createTopicIfNotExists(topicPath: string,
|
||||
options: CreateTopicIfNotExistsOptions,
|
||||
callback: TypedResultAndResponseCallback<boolean>): void;
|
||||
|
||||
public deleteTopic(topicPath: string,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public getTopic(topicPath: string,
|
||||
callback: TypedResultAndResponseCallback<Topic>): void;
|
||||
|
||||
public listTopics(topicPath: string,
|
||||
callback: TypedResultAndResponseCallback<Topic[]>): void;
|
||||
|
||||
/*
|
||||
* Subscription functions
|
||||
*/
|
||||
|
||||
public createSubscription(topicPath: string,
|
||||
subscriptionPath: string,
|
||||
callback: TypedResultAndResponseCallback<Subscription>): void;
|
||||
|
||||
public createSubscription(topicPath: string,
|
||||
subscriptionPath: string,
|
||||
options: CreateSubscriptionOptions,
|
||||
callback: TypedResultAndResponseCallback<Subscription>): void;
|
||||
|
||||
public deleteSubscription(topicPath: string,
|
||||
subscriptionPath: string,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public getSubscription(topicPath: string,
|
||||
subscriptionPath: string,
|
||||
callback: TypedResultAndResponseCallback<Subscription>): void;
|
||||
|
||||
public listSubscriptions(topicPath: string,
|
||||
callback: TypedResultAndResponseCallback<Subscription[]>): void;
|
||||
|
||||
public listSubscriptions(topicPath: string,
|
||||
options: ListSubscriptionsOptions,
|
||||
callback: TypedResultAndResponseCallback<Subscription[]>): void;
|
||||
|
||||
/*
|
||||
* Rule functions
|
||||
*/
|
||||
|
||||
public createRule(topicPath: string,
|
||||
subscriptionPath: string,
|
||||
rulePath: string,
|
||||
callback: TypedResultAndResponseCallback<Rule>): void;
|
||||
|
||||
public createRule(topicPath: string,
|
||||
subscriptionPath: string,
|
||||
rulePath: string,
|
||||
options: CreateRuleOptions,
|
||||
callback: TypedResultAndResponseCallback<Rule>): void;
|
||||
|
||||
public deleteRule(topicPath: string,
|
||||
subscriptionPath: string,
|
||||
rulePath: string,
|
||||
callback: ResponseCallback): void;
|
||||
|
||||
public getRule(topicPath: string,
|
||||
subscriptionPath: string,
|
||||
rulePath: string,
|
||||
callback: TypedResultAndResponseCallback<Rule>): void;
|
||||
|
||||
public listRules(topicPath: string,
|
||||
subscriptionPath: string,
|
||||
callback: TypedResultAndResponseCallback<Rule[]>): void;
|
||||
|
||||
public listRules(topicPath: string,
|
||||
subscriptionPath: string,
|
||||
options: ListRulesOptions,
|
||||
callback: TypedResultAndResponseCallback<Rule[]>): void;
|
||||
|
||||
/*
|
||||
* NotificationHub functions
|
||||
*/
|
||||
|
||||
public createNotificationHub(hubPath: string,
|
||||
callback: ResultAndResponseCallback): void;
|
||||
|
||||
public createNotificationHub(hubPath: string,
|
||||
options: CreateNotificationHubOptions,
|
||||
callback: ResultAndResponseCallback): void;
|
||||
|
||||
public getNotificationHub(hubPath: string,
|
||||
callback: ResultAndResponseCallback): void;
|
||||
|
||||
public listNotificationHubs(callback: ResultAndResponseCallback): void;
|
||||
|
||||
public listNotificationHubs(options: ListNotificationHubsOptions,
|
||||
callback: ResultAndResponseCallback): void;
|
||||
|
||||
public deleteNotificationHub(hubPath: string,
|
||||
callback: ResponseCallback): void;
|
||||
}
|
||||
|
||||
export = ServiceBusService;
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
import ServiceBusServiceClient = require('azure-sb/lib/servicebusserviceclient');
|
||||
|
||||
declare class ServiceBusServiceBase extends ServiceBusServiceClient {
|
||||
constructor(configOrNamespaceOrConnectionString: string,
|
||||
accessKey?: string,
|
||||
issuer?: string,
|
||||
acsNamespace?: string,
|
||||
host?: string,
|
||||
authenticationProvider?: object);
|
||||
}
|
||||
|
||||
export = ServiceBusServiceBase;
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
/// <reference types="node" />
|
||||
import EventEmitter = NodeJS.EventEmitter;
|
||||
|
||||
declare class ServiceBusServiceClient extends EventEmitter {
|
||||
constructor(accessKey?: string,
|
||||
issuer?: string,
|
||||
sharedAccessKeyName?: string,
|
||||
sharedAccessKeyValue?: string,
|
||||
host?: string,
|
||||
acsHost?: string,
|
||||
authenticationProvider?: object);
|
||||
}
|
||||
|
||||
export = ServiceBusServiceClient;
|
||||
Vendored
+377
@@ -0,0 +1,377 @@
|
||||
import NotificationHubService = require('azure-sb/lib/notificationhubservice');
|
||||
import Callback = Azure.ServiceBus.ResponseCallback;
|
||||
import { Azure } from 'azure-sb';
|
||||
import ListNotificationHubsOptions = Azure.ServiceBus.ListNotificationHubsOptions;
|
||||
import Dictionary = Azure.ServiceBus.Dictionary;
|
||||
|
||||
type Payload = Partial<{
|
||||
text1: string;
|
||||
text2: string;
|
||||
text3: string;
|
||||
text4: string;
|
||||
image1src: string;
|
||||
image1alt: string;
|
||||
image2src: string;
|
||||
image2alt: string;
|
||||
image3src: string;
|
||||
image3alt: string;
|
||||
image4src: string;
|
||||
image4alt: string;
|
||||
lang: string;
|
||||
type: string;
|
||||
}>;
|
||||
|
||||
interface Options {
|
||||
headers: Dictionary<string>;
|
||||
}
|
||||
|
||||
type badges =
|
||||
'none'
|
||||
| 'activity'
|
||||
| 'alert'
|
||||
| 'available'
|
||||
| 'away'
|
||||
| 'busy'
|
||||
| 'newMessage'
|
||||
| 'paused'
|
||||
| 'playing'
|
||||
| 'unavailable'
|
||||
| 'error'
|
||||
| 'attention';
|
||||
|
||||
type types = 'wns/toast' | 'wns/badge' | 'wns/tile' | 'wns/raw';
|
||||
|
||||
declare class WnsService {
|
||||
constructor(service: NotificationHubService);
|
||||
|
||||
public notificationHubService: NotificationHubService;
|
||||
|
||||
sendTileSquareBlock(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileSquareText01(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileSquareText02(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileSquareText03(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileSquareText04(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWideText01(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWideText02(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWideText03(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWideText04(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWideText05(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWideText06(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWideText07(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWideText08(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWideText09(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWideText10(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWideText11(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileSquareImage(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileSquarePeekImageAndText01(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileSquarePeekImageAndText02(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileSquarePeekImageAndText03(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileSquarePeekImageAndText04(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWideImage(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWideImageCollection(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWideImageAndText01(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWideImageAndText02(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWideBlockAndText01(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWideBlockAndText02(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWideSmallImageAndText01(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWideSmallImageAndText02(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWideSmallImageAndText03(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWideSmallImageAndText04(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWideSmallImageAndText05(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWidePeekImageCollection01(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWidePeekImageCollection02(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWidePeekImageCollection03(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWidePeekImageCollection04(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWidePeekImageCollection05(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWidePeekImageCollection06(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWidePeekImageAndText01(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWidePeekImageAndText02(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWidePeekImage01(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWidePeekImage02(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWidePeekImage03(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWidePeekImage04(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWidePeekImage05(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendTileWidePeekImage06(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendToastText01(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendToastText02(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendToastText03(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendToastText04(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendToastImageAndText01(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendToastImageAndText02(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendToastImageAndText03(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendToastImageAndText04(tags: string | string[],
|
||||
payload: any,
|
||||
optionsOrCallback: Options | Callback,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendBadge(tags: badges | badges[],
|
||||
value: string | number,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendBadge(tags: badges | badges[],
|
||||
value: string | number,
|
||||
options: Options,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendRaw(tags: string | string[],
|
||||
payload: any,
|
||||
callback?: Callback): void;
|
||||
|
||||
sendRaw(tags: string | string[],
|
||||
payload: any,
|
||||
options: Options,
|
||||
callback?: Callback): void;
|
||||
|
||||
send(tags: string | string[],
|
||||
payload: string,
|
||||
type: types,
|
||||
callback?: Callback): void;
|
||||
|
||||
send(tags: string | string[],
|
||||
payload: string,
|
||||
type: types,
|
||||
options: Options,
|
||||
callback: Callback): void;
|
||||
|
||||
createNativeRegistration(channel: string,
|
||||
tags: string | string[],
|
||||
callback: Callback): void;
|
||||
|
||||
createNativeRegistration(channel: string,
|
||||
tags: string | string[],
|
||||
options: Options,
|
||||
callback: Callback): void;
|
||||
|
||||
createOrUpdateNativeRegistration(registrationId: string,
|
||||
channel: string,
|
||||
tags: string | string[],
|
||||
callback: Callback): void;
|
||||
|
||||
createOrUpdateNativeRegistration(registrationId: string,
|
||||
channel: string,
|
||||
tags: string | string[],
|
||||
options: Options,
|
||||
callback: Callback): void;
|
||||
|
||||
listRegistrationsByChannel(channel: string,
|
||||
callback: Callback): void;
|
||||
|
||||
listRegistrationsByChannel(channel: string,
|
||||
options: ListNotificationHubsOptions,
|
||||
callback: Callback): void;
|
||||
|
||||
}
|
||||
|
||||
export = WnsService;
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
import { Azure } from 'azure-sb';
|
||||
|
||||
declare class WrapService {
|
||||
constructor(acsHost: string, issuer?: string, accessKey?: string);
|
||||
|
||||
public issuer?: string;
|
||||
public accessKey?: string;
|
||||
public authenticationProvider: {
|
||||
signRequest(webResource: any, callback: () => void): void;
|
||||
};
|
||||
public strictSSL: boolean;
|
||||
|
||||
public wrapAccessToken(uri: string,
|
||||
callback: Azure.ServiceBus.ResponseCallback): void;
|
||||
|
||||
public wrapAccessToken(uri: string,
|
||||
options: object,
|
||||
callback: Azure.ServiceBus.ResponseCallback): void;
|
||||
}
|
||||
|
||||
export = WrapService;
|
||||
@@ -17,7 +17,26 @@
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"azure-sb-tests.ts"
|
||||
"lib/servicebusservice.d.ts",
|
||||
"lib/wrapservice.d.ts",
|
||||
"lib/servicebusservicebase.d.ts",
|
||||
"lib/notificationhubservice.d.ts",
|
||||
"lib/models/topicresult.d.ts",
|
||||
"lib/models/queuemessageresult.d.ts",
|
||||
"lib/models/acstokenresult.d.ts",
|
||||
"lib/models/registrationresult.d.ts",
|
||||
"lib/models/ruleresult.d.ts",
|
||||
"lib/models/queueresult.d.ts",
|
||||
"lib/models/subscriptionresult.d.ts",
|
||||
"lib/models/notificationhubresult.d.ts",
|
||||
"lib/models/resourceresult.d.ts",
|
||||
"lib/servicebusserviceclient.d.ts",
|
||||
"lib/gcmservice.d.ts",
|
||||
"lib/wnsservice.d.ts",
|
||||
"lib/mpnservice.d.ts",
|
||||
"lib/apnsservice.d.ts",
|
||||
"azure-sb-tests.ts",
|
||||
"index.d.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vendored
+3
-5
@@ -280,11 +280,9 @@ export interface Big {
|
||||
export const Big: BigConstructor;
|
||||
|
||||
// Helpers to allow referencing Big and BigConstructor from inside the global declaration without creating a self reference
|
||||
/* tslint:disable:strict-export-declare-modifiers */
|
||||
type Big_ = Big;
|
||||
type BigConstructor_ = BigConstructor;
|
||||
type BigSource_ = BigSource;
|
||||
/* tslint:enable:strict-export-declare-modifiers */
|
||||
export type Big_ = Big;
|
||||
export type BigConstructor_ = BigConstructor;
|
||||
export type BigSource_ = BigSource;
|
||||
|
||||
declare global {
|
||||
namespace BigJs {
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
import bindings = require('bindings');
|
||||
|
||||
// Use your bindings defined in your C files
|
||||
const result = bindings('binding.node').your_c_function();
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
// Type definitions for bindings 1.3
|
||||
// Project: https://github.com/TooTallNate/node-bindings
|
||||
// Definitions by: Daniel Perez Alvarez <https://github.com/unindented>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* The main `bindings()` function loads the compiled bindings for a given module.
|
||||
* It uses V8's Error API to determine the parent filename that this function is
|
||||
* being invoked from, which is then used to find the root directory.
|
||||
*/
|
||||
declare function bindings(mod: string): any;
|
||||
|
||||
export = bindings;
|
||||
@@ -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",
|
||||
"bindings-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
-3
@@ -6,10 +6,7 @@
|
||||
|
||||
/// <reference types="jquery" />
|
||||
|
||||
/* tslint:disable: interface-name no-any */
|
||||
|
||||
interface JQueryStatic {
|
||||
/* tslint:enable: interface-name */
|
||||
notify(message: string): NotifyReturn;
|
||||
notify(opts: NotifyOptions, settings?: NotifySettings): NotifyReturn;
|
||||
notifyDefaults(settings: NotifySettings): void;
|
||||
|
||||
Vendored
+3
@@ -58,6 +58,9 @@ export class Code {
|
||||
}
|
||||
export class DBRef {
|
||||
constructor(namespace: string, oid: ObjectID, db?: string);
|
||||
namespace: string;
|
||||
oid: ObjectID;
|
||||
db?: string;
|
||||
}
|
||||
export class Double {
|
||||
constructor(value: number);
|
||||
|
||||
Vendored
+3
-9
@@ -16,12 +16,10 @@ import * as Promise from "bluebird";
|
||||
* Everytime the same queue is instantiated it tries to process all the old jobs that may exist from a previous unfinished session.
|
||||
*/
|
||||
declare const Bull: {
|
||||
// tslint:disable:unified-signatures
|
||||
(queueName: string, opts?: Bull.QueueOptions): Bull.Queue;
|
||||
(queueName: string, url?: string): Bull.Queue;
|
||||
(queueName: string, url?: string): Bull.Queue; // tslint:disable-line unified-signatures
|
||||
new (queueName: string, opts?: Bull.QueueOptions): Bull.Queue;
|
||||
new (queueName: string, url?: string): Bull.Queue;
|
||||
// tslint:enable:unified-signatures
|
||||
new (queueName: string, url?: string): Bull.Queue; // tslint:disable-line unified-signatures
|
||||
};
|
||||
|
||||
declare namespace Bull {
|
||||
@@ -520,8 +518,6 @@ declare namespace Bull {
|
||||
*/
|
||||
clean(grace: number, status?: JobStatus, limit?: number): Promise<Job[]>;
|
||||
|
||||
// tslint:disable:unified-signatures
|
||||
|
||||
/**
|
||||
* Listens to queue events
|
||||
*/
|
||||
@@ -566,7 +562,7 @@ declare namespace Bull {
|
||||
/**
|
||||
* The queue has been resumed
|
||||
*/
|
||||
on(event: 'resumed', callback: EventCallback): this;
|
||||
on(event: 'resumed', callback: EventCallback): this; // tslint:disable-line unified-signatures
|
||||
|
||||
/**
|
||||
* Old jobs have been cleaned from the queue.
|
||||
@@ -575,8 +571,6 @@ declare namespace Bull {
|
||||
* @see Queue#clean() for details
|
||||
*/
|
||||
on(event: 'cleaned', callback: CleanedEventCallback): this;
|
||||
|
||||
// tslint:enable:unified-signatures
|
||||
}
|
||||
|
||||
type EventCallback = () => void;
|
||||
|
||||
Vendored
-4
@@ -24,8 +24,6 @@ declare class Logger extends EventEmitter {
|
||||
fields: any;
|
||||
src: boolean;
|
||||
|
||||
/* tslint:disable:unified-signatures */
|
||||
|
||||
/**
|
||||
* Returns a boolean: is the `trace` level enabled?
|
||||
*
|
||||
@@ -199,8 +197,6 @@ declare class Logger extends EventEmitter {
|
||||
* Uses `util.format` for msg formatting.
|
||||
*/
|
||||
fatal(format: any, ...params: any[]): void;
|
||||
|
||||
/* tslint:enable:unified-signatures */
|
||||
}
|
||||
|
||||
declare namespace Logger {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// ban-types needs to be disabled to support TypeScript <2.2
|
||||
"ban-types": false
|
||||
"ban-types": false,
|
||||
"unified-signatures": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
import CanCan = require('cancan');
|
||||
|
||||
const cancan = new CanCan();
|
||||
|
||||
// $ExpectType void
|
||||
cancan.allow('admin', 'manage', 'all');
|
||||
|
||||
// $ExpectType void
|
||||
cancan.allow('user', 'read', 'post', {public: true});
|
||||
|
||||
// $ExpectType boolean
|
||||
cancan.can('user', 'read', 'post');
|
||||
|
||||
// $ExpectType boolean
|
||||
cancan.cannot('user', 'delete', 'post');
|
||||
|
||||
// $ExpectType void
|
||||
cancan.authorize('user', 'delete', 'post');
|
||||
|
||||
// $ExpectType boolean
|
||||
cancan.can('user', 'read', 'post', {fields: ['title']});
|
||||
|
||||
// $ExpectType boolean
|
||||
cancan.cannot('user', 'delete', 'post', {fields: ['title']});
|
||||
|
||||
// $ExpectType void
|
||||
cancan.authorize('user', 'delete', 'post', {fields: ['title']});
|
||||
|
||||
const cancanWithOption = new CanCan({
|
||||
instanceOf: (_instance, _model) => true,
|
||||
createError: () => true
|
||||
});
|
||||
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
// Type definitions for cancan 3.1
|
||||
// Project: https://github.com/vadimdemedes/cancan
|
||||
// Definitions by: Vincent Pang <https://github.com/Vincent-Pang>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
declare namespace CanCan {
|
||||
interface Option {
|
||||
instanceOf?: (instance: any, model: any) => boolean;
|
||||
createError?: () => any;
|
||||
}
|
||||
}
|
||||
|
||||
declare class CanCan {
|
||||
constructor(options?: CanCan.Option);
|
||||
|
||||
allow<T>(model: any,
|
||||
actions: string | ReadonlyArray<string>,
|
||||
targets: T | ReadonlyArray<T> | string | ReadonlyArray<string>,
|
||||
condition?: object | ((performer: any, target: any, options?: any) => boolean)): void;
|
||||
|
||||
can(performer: any, action: string, target: any, options?: any): boolean;
|
||||
|
||||
cannot(performer: any, action: string, target: any, options?: any): boolean;
|
||||
|
||||
authorize(performer: any, action: string, target: any, options?: any): void;
|
||||
}
|
||||
|
||||
export = CanCan;
|
||||
@@ -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",
|
||||
"cancan-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+1
-1
@@ -364,7 +364,7 @@ declare namespace Chart {
|
||||
|
||||
interface TickOptions {
|
||||
autoSkip?: boolean;
|
||||
autoSkipPadding?: boolean;
|
||||
autoSkipPadding?: number;
|
||||
callback?(value: any, index: any, values: any): string|number;
|
||||
display?: boolean;
|
||||
fontColor?: ChartColor;
|
||||
|
||||
Vendored
+17
-152
@@ -10,7 +10,6 @@ interface ChocolateChipStatic {
|
||||
*
|
||||
* @param selector A string containing a selector expression
|
||||
* @param context A DOM HTMLElement to use as context
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
(selector: string | HTMLElement | Document, context?: HTMLElement | ChocolateChipElementArray): ChocolateChipElementArray;
|
||||
|
||||
@@ -18,7 +17,6 @@ interface ChocolateChipStatic {
|
||||
* Binds a function to be executed when the DOM has finished loading.
|
||||
*
|
||||
* @param callback A function to execute after the DOM is ready.
|
||||
* @return void
|
||||
*/
|
||||
(callback: () => any): void;
|
||||
|
||||
@@ -26,7 +24,6 @@ interface ChocolateChipStatic {
|
||||
* Accepts a string containing a CSS selector which is then used to match a set of elements.
|
||||
*
|
||||
* @param element A DOM element to wrap in an array.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
(element: HTMLElement): ChocolateChipElementArray;
|
||||
|
||||
@@ -34,7 +31,6 @@ interface ChocolateChipStatic {
|
||||
* Accepts a string containing a CSS selector which is then used to match a set of elements.
|
||||
*
|
||||
* @param elementArray An array of DOM elements to convert into a ChocolateChip Collection.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
(elementArray: ChocolateChipElementArray): ChocolateChipElementArray;
|
||||
|
||||
@@ -42,13 +38,11 @@ interface ChocolateChipStatic {
|
||||
* Accepts the document element and returns it wrapped in an array.
|
||||
*
|
||||
* @param document The document object.
|
||||
* @return document[]
|
||||
*/
|
||||
(document: Document): Document[];
|
||||
|
||||
/**
|
||||
* If no argument is provided, return the document as a ChocolateChipElementArray.
|
||||
* @return Document[]
|
||||
*/
|
||||
(): Document[];
|
||||
|
||||
@@ -94,8 +88,6 @@ interface ChocolateChipStatic {
|
||||
|
||||
/**
|
||||
* An empty function.
|
||||
*
|
||||
* @return void.
|
||||
*/
|
||||
noop(): void;
|
||||
|
||||
@@ -106,40 +98,27 @@ interface ChocolateChipStatic {
|
||||
|
||||
/**
|
||||
* Create a random number to use as a uuid.
|
||||
*
|
||||
* @return number.
|
||||
*/
|
||||
uuidNum(): number;
|
||||
|
||||
/**
|
||||
* Creates a uuid using uuidNum().
|
||||
*
|
||||
* @return A string.
|
||||
*/
|
||||
makeUuid(): string;
|
||||
|
||||
/**
|
||||
* Create a ChocolateChip collection object by creating elements from an HTML string.
|
||||
*
|
||||
* @param selector
|
||||
* @return any
|
||||
*/
|
||||
make(selector: string): ChocolateChipElementArray;
|
||||
|
||||
/**
|
||||
* Create a ChocolateChip collection object by creating elements from an HTML string. This is an alias for $.make.
|
||||
*
|
||||
* @param selector
|
||||
* @return any
|
||||
*/
|
||||
html(selector: string): ChocolateChipElementArray;
|
||||
|
||||
/**
|
||||
* Replace one element with another.
|
||||
*
|
||||
* @param new HTMLElement
|
||||
* @param old HTMLElement
|
||||
* @return HTMLElement[]
|
||||
* @return {HTMLElement[]}
|
||||
*/
|
||||
replace(newElement: ChocolateChipElementArray, oldElement: ChocolateChipElementArray): void;
|
||||
|
||||
@@ -148,7 +127,7 @@ interface ChocolateChipStatic {
|
||||
*
|
||||
* @param url A string containing the URL where the script resides.
|
||||
* @param callback A callback function that is executed after the script loads.
|
||||
* @return void
|
||||
* @return {void}
|
||||
*/
|
||||
require(url: string, callback: Function): Function;
|
||||
|
||||
@@ -157,7 +136,7 @@ interface ChocolateChipStatic {
|
||||
*
|
||||
* @param url A string containing the URL where the script resides.
|
||||
* @param callback A callback function that is executed after the script loads.
|
||||
* @return Function
|
||||
* @return {Function}
|
||||
*/
|
||||
processJSON(json: string, name?: string): any;
|
||||
|
||||
@@ -173,7 +152,6 @@ interface ChocolateChipStatic {
|
||||
* Parse the data in a Promise response as JSON.
|
||||
*
|
||||
* @param response The response from a Promise.
|
||||
* @result
|
||||
*/
|
||||
json(reponse: Response): JSON;
|
||||
|
||||
@@ -182,7 +160,6 @@ interface ChocolateChipStatic {
|
||||
*
|
||||
* @param callback A function to execute.
|
||||
* @param duration The number of milliseconds to delay execution.
|
||||
* @return any
|
||||
*/
|
||||
delay(callback: Function, duration?: number): any;
|
||||
|
||||
@@ -190,7 +167,6 @@ interface ChocolateChipStatic {
|
||||
* The method will defer the execution of its callback until the call stack is clear.
|
||||
*
|
||||
* @param callback A callback to execute after a delay.
|
||||
* @return Function.
|
||||
*/
|
||||
defer(callback: Function): Function;
|
||||
|
||||
@@ -215,16 +191,14 @@ interface ChocolateChipStatic {
|
||||
/**
|
||||
* This method will concatenate strings or values as a cleaner alternative to using the '+' operator.
|
||||
*
|
||||
* @param string or number A comma separated series of strings to concatenate.
|
||||
* @return string
|
||||
* @param {string | number} A comma separated series of strings to concatenate.
|
||||
*/
|
||||
concat(...string: string[]): string;
|
||||
|
||||
/**
|
||||
* This method takes a space-delimited string of words and returns it as an array where the individual words are indices.
|
||||
*
|
||||
* @param string Any string with values separated by spaces.
|
||||
* @return string[]
|
||||
* @param Any string with values separated by spaces.
|
||||
*/
|
||||
w(string: string): string[];
|
||||
|
||||
@@ -232,7 +206,6 @@ interface ChocolateChipStatic {
|
||||
* This method converts a string of hyphenated tokens into a camel cased string.
|
||||
*
|
||||
* @param string A string of hyphenated tokens.
|
||||
* @return string
|
||||
*/
|
||||
camelize(string: string): string;
|
||||
|
||||
@@ -240,16 +213,11 @@ interface ChocolateChipStatic {
|
||||
* This method converts a camel case string into lowercase with hyphens.
|
||||
*
|
||||
* @param string A camel case string.
|
||||
* @return string
|
||||
*/
|
||||
deCamelize(string: string): string;
|
||||
|
||||
/**
|
||||
* This method capitalizes the first letter of a string.
|
||||
*
|
||||
* @param string A string.
|
||||
* @param boolean A boolean value.
|
||||
* @return string
|
||||
*/
|
||||
capitalize(string: string, boolean?: boolean): string;
|
||||
|
||||
@@ -257,7 +225,6 @@ interface ChocolateChipStatic {
|
||||
* Determine whether the argument is a string.
|
||||
*
|
||||
* @param obj Object to test whether or not it is a string.
|
||||
* @return boolean
|
||||
*/
|
||||
isString(obj: any): boolean;
|
||||
|
||||
@@ -265,7 +232,6 @@ interface ChocolateChipStatic {
|
||||
* Determine whether the argument is an array.
|
||||
*
|
||||
* @param obj Object to test whether or not it is an array.
|
||||
* @return boolean
|
||||
*/
|
||||
isArray(obj: any): boolean;
|
||||
|
||||
@@ -273,7 +239,6 @@ interface ChocolateChipStatic {
|
||||
* Determine whether the argument is a function.
|
||||
*
|
||||
* @param obj Object to test whether or not it is an function.
|
||||
* @return boolean
|
||||
*/
|
||||
isFunction(obj: any): boolean;
|
||||
|
||||
@@ -281,7 +246,6 @@ interface ChocolateChipStatic {
|
||||
* Determine whether the argument is an object.
|
||||
*
|
||||
* @param obj Object to test whether or not it is an object.
|
||||
* @return boolean
|
||||
*/
|
||||
isObject(obj: any): boolean;
|
||||
|
||||
@@ -297,7 +261,6 @@ interface ChocolateChipStatic {
|
||||
* Determine whether the argument is an empty object.
|
||||
*
|
||||
* @param obj Object to test whether or not it is an empty object.
|
||||
* @return boolean
|
||||
*/
|
||||
isEmptyObject(obj: any): boolean;
|
||||
|
||||
@@ -305,7 +268,6 @@ interface ChocolateChipStatic {
|
||||
* Determine whether the argument is a number.
|
||||
*
|
||||
* @param obj Object to test whether or not it is a number.
|
||||
* @return boolean
|
||||
*/
|
||||
isNumber(obj: any): boolean;
|
||||
|
||||
@@ -313,7 +275,6 @@ interface ChocolateChipStatic {
|
||||
* Determine whether the argument is an integer.
|
||||
*
|
||||
* @param obj Object to test whether or not it is an integer.
|
||||
* @return boolean
|
||||
*/
|
||||
isInteger(obj: any): boolean;
|
||||
|
||||
@@ -321,7 +282,6 @@ interface ChocolateChipStatic {
|
||||
* Determine whether the argument is a float.
|
||||
*
|
||||
* @param obj Object to test whether or not it is a float.
|
||||
* @return boolean
|
||||
*/
|
||||
isFloat(obj: any): boolean;
|
||||
|
||||
@@ -443,8 +403,8 @@ interface ChocolateChipStatic {
|
||||
/**
|
||||
* Grabs values from a form and converts them into a JSON object.
|
||||
*
|
||||
* @param rootNode: string | HTMLElement A form whose values you want to convert to JSON.
|
||||
* @param delimiter string A delimiter to namespace your form values. The default is "."
|
||||
* @param rootNode: A form whose values you want to convert to JSON.
|
||||
* @param delimiter A delimiter to namespace your form values. The default is "."
|
||||
* You use the form input's name to set up the namespace structure for your JSON, e.g. name="newUser.name.first".
|
||||
*/
|
||||
form2JSON(rootNode: string | HTMLElement, delimiter: string): Object;
|
||||
@@ -453,35 +413,33 @@ interface ChocolateChipStatic {
|
||||
* Subscribe to a publication. You provide the topic you want to subscribe to, as well as a callback to execute when a publication occurs.
|
||||
* Any data passed by the publisher is exposed to the callback as its second parameter. The callback's first parameter is the published topic.
|
||||
*
|
||||
* @param topic string A topic to subscribe to. This can be a single term, or any type of namespaced term with delimiters.
|
||||
* @data any You can receive any type: string, number, array, object, etc.
|
||||
* @return any
|
||||
* @param topic A topic to subscribe to. This can be a single term, or any type of namespaced term with delimiters.
|
||||
* @param callback You can receive any type: string, number, array, object, etc.
|
||||
*/
|
||||
subscribe(topic: string, callback: (topic: string, data: any) => any): boolean;
|
||||
|
||||
/**
|
||||
* Unsubscribe from a topic. Pass this the topic you wish to unsubscribe from. The subscription will be terminated immediately.
|
||||
*
|
||||
* @param topic string The name of the topic to unsubscribe from.
|
||||
* @return void
|
||||
* @param topic The name of the topic to unsubscribe from.
|
||||
*/
|
||||
unsubscribe(topic: string): void;
|
||||
|
||||
/**
|
||||
* Publish a topic with data for the topic's subscribers to receive.
|
||||
*
|
||||
* @param topic string The topic you wish to publish.
|
||||
* @param topic The topic you wish to publish.
|
||||
* @param data The data to send with the publication. This can be of any type: string, number, array, object, etc.
|
||||
* @return void
|
||||
* @return {void}
|
||||
*/
|
||||
publish(topic: string, data: any): string;
|
||||
|
||||
/**
|
||||
* Object used to store string templates and parsed templates.
|
||||
*
|
||||
* @param string A string defining the template.
|
||||
* @param string A label used to access an object's properties in the template. If none is provided it defaults to "data": [[= data.name]].
|
||||
* @return void
|
||||
* @param {strin} A string defining the template.
|
||||
* @param {string} A label used to access an object's properties in the template. If none is provided it defaults to "data": [[= data.name]].
|
||||
* @return {void}
|
||||
*/
|
||||
templates: Object;
|
||||
|
||||
@@ -495,7 +453,6 @@ interface ChocolateChipStatic {
|
||||
*
|
||||
* @param template A string of markup to use as a template.
|
||||
* @param variable An option name to use in the template. If it were "myData": [[= myData.name]]. Otherwise it defaults to "data": [[= data.name]].
|
||||
* @return A function.
|
||||
*/
|
||||
(template: string, variable?: string): Function;
|
||||
|
||||
@@ -514,7 +471,6 @@ interface ChocolateChipStatic {
|
||||
* @param element The target container into which the content will be inserted.
|
||||
* @param template A string of markup.
|
||||
* @param data The iterable data the template will consume.
|
||||
* @return void.
|
||||
*/
|
||||
(element: ChocolateChipElementArray, template: string, data: any): void;
|
||||
}
|
||||
@@ -523,7 +479,6 @@ interface ChocolateChipStatic {
|
||||
* An object that holds the reference to the controller for a repeater.
|
||||
* This is used to cache the data that a repeater uses. After the repeater is rendered, the reference is deleted from this object.
|
||||
* Example: $.template.data["myRepeater"] = [{name: "Joe"}, {name: "Sue"}];
|
||||
*
|
||||
*/
|
||||
data: any;
|
||||
|
||||
@@ -567,16 +522,11 @@ interface ChocolateChipStatic {
|
||||
interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
/**
|
||||
* Iterate over an Array object, executing a function for each matched element.
|
||||
*
|
||||
* @param Function
|
||||
* @return void
|
||||
*/
|
||||
each(func: (ctx: any, idx: number) => void): void;
|
||||
|
||||
/**
|
||||
* Sorts an array and removes duplicates before returning it.
|
||||
*
|
||||
* @return Array
|
||||
*/
|
||||
unique(): ChocolateChipElementArray;
|
||||
|
||||
@@ -585,16 +535,13 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* When dealing with document nodes, this allows you to cherry pick a node from its collection based on its
|
||||
* position amongst its siblings.
|
||||
*
|
||||
* @param number Index value indicating the node you wish to access from a collection. This is zero-based.
|
||||
* @return HTMLElement
|
||||
* @param index Value indicating the node you wish to access from a collection. This is zero-based.
|
||||
*/
|
||||
eq(index: number): ChocolateChipElementArray;
|
||||
|
||||
/**
|
||||
* Search for a given element from among the matched elements on a collection.
|
||||
* This method returns the index value as an integer.
|
||||
*
|
||||
* @return number
|
||||
*/
|
||||
index(): number;
|
||||
|
||||
@@ -603,7 +550,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* This method returns the index value as an integer.
|
||||
*
|
||||
* @param selector A selector representing an element to look for in a collection of elements.
|
||||
* @return number
|
||||
*/
|
||||
index(selector: string | HTMLElement[]): number;
|
||||
|
||||
@@ -612,7 +558,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* if it matches the given arguments.
|
||||
*
|
||||
* @param selector A string containing a selector expression to match elements against.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
is(selector: string): ChocolateChipElementArray;
|
||||
|
||||
@@ -621,7 +566,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* if it matches the given arguments.
|
||||
*
|
||||
* @param elements One or more elements to match the current set of elements against.
|
||||
* @ return HTMLElement[]
|
||||
*/
|
||||
is(element: any): ChocolateChipElementArray;
|
||||
|
||||
@@ -630,7 +574,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* if it does not match the given arguments.
|
||||
*
|
||||
* @param selector A string containing a selector expression to match elements against.
|
||||
* @ return HTMLElement[]
|
||||
*/
|
||||
isnt(selector: string): ChocolateChipElementArray;
|
||||
|
||||
@@ -639,7 +582,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* if it does not match the given arguments.
|
||||
*
|
||||
* @param elements One or more elements to match the current set of elements against.
|
||||
* @ return HTMLElement[]
|
||||
*/
|
||||
isnt(element: any): ChocolateChipElementArray;
|
||||
|
||||
@@ -647,7 +589,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
|
||||
*
|
||||
* @param selector A string containing a selector expression to match elements against.
|
||||
* @ return HTMLElement[]
|
||||
*/
|
||||
has(selector: string): ChocolateChipElementArray;
|
||||
|
||||
@@ -655,7 +596,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Reduce the set of matched elements to those that have a descendant that matches the selector or DOM element.
|
||||
*
|
||||
* @param contained A DOM element to match elements against.
|
||||
* @ return HTMLElement[]
|
||||
*/
|
||||
has(contained: HTMLElement): ChocolateChipElementArray;
|
||||
|
||||
@@ -671,7 +611,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Reduce the set of matched elements to those that have a descendant that does not match the selector or DOM element.
|
||||
*
|
||||
* @param contained A DOM element to match elements against.
|
||||
* @ return HTMLElement[]
|
||||
*/
|
||||
hasnt(contained: HTMLElement): ChocolateChipElementArray;
|
||||
|
||||
@@ -684,7 +623,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Get the descendants of each element in the current set of matched elements, filtered by a selector or element.
|
||||
*
|
||||
* @param selector A string containing a selector expression to match elements against.
|
||||
* @ return HTMLElement[]
|
||||
*/
|
||||
find(selector: string): ChocolateChipElementArray;
|
||||
|
||||
@@ -692,21 +630,16 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Get the descendants of each element in the current set of matched elements, filtered by a selector or element.
|
||||
*
|
||||
* @param element An element to match elements against.
|
||||
* @ return HTMLElement[]
|
||||
*/
|
||||
find(element: HTMLElement): ChocolateChipElementArray;
|
||||
|
||||
/**
|
||||
* Get the immediately preceding sibling of each element in the set of matched elements.
|
||||
*
|
||||
* @ return HTMLElement[]
|
||||
*/
|
||||
prev(): ChocolateChipElementArray;
|
||||
|
||||
/**
|
||||
* Get the immediately following sibling of each element in the set of matched elements.
|
||||
*
|
||||
* @ return HTMLElement[]
|
||||
*/
|
||||
next(): ChocolateChipElementArray;
|
||||
|
||||
@@ -717,8 +650,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
|
||||
/**
|
||||
* Reduce the set of matched elements to the last in the set.
|
||||
*
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
last(): ChocolateChipElementArray;
|
||||
|
||||
@@ -726,7 +657,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Get the children of each element in the set of matched elements, optionally filtered by a selector.
|
||||
*
|
||||
* @param selector A string containing a selector expression to match elements against.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
children(selector?: string): ChocolateChipElementArray;
|
||||
|
||||
@@ -735,7 +665,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* If multiple elements have the same parent, only one instance of the parent is returned.
|
||||
*
|
||||
* @param selector A string containing a selector expression to match elements against.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
parent(selector?: string): ChocolateChipElementArray;
|
||||
|
||||
@@ -745,7 +674,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* retrieving that ancestor based on its distance from the element.
|
||||
*
|
||||
* @param selector A string containing a selector expression to match elements against.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
ancestor(selector: string | number): ChocolateChipElementArray;
|
||||
|
||||
@@ -754,7 +682,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* itself and traversing up through its ancestors in the DOM tree.
|
||||
*
|
||||
* @param selector A string containing a selector expression to match elements against.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
closest(selector: string | number): ChocolateChipElementArray;
|
||||
|
||||
@@ -762,14 +689,11 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Get the siblings of each element in the set of matched elements, optionally filtered by a selector.
|
||||
*
|
||||
* @param selector A string containing a selector expression to match elements against.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
siblings(selector?: string): ChocolateChipElementArray;
|
||||
|
||||
/**
|
||||
* Get the HTML contents of the first element in the set of matched elements.
|
||||
*
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
html(): ChocolateChipElementArray;
|
||||
|
||||
@@ -777,7 +701,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Set the HTML contents of each element in the set of matched elements.
|
||||
*
|
||||
* @param htmlString A string of HTML to set as the content of each matched element.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
html(htmlString: string): ChocolateChipElementArray;
|
||||
|
||||
@@ -785,7 +708,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Get the value of style properties for the first element in the set of matched elements.
|
||||
*
|
||||
* @param propertyName A CSS property.
|
||||
* @return string
|
||||
*/
|
||||
css(propertyName: string): string;
|
||||
|
||||
@@ -794,7 +716,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
*
|
||||
* @param propertyName A CSS property name.
|
||||
* @param value A value to set for the property.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
css(propertyName: string, value: string): ChocolateChipElementArray;
|
||||
|
||||
@@ -802,7 +723,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Set one or more CSS properties for the set of matched elements.
|
||||
*
|
||||
* @param properties An object of property-value pairs to set.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
css(properties: Object): ChocolateChipElementArray;
|
||||
|
||||
@@ -819,7 +739,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
*
|
||||
* @param attributeName A string indicating the attribute to set.
|
||||
* @param value A string indicating the value to set the attribute to.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
attr(attributeName: string, value: string): ChocolateChipElementArray;
|
||||
|
||||
@@ -827,7 +746,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Remove an attribute from a node.
|
||||
*
|
||||
* @param attributeName A string indicating the attribute to remove.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
removeAttr(attributeName: string): ChocolateChipElementArray;
|
||||
|
||||
@@ -835,7 +753,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Return any of the matched elements that have the given attribute.
|
||||
*
|
||||
* @param className The class name to search for.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
hasAttr(attributeName: string): ChocolateChipElementArray;
|
||||
|
||||
@@ -843,7 +760,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Test whether an attribute exists on the first element in the set of matched elements. The value returned is a boolean.
|
||||
*
|
||||
* @param attributeName The name of the attribute to get.
|
||||
* @return boolean
|
||||
*/
|
||||
prop(propertyName: string): boolean;
|
||||
|
||||
@@ -852,7 +768,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
*
|
||||
* @param propertyName A string indicating the property to set.
|
||||
* @param value A string indicating the value to set the property to.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
prop(propertyName: string, value: any | boolean): ChocolateChipElementArray;
|
||||
|
||||
@@ -860,7 +775,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Remove an element property.
|
||||
*
|
||||
* @param property The property to remove.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
removeProp(property: string): ChocolateChipElementArray;
|
||||
|
||||
@@ -868,7 +782,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Adds the specified class(es) to each of the set of matched elements.
|
||||
*
|
||||
* @param className One or more space-separated classes to be added to the class attribute of each matched element.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
addClass(className: string): ChocolateChipElementArray;
|
||||
|
||||
@@ -876,7 +789,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Remove a single class or multiple classes from each element in the set of matched elements.
|
||||
*
|
||||
* @param className One or more space-separated classes to be removed from the class attribute of each matched element.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
removeClass(className?: string): ChocolateChipElementArray;
|
||||
|
||||
@@ -884,7 +796,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Add or remove a classe from each element in the set of matched elements, depending on whether the class is present or not.
|
||||
*
|
||||
* @param className One or more class names (separated by spaces) to be toggled for each element in the matched set.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
toggleClass(className: string, swtch?: boolean): ChocolateChipElementArray;
|
||||
|
||||
@@ -892,7 +803,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Return any of the matched elements that have the given class.
|
||||
*
|
||||
* @param className The class name to search for.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
hasClass(className: string): ChocolateChipElementArray;
|
||||
|
||||
@@ -901,7 +811,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
*
|
||||
* @param key A string naming the piece of data to set.
|
||||
* @param value The new data value; it can be any Javascript type including Array or Object.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
data(key: string, value: any): ChocolateChipElementArray;
|
||||
|
||||
@@ -910,7 +819,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* data(name).
|
||||
*
|
||||
* @param key Name of the data stored.
|
||||
* @return any
|
||||
*/
|
||||
data(key: string): any;
|
||||
|
||||
@@ -918,7 +826,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Remove the value at the named data store for the first element in the element collection, as set by data(name, value).
|
||||
*
|
||||
* @param key Name of the data stored.
|
||||
* @return any
|
||||
*/
|
||||
removeData(key?: string): any;
|
||||
|
||||
@@ -927,7 +834,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
*
|
||||
* @param key A string naming the piece of data to set.
|
||||
* @param value The new data value; it must be a string. You can convert JSON into a string to use with this.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
dataset(key: string, value: any): ChocolateChipElementArray;
|
||||
|
||||
@@ -935,7 +841,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Retrieve a dataset key's value for the first element in the element collection.
|
||||
*
|
||||
* @param key A string naming the piece of data to set.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
dataset(key: string): ChocolateChipElementArray;
|
||||
|
||||
@@ -943,7 +848,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Return the value at the named data store for the first element in the element collection, as set by data(name, value).
|
||||
*
|
||||
* @param key Name of the data stored.
|
||||
* @return any
|
||||
*/
|
||||
data(key: string): any;
|
||||
|
||||
@@ -952,7 +856,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
*
|
||||
* @param key A string naming the piece of data to set.
|
||||
* @param value The new data value; it can be any Javascript type including Array or Object.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
data(key: string, value?: any): ChocolateChipElementArray;
|
||||
|
||||
@@ -966,21 +869,16 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
*
|
||||
* @param value A string of text or an array of strings corresponding to the value of each matched element
|
||||
* to set as selected/checked.
|
||||
* @return any
|
||||
*/
|
||||
val(value: string): ChocolateChipElementArray;
|
||||
|
||||
/**
|
||||
* Set the property of an element to enabled by removing the "disabled" attribute.
|
||||
*
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
enable(): ChocolateChipElementArray;
|
||||
|
||||
/**
|
||||
* Set the property of an element to "disabled".
|
||||
*
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
disable(): ChocolateChipElementArray;
|
||||
|
||||
@@ -989,7 +887,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
*
|
||||
* @param speed A string or number determining how long the animation will run.
|
||||
* @param callback A function to call once the animation is complete.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
show(duration?: number | string, callback?: Function): ChocolateChipElementArray;
|
||||
|
||||
@@ -998,7 +895,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
*
|
||||
* @param duration A string or number determining how long the animation will run.
|
||||
* @param callback A function to call once the animation is complete.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
hide(duration?: number | string, callback?: Function): ChocolateChipElementArray;
|
||||
|
||||
@@ -1006,7 +902,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Insert content, specified by the parameter, before each element in the set of matched elements.
|
||||
*
|
||||
* @param content HTML string, DOM element, array of elements to insert before each element in the set of matched elements.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
before(content: ChocolateChipElementArray | HTMLElement | string): ChocolateChipElementArray;
|
||||
|
||||
@@ -1014,7 +909,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Insert content, specified by the parameter, after each element in the set of matched elements.
|
||||
*
|
||||
* @param content HTML string, DOM element, array of elements to insert after each element in the set of matched elements.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
after(content: ChocolateChipElementArray | HTMLElement | string): ChocolateChipElementArray;
|
||||
|
||||
@@ -1023,7 +917,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
*
|
||||
* @param content DOM element, array of elements, or HTML string to insert at the end of each element in the set
|
||||
* of matched elements.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
append(content: ChocolateChipElementArray | HTMLElement | Text | string): ChocolateChipElementArray;
|
||||
|
||||
@@ -1031,7 +924,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Insert content, specified by the parameter, at the beginning of each element in the set of matched elements.
|
||||
*
|
||||
* @param content DOM element, array of elements, or HTML string to insert at the beginning of each element in the set of matched elements.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
prepend(content: ChocolateChipElementArray | HTMLElement | Text | string): ChocolateChipElementArray;
|
||||
|
||||
@@ -1039,7 +931,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Insert every element in the set of matched elements to the beginning of the target.
|
||||
*
|
||||
* @param target A selector, element, or HTML string. The matched set of elements will be inserted at the beginning of the element specified by this parameter.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
prependTo(target: any[] | HTMLElement | string): ChocolateChipElementArray;
|
||||
|
||||
@@ -1048,14 +939,11 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
*
|
||||
* @param target A selector, element, or HTML string. The matched set of elements will be inserted at the end of the element specified by this parameter.
|
||||
* If no position value is provided it will simply append the content to the target.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
appendTo(target: any[] | HTMLElement | string): ChocolateChipElementArray;
|
||||
|
||||
/**
|
||||
* Insert element(s) into the target element.
|
||||
*
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
insert(content: string, position?: number | string): ChocolateChipElementArray;
|
||||
|
||||
@@ -1063,7 +951,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Create a copy of the set of matched elements.
|
||||
*
|
||||
* @param value A Boolean indicating whether to copy the element(s) with their children. A true value copies the children.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
clone(value?: boolean): ChocolateChipElementArray;
|
||||
|
||||
@@ -1071,14 +958,11 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Wrap an HTML structure around each element in the set of matched elements.
|
||||
*
|
||||
* @param wrappingElement A selector or HTML string specifying the structure to wrap around the matched elements.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
wrap(wrappingElement: string): ChocolateChipElementArray;
|
||||
|
||||
/**
|
||||
* Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place.
|
||||
*
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
unwrap(): ChocolateChipElementArray;
|
||||
|
||||
@@ -1086,21 +970,17 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Remove the set of matched elements from the DOM. If there are any attached events, this will remove them to prevent memory leaks.
|
||||
*
|
||||
* @param selector A selector expression that filters the set of matched elements to be removed.
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
remove(selector?: string): ChocolateChipElementArray;
|
||||
|
||||
/**
|
||||
* Remove all child nodes of the set of matched elements from the DOM.
|
||||
*
|
||||
* @return HTMLElement[]
|
||||
*/
|
||||
empty(): ChocolateChipElementArray;
|
||||
|
||||
/**
|
||||
* Get an object of the current coordinates of the first element in the set of matched elements, relative to the document.
|
||||
* These are: top, left, bottom and right. The values are numbers representing pixel values.
|
||||
* @return Object
|
||||
*/
|
||||
offset(): {
|
||||
top: number;
|
||||
@@ -1112,23 +992,17 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
/**
|
||||
* Get the current computed width for the first element in the set of matched elements,
|
||||
* including padding but excluding borders.
|
||||
*
|
||||
* @return number
|
||||
*/
|
||||
width(): number;
|
||||
|
||||
/**
|
||||
* Get the current computed height for the first element in the set of matched elements,
|
||||
* including padding but excluding borders.
|
||||
*
|
||||
* @return number
|
||||
*/
|
||||
height(): number;
|
||||
|
||||
/**
|
||||
* Get the combined text contents of each element in the set of matched elements, including their descendants.
|
||||
*
|
||||
* @return string
|
||||
* Get the combined text contents of each element in the set of matched elements, including their descendants
|
||||
*/
|
||||
text(): string;
|
||||
|
||||
@@ -1139,7 +1013,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* The text to set as the content of each matched element.
|
||||
* When Number is supplied, it will be converted to a String representation.
|
||||
* To delete text, use ChocolateChipElementArray.empty() or ChocolateChipElementArray.remove().
|
||||
* @return HTMLElement
|
||||
*/
|
||||
text(text: string | number): HTMLElement;
|
||||
|
||||
@@ -1149,7 +1022,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* @param options And object of key value pairs define the CSS properties and values to animate.
|
||||
* @param duration A string representing the time. Should have a time identifier: "200s", "200ms", etc.
|
||||
* @param easing A string indicating the easing for the animation, such as "ease-out", "ease-in", "ease-in-out".
|
||||
* @return void
|
||||
*/
|
||||
animate(options: Object, duration?: string, easing?: string): void;
|
||||
|
||||
@@ -1159,7 +1031,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
|
||||
* @param handler A function to execute each time the event is triggered.
|
||||
* @param useCapture Setting the third argument to true will trigger event bubbling. The default is false.
|
||||
* @return ChocolateChipStatic
|
||||
*/
|
||||
bind(eventType: string, handler: (eventObject: Event) => any, useCapture?: boolean): ChocolateChipStatic;
|
||||
|
||||
@@ -1169,7 +1040,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
|
||||
* @param handler A function to execute each time the event is triggered.
|
||||
* @param useCapture Setting the third argument to true will trigger event bubbling. The default is false.
|
||||
* @return ChocolateChipStatic
|
||||
*/
|
||||
unbind(eventType?: string, handler?: (eventObject: Event) => any, useCapture?: boolean): ChocolateChipStatic;
|
||||
|
||||
@@ -1181,7 +1051,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* @param handler A function to execute each time the event is triggered. The keyword "this" will refer
|
||||
* to the element receiving the event.
|
||||
* @param useCapture Setting the third argument to true will trigger event bubbling. The default is false.
|
||||
* @return ChocolateChipStatic
|
||||
*/
|
||||
delegate(selector: any, eventType: string, handler: (eventObject: Event) => any, useCapture?: boolean): ChocolateChipStatic;
|
||||
|
||||
@@ -1192,7 +1061,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* @param eventType A string containing one or more DOM event types, such as "click" or "submit," or custom event names.
|
||||
* @param handler A function handler assigned to this event.
|
||||
* @param useCapture Setting the third argument to true will trigger event bubbling. The default is false.
|
||||
* @return ChocolateChipStatic
|
||||
*/
|
||||
undelegate(selector?: any, eventType?: string, handler?: (eventObject: Event) => any, useCapture?: boolean): ChocolateChipStatic;
|
||||
|
||||
@@ -1203,7 +1071,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* @param selector A string defining the descendant elements are listening for the event.
|
||||
* @param handler A function handler assigned to this event.
|
||||
* @param useCapture Setting the third argument to true will trigger event bubbling. The default is false.
|
||||
* @return ChocolateChipStatic
|
||||
*/
|
||||
on(eventType: string, selector: any, handler?: (eventObject: Event) => any, capturePhase?: boolean): ChocolateChipStatic;
|
||||
|
||||
@@ -1215,7 +1082,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* @param selector A string defining the descendant elements are listening for the event.
|
||||
* @param handler A function handler assigned to this event.
|
||||
* @param useCapture Setting the third argument to true will trigger event bubbling. The default is false.
|
||||
* @return ChocolateChipStatic
|
||||
*/
|
||||
off(eventType?: string, selector?: any, handler?: (eventObject: Event) => any, capturePhase?: boolean): ChocolateChipStatic;
|
||||
|
||||
@@ -1223,7 +1089,6 @@ interface ChocolateChipElementArray extends Array<HTMLElement> {
|
||||
* Trigger an event on an element.
|
||||
*
|
||||
* @param eventType The event to trigger.
|
||||
* @return void
|
||||
*/
|
||||
trigger(eventType: string): void;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
"dt-header": false,
|
||||
"no-any-union": false,
|
||||
"unified-signatures": false,
|
||||
"no-unnecessary-generics": false
|
||||
"no-unnecessary-generics": false,
|
||||
// TODO: left in redundant jsdoc that conflicts with type declarations
|
||||
// Need to go over each and decide whether the jsdoc or type is correct
|
||||
"no-redundant-jsdoc": false,
|
||||
"no-redundant-jsdoc-2": false
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+577
-207
File diff suppressed because it is too large
Load Diff
Vendored
+70
-70
@@ -12,7 +12,7 @@ declare namespace chrome.cast {
|
||||
* @enum {string}
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.AutoJoinPolicy
|
||||
*/
|
||||
interface AutoJoinPolicy {
|
||||
export interface AutoJoinPolicy {
|
||||
TAB_AND_ORIGIN_SCOPED: string;
|
||||
ORIGIN_SCOPED: string;
|
||||
PAGE_SCOPED: string;
|
||||
@@ -22,7 +22,7 @@ declare namespace chrome.cast {
|
||||
* @enum {string}
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.DefaultActionPolicy
|
||||
*/
|
||||
interface DefaultActionPolicy {
|
||||
export interface DefaultActionPolicy {
|
||||
CREATE_SESSION: string;
|
||||
CAST_THIS_TAB: string;
|
||||
}
|
||||
@@ -31,7 +31,7 @@ declare namespace chrome.cast {
|
||||
* @enum {string}
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.Capability
|
||||
*/
|
||||
interface Capability {
|
||||
export interface Capability {
|
||||
VIDEO_OUT: string;
|
||||
AUDIO_OUT: string;
|
||||
VIDEO_IN: string;
|
||||
@@ -42,7 +42,7 @@ declare namespace chrome.cast {
|
||||
* @enum {string}
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ErrorCode
|
||||
*/
|
||||
interface ErrorCode {
|
||||
export interface ErrorCode {
|
||||
CANCEL: string;
|
||||
TIMEOUT: string;
|
||||
API_NOT_INITIALIZED: string;
|
||||
@@ -59,7 +59,7 @@ declare namespace chrome.cast {
|
||||
* @enum {string}
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ReceiverAvailability
|
||||
*/
|
||||
interface ReceiverAvailability {
|
||||
export interface ReceiverAvailability {
|
||||
AVAILABLE: string;
|
||||
UNAVAILABLE: string;
|
||||
}
|
||||
@@ -68,7 +68,7 @@ declare namespace chrome.cast {
|
||||
* @enum {string}
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.SenderPlatform
|
||||
*/
|
||||
interface SenderPlatform {
|
||||
export interface SenderPlatform {
|
||||
CHROME: string;
|
||||
IOS: string;
|
||||
ANDROID: string;
|
||||
@@ -78,7 +78,7 @@ declare namespace chrome.cast {
|
||||
* @enum {string}
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ReceiverType
|
||||
*/
|
||||
interface ReceiverType {
|
||||
export interface ReceiverType {
|
||||
CAST: string;
|
||||
HANGOUT: string;
|
||||
CUSTOM: string;
|
||||
@@ -88,7 +88,7 @@ declare namespace chrome.cast {
|
||||
* @enum {string}
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.ReceiverAction
|
||||
*/
|
||||
interface ReceiverAction {
|
||||
export interface ReceiverAction {
|
||||
CAST: string;
|
||||
STOP: string;
|
||||
}
|
||||
@@ -99,7 +99,7 @@ declare namespace chrome.cast {
|
||||
* @enum {string}
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.SessionStatus
|
||||
*/
|
||||
interface SessionStatus {
|
||||
export interface SessionStatus {
|
||||
CONNECTED: string;
|
||||
DISCONNECTED: string;
|
||||
STOPPED: string;
|
||||
@@ -109,13 +109,13 @@ declare namespace chrome.cast {
|
||||
* @const {!Array<number>}
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.VERSION
|
||||
*/
|
||||
var VERSION: Array<number>;
|
||||
export var VERSION: Array<number>;
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast#.isAvailable
|
||||
*/
|
||||
var isAvailable: boolean;
|
||||
export var isAvailable: boolean;
|
||||
|
||||
/**
|
||||
* @param {!chrome.cast.ApiConfig} apiConfig
|
||||
@@ -191,7 +191,7 @@ declare namespace chrome.cast {
|
||||
errorCallback: (error: chrome.cast.Error) => void
|
||||
): void
|
||||
|
||||
interface ApiConfig {
|
||||
export interface ApiConfig {
|
||||
/**
|
||||
* @param {!chrome.cast.SessionRequest} sessionRequest
|
||||
* @param {function(!chrome.cast.Session)} sessionListener
|
||||
@@ -217,7 +217,7 @@ declare namespace chrome.cast {
|
||||
defaultActionPolicy: chrome.cast.DefaultActionPolicy;
|
||||
}
|
||||
|
||||
interface Error {
|
||||
export interface Error {
|
||||
/**
|
||||
* @param {!chrome.cast.ErrorCode} code
|
||||
* @param {string=} opt_description
|
||||
@@ -237,7 +237,7 @@ declare namespace chrome.cast {
|
||||
|
||||
}
|
||||
|
||||
interface Image {
|
||||
export interface Image {
|
||||
/**
|
||||
* @param {string} url
|
||||
* @constructor
|
||||
@@ -252,7 +252,7 @@ declare namespace chrome.cast {
|
||||
width?: number;
|
||||
}
|
||||
|
||||
interface SenderApplication {
|
||||
export interface SenderApplication {
|
||||
/**
|
||||
* @param {!chrome.cast.SenderPlatform} platform
|
||||
* @constructor
|
||||
@@ -267,7 +267,7 @@ declare namespace chrome.cast {
|
||||
packageId?: string;
|
||||
}
|
||||
|
||||
interface SessionRequest {
|
||||
export interface SessionRequest {
|
||||
/**
|
||||
* @param {string} appId
|
||||
* @param {!Array<chrome.cast.Capability>=} opt_capabilities
|
||||
@@ -287,7 +287,7 @@ declare namespace chrome.cast {
|
||||
language?: string;
|
||||
}
|
||||
|
||||
interface Session {
|
||||
export interface Session {
|
||||
/**
|
||||
* @param {string} sessionId
|
||||
* @param {string} appId
|
||||
@@ -437,7 +437,7 @@ declare namespace chrome.cast {
|
||||
):void
|
||||
}
|
||||
|
||||
interface Receiver {
|
||||
export interface Receiver {
|
||||
/**
|
||||
* @param {string} label
|
||||
* @param {string} friendlyName
|
||||
@@ -461,7 +461,7 @@ declare namespace chrome.cast {
|
||||
displayStatus: chrome.cast.ReceiverDisplayStatus;
|
||||
}
|
||||
|
||||
interface ReceiverDisplayStatus {
|
||||
export interface ReceiverDisplayStatus {
|
||||
/**
|
||||
* @param {string} statusText
|
||||
* @param {!Array<chrome.cast.Image>} appImages
|
||||
@@ -477,7 +477,7 @@ declare namespace chrome.cast {
|
||||
appImages: Array<chrome.cast.Image>;
|
||||
}
|
||||
|
||||
interface Volume {
|
||||
export interface Volume {
|
||||
/**
|
||||
* @param {?number=} opt_level
|
||||
* @param {?boolean=} opt_muted
|
||||
@@ -496,13 +496,13 @@ declare namespace chrome.cast {
|
||||
|
||||
declare namespace chrome.cast.media {
|
||||
|
||||
var DEFAULT_MEDIA_RECEIVER_APP_ID: string;
|
||||
export var DEFAULT_MEDIA_RECEIVER_APP_ID: string;
|
||||
|
||||
/**
|
||||
* @enum {string}
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MediaCommand
|
||||
*/
|
||||
interface MediaCommand {
|
||||
export interface MediaCommand {
|
||||
PAUSE: string;
|
||||
SEEK: string;
|
||||
STREAM_VOLUME: string;
|
||||
@@ -513,7 +513,7 @@ declare namespace chrome.cast.media {
|
||||
* @enum {number}
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MetadataType
|
||||
*/
|
||||
interface MetadataType {
|
||||
export interface MetadataType {
|
||||
GENERIC: number;
|
||||
TV_SHOW: number;
|
||||
MOVIE: number;
|
||||
@@ -525,7 +525,7 @@ declare namespace chrome.cast.media {
|
||||
* @enum {string}
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PlayerState
|
||||
*/
|
||||
interface PlayerState {
|
||||
export interface PlayerState {
|
||||
IDLE: string;
|
||||
PLAYING: string;
|
||||
PAUSED: string;
|
||||
@@ -536,7 +536,7 @@ declare namespace chrome.cast.media {
|
||||
* @enum {string}
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.ResumeState
|
||||
*/
|
||||
interface ResumeState {
|
||||
export interface ResumeState {
|
||||
PLAYBACK_START: string;
|
||||
PLAYBACK_PAUSE: string;
|
||||
}
|
||||
@@ -545,7 +545,7 @@ declare namespace chrome.cast.media {
|
||||
* @enum {string}
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.StreamType
|
||||
*/
|
||||
interface StreamType {
|
||||
export interface StreamType {
|
||||
BUFFERED: string;
|
||||
LIVE: string;
|
||||
OTHER: string;
|
||||
@@ -555,7 +555,7 @@ declare namespace chrome.cast.media {
|
||||
* @enum {string}
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.IdleReason
|
||||
*/
|
||||
interface IdleReason {
|
||||
export interface IdleReason {
|
||||
CANCELLED: string;
|
||||
INTERRUPTED: string;
|
||||
FINISHED: string;
|
||||
@@ -566,14 +566,14 @@ declare namespace chrome.cast.media {
|
||||
* @enum {string}
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media#.RepeatMode
|
||||
*/
|
||||
interface RepeatMode {
|
||||
export interface RepeatMode {
|
||||
OFF:string;
|
||||
ALL:string;
|
||||
SINGLE:string;
|
||||
ALL_AND_SHUFFLE:string;
|
||||
}
|
||||
|
||||
interface QueueItem {
|
||||
export interface QueueItem {
|
||||
/**
|
||||
* @param {!chrome.cast.media.MediaInfo} mediaInfo
|
||||
* @constructor
|
||||
@@ -592,7 +592,7 @@ declare namespace chrome.cast.media {
|
||||
startTime: number;
|
||||
}
|
||||
|
||||
interface QueueLoadRequest {
|
||||
export interface QueueLoadRequest {
|
||||
/**
|
||||
* @param {!Array<chrome.cast.media.QueueItem>} items
|
||||
* @constructor
|
||||
@@ -608,7 +608,7 @@ declare namespace chrome.cast.media {
|
||||
startIndex: number;
|
||||
}
|
||||
|
||||
interface QueueInsertItemsRequest {
|
||||
export interface QueueInsertItemsRequest {
|
||||
/**
|
||||
* @param {!Array<chrome.cast.media.QueueItem>}
|
||||
* @constructor
|
||||
@@ -623,7 +623,7 @@ declare namespace chrome.cast.media {
|
||||
items: Array<chrome.cast.media.QueueItem>;
|
||||
}
|
||||
|
||||
interface QueueRemoveItemsRequest {
|
||||
export interface QueueRemoveItemsRequest {
|
||||
/**
|
||||
* @param {!Array<number>}
|
||||
* @constructor
|
||||
@@ -637,7 +637,7 @@ declare namespace chrome.cast.media {
|
||||
itemIds: Array<number>;
|
||||
}
|
||||
|
||||
interface QueueReorderItemsRequest {
|
||||
export interface QueueReorderItemsRequest {
|
||||
/**
|
||||
* @param {!Array<number>}
|
||||
* @constructor
|
||||
@@ -652,7 +652,7 @@ declare namespace chrome.cast.media {
|
||||
itemIds: Array<number>;
|
||||
}
|
||||
|
||||
interface QueueUpdateItemsRequest {
|
||||
export interface QueueUpdateItemsRequest {
|
||||
/**
|
||||
* @param {!Array<chrome.cast.media.QueueItem>}
|
||||
* @constructor
|
||||
@@ -670,7 +670,7 @@ declare namespace chrome.cast.media {
|
||||
* @enum {string}
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TrackType
|
||||
*/
|
||||
interface TrackType {
|
||||
export interface TrackType {
|
||||
TEXT: string;
|
||||
AUDIO: string;
|
||||
VIDEO: string;
|
||||
@@ -680,7 +680,7 @@ declare namespace chrome.cast.media {
|
||||
* @enum {string}
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackType
|
||||
*/
|
||||
interface TextTrackType {
|
||||
export interface TextTrackType {
|
||||
SUBTITLES: string;
|
||||
CAPTIONS: string;
|
||||
DESCRIPTIONS: string;
|
||||
@@ -692,7 +692,7 @@ declare namespace chrome.cast.media {
|
||||
* @enum {string}
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackEdgeType
|
||||
*/
|
||||
interface TextTrackEdgeType {
|
||||
export interface TextTrackEdgeType {
|
||||
NONE: string;
|
||||
OUTLINE: string;
|
||||
DROP_SHADOW: string;
|
||||
@@ -704,7 +704,7 @@ declare namespace chrome.cast.media {
|
||||
* @enum {string}
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackWindowType
|
||||
*/
|
||||
interface TextTrackWindowType {
|
||||
export interface TextTrackWindowType {
|
||||
NONE: string;
|
||||
NORMAL: string;
|
||||
ROUNDED_CORNERS: string;
|
||||
@@ -714,7 +714,7 @@ declare namespace chrome.cast.media {
|
||||
* @enum {string}
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackFontGenericFamily
|
||||
*/
|
||||
interface TextTrackFontGenericFamily {
|
||||
export interface TextTrackFontGenericFamily {
|
||||
SANS_SERIF: string;
|
||||
MONOSPACED_SANS_SERIF: string;
|
||||
SERIF: string;
|
||||
@@ -728,14 +728,14 @@ declare namespace chrome.cast.media {
|
||||
* @enum {string}
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackFontStyle
|
||||
*/
|
||||
interface TextTrackFontStyle {
|
||||
export interface TextTrackFontStyle {
|
||||
NORMAL: string;
|
||||
BOLD: string;
|
||||
BOLD_ITALIC: string;
|
||||
ITALIC: string;
|
||||
}
|
||||
|
||||
interface GetStatusRequest {
|
||||
export interface GetStatusRequest {
|
||||
/**
|
||||
* @constructor
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.GetStatusRequest
|
||||
@@ -745,7 +745,7 @@ declare namespace chrome.cast.media {
|
||||
customData: Object;
|
||||
}
|
||||
|
||||
interface PauseRequest {
|
||||
export interface PauseRequest {
|
||||
/**
|
||||
* @constructor
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PauseRequest
|
||||
@@ -755,7 +755,7 @@ declare namespace chrome.cast.media {
|
||||
customData: Object;
|
||||
}
|
||||
|
||||
interface PlayRequest {
|
||||
export interface PlayRequest {
|
||||
/**
|
||||
* @constructor
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PlayRequest
|
||||
@@ -765,7 +765,7 @@ declare namespace chrome.cast.media {
|
||||
customData: Object;
|
||||
}
|
||||
|
||||
interface SeekRequest {
|
||||
export interface SeekRequest {
|
||||
/**
|
||||
* @constructor
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.SeekRequest
|
||||
@@ -777,7 +777,7 @@ declare namespace chrome.cast.media {
|
||||
customData: Object;
|
||||
}
|
||||
|
||||
interface StopRequest {
|
||||
export interface StopRequest {
|
||||
/**
|
||||
* @constructor
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.StopRequest
|
||||
@@ -787,7 +787,7 @@ declare namespace chrome.cast.media {
|
||||
customData: Object;
|
||||
}
|
||||
|
||||
interface VolumeRequest {
|
||||
export interface VolumeRequest {
|
||||
/**
|
||||
* @param {!chrome.cast.Volume} volume
|
||||
* @constructor
|
||||
@@ -801,7 +801,7 @@ declare namespace chrome.cast.media {
|
||||
customData: Object;
|
||||
}
|
||||
|
||||
interface LoadRequest {
|
||||
export interface LoadRequest {
|
||||
/**
|
||||
* @param {!chrome.cast.media.MediaInfo} mediaInfo
|
||||
* @constructor
|
||||
@@ -818,7 +818,7 @@ declare namespace chrome.cast.media {
|
||||
media: chrome.cast.media.MediaInfo;
|
||||
}
|
||||
|
||||
interface EditTracksInfoRequest {
|
||||
export interface EditTracksInfoRequest {
|
||||
/**
|
||||
* @param {Array<number>=} opt_activeTrackIds
|
||||
* @param {chrome.cast.media.TextTrackStyle=} opt_textTrackStyle
|
||||
@@ -834,7 +834,7 @@ declare namespace chrome.cast.media {
|
||||
textTrackStyle: chrome.cast.media.TextTrackStyle;
|
||||
}
|
||||
|
||||
interface GenericMediaMetadata {
|
||||
export interface GenericMediaMetadata {
|
||||
/**
|
||||
* @constructor
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.GenericMediaMetadata
|
||||
@@ -852,7 +852,7 @@ declare namespace chrome.cast.media {
|
||||
type: chrome.cast.media.MetadataType;
|
||||
}
|
||||
|
||||
interface MovieMediaMetadata {
|
||||
export interface MovieMediaMetadata {
|
||||
/**
|
||||
* @constructor
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MovieMediaMetadata
|
||||
@@ -871,7 +871,7 @@ declare namespace chrome.cast.media {
|
||||
type: chrome.cast.media.MetadataType;
|
||||
}
|
||||
|
||||
interface TvShowMediaMetadata {
|
||||
export interface TvShowMediaMetadata {
|
||||
/**
|
||||
* @constructor
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TvShowMediaMetadata
|
||||
@@ -898,7 +898,7 @@ declare namespace chrome.cast.media {
|
||||
releaseYear: number;
|
||||
}
|
||||
|
||||
interface MusicTrackMediaMetadata {
|
||||
export interface MusicTrackMediaMetadata {
|
||||
/**
|
||||
* @constructor
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.MusicTrackMediaMetadata
|
||||
@@ -925,7 +925,7 @@ declare namespace chrome.cast.media {
|
||||
releaseYear: number;
|
||||
}
|
||||
|
||||
interface PhotoMediaMetadata {
|
||||
export interface PhotoMediaMetadata {
|
||||
/**
|
||||
* @constructor
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.PhotoMediaMetadata
|
||||
@@ -947,7 +947,7 @@ declare namespace chrome.cast.media {
|
||||
type: chrome.cast.media.MetadataType;
|
||||
}
|
||||
|
||||
interface MediaInfo {
|
||||
export interface MediaInfo {
|
||||
/**
|
||||
* @param {string} contentId
|
||||
* @param {string} contentType
|
||||
@@ -969,7 +969,7 @@ declare namespace chrome.cast.media {
|
||||
customData: Object;
|
||||
}
|
||||
|
||||
interface Media {
|
||||
export interface Media {
|
||||
/**
|
||||
* @param {string} sessionId
|
||||
* @param {number} mediaSessionId
|
||||
@@ -1215,7 +1215,7 @@ declare namespace chrome.cast.media {
|
||||
|
||||
}
|
||||
|
||||
interface Track {
|
||||
export interface Track {
|
||||
/**
|
||||
* @param {number} trackId
|
||||
* @param {!chrome.cast.media.TrackType} trackType
|
||||
@@ -1237,7 +1237,7 @@ declare namespace chrome.cast.media {
|
||||
customData: Object;
|
||||
}
|
||||
|
||||
interface TextTrackStyle {
|
||||
export interface TextTrackStyle {
|
||||
/**
|
||||
* @constructor
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.TextTrackStyle
|
||||
@@ -1264,17 +1264,17 @@ declare namespace chrome.cast.media {
|
||||
* @see https://developers.google.com/cast/docs/reference/chrome/chrome.cast.media.timeout
|
||||
*/
|
||||
declare namespace chrome.cast.media.timeout {
|
||||
var load: number;
|
||||
var getStatus: number;
|
||||
var play: number;
|
||||
var pause: number;
|
||||
var seek: number;
|
||||
var stop: number;
|
||||
var setVolume: number;
|
||||
var editTracksInfo: number;
|
||||
var queueInsert: number;
|
||||
var queueLoad: number;
|
||||
var queueRemove: number;
|
||||
var queueReorder: number;
|
||||
var queueUpdate: number;
|
||||
export var load: number;
|
||||
export var getStatus: number;
|
||||
export var play: number;
|
||||
export var pause: number;
|
||||
export var seek: number;
|
||||
export var stop: number;
|
||||
export var setVolume: number;
|
||||
export var editTracksInfo: number;
|
||||
export var queueInsert: number;
|
||||
export var queueLoad: number;
|
||||
export var queueRemove: number;
|
||||
export var queueReorder: number;
|
||||
export var queueUpdate: number;
|
||||
}
|
||||
|
||||
Vendored
+109
@@ -0,0 +1,109 @@
|
||||
/// <reference path="chrome-app.d.ts" />
|
||||
|
||||
// Project: http://developer.chrome.com/apps/
|
||||
// Definitions by: Nikolai Ommundsen <https://github.com/niikoo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
//
|
||||
// WebView ref: https://chromium.googlesource.com/chromium/src/+/64.0.3274.2/chrome/common/extensions/api/webview_tag.json
|
||||
//
|
||||
|
||||
|
||||
///////////////////
|
||||
// <webview> Tag
|
||||
///////////////////
|
||||
/**
|
||||
* Use the <code>webview</code> tag to actively load live content from the web over the network and embed it in your Chrome App. Your app can control the appearance of the <code>webview</code> and interact with the web content, initiate navigations in an embedded web page, react to error events that happen within it, and more (see <a href=\"#usage\">Usage</a>).
|
||||
*/
|
||||
declare namespace chrome.webviewTag {
|
||||
/** Options that determine what data should be cleared by `clearData`. */
|
||||
export interface ClearDataOptions {
|
||||
/** Clear data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the getTime method of the JavaScript <code>Date</code> object). If absent, defaults to <code>0</code> (which would remove all browsing data). */
|
||||
since: number;
|
||||
}
|
||||
export interface WindowEvent extends chrome.events.Event<() => void> {}
|
||||
|
||||
export interface ConsoleEvent extends Event {
|
||||
/**
|
||||
* @description The severity level of the log message. Ranges from 0 to 4.
|
||||
* @type {number}
|
||||
* @memberof ConsoleEvent
|
||||
*/
|
||||
level: number,
|
||||
/**
|
||||
* @description The logged message contents.
|
||||
* @type {string}
|
||||
* @memberof ConsoleEvent
|
||||
*/
|
||||
message: string,
|
||||
/**
|
||||
* @description The line number of the message source.
|
||||
* @type {number}
|
||||
* @memberof ConsoleEvent
|
||||
*/
|
||||
line: number,
|
||||
/**
|
||||
* @description A string identifying the resource which logged the message.
|
||||
* @type {string}
|
||||
* @memberof ConsoleEvent
|
||||
*/
|
||||
sourceId: string
|
||||
}
|
||||
|
||||
/** Description of a declarative rule for handling events. */
|
||||
export interface Rule {
|
||||
/** Optional priority of this rule. Defaults to 100. */
|
||||
priority?: number;
|
||||
/** List of conditions that can trigger the actions. */
|
||||
conditions: any[];
|
||||
/** Optional. Optional identifier that allows referencing this rule. */
|
||||
id?: string;
|
||||
/** List of actions that are triggered if one of the condtions is fulfilled. */
|
||||
actions: any[];
|
||||
/**
|
||||
* @description Tags can be used to annotate rules and perform operations on sets of rules.¨
|
||||
* @since Chrome 28
|
||||
* @type {string[]}
|
||||
* @memberof Rule
|
||||
*/
|
||||
tags?: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.
|
||||
* @export
|
||||
* @interface InjectDetails
|
||||
*/
|
||||
export interface InjectDetails {
|
||||
/**
|
||||
* @description JavaScript or CSS code to inject.<br><br><b>Warning:</b><br>Be careful using the <code>code</code> parameter. Incorrect use of it may open your app to <a href=\"https://en.wikipedia.org/wiki/Cross-site_scripting\">cross site scripting</a> attacks.
|
||||
* @type {string}
|
||||
* @memberof InjectDetails
|
||||
*/
|
||||
code?: string,
|
||||
/**
|
||||
* @description JavaScript or CSS file to inject.
|
||||
* @type {string}
|
||||
* @memberof InjectDetails
|
||||
*/
|
||||
file?: string
|
||||
}
|
||||
|
||||
export interface WebViewElementEventMap extends ElementEventMap {
|
||||
'message': ConsoleEvent
|
||||
}
|
||||
|
||||
/**
|
||||
* @description
|
||||
* @export
|
||||
* @interface HTMLWebViewElement
|
||||
* @extends {Element}
|
||||
*/
|
||||
export interface HTMLWebViewElement extends Element {
|
||||
executeScript?: (details: InjectDetails, callback?: (result: any) => void) => void,
|
||||
src: string,
|
||||
contentWindow: Window
|
||||
addEventListener<K extends keyof WebViewElementEventMap>(type: K, listener: (this: HTMLWebViewElement, ev: WebViewElementEventMap[K]) => any, useCapture?: boolean): void;
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
|
||||
}
|
||||
}
|
||||
Vendored
+647
-627
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,4 @@
|
||||
import webview = chrome.webviewTag;
|
||||
|
||||
let element: webview.HTMLWebViewElement;
|
||||
|
||||
@@ -21,7 +21,9 @@
|
||||
"index.d.ts",
|
||||
"chrome-app.d.ts",
|
||||
"chrome-cast.d.ts",
|
||||
"chrome-webview.d.ts",
|
||||
"test/index.ts",
|
||||
"test/chrome-app.ts"
|
||||
"test/chrome-app.ts",
|
||||
"test/chrome-webview.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import clamp, { ClampOptions, ClampResponse } from 'clamp-js-main';
|
||||
|
||||
const element: HTMLElement = document.createElement('div');
|
||||
element.style.setProperty('width', '5px');
|
||||
element.style.setProperty('height', '5px');
|
||||
element.style.setProperty('font-size', '12px');
|
||||
|
||||
const span: HTMLSpanElement = document.createElement('span');
|
||||
span.textContent = "Lorem ipsum. Lorem ipsum";
|
||||
element.appendChild(span);
|
||||
|
||||
const simpleClamp: ClampResponse = clamp(element);
|
||||
|
||||
const options: ClampOptions = {
|
||||
clamp: 2,
|
||||
useNativeClamp: false,
|
||||
splitOnChars: ['.'],
|
||||
animate: true,
|
||||
truncationChar: '--',
|
||||
truncationHTML: '<span></span>'
|
||||
};
|
||||
const clampWithOptions: ClampResponse = clamp(element, options);
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
// Type definitions for clamp-js-main 0.11
|
||||
// Project: https://github.com/jmenglis/clamp-js-main#readme
|
||||
// Definitions by: Sinziana Nicolae <https://github.com/sinziananicolae>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface ClampOptions {
|
||||
clamp?: number|string;
|
||||
useNativeClamp?: boolean;
|
||||
splitOnChars?: string[];
|
||||
animate?: boolean;
|
||||
truncationChar?: string;
|
||||
truncationHTML?: string | null;
|
||||
}
|
||||
|
||||
export interface ClampResponse {
|
||||
original: string;
|
||||
clamped: string;
|
||||
}
|
||||
|
||||
export default function clamp(element: HTMLElement, options?: ClampOptions): ClampResponse;
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"clamp-js-main-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -1,12 +1,12 @@
|
||||
import convert = require("convert-source-map");
|
||||
|
||||
// tslint:disable:max-line-length
|
||||
|
||||
const json = convert
|
||||
// tslint:disable-next-line max-line-length
|
||||
.fromComment('//@ sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9vLmpzIiwic291cmNlcyI6WyJjb25zb2xlLmxvZyhcImhpXCIpOyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=')
|
||||
.toJSON();
|
||||
|
||||
const modified = convert
|
||||
// tslint:disable-next-line max-line-length
|
||||
.fromComment('//@ sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9vLmpzIiwic291cmNlcyI6WyJjb25zb2xlLmxvZyhcImhpXCIpOyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=')
|
||||
.setProperty('sources', ['CONSOLE.LOG("HI");'])
|
||||
.toJSON();
|
||||
|
||||
+10
-2
@@ -39,7 +39,7 @@ interface InAppBrowser extends Window {
|
||||
* @param callback the function that executes when the event fires. The function is
|
||||
* passed an InAppBrowserEvent object as a parameter.
|
||||
*/
|
||||
addEventListener(type: channel, callback: (event: InAppBrowserEvent) => void): void;
|
||||
addEventListener(type: channel, callback: InAppBrowserEventListenerOrEventListenerObject): void;
|
||||
// removeEventListener overloads
|
||||
/**
|
||||
* Removes a listener for an event from the InAppBrowser.
|
||||
@@ -51,7 +51,7 @@ interface InAppBrowser extends Window {
|
||||
* @param callback the function that executes when the event fires. The function is
|
||||
* passed an InAppBrowserEvent object as a parameter.
|
||||
*/
|
||||
removeEventListener(type: channel, callback: (event: InAppBrowserEvent) => void): void;
|
||||
removeEventListener(type: channel, callback: InAppBrowserEventListenerOrEventListenerObject): void;
|
||||
/** Closes the InAppBrowser window. */
|
||||
close(): void;
|
||||
/** Hides the InAppBrowser window. Calling this has no effect if the InAppBrowser was already hidden. */
|
||||
@@ -79,6 +79,14 @@ interface InAppBrowser extends Window {
|
||||
insertCSS(css: { code: string } | { file: string }, callback: () => void): void;
|
||||
}
|
||||
|
||||
type InAppBrowserEventListenerOrEventListenerObject = InAppBrowserEventListener | InAppBrowserEventListenerObject;
|
||||
|
||||
type InAppBrowserEventListener = (evt: InAppBrowserEvent) => void;
|
||||
|
||||
interface InAppBrowserEventListenerObject {
|
||||
handleEvent(evt: InAppBrowserEvent): void;
|
||||
}
|
||||
|
||||
interface InAppBrowserEvent extends Event {
|
||||
/** the eventname, either loadstart, loadstop, loaderror, or exit. */
|
||||
type: string;
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": false,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": false,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
|
||||
@@ -10,7 +10,8 @@ cy
|
||||
.get('#querying')
|
||||
.contains('ul', 'oranges').should('have.class', 'query-list')
|
||||
.get('.query-button')
|
||||
.contains('Save Form').should('have.class', 'btn');
|
||||
.contains('Save Form').should('have.class', 'btn')
|
||||
.trigger('mousemove', {clientX: 100, clientY: 200});
|
||||
|
||||
cy.location('host');
|
||||
|
||||
@@ -39,3 +40,5 @@ cy
|
||||
.spread((x , y, z) => {
|
||||
x + y + z;
|
||||
});
|
||||
|
||||
cy.log('end');
|
||||
|
||||
Vendored
+2
-1
@@ -255,7 +255,7 @@ declare namespace Cypress {
|
||||
/**
|
||||
* @see https://on.cypress.io/api/log
|
||||
*/
|
||||
log(message: string, args: any): Chainable;
|
||||
log(message: string, args?: any): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/next
|
||||
@@ -382,6 +382,7 @@ declare namespace Cypress {
|
||||
* @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
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// tslint:disable:object-literal-shorthand
|
||||
/**
|
||||
* Typescript definition tests for d3/d3-selection-multi module
|
||||
*
|
||||
@@ -28,7 +27,7 @@ selection = selection.attrs({
|
||||
foo: () => 1,
|
||||
bar: (d) => d,
|
||||
baz: (d, i) => i !== 0,
|
||||
bat: function() {
|
||||
bat() {
|
||||
return this.href;
|
||||
},
|
||||
});
|
||||
|
||||
Vendored
+1
-1
@@ -642,7 +642,7 @@ declare namespace decimal {
|
||||
*
|
||||
* 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): string[];
|
||||
toFraction(max_denominator?: number | string | Decimal): Decimal[];
|
||||
|
||||
toJSON(): string;
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
Vendored
-1
@@ -17,7 +17,6 @@
|
||||
* applicable laws.
|
||||
*/
|
||||
declare namespace ej {
|
||||
/* tslint:disable:no-empty-interface */
|
||||
const dataUtil: dataUtil;
|
||||
function isMobile(): boolean;
|
||||
function isIOS(): boolean;
|
||||
|
||||
@@ -12,6 +12,31 @@
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"no-unnecessary-qualifier": false,
|
||||
"strict-export-declare-modifiers": false
|
||||
|
||||
"strict-export-declare-modifiers": false,
|
||||
"whitespace": false,
|
||||
"prefer-conditional-expression": false,
|
||||
"no-var-keyword": false,
|
||||
"object-literal-shorthand": false,
|
||||
"space-before-function-paren": false,
|
||||
"no-namespace": false,
|
||||
"no-internal-module": false,
|
||||
"only-arrow-functions": false,
|
||||
"no-empty-interface": false,
|
||||
"prefer-const": false,
|
||||
"max-line-length": false,
|
||||
"array-type": false,
|
||||
"ban-types": false,
|
||||
"semicolon": false,
|
||||
"object-literal-key-quotes": false,
|
||||
"one-variable-per-declaration": false,
|
||||
"triple-equals": false,
|
||||
"typedef-whitespace": false,
|
||||
"prefer-template": false,
|
||||
"no-duplicate-variable": false,
|
||||
"radix": false,
|
||||
"prefer-for-of": false,
|
||||
"one-line": false,
|
||||
"no-unnecessary-type-assertion": false
|
||||
}
|
||||
}
|
||||
|
||||
+60
-2
@@ -1,3 +1,61 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
import ejs = require("ejs");
|
||||
var people = ['geddy', 'neil', 'alex'];
|
||||
var html = ejs.render('<%= people.join(", "); %>', { people: people });
|
||||
import { readFileSync as read } from 'fs';
|
||||
import LRU = require("lru-cache");
|
||||
import { TemplateFunction, Options } from "ejs";
|
||||
|
||||
const fileName = 'test.ejs';
|
||||
const people = ['geddy', 'neil', 'alex'];
|
||||
const data = { people };
|
||||
const template = '<%= people.join(", "); %>';
|
||||
const options = { filename: fileName };
|
||||
let result: string;
|
||||
let ejsFunction: TemplateFunction;
|
||||
|
||||
const SimpleCallback = (err: any, html?: string) => {
|
||||
if (err) {
|
||||
return null;
|
||||
}
|
||||
return html;
|
||||
};
|
||||
|
||||
result = ejs.render(template);
|
||||
result = ejs.render(template, data);
|
||||
result = ejs.render(template, data, options);
|
||||
|
||||
result = ejs.renderFile(fileName, SimpleCallback);
|
||||
result = ejs.renderFile(fileName, data, SimpleCallback);
|
||||
result = ejs.renderFile(fileName, data, options, SimpleCallback);
|
||||
|
||||
ejsFunction = ejs.compile('');
|
||||
ejsFunction = ejs.compile(read(fileName, "utf8"));
|
||||
ejsFunction = ejs.compile(template);
|
||||
ejsFunction = ejs.compile(template, options);
|
||||
ejsFunction = ejs.compile(template, { cache: true, filename: fileName });
|
||||
ejsFunction = ejs.compile(template, { cache: true, filename: fileName, root: "./" });
|
||||
ejsFunction = ejs.compile(template, { context: { foo: 'FOO' } });
|
||||
ejsFunction = ejs.compile(template, { compileDebug: false });
|
||||
ejsFunction = ejs.compile(template, { client: true });
|
||||
ejsFunction = ejs.compile('<$= people.join(", "); $>', { delimiter: '$' });
|
||||
ejsFunction = ejs.compile('<%= locals.people.join(", "); %>', { _with: false });
|
||||
ejsFunction = ejs.compile('<%= locals.people.join(", "); %>', { strict: true });
|
||||
ejsFunction = ejs.compile('<%= it.people.join(", "); %>', { _with: false, localsName: "it" });
|
||||
ejsFunction = ejs.compile(template, { rmWhitespace: true });
|
||||
const customEscape = (str: string) => !str ? '' : str.toUpperCase();
|
||||
ejsFunction = ejs.compile(template, { escape: customEscape });
|
||||
|
||||
result = ejsFunction();
|
||||
result = ejsFunction({});
|
||||
result = ejsFunction(data);
|
||||
|
||||
/** @see https://github.com/mde/ejs/tree/v2.5.7#custom-fileloader */
|
||||
ejs.fileLoader = (path: string) => "";
|
||||
|
||||
/** @see https://github.com/mde/ejs/tree/v2.5.7#caching */
|
||||
ejs.clearCache();
|
||||
ejs.cache = LRU(100);
|
||||
|
||||
/** @see https://github.com/mde/ejs/tree/v2.5.7#custom-delimiters */
|
||||
ejs.delimiter = "%";
|
||||
delete ejs.delimiter;
|
||||
|
||||
Vendored
+115
-81
@@ -1,90 +1,124 @@
|
||||
// Type definitions for ejs.js v2.3.3
|
||||
// Type definitions for ejs.js 2.5
|
||||
// Project: http://ejs.co/
|
||||
// Definitions by: Ben Liddicott <https://github.com/benliddicott/DefinitelyTyped>
|
||||
// Definitions by: Ben Liddicott <https://github.com/benliddicott>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
declare namespace Ejs {
|
||||
type Data = { [name: string]: any };
|
||||
type Dependencies = string[];
|
||||
var cache: Cache;
|
||||
var localsName: string;
|
||||
function resolveInclude(name: string, filename: string): string;
|
||||
function compile(template: string, opts?: Options): (TemplateFunction);
|
||||
function render(template: string, data?: Data, opts?: Options): string;
|
||||
export interface Data {
|
||||
[name: string]: any;
|
||||
}
|
||||
/**
|
||||
* EJS template function cache. This can be a LRU object from lru-cache NPM
|
||||
* module. By default, it is {@link module:utils.cache}, a simple in-process
|
||||
* cache that grows continuously.
|
||||
*/
|
||||
export let cache: Cache;
|
||||
/**
|
||||
* Name of the object containing the locals.
|
||||
*
|
||||
* This variable is overridden by {@link Options}`.localsName` if it is not
|
||||
* `undefined`.
|
||||
*/
|
||||
export let localsName: string;
|
||||
/**
|
||||
* Get the path to the included file from the parent file path and the
|
||||
* specified path.
|
||||
*/
|
||||
export function resolveInclude(name: string, filename: string, isDir: boolean): string;
|
||||
/**
|
||||
* Compile the given `str` of ejs into a template function.
|
||||
*/
|
||||
export function compile(template: string, opts?: Options): (TemplateFunction);
|
||||
/**
|
||||
* Render the given `template` of ejs.
|
||||
*
|
||||
* If you would like to include options but not data, you need to explicitly
|
||||
* call this function with `data` being an empty object or `null`.
|
||||
*/
|
||||
export function render(template: string, data?: Data, opts?: Options): string;
|
||||
|
||||
type RenderFileCallback<T> = (err: Error, str?: string) => T;
|
||||
function renderFile<T>(path: string, cb: RenderFileCallback<T>): T;
|
||||
function renderFile<T>(path: string, data: Data, cb: RenderFileCallback<T>): T;
|
||||
function renderFile<T>(path: string, data: Data, opts: Options, cb: RenderFileCallback<T>): T;
|
||||
export type RenderFileCallback<T> = (err: Error, str?: string) => T;
|
||||
|
||||
function clearCache(): any;
|
||||
/**
|
||||
* Render an EJS file at the given `path` and callback `cb(err, str)`.
|
||||
*
|
||||
* If you would like to include options but not data, you need to explicitly
|
||||
* call this function with `data` being an empty object or `null`.
|
||||
*/
|
||||
export function renderFile<T>(path: string, cb: RenderFileCallback<T>): T;
|
||||
export function renderFile<T>(path: string, data: Data, cb: RenderFileCallback<T>): T;
|
||||
export function renderFile<T>(path: string, data: Data, opts: Options, cb: RenderFileCallback<T>): T;
|
||||
|
||||
interface TemplateFunction {
|
||||
(data: Data): any;
|
||||
}
|
||||
interface Options {
|
||||
cache?: any;
|
||||
filename?: string;
|
||||
context?: any;
|
||||
compileDebug?: boolean;
|
||||
client?: boolean;
|
||||
delimiter?: string;
|
||||
debug?: any;
|
||||
_with?: boolean;
|
||||
}
|
||||
class Template {
|
||||
constructor(text: string, opts: Options);
|
||||
opts: Options;
|
||||
templateText: string;
|
||||
mode: string;
|
||||
truncate: boolean;
|
||||
currentLine: number;
|
||||
source: string;
|
||||
dependencies: Dependencies;
|
||||
createRegex(): RegExp;
|
||||
compile(): TemplateFunction;
|
||||
generateSource(): any;
|
||||
parseTemplateText(): string[];
|
||||
scanLine(line: string): any;
|
||||
/**
|
||||
* Clear intermediate JavaScript cache. Calls {@link Cache#reset}.
|
||||
*/
|
||||
export function clearCache(): void;
|
||||
|
||||
}
|
||||
namespace Template {
|
||||
interface MODES {
|
||||
EVAL: string;
|
||||
ESCAPED: string;
|
||||
RAW: string;
|
||||
COMMENT: string;
|
||||
LITERAL: string;
|
||||
}
|
||||
}
|
||||
function escapeRegexChars(s: string): string;
|
||||
function escapeXML(markup: string): string;
|
||||
function shallowCopy<T1>(to: T1, fro: any): T1;
|
||||
interface Cache {
|
||||
_data: { [name: string]: any };
|
||||
set(key: string, val: any): any;
|
||||
get(key: string): any;
|
||||
}
|
||||
function resolve(from1: string, to: string): string;
|
||||
function resolve(from1: string, from2: string, to: string): string;
|
||||
function resolve(from1: string, from2: string, from3: string, to: string): string;
|
||||
function resolve(from1: string, from2: string, from3: string, from4: string, to: string): string;
|
||||
function resolve(from1: string, from2: string, from3: string, from4: string, from5: string, to: string): string;
|
||||
function resolve(from1: string, from2: string, from3: string, from4: string, from5: string, from6: string, to: string): string;
|
||||
function resolve(from1: string, from2: string, from3: string, from4: string, from5: string, from6: string, from7: string, to: string): string;
|
||||
function resolve(from1: string, from2: string, from3: string, from4: string, from5: string, from6: string, from7: string, from8: string, to: string): string;
|
||||
function resolve(from1: string, from2: string, from3: string, from4: string, from5: string, from6: string, from7: string, from8: string, from9: string, to: string): string;
|
||||
function resolve(...args: string[]): string;
|
||||
function normalize(path: string): string;
|
||||
function isAbsolute(path: string): boolean;
|
||||
function join(...args: string[]): string;
|
||||
function relative(from: string, to: string): string;
|
||||
var sep: string;
|
||||
var delimiter: string;
|
||||
function dirname(path: string): string;
|
||||
function basename(path: string): string;
|
||||
function extname(path: string): string;
|
||||
function filter(xs: any, f: any): any; // TODO WHUT?
|
||||
export type TemplateFunction = (data?: Data) => string;
|
||||
export interface Options {
|
||||
/** Compiled functions are cached, requires `filename` */
|
||||
cache?: boolean;
|
||||
/**
|
||||
* The name of the file being rendered. Not required if you are using `renderFile()`.
|
||||
* Used by `cache` to key caches, and for includes.
|
||||
*/
|
||||
filename?: string;
|
||||
/** Set project root for includes with an absolute path (/file.ejs). */
|
||||
root?: string;
|
||||
/** Function execution context */
|
||||
context?: any;
|
||||
/** When `false` no debug instrumentation is compiled */
|
||||
compileDebug?: boolean;
|
||||
/** When `true`, compiles a function that can be rendered in the browser without needing to load the EJS Runtime (ejs.min.js). */
|
||||
client?: boolean;
|
||||
/** Character to use with angle brackets for open/close */
|
||||
delimiter?: string;
|
||||
/** Output generated function body */
|
||||
debug?: boolean;
|
||||
/** When set to `true`, generated function is in strict mode */
|
||||
strict?: boolean;
|
||||
/**
|
||||
* Whether or not to use `with() {}` constructs.
|
||||
* If `false` then the locals will be stored in the `locals` object. Set to `false` in strict mode.
|
||||
*/
|
||||
_with?: boolean;
|
||||
/** Name to use for the object storing local variables when not using `with` Defaults to `locals` */
|
||||
localsName?: string;
|
||||
/**
|
||||
* Remove all safe-to-remove whitespace, including leading and trailing whitespace.
|
||||
* It also enables a safer version of `-%>` line slurping for all scriptlet tags (it does not strip new lines of tags in the middle of a line).
|
||||
*/
|
||||
rmWhitespace?: boolean;
|
||||
/**
|
||||
* The escaping function used with `<%=` construct.
|
||||
* It is used in rendering and is `.toString()`ed in the generation of client functions.
|
||||
* (By default escapes XML).
|
||||
*/
|
||||
escape?(str: string): string;
|
||||
}
|
||||
|
||||
export = Ejs;
|
||||
export function escapeRegexChars(s: string): string;
|
||||
/**
|
||||
* Escape characters reserved in XML.
|
||||
*
|
||||
* This is simply an export of {@link module:utils.escapeXML}.
|
||||
*
|
||||
* If `markup` is `undefined` or `null`, the empty string is returned.
|
||||
*/
|
||||
export function escapeXML(markup: string): string;
|
||||
export interface Cache {
|
||||
set(key: string, val: TemplateFunction): void;
|
||||
get(key: string): TemplateFunction;
|
||||
}
|
||||
export let delimiter: string;
|
||||
|
||||
/**
|
||||
* Custom file loader. Useful for template preprocessing or restricting access
|
||||
* to a certain part of the filesystem.
|
||||
*/
|
||||
export function fileLoader(filePath: string): string;
|
||||
|
||||
/**
|
||||
* Name for detection of EJS.
|
||||
*/
|
||||
export const name = "ejs";
|
||||
|
||||
+1
-79
@@ -1,79 +1 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
}
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import {
|
||||
SpellCheckHandler,
|
||||
ContextMenuListener,
|
||||
ContextMenuBuilder
|
||||
} from "electron-spellchecker";
|
||||
|
||||
const spellCheckHandler = new SpellCheckHandler();
|
||||
spellCheckHandler.attachToInput();
|
||||
|
||||
spellCheckHandler.switchLanguage("en-US");
|
||||
|
||||
const contextMenuBuilder = new ContextMenuBuilder(spellCheckHandler);
|
||||
const contextMenuListener = new ContextMenuListener(info => {
|
||||
contextMenuBuilder.showPopupMenu(info);
|
||||
});
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
// Type definitions for electron-spellchecker 1.1
|
||||
// Project: https://github.com/paulcbetts/electron-spellchecker
|
||||
// Definitions by: Daniel Perez Alvarez <https://github.com/unindented>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="electron"/>
|
||||
|
||||
export type ContextMenuFormatter = (options: { word: string }) => string;
|
||||
|
||||
export class SpellCheckHandler {
|
||||
currentSpellchecker: this;
|
||||
|
||||
attachToInput(): void;
|
||||
autoUnloadDictionariesOnBlur(): void;
|
||||
provideHintText(inputText: string): void;
|
||||
switchLanguage(language: string): void;
|
||||
getCorrectionsForMisspelling(misspelledWord: string): Promise<string[]>;
|
||||
addToDictionary(text: string): void;
|
||||
|
||||
unsubscribe(): void;
|
||||
}
|
||||
|
||||
export class ContextMenuBuilder {
|
||||
constructor(
|
||||
spellCheckHandler?: SpellCheckHandler,
|
||||
target?: Electron.BrowserWindow | Electron.WebviewTag | null,
|
||||
debugMode?: boolean,
|
||||
processMenu?: (menu: Electron.Menu) => Electron.Menu
|
||||
);
|
||||
|
||||
setAlternateStringFormatter(formatter: {
|
||||
[key: string]: ContextMenuFormatter;
|
||||
}): void;
|
||||
|
||||
showPopupMenu: (info: Electron.ContextMenuParams) => void;
|
||||
}
|
||||
|
||||
export class ContextMenuListener {
|
||||
constructor(
|
||||
handler: (info: Electron.ContextMenuParams) => void,
|
||||
target?: Electron.BrowserWindow | Electron.WebviewTag | null
|
||||
);
|
||||
|
||||
unsubscribe(): void;
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"electron": ">=1.6.10"
|
||||
}
|
||||
}
|
||||
@@ -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",
|
||||
"electron-spellchecker-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+8
-2
@@ -1,6 +1,6 @@
|
||||
// Type definitions for electron-winstaller 2.6
|
||||
// Project: https://github.com/electron/windows-installer
|
||||
// Definitions by: Brendan Forster <https://github.com/shiftkey>
|
||||
// Definitions by: Brendan Forster <https://github.com/shiftkey>, Daniel Perez Alvarez <https://github.com/unindented>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export function convertVersion(version: string): string;
|
||||
@@ -27,13 +27,19 @@ export interface Options {
|
||||
*
|
||||
* Defaults to the `author` field from your app's package.json file when unspecified.
|
||||
*/
|
||||
authors: string;
|
||||
authors?: string;
|
||||
/**
|
||||
* The owners value for the nuget package metadata.
|
||||
*
|
||||
* Defaults to the `authors` field when unspecified.
|
||||
*/
|
||||
owners?: string;
|
||||
/**
|
||||
* The copyright value for the nuget package metadata.
|
||||
*
|
||||
* Defaults to a generated copyright with `authors` or `owners`.
|
||||
*/
|
||||
copyright?: string;
|
||||
/**
|
||||
* The name of your app's main `.exe` file.
|
||||
*
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
setResolver, setupAcceptanceTest, setupComponentTest,
|
||||
setupModelTest, setupTest
|
||||
} from 'ember-mocha';
|
||||
import { describe, it, beforeEach, afterEach, before, after } from 'mocha';
|
||||
import { context, describe, it, beforeEach, afterEach, before, after } from 'mocha';
|
||||
import chai = require('chai');
|
||||
import Ember from "ember";
|
||||
import hbs from 'htmlbars-inline-precompile';
|
||||
@@ -127,6 +127,14 @@ describe('setupTest', function() {
|
||||
});
|
||||
});
|
||||
|
||||
// testing context
|
||||
describe('for test suite A', function() {
|
||||
context('when trying method foo', function() {
|
||||
it('should test correctly', function() {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// if you don't have a custom resolver, do it like this:
|
||||
setResolver(Ember.DefaultResolver.create());
|
||||
|
||||
|
||||
Vendored
+1
@@ -65,6 +65,7 @@ declare module 'mocha' {
|
||||
|
||||
// re-export mocha globals as named exports
|
||||
export const describe: Mocha.IContextDefinition;
|
||||
export const context: Mocha.IContextDefinition;
|
||||
export const it: Mocha.ITestDefinition;
|
||||
export const setup: mochaSetup;
|
||||
export const teardown: mochaTeardown;
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
# Installation
|
||||
`npm install --save @types/enigma.js`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for enigma.js (https://github.com/qlik-oss/enigma.js).
|
||||
|
||||
# Example
|
||||
|
||||
`npm install --save enigma.js`
|
||||
|
||||
`npm install --save bluebird`
|
||||
|
||||
```js
|
||||
import * as enigma from "enigma.js";
|
||||
import * as blubird from "bluebird";
|
||||
|
||||
let qixSchema = require("./node_modules/enigma.js/schemas/12.20.0.json");
|
||||
|
||||
let enigmaConfig: enigmaJS.IConfig = {
|
||||
Promise: blubird,
|
||||
schema: qixSchema,
|
||||
url: "ws://localhost:4848/"
|
||||
};
|
||||
|
||||
let session = enigma.create(enigmaConfig);
|
||||
|
||||
session.on("traffic:sent", data => console.log("sent:", data));
|
||||
|
||||
session.open()
|
||||
.then((global: EngineAPI.IGlobal) => {
|
||||
return global.EngineVersion();
|
||||
})
|
||||
.then((version) => {
|
||||
console.log(version);
|
||||
});
|
||||
```
|
||||
Vendored
+40
-6
@@ -38,7 +38,7 @@ declare namespace enigmaJS {
|
||||
/**
|
||||
* mixin.extend is an object containing methods to extend the generated API with. These method names cannot already exist or enigma.js will throw an error.
|
||||
*/
|
||||
extend?: [any];
|
||||
extend?: any;
|
||||
|
||||
/**
|
||||
* mixin.override is an object containing methods that overrides existing API methods.
|
||||
@@ -46,7 +46,35 @@ declare namespace enigmaJS {
|
||||
* Be careful when overriding, you may break expected behaviors in other mixins or your application.
|
||||
* base is a reference to the previous mixin method, can be used to invoke the mixin chain before this mixin method.
|
||||
*/
|
||||
override?: [any];
|
||||
override?: any;
|
||||
}
|
||||
|
||||
interface IResponseInterceptors {
|
||||
/**
|
||||
* This method is invoked when a previous interceptor has rejected the promise, use this to handle for example errors before they are sent into mixins.
|
||||
* @param session refers to the session executing the interceptor.
|
||||
* @param request is the JSON-RPC request resulting in this error. You may use .retry() to retry sending it to QIX Engine.
|
||||
* @param error is whatever the previous interceptor rejected with.
|
||||
*/
|
||||
onRejected?(session: ISession, request: any, error: any): Promise<any>;
|
||||
|
||||
/**
|
||||
* This method is invoked when a promise has been successfully resolved, use this to modify the result or reject the promise chain before it is sent to mixins.
|
||||
* @param session refers to the session executing the interceptor.
|
||||
* @param request is the JSON-RPC request resulting in this error. You may use .retry() to retry sending it to QIX Engine.
|
||||
* @param error is whatever the previous interceptor resolved with.
|
||||
*/
|
||||
onFulfilled?(session: ISession, request: any, result: any): Promise<any>;
|
||||
}
|
||||
|
||||
interface IRequestInterceptors {
|
||||
/**
|
||||
* This method is invoked when a request is about to be sent to QIX Engine.
|
||||
* @param session refers to the session executing the interceptor.
|
||||
* @param request is the JSON-RPC request resulting in this error. You may use .retry() to retry sending it to QIX Engine.
|
||||
* @returns request the new request
|
||||
*/
|
||||
onFulfilled?(session: ISession, request: any, result: any): any;
|
||||
}
|
||||
|
||||
interface IProtocol {
|
||||
@@ -83,13 +111,19 @@ declare namespace enigmaJS {
|
||||
* See Mixins section for more information how each entry in this array should look like.
|
||||
* Mixins are applied in the array order.
|
||||
*/
|
||||
mixins?: [any];
|
||||
mixins?: IMixin[];
|
||||
/**
|
||||
* Interceptors for augmenting responses before they are passed into mixins and end-users.
|
||||
* Interceptors for augmenting requests before they are sent to QIX Engine.
|
||||
* See Interceptors section for more information how each entry in this array should look like.
|
||||
* Interceptors are applied in the array order.
|
||||
*/
|
||||
interceptors?: [any];
|
||||
requestInterceptors?: IRequestInterceptors[];
|
||||
/**
|
||||
* Interceptors for augmenting responses before they are sent to QIX Engine.
|
||||
* See Interceptors section for more information how each entry in this array should look like.
|
||||
* Interceptors are applied in the array order.
|
||||
*/
|
||||
responseInterceptors?: IResponseInterceptors[];
|
||||
/**
|
||||
* An object containing additional JSON-RPC request parameters.
|
||||
* protocol.delta : Set to false to disable the use of the bandwidth-reducing delta protocol.
|
||||
@@ -148,7 +182,7 @@ declare namespace enigmaJS {
|
||||
* @param event - Event that triggers the function
|
||||
* @param func - Called function
|
||||
*/
|
||||
on(event: "opened" | "close" | "suspended" | "resumed" | string, func: any): void;
|
||||
on(event: "opened" | "closed" | "suspended" | "resumed" | string, func: any): void;
|
||||
}
|
||||
|
||||
interface IGeneratedAPI {
|
||||
|
||||
Vendored
+2
-2
@@ -356,7 +356,7 @@ export interface CommonWrapper<P = {}, S = {}> {
|
||||
// tslint:disable-next-line no-empty-interface
|
||||
export interface ShallowWrapper<P = {}, S = {}> extends CommonWrapper<P, S> {}
|
||||
export class ShallowWrapper<P = {}, S = {}> {
|
||||
constructor(nodes: JSX.Element[] | JSX.Element, root?: ShallowWrapper, options?: ShallowRendererProps);
|
||||
constructor(nodes: JSX.Element[] | JSX.Element, root?: ShallowWrapper<any, any>, options?: ShallowRendererProps);
|
||||
shallow(options?: ShallowRendererProps): ShallowWrapper<P, S>;
|
||||
unmount(): this;
|
||||
|
||||
@@ -441,7 +441,7 @@ export class ShallowWrapper<P = {}, S = {}> {
|
||||
// tslint:disable-next-line no-empty-interface
|
||||
export interface ReactWrapper<P = {}, S = {}> extends CommonWrapper<P, S> {}
|
||||
export class ReactWrapper<P = {}, S = {}> {
|
||||
constructor(nodes: JSX.Element | JSX.Element[], root?: ReactWrapper, options?: MountRendererProps);
|
||||
constructor(nodes: JSX.Element | JSX.Element[], root?: ReactWrapper<any, any>, options?: MountRendererProps);
|
||||
|
||||
unmount(): this;
|
||||
mount(): this;
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
// tslint:disable:no-trailing-whitespace
|
||||
// tslint:disable:prefer-method-signature
|
||||
// tslint:disable:no-single-declare-module
|
||||
// tslint:disable:only-arrow-functions
|
||||
// tslint:disable:space-before-function-paren
|
||||
|
||||
import * as L from 'leaflet';
|
||||
import 'esri-leaflet';
|
||||
|
||||
@@ -108,15 +102,15 @@ tiledMapLayer.metadata((err, metadata) => { });
|
||||
|
||||
tiledMapLayer.identify()
|
||||
.at(latlng)
|
||||
.run(function (error, featureCollection) { });
|
||||
.run((error, featureCollection) => {});
|
||||
tiledMapLayer.find()
|
||||
.layers('18')
|
||||
.text('Colorado')
|
||||
.run(function (error, featureCollection) { });
|
||||
.run((error, featureCollection) => {});
|
||||
tiledMapLayer.query()
|
||||
.layer(0)
|
||||
.within(latlngbounds)
|
||||
.run(function (error, featureCollection, response) { });
|
||||
.run((error, featureCollection, response) => {});
|
||||
|
||||
let dynamicMapLayer: L.esri.DynamicMapLayer;
|
||||
let dynamicMapLayerOptions: L.esri.DynamicMapLayerOptions;
|
||||
@@ -225,24 +219,24 @@ dynamicMapLayer = new L.esri.DynamicMapLayer({
|
||||
token: 'token'
|
||||
});
|
||||
|
||||
dynamicMapLayer.bindPopup(function (err, featureCollection, response) {
|
||||
dynamicMapLayer.bindPopup((err, featureCollection, response) => {
|
||||
const count = featureCollection.features.length;
|
||||
return (count) ? count + ' features' : false;
|
||||
});
|
||||
|
||||
dynamicMapLayer.metadata(function (error, metadata) { });
|
||||
dynamicMapLayer.metadata((error, metadata) => {});
|
||||
|
||||
dynamicMapLayer.identify()
|
||||
.at(latlng)
|
||||
.run(function (error, featureCollection) { });
|
||||
.run((error, featureCollection) => {});
|
||||
dynamicMapLayer.find()
|
||||
.layers('18')
|
||||
.text('Colorado')
|
||||
.run(function (error, featureCollection) { });
|
||||
.run((error, featureCollection) => {});
|
||||
dynamicMapLayer.query()
|
||||
.layer(0)
|
||||
.within(latlngbounds)
|
||||
.run(function (error, featureCollection, response) { });
|
||||
.run((error, featureCollection, response) => {});
|
||||
|
||||
let featureLayerOptions: L.esri.FeatureLayerOptions;
|
||||
let featureLayer: L.esri.FeatureLayer;
|
||||
@@ -324,20 +318,20 @@ featureLayer = new L.esri.FeatureLayer({
|
||||
featureLayer.setStyle({
|
||||
color: 'white'
|
||||
});
|
||||
featureLayer.setStyle(function (feature) {
|
||||
featureLayer.setStyle(feature => {
|
||||
return {
|
||||
weight: feature.properties.pixelWidth
|
||||
};
|
||||
});
|
||||
|
||||
featureLayer.eachFeature(function (layer) { });
|
||||
featureLayer.eachFeature(layer => {});
|
||||
|
||||
featureLayer.query()
|
||||
.within(latlngbounds)
|
||||
.where("Direction = 'WEST'")
|
||||
.run(function (error, featureCollection) { });
|
||||
.run((error, featureCollection) => {});
|
||||
|
||||
featureLayer.metadata(function (error, metadata) { });
|
||||
featureLayer.metadata((error, metadata) => {});
|
||||
|
||||
let mapServiceOptions: L.esri.MapServiceOptions;
|
||||
let mapService: L.esri.MapService;
|
||||
@@ -372,27 +366,27 @@ mapService = new L.esri.MapService({
|
||||
mapService.query()
|
||||
.layer(0)
|
||||
.within(latlngbounds)
|
||||
.run(function (error, featureCollection, response) { });
|
||||
.run((error, featureCollection, response) => {});
|
||||
mapService.identify()
|
||||
.on(map)
|
||||
.at(latlng)
|
||||
.run(function (error, featureCollection, response) { });
|
||||
.run((error, featureCollection, response) => {});
|
||||
mapService.find()
|
||||
.layers('18')
|
||||
.text('Colorado')
|
||||
.fields('name')
|
||||
.run(function (error, featureCollection, response) { });
|
||||
.run((error, featureCollection, response) => {});
|
||||
|
||||
mapService.identify()
|
||||
.on(map)
|
||||
.at([45.543, -122.621])
|
||||
.layers('visible:1')
|
||||
.run(function (error, featureCollection, response) { });
|
||||
.run((error, featureCollection, response) => {});
|
||||
mapService.find()
|
||||
.layers('18')
|
||||
.text('Colorado')
|
||||
.fields('GNIS_NAME')
|
||||
.run(function (error, featureCollection, response) { });
|
||||
.run((error, featureCollection, response) => {});
|
||||
|
||||
let imageServiceOptions: L.esri.ImageServiceOptions;
|
||||
let imageService: L.esri.ImageService;
|
||||
@@ -457,7 +451,7 @@ featureLayerService = new L.esri.FeatureLayerService({
|
||||
featureLayerService.query()
|
||||
.within(latlngbounds)
|
||||
.where("Direction = 'WEST'")
|
||||
.run(function (error, featureCollection, response) { });
|
||||
.run((error, featureCollection, response) => {});
|
||||
|
||||
const feature = {
|
||||
type: 'Feature',
|
||||
@@ -469,7 +463,7 @@ const feature = {
|
||||
name: 'Hello World'
|
||||
}
|
||||
};
|
||||
featureLayerService.addFeature(feature, function (error, response) { });
|
||||
featureLayerService.addFeature(feature, (error, response) => {});
|
||||
|
||||
const feature2 = {
|
||||
type: 'Feature',
|
||||
@@ -482,14 +476,14 @@ const feature2 = {
|
||||
name: 'Hi I\'m Feature 2'
|
||||
}
|
||||
};
|
||||
featureLayerService.updateFeature(feature2, function (error, response) { });
|
||||
featureLayerService.updateFeature(feature2, (error, response) => {});
|
||||
|
||||
featureLayerService.deleteFeature(2, function (error, response) { });
|
||||
featureLayerService.deleteFeature(2, (error, response) => {});
|
||||
|
||||
featureLayerService
|
||||
.query()
|
||||
.where("name='Hello World'")
|
||||
.run(function (error, featureCollection, response) { });
|
||||
.run((error, featureCollection, response) => {});
|
||||
|
||||
let queryOptions: L.esri.QueryOptions;
|
||||
let query: L.esri.Query;
|
||||
@@ -522,17 +516,17 @@ query = new L.esri.Query({
|
||||
});
|
||||
|
||||
query.within(latlngbounds);
|
||||
query.run(function (error, featureCollection, response) { });
|
||||
query.bounds(function (error, latLngBounds, response) { });
|
||||
query.run((error, featureCollection, response) => {});
|
||||
query.bounds((error, latLngBounds, response) => {});
|
||||
|
||||
query.nearby(latlng, 500);
|
||||
query.run(function (error, featureCollection, response) { });
|
||||
query.run((error, featureCollection, response) => {});
|
||||
|
||||
query.nearby(latlng, 2000).where("direction='East'").orderBy('stop_id', 'ASC');
|
||||
query.count(function (error, count, response) { });
|
||||
query.ids(function (error, ids, response) { });
|
||||
query.count((error, count, response) => {});
|
||||
query.ids((error, ids, response) => {});
|
||||
|
||||
query.where("zone_id='B'").bounds(function (error, latLngBounds, response) { });
|
||||
query.where("zone_id='B'").bounds((error, latLngBounds, response) => {});
|
||||
|
||||
query.transform(15851);
|
||||
query.transform({wkid: 15851 });
|
||||
@@ -574,7 +568,7 @@ identifyFeatures
|
||||
.on(map)
|
||||
.at([45.543, -122.621])
|
||||
.layers('visible:1')
|
||||
.run(function (error, featureCollection, response) { });
|
||||
.run((error, featureCollection, response) => {});
|
||||
|
||||
identifyFeatures.at(marker);
|
||||
identifyFeatures.at(polygon);
|
||||
@@ -614,9 +608,9 @@ find = new L.esri.Find({
|
||||
|
||||
find.layers('18')
|
||||
.text('Colorado');
|
||||
find.run(function (error, featureCollection, response) { });
|
||||
find.run((error, featureCollection, response) => {});
|
||||
|
||||
find.layers('13')
|
||||
.text('198133')
|
||||
.fields('GNIS_ID');
|
||||
find.run(function (error, featureCollection, response) { });
|
||||
find.run((error, featureCollection, response) => {});
|
||||
|
||||
@@ -273,9 +273,6 @@ switch (node.type) {
|
||||
case 'Program':
|
||||
program = node;
|
||||
break;
|
||||
case 'FunctionDeclaration':
|
||||
functionDeclaration = node
|
||||
break;
|
||||
case 'FunctionExpression':
|
||||
functionExpression = node
|
||||
break;
|
||||
@@ -367,18 +364,12 @@ switch (node.type) {
|
||||
case 'ObjectExpression':
|
||||
objectExpression = node;
|
||||
break;
|
||||
case 'FunctionExpression':
|
||||
functionExpression = node;
|
||||
break;
|
||||
case 'ArrowFunctionExpression':
|
||||
arrowFunctionExpression = node;
|
||||
break;
|
||||
case 'YieldExpression':
|
||||
yieldExpression = node;
|
||||
break;
|
||||
case 'Literal':
|
||||
literal = node;
|
||||
break;
|
||||
case 'UnaryExpression':
|
||||
unaryExpression = node;
|
||||
break;
|
||||
@@ -421,9 +412,6 @@ switch (node.type) {
|
||||
case 'MetaProperty':
|
||||
metaProperty = node;
|
||||
break;
|
||||
case 'Identifier':
|
||||
identifier = node;
|
||||
break;
|
||||
case 'AwaitExpression':
|
||||
awaitExpression = node;
|
||||
break;
|
||||
@@ -443,9 +431,6 @@ switch (node.type) {
|
||||
break;
|
||||
|
||||
// narrowing of Pattern
|
||||
case 'Identifier':
|
||||
identifier = node;
|
||||
break;
|
||||
case 'ObjectPattern':
|
||||
objectPattern = node;
|
||||
break;
|
||||
@@ -458,20 +443,11 @@ switch (node.type) {
|
||||
case 'AssignmentPattern':
|
||||
assignmentPattern = node;
|
||||
break;
|
||||
case 'MemberExpression':
|
||||
memberExpression = node;
|
||||
break;
|
||||
// end narrowing of Pattern
|
||||
|
||||
case 'ClassBody':
|
||||
classBody = node
|
||||
break;
|
||||
case 'ClassDeclaration':
|
||||
classDeclaration = node
|
||||
break;
|
||||
case 'ClassExpression':
|
||||
classExpression = node
|
||||
break;
|
||||
case 'MethodDefinition':
|
||||
methodDefinition = node
|
||||
break;
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import Router = require("express-promise-router");
|
||||
|
||||
const router = Router();
|
||||
|
||||
router.get("/", (req, res) => {
|
||||
// equivalent to calling next()
|
||||
return Promise.resolve('next');
|
||||
});
|
||||
|
||||
router.post("/", async (req, res) => {
|
||||
// ...
|
||||
});
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
// Type definitions for express-promise-router 2.0
|
||||
// Project: https://github.com/express-promise-router/express-promise-router
|
||||
// Definitions by: Anjun Wang <https://github.com/wanganjun>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/* =================== USAGE ===================
|
||||
import Router = require('express-promise-router');
|
||||
|
||||
const router = Router();
|
||||
|
||||
router.get('/', (req, res) => {
|
||||
// equivalent to calling next()
|
||||
return Promise.resolve('next');
|
||||
})
|
||||
|
||||
router.post('/', async (req, res) => {
|
||||
// ...
|
||||
})
|
||||
|
||||
export default router;
|
||||
=============================================== */
|
||||
|
||||
import { Router } from "express";
|
||||
|
||||
/**
|
||||
* A simple wrapper for Express 4's Router that allows middleware to return
|
||||
* promises. If the promise is rejected, `express-promise-router` will call next
|
||||
* with the reason
|
||||
*/
|
||||
declare const PromiseRouter: typeof Router;
|
||||
export = PromiseRouter;
|
||||
@@ -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-promise-router-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -21,7 +21,7 @@ const callbackWithFewerParams = new RateLimit({
|
||||
|
||||
class SomeStore implements RateLimit.Store {
|
||||
incr(key: string, cb: RateLimit.StoreIncrementCallback) { }
|
||||
resetAll() { }
|
||||
decrement(key: string) { }
|
||||
resetKey(key: string) { }
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user