diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index f9324d1bdd..9084f165aa 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -2645,8 +2645,8 @@
/types/node/v4/ @eps1lon
/types/node/v6/ @WilcoBakker @inlined @eps1lon @Alorel
/types/node/v7/ @parambirs @tellnes @WilcoBakker @eps1lon
-/types/node/v8/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @OliverJAsh @eps1lon @Hannes-Magnusson-CK @jkomyno @hoo29 @n-e
-/types/node/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @OliverJAsh @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 @n-e
+/types/node/v8/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @hoo29 @n-e
+/types/node/ @parambirs @tellnes @WilcoBakker @octo-sniffle @smac89 @Flarna @mwiktorczyk @wwwy3y3 @DeividasBakanas @kjin @alvis @eps1lon @Hannes-Magnusson-CK @jkomyno @ajafff @hoo29 @n-e
/types/node-7z/ @erkie
/types/node-array-ext/ @Beng89
/types/node-cache/ @chrootsu @dthunell @useltmann
diff --git a/README.md b/README.md
index 554316e52a..8e582f05b4 100644
--- a/README.md
+++ b/README.md
@@ -121,7 +121,7 @@ Your package should have this structure:
| tsconfig.json | This allows you to run `tsc` within the package. |
| tslint.json | Enables linting. |
-Generate these by running `npm install -g dts-gen` and `dts-gen --dt --name my-package-name --template module`.
+Generate these by running `npx dts-gen --dt --name my-package-name --template module` if you have npm ≥ 5.2.0, `npm install -g dts-gen` and `dts-gen --dt --name my-package-name --template module` otherwise.
See all options at [dts-gen](https://github.com/Microsoft/dts-gen).
You may edit the `tsconfig.json` to add new files, to add `"target": "es6"` (needed for async functions), to add to `"lib"`, or to add the `"jsx"` compiler option.
diff --git a/package.json b/package.json
index 37d1f4d48b..c5b1b03057 100644
--- a/package.json
+++ b/package.json
@@ -1,27 +1,27 @@
{
- "private": true,
- "name": "definitely-typed",
- "version": "0.0.2",
- "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git"
- },
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
- },
- "engines": {
- "node": ">=7.8.0"
- },
- "scripts": {
- "compile-scripts": "tsc -p scripts",
- "not-needed": "node scripts/not-needed.js",
- "test": "node node_modules/types-publisher/bin/tester/test.js --run-from-definitely-typed",
- "lint": "dtslint types"
- },
- "devDependencies": {
- "dtslint": "github:Microsoft/dtslint#production",
- "types-publisher": "Microsoft/types-publisher#production"
- }
+ "private": true,
+ "name": "definitely-typed",
+ "version": "0.0.2",
+ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git"
+ },
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
+ },
+ "engines": {
+ "node": ">=7.8.0"
+ },
+ "scripts": {
+ "compile-scripts": "tsc -p scripts",
+ "not-needed": "node scripts/not-needed.js",
+ "test": "node node_modules/types-publisher/bin/tester/test.js --run-from-definitely-typed",
+ "lint": "dtslint types"
+ },
+ "devDependencies": {
+ "dtslint": "github:Microsoft/dtslint#production",
+ "types-publisher": "Microsoft/types-publisher#production"
+ }
}
diff --git a/types/activex-access/index.d.ts b/types/activex-access/index.d.ts
index 2529538cad..4c531ea3ce 100644
--- a/types/activex-access/index.d.ts
+++ b/types/activex-access/index.d.ts
@@ -4,6 +4,7 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6
+///
///
///
///
@@ -8882,7 +8883,6 @@ interface ActiveXObject {
Access.OptionButton | Access.OptionGroup | Access.Page | Access.SubForm | Access.TabControl | Access.TextBox | Access.ToggleButton | Access.WebBrowserControl,
propertyName: 'accName' | 'accValue', parameterTypes: [any], newValue: string): void;
set(obj: Access._ControlInReportEvents | Access.ComboBox | Access.Control | Access.ListBox, propertyName: 'Selected', parameterTypes: [number], newValue: number): void;
- new(progid: K): ActiveXObjectNameMap[K];
}
interface ActiveXObjectNameMap {
diff --git a/types/activex-access/tsconfig.json b/types/activex-access/tsconfig.json
index a376fcb722..867c1e2970 100644
--- a/types/activex-access/tsconfig.json
+++ b/types/activex-access/tsconfig.json
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
- "es5",
- "scripthost"
+ "es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
diff --git a/types/activex-adodb/activex-adodb-tests.ts b/types/activex-adodb/activex-adodb-tests.ts
index 347e1d9c9f..eecc7e9bdc 100644
--- a/types/activex-adodb/activex-adodb-tests.ts
+++ b/types/activex-adodb/activex-adodb-tests.ts
@@ -1,5 +1,8 @@
// Note -- running these tests under cscript requires some ES5 polyfills
+///
+///
+
const collectionToArray = (col: { Item(key: any): T }): T[] => {
const results: T[] = [];
const enumerator = new Enumerator(col);
@@ -12,9 +15,9 @@ const collectionToArray = (col: { Item(key: any): T }): T[] => {
};
const toSafeArray = (...items: T[]): SafeArray => {
- const dict = new ActiveXObject('Scripting.Dictionary');
+ const dict: Scripting.Dictionary = new ActiveXObject('Scripting.Dictionary');
items.forEach((x, index) => dict.Add(index, x));
- return dict.Items() as SafeArray;
+ return dict.Items();
};
const toConnectionString = (o: { [index: string]: any }) => {
diff --git a/types/activex-adodb/index.d.ts b/types/activex-adodb/index.d.ts
index 1879891b2d..580042cfa6 100644
--- a/types/activex-adodb/index.d.ts
+++ b/types/activex-adodb/index.d.ts
@@ -4,6 +4,8 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6
+///
+
declare namespace ADODB {
const enum ADCPROP_ASYNCTHREADPRIORITY_ENUM {
adPriorityAboveNormal = 4,
@@ -1094,7 +1096,6 @@ declare namespace ADODB {
}
interface ActiveXObject {
- new(progid: K): ActiveXObjectNameMap[K];
on(obj: ADODB.Connection, event: 'BeginTransComplete', argNames: ['TransactionLevel', 'pError', 'adStatus', 'pConnection'], handler: (this: ADODB.Connection, parameter: {readonly TransactionLevel: number, readonly pError: ADODB.Error, adStatus: ADODB.EventStatusEnum, readonly pConnection: ADODB.Connection}) => void): void;
on(obj: ADODB.Connection, event: 'CommitTransComplete' | 'ConnectComplete' | 'InfoMessage' | 'RollbackTransComplete', argNames: ['pError', 'adStatus', 'pConnection'], handler: (this: ADODB.Connection, parameter: {readonly pError: ADODB.Error, adStatus: ADODB.EventStatusEnum, readonly pConnection: ADODB.Connection}) => void): void;
on(obj: ADODB.Connection, event: 'Disconnect', argNames: ['adStatus', 'pConnection'], handler: (this: ADODB.Connection, parameter: {adStatus: ADODB.EventStatusEnum, readonly pConnection: ADODB.Connection}) => void): void;
diff --git a/types/activex-adodb/tsconfig.json b/types/activex-adodb/tsconfig.json
index 5cb32f94c9..abf5b79a00 100644
--- a/types/activex-adodb/tsconfig.json
+++ b/types/activex-adodb/tsconfig.json
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
- "es5",
- "scripthost"
+ "es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
diff --git a/types/activex-adox/activex-adox-tests.ts b/types/activex-adox/activex-adox-tests.ts
index 1b6ec21d1f..df5c75ef12 100644
--- a/types/activex-adox/activex-adox-tests.ts
+++ b/types/activex-adox/activex-adox-tests.ts
@@ -1,3 +1,5 @@
+///
+
const collectionToArray = (col: { Item(key: any): T }): T[] => {
const results: T[] = [];
const enumerator = new Enumerator(col);
diff --git a/types/activex-adox/index.d.ts b/types/activex-adox/index.d.ts
index 8960dd0a31..fd502684e4 100644
--- a/types/activex-adox/index.d.ts
+++ b/types/activex-adox/index.d.ts
@@ -4,6 +4,7 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6
+///
///
declare namespace ADOX {
@@ -320,10 +321,6 @@ declare namespace ADOX {
}
}
-interface ActiveXObject {
- new(progid: K): ActiveXObjectNameMap[K];
-}
-
interface ActiveXObjectNameMap {
'ADOX.Catalog': ADOX.Catalog;
'ADOX.Column': ADOX.Column;
diff --git a/types/activex-adox/tsconfig.json b/types/activex-adox/tsconfig.json
index 7aaa955db5..30b6288e6a 100644
--- a/types/activex-adox/tsconfig.json
+++ b/types/activex-adox/tsconfig.json
@@ -1,8 +1,9 @@
-
{
"compilerOptions": {
"module": "commonjs",
- "lib": ["es5", "scripthost"],
+ "lib": [
+ "es5"
+ ],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
diff --git a/types/activex-dao/activex-dao-tests.ts b/types/activex-dao/activex-dao-tests.ts
index 7e8c2bef22..6eea19f8e6 100644
--- a/types/activex-dao/activex-dao-tests.ts
+++ b/types/activex-dao/activex-dao-tests.ts
@@ -1,3 +1,5 @@
+///
+
const collectionToArray = (col: { Item(key: any): T }): T[] => {
const results: T[] = [];
const enumerator = new Enumerator(col);
diff --git a/types/activex-dao/index.d.ts b/types/activex-dao/index.d.ts
index a2a159e324..0a13747514 100644
--- a/types/activex-dao/index.d.ts
+++ b/types/activex-dao/index.d.ts
@@ -4,6 +4,8 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6
+///
+
declare namespace DAO {
const enum _DAOSuppHelp {
KeepLocal = 0,
@@ -883,10 +885,6 @@ declare namespace DAO {
}
}
-interface ActiveXObject {
- new(progid: K): ActiveXObjectNameMap[K];
-}
-
interface ActiveXObjectNameMap {
'DAO.DBEngine': DAO.DBEngine;
'DAO.Field': DAO.Field;
diff --git a/types/activex-dao/tsconfig.json b/types/activex-dao/tsconfig.json
index 2ddea247b9..e9d00e61e1 100644
--- a/types/activex-dao/tsconfig.json
+++ b/types/activex-dao/tsconfig.json
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
- "es5",
- "scripthost"
+ "es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
diff --git a/types/activex-diskquota/index.d.ts b/types/activex-diskquota/index.d.ts
index d27863de3c..da7457e066 100644
--- a/types/activex-diskquota/index.d.ts
+++ b/types/activex-diskquota/index.d.ts
@@ -4,6 +4,8 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.5
+///
+
declare namespace DiskQuotaTypeLibrary {
// tslint:disable-next-line no-const-enum
const enum AccountStatusConstants {
@@ -136,7 +138,6 @@ interface ActiveXObject {
on(
obj: DiskQuotaTypeLibrary.DiskQuotaControl, event: 'OnUserNameChanged', argNames: ['pUser'], handler: (
this: DiskQuotaTypeLibrary.DiskQuotaControl, parameter: {readonly pUser: DiskQuotaTypeLibrary.DIDiskQuotaUser}) => void): void;
- new(progid: K): ActiveXObjectNameMap[K];
}
interface ActiveXObjectNameMap {
@@ -146,7 +147,3 @@ interface ActiveXObjectNameMap {
interface EnumeratorConstructor {
new(col: DiskQuotaTypeLibrary.DiskQuotaControl): Enumerator;
}
-
-interface SafeArray {
- _brand: SafeArray;
-}
diff --git a/types/activex-diskquota/tsconfig.json b/types/activex-diskquota/tsconfig.json
index 597d998a96..ce9b55800d 100644
--- a/types/activex-diskquota/tsconfig.json
+++ b/types/activex-diskquota/tsconfig.json
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
- "es5",
- "scripthost"
+ "es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
diff --git a/types/activex-excel/activex-excel-tests.ts b/types/activex-excel/activex-excel-tests.ts
index 4e577300e5..78291d57b5 100644
--- a/types/activex-excel/activex-excel-tests.ts
+++ b/types/activex-excel/activex-excel-tests.ts
@@ -1,11 +1,12 @@
+///
///
///
// some helpers
const toSafeArray = (...items: T[]): SafeArray => {
- const dict = new ActiveXObject('Scripting.Dictionary');
+ const dict: Scripting.Dictionary = new ActiveXObject('Scripting.Dictionary');
items.forEach((x, index) => dict.Add(index, x));
- return dict.Items() as SafeArray;
+ return dict.Items();
};
const inCollection = (collection: { Item(index: any): T }, index: string | number): T | undefined => {
let item: T | undefined;
diff --git a/types/activex-excel/index.d.ts b/types/activex-excel/index.d.ts
index cdf2a79551..c55bfe1c42 100644
--- a/types/activex-excel/index.d.ts
+++ b/types/activex-excel/index.d.ts
@@ -9723,7 +9723,6 @@ interface ActiveXObject {
set(obj: Excel.Workbook, propertyName: 'Colors', parameterTypes: [any], newValue: any): void;
set(obj: Excel.Range, propertyName: 'Value', parameterTypes: [Excel.XlRangeValueDataType], newValue: any): void;
set(obj: Excel.Range, propertyName: 'Value', newValue: any): void; // because Value is defined on the type as a method, not a property
- new (progid: K): ActiveXObjectNameMap[K];
}
interface ActiveXObjectNameMap {
diff --git a/types/activex-excel/tsconfig.json b/types/activex-excel/tsconfig.json
index 244ab1d0ef..0b346a4a25 100644
--- a/types/activex-excel/tsconfig.json
+++ b/types/activex-excel/tsconfig.json
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
- "es5",
- "scripthost"
+ "es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
diff --git a/types/activex-faxcomexlib/activex-faxcomexlib-tests.ts b/types/activex-faxcomexlib/activex-faxcomexlib-tests.ts
index ef3e403998..478e816eb7 100644
--- a/types/activex-faxcomexlib/activex-faxcomexlib-tests.ts
+++ b/types/activex-faxcomexlib/activex-faxcomexlib-tests.ts
@@ -1,4 +1,5 @@
-///
+///
+///
const collectionToArray = (col: { Item(index: any): T } | SafeArray) => {
const results: T[] = [];
@@ -12,9 +13,9 @@ const collectionToArray = (col: { Item(index: any): T } | SafeArray) => {
};
const toSafeArray = (...items: T[]): SafeArray => {
- const dict = new ActiveXObject('Scripting.Dictionary');
+ const dict: Scripting.Dictionary = new ActiveXObject('Scripting.Dictionary');
items.forEach((x, index) => dict.Add(index, x));
- return dict.Items() as SafeArray;
+ return dict.Items();
};
const VB = {
diff --git a/types/activex-faxcomexlib/index.d.ts b/types/activex-faxcomexlib/index.d.ts
index d4078061f7..ffd2412ef3 100644
--- a/types/activex-faxcomexlib/index.d.ts
+++ b/types/activex-faxcomexlib/index.d.ts
@@ -2011,7 +2011,6 @@ interface ActiveXObject {
this: FAXCOMEXLib.FaxServer, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void;
on(obj: FAXCOMEXLib.FaxAccount, event: 'AddRef' | 'Release', handler: (this: FAXCOMEXLib.FaxAccount, parameter: {}) => void): void;
on(obj: FAXCOMEXLib.FaxServer, event: 'AddRef' | 'Release', handler: (this: FAXCOMEXLib.FaxServer, parameter: {}) => void): void;
- new(progid: K): ActiveXObjectNameMap[K];
}
interface ActiveXObjectNameMap {
diff --git a/types/activex-faxcomexlib/tsconfig.json b/types/activex-faxcomexlib/tsconfig.json
index 6509ab4701..8443d46f26 100644
--- a/types/activex-faxcomexlib/tsconfig.json
+++ b/types/activex-faxcomexlib/tsconfig.json
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
- "es5",
- "scripthost"
+ "es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
diff --git a/types/activex-infopath/index.d.ts b/types/activex-infopath/index.d.ts
index c00c67e197..9cace4ec2e 100644
--- a/types/activex-infopath/index.d.ts
+++ b/types/activex-infopath/index.d.ts
@@ -1168,7 +1168,6 @@ interface ActiveXObject {
on(obj: InfoPath.Button, event: 'AddRef' | 'Release', handler: (this: InfoPath.Button, parameter: {}) => void): void;
on(obj: InfoPath.DataDOM, event: 'AddRef' | 'Release', handler: (this: InfoPath.DataDOM, parameter: {}) => void): void;
on(obj: InfoPath.XDocument, event: 'AddRef' | 'Release', handler: (this: InfoPath.XDocument, parameter: {}) => void): void;
- new(progid: K): ActiveXObjectNameMap[K];
}
interface ActiveXObjectNameMap {
diff --git a/types/activex-infopath/tsconfig.json b/types/activex-infopath/tsconfig.json
index 6feef8496c..db2712e264 100644
--- a/types/activex-infopath/tsconfig.json
+++ b/types/activex-infopath/tsconfig.json
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
- "es5",
- "scripthost"
+ "es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
diff --git a/types/activex-iwshruntimelibrary/activex-iwshruntimelibrary-tests.ts b/types/activex-iwshruntimelibrary/activex-iwshruntimelibrary-tests.ts
new file mode 100644
index 0000000000..67efbd3eca
--- /dev/null
+++ b/types/activex-iwshruntimelibrary/activex-iwshruntimelibrary-tests.ts
@@ -0,0 +1,62 @@
+///
+
+const collectionToArray = (col: { Item(key: any): T }): T[] => {
+ const results: T[] = [];
+ const enumerator = new Enumerator(col);
+ enumerator.moveFirst();
+ while (!enumerator.atEnd()) {
+ results.push(enumerator.item());
+ enumerator.moveNext();
+ }
+ return results;
+};
+
+const wshn = new ActiveXObject('WScript.Network');
+
+// https://msdn.microsoft.com/en-us/library/s6wt333f(v=vs.84).aspx
+// https://msdn.microsoft.com/en-us/library/wck0hkd7(v=vs.84).aspx
+// https://msdn.microsoft.com/en-us/library/tte130y1(v=vs.84).aspx
+// https://msdn.microsoft.com/en-us/library/3fxhka75(v=vs.84).aspx
+{
+ WScript.Echo('Domain = ' + wshn.UserDomain);
+ WScript.Echo('Computer Name = ' + wshn.ComputerName);
+ WScript.Echo('User Name = ' + wshn.UserName);
+}
+
+// https://msdn.microsoft.com/en-us/library/zsdh7hkb(v=vs.84).aspx
+wshn.AddWindowsPrinterConnection('\\\\printserv\\DefaultPrinter');
+
+// https://msdn.microsoft.com/en-us/library/kxsdca3c(v=vs.84).aspx
+wshn.AddPrinterConnection("LPT1", "\\\\Server\\Print1");
+
+// https://msdn.microsoft.com/en-us/library/t9zt39at(v=vs.84).aspx
+// https://msdn.microsoft.com/en-us/library/zhds6k80(v=vs.84).aspx
+{
+ const drives = wshn.EnumNetworkDrives();
+ const printers = wshn.EnumPrinterConnections();
+ WScript.Echo("Network drive mappings:");
+ for (let i = 0; i < drives.length; i += 2) {
+ WScript.Echo(`Drive ${drives.Item(i)} = ${drives.Item(i + 1)}`);
+ }
+ WScript.Echo('');
+ WScript.Echo("Network printer mappings:");
+ for (let i = 0; i < printers.length; i += 2) {
+ WScript.Echo(`Port ${printers.Item(i)} = ${printers.Item(i + 1)}`);
+ }
+}
+
+// https://msdn.microsoft.com/en-us/library/8kst88h6(v=vs.84).aspx
+wshn.MapNetworkDrive('E:', '\\\\Server\\Public');
+
+// https://msdn.microsoft.com/en-us/library/d16d7wbf(v=vs.84).aspx
+wshn.RemoveNetworkDrive('E:');
+
+// https://msdn.microsoft.com/en-us/library/tsbh2yy7(v=vs.84).aspx
+wshn.RemovePrinterConnection('\\\\PRN-CORP1\\B41-4523-A', true, true);
+
+// https://msdn.microsoft.com/en-us/library/2ccwwdct(v=vs.84).aspx
+{
+ const printerPath = "\\\\research\\library1";
+ wshn.AddWindowsPrinterConnection(printerPath);
+ wshn.SetDefaultPrinter(printerPath);
+}
diff --git a/types/activex-iwshruntimelibrary/index.d.ts b/types/activex-iwshruntimelibrary/index.d.ts
new file mode 100644
index 0000000000..1f89c2b84a
--- /dev/null
+++ b/types/activex-iwshruntimelibrary/index.d.ts
@@ -0,0 +1,437 @@
+// Type definitions for Windows Script Host Runtime Object Model 0.0
+// Project: https://msdn.microsoft.com/en-us/library/9bbdkx3k.aspx
+// Definitions by: Zev Spitz
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.3
+
+///
+
+declare namespace IWshRuntimeLibrary {
+ type WindowStyle = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
+ type ShortcutWindowStyle = 1 | 3 | 7;
+
+ const enum ButtonType {
+ OK,
+ OKCancel,
+ AbortRetryIgnore,
+ YesNoCancel,
+ YesNo,
+ RetryCancel,
+ CancelTryagainContinue
+ }
+
+ const enum EventType {
+ AuditFailure = 5,
+ AuditSuccess = 4,
+ Error = 1,
+ Information = 3,
+ Success = 0,
+ Warning = 2
+ }
+
+ const enum IconType {
+ Stop = 16,
+ QuestionMark = 32,
+ ExclamationMakr = 48,
+ InformationMark = 64,
+ }
+
+ const enum PopupType {
+ SecondButtonDefault = 256,
+ ThirdButtonDefault = 512,
+ Modal = 4096,
+ RightJustified = 524288,
+ RTL = 1048576,
+ }
+
+ const enum PopupSelection {
+ NoButton = -1,
+ OK = 1,
+ Cancel = 2,
+ Abort = 3,
+ Retry = 4,
+ Ignore = 5,
+ Yes = 6,
+ No = 7,
+ TryAgain = 10,
+ Continue = 11,
+ }
+
+ const enum WshExecStatus {
+ WshFailed = 2,
+ WshFinished = 1,
+ WshRunning = 0,
+ }
+
+ const enum WshWindowStyle {
+ WshHide = 0,
+ WshMaximizedFocus = 3,
+ WshMinimizedFocus = 2,
+ WshMinimizedNoFocus = 6,
+ WshNormalFocus = 1,
+ WshNormalNoFocus = 4,
+ }
+
+ class TextStreamBase {
+ /**
+ * The column number of the current character position in an input stream.
+ */
+ Column: number;
+
+ /**
+ * The current line number in an input stream.
+ */
+ Line: number;
+
+ /**
+ * Closes a text stream.
+ * It is not necessary to close standard streams; they close automatically when the process ends. If
+ * you close a standard stream, be aware that any other pointers to that standard stream become invalid.
+ */
+ Close(): void;
+ }
+
+ class TextStreamWriter extends TextStreamBase {
+ private 'IWshRuntimeLibrary.TextStreamWriter_typekey': TextStreamWriter;
+ private constructor();
+
+ /**
+ * Sends a string to an output stream.
+ */
+ Write(s: string): void;
+
+ /**
+ * Sends a specified number of blank lines (newline characters) to an output stream.
+ */
+ WriteBlankLines(intLines: number): void;
+
+ /**
+ * Sends a string followed by a newline character to an output stream.
+ */
+ WriteLine(s: string): void;
+ }
+
+ class TextStreamReader extends TextStreamBase {
+ private 'IWshRuntimeLibrary.TextStreamReader_typekey': TextStreamReader;
+ private constructor();
+
+ /**
+ * Returns a specified number of characters from an input stream, starting at the current pointer position.
+ * Does not return until the ENTER key is pressed.
+ * Can only be used on a stream in reading mode; causes an error in writing or appending mode.
+ */
+ Read(characters: number): string;
+
+ /**
+ * Returns all characters from an input stream.
+ * Can only be used on a stream in reading mode; causes an error in writing or appending mode.
+ */
+ ReadAll(): string;
+
+ /**
+ * Returns an entire line from an input stream.
+ * Although this method extracts the newline character, it does not add it to the returned string.
+ * Can only be used on a stream in reading mode; causes an error in writing or appending mode.
+ */
+ ReadLine(): string;
+
+ /**
+ * Skips a specified number of characters when reading from an input text stream.
+ * Can only be used on a stream in reading mode; causes an error in writing or appending mode.
+ * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.)
+ */
+ Skip(characters: number): void;
+
+ /**
+ * Skips the next line when reading from an input text stream.
+ * Can only be used on a stream in reading mode, not writing or appending mode.
+ */
+ SkipLine(): void;
+
+ /**
+ * Indicates whether the stream pointer position is at the end of a line.
+ */
+ AtEndOfLine: boolean;
+
+ /**
+ * Indicates whether the stream pointer position is at the end of a stream.
+ */
+ AtEndOfStream: boolean;
+ }
+
+ /** Generic Collection Object */
+ interface WshCollection {
+ Count(): number;
+ Item(Index: any): any;
+ readonly length: number;
+ (Index: any): any;
+ }
+
+ /** Environment Variables Collection Object */
+ interface WshEnvironment {
+ Count(): number;
+ Item(Name: string): string;
+ readonly Length: number;
+ Remove(Name: string): void;
+ (Name: string): string;
+ }
+
+ /** WSHExec object */
+ class WshExec {
+ private 'IWshRuntimeLibrary.WshExec_typekey': WshExec;
+ private constructor();
+ readonly ExitCode: number;
+ readonly ProcessID: number;
+ readonly Status: WshExecStatus;
+ readonly StdErr: TextStreamWriter;
+ readonly StdIn: TextStreamReader;
+ readonly StdOut: TextStreamWriter;
+ Terminate(): void;
+ }
+
+ /** Network Object */
+ class WshNetwork {
+ private 'IWshRuntimeLibrary.WshNetwork_typekey': WshNetwork;
+ private constructor();
+
+ /**
+ * Adds a remote MS-DOS-based printer connection to your computer system.
+ * @param LocalName Local name to assign to the connected printer.
+ * @param RemoteName Name of the remote printer.
+ * @param UpdateProfile [false] Whether the printer mapping is stored in the current user's profile.
+ *
+ * If you are mapping a remote printer using the profile of someone other than current user, you can specify _UserName_ and _Password_.
+ */
+ AddPrinterConnection(LocalName: string, RemoteName: string, UpdateProfile?: boolean, UserName?: string, Password?: string): void;
+
+ /**
+ * @param string Path to printer connection
+ * @param string [DriverName='']
+ * @param string [Port='LPT1']
+ *
+ * Unlike the **AddPrinterConnection** method, this method allows you to create a printer connection without directing it to a specific port, such as LPT1.
+ */
+ AddWindowsPrinterConnection(PrinterName: string, DriverName?: string, Port?: string): void;
+ readonly ComputerName: string;
+ EnumNetworkDrives(): WshCollection;
+ EnumPrinterConnections(): WshCollection;
+
+ /**
+ * Adds a remote MS-DOS-based printer connection to your computer system.
+ * @param LocalName Name by which the mapped drive will be known locally
+ * @param RemoteName Share's UNC name (\\xxx\yyy)
+ * @param UpdateProfile [false] Whether the printer mapping is stored in the current user's profile.
+ *
+ * If you are mapping a network drive using the profile of someone other than current user, you can specify _UserName_ and _Password_.
+ */
+ MapNetworkDrive(LocalName: string, RemoteName: string, UpdateProfile?: boolean, UserName?: string, Password?: string): void;
+ readonly Organization: string;
+
+ /**
+ * Removes a shared network drive from your computer system
+ * @param Name Name of the mapped drive you want to remove. This will be the drive letter if the drive has a mapping between a local name (drive letter) and a remote name (UNC name);
+ * it will be the UNC path if there is no such mapping
+ * @param Force [false] Remove the connections even if the resource is in use
+ * @param UpdateProfile [false] Remove the mapping from the user's profile
+ */
+ RemoveNetworkDrive(Name: string, Force?: boolean, UpdateProfile?: boolean): void;
+
+ /**
+ * Removes a shared network printer connection from your computer system
+ * @param Name Name that identifies the printer. Can be a UNC name (in the form `\\xxx\yyy`) or a local name (such as `LPT1`)
+ * @param Force [false] Remove printer connection even if a user is still connected
+ * @param UpdateProfile [false] Remove the printer connection from the user's profile
+ *
+ * The **RemovePrinterConnection** method removes both Windows and MS-DOS based printer connections. If the printer was connected using the method **AddPrinterConnection**,
+ * _Name_ must be the printer's local name. If the printer was connected using the **AddWindowsPrinterConnection** method or was added manually (using the Add Printer wizard),
+ * then _Name_ must be the printer's UNC name.
+ */
+ RemovePrinterConnection(Name: string, Force?: true, UpdateProfile?: true): void;
+ SetDefaultPrinter(Name: string): void;
+ readonly Site: string;
+ readonly UserDomain: string;
+ readonly UserName: string;
+ readonly UserProfile: string;
+ }
+
+ /** Shell Object */
+ class WshShell {
+ private 'IWshRuntimeLibrary.WshShell_typekey': WshShell;
+ private constructor();
+
+ /**
+ * Activates an application window
+ * @param App Title of application as it appears in the title bar, or the process ID
+ * @param Wait
+ *
+ * This method changes the focus to the named application or window. The window must be attached to the calling thread's message queue. It does not affect whether it is maximized or
+ * minimized. Focus moves from the activated application window when the user takes action to change the focus (or closes the window).
+ *
+ * In determining which application to activate, the specified title is compared to the title string of each running application. If no exact match exists, any application whose title
+ * string begins with title is activated. If an application still cannot be found, any application whose title string ends with title is activated. If more than one instance of the
+ * application named by title exists, one instance is arbitrarily activated.
+ *
+ * The method might return `false` under the following conditions:
+ *
+ * * The window is not brought to the foreground.
+ * * The window is brought to the foreground but is not given keyboard focus.
+ * * A Command Prompt window (`cmd.exe`) is brought to the foreground and is given keyboard focus.
+ */
+ AppActivate(App: string | number, Wait?: any): boolean;
+
+ /**
+ * Creates a shortcut
+ * @param PathLink Path where the shortcut should be created
+ *
+ * The shortcut object exists in memory until you save it to disk with the **Save** method.
+ */
+ CreateShortcut(PathLink: string): WshShortcut | WshURLShortcut;
+ CurrentDirectory: string;
+
+ /**
+ * Note that **Environment** doesn't actually return a callable object; the call is only usable in the context of the **Environment** property. The following:
+ *
+ * let env = new ActiveXObject('WScript.Shell').Environment;
+ * WScript.Echo(env('System'));
+ *
+ * will return an empty string, unless there is an environment variable named `System`
+ */
+ Environment: WshEnvironment & ((Type: 'System' | 'User' | 'Process' | 'Volatile') => WshEnvironment);
+ Exec(Command: string): WshExec;
+ ExpandEnvironmentStrings(Src: string): string;
+
+ /** @param string [Target=''] Name of the computer system where the event should be logged; default is the local computer system */
+ LogEvent(Type: EventType, Message: string, Target?: string): boolean;
+ Popup(Text: string, SecondsToWait?: number, Title?: string, Type?: ButtonType | IconType | PopupType): PopupSelection;
+ RegDelete(Name: string): void;
+
+ /**
+ * Returns the value of a key or value-name from the registry
+ * @param Name Key (ends with a final `\`) or value-name (doesn't end with a final `\`)
+ *
+ * Returns one of the following, based on the registry value type:
+ *
+ * * **REG_SZ** -- a string
+ * * **REG_DWORD** -- a number
+ * * **REG_SBINARY** -- a binary value, as a COM SafeArray containing integers
+ * * **REG_EXPAND_SZ** -- an expandable string
+ * * **REG_MULTI_SZ** -- an array of srings, as a COM SafeArray
+ */
+ RegRead(Name: string): string | number | SafeArray | SafeArray;
+
+ /**
+ * Creates a new key, adds another value-name to an existing key and assigns it a value, or changes the value of an existing value-name
+ * @param Name Key (ends with a final `\`) or value-name (doesn't end with a final `\`)
+ * @param Value Will be coerced to `string` or `integer` based on the value-name type:
+ * `REG_SZ | REG_EXPAND_SZ` will be converted to `string`;
+ * `REG_DWORD | REG_BINARY` will be converted to `integer`
+ * @param Type
+ */
+ RegWrite(Name: string, Value: any, Type?: 'REG_SZ' | 'REG_DWORD' | 'REG_BINARY' | 'REG_EXPAND_SZ'): void;
+
+ /**
+ * Runs a program in a new process.
+ * @param Command Command-line, including any parameters you want to pass to the executable file.
+ * @param WindowStyle Appearance of the program window. Not all programs make use of this information.
+ * @param WaitOnReturn Block script until program finishes executing.
+ *
+ * If `false` is passed into **WaitOnReturn**, the **Run** method will return 0 immediately. If `true` is passed in, **Run** will return the program's error code, if any.
+ *
+ * Environment variables will be expanded within the command line.
+ *
+ * Passing a registered file type will automatically open the program registered to the file type.
+ *
+ * Possible values for **WindowStyle**:
+ *
+ * * **0** -- Hides the window and activates another window.
+ * * **1** -- Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag
+ * when displaying the window for the first time.
+ * * **2** -- Activates the window and displays it as a minimized window.
+ * * **3** -- Activates the window and displays it as a maximized window.
+ * * **4** -- Displays a window in its most recent size and position. The active window remains active.
+ * * **5** -- Activates the window and displays it in its current size and position.
+ * * **6** -- Minimizes the specified window and activates the next top-level window in the Z order.
+ * * **7** -- Displays the window as a minimized window. The active window remains active.
+ * * **8** -- Displays the window in its current state. The active window remains active.
+ * * **9** -- Activates and displays the window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag
+ * when restoring a minimized window.
+ * * **10** -- Sets the show-state based on the state of the program that started the application.
+ */
+ Run(Command: string, WindowStyle?: WindowStyle, WaitOnReturn?: boolean): number;
+ SendKeys(Keys: string, Wait?: boolean): void;
+ readonly SpecialFolders: WshCollection;
+ }
+
+ /** Shortcut Object */
+ class WshShortcut {
+ private 'IWshRuntimeLibrary.WshShortcut_typekey': WshShortcut;
+ private constructor();
+ Arguments: string;
+ Description: string;
+ readonly FullName: string;
+ Hotkey: string;
+ IconLocation: string;
+ Load(PathLink: string): void;
+ readonly RelativePath: string;
+ Save(): void;
+ TargetPath: string;
+
+ /**
+ * Possible values:
+ *
+ * * **1** -- Activates and displays a window. If the window is minimized or maximized, the system restores it to its original size and position. An application should specify this flag
+ * when displaying the window for the first time.
+ * * **3** -- Activates the window and displays it as a maximized window.
+ * * **7** -- Displays the window as a minimized window. The active window remains active.
+ */
+ WindowStyle: ShortcutWindowStyle;
+ WorkingDirectory: string;
+ }
+
+ /** URLShortcut Object */
+ class WshURLShortcut {
+ private 'IWshRuntimeLibrary.WshURLShortcut_typekey': WshURLShortcut;
+ private constructor();
+ readonly FullName: string;
+ Load(PathLink: string): void;
+ Save(): void;
+ TargetPath: string;
+ }
+}
+declare namespace WSHControllerLibrary {
+ class WSHController {
+ private 'WSHControllerLibrary.WSHController_typekey': WSHController;
+ private constructor();
+ CreateScript(Command: string, Server?: any): any;
+ }
+}
+
+declare namespace ScriptSigner {
+ class Signer {
+ private 'ScriptSigner.Signer_typekey': Signer;
+ private constructor();
+
+ /** @param Store [Store='my'] */
+ Sign(FileExtension: string, Text: string, Certificate: string, Store?: string): string;
+
+ /** @param Store [Store='my'] */
+ SignFile(FileName: string, Certificate: string, Store?: string): void;
+
+ /** @param ShowUI [ShowUI=false] */
+ Verify(FileExtension: string, Text: string, ShowUI?: boolean): boolean;
+
+ /** @param ShowUI [ShowUI=false] */
+ VerifyFile(FileName: string, ShowUI?: boolean): boolean;
+ }
+}
+
+interface ActiveXObjectNameMap {
+ 'WSHController': WSHControllerLibrary.WSHController;
+ 'Scripting.Signer': ScriptSigner.Signer;
+ 'WScript.Network': IWshRuntimeLibrary.WshNetwork;
+ 'WScript.Shell': IWshRuntimeLibrary.WshShell;
+}
+
+interface ActiveXObject {
+ set(obj: IWshRuntimeLibrary.WshEnvironment, propertyName: 'Item', parameterTypes: [string], newValue: string): void;
+}
diff --git a/types/activex-iwshruntimelibrary/tsconfig.json b/types/activex-iwshruntimelibrary/tsconfig.json
new file mode 100644
index 0000000000..885ca81980
--- /dev/null
+++ b/types/activex-iwshruntimelibrary/tsconfig.json
@@ -0,0 +1,23 @@
+{
+ "compilerOptions": {
+ "module": "commonjs",
+ "lib": [
+ "es5"
+ ],
+ "noImplicitAny": true,
+ "noImplicitThis": true,
+ "strictNullChecks": true,
+ "strictFunctionTypes": true,
+ "baseUrl": "../",
+ "typeRoots": [
+ "../"
+ ],
+ "types": [],
+ "noEmit": true,
+ "forceConsistentCasingInFileNames": true
+ },
+ "files": [
+ "index.d.ts",
+ "activex-iwshruntimelibrary-tests.ts"
+ ]
+}
diff --git a/types/activex-iwshruntimelibrary/tslint.json b/types/activex-iwshruntimelibrary/tslint.json
new file mode 100644
index 0000000000..ed91c31f9c
--- /dev/null
+++ b/types/activex-iwshruntimelibrary/tslint.json
@@ -0,0 +1,6 @@
+{
+ "extends": "dtslint/dt.json",
+ "rules": {
+ "no-const-enum": false
+ }
+}
\ No newline at end of file
diff --git a/types/activex-libreoffice/activex-libreoffice-tests.ts b/types/activex-libreoffice/activex-libreoffice-tests.ts
index bafe014f59..87cf55eb8c 100644
--- a/types/activex-libreoffice/activex-libreoffice-tests.ts
+++ b/types/activex-libreoffice/activex-libreoffice-tests.ts
@@ -1,3 +1,5 @@
+///
+
(() => {
// https://wiki.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Bridge/Automation_Bridge
diff --git a/types/activex-libreoffice/index.d.ts b/types/activex-libreoffice/index.d.ts
index 1698317e8f..3459215083 100644
--- a/types/activex-libreoffice/index.d.ts
+++ b/types/activex-libreoffice/index.d.ts
@@ -4,6 +4,8 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
+///
+
declare class type {
private typekey: type;
}
@@ -12,9 +14,6 @@ declare class sequence {
private typekey: sequence;
}
-// tslint:disable-next-line no-empty-interface
-interface SafeArray {}
-
declare namespace com.sun.star {
namespace accessibility {
/**
diff --git a/types/activex-libreoffice/tsconfig.json b/types/activex-libreoffice/tsconfig.json
index 712ea46ca1..b6e9a7be63 100644
--- a/types/activex-libreoffice/tsconfig.json
+++ b/types/activex-libreoffice/tsconfig.json
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
- "es5",
- "scripthost"
+ "es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
diff --git a/types/activex-msforms/index.d.ts b/types/activex-msforms/index.d.ts
index c896cc4bf5..a9b5e8f8ac 100644
--- a/types/activex-msforms/index.d.ts
+++ b/types/activex-msforms/index.d.ts
@@ -1564,7 +1564,6 @@ interface ActiveXObject {
set(obj: MSForms.ComboBox | MSForms.ListBox, propertyName: 'Column' | 'List', parameterTypes: [number, number] | [number], newValue: any): void;
set(obj: MSForms.ComboBox | MSForms.ListBox, propertyName: 'Column' | 'List', parameterTypes: number[], newValue: SafeArray): void;
set(obj: MSForms.ListBox, propertyName: 'Selected', parameterTypes: [any], newValue: boolean): void;
- new(progid: K): ActiveXObjectNameMap[K];
}
interface ActiveXObjectNameMap {
diff --git a/types/activex-msforms/tsconfig.json b/types/activex-msforms/tsconfig.json
index 38f907552d..074a493c66 100644
--- a/types/activex-msforms/tsconfig.json
+++ b/types/activex-msforms/tsconfig.json
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
- "es5",
- "scripthost"
+ "es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
diff --git a/types/activex-mshtml/activex-mshtml-tests.ts b/types/activex-mshtml/activex-mshtml-tests.ts
index 324d3d09e2..bdf7f3dec3 100644
--- a/types/activex-mshtml/activex-mshtml-tests.ts
+++ b/types/activex-mshtml/activex-mshtml-tests.ts
@@ -1,3 +1,5 @@
+///
+
let htmlfile = new ActiveXObject('htmlfile');
let htmldoc = htmlfile.createDocumentFromUrl('https://msdn.microsoft.com/en-us/library/aa741317(v=vs.85).aspx', 'null');
let length = htmldoc.all.length;
diff --git a/types/activex-mshtml/index.d.ts b/types/activex-mshtml/index.d.ts
index 94466927d7..b2f8a92883 100644
--- a/types/activex-mshtml/index.d.ts
+++ b/types/activex-mshtml/index.d.ts
@@ -35570,7 +35570,6 @@ interface ActiveXObject {
on(obj: MSHTML.SVGTSpanElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGTSpanElement, parameter: {}) => void): void;
on(obj: MSHTML.SVGUseElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGUseElement, parameter: {}) => void): void;
on(obj: MSHTML.SVGViewElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGViewElement, parameter: {}) => void): void;
- new(progid: K): ActiveXObjectNameMap[K];
}
interface ActiveXObjectNameMap {
diff --git a/types/activex-mshtml/tsconfig.json b/types/activex-mshtml/tsconfig.json
index deba2b6ba3..1ef33423ee 100644
--- a/types/activex-mshtml/tsconfig.json
+++ b/types/activex-mshtml/tsconfig.json
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
- "es5",
- "scripthost"
+ "es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
diff --git a/types/activex-msxml2/activex-msxml2-tests.ts b/types/activex-msxml2/activex-msxml2-tests.ts
index 470f35d785..01ef12802e 100644
--- a/types/activex-msxml2/activex-msxml2-tests.ts
+++ b/types/activex-msxml2/activex-msxml2-tests.ts
@@ -1,3 +1,5 @@
+///
+
// https://msdn.microsoft.com/en-us/library/ms764708(v=vs.85).aspx
{
const dom = new ActiveXObject('Msxml2.DOMDocument.6.0');
diff --git a/types/activex-msxml2/index.d.ts b/types/activex-msxml2/index.d.ts
index 6f43ba02c5..5353864443 100644
--- a/types/activex-msxml2/index.d.ts
+++ b/types/activex-msxml2/index.d.ts
@@ -4,6 +4,8 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
+///
+
declare namespace MSXML2 {
/** Schema Object Model Content Types */
const enum _SCHEMACONTENTTYPE {
@@ -2775,7 +2777,6 @@ declare namespace MSXML2 {
interface ActiveXObject {
on(obj: MSXML2.DOMDocument60, event: 'ondataavailable' | 'onreadystatechange', handler: (this: MSXML2.DOMDocument60, parameter: {}) => void): void;
on(obj: MSXML2.FreeThreadedDOMDocument60, event: 'ondataavailable' | 'onreadystatechange', handler: (this: MSXML2.FreeThreadedDOMDocument60, parameter: {}) => void): void;
- new(progid: K): ActiveXObjectNameMap[K];
}
interface ActiveXObjectNameMap {
diff --git a/types/activex-msxml2/tsconfig.json b/types/activex-msxml2/tsconfig.json
index 49c53f71ca..fe55b33d3c 100644
--- a/types/activex-msxml2/tsconfig.json
+++ b/types/activex-msxml2/tsconfig.json
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
- "es5",
- "scripthost"
+ "es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
diff --git a/types/activex-office/activex-office-tests.ts b/types/activex-office/activex-office-tests.ts
index 7aab0b4521..4dd24fd547 100644
--- a/types/activex-office/activex-office-tests.ts
+++ b/types/activex-office/activex-office-tests.ts
@@ -1,3 +1,4 @@
+///
///
const collectionToArray = (col: { Item(key: any): T }): T[] => {
diff --git a/types/activex-office/tsconfig.json b/types/activex-office/tsconfig.json
index 729657e813..6ded50cfda 100644
--- a/types/activex-office/tsconfig.json
+++ b/types/activex-office/tsconfig.json
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
- "es5",
- "scripthost"
+ "es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
diff --git a/types/activex-outlook/index.d.ts b/types/activex-outlook/index.d.ts
index 37628722b5..2b316d80bd 100644
--- a/types/activex-outlook/index.d.ts
+++ b/types/activex-outlook/index.d.ts
@@ -4,6 +4,7 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6
+///
///
///
@@ -5855,7 +5856,6 @@ interface ActiveXObject {
on(obj: Outlook.TaskRequestDeclineItem, event: 'AfterWrite' | 'BeforeRead' | 'Read' | 'Unload', handler: (this: Outlook.TaskRequestDeclineItem, parameter: {}) => void): void;
on(obj: Outlook.TaskRequestItem, event: 'AfterWrite' | 'BeforeRead' | 'Read' | 'Unload', handler: (this: Outlook.TaskRequestItem, parameter: {}) => void): void;
on(obj: Outlook.TaskRequestUpdateItem, event: 'AfterWrite' | 'BeforeRead' | 'Read' | 'Unload', handler: (this: Outlook.TaskRequestUpdateItem, parameter: {}) => void): void;
- new(progid: K): ActiveXObjectNameMap[K];
}
interface ActiveXObjectNameMap {
diff --git a/types/activex-outlook/tsconfig.json b/types/activex-outlook/tsconfig.json
index 1a9fddc714..1a7c466608 100644
--- a/types/activex-outlook/tsconfig.json
+++ b/types/activex-outlook/tsconfig.json
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
- "es5",
- "scripthost"
+ "es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
diff --git a/types/activex-powerpoint/activex-powerpoint-tests.ts b/types/activex-powerpoint/activex-powerpoint-tests.ts
index 3f2bedf8cd..eb5a2e4c05 100644
--- a/types/activex-powerpoint/activex-powerpoint-tests.ts
+++ b/types/activex-powerpoint/activex-powerpoint-tests.ts
@@ -1,5 +1,5 @@
// tslint:disable-next-line no-unnecessary-generics
-const collectionToArray = (col: any): T[] => {
+const collectionToArray = (col: {Item(index: any): T}): T[] => {
const results: T[] = [];
const enumerator = new Enumerator(col);
enumerator.moveFirst();
@@ -13,8 +13,8 @@ const collectionToArray = (col: any): T[] => {
const app = new ActiveXObject('PowerPoint.Application');
(() => {
// delete empty textboxes in PowerPoint
- collectionToArray(app.ActivePresentation.Slides).forEach(slide => {
- collectionToArray(slide.Shapes).filter(shape =>
+ collectionToArray(app.ActivePresentation.Slides).forEach(slide => {
+ collectionToArray(slide.Shapes).filter(shape =>
shape.Type === Office.MsoShapeType.msoTextBox
&& shape.TextFrame.TextRange.Text.trim() === ''
).forEach(shape => shape.Delete());
diff --git a/types/activex-powerpoint/index.d.ts b/types/activex-powerpoint/index.d.ts
index ee59fd0be4..34e722a8a0 100644
--- a/types/activex-powerpoint/index.d.ts
+++ b/types/activex-powerpoint/index.d.ts
@@ -5374,7 +5374,6 @@ interface ActiveXObject {
this: PowerPoint.Application, parameter: {readonly Sel: PowerPoint.Selection, Cancel: boolean}) => void): void;
on(obj: PowerPoint.Application, event: 'WindowSelectionChange', argNames: ['Sel'], handler: (this: PowerPoint.Application, parameter: {readonly Sel: PowerPoint.Selection}) => void): void;
on(obj: PowerPoint.OLEControl, event: 'GotFocus' | 'LostFocus', handler: (this: PowerPoint.OLEControl, parameter: {}) => void): void;
- new(progid: K): ActiveXObjectNameMap[K];
}
interface ActiveXObjectNameMap {
diff --git a/types/activex-powerpoint/tsconfig.json b/types/activex-powerpoint/tsconfig.json
index 8a0392da3f..25bcee9fa3 100644
--- a/types/activex-powerpoint/tsconfig.json
+++ b/types/activex-powerpoint/tsconfig.json
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
- "es5",
- "scripthost"
+ "es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
diff --git a/types/activex-scripting/activex-scripting-tests.ts b/types/activex-scripting/activex-scripting-tests.ts
index 313e480cb5..f3ee3218ca 100644
--- a/types/activex-scripting/activex-scripting-tests.ts
+++ b/types/activex-scripting/activex-scripting-tests.ts
@@ -1,3 +1,5 @@
+///
+
// Note -- running these tests under cscript requires some ES5 polyfills
const collectionToArray = (col: { Item(key: any): T }): T[] => {
diff --git a/types/activex-scripting/index.d.ts b/types/activex-scripting/index.d.ts
index 42e4f0c9e0..e0f8ba306d 100644
--- a/types/activex-scripting/index.d.ts
+++ b/types/activex-scripting/index.d.ts
@@ -4,6 +4,8 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6
+///
+
declare namespace Scripting {
// tslint:disable-next-line:no-const-enum
const enum CompareMethod {
@@ -489,7 +491,6 @@ declare namespace Scripting {
}
interface ActiveXObject {
- new (progid: K): ActiveXObjectNameMap[K];
set(obj: Scripting.Dictionary, propertyName: 'Item', parameterTypes: [any], newValue: any): void;
}
diff --git a/types/activex-scripting/tsconfig.json b/types/activex-scripting/tsconfig.json
index e2008551fd..11cfcc44a4 100644
--- a/types/activex-scripting/tsconfig.json
+++ b/types/activex-scripting/tsconfig.json
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
- "es5",
- "scripthost"
+ "es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
diff --git a/types/activex-shdocvw/index.d.ts b/types/activex-shdocvw/index.d.ts
index 86568f6c5d..f450ea6112 100644
--- a/types/activex-shdocvw/index.d.ts
+++ b/types/activex-shdocvw/index.d.ts
@@ -4,6 +4,8 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6
+///
+
declare namespace SHDocVw {
// tslint:disable-next-line no-const-enum
const enum BrowserBarConstants {
@@ -1562,7 +1564,6 @@ interface ActiveXObject {
on(obj: SHDocVw.ShellNameSpace, event: 'DoubleClick' | 'Initialized' | 'SelectionChange', handler: (this: SHDocVw.ShellNameSpace, parameter: {}) => void): void;
on(obj: SHDocVw.WebBrowser, event: 'DownloadBegin' | 'DownloadComplete' | 'OnQuit', handler: (this: SHDocVw.WebBrowser, parameter: {}) => void): void;
on(obj: SHDocVw.WebBrowser_V1, event: 'DownloadBegin' | 'DownloadComplete' | 'WindowActivate' | 'WindowMove' | 'WindowResize', handler: (this: SHDocVw.WebBrowser_V1, parameter: {}) => void): void;
- new (progid: K): ActiveXObjectNameMap[K];
}
interface ActiveXObjectNameMap {
@@ -1571,7 +1572,3 @@ interface ActiveXObjectNameMap {
'Shell.UIHelper': SHDocVw.ShellUIHelper;
'ShellNameSpace.ShellNameSpace': SHDocVw.ShellNameSpace;
}
-
-interface EnumeratorConstructor {
- new(col: SHDocVw.ShellWindows): Enumerator;
-}
diff --git a/types/activex-shdocvw/tsconfig.json b/types/activex-shdocvw/tsconfig.json
index 1907cb1ef6..2a388d4c7d 100644
--- a/types/activex-shdocvw/tsconfig.json
+++ b/types/activex-shdocvw/tsconfig.json
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
- "es5",
- "scripthost"
+ "es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
diff --git a/types/activex-shell/activex-shell-tests.ts b/types/activex-shell/activex-shell-tests.ts
index f236f6e592..b9fd3b18fd 100644
--- a/types/activex-shell/activex-shell-tests.ts
+++ b/types/activex-shell/activex-shell-tests.ts
@@ -1,4 +1,4 @@
-///
+///
const shell = new ActiveXObject('Shell.Application');
diff --git a/types/activex-shell/index.d.ts b/types/activex-shell/index.d.ts
index cb59a11c5e..f12d135979 100644
--- a/types/activex-shell/index.d.ts
+++ b/types/activex-shell/index.d.ts
@@ -1001,7 +1001,6 @@ interface ActiveXObject {
on(
obj: Shell32.ShellFolderViewOC, event: 'BeginDrag' | 'DefaultVerbInvoked' | 'EnumDone' | 'SelectionChanged' | 'VerbInvoked',
handler: (this: Shell32.ShellFolderViewOC, parameter: {}) => void): void;
- new (progid: K): ActiveXObjectNameMap[K];
}
interface ActiveXObjectNameMap {
diff --git a/types/activex-shell/tsconfig.json b/types/activex-shell/tsconfig.json
index f4b549f649..364b5716de 100644
--- a/types/activex-shell/tsconfig.json
+++ b/types/activex-shell/tsconfig.json
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
- "es5",
- "scripthost"
+ "es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
diff --git a/types/activex-stdole/index.d.ts b/types/activex-stdole/index.d.ts
index e738e4f03d..34b12e4219 100644
--- a/types/activex-stdole/index.d.ts
+++ b/types/activex-stdole/index.d.ts
@@ -4,6 +4,8 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6
+///
+
declare namespace stdole {
type IPictureDisp = StdPicture;
@@ -79,7 +81,6 @@ declare namespace stdole {
interface ActiveXObject {
on(obj: stdole.StdFont, event: 'FontChanged', argNames: ['PropertyName'], handler: (this: stdole.StdFont, parameter: {readonly PropertyName: string}) => void): void;
- new(progid: K): ActiveXObjectNameMap[K];
}
interface ActiveXObjectNameMap {
diff --git a/types/activex-stdole/tsconfig.json b/types/activex-stdole/tsconfig.json
index cbe3ce7aae..24ea6a5417 100644
--- a/types/activex-stdole/tsconfig.json
+++ b/types/activex-stdole/tsconfig.json
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
- "es5",
- "scripthost"
+ "es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
diff --git a/types/activex-vbide/activex-vbide-tests.ts b/types/activex-vbide/activex-vbide-tests.ts
index 02209ec9bd..5780d36b1a 100644
--- a/types/activex-vbide/activex-vbide-tests.ts
+++ b/types/activex-vbide/activex-vbide-tests.ts
@@ -1,3 +1,4 @@
+///
///
const collectionToArray = (col: { Item(key: any): T }): T[] => {
diff --git a/types/activex-vbide/tsconfig.json b/types/activex-vbide/tsconfig.json
index 6fb205a3c4..5d27488056 100644
--- a/types/activex-vbide/tsconfig.json
+++ b/types/activex-vbide/tsconfig.json
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
- "es5",
- "scripthost"
+ "es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
diff --git a/types/activex-wia/activex-wia-tests.ts b/types/activex-wia/activex-wia-tests.ts
index 8fc7dcfd2e..25d025cc90 100644
--- a/types/activex-wia/activex-wia-tests.ts
+++ b/types/activex-wia/activex-wia-tests.ts
@@ -1,3 +1,5 @@
+///
+
// Note -- running these tests under cscript requires some ES5 polyfills
const collectionToArray = (col: { Item(key: any): T }): T[] => {
diff --git a/types/activex-wia/index.d.ts b/types/activex-wia/index.d.ts
index 18e474e09c..5a06471ff8 100644
--- a/types/activex-wia/index.d.ts
+++ b/types/activex-wia/index.d.ts
@@ -4,6 +4,8 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6
+///
+
declare namespace WIA {
/** String versions of globally unique identifiers (GUIDs) that identify common Device and Item commands. */
const enum CommandID {
@@ -791,7 +793,6 @@ declare namespace WIA {
}
interface ActiveXObject {
- new(progid: K): ActiveXObjectNameMap[K];
on(obj: WIA.DeviceManager, event: 'OnEvent', argNames: ['EventID', 'DeviceID', 'ItemID'], handler: (
this: WIA.DeviceManager, parameter: { readonly EventID: string, readonly DeviceID: string, readonly ItemID: string }) => void): void;
set(obj: WIA.Vector, propertyName: 'Item', parameterTypes: [number], newValue: TItem): void;
diff --git a/types/activex-wia/tsconfig.json b/types/activex-wia/tsconfig.json
index e77b3d1b66..48ed56e82e 100644
--- a/types/activex-wia/tsconfig.json
+++ b/types/activex-wia/tsconfig.json
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
- "es5",
- "scripthost"
+ "es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
diff --git a/types/activex-word/activex-word-tests.ts b/types/activex-word/activex-word-tests.ts
index 4a0000e6fa..2b44a5ba22 100644
--- a/types/activex-word/activex-word-tests.ts
+++ b/types/activex-word/activex-word-tests.ts
@@ -1,5 +1,7 @@
+///
+
// tslint:disable-next-line no-unnecessary-generics
-const collectionToArray = (col: any): T[] => {
+const collectionToArray = (col: {Item(index: any): T}): T[] => {
const results: T[] = [];
const enumerator = new Enumerator(col);
enumerator.moveFirst();
@@ -233,7 +235,7 @@ const activeDoc = app.ActiveDocument;
// looping through a collection -- https://msdn.microsoft.com/en-us/vba/word-vba/articles/looping-through-a-collection
(() => {
- collectionToArray(app.Documents)
+ collectionToArray(app.Documents)
.forEach(openDocument => WScript.Echo(openDocument.Name));
const strMarks = collectionToArray(activeDoc.Bookmarks)
diff --git a/types/activex-word/index.d.ts b/types/activex-word/index.d.ts
index 879af9021d..f6f559ae16 100644
--- a/types/activex-word/index.d.ts
+++ b/types/activex-word/index.d.ts
@@ -4,6 +4,7 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6
+///
///
///
///
@@ -12496,7 +12497,6 @@ interface ActiveXObject {
set(obj: Word.Document, propertyName: 'ActiveWritingStyle', parameterTypes: [any], newValue: string): void;
set(obj: Word.Document, propertyName: 'Compatibility', parameterTypes: [Word.WdCompatibility], newValue: boolean): void;
set(obj: Word.System, propertyName: 'PrivateProfileString', parameterTypes: [string, string, string], newValue: string): void;
- new(progid: K): ActiveXObjectNameMap[K];
}
interface ActiveXObjectNameMap {
diff --git a/types/activex-word/tsconfig.json b/types/activex-word/tsconfig.json
index c62626ca52..c5316c83c4 100644
--- a/types/activex-word/tsconfig.json
+++ b/types/activex-word/tsconfig.json
@@ -1,10 +1,7 @@
{
"compilerOptions": {
"module": "commonjs",
- "lib": [
- "es5",
- "scripthost"
- ],
+ "lib": ["es5"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
diff --git a/types/algoliasearch/algoliasearch-tests.ts b/types/algoliasearch/algoliasearch-tests.ts
index 96270b31eb..87fdb95a01 100644
--- a/types/algoliasearch/algoliasearch-tests.ts
+++ b/types/algoliasearch/algoliasearch-tests.ts
@@ -94,7 +94,8 @@ let _algoliaIndexSettings: IndexSettings = {
allowCompressionOfIntegerArray: false,
altCorrections: [{}],
minProximity: 0,
- placeholders: '',
+ placeholders: { '': [''] },
+ camelCaseAttributes: [''],
};
let _algoliaQueryParameters: QueryParameters = {
diff --git a/types/algoliasearch/index.d.ts b/types/algoliasearch/index.d.ts
index ba46f37ce6..9315a7f6b9 100644
--- a/types/algoliasearch/index.d.ts
+++ b/types/algoliasearch/index.d.ts
@@ -1759,10 +1759,18 @@ declare namespace algoliasearch {
minProximity?: number;
/**
* This is an advanced use-case to define a token substitutable by a list of words without having the original token searchable
- * default: ''
+ * default: {}
* https://github.com/algolia/algoliasearch-client-js#placeholders
*/
- placeholders?: any;
+ placeholders?: {
+ [name: string]: string[],
+ };
+ /**
+ * List of attributes on which to do a decomposition of camel case words.
+ *
+ https://www.algolia.com/doc/api-reference/api-parameters/camelCaseAttributes/
+ */
+ camelCaseAttributes?: string[];
}
interface Response {
diff --git a/types/awesomplete/index.d.ts b/types/awesomplete/index.d.ts
index e73b7cf2f3..9f5060de03 100644
--- a/types/awesomplete/index.d.ts
+++ b/types/awesomplete/index.d.ts
@@ -42,7 +42,8 @@ declare class Awesomplete {
}
declare namespace Awesomplete {
- type Suggestion = string | {label: string | any, value: string | any} | [string, string];
+ type Suggestion = string | { label: string | any, value: string | any } | [string, string];
+ type SortFunction = (left: number | any[], right: number | any[]) => number;
interface Options {
list?: string | string[] | Element | Array<{ label: string, value: any }> | Array<[string, string]>;
@@ -51,7 +52,7 @@ declare namespace Awesomplete {
autoFirst?: boolean;
data?(item: Suggestion, input: string): string;
filter?(text: string, input: string): boolean;
- sort?(left: number | any[], right: number | any[]): number;
+ sort?: boolean | SortFunction;
item?(text: string, input: string): HTMLElement;
replace?(text: string): void;
}
diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts
index 9f9d7438e3..8a3909329f 100644
--- a/types/aws-lambda/aws-lambda-tests.ts
+++ b/types/aws-lambda/aws-lambda-tests.ts
@@ -525,6 +525,58 @@ function customAuthorizerCallback(cb: AWSLambda.CustomAuthorizerCallback) {
cb(null, authResponse);
}
+/* CodePipeline events https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-invoke-lambda-function.html#actions-invoke-lambda-function-json-event-example */
+const CodePipelineEvent: AWSLambda.CodePipelineEvent = {
+ "CodePipeline.job": {
+ id: "11111111-abcd-1111-abcd-111111abcdef",
+ accountId: "111111111111",
+ data: {
+ actionConfiguration: {
+ configuration: {
+ FunctionName: "MyLambdaFunctionForAWSCodePipeline",
+ UserParameters: "some-input-such-as-a-URL"
+ }
+ },
+ inputArtifacts: [
+ {
+ location: {
+ s3Location: {
+ bucketName: "the name of the bucket configured as the pipeline artifact store in Amazon S3, for example codepipeline-us-east-2-1234567890",
+ objectKey: "the name of the application, for example CodePipelineDemoApplication.zip"
+ },
+ type: "S3"
+ },
+ revision: null,
+ name: "ArtifactName"
+ }
+ ],
+ outputArtifacts: [],
+ artifactCredentials: {
+ secretAccessKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
+ sessionToken: `MIICiTCCAfICCQD6m7oRw0uXOjANBgkqhkiG9w
+ 0BAQUFADCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZ
+ WF0dGxlMQ8wDQYDVQQKEwZBbWF6b24xFDASBgNVBAsTC0lBTSBDb25zb2xlMRIw
+ EAYDVQQDEwlUZXN0Q2lsYWMxHzAdBgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5
+ jb20wHhcNMTEwNDI1MjA0NTIxWhcNMTIwNDI0MjA0NTIxWjCBiDELMAkGA1UEBh
+ MCVVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBb
+ WF6b24xFDASBgNVBAsTC0lBTSBDb25zb2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMx
+ HzAdBgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5jb20wgZ8wDQYJKoZIhvcNAQE
+ BBQADgY0AMIGJAoGBAMaK0dn+a4GmWIWJ21uUSfwfEvySWtC2XADZ4nB+BLYgVI
+ k60CpiwsZ3G93vUEIO3IyNoH/f0wYK8m9TrDHudUZg3qX4waLG5M43q7Wgc/MbQ
+ ITxOUSQv7c7ugFFDzQGBzZswY6786m86gpEIbb3OhjZnzcvQAaRHhdlQWIMm2nr
+ AgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAtCu4nUhVVxYUntneD9+h8Mg9q6q+auN
+ KyExzyLwaxlAoo7TJHidbtS4J5iNmZgXL0FkbFFBjvSfpJIlJ00zbhNYS5f6Guo
+ EDmFJl0ZxBHjJnyp378OD8uTs7fLvjx79LjSTbNYiytVbZPQUQ5Yaxu2jXnimvw
+ 3rrszlaEXAMPLE=`,
+ accessKeyId: "AKIAIOSFODNN7EXAMPLE"
+ },
+ continuationToken: "A continuation token if continuing job"
+ }
+ }
+};
+
+CodePipelineEvent["CodePipeline.job"].data.encryptionKey = { type: 'KMS', id: 'key' };
+
/* CloudFront events, see http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html */
const CloudFrontRequestEvent: AWSLambda.CloudFrontRequestEvent = {
Records: [
@@ -750,6 +802,8 @@ let apiGtwProxyHandler: AWSLambda.APIGatewayProxyHandler = (event: AWSLambda.API
let proxyHandler: AWSLambda.ProxyHandler = (event: AWSLambda.APIGatewayEvent, context: AWSLambda.Context, cb: AWSLambda.ProxyCallback) => { };
apiGtwProxyHandler = proxyHandler;
+let codePipelineHandler: AWSLambda.CodePipelineHandler = (event: AWSLambda.CodePipelineEvent, context: AWSLambda.Context, cb: AWSLambda.Callback) => {};
+
let cloudFrontRequestHandler: AWSLambda.CloudFrontRequestHandler = (event: AWSLambda.CloudFrontRequestEvent, context: AWSLambda.Context, cb: AWSLambda.CloudFrontRequestCallback) => {
cb();
cb(null);
diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts
index 7795c4cdfe..e61d2bac72 100644
--- a/types/aws-lambda/index.d.ts
+++ b/types/aws-lambda/index.d.ts
@@ -501,6 +501,58 @@ export interface AuthResponseContext {
[name: string]: any;
}
+/**
+ * CodePipeline events
+ * https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-invoke-lambda-function.html
+ */
+export interface S3ArtifactLocation {
+ bucketName: string;
+ objectKey: string;
+}
+export interface S3ArtifactStore {
+ type: 'S3';
+ s3Location: S3ArtifactLocation;
+}
+
+export type ArtifactLocation = S3ArtifactStore;
+
+export interface Artifact {
+ name: string;
+ revision: string | null;
+ location: ArtifactLocation;
+}
+
+export interface Credentials {
+ accessKeyId: string;
+ secretAccessKey: string;
+ sessionToken?: string;
+}
+
+export interface EncryptionKey {
+ type: string;
+ id: string;
+}
+
+export interface CodePipelineEvent {
+ "CodePipeline.job": {
+ id: string;
+ accountId: string;
+ data: {
+ actionConfiguration: {
+ configuration: {
+ FunctionName: string;
+ UserParameters: string;
+ }
+ };
+ inputArtifacts: Artifact[];
+ outputArtifacts: Artifact[];
+ artifactCredentials: Credentials;
+ encryptionKey?: EncryptionKey & {type: 'KMS'};
+ continuationToken?: string;
+ };
+ };
+}
+
/**
* CloudFront events
* http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html
@@ -653,6 +705,8 @@ export type ProxyCallback = APIGatewayProxyCallback; // Old name
// TODO: IoT
+export type CodePipelineHandler = Handler;
+
export type CloudFrontRequestHandler = Handler;
export type CloudFrontRequestCallback = Callback;
diff --git a/types/chartist/chartist-tests.ts b/types/chartist/chartist-tests.ts
index 13a7c7dd1c..53ba63497c 100644
--- a/types/chartist/chartist-tests.ts
+++ b/types/chartist/chartist-tests.ts
@@ -1,429 +1,485 @@
import Chartist = require("chartist");
+
Chartist.escapingMap = {
- '&': '&',
- '<': '<',
- '>': '>',
- '"': '"',
- '\'': ''',
+ '&': '&',
+ '<': '<',
+ '>': '>',
+ '"': '"',
+ '\'': ''',
};
Chartist.precision = 8;
new Chartist.Line('.ct-chart', {
- labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],
- series: [
- [12, 9, 7, 8, 5],
- [2, 1, 3.5, 7, 3],
- [1, 3, 4, 5, 6]
- ]
+ labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],
+ series: [
+ [12, 9, 7, 8, 5],
+ [2, 1, 3.5, 7, 3],
+ [1, 3, 4, 5, 6]
+ ]
}, {
fullWidth: true,
chartPadding: {
- right: 40
+ right: 40
}
- });
-
-var lineChart = new Chartist.Line('.ct-chart', {
- labels: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
- series: [
- [5, 5, 10, 8, 7, 5, 4, null, null, null, 10, 10, 7, 8, 6, 9],
- [10, 15, null, 12, null, 10, 12, 15, null, null, 12, null, 14, null, null, null],
- [null, null, null, null, 3, 4, 1, 3, 4, 6, 7, 9, 5, null, null, null]
- ]
-}, {
- fullWidth: true,
- chartPadding: {
- right: 10
- },
- low: 0
- });
-
-new Chartist.Line('.ct-chart', {
- labels: ['1', '2', '3', '4', '5', '6'],
- series: [
- {
- name: 'Fibonacci sequence',
- data: [1, 2, 3, 5, 8, 13]
- },
- {
- name: 'Golden section',
- data: [1, 1.618, 2.618, 4.236, 6.854, 11.09]
- }
- ]
});
+var lineChart = new Chartist.Line('.ct-chart', {
+ labels: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
+ series: [
+ [5, 5, 10, 8, 7, 5, 4, null, null, null, 10, 10, 7, 8, 6, 9],
+ [10, 15, null, 12, null, 10, 12, 15, null, null, 12, null, 14, null, null, null],
+ [null, null, null, null, 3, 4, 1, 3, 4, 6, 7, 9, 5, null, null, null]
+ ]
+}, {
+ fullWidth: true,
+ chartPadding: {
+ right: 10
+ },
+ low: 0
+});
+
+new Chartist.Line('.ct-chart', {
+ labels: ['1', '2', '3', '4', '5', '6'],
+ series: [
+ {
+ name: 'Fibonacci sequence',
+ data: [1, 2, 3, 5, 8, 13]
+ },
+ {
+ name: 'Golden section',
+ data: [1, 1.618, 2.618, 4.236, 6.854, 11.09]
+ }
+ ]
+});
+
+
+// This example was taken here: https://gionkunz.github.io/chartist-js/examples.html#example-line-series-override
+new Chartist.Line('.ct-chart', {
+ labels: ['1', '2', '3', '4', '5', '6', '7', '8'],
+ // Naming the series with the series object array notation
+ series: [{
+ name: 'series-1',
+ data: [5, 2, -4, 2, 0, -2, 5, -3]
+ }, {
+ name: 'series-2',
+ data: [4, 3, 5, 3, 1, 3, 6, 4]
+ }, {
+ name: 'series-3',
+ data: [2, 4, 3, 1, 4, 5, 3, 2]
+ }]
+}, {
+ fullWidth: true,
+ // Within the series options you can use the series names
+ // to specify configuration that will only be used for the
+ // specific series.
+ series: {
+ 'series-1': {
+ lineSmooth: Chartist.Interpolation.step()
+ },
+ 'series-2': {
+ lineSmooth: Chartist.Interpolation.simple(),
+ showArea: true
+ },
+ 'series-3': {
+ showPoint: false
+ }
+ }
+}, [
+ // You can even use responsive configuration overrides to
+ // customize your series configuration even further!
+ ['screen and (max-width: 320px)', {
+ series: {
+ 'series-1': {
+ lineSmooth: Chartist.Interpolation.none()
+ },
+ 'series-2': {
+ lineSmooth: Chartist.Interpolation.none(),
+ showArea: false
+ },
+ 'series-3': {
+ lineSmooth: Chartist.Interpolation.none(),
+ showPoint: true
+ }
+ }
+ }]
+]);
+
+
var data = {
- series: [5, 3, 4]
+ series: [5, 3, 4]
};
-var sum = (a: number, b: number) => { return a + b };
+var sum = (a: number, b: number) => {
+ return a + b
+};
new Chartist.Pie('.ct-chart', data, {
- labelInterpolationFnc: (value: number) => {
- return Math.round(value / data.series.reduce(sum) * 100) + '%';
- }
+ labelInterpolationFnc: (value: number) => {
+ return Math.round(value / data.series.reduce(sum) * 100) + '%';
+ }
});
new Chartist.Pie('.ct-chart', {
- series: [20, 10, 30, 40]
+ series: [20, 10, 30, 40]
}, {
donut: true,
donutWidth: 60,
startAngle: 270,
total: 200,
showLabel: false
- });
+});
// Animation Donut example
var chart = new Chartist.Pie('.ct-chart', {
- series: [10, 20, 50, 20, 5, 50, 15],
- labels: [1, 2, 3, 4, 5, 6, 7]
+ series: [10, 20, 50, 20, 5, 50, 15],
+ labels: [1, 2, 3, 4, 5, 6, 7]
}, {
donut: true,
showLabel: false
- });
+});
chart.on('draw', (data: any) => {
- if (data.type === 'slice') {
- // Get the total path length in order to use for dash array animation
- var pathLength = data.element._node.getTotalLength();
+ if (data.type === 'slice') {
+ // Get the total path length in order to use for dash array animation
+ var pathLength = data.element._node.getTotalLength();
- // Set a dasharray that matches the path length as prerequisite to animate dashoffset
- data.element.attr({
- 'stroke-dasharray': pathLength + 'px ' + pathLength + 'px'
- });
+ // Set a dasharray that matches the path length as prerequisite to animate dashoffset
+ data.element.attr({
+ 'stroke-dasharray': pathLength + 'px ' + pathLength + 'px'
+ });
- // Create animation definition while also assigning an ID to the animation for later sync usage
- var animationDefinition: Chartist.IChartistAnimations = {
- 'stroke-dashoffset': {
- id: 'anim' + data.index,
- dur: 1000,
- from: -pathLength + 'px',
- to: '0px',
- easing: Chartist.Svg.Easing.easeOutQuint,
- // We need to use `fill: 'freeze'` otherwise our animation will fall back to initial (not visible)
- fill: 'freeze'
- }
- };
+ // Create animation definition while also assigning an ID to the animation for later sync usage
+ var animationDefinition: Chartist.IChartistAnimations = {
+ 'stroke-dashoffset': {
+ id: 'anim' + data.index,
+ dur: 1000,
+ from: -pathLength + 'px',
+ to: '0px',
+ easing: Chartist.Svg.Easing.easeOutQuint,
+ // We need to use `fill: 'freeze'` otherwise our animation will fall back to initial (not visible)
+ fill: 'freeze'
+ }
+ };
- // If this was not the first slice, we need to time the animation so that it uses the end sync event of the previous animation
- if (data.index !== 0) {
- animationDefinition['stroke-dashoffset'].begin = 'anim' + (data.index - 1) + '.end';
+ // If this was not the first slice, we need to time the animation so that it uses the end sync event of the previous animation
+ if (data.index !== 0) {
+ animationDefinition['stroke-dashoffset'].begin = 'anim' + (data.index - 1) + '.end';
+ }
+
+ // We need to set an initial value before the animation starts as we are not in guided mode which would do that for us
+ data.element.attr({
+ 'stroke-dashoffset': -pathLength + 'px'
+ });
+
+ // We can't use guided mode as the animations need to rely on setting begin manually
+ // See http://gionkunz.github.io/chartist-js/api-documentation.html#chartistsvg-function-animate
+ data.element.animate(animationDefinition, false);
}
-
- // We need to set an initial value before the animation starts as we are not in guided mode which would do that for us
- data.element.attr({
- 'stroke-dashoffset': -pathLength + 'px'
- });
-
- // We can't use guided mode as the animations need to rely on setting begin manually
- // See http://gionkunz.github.io/chartist-js/api-documentation.html#chartistsvg-function-animate
- data.element.animate(animationDefinition, false);
- }
});
new Chartist.Bar('.ct-chart', {
- labels: ['XS', 'S', 'M', 'L', 'XL', 'XXL', 'XXXL'],
- series: [20, 60, 120, 200, 180, 20, 10]
+ labels: ['XS', 'S', 'M', 'L', 'XL', 'XXL', 'XXXL'],
+ series: [20, 60, 120, 200, 180, 20, 10]
}, {
distributeSeries: true
- });
+});
new Chartist.Bar('.ct-chart', {
- labels: ['Quarter 1', 'Quarter 2', 'Quarter 3', 'Quarter 4'],
- series: [
- [5, 4, 3, 7],
- [3, 2, 9, 5],
- [1, 5, 8, 4],
- [2, 3, 4, 6],
- [4, 1, 2, 1]
- ]
+ labels: ['Quarter 1', 'Quarter 2', 'Quarter 3', 'Quarter 4'],
+ series: [
+ [5, 4, 3, 7],
+ [3, 2, 9, 5],
+ [1, 5, 8, 4],
+ [2, 3, 4, 6],
+ [4, 1, 2, 1]
+ ]
}, {
// Default mobile configuration
stackBars: true,
axisX: {
- labelInterpolationFnc: (value: string) => {
- return value.split(/\s+/).map((word: string) => {
- return word[0];
- }).join('');
- }
+ labelInterpolationFnc: (value: string) => {
+ return value.split(/\s+/).map((word: string) => {
+ return word[0];
+ }).join('');
+ }
},
axisY: {
- offset: 20
+ offset: 20
}
- }, [
+}, [
// Options override for media > 400px
['screen and (min-width: 400px)', {
- reverseData: true,
- horizontalBars: true,
- axisX: {
- labelInterpolationFnc: Chartist.noop
- },
- axisY: {
- offset: 60
- }
+ reverseData: true,
+ horizontalBars: true,
+ axisX: {
+ labelInterpolationFnc: Chartist.noop
+ },
+ axisY: {
+ offset: 60
+ }
}],
// Options override for media > 800px
['screen and (min-width: 800px)', {
- stackBars: false,
- seriesBarDistance: 10
+ stackBars: false,
+ seriesBarDistance: 10
}],
// Options override for media > 1000px
['screen and (min-width: 1000px)', {
- reverseData: false,
- horizontalBars: false,
- seriesBarDistance: 15
+ reverseData: false,
+ horizontalBars: false,
+ seriesBarDistance: 15
}]
- ]);
+]);
new Chartist.Pie('.ct-chart', {
- series: [{
- value: 20,
- name: 'Series 1',
- className: 'my-custom-class-one',
- meta: 'Meta One'
- }, {
- value: 10,
- name: 'Series 2',
- className: 'my-custom-class-two',
- meta: 'Meta Two'
+ series: [{
+ value: 20,
+ name: 'Series 1',
+ className: 'my-custom-class-one',
+ meta: 'Meta One'
}, {
- value: 70,
- name: 'Series 3',
- className: 'my-custom-class-three',
- meta: 'Meta Three'
+ value: 10,
+ name: 'Series 2',
+ className: 'my-custom-class-two',
+ meta: 'Meta Two'
+ }, {
+ value: 70,
+ name: 'Series 3',
+ className: 'my-custom-class-three',
+ meta: 'Meta Three'
}]
});
new Chartist.Bar('.bar-chart', {
- labels: ['foo', 'bar', 'foobar'],
- series: [
- {
- data: [1],
- className: 'graph-foo',
- },
- {
- data: [10],
- className: 'graph-foo',
- },
- {
- data: [12],
- className: 'graph-foo',
- }]
- }, {
+ labels: ['foo', 'bar', 'foobar'],
+ series: [
+ {
+ data: [1],
+ className: 'graph-foo',
+ },
+ {
+ data: [10],
+ className: 'graph-foo',
+ },
+ {
+ data: [12],
+ className: 'graph-foo',
+ }]
+}, {
seriesBarDistance: 30,
reverseData: true,
horizontalBars: true,
height: '115px',
axisY: {
- offset: 70,
- showGrid: false,
+ offset: 70,
+ showGrid: false,
},
axisX: {
- scaleMinSpace: 200
+ scaleMinSpace: 200
}
- });
+});
new Chartist.Line('.ct-chart', {
- labels: [1, 2, 3, 4, 5, 6, 7, 8],
- series: [
- [5, 9, 7, 8, 5, 3, 5, 4]
- ]
+ labels: [1, 2, 3, 4, 5, 6, 7, 8],
+ series: [
+ [5, 9, 7, 8, 5, 3, 5, 4]
+ ]
}, {
ticks: [0, 4],
low: 0,
showArea: true,
axisY: {
- showLabel: true,
- showGrid: false,
- ticks: [1, 4],
- type: Chartist.FixedScaleAxis
+ showLabel: true,
+ showGrid: false,
+ ticks: [1, 4],
+ type: Chartist.FixedScaleAxis
}
- });
+});
new Chartist.Line('.ct-chart', {
- labels: [1, 2, 3, 4, 5, 6, 7, 8],
- series: [
- [5, 9, 7, 8, 5, 3, 5, 4]
- ]
+ labels: [1, 2, 3, 4, 5, 6, 7, 8],
+ series: [
+ [5, 9, 7, 8, 5, 3, 5, 4]
+ ]
}, {
ticks: [0, 4],
low: 0,
showArea: true,
axisX: {
- showGrid: false
+ showGrid: false
},
axisY: {
- showLabel: true,
- showGrid: false,
- ticks: [1, 4],
- type: Chartist.FixedScaleAxis
+ showLabel: true,
+ showGrid: false,
+ ticks: [1, 4],
+ type: Chartist.FixedScaleAxis
}
- });
+});
var chart2 = new Chartist.Line('.ct-chart', {
- labels: [1, 2, 3, 4, 5],
- series: [
- [12, 9, 7, 8, 5]
- ]
+ labels: [1, 2, 3, 4, 5],
+ series: [
+ [12, 9, 7, 8, 5]
+ ]
});
// Listening for draw events that get emitted by the Chartist chart
chart2.on('draw', (data: any) => {
- // If the draw event was triggered from drawing a point on the line chart
- if (data.type === 'point') {
- // We are creating a new path SVG element that draws a triangle around the point coordinates
- var triangle = new Chartist.Svg('path', {
- d: ['M',
- data.x,
- data.y - 15,
- 'L',
- data.x - 15,
- data.y + 8,
- 'L',
- data.x + 15,
- data.y + 8,
- 'z'].join(' '),
- style: 'fill-opacity: 1'
- }, 'ct-area');
+ // If the draw event was triggered from drawing a point on the line chart
+ if (data.type === 'point') {
+ // We are creating a new path SVG element that draws a triangle around the point coordinates
+ var triangle = new Chartist.Svg('path', {
+ d: ['M',
+ data.x,
+ data.y - 15,
+ 'L',
+ data.x - 15,
+ data.y + 8,
+ 'L',
+ data.x + 15,
+ data.y + 8,
+ 'z'].join(' '),
+ style: 'fill-opacity: 1'
+ }, 'ct-area');
- // With data.element we get the Chartist SVG wrapper and we can replace the original point drawn by Chartist with our newly created triangle
- data.element.replace(triangle);
- }
+ // With data.element we get the Chartist SVG wrapper and we can replace the original point drawn by Chartist with our newly created triangle
+ data.element.replace(triangle);
+ }
});
// Create a simple bi-polar bar chart
var biPolarChart = new Chartist.Bar('.ct-chart', {
- labels: ['W1', 'W2', 'W3', 'W4', 'W5', 'W6', 'W7', 'W8', 'W9', 'W10'],
- series: [
- [1, 2, 4, 8, 6, -2, -1, -4, -6, -2]
- ]
+ labels: ['W1', 'W2', 'W3', 'W4', 'W5', 'W6', 'W7', 'W8', 'W9', 'W10'],
+ series: [
+ [1, 2, 4, 8, 6, -2, -1, -4, -6, -2]
+ ]
}, {
high: 10,
low: -10,
axisX: {
- labelInterpolationFnc: (value: any, index: number) => {
- return index % 2 === 0 ? value : null;
- }
+ labelInterpolationFnc: (value: any, index: number) => {
+ return index % 2 === 0 ? value : null;
+ }
}
- });
+});
// Listen for draw events on the bar chart
biPolarChart.on('draw', (data: any) => {
- // If this draw event is of type bar we can use the data to create additional content
- if (data.type === 'bar') {
- // We use the group element of the current series to append a simple circle with the bar peek coordinates and a circle radius that is depending on the value
- data.group.append(new Chartist.Svg('circle', {
- cx: data.x2,
- cy: data.y2,
- r: Math.abs(Chartist.getMultiValue(data.value)) * 2 + 5
- }, 'ct-slice-pie'));
- }
+ // If this draw event is of type bar we can use the data to create additional content
+ if (data.type === 'bar') {
+ // We use the group element of the current series to append a simple circle with the bar peek coordinates and a circle radius that is depending on the value
+ data.group.append(new Chartist.Svg('circle', {
+ cx: data.x2,
+ cy: data.y2,
+ r: Math.abs(Chartist.getMultiValue(data.value)) * 2 + 5
+ }, 'ct-slice-pie'));
+ }
});
new Chartist.Bar('.ct-chart', {
- labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
- series: [
- [5, 4, 3, 7, 5, 10, 3],
- [3, 2, 9, 5, 4, 6, 4]
- ]
+ labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
+ series: [
+ [5, 4, 3, 7, 5, 10, 3],
+ [3, 2, 9, 5, 4, 6, 4]
+ ]
}, {
axisX: {
- // On the x-axis start means top and end means bottom
- position: 'start'
+ // On the x-axis start means top and end means bottom
+ position: 'start'
},
axisY: {
- // On the y-axis start means left and end means right
- position: 'end'
+ // On the y-axis start means left and end means right
+ position: 'end'
}
- });
+});
new Chartist.Line('.ct-chart', {
- labels: [1, 2, 3, 4, 5],
- series: [[1, 2, 8, 1, 7]]
+ labels: [1, 2, 3, 4, 5],
+ series: [[1, 2, 8, 1, 7]]
}, {
lineSmooth: Chartist.Interpolation.none({
- fillHoles: false
+ fillHoles: false
})
- });
+});
new Chartist.Line('.ct-chart', {
- labels: [1, 2, 3, 4, 5],
- series: [[1, 2, 8, 1, 7]]
+ labels: [1, 2, 3, 4, 5],
+ series: [[1, 2, 8, 1, 7]]
}, {
lineSmooth: Chartist.Interpolation.simple({
- divisor: 2,
- fillHoles: false
+ divisor: 2,
+ fillHoles: false
})
- });
+});
new Chartist.Line('.ct-chart', {
- labels: [1, 2, 3, 4, 5],
- series: [[1, 2, 8, 1, 7]]
+ labels: [1, 2, 3, 4, 5],
+ series: [[1, 2, 8, 1, 7]]
}, {
lineSmooth: Chartist.Interpolation.cardinal({
- tension: 1,
- fillHoles: false
+ tension: 1,
+ fillHoles: false
})
- });
+});
new Chartist.Line('.ct-chart', {
- labels: [1, 2, 3, 4, 5],
- series: [[1, 2, 8, 1, 7]]
+ labels: [1, 2, 3, 4, 5],
+ series: [[1, 2, 8, 1, 7]]
}, {
lineSmooth: Chartist.Interpolation.step({
- postpone: true,
- fillHoles: false
+ postpone: true,
+ fillHoles: false
})
- });
+});
var overlappingBarsData: Chartist.IChartistData = {
- labels: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
- series: [
- [5, 4, 3, 7, 5, 10, 3, 4, 8, 10, 6, 8],
- [3, 2, 9, 5, 4, 6, 4, 6, 7, 8, 7, 4]
- ]
+ labels: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
+ series: [
+ [5, 4, 3, 7, 5, 10, 3, 4, 8, 10, 6, 8],
+ [3, 2, 9, 5, 4, 6, 4, 6, 7, 8, 7, 4]
+ ]
};
var overlappingBarsOptions: Chartist.IBarChartOptions = {
- seriesBarDistance: 10
+ seriesBarDistance: 10
};
var overlappingBarsResponsiveOptions: Array> = [
- ['screen and (max-width: 640px)', {
- seriesBarDistance: 5,
- axisX: {
- labelInterpolationFnc: (value: any) => {
- return value[0];
- }
- }
- }]
+ ['screen and (max-width: 640px)', {
+ seriesBarDistance: 5,
+ axisX: {
+ labelInterpolationFnc: (value: any) => {
+ return value[0];
+ }
+ }
+ }]
];
new Chartist.Bar('.ct-chart', overlappingBarsData, overlappingBarsOptions, overlappingBarsResponsiveOptions);
new Chartist.Candle('.ct-chart', {
- labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
- series: [
- [5, 4, 3, 7],
- [3, 2, 9, 5],
- [5, 4, 3, 7],
- [3, 2, 9, 5],
- [5, 4, 3, 7],
- [3, 2, 9, 5],
- [3, 2, 9, 5]
- ]
+ labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
+ series: [
+ [5, 4, 3, 7],
+ [3, 2, 9, 5],
+ [5, 4, 3, 7],
+ [3, 2, 9, 5],
+ [5, 4, 3, 7],
+ [3, 2, 9, 5],
+ [3, 2, 9, 5]
+ ]
}, {
- axisX: {
- labelOffset: {
- x: -10,
- y: 0
+ axisX: {
+ labelOffset: {
+ x: -10,
+ y: 0
+ }
+ },
+ axisY: {
+ showGrid: false,
+ labelInterpolationFnc: function (value: any) {
+ return value + 12000;
+ }
}
- },
- axisY: {
- showGrid: false,
- labelInterpolationFnc: function (value: any) {
- return value + 12000;
- }
- }
});
diff --git a/types/chartist/index.d.ts b/types/chartist/index.d.ts
index 93918a5eeb..58db5e64ff 100644
--- a/types/chartist/index.d.ts
+++ b/types/chartist/index.d.ts
@@ -1,703 +1,728 @@
// Type definitions for Chartist v0.9.81
// Project: https://github.com/gionkunz/chartist-js
-// Definitions by: Matt Gibbs , Simon Pfeifer , Cassey Lottman
+// Definitions by: Matt Gibbs , Simon Pfeifer , Cassey Lottman , Anastasiia Antonova
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace Chartist {
- interface ChartistStatic {
-
- /**
- * Precision level used internally in Chartist for rounding. If you require more decimal places you can increase this number.
- */
- precision: number;
-
- /**
- * A map with characters to escape for strings to be safely used as attribute values.
- */
- escapingMap: IChartistEscapeMap;
-
- Pie: IChartistPieChart;
- Bar: IChartistBarChart;
- Line: IChartistLineChart;
- Candle: IChartistCandleChart;
-
- FixedScaleAxis: IFixedScaleAxisStatic;
- AutoScaleAxis: IAutoScaleAxisStatic;
- StepAxis: IStepAxisStatic;
-
- Svg: ChartistSvgStatic;
- Interpolation: ChartistInterpolationStatic;
-
- noop: Function;
-
- alphaNumerate(n: number): string;
- extend(target: Object, ...sources: Object[]): Object;
-
- replaceAll(str: string, subStr: string, newSubStr: string): string;
- ensureUnit(value: number, unit: string): string;
- quantity(input: string | number): Object;
-
- query(query: Node | string): Node;
- times(length: number): Array;
- sum(previous: number, current: number): number;
- mapMultiply(factor: number): (num: number) => number;
- mapAdd(addend: number): (num: number) => number;
- serialMap(arr: Array, cb: Function): Array;
- roundWithPrecision(value: number, digits?: number): number;
-
- getMultiValue(value: any, dimension?: any): number; // this method is not documented, but it is used in the examples
-
- serialize(data: Object | string | number): string;
- deserialize(data: string): Object | string | number;
-
- createSvg(container: Node, width: string, height: string, className: string): Object; // TODO: Figure out if this is returning a ChartistSVGWrapper or an actual SVGElement
-
- plugins: any;
- }
-
- interface IChartistEscapeMap {
- [Key: string]: string;
- }
-
- interface IResponsiveOptionTuple extends Array {
- 0: string;
- 1: T;
- }
-
- // these have no other purpose than to help define the types that can be placed on
- // a line chart axisX
- // in the actual chartist library these are classes that project their options onto
- // the parent class
- interface IFixedScaleAxisStatic { }
- interface IAutoScaleAxisStatic { }
- interface IStepAxisStatic { }
-
- // data formats are not well documented on all the ways they can be passed to the constructors
- // this definition gives some intellisense, but does not protect the user from misuse
- // TODO: come in and tidy this up and make it fit better
- interface IChartistData {
- labels?: Array | Array | Array;
- series: Array | Array> | Array | Array>;
- }
-
- interface IChartistSeriesData {
- name?: string;
- value?: number;
- data?: Array;
- className?: string;
- meta?: string; // I assume this could probably be a number as well?
- }
-
- interface IChartistBase {
- container: any;
- data: IChartistData;
- defaultOptions: T;
- options: T;
- responsiveOptions: Array>;
-
- // this most likely doesn't need to be exposed to the user
- eventEmitter: any;
-
- supportsForeignObject: boolean;
- supportsAnimations: boolean;
- resizeListener: any;
-
- plugins?: Array; // all of these plugins seem to be functions with options, but keeping type any for now
-
- update(data: Object, options?: T, override?: boolean): void;
- detach(): void;
-
- /**
- * Use this function to register event handlers. The handler callbacks are synchronous and will run in the main thread rather than the event loop.
- *
- * @method on
- * @param event {string} Name of the event. Check the examples for supported events.
- * @param handler {Function} The handler function that will be called when an event with the given name was emitted. This function will receive a data argument which contains event data. See the example for more details.
- */
- on(event: string, handler: Function): IChartistBase;
-
- /**
- * Use this function to un-register event handlers. If the handler function parameter is omitted all handlers for the given event will be un-registered.
- *
- * @method off
- * @param event {string} Name of the event for which a handler should be removed
- * @param handler {Function} The handler function that that was previously used to register a new event handler. This handler will be removed from the event handler list. If this parameter is omitted then all event handlers for the given event are removed from the list.
- */
- off(event: string, handler?: Function): IChartistBase;
- }
-
- interface IChartistPieChart extends IChartistBase {
- new (target: any, data: IChartistData, options?: IPieChartOptions, responsiveOptions?: Array>): IChartistPieChart;
- }
-
- interface IChartistLineChart extends IChartistBase {
- new (target: any, data: IChartistData, options?: ILineChartOptions, responsiveOptions?: Array>): IChartistLineChart;
- }
-
- interface IChartistBarChart extends IChartistBase {
- new (target: any, data: IChartistData, options?: IBarChartOptions, responsiveOptions?: Array>): IChartistBarChart;
- }
-
- interface IChartistCandleChart extends IChartistBase {
- new (target: any, data: IChartistData, options?: ICandleChartOptions, responsiveOptions?: Array>): IChartistCandleChart;
- }
-
- interface IChartOptions {
- /**
- * If true the whole data is reversed including labels, the series order as well as the whole series data arrays.
- */
- reverseData?: boolean;
-
- plugins?: Array;
- }
-
- interface IPieChartOptions extends IChartOptions {
- /**
- * Specify a fixed width for the chart as a string (i.e. '100px' or '50%')
- */
- width?: number | string;
-
- /**
- * Specify a fixed height for the chart as a string (i.e. '100px' or '50%')
- */
- height?: number | string;
-
- /**
- * Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5}
- */
- chartPadding?: IChartPadding | number;
-
- /**
- * Override the class names that are used to generate the SVG structure of the chart
- */
- classNames?: IPieChartClasses;
-
- /**
- * The start angle of the pie chart in degrees where 0 points north. A higher value offsets the start angle clockwise.
- */
- startAngle?: number;
-
- /**
- * An optional total you can specify. By specifying a total value, the sum of the values in the series must be this total in order to draw a full pie. You can use this parameter to draw only parts of a pie or gauge charts.
- */
- total?: number;
-
- /**
- * If specified the donut CSS classes will be used and strokes will be drawn instead of pie slices.
- */
- donut?: boolean;
-
- /**
- * If specified the donut segments will be drawn as shapes instead of strokes.
- */
- donutSolid?: boolean;
-
- /**
- * Specify the donut stroke width, currently done in javascript for convenience. May move to CSS styles in the future.
- * This option can be set as number or string to specify a relative width (i.e. 100 or '30%').
- */
- donutWidth?: number | string;
-
- /**
- * Specify if a label should be shown or not
- */
- showLabel?: boolean;
-
- /**
- * Label position offset from the standard position which is half distance of the radius. This value can be either positive or negative. Positive values will position the label away from the center.
- */
- labelOffset?: number;
-
- /**
- * This option can be set to 'inside', 'outside' or 'center'. Positioned with 'inside' the labels will be placed on half the distance of the radius to the border of the Pie by respecting the 'labelOffset'. The 'outside' option will place the labels at the border of the pie and 'center' will place the labels in the absolute center point of the chart. The 'center' option only makes sense in conjunction with the 'labelOffset' option.
- */
- labelPosition?: string;
-
- /**
- * An interpolation function for the label value
- */
- labelInterpolationFnc?: Function;
-
- /**
- * Label direction can be 'neutral', 'explode' or 'implode'. Default is 'neutral'. The labels anchor will be positioned based on those settings as well as the fact if the labels are on the right or left side of the center of the chart. Usually explode is useful when labels are positioned far away from the center.
- */
- labelDirection?: string;
-
- /**
- * If true the whole data is reversed including labels, the series order as well as the whole series data arrays.
- */
- reverseData?: boolean;
-
- /**
- * If true empty values will be ignored to avoid drawing unncessary slices and labels
- */
- ignoreEmptyValues?: boolean;
- }
-
- interface IChartPadding {
- top?: number;
- right?: number;
- bottom?: number;
- left?: number;
- }
-
- interface IPieChartClasses {
- chartPie?: string;
- chartDonut?: string;
- series?: string;
- slicePie?: string;
- sliceDonut?: string;
- label?: string;
- }
-
- interface IBarChartOptions extends IChartOptions {
- axisX?: IBarChartAxis;
- axisY?: IBarChartAxis;
- width?: number | string;
- height?: number | string;
- high?: number;
- low?: number;
- ticks?: Array;
- onlyInteger?: boolean;
- chartPadding?: IChartPadding;
- seriesBarDistance?: number;
-
- /**
- * If set to true this property will cause the series bars to be stacked and form a total for each series point. This will also influence the y-axis and the overall bounds of the chart. In stacked mode the seriesBarDistance property will have no effect.
- */
- stackBars?: boolean;
-
- horizontalBars?: boolean;
- distributeSeries?: boolean;
- }
-
- interface IBarChartAxis {
- offset?: number;
- position?: string;
- labelOffset?: {
- x?: number;
- y?: number;
- };
- showLabel?: boolean;
- showGrid?: boolean;
- labelInterpolationFnc?: Function;
- scaleMinSpace?: number;
- onlyInteger?: boolean;
- }
-
- interface IBarChartClasses {
- chart?: string;
- horizontalBars?: string;
- label?: string;
- labelGroup?: string;
- series?: string;
- bar?: string;
- grid?: string;
- gridGroup?: string;
- vertical?: string;
- horizontal?: string;
- start?: string;
- end?: string;
- }
-
- interface ILineChartOptions extends IChartOptions {
- axisX?: IChartistStepAxis | IChartistFixedScaleAxis | IChartistAutoScaleAxis;
- axisY?: IChartistStepAxis | IChartistFixedScaleAxis | IChartistAutoScaleAxis;
- width?: number | string;
- height?: number | string;
- showLine?: boolean;
- showPoint?: boolean;
- showArea?: boolean;
- areaBase?: number;
- lineSmooth?: Function | boolean;
- low?: number;
- high?: number;
- ticks?: Array;
- chartPadding?: IChartPadding;
- fullWidth?: boolean;
- classNames?: ILineChartClasses;
- }
-
- interface ILineChartAxis {
- offset?: number;
- position?: string;
- labelOffset?: {
- x?: number;
- y?: number;
- };
- showLabel?: boolean;
- showGrid?: boolean;
- labelInterpolationFnc?: Function;
- }
-
- interface IChartistStepAxis extends ILineChartAxis {
- type?: IStepAxisStatic;
- ticks?: Array | Array;
- stretch?: boolean;
- }
-
- interface IChartistFixedScaleAxis extends ILineChartAxis {
- type?: IFixedScaleAxisStatic;
- high?: number;
- low?: number;
- divisor?: number;
- ticks?: Array | Array;
- }
-
- interface IChartistAutoScaleAxis extends ILineChartAxis {
- high?: number;
- low?: number;
- scaleMinSpace?: number;
- onlyInteger?: boolean;
- referenceValue?: number;
- type?: IAutoScaleAxisStatic;
- }
-
- interface ILineChartClasses {
- /**
- * Default is 'ct-chart-line'
- */
- chart?: string;
- label?: string;
- labelGroup?: string;
- series?: string;
- line?: string;
- point?: string;
- area?: string;
- grid?: string;
- gridGroup?: string;
- gridBackground?: string;
- vertical?: string;
- horizontal?: string;
- start?: string;
- end?: string;
- }
-
- interface ICandleChartOptions extends IChartOptions {
-
- /**
- * Options for X-Axis
- */
- axisX?: ICandleChartAxis;
-
- /**
- * Options for Y-Axis
- */
- axisY?: ICandleChartAxis;
-
- /**
- * Specify a fixed width for the chart as a string (i.e. '100px' or '50%')
- */
- width?: number | string;
-
- /**
- * Specify a fixed height for the chart as a string (i.e. '100px' or '50%')
- */
- height?: number | string;
-
- /**
- * Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value
- */
- hight?: number | string;
-
- /**
- * Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value
- */
- low?: number | string;
-
- /**
- * Width of candle body in pixel (IMO is 2 px best minimum value)
- */
- candleWidth?: number | string;
-
- /**
- * Width of candle wick in pixel (IMO is 1 px best minimum value)
- */
- candleWickWidth?: number | string;
-
- /**
- * Use calculated x-axis step length, depending on the number of quotes to display, as candle width. Otherwise the candleWidth is being used.
- */
- useStepLengthAsCandleWidth?: boolean | string;
-
- /**
- * Use 1/3 of candle body width as width for the candle wick, otherwise the candleWickWidth is being used.
- */
- useOneThirdAsCandleWickWidth?: boolean | string;
-
- /**
- * Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5}
- */
- chartPadding?: IChartPadding | number;
-
- /**
- * When set to true, the last grid line on the x-axis is not drawn and the chart elements will expand to the full available width of the chart. For the last label to be drawncorrectly you might need to add chart padding or offset the last label with a draw event handler.
- */
- fullWidth?: boolean | string;
-
- /**
- * Override the class names that get used to generate the SVG structure of the chart
- */
- classNames?: ICandleChartClasses;
- }
-
- interface ICandleChartAxis {
- /**
- * The offset of the chart drawing area to the border of the container
- */
- offset?: number;
- /**
- * Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.
- */
- position?: string;
- /**
- * Allows you to correct label positioning on this axis by positive or negative x and y offset.
- */
- labelOffset?: {
- x?: number;
- y?: number;
- };
- /**
- * If labels should be shown or not
- */
- showLabel?: boolean;
- /**
- * If the axis grid should be drawn or not
- */
- showGrid?: boolean;
- /**
- * Interpolation function that allows you to intercept the value from the axis label
- */
- labelInterpolationFnc?: Function;
- /**
- * Set the axis type to be used to project values on this axis. If not defined, Chartist.StepAxis will be used for the X-Axis, where the ticks option will be set to the labels in the data and the stretch option will be set to the global fullWidth option. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here.
- */
- type?: any;
- }
-
- interface ICandleChartClasses {
- chart?: string;
- label?: string;
- labelGroup?: string;
- series?: string;
- candlePositive?: string;
- candleNegative?: string,
- grid?: string,
- gridGroup?: string,
- gridBackground?: string,
- vertical?: string,
- horizontal?: string,
- start?: string,
- end?: string,
- }
-
-
- interface ChartistSvgStatic {
- new (name: HTMLElement | string, attributes: Object, className?: string, parent?: Object, insertFirst?: boolean): IChartistSvg;
-
- Easing: ChartistEasingStatic;
-
- /**
- * This method checks for support of a given SVG feature like Extensibility, SVG-animation or the like. Check http://www.w3.org/TR/SVG11/feature for a detailed list.
- */
- isSupported(feature: string): boolean;
- }
-
- interface IChartistSvg {
-
- /**
- * Set attributes on the current SVG element of the wrapper you're currently working on.
- */
- attr(attributes: Object | string, ns: string): Object | string;
-
- /**
- * Create a new SVG element whose wrapper object will be selected for further operations. This way you can also create nested groups easily.
- */
- elem(name: string, attributes?: Object, className?: string, insertFirst?: boolean): IChartistSvg;
-
- /**
- * Returns the parent Chartist.SVG wrapper object
- */
- parent(): IChartistSvg;
-
- /**
- * This method returns a Chartist.Svg wrapper around the root SVG element of the current tree.
- */
- root(): IChartistSvg;
-
- /**
- * Find the first child SVG element of the current element that matches a CSS selector. The returned object is a Chartist.Svg wrapper.
- */
- querySelector(selector: string): IChartistSvg;
-
- /**
- * Find the all child SVG elements of the current element that match a CSS selector. The returned object is a Chartist.Svg.List wrapper.
- */
- querySelectorAll(selector: string): any; // this returns an svg wrapper list in the docs, need to see if that's just an array or a special list
-
- /**
- * This method creates a foreignObject (see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject) that allows to embed HTML content into a SVG graphic. With the help of foreignObjects you can enable the usage of regular HTML elements inside of SVG where they are subject for SVG positioning and transformation but the Browser will use the HTML rendering capabilities for the containing DOM.
- */
- foreignObject(content: any, attributes?: Object, className?: string, insertFirst?: boolean): IChartistSvg;
-
- /**
- * This method adds a new text element to the current Chartist.Svg wrapper.
- */
- text(t: string): IChartistSvg;
-
- /**
- * This method will clear all child nodes of the current wrapper object.
- */
- empty(): IChartistSvg;
-
- /**
- * This method will cause the current wrapper to remove itself from its parent wrapper. Use this method if you'd like to get rid of an element in a given DOM structure.
- */
- remove(): IChartistSvg;
-
- /**
- * This method will replace the element with a new element that can be created outside of the current DOM.
- */
- replace(): IChartistSvg;
-
- /**
- * This method will append an element to the current element as a child.
- */
- append(element: IChartistSvg, insertFirst?: boolean): IChartistSvg;
-
- /**
- * Returns an array of class names that are attached to the current wrapper element. This method can not be chained further.
- */
- classes(): Array;
-
- /**
- * Adds one or a space separated list of classes to the current element and ensures the classes are only existing once.
- *
- * @method addClass
- * @param names {string} A white space separated list of class names
- */
- addClass(names: string): IChartistSvg;
-
- /**
- * Removes one or a space separated list of classes from the current element.
- *
- * @method removeClass
- * @param names {string} A white space separated list of class names
- */
- removeClass(names: string): IChartistSvg;
-
- /**
- * Removes all classes from the current element.
- */
- removeAllClasses(): IChartistSvg;
-
- /**
- * Get element height with fallback to svg BoundingBox or parent container dimensions
- */
- height(): number;
-
- /**
- * The animate function lets you animate the current element with SMIL animations. You can add animations for multiple attributes at the same time by using an animation definition object. This object should contain SMIL animation attributes.
- */
- animate(animations: IChartistAnimations, guided: boolean, eventEmitter: Object): IChartistSvg;
-
- /**
- * "Safe" way to get property value from svg BoundingBox. This is a workaround. Firefox throws an NS_ERROR_FAILURE error if getBBox() is called on an invisible node.
- * THIS IS A WORKAROUND
- */
- getBBoxProperty(node: SVGElement, prop: string): string; // TODO: find a good example of this and add it to the tests, it might belong to static
- }
-
- interface IChartistAnimations {
- [Key: string]: IChartistAnimationOptions;
- }
-
- interface IChartistAnimationOptions {
- id?: string;
- dur: string | number;
- from: string | number;
- to: string | number;
- easing?: IChartistEasingDefinition | string;
- fill?: string;
- begin?: string;
- }
-
- interface IChartistEasingDefinition {
- 0: number;
- 1: number;
- 2: number;
- 3: number;
- }
-
- interface ChartistEasingStatic {
- easeInSine: IChartistEasingDefinition;
- easeOutSine: IChartistEasingDefinition;
- easeInOutSine: IChartistEasingDefinition;
- easeInQuad: IChartistEasingDefinition;
- easeOutQuad: IChartistEasingDefinition;
- easeInOutQuad: IChartistEasingDefinition;
- easeInCubic: IChartistEasingDefinition;
- easeOutCubic: IChartistEasingDefinition;
- easeInOutCubic: IChartistEasingDefinition;
- easeInQuart: IChartistEasingDefinition;
- easeOutQuart: IChartistEasingDefinition;
- easeInOutQuart: IChartistEasingDefinition;
- easeInQuint: IChartistEasingDefinition;
- easeOutQuint: IChartistEasingDefinition;
- easeInOutQuint: IChartistEasingDefinition;
- easeInExpo: IChartistEasingDefinition;
- easeOutExpo: IChartistEasingDefinition;
- easeInOutExpo: IChartistEasingDefinition;
- easeInCirc: IChartistEasingDefinition;
- easeOutCirc: IChartistEasingDefinition;
- easeInOutCirc: IChartistEasingDefinition;
- easeInBack: IChartistEasingDefinition;
- easeOutBack: IChartistEasingDefinition;
- easeInOutBack: IChartistEasingDefinition;
- }
-
- interface ChartistInterpolationStatic {
-
- /**
- * This interpolation function does not smooth the path and the result is only containing lines and no curves.
- */
- none(options?: IChartistInterpolationOptions): Function;
-
- /**
- * Simple smoothing creates horizontal handles that are positioned with a fraction of the length between two data points. You can use the divisor option to specify the amount of smoothing.
- */
- simple(options?: IChartistSimpleInterpolationOptions): Function;
-
- /**
- * Cardinal / Catmull-Rome spline interpolation is the default smoothing function in Chartist. It produces nice results where the splines will always meet the points. It produces some artifacts though when data values are increased or decreased rapidly. The line may not follow a very accurate path and if the line should be accurate this smoothing function does not produce the best results.
- */
- cardinal(options?: IChartistCardinalInterpolationOptions): Function;
-
- /**
- * Step interpolation will cause the line chart to move in steps rather than diagonal or smoothed lines. This interpolation will create additional points that will also be drawn when the showPoint option is enabled.
- */
- step(options?: IChartistStepInterpolationOptions): Function;
- }
-
- interface IChartistInterpolationOptions {
- fillHoles?: boolean;
- }
-
- interface IChartistSimpleInterpolationOptions extends IChartistInterpolationOptions {
- divisor?: number;
- }
-
- interface IChartistCardinalInterpolationOptions extends IChartistInterpolationOptions {
- tension?: number;
- }
-
- interface IChartistStepInterpolationOptions extends IChartistInterpolationOptions {
- postpone?: boolean;
- }
+ interface ChartistStatic {
+
+ /**
+ * Precision level used internally in Chartist for rounding. If you require more decimal places you can increase this number.
+ */
+ precision: number;
+
+ /**
+ * A map with characters to escape for strings to be safely used as attribute values.
+ */
+ escapingMap: IChartistEscapeMap;
+
+ Pie: IChartistPieChart;
+ Bar: IChartistBarChart;
+ Line: IChartistLineChart;
+ Candle: IChartistCandleChart;
+
+ FixedScaleAxis: IFixedScaleAxisStatic;
+ AutoScaleAxis: IAutoScaleAxisStatic;
+ StepAxis: IStepAxisStatic;
+
+ Svg: ChartistSvgStatic;
+ Interpolation: ChartistInterpolationStatic;
+
+ noop: Function;
+
+ alphaNumerate(n: number): string;
+
+ extend(target: Object, ...sources: Object[]): Object;
+
+ replaceAll(str: string, subStr: string, newSubStr: string): string;
+
+ ensureUnit(value: number, unit: string): string;
+
+ quantity(input: string | number): Object;
+
+ query(query: Node | string): Node;
+
+ times(length: number): Array;
+
+ sum(previous: number, current: number): number;
+
+ mapMultiply(factor: number): (num: number) => number;
+
+ mapAdd(addend: number): (num: number) => number;
+
+ serialMap(arr: Array, cb: Function): Array;
+
+ roundWithPrecision(value: number, digits?: number): number;
+
+ getMultiValue(value: any, dimension?: any): number; // this method is not documented, but it is used in the examples
+
+ serialize(data: Object | string | number): string;
+
+ deserialize(data: string): Object | string | number;
+
+ createSvg(container: Node, width: string, height: string, className: string): Object; // TODO: Figure out if this is returning a ChartistSVGWrapper or an actual SVGElement
+
+ plugins: any;
+ }
+
+ interface IChartistEscapeMap {
+ [Key: string]: string;
+ }
+
+ interface IResponsiveOptionTuple extends Array {
+ 0: string;
+ 1: T;
+ }
+
+ // these have no other purpose than to help define the types that can be placed on
+ // a line chart axisX
+ // in the actual chartist library these are classes that project their options onto
+ // the parent class
+ interface IFixedScaleAxisStatic {
+ }
+
+ interface IAutoScaleAxisStatic {
+ }
+
+ interface IStepAxisStatic {
+ }
+
+ // data formats are not well documented on all the ways they can be passed to the constructors
+ // this definition gives some intellisense, but does not protect the user from misuse
+ // TODO: come in and tidy this up and make it fit better
+ interface IChartistData {
+ labels?: Array | Array | Array;
+ series: Array | Array> | Array | Array>;
+ }
+
+ interface IChartistSeriesData {
+ name?: string;
+ value?: number;
+ data?: Array;
+ className?: string;
+ meta?: string; // I assume this could probably be a number as well?
+ }
+
+ interface IChartistBase {
+ container: any;
+ data: IChartistData;
+ defaultOptions: T;
+ options: T;
+ responsiveOptions: Array>;
+
+ // this most likely doesn't need to be exposed to the user
+ eventEmitter: any;
+
+ supportsForeignObject: boolean;
+ supportsAnimations: boolean;
+ resizeListener: any;
+
+ plugins?: Array; // all of these plugins seem to be functions with options, but keeping type any for now
+
+ update(data: Object, options?: T, override?: boolean): void;
+
+ detach(): void;
+
+ /**
+ * Use this function to register event handlers. The handler callbacks are synchronous and will run in the main thread rather than the event loop.
+ *
+ * @method on
+ * @param event {string} Name of the event. Check the examples for supported events.
+ * @param handler {Function} The handler function that will be called when an event with the given name was emitted. This function will receive a data argument which contains event data. See the example for more details.
+ */
+ on(event: string, handler: Function): IChartistBase;
+
+ /**
+ * Use this function to un-register event handlers. If the handler function parameter is omitted all handlers for the given event will be un-registered.
+ *
+ * @method off
+ * @param event {string} Name of the event for which a handler should be removed
+ * @param handler {Function} The handler function that that was previously used to register a new event handler. This handler will be removed from the event handler list. If this parameter is omitted then all event handlers for the given event are removed from the list.
+ */
+ off(event: string, handler?: Function): IChartistBase;
+ }
+
+ interface IChartistPieChart extends IChartistBase {
+ new (target: any, data: IChartistData, options?: IPieChartOptions, responsiveOptions?: Array>): IChartistPieChart;
+ }
+
+ interface IChartistLineChart extends IChartistBase {
+ new (target: any, data: IChartistData, options?: ILineChartOptions, responsiveOptions?: Array>): IChartistLineChart;
+ }
+
+ interface IChartistBarChart extends IChartistBase {
+ new (target: any, data: IChartistData, options?: IBarChartOptions, responsiveOptions?: Array>): IChartistBarChart;
+ }
+
+ interface IChartistCandleChart extends IChartistBase {
+ new (target: any, data: IChartistData, options?: ICandleChartOptions, responsiveOptions?: Array>): IChartistCandleChart;
+ }
+
+ interface IChartOptions {
+ /**
+ * If true the whole data is reversed including labels, the series order as well as the whole series data arrays.
+ */
+ reverseData?: boolean;
+
+ plugins?: Array;
+ }
+
+ interface IPieChartOptions extends IChartOptions {
+ /**
+ * Specify a fixed width for the chart as a string (i.e. '100px' or '50%')
+ */
+ width?: number | string;
+
+ /**
+ * Specify a fixed height for the chart as a string (i.e. '100px' or '50%')
+ */
+ height?: number | string;
+
+ /**
+ * Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5}
+ */
+ chartPadding?: IChartPadding | number;
+
+ /**
+ * Override the class names that are used to generate the SVG structure of the chart
+ */
+ classNames?: IPieChartClasses;
+
+ /**
+ * The start angle of the pie chart in degrees where 0 points north. A higher value offsets the start angle clockwise.
+ */
+ startAngle?: number;
+
+ /**
+ * An optional total you can specify. By specifying a total value, the sum of the values in the series must be this total in order to draw a full pie. You can use this parameter to draw only parts of a pie or gauge charts.
+ */
+ total?: number;
+
+ /**
+ * If specified the donut CSS classes will be used and strokes will be drawn instead of pie slices.
+ */
+ donut?: boolean;
+
+ /**
+ * If specified the donut segments will be drawn as shapes instead of strokes.
+ */
+ donutSolid?: boolean;
+
+ /**
+ * Specify the donut stroke width, currently done in javascript for convenience. May move to CSS styles in the future.
+ * This option can be set as number or string to specify a relative width (i.e. 100 or '30%').
+ */
+ donutWidth?: number | string;
+
+ /**
+ * Specify if a label should be shown or not
+ */
+ showLabel?: boolean;
+
+ /**
+ * Label position offset from the standard position which is half distance of the radius. This value can be either positive or negative. Positive values will position the label away from the center.
+ */
+ labelOffset?: number;
+
+ /**
+ * This option can be set to 'inside', 'outside' or 'center'. Positioned with 'inside' the labels will be placed on half the distance of the radius to the border of the Pie by respecting the 'labelOffset'. The 'outside' option will place the labels at the border of the pie and 'center' will place the labels in the absolute center point of the chart. The 'center' option only makes sense in conjunction with the 'labelOffset' option.
+ */
+ labelPosition?: string;
+
+ /**
+ * An interpolation function for the label value
+ */
+ labelInterpolationFnc?: Function;
+
+ /**
+ * Label direction can be 'neutral', 'explode' or 'implode'. Default is 'neutral'. The labels anchor will be positioned based on those settings as well as the fact if the labels are on the right or left side of the center of the chart. Usually explode is useful when labels are positioned far away from the center.
+ */
+ labelDirection?: string;
+
+ /**
+ * If true the whole data is reversed including labels, the series order as well as the whole series data arrays.
+ */
+ reverseData?: boolean;
+
+ /**
+ * If true empty values will be ignored to avoid drawing unncessary slices and labels
+ */
+ ignoreEmptyValues?: boolean;
+ }
+
+ interface IChartPadding {
+ top?: number;
+ right?: number;
+ bottom?: number;
+ left?: number;
+ }
+
+ interface IPieChartClasses {
+ chartPie?: string;
+ chartDonut?: string;
+ series?: string;
+ slicePie?: string;
+ sliceDonut?: string;
+ label?: string;
+ }
+
+ interface IBarChartOptions extends IChartOptions {
+ axisX?: IBarChartAxis;
+ axisY?: IBarChartAxis;
+ width?: number | string;
+ height?: number | string;
+ high?: number;
+ low?: number;
+ ticks?: Array;
+ onlyInteger?: boolean;
+ chartPadding?: IChartPadding;
+ seriesBarDistance?: number;
+
+ /**
+ * If set to true this property will cause the series bars to be stacked and form a total for each series point. This will also influence the y-axis and the overall bounds of the chart. In stacked mode the seriesBarDistance property will have no effect.
+ */
+ stackBars?: boolean;
+
+ horizontalBars?: boolean;
+ distributeSeries?: boolean;
+ }
+
+ interface IBarChartAxis {
+ offset?: number;
+ position?: string;
+ labelOffset?: {
+ x?: number;
+ y?: number;
+ };
+ showLabel?: boolean;
+ showGrid?: boolean;
+ labelInterpolationFnc?: Function;
+ scaleMinSpace?: number;
+ onlyInteger?: boolean;
+ }
+
+ interface IBarChartClasses {
+ chart?: string;
+ horizontalBars?: string;
+ label?: string;
+ labelGroup?: string;
+ series?: string;
+ bar?: string;
+ grid?: string;
+ gridGroup?: string;
+ vertical?: string;
+ horizontal?: string;
+ start?: string;
+ end?: string;
+ }
+
+ interface ILineChartOptions extends IChartOptions {
+ axisX?: IChartistStepAxis | IChartistFixedScaleAxis | IChartistAutoScaleAxis;
+ axisY?: IChartistStepAxis | IChartistFixedScaleAxis | IChartistAutoScaleAxis;
+ width?: number | string;
+ height?: number | string;
+ showLine?: boolean;
+ showPoint?: boolean;
+ showArea?: boolean;
+ areaBase?: number;
+ lineSmooth?: Function | boolean;
+ low?: number;
+ high?: number;
+ ticks?: Array;
+ chartPadding?: IChartPadding;
+ fullWidth?: boolean;
+ classNames?: ILineChartClasses;
+ series?: {
+ [key: string]: {
+ lineSmooth?: Function | boolean;
+ showLine?: boolean;
+ showPoint?: boolean;
+ showArea?: boolean;
+ areaBase?: number;
+ }
+ }
+ }
+
+ interface ILineChartAxis {
+ offset?: number;
+ position?: string;
+ labelOffset?: {
+ x?: number;
+ y?: number;
+ };
+ showLabel?: boolean;
+ showGrid?: boolean;
+ labelInterpolationFnc?: Function;
+ }
+
+ interface IChartistStepAxis extends ILineChartAxis {
+ type?: IStepAxisStatic;
+ ticks?: Array | Array;
+ stretch?: boolean;
+ }
+
+ interface IChartistFixedScaleAxis extends ILineChartAxis {
+ type?: IFixedScaleAxisStatic;
+ high?: number;
+ low?: number;
+ divisor?: number;
+ ticks?: Array | Array;
+ }
+
+ interface IChartistAutoScaleAxis extends ILineChartAxis {
+ high?: number;
+ low?: number;
+ scaleMinSpace?: number;
+ onlyInteger?: boolean;
+ referenceValue?: number;
+ type?: IAutoScaleAxisStatic;
+ }
+
+ interface ILineChartClasses {
+ /**
+ * Default is 'ct-chart-line'
+ */
+ chart?: string;
+ label?: string;
+ labelGroup?: string;
+ series?: string;
+ line?: string;
+ point?: string;
+ area?: string;
+ grid?: string;
+ gridGroup?: string;
+ gridBackground?: string;
+ vertical?: string;
+ horizontal?: string;
+ start?: string;
+ end?: string;
+ }
+
+ interface ICandleChartOptions extends IChartOptions {
+
+ /**
+ * Options for X-Axis
+ */
+ axisX?: ICandleChartAxis;
+
+ /**
+ * Options for Y-Axis
+ */
+ axisY?: ICandleChartAxis;
+
+ /**
+ * Specify a fixed width for the chart as a string (i.e. '100px' or '50%')
+ */
+ width?: number | string;
+
+ /**
+ * Specify a fixed height for the chart as a string (i.e. '100px' or '50%')
+ */
+ height?: number | string;
+
+ /**
+ * Overriding the natural high of the chart allows you to zoom in or limit the charts highest displayed value
+ */
+ hight?: number | string;
+
+ /**
+ * Overriding the natural low of the chart allows you to zoom in or limit the charts lowest displayed value
+ */
+ low?: number | string;
+
+ /**
+ * Width of candle body in pixel (IMO is 2 px best minimum value)
+ */
+ candleWidth?: number | string;
+
+ /**
+ * Width of candle wick in pixel (IMO is 1 px best minimum value)
+ */
+ candleWickWidth?: number | string;
+
+ /**
+ * Use calculated x-axis step length, depending on the number of quotes to display, as candle width. Otherwise the candleWidth is being used.
+ */
+ useStepLengthAsCandleWidth?: boolean | string;
+
+ /**
+ * Use 1/3 of candle body width as width for the candle wick, otherwise the candleWickWidth is being used.
+ */
+ useOneThirdAsCandleWickWidth?: boolean | string;
+
+ /**
+ * Padding of the chart drawing area to the container element and labels as a number or padding object {top: 5, right: 5, bottom: 5, left: 5}
+ */
+ chartPadding?: IChartPadding | number;
+
+ /**
+ * When set to true, the last grid line on the x-axis is not drawn and the chart elements will expand to the full available width of the chart. For the last label to be drawncorrectly you might need to add chart padding or offset the last label with a draw event handler.
+ */
+ fullWidth?: boolean | string;
+
+ /**
+ * Override the class names that get used to generate the SVG structure of the chart
+ */
+ classNames?: ICandleChartClasses;
+ }
+
+ interface ICandleChartAxis {
+ /**
+ * The offset of the chart drawing area to the border of the container
+ */
+ offset?: number;
+ /**
+ * Position where labels are placed. Can be set to `start` or `end` where `start` is equivalent to left or top on vertical axis and `end` is equivalent to right or bottom on horizontal axis.
+ */
+ position?: string;
+ /**
+ * Allows you to correct label positioning on this axis by positive or negative x and y offset.
+ */
+ labelOffset?: {
+ x?: number;
+ y?: number;
+ };
+ /**
+ * If labels should be shown or not
+ */
+ showLabel?: boolean;
+ /**
+ * If the axis grid should be drawn or not
+ */
+ showGrid?: boolean;
+ /**
+ * Interpolation function that allows you to intercept the value from the axis label
+ */
+ labelInterpolationFnc?: Function;
+ /**
+ * Set the axis type to be used to project values on this axis. If not defined, Chartist.StepAxis will be used for the X-Axis, where the ticks option will be set to the labels in the data and the stretch option will be set to the global fullWidth option. This type can be changed to any axis constructor available (e.g. Chartist.FixedScaleAxis), where all axis options should be present here.
+ */
+ type?: any;
+ }
+
+ interface ICandleChartClasses {
+ chart?: string;
+ label?: string;
+ labelGroup?: string;
+ series?: string;
+ candlePositive?: string;
+ candleNegative?: string,
+ grid?: string,
+ gridGroup?: string,
+ gridBackground?: string,
+ vertical?: string,
+ horizontal?: string,
+ start?: string,
+ end?: string,
+ }
+
+
+ interface ChartistSvgStatic {
+ new (name: HTMLElement | string, attributes: Object, className?: string, parent?: Object, insertFirst?: boolean): IChartistSvg;
+
+ Easing: ChartistEasingStatic;
+
+ /**
+ * This method checks for support of a given SVG feature like Extensibility, SVG-animation or the like. Check http://www.w3.org/TR/SVG11/feature for a detailed list.
+ */
+ isSupported(feature: string): boolean;
+ }
+
+ interface IChartistSvg {
+
+ /**
+ * Set attributes on the current SVG element of the wrapper you're currently working on.
+ */
+ attr(attributes: Object | string, ns: string): Object | string;
+
+ /**
+ * Create a new SVG element whose wrapper object will be selected for further operations. This way you can also create nested groups easily.
+ */
+ elem(name: string, attributes?: Object, className?: string, insertFirst?: boolean): IChartistSvg;
+
+ /**
+ * Returns the parent Chartist.SVG wrapper object
+ */
+ parent(): IChartistSvg;
+
+ /**
+ * This method returns a Chartist.Svg wrapper around the root SVG element of the current tree.
+ */
+ root(): IChartistSvg;
+
+ /**
+ * Find the first child SVG element of the current element that matches a CSS selector. The returned object is a Chartist.Svg wrapper.
+ */
+ querySelector(selector: string): IChartistSvg;
+
+ /**
+ * Find the all child SVG elements of the current element that match a CSS selector. The returned object is a Chartist.Svg.List wrapper.
+ */
+ querySelectorAll(selector: string): any; // this returns an svg wrapper list in the docs, need to see if that's just an array or a special list
+
+ /**
+ * This method creates a foreignObject (see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject) that allows to embed HTML content into a SVG graphic. With the help of foreignObjects you can enable the usage of regular HTML elements inside of SVG where they are subject for SVG positioning and transformation but the Browser will use the HTML rendering capabilities for the containing DOM.
+ */
+ foreignObject(content: any, attributes?: Object, className?: string, insertFirst?: boolean): IChartistSvg;
+
+ /**
+ * This method adds a new text element to the current Chartist.Svg wrapper.
+ */
+ text(t: string): IChartistSvg;
+
+ /**
+ * This method will clear all child nodes of the current wrapper object.
+ */
+ empty(): IChartistSvg;
+
+ /**
+ * This method will cause the current wrapper to remove itself from its parent wrapper. Use this method if you'd like to get rid of an element in a given DOM structure.
+ */
+ remove(): IChartistSvg;
+
+ /**
+ * This method will replace the element with a new element that can be created outside of the current DOM.
+ */
+ replace(): IChartistSvg;
+
+ /**
+ * This method will append an element to the current element as a child.
+ */
+ append(element: IChartistSvg, insertFirst?: boolean): IChartistSvg;
+
+ /**
+ * Returns an array of class names that are attached to the current wrapper element. This method can not be chained further.
+ */
+ classes(): Array;
+
+ /**
+ * Adds one or a space separated list of classes to the current element and ensures the classes are only existing once.
+ *
+ * @method addClass
+ * @param names {string} A white space separated list of class names
+ */
+ addClass(names: string): IChartistSvg;
+
+ /**
+ * Removes one or a space separated list of classes from the current element.
+ *
+ * @method removeClass
+ * @param names {string} A white space separated list of class names
+ */
+ removeClass(names: string): IChartistSvg;
+
+ /**
+ * Removes all classes from the current element.
+ */
+ removeAllClasses(): IChartistSvg;
+
+ /**
+ * Get element height with fallback to svg BoundingBox or parent container dimensions
+ */
+ height(): number;
+
+ /**
+ * The animate function lets you animate the current element with SMIL animations. You can add animations for multiple attributes at the same time by using an animation definition object. This object should contain SMIL animation attributes.
+ */
+ animate(animations: IChartistAnimations, guided: boolean, eventEmitter: Object): IChartistSvg;
+
+ /**
+ * "Safe" way to get property value from svg BoundingBox. This is a workaround. Firefox throws an NS_ERROR_FAILURE error if getBBox() is called on an invisible node.
+ * THIS IS A WORKAROUND
+ */
+ getBBoxProperty(node: SVGElement, prop: string): string; // TODO: find a good example of this and add it to the tests, it might belong to static
+ }
+
+ interface IChartistAnimations {
+ [Key: string]: IChartistAnimationOptions;
+ }
+
+ interface IChartistAnimationOptions {
+ id?: string;
+ dur: string | number;
+ from: string | number;
+ to: string | number;
+ easing?: IChartistEasingDefinition | string;
+ fill?: string;
+ begin?: string;
+ }
+
+ interface IChartistEasingDefinition {
+ 0: number;
+ 1: number;
+ 2: number;
+ 3: number;
+ }
+
+ interface ChartistEasingStatic {
+ easeInSine: IChartistEasingDefinition;
+ easeOutSine: IChartistEasingDefinition;
+ easeInOutSine: IChartistEasingDefinition;
+ easeInQuad: IChartistEasingDefinition;
+ easeOutQuad: IChartistEasingDefinition;
+ easeInOutQuad: IChartistEasingDefinition;
+ easeInCubic: IChartistEasingDefinition;
+ easeOutCubic: IChartistEasingDefinition;
+ easeInOutCubic: IChartistEasingDefinition;
+ easeInQuart: IChartistEasingDefinition;
+ easeOutQuart: IChartistEasingDefinition;
+ easeInOutQuart: IChartistEasingDefinition;
+ easeInQuint: IChartistEasingDefinition;
+ easeOutQuint: IChartistEasingDefinition;
+ easeInOutQuint: IChartistEasingDefinition;
+ easeInExpo: IChartistEasingDefinition;
+ easeOutExpo: IChartistEasingDefinition;
+ easeInOutExpo: IChartistEasingDefinition;
+ easeInCirc: IChartistEasingDefinition;
+ easeOutCirc: IChartistEasingDefinition;
+ easeInOutCirc: IChartistEasingDefinition;
+ easeInBack: IChartistEasingDefinition;
+ easeOutBack: IChartistEasingDefinition;
+ easeInOutBack: IChartistEasingDefinition;
+ }
+
+ interface ChartistInterpolationStatic {
+
+ /**
+ * This interpolation function does not smooth the path and the result is only containing lines and no curves.
+ */
+ none(options?: IChartistInterpolationOptions): Function;
+
+ /**
+ * Simple smoothing creates horizontal handles that are positioned with a fraction of the length between two data points. You can use the divisor option to specify the amount of smoothing.
+ */
+ simple(options?: IChartistSimpleInterpolationOptions): Function;
+
+ /**
+ * Cardinal / Catmull-Rome spline interpolation is the default smoothing function in Chartist. It produces nice results where the splines will always meet the points. It produces some artifacts though when data values are increased or decreased rapidly. The line may not follow a very accurate path and if the line should be accurate this smoothing function does not produce the best results.
+ */
+ cardinal(options?: IChartistCardinalInterpolationOptions): Function;
+
+ /**
+ * Step interpolation will cause the line chart to move in steps rather than diagonal or smoothed lines. This interpolation will create additional points that will also be drawn when the showPoint option is enabled.
+ */
+ step(options?: IChartistStepInterpolationOptions): Function;
+ }
+
+ interface IChartistInterpolationOptions {
+ fillHoles?: boolean;
+ }
+
+ interface IChartistSimpleInterpolationOptions extends IChartistInterpolationOptions {
+ divisor?: number;
+ }
+
+ interface IChartistCardinalInterpolationOptions extends IChartistInterpolationOptions {
+ tension?: number;
+ }
+
+ interface IChartistStepInterpolationOptions extends IChartistInterpolationOptions {
+ postpone?: boolean;
+ }
}
declare var Chartist: Chartist.ChartistStatic;
export = Chartist;
-export as namespace Chartist;
\ No newline at end of file
+export as namespace Chartist;
diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts
index d2b92e4b22..3553daada1 100644
--- a/types/chrome/index.d.ts
+++ b/types/chrome/index.d.ts
@@ -5989,6 +5989,16 @@ declare namespace chrome.tabs {
* @since Chrome 45.
*/
audible?: boolean;
+ /**
+ * Whether the tab is discarded. A discarded tab is one whose content has been unloaded from memory, but is still visible in the tab strip. Its content gets reloaded the next time it's activated.
+ * @since Chrome 54.
+ */
+ discarded: boolean;
+ /**
+ * Whether the tab can be discarded automatically by the browser when resources are low.
+ * @since Chrome 54.
+ */
+ autoDiscardable: boolean;
/**
* Optional.
* Current tab muted state and the reason for the last state change.
@@ -6153,6 +6163,11 @@ declare namespace chrome.tabs {
* @since Chrome 45.
*/
muted?: boolean;
+ /**
+ * Optional. Whether the tab should be discarded automatically by the browser when resources are low.
+ * @since Chrome 54.
+ */
+ autoDiscardable?: boolean;
}
export interface CaptureVisibleTabOptions {
@@ -6200,7 +6215,7 @@ declare namespace chrome.tabs {
* Optional. Whether the tabs have completed loading.
* One of: "loading", or "complete"
*/
- status?: string;
+ status?: 'loading' | 'complete';
/**
* Optional. Whether the tabs are in the last focused window.
* @since Chrome 19.
@@ -6212,7 +6227,7 @@ declare namespace chrome.tabs {
* Optional. The type of window the tabs are in.
* One of: "normal", "popup", "panel", "app", or "devtools"
*/
- windowType?: string;
+ windowType?: 'normal' | 'popup' | 'panel' | 'app' | 'devtools';
/** Optional. Whether the tabs are active in their windows. */
active?: boolean;
/**
@@ -6231,6 +6246,18 @@ declare namespace chrome.tabs {
currentWindow?: boolean;
/** Optional. Whether the tabs are highlighted. */
highlighted?: boolean;
+ /**
+ * Optional.
+ * Whether the tabs are discarded. A discarded tab is one whose content has been unloaded from memory, but is still visible in the tab strip. Its content gets reloaded the next time it's activated.
+ * @since Chrome 54.
+ */
+ discarded?: boolean;
+ /**
+ * Optional.
+ * Whether the tabs can be discarded automatically by the browser when resources are low.
+ * @since Chrome 54.
+ */
+ autoDiscardable?: boolean;
/** Optional. Whether the tabs are pinned. */
pinned?: boolean;
/**
@@ -6280,6 +6307,16 @@ declare namespace chrome.tabs {
* @since Chrome 45.
*/
audible?: boolean;
+ /**
+ * The tab's new discarded state.
+ * @since Chrome 54.
+ */
+ discarded?: boolean;
+ /**
+ * The tab's new auto-discardable
+ * @since Chrome 54.
+ */
+ autoDiscardable?: boolean;
/**
* The tab's new muted state and the reason for the change.
* @since Chrome 46. Warning: this is the current Beta channel.
@@ -6604,6 +6641,13 @@ declare namespace chrome.tabs {
* Paramater zoomSettings: The tab's current zoom settings.
*/
export function getZoomSettings(tabId: number, callback: (zoomSettings: ZoomSettings) => void): void;
+ /**
+ * Discards a tab from memory. Discarded tabs are still visible on the tab strip and are reloaded when activated.
+ * @since Chrome 54.
+ * @param tabId Optional. The ID of the tab to be discarded. If specified, the tab will be discarded unless it's active or already discarded. If omitted, the browser will discard the least important tab. This can fail if no discardable tabs exist.
+ * @param callback Called after the operation is completed.
+ */
+ export function discard(tabId: number, callback: (tab: Tab) => void): void;
/**
* Fired when the highlighted or selected tabs in a window changes.
diff --git a/types/ckeditor/index.d.ts b/types/ckeditor/index.d.ts
index 3370479bff..ccc58b7f71 100644
--- a/types/ckeditor/index.d.ts
+++ b/types/ckeditor/index.d.ts
@@ -224,7 +224,7 @@ declare namespace CKEDITOR {
focusPrevious(ignoreChildren?: boolean, indexToUse?: number): void;
forEach(callback: (node: node) => void, type?: number, skipRoot?: boolean): void;
getAttribute(name: string): string;
- getBogus(): Object;
+ getBogus(): node|false;
getChild(indices: number): node;
getChild(indices: number[]): node;
getChildCount(): number;
diff --git a/types/cli-table/cli-table-tests.ts b/types/cli-table/cli-table-tests.ts
new file mode 100644
index 0000000000..30d160f699
--- /dev/null
+++ b/types/cli-table/cli-table-tests.ts
@@ -0,0 +1,50 @@
+import Table = require('cli-table');
+
+/**
+ * Example.
+ */
+
+/* col widths */
+const table = new Table({
+ head: ['Rel', 'Change', 'By', 'When'],
+ colWidths: [6, 21, 25, 17]
+});
+
+table.push(
+ ['v0.1', 'Testing something cool', 'rauchg@gmail.com', '7 minutes ago'],
+ ['v0.1', 'Testing something cool', 'rauchg@gmail.com', '8 minutes ago']
+);
+
+table.toString();
+
+/* compact */
+const table1 = new Table({
+ head: ['Rel', 'Change', 'By', 'When'],
+ colWidths: [6, 21, 25, 17],
+ style : {compact : true, 'padding-left' : 1}
+});
+
+table1.push(
+ ['v0.1', 'Testing something cool', 'rauchg@gmail.com', '7 minutes ago'],
+ ['v0.1', 'Testing something cool', 'rauchg@gmail.com', '8 minutes ago'],
+ [],
+ ['v0.1', 'Testing something cool', 'rauchg@gmail.com', '8 minutes ago']
+);
+
+/* headless */
+const headless_table = new Table();
+headless_table.push(
+ ['v0.1', 'Testing something cool', 'rauchg@gmail.com', '7 minutes ago']
+);
+/* vertical */
+const vertical_table = new Table();
+vertical_table.push(
+ { "Some Key": "Some Value"},
+ { "Another much longer key": "And its corresponding longer value"}
+);
+/* cross */
+const cross_table = new Table({ head: ["", "Header #1", "Header #2"] });
+cross_table.push(
+ { "Header #3": ["Value 1", "Value 2"] },
+ { "Header #4": ["Value 3", "Value 4"] }
+);
diff --git a/types/cli-table/index.d.ts b/types/cli-table/index.d.ts
new file mode 100644
index 0000000000..a39ac2d914
--- /dev/null
+++ b/types/cli-table/index.d.ts
@@ -0,0 +1,45 @@
+// Type definitions for cli-table 0.3
+// Project: https://github.com/Automattic/cli-table
+// Definitions by: AryloYeung
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.1
+
+interface TableOptions {
+ chars: Partial>;
+ truncate: string;
+ colors: boolean;
+ colWidths: number[];
+ colAligns: Array<"left" | "middle" | "right">;
+ style: Partial<{
+ 'padding-left': number;
+ 'padding-right': number;
+ head: string[];
+ border: string[];
+ compact: boolean;
+ }>;
+ head: string[];
+}
+
+declare class Table extends Array {
+ constructor(options?: Partial);
+ toString(): string;
+ static version: string;
+}
+
+export = Table;
diff --git a/types/cli-table/tsconfig.json b/types/cli-table/tsconfig.json
new file mode 100644
index 0000000000..50afa32769
--- /dev/null
+++ b/types/cli-table/tsconfig.json
@@ -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",
+ "cli-table-tests.ts"
+ ]
+}
diff --git a/types/cli-table/tslint.json b/types/cli-table/tslint.json
new file mode 100644
index 0000000000..3db14f85ea
--- /dev/null
+++ b/types/cli-table/tslint.json
@@ -0,0 +1 @@
+{ "extends": "dtslint/dt.json" }
diff --git a/types/d3-color/d3-color-tests.ts b/types/d3-color/d3-color-tests.ts
index 47f191073b..2d324e7886 100644
--- a/types/d3-color/d3-color-tests.ts
+++ b/types/d3-color/d3-color-tests.ts
@@ -36,6 +36,7 @@ cRGB = cRGB.darker(0.2);
cRGB = cRGB.rgb();
displayable = cRGB.displayable();
cString = cRGB.toString();
+cString = cRGB.hex();
console.log('Channels = (r : %d, g: %d, b: %d)', cRGB.r, cRGB.g, cRGB.b);
console.log('Opacity = %d', cRGB.opacity);
@@ -51,6 +52,7 @@ cHSL = cHSL.darker(0.2);
cRGB = cHSL.rgb();
displayable = cHSL.displayable();
cString = cHSL.toString();
+cString = cHSL.hex();
console.log('Channels = (h : %d, s: %d, l: %d)', cHSL.h, cHSL.s, cHSL.l);
console.log('Opacity = %d', cHSL.opacity);
@@ -70,9 +72,14 @@ cLab = cLab.darker(0.2);
cRGB = cLab.rgb();
displayable = cLab.displayable();
cString = cLab.toString();
+cString = cLab.hex();
console.log('Channels = (l : %d, a: %d, b: %d)', cLab.l, cLab.a, cLab.b);
console.log('Opacity = %d', cLab.opacity);
+// Signature tests for Gray
+cLab = d3Color.gray(120);
+cLab = d3Color.gray(120, 0.5);
+
// Signature tests for HCL
let cHcl: d3Color.HCLColor;
@@ -89,9 +96,16 @@ cHcl = cHcl.darker(0.2);
cRGB = cHcl.rgb();
displayable = cHcl.displayable();
cString = cHcl.toString();
+cString = cHcl.hex();
console.log('Channels = (h : %d, c: %d, l: %d)', cHcl.h, cHcl.c, cHcl.l);
console.log('Opacity = %d', cHcl.opacity);
+cHcl = d3Color.lch(40, 50, 120);
+cHcl = d3Color.lch(40, 50, 120, 0.5);
+cHcl = d3Color.lch('steelblue');
+cHcl = d3Color.lch('rgba(20, 100, 200, 0.5)');
+cHcl = d3Color.lch(c);
+
// Signature tests for Cubehelix
let cCubehelix: d3Color.CubehelixColor;
@@ -108,6 +122,7 @@ cCubehelix = cCubehelix.darker(0.2);
cRGB = cCubehelix.rgb();
displayable = cCubehelix.displayable();
cString = cCubehelix.toString();
+cString = cCubehelix.hex();
console.log('Channels = (h : %d, s: %d, l: %d)', cCubehelix.h, cCubehelix.s, cCubehelix.l);
console.log('Opacity = %d', cCubehelix.opacity);
diff --git a/types/d3-color/index.d.ts b/types/d3-color/index.d.ts
index 825b82d9c4..56812a6bdb 100644
--- a/types/d3-color/index.d.ts
+++ b/types/d3-color/index.d.ts
@@ -1,12 +1,13 @@
-// Type definitions for D3JS d3-color module 1.0
+// Type definitions for D3JS d3-color module 1.2
// Project: https://github.com/d3/d3-color/
-// Definitions by: Tom Wanzek
-// Alex Ford
-// Boris Yankov
-// denisname
+// Definitions by: Tom Wanzek ,
+// Alex Ford ,
+// Boris Yankov ,
+// denisname ,
+// Hugues Stefanski
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-// Last module patch version validated against: 1.0.3
+// Last module patch version validated against: 1.2.0
// ---------------------------------------------------------------------------
// Shared Type Definitions and Interfaces
@@ -27,11 +28,21 @@ export interface ColorCommonInstance {
brighter(k?: number): this;
darker(k?: number): this;
rgb(): RGBColor;
+ /**
+ * Returns a hexadecimal string representing this color.
+ * If this color is not displayable, a suitable displayable color is returned instead. For example, RGB channel values greater than 255 are clamped to 255.
+ */
+ hex(): string;
}
export interface Color {
displayable(): boolean; // Note: While this method is used in prototyping for colors of specific colorspaces, it should not be called directly, as 'this.rgb' would not be implemented on Color
toString(): string; // Note: While this method is used in prototyping for colors of specific colorspaces, it should not be called directly, as 'this.rgb' would not be implemented on Color
+ /**
+ * Returns a hexadecimal string representing this color.
+ * If this color is not displayable, a suitable displayable color is returned instead. For example, RGB channel values greater than 255 are clamped to 255.
+ */
+ hex(): string;
}
export interface ColorFactory extends Function {
@@ -47,6 +58,9 @@ export interface RGBColor extends Color {
opacity: number;
brighter(k?: number): this;
darker(k?: number): this;
+ /**
+ * Returns the RGB equivalent of this color.
+ */
rgb(): this;
}
@@ -91,6 +105,11 @@ export interface LabColorFactory extends Function {
readonly prototype: LabColor;
}
+/**
+ * Constructs a new Lab color with the specified l value and a = b = 0.
+ */
+export type GrayColorFactory = (l: number, opacity?: number) => LabColor;
+
export interface HCLColor extends Color {
h: number;
c: number;
@@ -108,6 +127,12 @@ export interface HCLColorFactory extends Function {
readonly prototype: HCLColor;
}
+export interface LCHColorFactory {
+ (l: number, c: number, h: number, opacity?: number): HCLColor;
+ (cssColorSpecifier: string): HCLColor;
+ (color: ColorSpaceObject | ColorCommonInstance): HCLColor;
+}
+
export interface CubehelixColor extends Color {
h: number;
s: number;
@@ -137,6 +162,10 @@ export const hsl: HSLColorFactory;
export const lab: LabColorFactory;
+export const gray: GrayColorFactory;
+
export const hcl: HCLColorFactory;
+export const lch: LCHColorFactory;
+
export const cubehelix: CubehelixColorFactory;
diff --git a/types/d3-geo/index.d.ts b/types/d3-geo/index.d.ts
index a41f67618a..5dd835026d 100644
--- a/types/d3-geo/index.d.ts
+++ b/types/d3-geo/index.d.ts
@@ -1,6 +1,6 @@
// Type definitions for D3JS d3-geo module 1.10
// Project: https://github.com/d3/d3-geo/
-// Definitions by: Hugues Stefanski , Tom Wanzek , Alex Ford , Boris Yankov
+// Definitions by: Hugues Stefanski , Tom Wanzek , Alex Ford , Boris Yankov
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
diff --git a/types/d3-hsv/index.d.ts b/types/d3-hsv/index.d.ts
index 1728af0874..7452dbcc2b 100644
--- a/types/d3-hsv/index.d.ts
+++ b/types/d3-hsv/index.d.ts
@@ -68,6 +68,12 @@ export interface HSVColor extends Color {
* Returns the RGB equivalent of this color.
*/
rgb(): RGBColor;
+
+ /**
+ * Returns a hexadecimal string representing this color.
+ * If this color is not displayable, a suitable displayable color is returned instead. For example, RGB channel values greater than 255 are clamped to 255.
+ */
+ hex(): string;
}
export const hsv: HSVColorFactory;
diff --git a/types/discourse-sso/discourse-sso-tests.ts b/types/discourse-sso/discourse-sso-tests.ts
new file mode 100644
index 0000000000..efe7eba95b
--- /dev/null
+++ b/types/discourse-sso/discourse-sso-tests.ts
@@ -0,0 +1,16 @@
+import * as discourseSSO from 'discourse-sso';
+const sso = new discourseSSO('sso secret string');
+
+if (sso.validate('payload', 'sig')) {
+ const nonce = sso.getNonce('payload');
+
+ const userParams: discourseSSO.UserParams = {
+ nonce,
+ external_id: '1',
+ email: 'omg@mail.com',
+ username: 'myuser',
+ name: 'This Guy'
+ };
+
+ const loginString: string = sso.buildLoginString(userParams);
+}
diff --git a/types/discourse-sso/index.d.ts b/types/discourse-sso/index.d.ts
new file mode 100644
index 0000000000..b8030e0735
--- /dev/null
+++ b/types/discourse-sso/index.d.ts
@@ -0,0 +1,27 @@
+// Type definitions for discourse-sso 1.0
+// Project: https://github.com/ArmedGuy/discourse_sso_node
+// Definitions by: Arnav Gupta
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+declare class DiscourseSSO {
+ constructor(ssoSecret: string);
+ validate(payload: string, sig: string): boolean;
+ getNonce(payload: string): string;
+ buildLoginString(params: DiscourseSSO.UserParams): string;
+}
+
+declare namespace DiscourseSSO {
+ interface UserParams {
+ nonce: string;
+ external_id: string;
+ email: string;
+ admin?: boolean;
+ moderator?: boolean;
+ username?: string;
+ name?: string;
+ avatar_url?: string;
+ add_groups?: string[];
+ remove_groups?: string[];
+ }
+}
+export = DiscourseSSO;
diff --git a/types/discourse-sso/tsconfig.json b/types/discourse-sso/tsconfig.json
new file mode 100644
index 0000000000..a0f1edbad5
--- /dev/null
+++ b/types/discourse-sso/tsconfig.json
@@ -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",
+ "discourse-sso-tests.ts"
+ ]
+}
diff --git a/types/discourse-sso/tslint.json b/types/discourse-sso/tslint.json
new file mode 100644
index 0000000000..3db14f85ea
--- /dev/null
+++ b/types/discourse-sso/tslint.json
@@ -0,0 +1 @@
+{ "extends": "dtslint/dt.json" }
diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts
index a35ed40dec..a1cfc84334 100755
--- a/types/ember/index.d.ts
+++ b/types/ember/index.d.ts
@@ -1685,6 +1685,10 @@ declare module 'ember' {
target: Target,
method: ObserverMethod
): void;
+ addObserver(
+ key: keyof this,
+ method: ObserverMethod
+ ): void;
/**
* Remove an observer you have previously registered on this object. Pass
* the same key, target, and method you passed to `addObserver()` and your
@@ -1695,6 +1699,10 @@ declare module 'ember' {
target: Target,
method: ObserverMethod
): any;
+ removeObserver(
+ key: keyof this,
+ method: ObserverMethod
+ ): any;
/**
* Retrieves the value of a property, or a default value in the case that the
* property returns `undefined`.
@@ -3010,6 +3018,11 @@ declare module 'ember' {
method: ObserverMethod,
once?: boolean
): void;
+ function addListener(
+ obj: Context,
+ key: keyof Context,
+ method: ObserverMethod
+ ): void;
/**
* Remove an event listener
*/
@@ -3019,6 +3032,11 @@ declare module 'ember' {
target: Target,
method: ObserverMethod
): any;
+ function removeListener(
+ obj: Context,
+ key: keyof Context,
+ method: ObserverMethod
+ ): any;
/**
* Send an event. The execution of suspended listeners
* is skipped, and once listeners are removed. A listener without
@@ -3112,6 +3130,11 @@ declare module 'ember' {
target: Target,
method: ObserverMethod
): void;
+ function addObserver(
+ obj: Context,
+ key: keyof Context,
+ method: ObserverMethod
+ ): void;
/**
* Remove an observer you have previously registered on this object. Pass
* the same key, target, and method you passed to `addObserver()` and your
@@ -3123,6 +3146,11 @@ declare module 'ember' {
target: Target,
method: ObserverMethod
): any;
+ function removeObserver(
+ obj: Context,
+ key: keyof Context,
+ method: ObserverMethod
+ ): any;
/**
* Gets the value of a property on an object. If the property is computed,
* the function will be invoked. If the property is not defined but the
diff --git a/types/ember/test/observable.ts b/types/ember/test/observable.ts
index cf871807b2..a642da271f 100755
--- a/types/ember/test/observable.ts
+++ b/types/ember/test/observable.ts
@@ -14,6 +14,13 @@ class MyComponent extends Ember.Component {
this.removeObserver('foo', this, this.fooDidChange);
Ember.removeObserver(this, 'foo', this, 'fooDidChange');
Ember.removeObserver(this, 'foo', this, this.fooDidChange);
+ const lambda = () => {
+ this.fooDidChange(this, 'foo');
+ };
+ this.addObserver('foo', lambda);
+ this.removeObserver('foo', lambda);
+ Ember.addObserver(this, 'foo', lambda);
+ Ember.removeObserver(this, 'foo', lambda);
}
fooDidChange(sender: MyComponent, key: 'foo') {
diff --git a/types/extract-files/extract-files-tests.ts b/types/extract-files/extract-files-tests.ts
new file mode 100644
index 0000000000..862f29d5f3
--- /dev/null
+++ b/types/extract-files/extract-files-tests.ts
@@ -0,0 +1,9 @@
+import { ReactNativeFile, ReactNativeFileOptions } from "extract-files";
+
+const options: ReactNativeFileOptions = {
+ name: "",
+ type: "",
+ uri: "",
+};
+
+new ReactNativeFile(options);
diff --git a/types/extract-files/index.d.ts b/types/extract-files/index.d.ts
new file mode 100644
index 0000000000..412dc09a98
--- /dev/null
+++ b/types/extract-files/index.d.ts
@@ -0,0 +1,20 @@
+// Type definitions for extract-files 3.1
+// Project: https://github.com/jaydenseric/extract-files#readme
+// Definitions by: Edward Sammut Alessi
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+export interface ReactNativeFileOptions {
+ uri: string;
+ type: string;
+ name: string;
+}
+
+export class ReactNativeFile {
+ uri: string;
+ type: string;
+ name: string;
+
+ constructor(options: ReactNativeFileOptions);
+
+ static list(files: ReactNativeFileOptions[]): ReactNativeFile[];
+}
diff --git a/types/extract-files/tsconfig.json b/types/extract-files/tsconfig.json
new file mode 100644
index 0000000000..6c462da54e
--- /dev/null
+++ b/types/extract-files/tsconfig.json
@@ -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",
+ "extract-files-tests.ts"
+ ]
+}
diff --git a/types/extract-files/tslint.json b/types/extract-files/tslint.json
new file mode 100644
index 0000000000..3db14f85ea
--- /dev/null
+++ b/types/extract-files/tslint.json
@@ -0,0 +1 @@
+{ "extends": "dtslint/dt.json" }
diff --git a/types/fabric/fabric-impl.d.ts b/types/fabric/fabric-impl.d.ts
index e35b0ebe0d..13bde18c3e 100644
--- a/types/fabric/fabric-impl.d.ts
+++ b/types/fabric/fabric-impl.d.ts
@@ -2098,6 +2098,11 @@ interface IObjectOptions {
*/
backgroundColor?: string;
+ /**
+ * When `true`, object is cached on an additional canvas.
+ */
+ objectCaching?: boolean;
+
/**
* When defined, an object is rendered via stroke and this property specifies its color
*/
diff --git a/types/firebird/tsconfig.json b/types/firebird/tsconfig.json
index e5e2d1b6ac..ad3f26314d 100644
--- a/types/firebird/tsconfig.json
+++ b/types/firebird/tsconfig.json
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
- "es6",
- "scripthost"
+ "es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
diff --git a/types/gl-texture2d/gl-texture2d-tests.ts b/types/gl-texture2d/gl-texture2d-tests.ts
index f51046f420..2f19753538 100644
--- a/types/gl-texture2d/gl-texture2d-tests.ts
+++ b/types/gl-texture2d/gl-texture2d-tests.ts
@@ -54,11 +54,20 @@ texture2d(gl, ndarray([1, 2, 3]));
const texture = texture2d(gl, canvas);
-texture.bind();
-texture.bind(1);
texture.dispose();
texture.generateMipmap();
+texture.bind();
+texture.bind(1);
+
+texture.setPixels(canvas);
+texture.setPixels(video);
+texture.setPixels(image);
+texture.setPixels(imageData);
+texture.setPixels(ndarray([1, 2, 3]));
+texture.setPixels(canvas, [1, 1]);
+texture.setPixels(canvas, [1, 1], 0);
+
texture.magFilter = 1;
texture.minFilter = 1;
texture.mipSamples = 1;
diff --git a/types/gl-texture2d/index.d.ts b/types/gl-texture2d/index.d.ts
index 2b44b9985a..4d979d99f9 100644
--- a/types/gl-texture2d/index.d.ts
+++ b/types/gl-texture2d/index.d.ts
@@ -29,6 +29,7 @@ declare class Texture {
bind(id?: number): number;
dispose(): void;
generateMipmap(): void;
+ setPixels(data: InputType | RawObject | ndarray, offset?: [number, number], mipLevel?: GLenum): void;
}
declare function texture2d(gl: WebGLRenderingContext, array: ndarray): Texture;
diff --git a/types/h2o2/tsconfig.json b/types/h2o2/tsconfig.json
index 767fa4e7b7..870a359f9b 100644
--- a/types/h2o2/tsconfig.json
+++ b/types/h2o2/tsconfig.json
@@ -25,6 +25,9 @@
],
"inert": [
"inert/v4"
+ ],
+ "wreck": [
+ "wreck/v7"
]
},
"noEmit": true,
diff --git a/types/jwplayer/index.d.ts b/types/jwplayer/index.d.ts
index aee22c16f1..6481b59faf 100644
--- a/types/jwplayer/index.d.ts
+++ b/types/jwplayer/index.d.ts
@@ -1,10 +1,12 @@
-// Type definitions for JW Player V8.0
+// Type definitions for JW Player V8.2
// Project: https://github.com/jwplayer/jwplayer/
// Definitions by: Martin Duparc
// Tomer Kruvi
// Philipp Gürtler
// Daniel McGraw
+// Benjamin Dobson
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.2
// JW Player is the leading HTML5 & Flash video player, optimized for mobile and the desktop. Easy enough for beginners, advanced enough for pros.
@@ -89,6 +91,12 @@ interface AdImpressionParam extends CallbackParam {
wrapper: any[];
}
+interface AdScheduleParam extends CallbackParam {
+ tag: string;
+ client: string;
+ adbreaks: object[];
+}
+
interface AdStartedParam extends CallbackParam {
creativetype: string;
tag: string;
@@ -288,7 +296,11 @@ interface JWPlayer {
once(event: 'adRequest', callback: EventCallback): void;
off(event: 'adRequest'): void;
trigger(event: 'adRequest', args: AdRequestParam): void;
- on(event: 'adStarted', callback: EventCallback): void;
+ on(event: 'adSchedule', callback: EventCallback): void;
+ once(event: 'adSchedule', callback: EventCallback): void;
+ off(event: 'adSchedule'): void;
+ trigger(event: 'adSchedule', args: AdScheduleParam): void;
+ on(event: 'adStarted', callback: EventCallback): void;
once(event: 'adStarted', callback: EventCallback): void;
off(event: 'adStarted'): void;
trigger(event: 'adStarted', args: AdStartedParam): void;
@@ -424,7 +436,11 @@ interface JWPlayer {
once(event: 'seek', callback: EventCallback): void;
off(event: 'seek'): void;
trigger(event: 'seek', args: SeekParam): void;
- on(event: 'setupError', callback: EventCallback): void;
+ on(event: 'seeked', callback: () => void): void;
+ once(event: 'seeked', callback: () => void): void;
+ off(event: 'seeked'): void;
+ trigger(event: 'seeked'): void
+ on(event: 'setupError', callback: EventCallback): void;
once(event: 'setupError', callback: EventCallback): void;
off(event: 'setupError'): void;
trigger(event: 'setupError', args: ErrorParam): void;
diff --git a/types/lazy-value/tsconfig.json b/types/lazy-value/tsconfig.json
index e2e784e24f..caca4e6292 100644
--- a/types/lazy-value/tsconfig.json
+++ b/types/lazy-value/tsconfig.json
@@ -9,9 +9,7 @@
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
- "typeRoots": [
- "../"
- ],
+ "typeRoots": [ "../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
diff --git a/types/lodash/common/array.d.ts b/types/lodash/common/array.d.ts
index 5591bce088..6d4aff3056 100644
--- a/types/lodash/common/array.d.ts
+++ b/types/lodash/common/array.d.ts
@@ -929,28 +929,28 @@ declare module "../index" {
// flattenDepth
interface LoDashStatic {
- /**
- * Recursively flatten array up to depth times.
- *
- * @param array The array to recursively flatten.
- * @param number The maximum recursion depth.
- * @return Returns the new flattened array.
- */
- flattenDepth(array: ListOfRecursiveArraysOrValues | null | undefined, depth?: number): T[];
+ /**
+ * Recursively flatten array up to depth times.
+ *
+ * @param array The array to recursively flatten.
+ * @param number The maximum recursion depth.
+ * @return Returns the new flattened array.
+ */
+ flattenDepth(array: ListOfRecursiveArraysOrValues | null | undefined, depth?: number): T[];
}
interface LoDashImplicitWrapper {
- /**
- * @see _.flattenDeep
- */
- flattenDepth(this: LoDashImplicitWrapper | null | undefined>, depth?: number): LoDashImplicitWrapper;
+ /**
+ * @see _.flattenDeep
+ */
+ flattenDepth(this: LoDashImplicitWrapper | null | undefined>, depth?: number): LoDashImplicitWrapper;
}
interface LoDashExplicitWrapper {
- /**
- * @see _.flattenDeep
- */
- flattenDepth(this: LoDashExplicitWrapper | null | undefined>, depth?: number): LoDashExplicitWrapper;
+ /**
+ * @see _.flattenDeep
+ */
+ flattenDepth(this: LoDashExplicitWrapper | null | undefined>, depth?: number): LoDashExplicitWrapper;
}
// fromPairs
diff --git a/types/lodash/common/common.d.ts b/types/lodash/common/common.d.ts
index 28c4437073..d0856a006b 100644
--- a/types/lodash/common/common.d.ts
+++ b/types/lodash/common/common.d.ts
@@ -217,6 +217,8 @@ declare module "../index" {
type PropertyName = string | number | symbol;
type PropertyPath = Many;
+ type Omit = Pick;
+
/** Common interface between Arrays and jQuery objects */
type List = ArrayLike;
diff --git a/types/lodash/common/object.d.ts b/types/lodash/common/object.d.ts
index e0b1f3ebf1..5e2d539c23 100644
--- a/types/lodash/common/object.d.ts
+++ b/types/lodash/common/object.d.ts
@@ -2860,15 +2860,23 @@ declare module "../index" {
*/
omit(
object: T | null | undefined,
- ...paths: PropertyPath[]
+ ...paths: Array>
): T;
+ /**
+ * @see _.omit
+ */
+ omit(
+ object: T | null | undefined,
+ ...paths: Array>
+ ): Omit;
+
/**
* @see _.omit
*/
omit(
object: T | null | undefined,
- ...paths: PropertyPath[]
+ ...paths: Array>
): PartialObject;
}
@@ -2878,15 +2886,23 @@ declare module "../index" {
*/
omit(
this: LoDashImplicitWrapper,
- ...paths: PropertyPath[]
+ ...paths: Array>
): LoDashImplicitWrapper;
+ /**
+ * @see _.omit
+ */
+ omit(
+ this: LoDashImplicitWrapper,
+ ...paths: Array>
+ ): LoDashImplicitWrapper>;
+
/**
* @see _.omit
*/
omit(
this: LoDashImplicitWrapper,
- ...paths: PropertyPath[]
+ ...paths: Array>
): LoDashImplicitWrapper>;
}
@@ -2896,15 +2912,23 @@ declare module "../index" {
*/
omit(
this: LoDashExplicitWrapper,
- ...paths: PropertyPath[]
+ ...paths: Array>
): LoDashExplicitWrapper;
+ /**
+ * @see _.omit
+ */
+ omit(
+ this: LoDashExplicitWrapper,
+ ...paths: Array