mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 00:07:07 +00:00
Remove decimal.js typings
This commit is contained in:
@@ -378,6 +378,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",
|
||||
@@ -576,6 +582,12 @@
|
||||
"sourceRepoURL": "https://github.com/gpbl/react-day-picker",
|
||||
"asOfVersion": "5.3.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "react-native-elements",
|
||||
"typingsPackageName": "react-native-elements",
|
||||
"sourceRepoURL": "https://github.com/react-native-training/react-native-elements",
|
||||
"asOfVersion": "0.18.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "realm",
|
||||
"typingsPackageName": "realm",
|
||||
|
||||
@@ -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;
|
||||
@@ -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",
|
||||
"add-zero-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -121,12 +121,12 @@ let _algoliaQueryParameters: AlgoliaQueryParameters = {
|
||||
disableTypoToleranceOnAttributes: '',
|
||||
aroundLatLng: '',
|
||||
aroundLatLngViaIP: '',
|
||||
aroundRadius: '',
|
||||
aroundRadius: 0,
|
||||
aroundPrecision: 0,
|
||||
minimumAroundRadius: 0,
|
||||
insideBoundingBox: '',
|
||||
insideBoundingBox: [[0]],
|
||||
queryType: '',
|
||||
insidePolygon: '',
|
||||
insidePolygon: [[0]],
|
||||
removeWordsIfNoResults: '',
|
||||
advancedSyntax: false,
|
||||
optionalWords: [''],
|
||||
|
||||
Vendored
+20
-18
@@ -49,6 +49,9 @@ declare namespace algoliasearch {
|
||||
*/
|
||||
params: string;
|
||||
}
|
||||
interface AlgoliaMultiResponse {
|
||||
results: AlgoliaResponse[];
|
||||
}
|
||||
/*
|
||||
Interface for the algolia client object
|
||||
*/
|
||||
@@ -71,8 +74,8 @@ declare namespace algoliasearch {
|
||||
indexName: string;
|
||||
query: string;
|
||||
params: AlgoliaQueryParameters;
|
||||
},
|
||||
cb: (err: Error, res: any) => void
|
||||
}[],
|
||||
cb: (err: Error, res: AlgoliaMultiResponse) => void
|
||||
): void;
|
||||
/**
|
||||
* Query on multiple index
|
||||
@@ -84,7 +87,7 @@ declare namespace algoliasearch {
|
||||
indexName: string;
|
||||
query: string;
|
||||
params: AlgoliaQueryParameters;
|
||||
}): Promise<AlgoliaResponse>;
|
||||
}[]): Promise<AlgoliaMultiResponse>;
|
||||
/**
|
||||
* clear browser cache
|
||||
* https://github.com/algolia/algoliasearch-client-js#cache
|
||||
@@ -319,8 +322,8 @@ declare namespace algoliasearch {
|
||||
getLogs(options: LogsOptions): Promise<any>;
|
||||
}
|
||||
/**
|
||||
* Interface for the index algolia object
|
||||
*/
|
||||
* Interface for the index algolia object
|
||||
*/
|
||||
interface AlgoliaIndex {
|
||||
/**
|
||||
* Gets a specific object
|
||||
@@ -783,7 +786,7 @@ declare namespace algoliasearch {
|
||||
* @param err() error callback
|
||||
* https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search
|
||||
*/
|
||||
search(params: AlgoliaQueryParameters): Promise<any>;
|
||||
search(params: AlgoliaQueryParameters): Promise<AlgoliaResponse>;
|
||||
/**
|
||||
* Search in an index
|
||||
* @param params query parameter
|
||||
@@ -793,7 +796,7 @@ declare namespace algoliasearch {
|
||||
*/
|
||||
search(
|
||||
params: AlgoliaQueryParameters,
|
||||
cb: (err: Error, res: any) => void
|
||||
cb: (err: Error, res: AlgoliaResponse) => void
|
||||
): void;
|
||||
/**
|
||||
* Search in an index
|
||||
@@ -809,8 +812,7 @@ declare namespace algoliasearch {
|
||||
}: {
|
||||
facetName: string;
|
||||
facetQuery: string;
|
||||
} & AlgoliaQueryParameters
|
||||
): Promise<any>;
|
||||
} & AlgoliaQueryParameters): Promise<any>;
|
||||
/**
|
||||
* Search in an index
|
||||
* @param params query parameter
|
||||
@@ -1071,8 +1073,8 @@ Interface describing options available for gettings the logs
|
||||
type?: string;
|
||||
}
|
||||
/**
|
||||
* Describe the action object used for batch operation
|
||||
*/
|
||||
* Describe the action object used for batch operation
|
||||
*/
|
||||
interface AlgoliaAction {
|
||||
/**
|
||||
* Type of the batch action
|
||||
@@ -1098,8 +1100,8 @@ Interface describing options available for gettings the logs
|
||||
body: {};
|
||||
}
|
||||
/**
|
||||
* Describes the option used when creating user key
|
||||
*/
|
||||
* Describes the option used when creating user key
|
||||
*/
|
||||
interface AlgoliaApiKeyOptions {
|
||||
/**
|
||||
* Add a validity period. The key will be valid for a specific period of time (in seconds).
|
||||
@@ -1364,8 +1366,8 @@ Interface describing options available for gettings the logs
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes the settings available for configure your index
|
||||
*/
|
||||
* Describes the settings available for configure your index
|
||||
*/
|
||||
interface AlgoliaIndexSettings {
|
||||
/**
|
||||
* The list of attributes you want index
|
||||
@@ -1770,7 +1772,7 @@ Interface describing options available for gettings the logs
|
||||
* You can specify aroundRadius=all if you want to compute the geo distance without filtering in a geo area
|
||||
* https://github.com/algolia/algoliasearch-client-js#aroundradius
|
||||
*/
|
||||
aroundRadius?: any;
|
||||
aroundRadius?: number | 'all';
|
||||
/**
|
||||
* Control the precision of a geo search
|
||||
* default: null
|
||||
@@ -1788,7 +1790,7 @@ Interface describing options available for gettings the logs
|
||||
* default: null
|
||||
* https://github.com/algolia/algoliasearch-client-js#insideboundingbox
|
||||
*/
|
||||
insideBoundingBox?: string;
|
||||
insideBoundingBox?: number[][];
|
||||
/**
|
||||
* Selects how the query words are interpreted
|
||||
* default: 'prefixLast'
|
||||
@@ -1803,7 +1805,7 @@ Interface describing options available for gettings the logs
|
||||
* defauly: ''
|
||||
* https://github.com/algolia/algoliasearch-client-js#insidepolygon
|
||||
*/
|
||||
insidePolygon?: string;
|
||||
insidePolygon?: number[][];
|
||||
/**
|
||||
* This option is used to select a strategy in order to avoid having an empty result page
|
||||
* default: 'none'
|
||||
|
||||
Vendored
+721
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
@@ -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",
|
||||
"appdmg-tests.ts"
|
||||
]
|
||||
}
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/atom/atom-keymap
|
||||
// Definitions by: GlenCFL <https://github.com/GlenCFL>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import { Disposable } from "event-kit";
|
||||
|
||||
|
||||
@@ -844,9 +844,12 @@ function testDock() {
|
||||
}
|
||||
|
||||
// Emitter ====================================================================
|
||||
interface TestEmissions {
|
||||
"test-event": string;
|
||||
}
|
||||
|
||||
function testEmitter() {
|
||||
emitter = new Atom.Emitter();
|
||||
|
||||
emitter.clear();
|
||||
emitter.dispose();
|
||||
|
||||
@@ -858,6 +861,27 @@ function testEmitter() {
|
||||
// Event Emission
|
||||
emitter.emit("test-event");
|
||||
emitter.emit("test-event", 42);
|
||||
|
||||
// Optional Value Emitter
|
||||
const optEmitter = new Atom.Emitter<{ "test-event": string }>();
|
||||
optEmitter.emit("test-event");
|
||||
optEmitter.emit("test-event", "test");
|
||||
optEmitter.on("test-event", value => {
|
||||
str = value ? value : "";
|
||||
});
|
||||
|
||||
// Required Value Emitter
|
||||
const reqEmitter = new Atom.Emitter<{}, TestEmissions>();
|
||||
reqEmitter.on("test-event", value => {
|
||||
str = value;
|
||||
});
|
||||
reqEmitter.emit("test-event", "test");
|
||||
|
||||
// Mixed Value Emitter
|
||||
const mixedEmitter = new Atom.Emitter<{ "t1": "test" }, { "t2": "test" }>();
|
||||
mixedEmitter.emit("t1");
|
||||
mixedEmitter.emit("t1", "test");
|
||||
mixedEmitter.emit("t2", "test");
|
||||
}
|
||||
|
||||
// File =======================================================================
|
||||
@@ -2939,7 +2963,7 @@ function testTooltipManager() {
|
||||
subscription = atom.tooltips.add(element, { class: "test-class" });
|
||||
subscription = atom.tooltips.add(element, { placement: "top" });
|
||||
|
||||
subscription = atom.tooltips.add(element, { placement: () => "left" });
|
||||
subscription = atom.tooltips.add(element, { placement: () => "auto left" });
|
||||
|
||||
subscription = atom.tooltips.add(element, { trigger: "click" });
|
||||
subscription = atom.tooltips.add(element, { delay: { hide: 42, show: 42 }});
|
||||
|
||||
Vendored
+45
-37
@@ -717,7 +717,9 @@ export class Disposable implements DisposableLike {
|
||||
* Utility class to be used when implementing event-based APIs that allows
|
||||
* for handlers registered via ::on to be invoked with calls to ::emit.
|
||||
*/
|
||||
export class Emitter implements DisposableLike {
|
||||
// tslint:disable-next-line:no-any
|
||||
export class Emitter<OptionalEmissions = { [key: string]: any }, RequiredEmissions = {}>
|
||||
implements DisposableLike {
|
||||
/** Construct an emitter. */
|
||||
constructor();
|
||||
|
||||
@@ -729,27 +731,47 @@ export class Emitter implements DisposableLike {
|
||||
|
||||
// Event Subscription
|
||||
/** Registers a handler to be invoked whenever the given event is emitted. */
|
||||
on<T extends keyof Emissions>(eventName: T, handler: (value?: Emissions[T]) => void):
|
||||
Disposable;
|
||||
on<T extends keyof OptionalEmissions>(eventName: T, handler: (value?:
|
||||
OptionalEmissions[T]) => void): Disposable;
|
||||
/** Registers a handler to be invoked whenever the given event is emitted. */
|
||||
on<T extends keyof RequiredEmissions>(eventName: T, handler: (value:
|
||||
RequiredEmissions[T]) => void): Disposable;
|
||||
|
||||
/**
|
||||
* Register the given handler function to be invoked the next time an event
|
||||
* with the given name is emitted via ::emit.
|
||||
*/
|
||||
once<T extends keyof Emissions>(eventName: T, handler: (value?: Emissions[T]) => void):
|
||||
Disposable;
|
||||
once<T extends keyof OptionalEmissions>(eventName: T, handler: (value?:
|
||||
OptionalEmissions[T]) => void): Disposable;
|
||||
/**
|
||||
* Register the given handler function to be invoked the next time an event
|
||||
* with the given name is emitted via ::emit.
|
||||
*/
|
||||
once<T extends keyof RequiredEmissions>(eventName: T, handler: (value:
|
||||
RequiredEmissions[T]) => void): Disposable;
|
||||
|
||||
/**
|
||||
* Register the given handler function to be invoked before all other
|
||||
* handlers existing at the time of subscription whenever events by the
|
||||
* given name are emitted via ::emit.
|
||||
*/
|
||||
preempt<T extends keyof Emissions>(eventName: T, handler: (value?: Emissions[T]) => void):
|
||||
Disposable;
|
||||
preempt<T extends keyof OptionalEmissions>(eventName: T, handler: (value?:
|
||||
OptionalEmissions[T]) => void): Disposable;
|
||||
/**
|
||||
* Register the given handler function to be invoked before all other
|
||||
* handlers existing at the time of subscription whenever events by the
|
||||
* given name are emitted via ::emit.
|
||||
*/
|
||||
preempt<T extends keyof RequiredEmissions>(eventName: T, handler: (value:
|
||||
RequiredEmissions[T]) => void): Disposable;
|
||||
|
||||
// Event Emission
|
||||
/** Invoke the handlers registered via ::on for the given event name. */
|
||||
emit<T extends keyof Emissions>(eventName: T, value?: Emissions[T]): void;
|
||||
emit<T extends keyof OptionalEmissions>(eventName: T, value?:
|
||||
OptionalEmissions[T]): void;
|
||||
/** Invoke the handlers registered via ::on for the given event name. */
|
||||
emit<T extends keyof RequiredEmissions>(eventName: T, value:
|
||||
RequiredEmissions[T]): void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1015,10 +1037,7 @@ export class Point {
|
||||
* Create a Point from an array containing two numbers representing the
|
||||
* row and column.
|
||||
*/
|
||||
static fromObject(object: [number, number]): Point;
|
||||
|
||||
/** Create a Point from an existing object which implements PointLike. */
|
||||
static fromObject(object: PointLike, copy?: boolean): Point;
|
||||
static fromObject(object: PointCompatible, copy?: boolean): Point;
|
||||
|
||||
/** Construct a Point object */
|
||||
constructor(row?: number, column?: number);
|
||||
@@ -1775,7 +1794,8 @@ export class TextEditor {
|
||||
void;
|
||||
|
||||
/** Add a cursor at the given position in buffer coordinates. */
|
||||
addCursorAtBufferPosition(bufferPosition: PointCompatible): Cursor;
|
||||
addCursorAtBufferPosition(bufferPosition: PointCompatible, options?:
|
||||
{ autoscroll?: boolean }): Cursor;
|
||||
|
||||
/** Add a cursor at the position in screen coordinates. */
|
||||
addCursorAtScreenPosition(screenPosition: PointCompatible): Cursor;
|
||||
@@ -2403,27 +2423,25 @@ export interface TextEditorRegistry {
|
||||
observe(callback: (editor: TextEditor) => void): Disposable;
|
||||
}
|
||||
|
||||
export type TooltipPlacement =
|
||||
|"top"|"bottom"|"left"|"right"
|
||||
|"auto"|"auto top"|"auto bottom"|"auto left"|"auto right";
|
||||
|
||||
/** Associates tooltips with HTML elements or selectors. */
|
||||
export interface TooltipManager {
|
||||
/** Add a tooltip to the given element. */
|
||||
add(target: HTMLElement, options: {
|
||||
title?: string,
|
||||
html?: boolean,
|
||||
item?: HTMLElement|{ element: HTMLElement },
|
||||
class?: string,
|
||||
placement?: "top"|"bottom"|"left"|"right"|"auto"|(() => string),
|
||||
trigger?: "click"|"hover"|"focus"|"manual",
|
||||
delay?: { show: number, hide: number },
|
||||
keyBindingCommand?: string,
|
||||
keyBindingTarget?: HTMLElement
|
||||
item?: object,
|
||||
} | {
|
||||
title?: string|(() => string),
|
||||
html?: boolean,
|
||||
item?: HTMLElement|{ element: HTMLElement },
|
||||
class?: string,
|
||||
placement?: "top"|"bottom"|"left"|"right"|"auto"|(() => string),
|
||||
keyBindingCommand?: string,
|
||||
keyBindingTarget?: HTMLElement
|
||||
} & {
|
||||
class?: string;
|
||||
placement?: TooltipPlacement|(() => TooltipPlacement),
|
||||
trigger?: "click"|"hover"|"focus"|"manual",
|
||||
delay?: { show: number, hide: number },
|
||||
delay?: { show: number, hide: number }
|
||||
}): Disposable;
|
||||
|
||||
/** Find the tooltips that have been applied to the given element. */
|
||||
@@ -5795,16 +5813,6 @@ export interface ConfigValues {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows you to strongly type event emissions across your codebase. Additional
|
||||
* key:value pairings merged into this interface will result in emissions under
|
||||
* the value of each key being templated by the type of the associated value.
|
||||
*/
|
||||
export interface Emissions {
|
||||
// tslint:disable-next-line:no-any
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
// Options ====================================================================
|
||||
// The option objects that the user is expected to fill out and provide to
|
||||
// specific API call.
|
||||
@@ -6094,7 +6102,7 @@ export interface SharedDecorationOptions {
|
||||
* An HTMLElement or a model Object with a corresponding view registered. Only
|
||||
* applicable to the gutter, overlay and block types.
|
||||
*/
|
||||
item?: HTMLElement;
|
||||
item?: object;
|
||||
|
||||
/**
|
||||
* If true, the decoration will only be applied to the head of the DisplayMarker.
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -111,3 +111,12 @@ management
|
||||
// Update app metadata using callback
|
||||
management
|
||||
.updateAppMetadata({id: "user_id"}, {"key": "value"}, (err: Error, users: auth0.User) => {});
|
||||
|
||||
|
||||
management.getUsersByEmail('email@address.com', (err, users) => {
|
||||
console.log(users);
|
||||
});
|
||||
|
||||
management.getUsersByEmail('email@address.com').then((users) => {
|
||||
console.log(users);
|
||||
});
|
||||
|
||||
Vendored
+3
@@ -482,6 +482,9 @@ export class ManagementClient {
|
||||
getUser(params: ObjectWithId): Promise<User>;
|
||||
getUser(params: ObjectWithId, cb?: (err: Error, user: User) => void): void;
|
||||
|
||||
getUsersByEmail(email: string): Promise<User[]>;
|
||||
getUsersByEmail(email: string, cb?: (err: Error, users: User[]) => void): void;
|
||||
|
||||
createUser(data: CreateUserData): Promise<User>;
|
||||
createUser(data: CreateUserData, cb: (err: Error, user: User) => void): void;
|
||||
|
||||
|
||||
@@ -315,6 +315,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
+50
@@ -10,6 +10,7 @@
|
||||
// Ishaan Malhi <https://github.com/OrthoDex>
|
||||
// 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
|
||||
|
||||
@@ -346,6 +347,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
|
||||
|
||||
@@ -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" }
|
||||
@@ -0,0 +1,31 @@
|
||||
import * as React from "react";
|
||||
import * as BraftEditor from "braft-editor";
|
||||
import {
|
||||
RawDraftContentState,
|
||||
} from 'draft-js';
|
||||
class BraftEditorTest extends React.Component<BraftEditor.editorProps> {
|
||||
state = {
|
||||
content: null
|
||||
};
|
||||
render() {
|
||||
const editorProps = {
|
||||
height: 500,
|
||||
initialContent: this.state.content,
|
||||
onChange: this.handleChange,
|
||||
onHTMLChange: this.handleHTMLChange
|
||||
};
|
||||
return (
|
||||
<div>
|
||||
<BraftEditor
|
||||
{...editorProps}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
private handleChange = (content: RawDraftContentState) => {
|
||||
console.log(content);
|
||||
}
|
||||
private handleHTMLChange = (html: string) => {
|
||||
console.log(html);
|
||||
}
|
||||
}
|
||||
Vendored
+59
@@ -0,0 +1,59 @@
|
||||
// Type definitions for braft-editor 1.1
|
||||
// Project: https://github.com/margox/braft#readme
|
||||
// Definitions by: My Self <https://github.com/me>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as React from "react";
|
||||
import { RawDraftContentState } from 'draft-js';
|
||||
export as namespace BraftEditor;
|
||||
export = BraftEditor;
|
||||
declare namespace BraftEditor {
|
||||
interface fontFamiliesRange {
|
||||
name: string;
|
||||
family: string;
|
||||
}
|
||||
interface editorProps {
|
||||
editorState?: any;
|
||||
contentFormat?: RawDraftContentState;
|
||||
initialContent?: RawDraftContentState | null;
|
||||
onChange?: (content: RawDraftContentState) => void;
|
||||
onRawChange?: (content: RawDraftContentState) => void;
|
||||
onHTMLChange?: (content: string) => void;
|
||||
controls?: string[];
|
||||
extendControls?: any[];
|
||||
height?: number;
|
||||
language?: string;
|
||||
placeholder?: string;
|
||||
viewWrapper?: string;
|
||||
colors?: string[];
|
||||
fontSizes?: number[];
|
||||
fontFamilies?: fontFamiliesRange[];
|
||||
media?: { [key: string]: any };
|
||||
getContent?: (format?: string) => RawDraftContentState;
|
||||
setContent?: (content: RawDraftContentState, format?: string) => void;
|
||||
toggleSelectionBlockType?: (blockquote: string) => any;
|
||||
toggleSelectionInlineStyle?: (style: string, stylesToBeRemoved?: string[]) => any;
|
||||
insertMedias?: (medias: Array<{ type: string, name: string, url: string }>) => void;
|
||||
insertText?: (text: string, replace?: boolean) => void;
|
||||
toggleSelectionLink?: (href: string, target: string) => void;
|
||||
toggleSelectionAlignment?: (alignment: string) => any;
|
||||
toggleSelectionColor?: (hexColor: string) => void;
|
||||
toggleSelectionBackgroundColor?: (hexColor: string) => void;
|
||||
toggleSelectionFontSize?: (fontSize: number) => void;
|
||||
toggleSelectionFontFamily?: (fontFamily: string) => void;
|
||||
selectionCollapsed?: () => boolean;
|
||||
selectionHasInlineStyle?: () => boolean;
|
||||
getSelectionBlockType?: () => string;
|
||||
getEditorState?: () => void;
|
||||
forceRender?: () => void;
|
||||
getDraftInstance?: () => any;
|
||||
getMediaLibraryInstance?: () => any;
|
||||
getSelectionInlineStyle?: () => any;
|
||||
undo?: () => any;
|
||||
redo?: () => any;
|
||||
focus?: () => void;
|
||||
blur?: () => void;
|
||||
}
|
||||
}
|
||||
declare class BraftEditor extends React.Component<BraftEditor.editorProps> { }
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"jsx": "react",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"braft-editor-tests.tsx"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
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);
|
||||
|
||||
@@ -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
+13
-13
@@ -26,20 +26,20 @@ declare namespace Chai {
|
||||
version: string;
|
||||
}
|
||||
|
||||
interface ExpectStatic extends AssertionStatic {
|
||||
export interface ExpectStatic extends AssertionStatic {
|
||||
fail(actual?: any, expected?: any, message?: string, operator?: Operator): void;
|
||||
}
|
||||
|
||||
interface AssertStatic extends Assert {
|
||||
export interface AssertStatic extends Assert {
|
||||
}
|
||||
|
||||
interface AssertionStatic {
|
||||
export interface AssertionStatic {
|
||||
(target: any, message?: string): Assertion;
|
||||
}
|
||||
|
||||
type Operator = string; // "==" | "===" | ">" | ">=" | "<" | "<=" | "!=" | "!==";
|
||||
export type Operator = string; // "==" | "===" | ">" | ">=" | "<" | "<=" | "!=" | "!==";
|
||||
|
||||
type OperatorComparable = boolean | null | number | string | undefined | Date;
|
||||
export type OperatorComparable = boolean | null | number | string | undefined | Date;
|
||||
|
||||
interface ShouldAssertion {
|
||||
equal(value1: any, value2: any, message?: string): void;
|
||||
@@ -256,7 +256,7 @@ declare namespace Chai {
|
||||
(object: Object, property: string, message?: string): Assertion;
|
||||
}
|
||||
|
||||
interface Assert {
|
||||
export interface Assert {
|
||||
/**
|
||||
* @param expression Expression to test for truthiness.
|
||||
* @param message Message to display on error.
|
||||
@@ -1587,7 +1587,7 @@ declare namespace Chai {
|
||||
doesNotHaveAllDeepKeys<T>(object: T, keys: Array<Object | string> | { [key: string]: any }, message?: string): void;
|
||||
}
|
||||
|
||||
interface Config {
|
||||
export interface Config {
|
||||
/**
|
||||
* Default: false
|
||||
*/
|
||||
@@ -1604,7 +1604,7 @@ declare namespace Chai {
|
||||
truncateThreshold: number;
|
||||
}
|
||||
|
||||
class AssertionError {
|
||||
export class AssertionError {
|
||||
constructor(message: string, _props?: any, ssf?: Function);
|
||||
name: string;
|
||||
message: string;
|
||||
@@ -1615,10 +1615,10 @@ declare namespace Chai {
|
||||
|
||||
declare const chai: Chai.ChaiStatic;
|
||||
|
||||
export = chai;
|
||||
declare module "chai" {
|
||||
export = chai;
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface Object {
|
||||
should: Chai.Assertion;
|
||||
}
|
||||
interface Object {
|
||||
should: Chai.Assertion;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,11 @@
|
||||
"ban-types": false,
|
||||
"callable-types": false,
|
||||
"new-parens": false,
|
||||
"no-declare-current-package": false,
|
||||
"no-empty-interface": false,
|
||||
"no-redundant-jsdoc-2": false,
|
||||
"no-unnecessary-generics": false
|
||||
"no-single-declare-module": false,
|
||||
"no-unnecessary-generics": false,
|
||||
"strict-export-declare-modifiers": false
|
||||
}
|
||||
}
|
||||
|
||||
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
+2
-5
@@ -1,4 +1,4 @@
|
||||
// Type definitions for chokidar 1.7.1
|
||||
// Type definitions for chokidar 1.7
|
||||
// Project: https://github.com/paulmillr/chokidar
|
||||
// Definitions by: Stefan Steinhart <https://github.com/reppners>
|
||||
// Felix Becker <https://github.com/felixfbecker>
|
||||
@@ -19,7 +19,6 @@ export interface WatchedPaths {
|
||||
}
|
||||
|
||||
export class FSWatcher extends EventEmitter implements fs.FSWatcher {
|
||||
|
||||
/**
|
||||
* Constructs a new FSWatcher instance with optional WatchOptions parameter.
|
||||
*/
|
||||
@@ -52,7 +51,6 @@ export class FSWatcher extends EventEmitter implements fs.FSWatcher {
|
||||
}
|
||||
|
||||
export interface WatchOptions {
|
||||
|
||||
/**
|
||||
* Indicates whether the process should continue to run as long as files are being watched. If
|
||||
* set to `false` when using `fsevents` to watch, no more events will be emitted after `ready`,
|
||||
@@ -86,7 +84,7 @@ export interface WatchOptions {
|
||||
* be relative to this.
|
||||
*/
|
||||
cwd?: string;
|
||||
|
||||
|
||||
/**
|
||||
* If set to true then the strings passed to .watch() and .add() are treated as literal path
|
||||
* names, even if they look like globs. Default: false.
|
||||
@@ -155,7 +153,6 @@ export interface WatchOptions {
|
||||
}
|
||||
|
||||
export interface AwaitWriteFinishOptions {
|
||||
|
||||
/**
|
||||
* Amount of time in milliseconds for a file size to remain constant before emitting its event.
|
||||
*/
|
||||
|
||||
@@ -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" }
|
||||
|
||||
Vendored
+28
-1
@@ -1,6 +1,6 @@
|
||||
// Type definitions for Chrome packaged application development
|
||||
// Project: http://developer.chrome.com/apps/
|
||||
// Definitions by: Adam Lay <https://github.com/AdamLay>, MIZUNE Pine <https://github.com/pine613>, MIZUSHIMA Junki <https://github.com/mzsm>, Ingvar Stepanyan <https://github.com/RReverser>
|
||||
// Definitions by: Adam Lay <https://github.com/AdamLay>, MIZUNE Pine <https://github.com/pine613>, MIZUSHIMA Junki <https://github.com/mzsm>, Ingvar Stepanyan <https://github.com/RReverser>, Adam Pyle <https://github.com/pyle>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="index.d.ts"/>
|
||||
@@ -21,12 +21,39 @@ declare namespace chrome.app {
|
||||
// App Runtime
|
||||
////////////////////
|
||||
declare namespace chrome.app.runtime {
|
||||
enum LaunchSource {
|
||||
"untracked" = "untracked",
|
||||
"app_launcher" = "app_launcher",
|
||||
"new_tab_page" = "new_tab_page",
|
||||
"reload" = "reload",
|
||||
"restart" = "restart",
|
||||
"load_and_launch" = "load_and_launch",
|
||||
"command_line" = "command_line",
|
||||
"file_handler" = "file_handler",
|
||||
"url_handler" = "url_handler",
|
||||
"system_tray" = "system_tray",
|
||||
"about_page" = "about_page",
|
||||
"keyboard" = "keyboard",
|
||||
"extensions_page" = "extensions_page",
|
||||
"management_api" = "management_api",
|
||||
"ephemeral_app" = "ephemeral_app",
|
||||
"background" = "background",
|
||||
"kiosk" = "kiosk",
|
||||
"chrome_internal" = "chrome_internal",
|
||||
"test" = "test",
|
||||
"installed_notification" = "installed_notification",
|
||||
"context_menu" = "context_menu",
|
||||
}
|
||||
|
||||
interface LaunchData {
|
||||
id?: string;
|
||||
items?: LaunchDataItem[];
|
||||
url?: string;
|
||||
referrerUrl?: string;
|
||||
isKioskSession?: boolean;
|
||||
isPublicSession?: boolean;
|
||||
source?: LaunchSource;
|
||||
actionData?: {};
|
||||
}
|
||||
|
||||
interface LaunchDataItem {
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
// Project: http://developer.chrome.com/extensions/
|
||||
// Definitions by: Matthew Kimber <https://github.com/matthewkimber>, otiai10 <https://github.com/otiai10>, couven92 <https://github.com/couven92>, RReverser <https://github.com/rreverser>, sreimer15 <https://github.com/sreimer15>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
/// <reference types="filesystem" />
|
||||
|
||||
|
||||
@@ -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" }
|
||||
@@ -0,0 +1,108 @@
|
||||
import * as coinbase from "coinbase";
|
||||
|
||||
const client = new coinbase.Client({ apiKey: "key", apiSecret: "secret", version: "2017-10-22" });
|
||||
|
||||
client.getAccounts({}, (error: Error, result: coinbase.Account[]): void => undefined);
|
||||
|
||||
client.getAccount("abcdef", (error: Error, account: coinbase.Account): void => {
|
||||
account.buy({ amount: "1", commit: false, currency: "BTC", payment_method: "abcdef" }, (error: Error, buy: coinbase.Buy): void => {
|
||||
buy.commit((error: Error, buy: coinbase.Buy): void => undefined);
|
||||
});
|
||||
|
||||
account.createAddress({ name: "foo" }, (error: Error, address: coinbase.Address): void => {
|
||||
address.getTransactions({}, (error: Error, transactions: coinbase.Transaction[]): void => undefined);
|
||||
});
|
||||
|
||||
account.delete((error: Error): void => undefined);
|
||||
|
||||
account.deposit({ amount: "1", commit: false, currency: "USD", payment_method: "abcdef" }, (error: Error, deposit: coinbase.Deposit): void => {
|
||||
deposit.commit((error: Error, deposit: coinbase.Deposit): void => undefined);
|
||||
});
|
||||
|
||||
account.getAddress("abcdef", (error: Error, address: coinbase.Address): void => undefined);
|
||||
|
||||
account.getAddresses((error: Error, address: coinbase.Address[]): void => undefined);
|
||||
|
||||
account.getBuy("abcdef", (error: Error, buy: coinbase.Buy): void => undefined);
|
||||
|
||||
account.getBuys((error: Error, buy: coinbase.Buy[]): void => undefined);
|
||||
|
||||
account.getDeposit("abcdef", (error: Error, deposit: coinbase.Deposit): void => undefined);
|
||||
|
||||
account.getDeposits((error: Error, deposit: coinbase.Deposit[]): void => undefined);
|
||||
|
||||
account.getSell("abcdef", (error: Error, deposit: coinbase.Sell): void => undefined);
|
||||
|
||||
account.getSells((error: Error, deposit: coinbase.Sell[]): void => undefined);
|
||||
|
||||
account.getTransaction("abcdef", (error: Error, deposit: coinbase.Transaction): void => undefined);
|
||||
|
||||
account.getTransactions((error: Error, deposit: coinbase.Transaction[]): void => undefined);
|
||||
|
||||
account.getWithdrawal("abcdef", (error: Error, deposit: coinbase.Withdrawal): void => undefined);
|
||||
|
||||
account.getWithdrawals((error: Error, deposit: coinbase.Withdrawal[]): void => undefined);
|
||||
|
||||
account.requestMoney(
|
||||
{ amount: "1", currency: "EUR", description: "foo", to: "bar", type: "request" },
|
||||
(error: Error, result: coinbase.Transaction) => undefined
|
||||
);
|
||||
account.requestMoney({ amount: "1", currency: "EUR", to: "bar", type: "request" }, (error: Error, tx: coinbase.Transaction) => {
|
||||
tx.cancel((error: Error, tx: coinbase.Transaction): void => undefined);
|
||||
tx.complete((error: Error, tx: coinbase.Transaction): void => undefined);
|
||||
tx.resend((error: Error, tx: coinbase.Transaction): void => undefined);
|
||||
});
|
||||
|
||||
account.sell(
|
||||
{ agree_btc_amount_varies: true, amount: "1", commit: true, currency: "BTC", payment_method: "abcdef", quote: true},
|
||||
(error: Error, sell: coinbase.Sell): void => {
|
||||
sell.commit((error: Error, sell: coinbase.Sell): void => undefined);
|
||||
}
|
||||
);
|
||||
account.sell(
|
||||
{ currency: "BTC", payment_method: "abcdef", total: "3"},
|
||||
(error: Error, sell: coinbase.Sell): void => {
|
||||
sell.commit((error: Error, sell: coinbase.Sell): void => undefined);
|
||||
}
|
||||
);
|
||||
|
||||
account.sendMoney(
|
||||
{ amount: "1", currency: "EUR", description: "foo", fee: "2", idem: "bar", to: "baz", type: "send" },
|
||||
(error: Error, result: coinbase.Transaction) => undefined
|
||||
);
|
||||
|
||||
account.setPrimary((error: Error, result: coinbase.Account): void => undefined);
|
||||
|
||||
account.transferMoney(
|
||||
{ amount: "1", currency: "USD", description: "foo", to: "bar", type: "transfer" },
|
||||
(error: Error, tx: coinbase.Transaction): void => undefined
|
||||
);
|
||||
|
||||
account.update({ name: "foo" }, (error: Error, result: coinbase.Account): void => undefined);
|
||||
|
||||
account.withdraw({ amount: "1", commit: false, currency: "ETH", payment_method: "abcdef"}, (error: Error, result: coinbase.Withdrawal): void => {
|
||||
result.commit((error: Error, result: coinbase.Withdrawal): void => undefined);
|
||||
});
|
||||
});
|
||||
|
||||
client.getBuyPrice({ currencyPair: "USD-BTC" }, (error: Error, result: coinbase.MoneyHash): void => undefined);
|
||||
|
||||
client.getCurrencies((error: Error, result: coinbase.Currency[]): void => undefined);
|
||||
|
||||
client.getExchangeRates({currency: "ETC"}, (error: Error, result: coinbase.ExchangeRate): void => undefined);
|
||||
|
||||
client.getPaymentMethod("foo", (error: Error, result: coinbase.PaymentMethod): void => undefined);
|
||||
|
||||
client.getPaymentMethods((error: Error, result: coinbase.PaymentMethod[]): void => undefined);
|
||||
|
||||
client.getSellPrice({ currencyPair: "USD-BTC" }, (error: Error, result: coinbase.MoneyHash): void => undefined);
|
||||
|
||||
client.getSpotPrice({ currencyPair: "USD-BTC" }, (error: Error, result: coinbase.MoneyHash): void => undefined);
|
||||
client.getSpotPrice({ currencyPair: "USD-BTC", date: "2017-22-01" }, (error: Error, result: coinbase.MoneyHash): void => undefined);
|
||||
|
||||
client.getTime((error: Error, result: coinbase.Time): void => undefined);
|
||||
|
||||
client.getUser("abcdef", (error: Error, user: coinbase.User): void => {
|
||||
user.showAuth((error: Error, auth: coinbase.Auth): void => undefined);
|
||||
user.update({ name: "foo", time_zone: "bar", native_currency: "USD" }, (error: Error, user: coinbase.User): void => undefined);
|
||||
});
|
||||
Vendored
+1333
File diff suppressed because it is too large
Load Diff
@@ -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",
|
||||
"coinbase-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as concaveman from 'concaveman';
|
||||
|
||||
var points = [[10, 20], [30, 12.5]];
|
||||
var polygon = concaveman(points);
|
||||
var polygon = concaveman(points);
|
||||
|
||||
Vendored
+3
-2
@@ -3,10 +3,11 @@
|
||||
// Definitions by: Denis Carriere <https://github.com/DenisCarriere>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
declare module "concaveman" {
|
||||
/**
|
||||
* A very fast 2D concave hull algorithm in JavaScript (generates a general outline of a point set).
|
||||
*
|
||||
*
|
||||
* @name concaveman
|
||||
* @param {Array<Array<number>>} points is an array of [x, y] points.
|
||||
* @param {number} [concavity=2] is a relative measure of concavity. 1 results in a relatively detailed shape, Infinity results in a convex hull. You can use values lower than 1, but they can produce pretty crazy shapes.
|
||||
@@ -15,7 +16,7 @@ declare module "concaveman" {
|
||||
* @example
|
||||
* var points = [[10, 20], [30, 12.5], ...];
|
||||
* var polygon = concaveman(points);
|
||||
*
|
||||
*
|
||||
* //=hull
|
||||
*/
|
||||
function concaveman(points: number[][], concavity?: number, lengthThreshold?: number): number[][];
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
class Confirm {
|
||||
private title_: string;
|
||||
private conTent_: string;
|
||||
constructor(title: string, content: string) {
|
||||
this.title_ = title;
|
||||
this.conTent_ = content;
|
||||
}
|
||||
|
||||
confirm() {
|
||||
$.confirm({
|
||||
title: 'Confirm!',
|
||||
content: 'Simple confirm!',
|
||||
buttons: {
|
||||
confirm: () => {
|
||||
$.alert('Confirmed!');
|
||||
},
|
||||
cancel: (cancel: string) => {
|
||||
$.alert('Canceled! ' + cancel);
|
||||
},
|
||||
somethingElse: {
|
||||
text: 'Something else',
|
||||
btnClass: 'btn-blue',
|
||||
keys: ['enter', 'shift'],
|
||||
action: () => {
|
||||
alert('Something else?');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
alert() {
|
||||
$.alert({
|
||||
title: 'Alert!',
|
||||
content: 'Simple alert!',
|
||||
});
|
||||
}
|
||||
|
||||
globalSettings() {
|
||||
jconfirm.defaults = {
|
||||
title: 'Hello',
|
||||
titleClass: '',
|
||||
type: 'default',
|
||||
typeAnimated: true,
|
||||
draggable: true,
|
||||
dragWindowGap: 15,
|
||||
dragWindowBorder: true,
|
||||
animateFromElement: true,
|
||||
smoothContent: true,
|
||||
content: 'Are you sure to continue?',
|
||||
buttons: {},
|
||||
defaultButtons: {
|
||||
ok: {
|
||||
action: () => {
|
||||
}
|
||||
},
|
||||
close: {
|
||||
action: () => {
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
icon: '',
|
||||
lazyOpen: false,
|
||||
bgOpacity: null,
|
||||
theme: 'light',
|
||||
animation: 'scale',
|
||||
closeAnimation: 'scale',
|
||||
animationSpeed: 400,
|
||||
animationBounce: 1,
|
||||
rtl: false,
|
||||
container: 'body',
|
||||
containerFluid: false,
|
||||
backgroundDismiss: false,
|
||||
backgroundDismissAnimation: 'shake',
|
||||
autoClose: false,
|
||||
closeIcon: null,
|
||||
closeIconClass: false,
|
||||
watchInterval: 100,
|
||||
columnClass: 'col-md-4 col-md-offset-4 col-sm-6 col-sm-offset-3 col-xs-10 col-xs-offset-1',
|
||||
boxWidth: '50%',
|
||||
scrollToPreviousElement: true,
|
||||
scrollToPreviousElementAnimate: true,
|
||||
useBootstrap: true,
|
||||
offsetTop: 40,
|
||||
offsetBottom: 40,
|
||||
bootstrapClasses: {
|
||||
container: 'container',
|
||||
containerFluid: 'container-fluid',
|
||||
row: 'row',
|
||||
},
|
||||
onContentReady: () => {},
|
||||
onOpenBefore: () => {},
|
||||
onOpen: () => {},
|
||||
onClose: () => {},
|
||||
onDestroy: () => {},
|
||||
onAction: () => {}
|
||||
};
|
||||
}
|
||||
|
||||
api() {
|
||||
const jc = $.confirm({
|
||||
title: 'awesome',
|
||||
onContentReady: () => {
|
||||
jc.setTitle();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
confirm_84() {
|
||||
$.confirm({
|
||||
closeIcon: true,
|
||||
buttons: {
|
||||
buttonA: {
|
||||
text: 'button a',
|
||||
action: (buttonA: string) => {
|
||||
return false; // prevent the modal from closing
|
||||
}
|
||||
},
|
||||
resetButton: (resetButton: string) => {
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
let firstName = 'Pierre';
|
||||
let lastName = 'Yotti';
|
||||
let type = new Confirm(firstName, lastName);
|
||||
Vendored
+93
@@ -0,0 +1,93 @@
|
||||
// Type definitions for confirmdialog 3.3
|
||||
// Project: https://github.com/allipierre/Type-definitions-for-jquery-confirm/tree/master/types/confirmDialog-js
|
||||
// Definitions by: Alli Pierre Yotti <https://github.com/allipierre>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="jquery"/>
|
||||
|
||||
interface JQueryStatic {
|
||||
/**
|
||||
* confirm Dialog
|
||||
* {confirmOptions} pOtions
|
||||
*/
|
||||
confirm(pOtions: options.confirmOptions | string, title?: string): any;
|
||||
|
||||
/**
|
||||
* confirm alert
|
||||
* {any} pMessage
|
||||
*/
|
||||
alert(pMessage?: any, title?: string): any;
|
||||
|
||||
/**
|
||||
* confirm Dialog
|
||||
* {any} pMessage
|
||||
*/
|
||||
dialog(pOtions: options.confirmOptions | string): any;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
/**
|
||||
* confirm Dialog
|
||||
* {confirmOptions} pOtions
|
||||
*/
|
||||
confirm(pOtions: options.confirmOptions | string, title?: string): any;
|
||||
|
||||
/**
|
||||
* confirm alert
|
||||
* {any} pMessage
|
||||
*/
|
||||
alert(pMessage?: any, title?: string): any;
|
||||
|
||||
/**
|
||||
* confirm Dialog
|
||||
* {any} pMessage
|
||||
*/
|
||||
dialog(pOtions: options.confirmOptions): any;
|
||||
}
|
||||
|
||||
interface Window {
|
||||
setContentAppend: any;
|
||||
}
|
||||
|
||||
declare namespace options {
|
||||
interface confirmOptions {
|
||||
buttons?: any;
|
||||
title?: string | boolean;
|
||||
content?: any;
|
||||
onContentReady?: any;
|
||||
lazyOpen?: boolean;
|
||||
closeIcon?: any;
|
||||
type?: string;
|
||||
typeAnimated?: boolean;
|
||||
icon?: string;
|
||||
closeIconClass?: string;
|
||||
columnClass?: string;
|
||||
containerFluid?: boolean;
|
||||
boxWidth?: string;
|
||||
useBootstrap?: boolean;
|
||||
bootstrapClasses?: any;
|
||||
draggable?: boolean;
|
||||
dragWindowBorder?: boolean;
|
||||
dragWindowGap?: number;
|
||||
contentLoaded?: () => void;
|
||||
autoClose?: string;
|
||||
backgroundDismiss?: any;
|
||||
backgroundDismissAnimation?: string;
|
||||
escapeKey?: string | boolean;
|
||||
onOpenBefore?: () => void;
|
||||
onOpen?: () => void;
|
||||
onClose?: () => void;
|
||||
onDestroy?: () => void;
|
||||
onAction?: () => void;
|
||||
}
|
||||
|
||||
interface buttonOptionss {
|
||||
cancel?: () => void;
|
||||
confirm?: () => void;
|
||||
}
|
||||
}
|
||||
|
||||
declare namespace jconfirm {
|
||||
let defaults: any;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"target": "es6"
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"confirmdialog-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
+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": [
|
||||
"../"
|
||||
|
||||
Vendored
+1
-1
@@ -8,7 +8,7 @@ export as namespace CryptoJS;
|
||||
|
||||
declare var CryptoJS: CryptoJS.Hashes;
|
||||
declare namespace CryptoJS {
|
||||
type Hash = (message: string | LibWordArray, key?: string, ...options: any[]) => WordArray;
|
||||
type Hash = (message: string | LibWordArray, key?: string | WordArray, ...options: any[]) => WordArray;
|
||||
interface Cipher {
|
||||
encrypt(message: string, secretPassphrase: string | WordArray, option?: CipherOption): WordArray;
|
||||
decrypt(encryptedMessage: string | WordArray, secretPassphrase: string | WordArray, option?: CipherOption): DecryptedMessage;
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
import defer = require('defer-promise');
|
||||
|
||||
// $ExpectType Deferred<number>
|
||||
const a = defer<number>();
|
||||
// $ExpectType void
|
||||
a.resolve(5);
|
||||
// $ExpectError
|
||||
a.resolve('foo');
|
||||
// $ExpectError
|
||||
a.resolve();
|
||||
|
||||
// $ExpectType Deferred<void>
|
||||
const b = defer<void>();
|
||||
// $ExpectType void
|
||||
b.resolve();
|
||||
// $ExpectError
|
||||
b.resolve(5);
|
||||
|
||||
const c: DeferPromise.Deferred<string> = defer();
|
||||
// $ExpectType void
|
||||
c.resolve('foo');
|
||||
// $ExpectType Promise<string>
|
||||
c.promise;
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
// Type definitions for defer-promise 1.0
|
||||
// Project: https://github.com/75lb/defer-promise#readme
|
||||
// Definitions by: Niklas Fiekas <https://github.com/niklasf>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
// tslint:disable-next-line no-unnecessary-generics
|
||||
declare function defer<T>(): DeferPromise.Deferred<T>;
|
||||
|
||||
export = defer;
|
||||
|
||||
declare global {
|
||||
namespace DeferPromise {
|
||||
interface Deferred<T> {
|
||||
promise: Promise<T>;
|
||||
resolve(value: T | PromiseLike<T>): void;
|
||||
resolve(this: Deferred<void>): void;
|
||||
reject(reason?: any): void;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5",
|
||||
"es2015.Promise"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"defer-promise-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,24 @@
|
||||
import * as Deque from 'double-ended-queue';
|
||||
|
||||
const a = new Deque<number>(); // $ExpectType Deque<number>
|
||||
const b = new Deque<string>(6); // $ExpectType Deque<string>
|
||||
const c = new Deque<string>([1, 2, 3]); // $ExpectError
|
||||
const d = new Deque<number>([1, 2, 3]); // $ExpectType Deque<number>
|
||||
|
||||
a.length; // $ExpectType number
|
||||
a.push("foo"); // $ExpectError
|
||||
a.push(4, 5); // $ExpectType number
|
||||
a.unshift("foo"); // $ExpectError
|
||||
a.unshift(4, 5); // $ExpectType number
|
||||
a.pop(); // $ExpectType number | undefined
|
||||
a.pop(2); // $ExpectError
|
||||
a.shift(); // $ExpectType number | undefined
|
||||
a.peekBack(); // $ExpectType number | undefined
|
||||
a.peekFront(); // $ExpectType number | undefined
|
||||
a.toArray(); // $ExpectType number[]
|
||||
a.get(); // $ExpectError
|
||||
a.get(null); // $ExpectError
|
||||
a.get(1); // $ExpectType number | undefined
|
||||
b.get(-1); // $ExpectType string | undefined
|
||||
b.clear(); // $ExpectType void
|
||||
b.isEmpty(); // $ExpectType boolean
|
||||
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
// Type definitions for double-ended-queue 2.1
|
||||
// Project: https://github.com/petkaantonov/deque
|
||||
// Definitions by: Dmitry <https://github.com/dsagal>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface Deque<T> {
|
||||
readonly length: number;
|
||||
push(...items: T[]): number;
|
||||
unshift(...items: T[]): number;
|
||||
pop(): T|undefined;
|
||||
shift(): T|undefined;
|
||||
toArray(): T[];
|
||||
peekBack(): T|undefined;
|
||||
peekFront(): T|undefined;
|
||||
get(index: number): T|undefined;
|
||||
isEmpty(): boolean;
|
||||
clear(): void;
|
||||
}
|
||||
|
||||
declare const Deque: {
|
||||
prototype: Deque<any>;
|
||||
new <T>(items?: ReadonlyArray<T>): Deque<T>;
|
||||
new <T>(capacity: number): Deque<T>; // tslint:disable-line:no-unnecessary-generics
|
||||
};
|
||||
|
||||
export = Deque;
|
||||
@@ -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",
|
||||
"double-ended-queue-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+3
-3
@@ -746,7 +746,7 @@ declare namespace Draft {
|
||||
}
|
||||
|
||||
class ContentState extends Record {
|
||||
static createFromBlockArray(blocks: Array<ContentBlock>, entityMap: any): ContentState;
|
||||
static createFromBlockArray(blocks: Array<ContentBlock>, entityMap?: any): ContentState;
|
||||
static createFromText(text: string, delimiter?: string): ContentState;
|
||||
|
||||
createEntity(type: DraftEntityType, mutability: DraftEntityMutability, data?: Object): ContentState;
|
||||
@@ -797,7 +797,7 @@ declare namespace Draft {
|
||||
class CharacterMetadata {
|
||||
static applyStyle(record: CharacterMetadata, style: string): CharacterMetadata;
|
||||
static removeStyle(record: CharacterMetadata, style: string): CharacterMetadata;
|
||||
static applyEntity(record: CharacterMetadata, entityKey: string): CharacterMetadata;
|
||||
static applyEntity(record: CharacterMetadata, entityKey: string | null): CharacterMetadata;
|
||||
static applyEntity(record: CharacterMetadata): CharacterMetadata;
|
||||
/**
|
||||
* Use this function instead of the `CharacterMetadata` constructor.
|
||||
@@ -894,7 +894,7 @@ declare namespace Draft {
|
||||
|
||||
static setBlockData(contentState: ContentState, selectionState: SelectionState, blockData: Immutable.Map<any, any>): ContentState;
|
||||
static mergeBlockData(contentState: ContentState, selectionState: SelectionState, blockData: Immutable.Map<any, any>): ContentState;
|
||||
static applyEntity(contentState: ContentState, selectionState: SelectionState, entityKey: string): ContentState;
|
||||
static applyEntity(contentState: ContentState, selectionState: SelectionState, entityKey: string | null): ContentState;
|
||||
}
|
||||
|
||||
class RichTextEditorUtil {
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
|
||||
jss.set('.demo', {
|
||||
'font-size': '15px',
|
||||
'color': 'red'
|
||||
});
|
||||
|
||||
jss.get('.demo');
|
||||
|
||||
jss.get();
|
||||
|
||||
jss.getAll('.demo');
|
||||
|
||||
jss.remove('.demo');
|
||||
|
||||
jss.remove();
|
||||
Vendored
+50
@@ -0,0 +1,50 @@
|
||||
// Type definitions for jss v0.6
|
||||
// Project: https://github.com/Box9/jss
|
||||
// Definitions by: Valentin Robert <https://github.com/Ptival>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface Properties {
|
||||
[name: string]: string;
|
||||
}
|
||||
|
||||
interface Selectors {
|
||||
[selector: string]: Properties;
|
||||
}
|
||||
|
||||
interface JSS {
|
||||
/**
|
||||
* Retrieve all rules added via JSS, organized by selectors
|
||||
*/
|
||||
get(): Selectors;
|
||||
|
||||
/**
|
||||
* Retrieve rules added via JSS for a given selector
|
||||
* @param s CSS selector
|
||||
*/
|
||||
get(s: string): Properties;
|
||||
|
||||
/**
|
||||
* Retrieve all rules specified for a given selector (not necessarily added via JSS)
|
||||
* @param s CSS selector
|
||||
*/
|
||||
getAll(s: string): Properties;
|
||||
|
||||
/**
|
||||
* Remove all rules added via JSS
|
||||
*/
|
||||
remove(): void;
|
||||
|
||||
/**
|
||||
* Remove all rules added via JSS for the given selector
|
||||
*/
|
||||
remove(s: string): void;
|
||||
|
||||
/**
|
||||
* Add or extend an existing rule
|
||||
* @param s CSS selector
|
||||
* @param p CSS properties
|
||||
*/
|
||||
set(s: string, p: Properties): void;
|
||||
}
|
||||
|
||||
declare var jss: JSS;
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"dvtng-jss-tests.ts"
|
||||
]
|
||||
}
|
||||
+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" }
|
||||
|
||||
Vendored
+2
@@ -137,6 +137,7 @@ export interface ShardsResponse {
|
||||
total: number;
|
||||
successful: number;
|
||||
failed: number;
|
||||
skipped: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -638,6 +639,7 @@ export interface SearchResponse<T> {
|
||||
fields?: any;
|
||||
highlight?: any;
|
||||
inner_hits?: any;
|
||||
sort?: string[];
|
||||
}>;
|
||||
};
|
||||
aggregations?: any;
|
||||
|
||||
@@ -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" }
|
||||
@@ -0,0 +1,187 @@
|
||||
import {
|
||||
describeComponent, describeModel, describeModule,
|
||||
setResolver, setupAcceptanceTest, setupComponentTest,
|
||||
setupModelTest, setupTest
|
||||
} from 'ember-mocha';
|
||||
import { describe, it, beforeEach, afterEach, before, after } from 'mocha';
|
||||
import chai = require('chai');
|
||||
import Ember from "ember";
|
||||
import hbs from 'htmlbars-inline-precompile';
|
||||
|
||||
describeModule('name', function() {
|
||||
beforeEach(function() {
|
||||
});
|
||||
|
||||
it('test', function() {
|
||||
});
|
||||
});
|
||||
|
||||
describeModule('name', 'description', function() {
|
||||
it('test', function() {
|
||||
});
|
||||
});
|
||||
|
||||
describeModule(
|
||||
'name',
|
||||
'description',
|
||||
{
|
||||
needs: ['service:notifications']
|
||||
},
|
||||
function() {
|
||||
}
|
||||
);
|
||||
|
||||
describeModule('component:x-foo', 'TestModule callbacks', {
|
||||
needs: [],
|
||||
|
||||
beforeSetup() {
|
||||
},
|
||||
setup() {
|
||||
},
|
||||
teardown() {
|
||||
},
|
||||
afterTeardown() {
|
||||
}
|
||||
}, function() {
|
||||
});
|
||||
|
||||
describeComponent('x-foo', {
|
||||
integration: true
|
||||
}, function() {
|
||||
});
|
||||
|
||||
describeComponent('x-foo', {
|
||||
unit: true,
|
||||
needs: ['helper:pluralize-string']
|
||||
}, function() {
|
||||
});
|
||||
|
||||
describeComponent.skip(
|
||||
'block-slot',
|
||||
'Integration: BlockSlotComponent',
|
||||
{
|
||||
integration: true
|
||||
},
|
||||
function() {
|
||||
}
|
||||
);
|
||||
|
||||
describeModel('user', {
|
||||
needs: ['model:child']
|
||||
}, function() {
|
||||
});
|
||||
|
||||
describeModule('component:x-foo', 'TestModule callbacks', function() {
|
||||
before(function() {
|
||||
class I18n extends Ember.Object {}
|
||||
|
||||
this.skip();
|
||||
this.timeout(1000);
|
||||
this.registry.register('helper:i18n', I18n);
|
||||
this.registry.register('helper:i18n', I18n, { singleton: true });
|
||||
this.register('service:i18n', {});
|
||||
this.inject.service('i18n');
|
||||
this.inject.service('i18n', { as: 'i18n' });
|
||||
this.factory('object:user').create();
|
||||
});
|
||||
|
||||
after(function() {
|
||||
});
|
||||
|
||||
beforeEach(function() {
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe('setupTest', function() {
|
||||
setupTest();
|
||||
|
||||
setupTest('service:ajax');
|
||||
|
||||
setupTest('service:ajax', {
|
||||
unit: true
|
||||
});
|
||||
|
||||
setupTest('controller:sidebar', {
|
||||
// Specify the other units that are required for this test.
|
||||
// needs: ['controller:foo']
|
||||
});
|
||||
|
||||
setupComponentTest('gravatar-image', {
|
||||
// specify the other units that are required for this test
|
||||
// needs: ['component:foo', 'helper:bar']
|
||||
});
|
||||
|
||||
setupModelTest('contact', {
|
||||
// Specify the other units that are required for this test.
|
||||
needs: []
|
||||
});
|
||||
|
||||
const Application = Ember.Application.extend();
|
||||
|
||||
setupAcceptanceTest({ Application });
|
||||
|
||||
it('test', function() {
|
||||
});
|
||||
});
|
||||
|
||||
// if you don't have a custom resolver, do it like this:
|
||||
setResolver(Ember.DefaultResolver.create());
|
||||
|
||||
it('renders', function() {
|
||||
// setup the outer context
|
||||
this.set('value', 'cat');
|
||||
this.on('action', function(result) {
|
||||
chai.expect(result).to.equal('bar', 'The correct result was returned');
|
||||
chai.expect(this.get('value')).to.equal('cat');
|
||||
});
|
||||
|
||||
// render the component
|
||||
this.render(hbs`
|
||||
{{ x-foo value=value action="result" }}
|
||||
`);
|
||||
this.render('{{ x-foo value=value action="result" }}');
|
||||
this.render([
|
||||
'{{ x-foo value=value action="result" }}'
|
||||
]);
|
||||
|
||||
chai.expect(this.$('div>.value').text()).to.equal('cat', 'The component shows the correct value');
|
||||
|
||||
this.$('button').click();
|
||||
});
|
||||
|
||||
it('renders', function() {
|
||||
// creates the component instance
|
||||
const subject = this.subject();
|
||||
|
||||
const subject2 = this.subject({
|
||||
item: 42
|
||||
});
|
||||
|
||||
const { inputFormat } = this.setProperties({
|
||||
inputFormat: 'M/D/YY',
|
||||
outputFormat: 'MMMM D, YYYY',
|
||||
date: '5/3/10'
|
||||
});
|
||||
|
||||
const { inputFormat: if2, outputFormat } = this.getProperties('inputFormat', 'outputFormat');
|
||||
|
||||
const inputFormat2 = this.get('inputFormat');
|
||||
|
||||
// render the component on the page
|
||||
this.render();
|
||||
chai.expect(this.$('.foo').text()).to.equal('bar');
|
||||
});
|
||||
|
||||
it('can calculate the result', function(assert) {
|
||||
const subject = this.subject();
|
||||
|
||||
subject.set('value', 'foo');
|
||||
chai.assert.equal(subject.get('result'), 'bar');
|
||||
});
|
||||
|
||||
it.skip('disabled test');
|
||||
|
||||
it.skip('disabled test', function() { });
|
||||
Vendored
+77
@@ -0,0 +1,77 @@
|
||||
// Type definitions for ember-mocha 0.12
|
||||
// Project: https://github.com/emberjs/ember-mocha#readme
|
||||
// Definitions by: Derek Wickern <https://github.com/dwickern>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
import { TestContext, ModuleCallbacks } from "ember-test-helpers";
|
||||
import Ember from 'ember';
|
||||
import { it as mochaIt, ISuiteCallbackContext } from 'mocha';
|
||||
|
||||
// these globals are re-exported as named exports by ember-mocha
|
||||
type mochaBefore = typeof before;
|
||||
type mochaAfter = typeof after;
|
||||
type mochaBeforeEach = typeof beforeEach;
|
||||
type mochaAfterEach = typeof afterEach;
|
||||
type mochaSetup = typeof setup;
|
||||
type mochaTeardown = typeof teardown;
|
||||
type mochaSuiteSetup = typeof suiteSetup;
|
||||
type mochaSuiteTeardown = typeof suiteTeardown;
|
||||
|
||||
declare module 'ember-mocha' {
|
||||
interface ContextDefinitionFunction {
|
||||
(name: string, description: string, callbacks: ModuleCallbacks, tests: (this: ISuiteCallbackContext) => void): void;
|
||||
(name: string, description: string, tests: (this: ISuiteCallbackContext) => void): void;
|
||||
(name: string, callbacks: ModuleCallbacks, tests: (this: ISuiteCallbackContext) => void): void;
|
||||
(name: string, tests: (this: ISuiteCallbackContext) => void): void;
|
||||
}
|
||||
|
||||
interface ContextDefinition extends ContextDefinitionFunction {
|
||||
only: ContextDefinitionFunction;
|
||||
skip: ContextDefinitionFunction;
|
||||
}
|
||||
|
||||
interface SetupTest {
|
||||
(name?: string, callbacks?: ModuleCallbacks): void;
|
||||
(callbacks: ModuleCallbacks): void;
|
||||
}
|
||||
|
||||
/** @deprecated Use setupTest instead */
|
||||
export const describeModule: ContextDefinition;
|
||||
|
||||
/** @deprecated Use setupComponentTest instead */
|
||||
export const describeComponent: ContextDefinition;
|
||||
|
||||
/** @deprecated Use setupModelTest instead */
|
||||
export const describeModel: ContextDefinition;
|
||||
|
||||
export const setupTest: SetupTest;
|
||||
export const setupAcceptanceTest: SetupTest;
|
||||
export const setupComponentTest: SetupTest;
|
||||
export const setupModelTest: SetupTest;
|
||||
|
||||
export const it: typeof mochaIt;
|
||||
|
||||
/**
|
||||
* Sets a Resolver globally which will be used to look up objects from each test's container.
|
||||
*/
|
||||
export function setResolver(resolver: Ember.Resolver): void;
|
||||
}
|
||||
|
||||
declare module 'mocha' {
|
||||
// augment test callback context
|
||||
interface ITestCallbackContext extends TestContext {}
|
||||
interface IHookCallbackContext extends TestContext {}
|
||||
|
||||
// re-export mocha globals as named exports
|
||||
export const describe: Mocha.IContextDefinition;
|
||||
export const it: Mocha.ITestDefinition;
|
||||
export const setup: mochaSetup;
|
||||
export const teardown: mochaTeardown;
|
||||
export const suiteSetup: mochaSuiteSetup;
|
||||
export const suiteTeardown: mochaSuiteTeardown;
|
||||
export const before: mochaBefore;
|
||||
export const after: mochaAfter;
|
||||
export const beforeEach: mochaBeforeEach;
|
||||
export const afterEach: mochaAfterEach;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ember-mocha-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"only-arrow-functions": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"no-duplicate-imports": false,
|
||||
"unified-signatures": false,
|
||||
"no-declare-current-package": false,
|
||||
|
||||
// ERROR: An interface declaring no members is equivalent to its supertype.
|
||||
// -- Not true when augmenting an interface
|
||||
"no-empty-interface": false,
|
||||
|
||||
// ERROR: interface name must not have an "I" prefix
|
||||
// -- Augmenting @types/mocha which uses "I" prefix
|
||||
"interface-name": false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
import Ember from 'ember';
|
||||
import hbs from 'htmlbars-inline-precompile';
|
||||
import { test, skip, moduleFor, moduleForModel, moduleForComponent, setResolver } from 'ember-qunit';
|
||||
|
||||
moduleForComponent('x-foo', {
|
||||
integration: true
|
||||
});
|
||||
|
||||
moduleForComponent('x-foo', {
|
||||
unit: true,
|
||||
needs: ['helper:pluralize-string']
|
||||
});
|
||||
|
||||
moduleForModel('user', {
|
||||
needs: ['model:child']
|
||||
});
|
||||
|
||||
moduleFor('controller:home');
|
||||
|
||||
moduleFor('component:x-foo', 'Some description');
|
||||
|
||||
moduleFor('component:x-foo', 'TestModule callbacks', {
|
||||
beforeSetup() {
|
||||
},
|
||||
|
||||
beforeEach(assert) {
|
||||
this.registry.register('helper:i18n', {});
|
||||
this.register('service:i18n', {});
|
||||
this.inject.service('i18n');
|
||||
this.inject.service('i18n', { as: 'i18n' });
|
||||
this.factory('object:user').create();
|
||||
assert.ok(true);
|
||||
},
|
||||
|
||||
afterEach(assert) {
|
||||
assert.ok(true);
|
||||
},
|
||||
|
||||
afterTeardown(assert) {
|
||||
assert.ok(true);
|
||||
}
|
||||
});
|
||||
|
||||
// if you don't have a custom resolver, do it like this:
|
||||
setResolver(Ember.DefaultResolver.create());
|
||||
|
||||
test('it renders', function(assert) {
|
||||
assert.expect(2);
|
||||
|
||||
// setup the outer context
|
||||
this.set('value', 'cat');
|
||||
this.on('action', function(result) {
|
||||
assert.equal(result, 'bar', 'The correct result was returned');
|
||||
assert.equal(this.get('value'), 'cat');
|
||||
});
|
||||
|
||||
// render the component
|
||||
this.render(hbs`
|
||||
{{ x-foo value=value action="result" }}
|
||||
`);
|
||||
this.render('{{ x-foo value=value action="result" }}');
|
||||
this.render([
|
||||
'{{ x-foo value=value action="result" }}'
|
||||
]);
|
||||
|
||||
assert.equal(this.$('div>.value').text(), 'cat', 'The component shows the correct value');
|
||||
|
||||
this.$('button').click();
|
||||
});
|
||||
|
||||
test('it renders', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
// creates the component instance
|
||||
const subject = this.subject();
|
||||
|
||||
const subject2 = this.subject({
|
||||
item: 42
|
||||
});
|
||||
|
||||
const { inputFormat } = this.setProperties({
|
||||
inputFormat: 'M/D/YY',
|
||||
outputFormat: 'MMMM D, YYYY',
|
||||
date: '5/3/10'
|
||||
});
|
||||
|
||||
const { inputFormat: if2, outputFormat } = this.getProperties('inputFormat', 'outputFormat');
|
||||
|
||||
const inputFormat2 = this.get('inputFormat');
|
||||
|
||||
// render the component on the page
|
||||
this.render();
|
||||
assert.equal(this.$('.foo').text(), 'bar');
|
||||
});
|
||||
|
||||
test('It can calculate the result', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
const subject = this.subject();
|
||||
|
||||
subject.set('value', 'foo');
|
||||
assert.equal(subject.get('result'), 'bar');
|
||||
});
|
||||
|
||||
skip('disabled test');
|
||||
|
||||
skip('disabled test', function(assert) { });
|
||||
Vendored
+118
@@ -0,0 +1,118 @@
|
||||
// Type definitions for ember-qunit 2.2
|
||||
// Project: https://github.com/emberjs/ember-qunit#readme
|
||||
// Definitions by: Derek Wickern <https://github.com/dwickern>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
/// <reference types="qunit" />
|
||||
|
||||
declare module 'ember-qunit' {
|
||||
import Ember from 'ember';
|
||||
import { ModuleCallbacks } from "ember-test-helpers";
|
||||
|
||||
interface QUnitModuleCallbacks extends ModuleCallbacks, Hooks {
|
||||
beforeSetup?(assert: Assert): void;
|
||||
setup?(assert: Assert): void;
|
||||
teardown?(assert: Assert): void;
|
||||
afterTeardown?(assert: Assert): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param fullName The full name of the unit, ie controller:application, route:index.
|
||||
* @param description The description of the module
|
||||
*/
|
||||
export function moduleFor(fullName: string, description: string, callbacks?: QUnitModuleCallbacks): void;
|
||||
export function moduleFor(fullName: string, callbacks?: QUnitModuleCallbacks): void;
|
||||
|
||||
/**
|
||||
* @param fullName the short name of the component that you'd use in a template, ie x-foo, ic-tabs, etc.
|
||||
* @param description The description of the module
|
||||
*/
|
||||
export function moduleForComponent(fullName: string, description: string, callbacks?: QUnitModuleCallbacks): void;
|
||||
export function moduleForComponent(fullName: string, callbacks?: QUnitModuleCallbacks): void;
|
||||
|
||||
/**
|
||||
* @param fullName the short name of the model you'd use in store operations ie user, assignmentGroup, etc.
|
||||
* @param description The description of the module
|
||||
*/
|
||||
export function moduleForModel(fullName: string, description: string, callbacks?: QUnitModuleCallbacks): void;
|
||||
export function moduleForModel(fullName: string, callbacks?: QUnitModuleCallbacks): void;
|
||||
|
||||
/**
|
||||
* Sets a Resolver globally which will be used to look up objects from each test's container.
|
||||
*/
|
||||
export function setResolver(resolver: Ember.Resolver): void;
|
||||
|
||||
export class QUnitAdapter extends Ember.Test.Adapter {}
|
||||
|
||||
export { module, test, skip, only, todo } from 'qunit';
|
||||
}
|
||||
|
||||
declare module 'qunit' {
|
||||
import { TestContext } from "ember-test-helpers";
|
||||
|
||||
export const module: typeof QUnit.module;
|
||||
|
||||
/**
|
||||
* Add a test to run.
|
||||
*
|
||||
* Add a test to run using `QUnit.test()`.
|
||||
*
|
||||
* The `assert` argument to the callback contains all of QUnit's assertion
|
||||
* methods. Use this argument to call your test assertions.
|
||||
*
|
||||
* `QUnit.test()` can automatically handle the asynchronous resolution of a
|
||||
* Promise on your behalf if you return a thenable Promise as the result of
|
||||
* your callback function.
|
||||
*
|
||||
* @param name Title of unit being tested
|
||||
* @param callback Function to close over assertions
|
||||
*/
|
||||
export function test(name: string, callback: (this: TestContext, assert: Assert) => void): void;
|
||||
|
||||
/**
|
||||
* Adds a test to exclusively run, preventing all other tests from running.
|
||||
*
|
||||
* Use this method to focus your test suite on a specific test. QUnit.only
|
||||
* will cause any other tests in your suite to be ignored.
|
||||
*
|
||||
* Note, that if more than one QUnit.only is present only the first instance
|
||||
* will run.
|
||||
*
|
||||
* This is an alternative to filtering tests to run in the HTML reporter. It
|
||||
* is especially useful when you use a console reporter or in a codebase
|
||||
* with a large set of long running tests.
|
||||
*
|
||||
* @param name Title of unit being tested
|
||||
* @param callback Function to close over assertions
|
||||
*/
|
||||
export function only(name: string, callback: (this: TestContext, assert: Assert) => void): void;
|
||||
|
||||
/**
|
||||
* Use this method to test a unit of code which is still under development (in a “todo” state).
|
||||
* The test will pass as long as one failing assertion is present.
|
||||
*
|
||||
* If all assertions pass, then the test will fail signaling that `QUnit.todo` should
|
||||
* be replaced by `QUnit.test`.
|
||||
*
|
||||
* @param name Title of unit being tested
|
||||
* @param callback Function to close over assertions
|
||||
*/
|
||||
export function todo(name: string, callback: (this: TestContext, assert: Assert) => void): void;
|
||||
|
||||
/**
|
||||
* Adds a test like object to be skipped.
|
||||
*
|
||||
* Use this method to replace QUnit.test() instead of commenting out entire
|
||||
* tests.
|
||||
*
|
||||
* This test's prototype will be listed on the suite as a skipped test,
|
||||
* ignoring the callback argument and the respective global and module's
|
||||
* hooks.
|
||||
*
|
||||
* @param Title of unit being tested
|
||||
*/
|
||||
export const skip: typeof QUnit.skip;
|
||||
|
||||
export default QUnit;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ember-qunit-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"only-arrow-functions": false,
|
||||
"strict-export-declare-modifiers": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-declare-current-package": false
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
/// <reference types="qunit" />
|
||||
import { ModuleCallbacks, TestModule } from "ember-test-helpers";
|
||||
import wait from 'ember-test-helpers/wait';
|
||||
import hasEmberVersion from 'ember-test-helpers/has-ember-version';
|
||||
|
||||
function moduleFor(name: string, description: string, callbacks: ModuleCallbacks) {
|
||||
const module = new TestModule(name, description, callbacks);
|
||||
|
||||
QUnit.module(module.name, {
|
||||
beforeEach() {
|
||||
module.setup();
|
||||
},
|
||||
afterEach() {
|
||||
module.teardown();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function testWait() {
|
||||
await wait();
|
||||
}
|
||||
|
||||
if (hasEmberVersion(2, 10)) {
|
||||
// ...
|
||||
}
|
||||
Vendored
+95
@@ -0,0 +1,95 @@
|
||||
// Type definitions for ember-test-helpers 0.6
|
||||
// Project: https://github.com/emberjs/ember-test-helpers#readme
|
||||
// Definitions by: Derek Wickern <https://github.com/dwickern>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
/// <reference types="jquery" />
|
||||
|
||||
declare module 'ember-test-helpers' {
|
||||
import Ember from 'ember';
|
||||
import DS from 'ember-data';
|
||||
import { TemplateFactory } from 'htmlbars-inline-precompile';
|
||||
import RSVP from "rsvp";
|
||||
|
||||
interface ModuleCallbacks {
|
||||
integration?: boolean;
|
||||
unit?: boolean;
|
||||
needs?: string[];
|
||||
|
||||
beforeSetup?(assert?: any): void;
|
||||
setup?(assert?: any): void;
|
||||
teardown?(assert?: any): void;
|
||||
afterTeardown?(assert?: any): void;
|
||||
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
interface TestContext {
|
||||
get(key: string): any;
|
||||
getProperties<K extends string>(...keys: K[]): Pick<any, K>;
|
||||
set<V>(key: string, value: V): V;
|
||||
setProperties<P extends { [key: string]: any }>(hash: P): P;
|
||||
on(actionName: string, handler: (this: TestContext, ...args: any[]) => any): void;
|
||||
send(actionName: string): void;
|
||||
$: JQueryStatic;
|
||||
subject(options?: {}): any;
|
||||
render(template?: string | string[] | TemplateFactory): void;
|
||||
clearRender(): void;
|
||||
registry: Ember.Registry;
|
||||
container: Ember.Container;
|
||||
dispatcher: Ember.EventDispatcher;
|
||||
application: Ember.Application;
|
||||
store: DS.Store;
|
||||
register(fullName: string, factory: any): void;
|
||||
factory(fullName: string): any;
|
||||
inject: {
|
||||
controller(name: string, options?: { as: string }): any;
|
||||
service(name: string, options?: { as: string }): any;
|
||||
};
|
||||
}
|
||||
|
||||
class TestModule {
|
||||
constructor(name: string, callbacks?: ModuleCallbacks);
|
||||
constructor(name: string, description?: string, callbacks?: ModuleCallbacks);
|
||||
|
||||
name: string;
|
||||
subjectName: string;
|
||||
description: string;
|
||||
isIntegration: boolean;
|
||||
callbacks: ModuleCallbacks;
|
||||
context: TestContext;
|
||||
resolver: Ember.Resolver;
|
||||
|
||||
setup(assert?: any): RSVP.Promise<void>;
|
||||
teardown(assert?: any): RSVP.Promise<void>;
|
||||
getContext(): TestContext;
|
||||
setContext(context: TestContext): void;
|
||||
}
|
||||
|
||||
class TestModuleForAcceptance extends TestModule {}
|
||||
class TestModuleForIntegration extends TestModule {}
|
||||
class TestModuleForComponent extends TestModule {}
|
||||
class TestModuleForModel extends TestModule {}
|
||||
|
||||
function getContext(): TestContext | undefined;
|
||||
function setContext(context: TestContext): void;
|
||||
function unsetContext(): void;
|
||||
function setResolver(resolver: Ember.Resolver): void;
|
||||
}
|
||||
|
||||
declare module 'ember-test-helpers/wait' {
|
||||
import RSVP from "rsvp";
|
||||
|
||||
interface WaitOptions {
|
||||
waitForTimers?: boolean;
|
||||
waitForAJAX?: boolean;
|
||||
waitForWaiters?: boolean;
|
||||
}
|
||||
|
||||
export default function wait(options?: WaitOptions): RSVP.Promise<void>;
|
||||
}
|
||||
|
||||
declare module 'ember-test-helpers/has-ember-version' {
|
||||
export default function hasEmberVersion(major: number, minor: number): boolean;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ember-test-helpers-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"strict-export-declare-modifiers": false,
|
||||
"no-duplicate-imports": false,
|
||||
"no-declare-current-package": false
|
||||
}
|
||||
}
|
||||
Vendored
+10
-2
@@ -300,7 +300,7 @@ declare module 'ember' {
|
||||
/**
|
||||
* Given a fullName return a corresponding instance.
|
||||
*/
|
||||
lookup(fullName: string, options: {}): any;
|
||||
lookup(fullName: string, options?: {}): any;
|
||||
}
|
||||
const _ContainerProxyMixin: Mixin<_ContainerProxyMixin>;
|
||||
|
||||
@@ -2097,7 +2097,15 @@ declare module 'ember' {
|
||||
options?: { path?: string; resetNamespace?: boolean },
|
||||
callback?: (this: RouterDSL) => void
|
||||
): void;
|
||||
mount(name: string): void;
|
||||
mount(
|
||||
name: string,
|
||||
options?: {
|
||||
as?: string,
|
||||
path?: string,
|
||||
resetNamespace?: boolean,
|
||||
engineInfo?: any
|
||||
}
|
||||
): void;
|
||||
}
|
||||
class Service extends Object {}
|
||||
/**
|
||||
|
||||
@@ -20,4 +20,5 @@ AppRouter.map(function() {
|
||||
});
|
||||
this.route('not-found', { path: '/*path' });
|
||||
this.mount('my-engine');
|
||||
this.mount('my-engine', { as: 'some-other-engine', path: '/some-other-engine'});
|
||||
});
|
||||
|
||||
Vendored
+3
-12
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/atom/event-kit
|
||||
// Definitions by: GlenCFL <https://github.com/GlenCFL>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
export interface DisposableLike {
|
||||
dispose(): void;
|
||||
@@ -64,21 +64,12 @@ export class CompositeDisposable implements DisposableLike {
|
||||
clear(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows you to strongly type event emissions across your codebase. Additional
|
||||
* key:value pairings merged into this interface will result in emissions under
|
||||
* the value of each key being templated by the type of the associated value.
|
||||
*/
|
||||
export interface Emissions {
|
||||
// tslint:disable-next-line:no-any
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility class to be used when implementing event-based APIs that allows
|
||||
* for handlers registered via ::on to be invoked with calls to ::emit.
|
||||
*/
|
||||
export class Emitter implements DisposableLike {
|
||||
// tslint:disable-next-line:no-any
|
||||
export class Emitter<Emissions = { [key: string]: any }> implements DisposableLike {
|
||||
disposed: boolean;
|
||||
|
||||
/** Construct an emitter. */
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
browser.nonexistentNS; // $ExpectError
|
||||
browser.nonexistentNS.unknownMethod(); // $ExpectError
|
||||
|
||||
// Test that out overwritten things at least worked
|
||||
browser.runtime.getManifest(); // $ExpectType WebExtensionManifest
|
||||
browser.test; // $ExpectError
|
||||
browser.manifest; // $ExpectError
|
||||
browser._manifest; // $ExpectType typeof _manifest
|
||||
browser._manifest.WebExtensionLangpackManifest; // $ExpectError
|
||||
browser._manifest.NativeManifest; // $ExpectError
|
||||
+3148
File diff suppressed because it is too large
Load Diff
@@ -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",
|
||||
"firefox-webext-browser-tests.ts"
|
||||
]
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user