mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 14:27:04 +00:00
Merge branch 'master' of github.com:ozum/DefinitelyTyped
This commit is contained in:
+2
-2
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -1158,6 +1158,12 @@
|
||||
"sourceRepoURL": "https://github.com/react-ga/react-ga",
|
||||
"asOfVersion": "2.3.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "react-monaco-editor",
|
||||
"typingsPackageName": "react-monaco-editor",
|
||||
"sourceRepoURL": "https://github.com/superRaytin/react-monaco-editor",
|
||||
"asOfVersion": "0.16.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "react-native-collapsible",
|
||||
"typingsPackageName": "react-native-collapsible",
|
||||
|
||||
+25
-25
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import AceDiff = require('ace-diff');
|
||||
|
||||
new AceDiff(); // $ExpectError
|
||||
|
||||
const aceDiffConstructorOpts = {
|
||||
element: '.acediff',
|
||||
left: { content: 'left content' },
|
||||
right: { content: 'right content' },
|
||||
};
|
||||
new AceDiff(aceDiffConstructorOpts); // $ExpectType AceDiff
|
||||
|
||||
const differ = new AceDiff(aceDiffConstructorOpts);
|
||||
|
||||
differ.getEditors(); // $ExpectType { left: any; right: any; }
|
||||
differ.setOptions(); // $ExpectError
|
||||
const aceDiffOpts = {
|
||||
diffGranularity: 'broad' as 'broad', // workaround: cast to avoid https://github.com/Microsoft/TypeScript/issues/11465#issuecomment-252453037
|
||||
};
|
||||
differ.setOptions(aceDiffOpts); // $ExpectType void
|
||||
differ.getNumDiffs(); // $ExpectType number
|
||||
differ.diff(); // $ExpectType void
|
||||
differ.destroy(); // $ExpectType void
|
||||
Vendored
+52
@@ -0,0 +1,52 @@
|
||||
// Type definitions for ace-diff 2.1
|
||||
// Project: https://ace-diff.github.io/ace-diff/
|
||||
// Definitions by: Mike Dodge <https://github.com/innovation-team>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export as namespace AceDiff;
|
||||
|
||||
export = AceDiff;
|
||||
|
||||
declare class AceDiff {
|
||||
constructor(opts: AceDiff.AceDiffConstructorOpts);
|
||||
getEditors(): {
|
||||
left: any;
|
||||
right: any;
|
||||
};
|
||||
setOptions(options: AceDiff.AceDiffOpts): void;
|
||||
getNumDiffs(): number;
|
||||
diff(): void;
|
||||
destroy(): void;
|
||||
}
|
||||
declare namespace AceDiff {
|
||||
interface AceDiffLROpts {
|
||||
content?: string | null;
|
||||
mode?: string;
|
||||
theme?: string;
|
||||
editable?: boolean;
|
||||
copyLinkEnabled?: boolean;
|
||||
}
|
||||
|
||||
interface AceDiffConstructorOpts extends AceDiffOpts {
|
||||
element: string | HTMLElement;
|
||||
left: AceDiffLROpts;
|
||||
right: AceDiffLROpts;
|
||||
}
|
||||
|
||||
interface AceDiffOpts {
|
||||
mode?: string;
|
||||
theme?: string;
|
||||
diffGranularity?: 'specific' | 'broad';
|
||||
showDiffs?: boolean;
|
||||
showConnectors?: boolean;
|
||||
maxDiffs?: number;
|
||||
left?: AceDiffLROpts;
|
||||
right?: AceDiffLROpts;
|
||||
classes?: {
|
||||
diff: string;
|
||||
connector: string;
|
||||
newCodeConnectorLinkContent: string;
|
||||
deletedCodeConnectorLinkContent: string;
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ace-diff-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
/// <reference types="windows-script-host" />
|
||||
|
||||
let app = new ActiveXObject('Access.Application');
|
||||
app.UserControl = true;
|
||||
|
||||
@@ -6,7 +8,7 @@ app.DoCmd.OpenForm('MyForm', Access.AcFormView.acNormal, '', 'LastName="Smith"')
|
||||
|
||||
// change the contents of a textbox
|
||||
// tslint:disable-next-line:no-unnecessary-type-assertion
|
||||
let textbox = app.Forms.Item('MyForm').Controls.Item('MyTextBox') as Access.TextBox;
|
||||
let textbox = app.Forms('MyForm').Controls('MyTextBox') as Access.TextBox;
|
||||
textbox.Text = 'Not Smith';
|
||||
|
||||
// save the current record on the active form
|
||||
|
||||
Vendored
+794
-1507
File diff suppressed because it is too large
Load Diff
@@ -2,8 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5",
|
||||
"scripthost"
|
||||
"es5"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-const-enum": false
|
||||
"no-const-enum": false,
|
||||
"max-line-length": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
// Note -- running these tests under cscript requires some ES5 polyfills
|
||||
|
||||
/// <reference types="windows-script-host" />
|
||||
/// <reference types="activex-scripting" />
|
||||
|
||||
const collectionToArray = <T>(col: { Item(key: any): T }): T[] => {
|
||||
const results: T[] = [];
|
||||
const enumerator = new Enumerator<T>(col);
|
||||
@@ -12,9 +15,9 @@ const collectionToArray = <T>(col: { Item(key: any): T }): T[] => {
|
||||
};
|
||||
|
||||
const toSafeArray = <T>(...items: T[]): SafeArray<T> => {
|
||||
const dict = new ActiveXObject('Scripting.Dictionary');
|
||||
const dict: Scripting.Dictionary<number, T> = new ActiveXObject('Scripting.Dictionary');
|
||||
items.forEach((x, index) => dict.Add(index, x));
|
||||
return dict.Items() as SafeArray<T>;
|
||||
return dict.Items();
|
||||
};
|
||||
|
||||
const toConnectionString = (o: { [index: string]: any }) => {
|
||||
|
||||
Vendored
+2
-1
@@ -4,6 +4,8 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/// <reference types="activex-interop" />
|
||||
|
||||
declare namespace ADODB {
|
||||
const enum ADCPROP_ASYNCTHREADPRIORITY_ENUM {
|
||||
adPriorityAboveNormal = 4,
|
||||
@@ -1094,7 +1096,6 @@ declare namespace ADODB {
|
||||
}
|
||||
|
||||
interface ActiveXObject {
|
||||
new<K extends keyof ActiveXObjectNameMap = any>(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;
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5",
|
||||
"scripthost"
|
||||
"es5"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/// <reference types="windows-script-host" />
|
||||
|
||||
const collectionToArray = <T>(col: { Item(key: any): T }): T[] => {
|
||||
const results: T[] = [];
|
||||
const enumerator = new Enumerator<T>(col);
|
||||
|
||||
Vendored
+1
-4
@@ -4,6 +4,7 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/// <reference types="activex-interop" />
|
||||
/// <reference types="activex-adodb" />
|
||||
|
||||
declare namespace ADOX {
|
||||
@@ -320,10 +321,6 @@ declare namespace ADOX {
|
||||
}
|
||||
}
|
||||
|
||||
interface ActiveXObject {
|
||||
new<K extends keyof ActiveXObjectNameMap = any>(progid: K): ActiveXObjectNameMap[K];
|
||||
}
|
||||
|
||||
interface ActiveXObjectNameMap {
|
||||
'ADOX.Catalog': ADOX.Catalog;
|
||||
'ADOX.Column': ADOX.Column;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es5", "scripthost"],
|
||||
"lib": [
|
||||
"es5"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/// <reference types="windows-script-host" />
|
||||
|
||||
const collectionToArray = <T>(col: { Item(key: any): T }): T[] => {
|
||||
const results: T[] = [];
|
||||
const enumerator = new Enumerator<T>(col);
|
||||
|
||||
Vendored
+2
-4
@@ -4,6 +4,8 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/// <reference types="activex-interop" />
|
||||
|
||||
declare namespace DAO {
|
||||
const enum _DAOSuppHelp {
|
||||
KeepLocal = 0,
|
||||
@@ -883,10 +885,6 @@ declare namespace DAO {
|
||||
}
|
||||
}
|
||||
|
||||
interface ActiveXObject {
|
||||
new<K extends keyof ActiveXObjectNameMap = any>(progid: K): ActiveXObjectNameMap[K];
|
||||
}
|
||||
|
||||
interface ActiveXObjectNameMap {
|
||||
'DAO.DBEngine': DAO.DBEngine;
|
||||
'DAO.Field': DAO.Field;
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5",
|
||||
"scripthost"
|
||||
"es5"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
|
||||
Vendored
+2
-5
@@ -4,6 +4,8 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.5
|
||||
|
||||
/// <reference types="activex-interop" />
|
||||
|
||||
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<K extends keyof ActiveXObjectNameMap = any>(progid: K): ActiveXObjectNameMap[K];
|
||||
}
|
||||
|
||||
interface ActiveXObjectNameMap {
|
||||
@@ -146,7 +147,3 @@ interface ActiveXObjectNameMap {
|
||||
interface EnumeratorConstructor {
|
||||
new(col: DiskQuotaTypeLibrary.DiskQuotaControl): Enumerator<DiskQuotaTypeLibrary.DIDiskQuotaUser>;
|
||||
}
|
||||
|
||||
interface SafeArray<T = any> {
|
||||
_brand: SafeArray<T>;
|
||||
}
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5",
|
||||
"scripthost"
|
||||
"es5"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
/// <reference types="windows-script-host" />
|
||||
/// <reference types="activex-msforms" />
|
||||
/// <reference types="activex-scripting" />
|
||||
|
||||
// some helpers
|
||||
const toSafeArray = <T>(...items: T[]): SafeArray<T> => {
|
||||
const dict = new ActiveXObject('Scripting.Dictionary');
|
||||
const dict: Scripting.Dictionary<number, T> = new ActiveXObject('Scripting.Dictionary');
|
||||
items.forEach((x, index) => dict.Add(index, x));
|
||||
return dict.Items() as SafeArray<T>;
|
||||
return dict.Items();
|
||||
};
|
||||
const inCollection = <T = any>(collection: { Item(index: any): T }, index: string | number): T | undefined => {
|
||||
let item: T | undefined;
|
||||
|
||||
Vendored
-1
@@ -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 <K extends keyof ActiveXObjectNameMap = any>(progid: K): ActiveXObjectNameMap[K];
|
||||
}
|
||||
|
||||
interface ActiveXObjectNameMap {
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5",
|
||||
"scripthost"
|
||||
"es5"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/// <reference types="activex-iwshruntimelibrary" />
|
||||
/// <reference types="windows-script-host" />
|
||||
/// <reference types="activex-scripting" />
|
||||
|
||||
const collectionToArray = <T>(col: { Item(index: any): T } | SafeArray<T>) => {
|
||||
const results: T[] = [];
|
||||
@@ -12,9 +13,9 @@ const collectionToArray = <T>(col: { Item(index: any): T } | SafeArray<T>) => {
|
||||
};
|
||||
|
||||
const toSafeArray = <T>(...items: T[]): SafeArray<T> => {
|
||||
const dict = new ActiveXObject('Scripting.Dictionary');
|
||||
const dict: Scripting.Dictionary<number, T> = new ActiveXObject('Scripting.Dictionary');
|
||||
items.forEach((x, index) => dict.Add(index, x));
|
||||
return dict.Items() as SafeArray<T>;
|
||||
return dict.Items();
|
||||
};
|
||||
|
||||
const VB = {
|
||||
|
||||
Vendored
-1
@@ -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<K extends keyof ActiveXObjectNameMap = any>(progid: K): ActiveXObjectNameMap[K];
|
||||
}
|
||||
|
||||
interface ActiveXObjectNameMap {
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5",
|
||||
"scripthost"
|
||||
"es5"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
|
||||
Vendored
-1
@@ -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<K extends keyof ActiveXObjectNameMap = any>(progid: K): ActiveXObjectNameMap[K];
|
||||
}
|
||||
|
||||
interface ActiveXObjectNameMap {
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5",
|
||||
"scripthost"
|
||||
"es5"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
/// <reference types="windows-script-host" />
|
||||
|
||||
const collectionToArray = <T>(col: { Item(key: any): T }): T[] => {
|
||||
const results: T[] = [];
|
||||
const enumerator = new Enumerator<T>(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);
|
||||
}
|
||||
+437
@@ -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 <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="activex-interop" />
|
||||
|
||||
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<string> | SafeArray<number>;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-const-enum": false
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
/// <reference types="windows-script-host" />
|
||||
|
||||
(() => {
|
||||
// https://wiki.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Bridge/Automation_Bridge
|
||||
|
||||
|
||||
Vendored
+2
-3
@@ -4,6 +4,8 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="activex-interop" />
|
||||
|
||||
declare class type {
|
||||
private typekey: type;
|
||||
}
|
||||
@@ -12,9 +14,6 @@ declare class sequence<T = any> {
|
||||
private typekey: sequence<T>;
|
||||
}
|
||||
|
||||
// tslint:disable-next-line no-empty-interface
|
||||
interface SafeArray<T = any> {}
|
||||
|
||||
declare namespace com.sun.star {
|
||||
namespace accessibility {
|
||||
/**
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5",
|
||||
"scripthost"
|
||||
"es5"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
|
||||
Vendored
-1
@@ -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<K extends keyof ActiveXObjectNameMap = any>(progid: K): ActiveXObjectNameMap[K];
|
||||
}
|
||||
|
||||
interface ActiveXObjectNameMap {
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5",
|
||||
"scripthost"
|
||||
"es5"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/// <reference types="windows-script-host" />
|
||||
|
||||
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;
|
||||
|
||||
Vendored
-1
@@ -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<K extends keyof ActiveXObjectNameMap = any>(progid: K): ActiveXObjectNameMap[K];
|
||||
}
|
||||
|
||||
interface ActiveXObjectNameMap {
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5",
|
||||
"scripthost"
|
||||
"es5"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/// <reference types="windows-script-host" />
|
||||
|
||||
// https://msdn.microsoft.com/en-us/library/ms764708(v=vs.85).aspx
|
||||
{
|
||||
const dom = new ActiveXObject('Msxml2.DOMDocument.6.0');
|
||||
|
||||
Vendored
+2
-1
@@ -4,6 +4,8 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="activex-interop" />
|
||||
|
||||
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<K extends keyof ActiveXObjectNameMap = any>(progid: K): ActiveXObjectNameMap[K];
|
||||
}
|
||||
|
||||
interface ActiveXObjectNameMap {
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5",
|
||||
"scripthost"
|
||||
"es5"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/// <reference types="windows-script-host" />
|
||||
/// <reference types="activex-word" />
|
||||
|
||||
const collectionToArray = <T>(col: { Item(key: any): T }): T[] => {
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5",
|
||||
"scripthost"
|
||||
"es5"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
|
||||
Vendored
+1
-1
@@ -4,6 +4,7 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/// <reference types="activex-interop" />
|
||||
/// <reference types="activex-stdole" />
|
||||
/// <reference types="activex-office" />
|
||||
|
||||
@@ -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<K extends keyof ActiveXObjectNameMap = any>(progid: K): ActiveXObjectNameMap[K];
|
||||
}
|
||||
|
||||
interface ActiveXObjectNameMap {
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5",
|
||||
"scripthost"
|
||||
"es5"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// tslint:disable-next-line no-unnecessary-generics
|
||||
const collectionToArray = <T>(col: any): T[] => {
|
||||
const collectionToArray = <T>(col: {Item(index: any): T}): T[] => {
|
||||
const results: T[] = [];
|
||||
const enumerator = new Enumerator<T>(col);
|
||||
enumerator.moveFirst();
|
||||
@@ -13,8 +13,8 @@ const collectionToArray = <T>(col: any): T[] => {
|
||||
const app = new ActiveXObject('PowerPoint.Application');
|
||||
(() => {
|
||||
// delete empty textboxes in PowerPoint
|
||||
collectionToArray<PowerPoint.Slide>(app.ActivePresentation.Slides).forEach(slide => {
|
||||
collectionToArray<PowerPoint.Shape>(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());
|
||||
|
||||
Vendored
-1
@@ -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<K extends keyof ActiveXObjectNameMap = any>(progid: K): ActiveXObjectNameMap[K];
|
||||
}
|
||||
|
||||
interface ActiveXObjectNameMap {
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5",
|
||||
"scripthost"
|
||||
"es5"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/// <reference types="windows-script-host" />
|
||||
|
||||
// Note -- running these tests under cscript requires some ES5 polyfills
|
||||
|
||||
const collectionToArray = <T>(col: { Item(key: any): T }): T[] => {
|
||||
|
||||
Vendored
+2
-1
@@ -4,6 +4,8 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/// <reference types="activex-interop" />
|
||||
|
||||
declare namespace Scripting {
|
||||
// tslint:disable-next-line:no-const-enum
|
||||
const enum CompareMethod {
|
||||
@@ -489,7 +491,6 @@ declare namespace Scripting {
|
||||
}
|
||||
|
||||
interface ActiveXObject {
|
||||
new <K extends keyof ActiveXObjectNameMap = any>(progid: K): ActiveXObjectNameMap[K];
|
||||
set(obj: Scripting.Dictionary, propertyName: 'Item', parameterTypes: [any], newValue: any): void;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5",
|
||||
"scripthost"
|
||||
"es5"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
|
||||
Vendored
+2
-5
@@ -4,6 +4,8 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/// <reference types="activex-interop" />
|
||||
|
||||
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 <K extends keyof ActiveXObjectNameMap = any>(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<SHDocVw.InternetExplorer>;
|
||||
}
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5",
|
||||
"scripthost"
|
||||
"es5"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/// <reference types="activex-iwshruntimelibrary" />
|
||||
/// <reference types="windows-script-host" />
|
||||
|
||||
const shell = new ActiveXObject('Shell.Application');
|
||||
|
||||
|
||||
Vendored
-1
@@ -1001,7 +1001,6 @@ interface ActiveXObject {
|
||||
on(
|
||||
obj: Shell32.ShellFolderViewOC, event: 'BeginDrag' | 'DefaultVerbInvoked' | 'EnumDone' | 'SelectionChanged' | 'VerbInvoked',
|
||||
handler: (this: Shell32.ShellFolderViewOC, parameter: {}) => void): void;
|
||||
new <K extends keyof ActiveXObjectNameMap = any>(progid: K): ActiveXObjectNameMap[K];
|
||||
}
|
||||
|
||||
interface ActiveXObjectNameMap {
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5",
|
||||
"scripthost"
|
||||
"es5"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
|
||||
Vendored
+8
-1
@@ -4,15 +4,23 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/// <reference types="activex-interop" />
|
||||
|
||||
declare namespace stdole {
|
||||
type IFontDisp = StdFont;
|
||||
|
||||
type IPictureDisp = StdPicture;
|
||||
|
||||
type OLE_COLOR = number;
|
||||
|
||||
type OLE_XPOS_CONTAINER = number;
|
||||
|
||||
type OLE_XPOS_PIXELS = number;
|
||||
|
||||
type OLE_YPOS_CONTAINER = number;
|
||||
|
||||
type OLE_YPOS_PIXELS = number;
|
||||
|
||||
const enum LoadPictureConstants {
|
||||
Color = 4,
|
||||
Default = 0,
|
||||
@@ -79,7 +87,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<K extends keyof ActiveXObjectNameMap = any>(progid: K): ActiveXObjectNameMap[K];
|
||||
}
|
||||
|
||||
interface ActiveXObjectNameMap {
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5",
|
||||
"scripthost"
|
||||
"es5"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/// <reference types="windows-script-host" />
|
||||
/// <reference types="activex-word" />
|
||||
|
||||
const collectionToArray = <T>(col: { Item(key: any): T }): T[] => {
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5",
|
||||
"scripthost"
|
||||
"es5"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/// <reference types="windows-script-host" />
|
||||
|
||||
// Note -- running these tests under cscript requires some ES5 polyfills
|
||||
|
||||
const collectionToArray = <T>(col: { Item(key: any): T }): T[] => {
|
||||
|
||||
Vendored
+2
-1
@@ -4,6 +4,8 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/// <reference types="activex-interop" />
|
||||
|
||||
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<K extends keyof ActiveXObjectNameMap = any>(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<TItem>(obj: WIA.Vector<TItem>, propertyName: 'Item', parameterTypes: [number], newValue: TItem): void;
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5",
|
||||
"scripthost"
|
||||
"es5"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/// <reference types="windows-script-host" />
|
||||
|
||||
// tslint:disable-next-line no-unnecessary-generics
|
||||
const collectionToArray = <T>(col: any): T[] => {
|
||||
const collectionToArray = <T>(col: {Item(index: any): T}): T[] => {
|
||||
const results: T[] = [];
|
||||
const enumerator = new Enumerator<T>(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<Word.Document>(app.Documents)
|
||||
collectionToArray(app.Documents)
|
||||
.forEach(openDocument => WScript.Echo(openDocument.Name));
|
||||
|
||||
const strMarks = collectionToArray<Word.Bookmark>(activeDoc.Bookmarks)
|
||||
|
||||
Vendored
+1
-1
@@ -4,6 +4,7 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/// <reference types="activex-interop" />
|
||||
/// <reference types="activex-office" />
|
||||
/// <reference types="activex-vbide" />
|
||||
/// <reference types="activex-stdole" />
|
||||
@@ -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<K extends keyof ActiveXObjectNameMap = any>(progid: K): ActiveXObjectNameMap[K];
|
||||
}
|
||||
|
||||
interface ActiveXObjectNameMap {
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5",
|
||||
"scripthost"
|
||||
],
|
||||
"lib": ["es5"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
|
||||
@@ -94,7 +94,8 @@ let _algoliaIndexSettings: IndexSettings = {
|
||||
allowCompressionOfIntegerArray: false,
|
||||
altCorrections: [{}],
|
||||
minProximity: 0,
|
||||
placeholders: '',
|
||||
placeholders: { '': [''] },
|
||||
camelCaseAttributes: [''],
|
||||
};
|
||||
|
||||
let _algoliaQueryParameters: QueryParameters = {
|
||||
|
||||
Vendored
+10
-2
@@ -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 {
|
||||
|
||||
Vendored
+2
@@ -33,6 +33,8 @@ interface IItemLookupOptions {
|
||||
searchIndex?: string;
|
||||
truncateReviewsAt?: number;
|
||||
variationPage?: string;
|
||||
domain?: string;
|
||||
request?: Function;
|
||||
}
|
||||
|
||||
interface IBrowseNodeLookupOptions {
|
||||
|
||||
@@ -1327,6 +1327,9 @@ function testMarkerLayer() {
|
||||
markers = markerLayer.findMarkers({ containsRange: [[0, 0], pos] });
|
||||
markers = markerLayer.findMarkers({ containsRange: [[0, 0], [0, 0]] });
|
||||
|
||||
const role = markerLayer.getRole();
|
||||
if (role) str = role;
|
||||
|
||||
// Marker creation
|
||||
marker = markerLayer.markRange(range);
|
||||
marker = markerLayer.markRange([pos, pos]);
|
||||
@@ -1738,6 +1741,10 @@ function testProject() {
|
||||
subscription = project.onDidAddBuffer(buffer => buffer.id);
|
||||
subscription = project.observeBuffers(buffer => buffer.getUri());
|
||||
|
||||
subscription = project.onDidReplace(projectSpec => {
|
||||
if (projectSpec != null) str = projectSpec.originPath;
|
||||
});
|
||||
|
||||
// Accessing the git repository
|
||||
repositories = project.getRepositories();
|
||||
|
||||
@@ -1950,32 +1957,54 @@ function testSelection() {
|
||||
selection.insertText("Replacement", { autoDecreaseIndent: true });
|
||||
selection.insertText("Replacement", { normalizeLineEndings: true });
|
||||
selection.insertText("Replacement", { undo: "skip" });
|
||||
selection.insertText("Replacement", { bypassReadOnly: true });
|
||||
selection.insertText("Replacement", { select: true, autoIndent: true,
|
||||
autoIndentNewline: true, autoDecreaseIndent: true, normalizeLineEndings: true,
|
||||
undo: "skip", preserveTrailingLineIndentation: false });
|
||||
undo: "skip", preserveTrailingLineIndentation: false, bypassReadOnly: false });
|
||||
|
||||
selection.backspace();
|
||||
selection.backspace({ bypassReadOnly: true });
|
||||
selection.deleteToPreviousWordBoundary();
|
||||
selection.deleteToPreviousWordBoundary({ bypassReadOnly: false });
|
||||
selection.deleteToNextWordBoundary();
|
||||
selection.deleteToNextWordBoundary({ bypassReadOnly: true });
|
||||
selection.deleteToBeginningOfWord();
|
||||
selection.deleteToBeginningOfWord({ bypassReadOnly: false });
|
||||
selection.deleteToBeginningOfLine();
|
||||
selection.deleteToBeginningOfLine({ bypassReadOnly: true });
|
||||
selection.delete();
|
||||
selection.delete({ bypassReadOnly: false });
|
||||
selection.deleteToEndOfLine();
|
||||
selection.deleteToEndOfLine({ bypassReadOnly: true });
|
||||
selection.deleteToEndOfWord();
|
||||
selection.deleteToEndOfWord({ bypassReadOnly: false });
|
||||
selection.deleteToBeginningOfSubword();
|
||||
selection.deleteToBeginningOfSubword({ bypassReadOnly: true });
|
||||
selection.deleteToEndOfSubword();
|
||||
selection.deleteToEndOfSubword({ bypassReadOnly: false });
|
||||
selection.deleteSelectedText();
|
||||
selection.deleteSelectedText({ bypassReadOnly: true });
|
||||
selection.deleteLine();
|
||||
selection.deleteLine({ bypassReadOnly: false });
|
||||
selection.joinLines();
|
||||
selection.joinLines({ bypassReadOnly: true });
|
||||
selection.outdentSelectedRows();
|
||||
selection.outdentSelectedRows({ bypassReadOnly: false });
|
||||
selection.autoIndentSelectedRows();
|
||||
selection.autoIndentSelectedRows({ bypassReadOnly: true });
|
||||
selection.toggleLineComments();
|
||||
selection.toggleLineComments({ bypassReadOnly: false });
|
||||
selection.cutToEndOfLine();
|
||||
selection.cutToEndOfLine(true);
|
||||
selection.cutToEndOfLine(undefined, { bypassReadOnly: true });
|
||||
selection.cutToEndOfBufferLine();
|
||||
selection.cutToEndOfBufferLine(true);
|
||||
selection.cutToEndOfBufferLine(false, { bypassReadOnly: false });
|
||||
|
||||
selection.cut();
|
||||
selection.cut(true);
|
||||
selection.cut(true, true);
|
||||
selection.cut(undefined, undefined, { bypassReadOnly: true });
|
||||
|
||||
selection.copy();
|
||||
selection.copy(true);
|
||||
@@ -1983,6 +2012,7 @@ function testSelection() {
|
||||
|
||||
selection.fold();
|
||||
selection.indentSelectedRows();
|
||||
selection.indentSelectedRows({ bypassReadOnly: false });
|
||||
|
||||
// Managing multiple selections
|
||||
selection.addSelectionBelow();
|
||||
@@ -2143,6 +2173,8 @@ function testTextBuffer() {
|
||||
num = nextRow;
|
||||
}
|
||||
|
||||
bool = buffer.hasAstral();
|
||||
|
||||
// Mutating Text
|
||||
range = buffer.setText("Test");
|
||||
buffer.setTextViaDiff("Test");
|
||||
@@ -2232,9 +2264,13 @@ function testTextBuffer() {
|
||||
|
||||
// History
|
||||
bool = buffer.undo();
|
||||
bool = buffer.undo({ selectionsMarkerLayer: markerLayer });
|
||||
bool = buffer.redo();
|
||||
bool = buffer.redo({ selectionsMarkerLayer: markerLayer });
|
||||
|
||||
num = buffer.transact<number>(500, (): number => 42);
|
||||
num = buffer.transact(500, (): number => 42);
|
||||
num = buffer.transact({ groupingInterval: 500, selectionsMarkerLayer: markerLayer },
|
||||
(): number => 42);
|
||||
|
||||
buffer.clearUndoStack();
|
||||
num = buffer.createCheckpoint();
|
||||
@@ -2434,6 +2470,8 @@ function testTextEditor() {
|
||||
|
||||
// Mutating Text
|
||||
editor.setText("Test");
|
||||
editor.setText("Test", {});
|
||||
editor.setText("Text", { bypassReadOnly: true });
|
||||
|
||||
range = editor.setTextInBufferRange(range, "Test");
|
||||
range = editor.setTextInBufferRange([pos, pos], "Test");
|
||||
@@ -2443,7 +2481,7 @@ function testTextEditor() {
|
||||
range = editor.setTextInBufferRange(range, "Test", {});
|
||||
range = editor.setTextInBufferRange([pos, pos], "Test", { normalizeLineEndings: true });
|
||||
range = editor.setTextInBufferRange(range, "Test", { normalizeLineEndings: true,
|
||||
undo: "skip" });
|
||||
undo: "skip", bypassReadOnly: false });
|
||||
|
||||
editor.insertText("Test");
|
||||
editor.insertText("Test", {});
|
||||
@@ -2455,27 +2493,45 @@ function testTextEditor() {
|
||||
editor.insertText("Test", { undo: "skip" });
|
||||
editor.insertText("Text", { autoDecreaseIndent: false, autoIndent: false,
|
||||
autoIndentNewline: false, normalizeLineEndings: false, select: false,
|
||||
undo: "skip", preserveTrailingLineIndentation: true });
|
||||
undo: "skip", preserveTrailingLineIndentation: true, bypassReadOnly: true });
|
||||
|
||||
editor.insertNewline();
|
||||
editor.insertNewline({ bypassReadOnly: false });
|
||||
editor.delete();
|
||||
editor.delete({ bypassReadOnly: true });
|
||||
editor.backspace();
|
||||
editor.backspace({ bypassReadOnly: false });
|
||||
editor.mutateSelectedText((selection, index) => { selection.clear(); });
|
||||
editor.transpose();
|
||||
editor.transpose({ bypassReadOnly: true });
|
||||
editor.upperCase();
|
||||
editor.upperCase({ bypassReadOnly: false });
|
||||
editor.lowerCase();
|
||||
editor.lowerCase({ bypassReadOnly: true });
|
||||
editor.toggleLineCommentsInSelection();
|
||||
editor.toggleLineCommentsInSelection({ bypassReadOnly: false });
|
||||
editor.insertNewlineBelow();
|
||||
editor.insertNewlineBelow({ bypassReadOnly: true });
|
||||
editor.insertNewlineAbove();
|
||||
editor.insertNewlineAbove({ bypassReadOnly: false });
|
||||
editor.deleteToBeginningOfWord();
|
||||
editor.deleteToBeginningOfWord({ bypassReadOnly: true });
|
||||
editor.deleteToPreviousWordBoundary();
|
||||
editor.deleteToPreviousWordBoundary({ bypassReadOnly: false });
|
||||
editor.deleteToNextWordBoundary();
|
||||
editor.deleteToNextWordBoundary({ bypassReadOnly: true });
|
||||
editor.deleteToBeginningOfSubword();
|
||||
editor.deleteToBeginningOfSubword({ bypassReadOnly: false });
|
||||
editor.deleteToEndOfSubword();
|
||||
editor.deleteToEndOfSubword({ bypassReadOnly: true });
|
||||
editor.deleteToBeginningOfLine();
|
||||
editor.deleteToBeginningOfLine({ bypassReadOnly: false });
|
||||
editor.deleteToEndOfLine();
|
||||
editor.deleteToEndOfLine({ bypassReadOnly: true });
|
||||
editor.deleteToEndOfWord();
|
||||
editor.deleteToEndOfWord({ bypassReadOnly: false });
|
||||
editor.deleteLine();
|
||||
editor.deleteLine({ bypassReadOnly: true });
|
||||
|
||||
// History
|
||||
editor.undo();
|
||||
@@ -2923,9 +2979,12 @@ function testTextEditor() {
|
||||
editor.setIndentationForBufferRow(42, 42, { preserveLeadingWhitespace: true });
|
||||
|
||||
editor.indentSelectedRows();
|
||||
editor.indentSelectedRows({ bypassReadOnly: false });
|
||||
editor.outdentSelectedRows();
|
||||
editor.outdentSelectedRows({ bypassReadOnly: true });
|
||||
num = editor.indentLevelForLine("Test");
|
||||
editor.autoIndentSelectedRows();
|
||||
editor.autoIndentSelectedRows({ bypassReadOnly: false });
|
||||
|
||||
// Grammars
|
||||
grammar = editor.getGrammar();
|
||||
@@ -2942,6 +3001,7 @@ function testTextEditor() {
|
||||
// Clipboard Operations
|
||||
editor.copySelectedText();
|
||||
editor.cutSelectedText();
|
||||
editor.cutSelectedText({ bypassReadOnly: true });
|
||||
|
||||
editor.pasteText();
|
||||
editor.pasteText({});
|
||||
@@ -2951,11 +3011,14 @@ function testTextEditor() {
|
||||
editor.pasteText({ normalizeLineEndings: true });
|
||||
editor.pasteText({ select: true });
|
||||
editor.pasteText({ undo: "skip" });
|
||||
editor.pasteText({ bypassReadOnly: false });
|
||||
editor.pasteText({ autoIndentNewline: true, autoIndent: true, autoDecreaseIndent: true,
|
||||
normalizeLineEndings: true, select: true, undo: "skip" });
|
||||
normalizeLineEndings: true, select: true, undo: "skip", bypassReadOnly: true });
|
||||
|
||||
editor.cutToEndOfLine();
|
||||
editor.cutToEndOfLine({ bypassReadOnly: false });
|
||||
editor.cutToEndOfBufferLine();
|
||||
editor.cutToEndOfBufferLine({ bypassReadOnly: true });
|
||||
|
||||
// Folds
|
||||
editor.foldCurrentRow();
|
||||
|
||||
Vendored
+99
-62
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Atom 1.26
|
||||
// Type definitions for Atom 1.27
|
||||
// Project: https://github.com/atom/atom
|
||||
// Definitions by: GlenCFL <https://github.com/GlenCFL>
|
||||
// smhxx <https://github.com/smhxx>
|
||||
@@ -7,7 +7,7 @@
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// NOTE: only those classes exported within this file should be retain that status below.
|
||||
// https://github.com/atom/atom/blob/v1.26.0/exports/atom.js
|
||||
// https://github.com/atom/atom/blob/v1.27.0/exports/atom.js
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
@@ -1004,6 +1004,9 @@ export interface MarkerLayer {
|
||||
/** Find markers in the layer conforming to the given parameters. */
|
||||
findMarkers(params: FindMarkerOptions): Marker[];
|
||||
|
||||
/** Get the role of the marker layer e.g. "atom.selection". */
|
||||
getRole(): string | undefined;
|
||||
|
||||
// Marker Creation
|
||||
/** Create a marker with the given range. */
|
||||
markRange(range: RangeCompatible, options?: { reversed?: boolean, invalidate?:
|
||||
@@ -1525,29 +1528,29 @@ export class TextEditor {
|
||||
|
||||
// Mutating Text
|
||||
/** Replaces the entire contents of the buffer with the given string. */
|
||||
setText(text: string): void;
|
||||
setText(text: string, options?: ReadonlyEditOptions): void;
|
||||
|
||||
/** Set the text in the given Range in buffer coordinates. */
|
||||
setTextInBufferRange(range: RangeCompatible, text: string, options?:
|
||||
TextEditOptions): Range;
|
||||
TextEditOptions & ReadonlyEditOptions): Range;
|
||||
|
||||
/* For each selection, replace the selected text with the given text. */
|
||||
insertText(text: string, options?: TextInsertionOptions): Range|false;
|
||||
insertText(text: string, options?: TextInsertionOptions & ReadonlyEditOptions): Range|false;
|
||||
|
||||
/** For each selection, replace the selected text with a newline. */
|
||||
insertNewline(): void;
|
||||
insertNewline(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* For each selection, if the selection is empty, delete the character following
|
||||
* the cursor. Otherwise delete the selected text.
|
||||
*/
|
||||
delete(): void;
|
||||
delete(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* For each selection, if the selection is empty, delete the character preceding
|
||||
* the cursor. Otherwise delete the selected text.
|
||||
*/
|
||||
backspace(): void;
|
||||
backspace(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* Mutate the text of all the selections in a single transaction.
|
||||
@@ -1561,89 +1564,89 @@ export class TextEditor {
|
||||
* If the selection is empty, the characters preceding and following the cursor
|
||||
* are swapped. Otherwise, the selected characters are reversed.
|
||||
*/
|
||||
transpose(): void;
|
||||
transpose(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* Convert the selected text to upper case.
|
||||
* For each selection, if the selection is empty, converts the containing word
|
||||
* to upper case. Otherwise convert the selected text to upper case.
|
||||
*/
|
||||
upperCase(): void;
|
||||
upperCase(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* Convert the selected text to lower case.
|
||||
* For each selection, if the selection is empty, converts the containing word
|
||||
* to upper case. Otherwise convert the selected text to upper case.
|
||||
*/
|
||||
lowerCase(): void;
|
||||
lowerCase(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* Toggle line comments for rows intersecting selections.
|
||||
* If the current grammar doesn't support comments, does nothing.
|
||||
*/
|
||||
toggleLineCommentsInSelection(): void;
|
||||
toggleLineCommentsInSelection(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/** For each cursor, insert a newline at beginning the following line. */
|
||||
insertNewlineBelow(): void;
|
||||
insertNewlineBelow(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/** For each cursor, insert a newline at the end of the preceding line. */
|
||||
insertNewlineAbove(): void;
|
||||
insertNewlineAbove(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* For each selection, if the selection is empty, delete all characters of the
|
||||
* containing word that precede the cursor. Otherwise delete the selected text.
|
||||
*/
|
||||
deleteToBeginningOfWord(): void;
|
||||
deleteToBeginningOfWord(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* Similar to ::deleteToBeginningOfWord, but deletes only back to the previous
|
||||
* word boundary.
|
||||
*/
|
||||
deleteToPreviousWordBoundary(): void;
|
||||
deleteToPreviousWordBoundary(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/** Similar to ::deleteToEndOfWord, but deletes only up to the next word boundary. */
|
||||
deleteToNextWordBoundary(): void;
|
||||
deleteToNextWordBoundary(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* For each selection, if the selection is empty, delete all characters of the
|
||||
* containing subword following the cursor. Otherwise delete the selected text.
|
||||
*/
|
||||
deleteToBeginningOfSubword(): void;
|
||||
deleteToBeginningOfSubword(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* For each selection, if the selection is empty, delete all characters of the
|
||||
* containing subword following the cursor. Otherwise delete the selected text.
|
||||
*/
|
||||
deleteToEndOfSubword(): void;
|
||||
deleteToEndOfSubword(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* For each selection, if the selection is empty, delete all characters of the
|
||||
* containing line that precede the cursor. Otherwise delete the selected text.
|
||||
*/
|
||||
deleteToBeginningOfLine(): void;
|
||||
deleteToBeginningOfLine(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* For each selection, if the selection is not empty, deletes the selection
|
||||
* otherwise, deletes all characters of the containing line following the cursor.
|
||||
* If the cursor is already at the end of the line, deletes the following newline.
|
||||
*/
|
||||
deleteToEndOfLine(): void;
|
||||
deleteToEndOfLine(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* For each selection, if the selection is empty, delete all characters of the
|
||||
* containing word following the cursor. Otherwise delete the selected text.
|
||||
*/
|
||||
deleteToEndOfWord(): void;
|
||||
deleteToEndOfWord(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/** Delete all lines intersecting selections. */
|
||||
deleteLine(): void;
|
||||
deleteLine(options?: ReadonlyEditOptions): void;
|
||||
|
||||
// History
|
||||
/** Undo the last change. */
|
||||
undo(): void;
|
||||
undo(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/** Redo the last change. */
|
||||
redo(): void;
|
||||
redo(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* Batch multiple operations as a single undo/redo step.
|
||||
@@ -2284,10 +2287,10 @@ export class TextEditor {
|
||||
{ preserveLeadingWhitespace?: boolean }): void;
|
||||
|
||||
/** Indent rows intersecting selections by one level. */
|
||||
indentSelectedRows(): void;
|
||||
indentSelectedRows(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/** Outdent rows intersecting selections by one level. */
|
||||
outdentSelectedRows(): void;
|
||||
outdentSelectedRows(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* Get the indentation level of the given line of text.
|
||||
@@ -2298,7 +2301,7 @@ export class TextEditor {
|
||||
indentLevelForLine(line: string): number;
|
||||
|
||||
/** Indent rows intersecting selections based on the grammar's suggested indent level. */
|
||||
autoIndentSelectedRows(): void;
|
||||
autoIndentSelectedRows(options?: ReadonlyEditOptions): void;
|
||||
|
||||
// Grammars
|
||||
/** Get the current Grammar of this editor. */
|
||||
@@ -2328,7 +2331,7 @@ export class TextEditor {
|
||||
copySelectedText(): void;
|
||||
|
||||
/** For each selection, cut the selected text. */
|
||||
cutSelectedText(): void;
|
||||
cutSelectedText(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* For each selection, replace the selected text with the contents of the clipboard.
|
||||
@@ -2336,19 +2339,19 @@ export class TextEditor {
|
||||
* each selection will be replaced with the content of the corresponding clipboard
|
||||
* selection text.
|
||||
*/
|
||||
pasteText(options?: TextInsertionOptions): void;
|
||||
pasteText(options?: TextInsertionOptions & ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* For each selection, if the selection is empty, cut all characters of the
|
||||
* containing screen line following the cursor. Otherwise cut the selected text.
|
||||
*/
|
||||
cutToEndOfLine(): void;
|
||||
cutToEndOfLine(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* For each selection, if the selection is empty, cut all characters of the
|
||||
* containing buffer line following the cursor. Otherwise cut the selected text.
|
||||
*/
|
||||
cutToEndOfBufferLine(): void;
|
||||
cutToEndOfBufferLine(options?: ReadonlyEditOptions): void;
|
||||
|
||||
// Folds
|
||||
/**
|
||||
@@ -3322,7 +3325,7 @@ export class Directory {
|
||||
/** Returns a boolean, always false. */
|
||||
isFile(): this is File;
|
||||
|
||||
/** Returns a roolean, always true. */
|
||||
/** Returns a boolean, always true. */
|
||||
isDirectory(): this is Directory;
|
||||
|
||||
/** Returns a boolean indicating whether or not this is a symbolic link. */
|
||||
@@ -4482,6 +4485,10 @@ export interface Project {
|
||||
/** Invoke a callback when a filesystem change occurs within any open project path. */
|
||||
onDidChangeFiles(callback: (events: FilesystemChangeEvent) => void): Disposable;
|
||||
|
||||
/** Invoke a callback whenever the project's configuration has been replaced. */
|
||||
onDidReplace(callback: (projectSpec: ProjectSpecification | null | undefined) => void):
|
||||
Disposable;
|
||||
|
||||
// Accessing the Git Repository
|
||||
/**
|
||||
* Get an Array of GitRepositorys associated with the project's directories.
|
||||
@@ -4716,107 +4723,107 @@ export interface Selection {
|
||||
|
||||
// Modifying the selected text
|
||||
/** Replaces text at the current selection. */
|
||||
insertText(text: string, options?: TextInsertionOptions): void;
|
||||
insertText(text: string, options?: TextInsertionOptions & ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* Removes the first character before the selection if the selection is empty
|
||||
* otherwise it deletes the selection.
|
||||
*/
|
||||
backspace(): void;
|
||||
backspace(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* Removes the selection or, if nothing is selected, then all characters from
|
||||
* the start of the selection back to the previous word boundary.
|
||||
*/
|
||||
deleteToPreviousWordBoundary(): void;
|
||||
deleteToPreviousWordBoundary(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* Removes the selection or, if nothing is selected, then all characters from
|
||||
* the start of the selection up to the next word boundary.
|
||||
*/
|
||||
deleteToNextWordBoundary(): void;
|
||||
deleteToNextWordBoundary(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* Removes from the start of the selection to the beginning of the current
|
||||
* word if the selection is empty otherwise it deletes the selection.
|
||||
*/
|
||||
deleteToBeginningOfWord(): void;
|
||||
deleteToBeginningOfWord(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* Removes from the beginning of the line which the selection begins on all
|
||||
* the way through to the end of the selection.
|
||||
*/
|
||||
deleteToBeginningOfLine(): void;
|
||||
deleteToBeginningOfLine(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* Removes the selection or the next character after the start of the selection
|
||||
* if the selection is empty.
|
||||
*/
|
||||
delete(): void;
|
||||
delete(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* If the selection is empty, removes all text from the cursor to the end of
|
||||
* the line. If the cursor is already at the end of the line, it removes the following
|
||||
* newline. If the selection isn't empty, only deletes the contents of the selection.
|
||||
*/
|
||||
deleteToEndOfLine(): void;
|
||||
deleteToEndOfLine(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* Removes the selection or all characters from the start of the selection to
|
||||
* the end of the current word if nothing is selected.
|
||||
*/
|
||||
deleteToEndOfWord(): void;
|
||||
deleteToEndOfWord(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* Removes the selection or all characters from the start of the selection to
|
||||
* the end of the current word if nothing is selected.
|
||||
*/
|
||||
deleteToBeginningOfSubword(): void;
|
||||
deleteToBeginningOfSubword(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* Removes the selection or all characters from the start of the selection to
|
||||
* the end of the current word if nothing is selected.
|
||||
*/
|
||||
deleteToEndOfSubword(): void;
|
||||
deleteToEndOfSubword(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/** Removes only the selected text. */
|
||||
deleteSelectedText(): void;
|
||||
deleteSelectedText(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* Removes the line at the beginning of the selection if the selection is empty
|
||||
* unless the selection spans multiple lines in which case all lines are removed.
|
||||
*/
|
||||
deleteLine(): void;
|
||||
deleteLine(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* Joins the current line with the one below it. Lines will be separated by a single space.
|
||||
* If there selection spans more than one line, all the lines are joined together.
|
||||
*/
|
||||
joinLines(): void;
|
||||
joinLines(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/** Removes one level of indent from the currently selected rows. */
|
||||
outdentSelectedRows(): void;
|
||||
outdentSelectedRows(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* Sets the indentation level of all selected rows to values suggested by the
|
||||
* relevant grammars.
|
||||
*/
|
||||
autoIndentSelectedRows(): void;
|
||||
autoIndentSelectedRows(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/**
|
||||
* Wraps the selected lines in comments if they aren't currently part of a comment.
|
||||
* Removes the comment if they are currently wrapped in a comment.
|
||||
*/
|
||||
toggleLineComments(): void;
|
||||
toggleLineComments(options?: ReadonlyEditOptions): void;
|
||||
|
||||
/** Cuts the selection until the end of the screen line. */
|
||||
cutToEndOfLine(): void;
|
||||
cutToEndOfLine(maintainClipboard?: boolean, options?: ReadonlyEditOptions): void;
|
||||
|
||||
/** Cuts the selection until the end of the buffer line. */
|
||||
cutToEndOfBufferLine(): void;
|
||||
cutToEndOfBufferLine(maintainClipboard?: boolean, options?: ReadonlyEditOptions): void;
|
||||
|
||||
/** Copies the selection to the clipboard and then deletes it. */
|
||||
cut(maintainClipboard?: boolean, fullLine?: boolean): void;
|
||||
cut(maintainClipboard?: boolean, fullLine?: boolean, options?: ReadonlyEditOptions): void;
|
||||
|
||||
/** Copies the current selection to the clipboard. */
|
||||
copy(maintainClipboard?: boolean, fullLine?: boolean): void;
|
||||
@@ -4825,7 +4832,7 @@ export interface Selection {
|
||||
fold(): void;
|
||||
|
||||
/** If the selection spans multiple rows, indent all of them. */
|
||||
indentSelectedRows(): void;
|
||||
indentSelectedRows(options?: ReadonlyEditOptions): void;
|
||||
|
||||
// Managing multiple selections
|
||||
/** Moves the selection down one row. */
|
||||
@@ -5134,6 +5141,12 @@ export class TextBuffer {
|
||||
*/
|
||||
nextNonBlankRow(startRow: number): number|null;
|
||||
|
||||
/**
|
||||
* Return true if the buffer contains any astral-plane Unicode characters that
|
||||
* are encoded as surrogate pairs.
|
||||
*/
|
||||
hasAstral(): boolean;
|
||||
|
||||
// Mutating Text
|
||||
/** Replace the entire contents of the buffer with the given text. */
|
||||
setText(text: string): Range;
|
||||
@@ -5172,7 +5185,7 @@ export class TextBuffer {
|
||||
|
||||
// Markers
|
||||
/** Create a layer to contain a set of related markers. */
|
||||
addMarkerLayer(options?: { maintainHistory?: boolean, persistent?: boolean }):
|
||||
addMarkerLayer(options?: { maintainHistory?: boolean, persistent?: boolean, role?: string }):
|
||||
MarkerLayer;
|
||||
|
||||
/**
|
||||
@@ -5210,16 +5223,18 @@ export class TextBuffer {
|
||||
* Undo the last operation. If a transaction is in progress, aborts it.
|
||||
* @return A boolean of whether or not a change was made.
|
||||
*/
|
||||
undo(): boolean;
|
||||
undo(options?: HistoryTraversalOptions): boolean;
|
||||
|
||||
/**
|
||||
* Redo the last operation.
|
||||
* @return A boolean of whether or not a change was made.
|
||||
*/
|
||||
redo(): boolean;
|
||||
redo(options?: HistoryTraversalOptions): boolean;
|
||||
|
||||
/** Batch multiple operations as a single undo/redo step. */
|
||||
transact<T>(groupingInterval: number, fn: () => T): T;
|
||||
transact<T>(optionsOrInterval: number | { groupingInterval?: number } &
|
||||
HistoryTransactionOptions, fn: () => T): T;
|
||||
/** Batch multiple operations as a single undo/redo step. */
|
||||
transact<T>(fn: () => T): T;
|
||||
|
||||
/**
|
||||
@@ -5237,20 +5252,21 @@ export class TextBuffer {
|
||||
* `::revertToCheckpoint` and `::groupChangesSinceCheckpoint`.
|
||||
* @return A checkpoint ID value.
|
||||
*/
|
||||
createCheckpoint(): number;
|
||||
createCheckpoint(options?: HistoryTransactionOptions): number;
|
||||
|
||||
/**
|
||||
* Revert the buffer to the state it was in when the given checkpoint was created.
|
||||
* @return A boolean indicating whether the operation succeeded.
|
||||
*/
|
||||
revertToCheckpoint(checkpoint: number): boolean;
|
||||
revertToCheckpoint(checkpoint: number, options?: HistoryTraversalOptions):
|
||||
boolean;
|
||||
|
||||
/**
|
||||
* Group all changes since the given checkpoint into a single transaction for
|
||||
* purposes of undo/redo.
|
||||
* @return A boolean indicating whether the operation succeeded.
|
||||
*/
|
||||
groupChangesSinceCheckpoint(checkpoint: number): boolean;
|
||||
groupChangesSinceCheckpoint(checkpoint: number, options?: HistoryTransactionOptions): boolean;
|
||||
|
||||
/**
|
||||
* Group the last two text changes for purposes of undo/redo.
|
||||
@@ -5828,7 +5844,7 @@ export interface TextEditorObservedEvent {
|
||||
// information under certain contexts.
|
||||
|
||||
// NOTE: the config schema with these defaults can be found here:
|
||||
// https://github.com/atom/atom/blob/v1.26.0/src/config-schema.js
|
||||
// https://github.com/atom/atom/blob/v1.27.0/src/config-schema.js
|
||||
/**
|
||||
* Allows you to strongly type Atom configuration variables. Additional key:value
|
||||
* pairings merged into this interface will result in configuration values under
|
||||
@@ -6356,6 +6372,16 @@ export interface FindMarkerOptions {
|
||||
intersectsRow?: number;
|
||||
}
|
||||
|
||||
export interface HistoryTransactionOptions {
|
||||
/** When provided, skip taking snapshot for other selections markerLayers except given one. */
|
||||
selectionsMarkerLayer?: MarkerLayer;
|
||||
}
|
||||
|
||||
export interface HistoryTraversalOptions {
|
||||
/** Restore snapshot of selections marker layer to given selectionsMarkerLayer. */
|
||||
selectionsMarkerLayer?: MarkerLayer;
|
||||
}
|
||||
|
||||
export interface MenuOptions {
|
||||
/** The menu itme's label. */
|
||||
label: string;
|
||||
@@ -6413,6 +6439,11 @@ export interface ProcessOptions extends NodeProcessOptions {
|
||||
autoStart?: boolean;
|
||||
}
|
||||
|
||||
export interface ReadonlyEditOptions {
|
||||
/** Whether the readonly protections on the text editor should be ignored. */
|
||||
bypassReadOnly?: boolean;
|
||||
}
|
||||
|
||||
export interface ScanContextOptions {
|
||||
/** The number of lines before the matched line to include in the results object. */
|
||||
leadingContextLineCount?: number;
|
||||
@@ -6822,6 +6853,12 @@ export interface ProjectHistory {
|
||||
lastOpened: Date;
|
||||
}
|
||||
|
||||
export interface ProjectSpecification {
|
||||
paths: string[];
|
||||
originPath: string;
|
||||
config?: ConfigValues;
|
||||
}
|
||||
|
||||
export interface ScandalResult {
|
||||
filePath: string;
|
||||
matches: Array<{
|
||||
|
||||
Vendored
+3
-2
@@ -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;
|
||||
}
|
||||
|
||||
@@ -93,6 +93,7 @@ str = apiGwEvtReqCtx.identity.sourceIp;
|
||||
strOrNull = apiGwEvtReqCtx.identity.user;
|
||||
strOrNull = apiGwEvtReqCtx.identity.userAgent;
|
||||
strOrNull = apiGwEvtReqCtx.identity.userArn;
|
||||
str = apiGwEvtReqCtx.path;
|
||||
str = apiGwEvtReqCtx.stage;
|
||||
str = apiGwEvtReqCtx.requestId;
|
||||
str = apiGwEvtReqCtx.resourceId;
|
||||
@@ -525,6 +526,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 +803,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<void>) => {};
|
||||
|
||||
let cloudFrontRequestHandler: AWSLambda.CloudFrontRequestHandler = (event: AWSLambda.CloudFrontRequestEvent, context: AWSLambda.Context, cb: AWSLambda.CloudFrontRequestCallback) => {
|
||||
cb();
|
||||
cb(null);
|
||||
|
||||
Vendored
+55
@@ -42,6 +42,7 @@ export interface APIGatewayEventRequestContext {
|
||||
userAgent: string | null;
|
||||
userArn: string | null;
|
||||
};
|
||||
path: string;
|
||||
stage: string;
|
||||
requestId: string;
|
||||
requestTimeEpoch: number;
|
||||
@@ -501,6 +502,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 +706,8 @@ export type ProxyCallback = APIGatewayProxyCallback; // Old name
|
||||
|
||||
// TODO: IoT
|
||||
|
||||
export type CodePipelineHandler = Handler<CodePipelineEvent, void>;
|
||||
|
||||
export type CloudFrontRequestHandler = Handler<CloudFrontRequestEvent, CloudFrontRequestResult>;
|
||||
export type CloudFrontRequestCallback = Callback<CloudFrontRequestResult>;
|
||||
|
||||
|
||||
+327
-271
@@ -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<Chartist.IResponsiveOptionTuple<Chartist.IBarChartOptions>> = [
|
||||
['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;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Vendored
+717
-692
File diff suppressed because it is too large
Load Diff
Vendored
+46
-2
@@ -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.
|
||||
|
||||
@@ -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"] }
|
||||
);
|
||||
Vendored
+45
@@ -0,0 +1,45 @@
|
||||
// Type definitions for cli-table 0.3
|
||||
// Project: https://github.com/Automattic/cli-table
|
||||
// Definitions by: AryloYeung <https://github.com/arylo>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
interface TableOptions {
|
||||
chars: Partial<Record<(
|
||||
'top' |
|
||||
'top-mid' |
|
||||
'top-left' |
|
||||
'top-right' |
|
||||
'bottom' |
|
||||
'bottom-mid' |
|
||||
'bottom-left' |
|
||||
'bottom-right' |
|
||||
'left' |
|
||||
'left-mid' |
|
||||
'mid' |
|
||||
'mid-mid' |
|
||||
'right' |
|
||||
'right-mid' |
|
||||
'middle'
|
||||
), string>>;
|
||||
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<TableOptions>);
|
||||
toString(): string;
|
||||
static version: string;
|
||||
}
|
||||
|
||||
export = Table;
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -0,0 +1,119 @@
|
||||
import * as React from "react";
|
||||
import { createSubscription, Subscription } from "create-subscription";
|
||||
|
||||
//
|
||||
// Example: Subscribing to event dispatchers
|
||||
// https://github.com/facebook/react/blob/fa7fa812c70084e139d13437fb204fcdf9152299/packages/create-subscription/README.md#subscribing-to-event-dispatchers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Start with a simple component.
|
||||
// In this case, it's a functional component, but it could have been a class.
|
||||
function FollowerComponent({ followersCount }: { followersCount: number }) {
|
||||
return <div>You have {followersCount} followers!</div>;
|
||||
}
|
||||
|
||||
interface EventDispatcher<T> {
|
||||
value: T;
|
||||
addEventListener(eventName: "change", onChange: (newValue: T) => any): void;
|
||||
removeEventListener(eventName: "change", onChange: (newValue: T) => any): void;
|
||||
}
|
||||
|
||||
// Create a wrapper component to manage the subscription.
|
||||
// $ExpectType Subscription<EventDispatcher<number>, number>
|
||||
const EventHandlerSubscription = createSubscription({
|
||||
getCurrentValue: (eventDispatcher: EventDispatcher<number>) => eventDispatcher.value,
|
||||
subscribe: (eventDispatcher: EventDispatcher<number>, callback) => {
|
||||
const onChange = (event: any) => callback(eventDispatcher.value);
|
||||
eventDispatcher.addEventListener("change", onChange);
|
||||
return () => eventDispatcher.removeEventListener("change", onChange);
|
||||
}
|
||||
});
|
||||
|
||||
declare const eventDispatcher: EventDispatcher<number>;
|
||||
|
||||
// Your component can now be used as shown below.
|
||||
// In this example, 'eventDispatcher' represents a generic event dispatcher.
|
||||
<EventHandlerSubscription source={eventDispatcher}>
|
||||
{value => {
|
||||
// $ExpectType number
|
||||
const followersCount = value;
|
||||
return <FollowerComponent followersCount={followersCount} />;
|
||||
}}
|
||||
</EventHandlerSubscription>;
|
||||
|
||||
//
|
||||
// Example: Subscribing to event dispatchers
|
||||
// https://github.com/facebook/react/blob/fa7fa812c70084e139d13437fb204fcdf9152299/packages/create-subscription/README.md#subscribing-to-a-promise
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Start with a simple component.
|
||||
const LoadingComponent: React.SFC<{ loadingStatus: string | undefined }> = ({ loadingStatus }) => {
|
||||
if (loadingStatus === undefined) {
|
||||
// Loading
|
||||
} else if (loadingStatus === null) {
|
||||
// Error
|
||||
} else {
|
||||
// Success
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
// Wrap the functional component with a subscriber HOC.
|
||||
// This HOC will manage subscriptions and pass values to the decorated component.
|
||||
// It will add and remove subscriptions in an async-safe way when props change.
|
||||
// $ExpectType Subscription<Promise<string>, string | undefined>
|
||||
const PromiseSubscription = createSubscription({
|
||||
getCurrentValue: promise => {
|
||||
// There is no way to synchronously read a Promise's value,
|
||||
// So this method should return undefined.
|
||||
return undefined;
|
||||
},
|
||||
subscribe: (promise: Promise<string>, callback: (newValue: string | undefined) => void) => {
|
||||
promise.then(
|
||||
// Success
|
||||
callback,
|
||||
// Failure
|
||||
() => callback(undefined)
|
||||
);
|
||||
|
||||
// There is no way to "unsubscribe" from a Promise.
|
||||
// create-subscription will still prevent stale values from rendering.
|
||||
return () => {};
|
||||
}
|
||||
});
|
||||
|
||||
declare const loadingPromise: Promise<string>;
|
||||
|
||||
// Your component can now be used as shown below.
|
||||
<PromiseSubscription source={loadingPromise}>
|
||||
{value => {
|
||||
// $ExpectType string | undefined
|
||||
const loadingStatus = value;
|
||||
return <LoadingComponent loadingStatus={loadingStatus} />;
|
||||
}}
|
||||
</PromiseSubscription>;
|
||||
|
||||
//
|
||||
// Error cases
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
declare const wrongPromise: Promise<number>;
|
||||
|
||||
// $ExpectError
|
||||
<PromiseSubscription source={wrongPromise}>
|
||||
{value => null}
|
||||
</PromiseSubscription>;
|
||||
|
||||
// $ExpectError
|
||||
const MismatchSubscription = createSubscription({
|
||||
getCurrentValue: (a: number) => null,
|
||||
subscribe: (a: string, callback) => (() => undefined)
|
||||
});
|
||||
|
||||
// $ExpectError
|
||||
const NoUnsubscribe = createSubscription({
|
||||
getCurrentValue: (a: number) => a,
|
||||
subscribe: (a: number, callback) => {
|
||||
// oops, should've returned a callback here
|
||||
}
|
||||
});
|
||||
Vendored
+37
@@ -0,0 +1,37 @@
|
||||
// Type definitions for create-subscription 16.4
|
||||
// Project: https://github.com/facebook/react/tree/master/packages/create-subscription
|
||||
// Definitions by: Asana <https://github.com/Asana>
|
||||
// Vincent Siao <https://github.com/vsiao>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
import * as React from "react";
|
||||
|
||||
export type Unsubscribe = () => any;
|
||||
|
||||
export interface SubscriptionConfig<S, T> {
|
||||
/**
|
||||
* Synchronously gets the value for the subscribed property.
|
||||
* Return undefined if the subscribable value is undefined,
|
||||
* Or does not support synchronous reading (e.g. native Promise).
|
||||
*/
|
||||
getCurrentValue: (source: S) => T;
|
||||
|
||||
/**
|
||||
* Set up a subscription for the subscribable value in props, and return an unsubscribe function.
|
||||
* Return false to indicate the property cannot be unsubscribed from (e.g. native Promises).
|
||||
* Due to the variety of change event types, subscribers should provide their own handlers.
|
||||
* Those handlers should not attempt to update state though;
|
||||
* They should call the callback() instead when a subscription changes.
|
||||
*/
|
||||
subscribe: (source: S, callback: (newValue: T) => void) => Unsubscribe;
|
||||
}
|
||||
|
||||
export interface SubscriptionProps<S, T> {
|
||||
children: (value: T) => React.ReactNode;
|
||||
source: S;
|
||||
}
|
||||
|
||||
export interface Subscription<S, T> extends React.ComponentClass<SubscriptionProps<S, T>> {}
|
||||
|
||||
export function createSubscription<S, T>(config: SubscriptionConfig<S, T>): Subscription<S, T>;
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"jsx": "react",
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"create-subscription-tests.tsx"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+19
@@ -4,6 +4,7 @@
|
||||
// Shenghan Gao <https://github.com/wy193777>
|
||||
// Yuri Pereira Constante <https://github.com/ypconstante>
|
||||
// Jan-Niclas Struewer <https://github.com/janniclas>
|
||||
// Cerberuser <https://github.com/cerberuser>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
//
|
||||
// Translation from Objects in help to Typescript interface.
|
||||
@@ -4527,4 +4528,22 @@ declare namespace cytoscape {
|
||||
*/
|
||||
promise(animationEvent?: "completed" | "complete" | "frame"): Promise<EventObject>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cytoscape extension type
|
||||
* Definition of an extension would be in following form:
|
||||
* @example
|
||||
* declare module 'cytoscape-ext' {
|
||||
* const ext: cytoscape.Ext;
|
||||
* export = ext;
|
||||
* }
|
||||
*/
|
||||
type Ext = (cytoscape: (options?: CytoscapeOptions) => Core) => void;
|
||||
/**
|
||||
* Register imported extension into cytoscape
|
||||
* @param module Entry point for the extension, got by module = require('cy-ext')
|
||||
* or by import module from 'cy-ext'
|
||||
* http://js.cytoscape.org/#extensions
|
||||
*/
|
||||
function use(module: Ext): void;
|
||||
}
|
||||
|
||||
Vendored
+3
-3
@@ -195,21 +195,21 @@ export interface BrushBehavior<Datum> {
|
||||
* Create a new two-dimensional brush.
|
||||
*
|
||||
* The generic "Datum" refers to the type of the data of the selected svg:g element to
|
||||
* which the returned BrushBEhavoir will be applied.
|
||||
* which the returned BrushBehavior will be applied.
|
||||
*/
|
||||
export function brush<Datum>(): BrushBehavior<Datum>;
|
||||
/**
|
||||
* Creates a new one-dimensional brush along the x-dimension.
|
||||
*
|
||||
* The generic "Datum" refers to the type of the data of the selected svg:g element to
|
||||
* which the returned BrushBEhavoir will be applied.
|
||||
* which the returned BrushBehavior will be applied.
|
||||
*/
|
||||
export function brushX<Datum>(): BrushBehavior<Datum>;
|
||||
/**
|
||||
* Creates a new one-dimensional brush along the y-dimension.
|
||||
*
|
||||
* The generic "Datum" refers to the type of the data of the selected svg:g element to
|
||||
* which the returned BrushBEhavoir will be applied.
|
||||
* which the returned BrushBehavior will be applied.
|
||||
*/
|
||||
export function brushY<Datum>(): BrushBehavior<Datum>;
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ canvasRibbon(ribbon); // render ribbon for first chord
|
||||
|
||||
// The below fails explicitly, as standard ChordSubgroup objects for source and target are missing "radius" property assumed in default
|
||||
// radius accessor. Given the internals of d3 this would lead to a "NaN" radius. So using static typing to raise this to
|
||||
// awareness seems appropriate. The alternative, is to create RibbonGenerator using the generics to explictly set the types and
|
||||
// awareness seems appropriate. The alternative, is to create RibbonGenerator using the generics to explicitly set the types and
|
||||
// then set the radius. Or, one could map a radius property into the Chords returned by the ChordLayout.
|
||||
|
||||
// canvasRibbon(chords[0]); // fails, see above
|
||||
|
||||
Vendored
+3
-3
@@ -44,7 +44,7 @@ export interface ChordSubgroup {
|
||||
*/
|
||||
export interface Chord {
|
||||
/**
|
||||
* Chord subgroup constituting the sodurce of Chord
|
||||
* Chord subgroup constituting the source of Chord
|
||||
*/
|
||||
source: ChordSubgroup;
|
||||
/**
|
||||
@@ -122,7 +122,7 @@ export interface ChordLayout {
|
||||
*
|
||||
* The default is zero.
|
||||
*
|
||||
* @param angle Pad angle between adjecent groups in radians.
|
||||
* @param angle Pad angle between adjacent groups in radians.
|
||||
*/
|
||||
padAngle(angle: number): this;
|
||||
|
||||
@@ -233,7 +233,7 @@ export interface Ribbon {
|
||||
|
||||
/**
|
||||
*
|
||||
* A ribbon generator to suport rendering of chords in a chord diagram.
|
||||
* A ribbon generator to support rendering of chords in a chord diagram.
|
||||
*
|
||||
* The first generic corresponds to the type of the "this" context within which the ribbon generator and its accessor functions will be invoked.
|
||||
*
|
||||
|
||||
Vendored
+7
-7
@@ -7,7 +7,7 @@
|
||||
// Last module patch version validated against: 1.0.4
|
||||
|
||||
/**
|
||||
* Reference type things that can be coerced to string implicitely
|
||||
* Reference type things that can be coerced to string implicitly
|
||||
*/
|
||||
export interface Stringifiable {
|
||||
toString(): string;
|
||||
@@ -64,7 +64,7 @@ export function entries(obj: object): Array<{ key: string, value: any }>;
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* A datastructure similar to ES6 Maps, but with a few differences:
|
||||
* A data structure similar to ES6 Maps, but with a few differences:
|
||||
* - Keys are coerced to strings.
|
||||
* - map.each, not map.forEach. (Also, no thisArg.)
|
||||
* - map.remove, not map.delete.
|
||||
@@ -194,7 +194,7 @@ export function map(obj: object): Map<any>;
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* A datastructure similar to ES6 Sets, but with a few differences:
|
||||
* A data structure similar to ES6 Sets, but with a few differences:
|
||||
*
|
||||
* - Values are coerced to strings.
|
||||
* - set.each, not set.forEach. (Also, no thisArg.)
|
||||
@@ -282,11 +282,11 @@ export function set<T>(array: T[], key: (value: T, index: number, array: T[]) =>
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* A more formal defintion of the nested array returned by Nest.entries(...). This data structure is intended as a reference only.
|
||||
* A more formal definition of the nested array returned by Nest.entries(...). This data structure is intended as a reference only.
|
||||
*
|
||||
* As the union types cannot be ex ante simplified without knowledge
|
||||
* of the nesting level (number of key(...) operations) and whether the data were rolled-up, this data structure becomes cumbersome
|
||||
* to use in practice. This is particularly true for discrimiation of array element types.
|
||||
* to use in practice. This is particularly true for discrimination of array element types.
|
||||
* The use of the rollup function, or lack thereof, also determines whether NestedArray has the 'values' property
|
||||
* with an array of type Datum at leaf level, or has a rolled-up 'value' property.
|
||||
*/
|
||||
@@ -294,7 +294,7 @@ export function set<T>(array: T[], key: (value: T, index: number, array: T[]) =>
|
||||
export interface NestedArray<Datum, RollupType> extends Array<{ key: string, values: NestedArray<Datum, RollupType> | Datum[] | undefined, value: RollupType | undefined }> { }
|
||||
|
||||
/**
|
||||
* A more formal defintion of the nested array returned by Nest.map(...). This data structure is intended as a reference only.
|
||||
* A more formal definition of the nested array returned by Nest.map(...). This data structure is intended as a reference only.
|
||||
*
|
||||
* As the union types cannot be ex ante simplified without knowledge
|
||||
* of the nesting level (number of key(...) operations) and whether the data were rolled-up, this data structure becomes cumbersome
|
||||
@@ -304,7 +304,7 @@ export interface NestedArray<Datum, RollupType> extends Array<{ key: string, val
|
||||
export interface NestedMap<Datum, RollupType> extends Map<NestedMap<Datum, RollupType> | Datum[] | RollupType> { }
|
||||
|
||||
/**
|
||||
* A more formal defintion of the nested array returned by Nest.object(...). This data structure is intended as a reference only.
|
||||
* A more formal definition of the nested array returned by Nest.object(...). This data structure is intended as a reference only.
|
||||
*
|
||||
* As the union types cannot be ex ante simplified without knowledge
|
||||
* of the nesting level (number of key(...) operations) and whether the data were rolled-up, this data structure becomes cumbersome
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Vendored
+441
-6
@@ -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 <https://github.com/tomwanzek>
|
||||
// Alex Ford <https://github.com/gustavderdrache>
|
||||
// Boris Yankov <https://github.com/borisyankov>
|
||||
// denisname <https://github.com/denisname>
|
||||
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>,
|
||||
// Alex Ford <https://github.com/gustavderdrache>,
|
||||
// Boris Yankov <https://github.com/borisyankov>,
|
||||
// denisname <https://github.com/denisname>,
|
||||
// Hugues Stefanski <https://github.com/ledragon>
|
||||
// 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
|
||||
@@ -22,106 +23,507 @@ export type ColorSpaceObject = RGBColor | HSLColor | LabColor | HCLColor | Cubeh
|
||||
* e.g. in d3-hsv). This interface
|
||||
*/
|
||||
export interface ColorCommonInstance {
|
||||
/**
|
||||
* Returns true if and only if the color is displayable on standard hardware.
|
||||
* For example, this returns false for an RGB color if any channel value is less than zero or greater than 255, or if the opacity is not in the range [0, 1].
|
||||
*/
|
||||
displayable(): boolean;
|
||||
/**
|
||||
* Returns a string representing this color according to the CSS Object Model specification,
|
||||
* such as rgb(247, 234, 186) or rgba(247, 234, 186, 0.2).
|
||||
* 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.
|
||||
*/
|
||||
toString(): string;
|
||||
/**
|
||||
* Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be.
|
||||
* If k is not specified, it defaults to 1. The behavior of this method is dependent on the implementing color space.
|
||||
*
|
||||
* @param k A color space dependent number to determine, how much brighter the returned color should be.
|
||||
*/
|
||||
brighter(k?: number): this;
|
||||
/**
|
||||
* Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be.
|
||||
* If k is not specified, it defaults to 1. The behavior of this method is dependent on the implementing color space.
|
||||
*
|
||||
* @param k A color space dependent number to determine, how much darker the returned color should be.
|
||||
*/
|
||||
darker(k?: number): this;
|
||||
/**
|
||||
* Returns the RGB equivalent of this color. For RGB colors, that’s "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;
|
||||
}
|
||||
|
||||
/**
|
||||
* A Color object which serves as a base class for
|
||||
* colorspace-specific sub-class implementations.
|
||||
*/
|
||||
export interface Color {
|
||||
/**
|
||||
* Returns true if and only if the color is displayable on standard hardware.
|
||||
* For example, this returns false for an RGB color if any channel value is less than zero or greater than 255, or if the opacity is not in the range [0, 1].
|
||||
*/
|
||||
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
|
||||
/**
|
||||
* Returns a string representing this color according to the CSS Object Model specification,
|
||||
* such as rgb(247, 234, 186) or rgba(247, 234, 186, 0.2).
|
||||
* 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.
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* A Color factory object, which may also be used with instanceof to test if an object is a color instance.
|
||||
*/
|
||||
export interface ColorFactory extends Function {
|
||||
/**
|
||||
* Parses the specified CSS Color Module Level 3 specifier string, returning an RGB or HSL color.
|
||||
* If the specifier was not valid, null is returned.
|
||||
*
|
||||
* @param cssColorSpecifier A CSS Color Module Level 3 specifier string.
|
||||
*/
|
||||
(cssColorSpecifier: string): RGBColor | HSLColor | null;
|
||||
/**
|
||||
* Converts the provided color instance and returns an RGB or HSL color.
|
||||
*
|
||||
* @param color A permissible color space instance.
|
||||
*/
|
||||
(color: ColorSpaceObject | ColorCommonInstance): RGBColor | HSLColor;
|
||||
/**
|
||||
* Prototype of the factory, which can be used for instanceof testing
|
||||
*/
|
||||
readonly prototype: Color;
|
||||
}
|
||||
|
||||
/**
|
||||
* An RGB color object.
|
||||
*/
|
||||
export interface RGBColor extends Color {
|
||||
/**
|
||||
* Value of red channel
|
||||
*/
|
||||
r: number;
|
||||
/**
|
||||
* Value of green channel
|
||||
*/
|
||||
g: number;
|
||||
/**
|
||||
* Value of blue channel
|
||||
*/
|
||||
b: number;
|
||||
/**
|
||||
* Opacity value
|
||||
*/
|
||||
opacity: number;
|
||||
/**
|
||||
* Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be.
|
||||
* If k is not specified, it defaults to 1.
|
||||
*
|
||||
* @param k A color space dependent number to determine, how much brighter the returned color should be.
|
||||
*/
|
||||
brighter(k?: number): this;
|
||||
/**
|
||||
* Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be.
|
||||
* If k is not specified, it defaults to 1.
|
||||
*
|
||||
* @param k A color space dependent number to determine, how much darker the returned color should be.
|
||||
*/
|
||||
darker(k?: number): this;
|
||||
/**
|
||||
* Returns the RGB equivalent of this color.
|
||||
*/
|
||||
rgb(): this;
|
||||
}
|
||||
|
||||
/**
|
||||
* An RGB color factory object, which may also be used with instanceof to test if an object
|
||||
* is an RGB color instance.
|
||||
*/
|
||||
export interface RGBColorFactory extends Function {
|
||||
/**
|
||||
* Constructs a new RGB color based on the specified channel values and opacity.
|
||||
*
|
||||
* @param r Red channel value.
|
||||
* @param g Green channel value.
|
||||
* @param b Blue channel value.
|
||||
* @param opacity Optional opacity value, defaults to 1.
|
||||
*/
|
||||
(r: number, g: number, b: number, opacity?: number): RGBColor;
|
||||
/**
|
||||
* Parses the specified CSS Color Module Level 3 specifier string, returning an RGB color.
|
||||
* If the specifier was not valid, null is returned.
|
||||
*
|
||||
* @param cssColorSpecifier A CSS Color Module Level 3 specifier string.
|
||||
*/
|
||||
(cssColorSpecifier: string): RGBColor;
|
||||
/**
|
||||
* Converts the provided color instance and returns an RGB color. The color instance is converted to the RGB color space using color.rgb.
|
||||
* Note that unlike color.rgb this method always returns a new instance, even if color is already an RGB color.
|
||||
*
|
||||
* @param color A permissible color space instance.
|
||||
*/
|
||||
(color: ColorSpaceObject | ColorCommonInstance): RGBColor;
|
||||
/**
|
||||
* Prototype of the factory, which can be used for instanceof testing
|
||||
*/
|
||||
readonly prototype: RGBColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* An HSL color object.
|
||||
*/
|
||||
export interface HSLColor extends Color {
|
||||
/**
|
||||
* Hue channel value.
|
||||
*/
|
||||
h: number;
|
||||
/**
|
||||
* Saturation channel value.
|
||||
*/
|
||||
s: number;
|
||||
/**
|
||||
* Lightness channel value.
|
||||
*/
|
||||
l: number;
|
||||
/**
|
||||
* Opacity value.
|
||||
*/
|
||||
opacity: number;
|
||||
/**
|
||||
* Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be.
|
||||
* If k is not specified, it defaults to 1.
|
||||
*
|
||||
* @param k A color space dependent number to determine, how much brighter the returned color should be.
|
||||
*/
|
||||
brighter(k?: number): this;
|
||||
/**
|
||||
* Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be.
|
||||
* If k is not specified, it defaults to 1.
|
||||
*
|
||||
* @param k A color space dependent number to determine, how much darker the returned color should be.
|
||||
*/
|
||||
darker(k?: number): this;
|
||||
/**
|
||||
* Returns the RGB color equivalent of this color.
|
||||
*/
|
||||
rgb(): RGBColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* An HSL color factory object, which may also be used with instanceof to test if an object
|
||||
* is an HSL color instance.
|
||||
*/
|
||||
export interface HSLColorFactory extends Function {
|
||||
/**
|
||||
* Constructs a new HSL color based on the specified channel values and opacity.
|
||||
*
|
||||
* @param h Hue channel value.
|
||||
* @param s Saturation channel value.
|
||||
* @param l Lightness channel value.
|
||||
* @param opacity Optional opacity value, defaults to 1.
|
||||
*/
|
||||
(h: number, s: number, l: number, opacity?: number): HSLColor;
|
||||
/**
|
||||
* Parses the specified CSS Color Module Level 3 specifier string, returning an HSL color.
|
||||
* If the specifier was not valid, null is returned.
|
||||
*
|
||||
* @param cssColorSpecifier A CSS Color Module Level 3 specifier string.
|
||||
*/
|
||||
(cssColorSpecifier: string): HSLColor;
|
||||
/**
|
||||
* Converts the provided color instance and returns an HSL color.
|
||||
* The color instance is converted to the RGB color space using color.rgb and then converted to HSL.
|
||||
* (Colors already in the HSL color space skip the conversion to RGB.)
|
||||
*
|
||||
* @param color A permissible color space instance.
|
||||
*/
|
||||
(color: ColorSpaceObject | ColorCommonInstance): HSLColor;
|
||||
/**
|
||||
* Prototype of the factory, which can be used for instanceof testing
|
||||
*/
|
||||
readonly prototype: HSLColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* A Lab (CIELAB) color object.
|
||||
*/
|
||||
export interface LabColor extends Color {
|
||||
/**
|
||||
* Lightness typically in the range [0, 100].
|
||||
*/
|
||||
l: number;
|
||||
/**
|
||||
* Position between red/magenta and green typically in [-160, +160].
|
||||
*/
|
||||
a: number;
|
||||
/**
|
||||
* Position between yellow and blue typically in [-160, +160].
|
||||
*/
|
||||
b: number;
|
||||
/**
|
||||
* Opacity value
|
||||
*/
|
||||
opacity: number;
|
||||
/**
|
||||
* Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be.
|
||||
* If k is not specified, it defaults to 1.
|
||||
*
|
||||
* @param k A color space dependent number to determine, how much brighter the returned color should be.
|
||||
*/
|
||||
brighter(k?: number): this;
|
||||
/**
|
||||
* Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be.
|
||||
* If k is not specified, it defaults to 1.
|
||||
*
|
||||
* @param k A color space dependent number to determine, how much darker the returned color should be.
|
||||
*/
|
||||
darker(k?: number): this;
|
||||
/**
|
||||
* Returns the RGB color equivalent of this color.
|
||||
*/
|
||||
rgb(): RGBColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* A Lab (CIELAB) color factory object, which may also be used with instanceof to test if an object
|
||||
* is a Lab color instance.
|
||||
*/
|
||||
export interface LabColorFactory extends Function {
|
||||
/**
|
||||
* Constructs a new Lab color based on the specified channel values and opacity.
|
||||
*
|
||||
* @param l Lightness typically in the range [0, 100].
|
||||
* @param a Position between red/magenta and green typically in [-160, +160].
|
||||
* @param b Position between yellow and blue typically in [-160, +160].
|
||||
* @param opacity Optional opacity value, defaults to 1.
|
||||
*/
|
||||
(l: number, a: number, b: number, opacity?: number): LabColor;
|
||||
/**
|
||||
* Parses the specified CSS Color Module Level 3 specifier string, returning a Lab color.
|
||||
* If the specifier was not valid, null is returned.
|
||||
*
|
||||
* @param cssColorSpecifier A CSS Color Module Level 3 specifier string.
|
||||
*/
|
||||
(cssColorSpecifier: string): LabColor;
|
||||
/**
|
||||
* Converts the provided color instance and returns a Lab color.
|
||||
* The color instance is converted to the RGB color space using color.rgb and then converted to Lab.
|
||||
* (Colors already in the Lab color space skip the conversion to RGB,
|
||||
* and colors in the HCL color space are converted directly to Lab.)
|
||||
*
|
||||
* @param color A permissible color space instance.
|
||||
*/
|
||||
(color: ColorSpaceObject | ColorCommonInstance): LabColor;
|
||||
/**
|
||||
* Prototype of the factory, which can be used for instanceof testing
|
||||
*/
|
||||
readonly prototype: LabColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* A gray color factory for Lab (CIELAB) colors.
|
||||
*/
|
||||
export type GrayColorFactory =
|
||||
/**
|
||||
* Constructs a new Lab color with the specified l value and a = b = 0.
|
||||
*
|
||||
* @param l Lightness typically in the range [0, 100].
|
||||
* @param opacity Optional opacity value, defaults to 1.
|
||||
*/
|
||||
(l: number, opacity?: number) => LabColor;
|
||||
|
||||
/**
|
||||
* An HCL (CIELCH) color object.
|
||||
*/
|
||||
export interface HCLColor extends Color {
|
||||
/**
|
||||
* Hue channel value typically in [0, 360).
|
||||
*/
|
||||
h: number;
|
||||
/**
|
||||
* Chroma channel value typically in [0, 230].
|
||||
*/
|
||||
c: number;
|
||||
/**
|
||||
* Luminance channel value typically in the range [0, 100].
|
||||
*/
|
||||
l: number;
|
||||
/**
|
||||
* Opacity value
|
||||
*/
|
||||
opacity: number;
|
||||
/**
|
||||
* Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be.
|
||||
* If k is not specified, it defaults to 1.
|
||||
*
|
||||
* @param k A color space dependent number to determine, how much brighter the returned color should be.
|
||||
*/
|
||||
brighter(k?: number): this;
|
||||
/**
|
||||
* Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be.
|
||||
* If k is not specified, it defaults to 1.
|
||||
*
|
||||
* @param k A color space dependent number to determine, how much darker the returned color should be.
|
||||
*/
|
||||
darker(k?: number): this;
|
||||
/**
|
||||
* Returns the RGB color equivalent of this color.
|
||||
*/
|
||||
rgb(): RGBColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* An HCL (CIELCH) color factory object, which may also be used with instanceof to test if an object
|
||||
* is an HCL color instance.
|
||||
*/
|
||||
export interface HCLColorFactory extends Function {
|
||||
/**
|
||||
* Constructs a new HCL color based on the specified channel values and opacity.
|
||||
*
|
||||
* @param h Hue channel value typically in [0, 360).
|
||||
* @param c Chroma channel value typically in [0, 230].
|
||||
* @param l Luminance channel value typically in the range [0, 100].
|
||||
* @param opacity Optional opacity value, defaults to 1.
|
||||
*/
|
||||
(h: number, l: number, c: number, opacity?: number): HCLColor;
|
||||
/**
|
||||
* Parses the specified CSS Color Module Level 3 specifier string, returning an HCL color.
|
||||
* If the specifier was not valid, null is returned.
|
||||
*
|
||||
* @param cssColorSpecifier A CSS Color Module Level 3 specifier string.
|
||||
*/
|
||||
(cssColorSpecifier: string): HCLColor;
|
||||
/**
|
||||
* Converts the provided color instance and returns an HCL color.
|
||||
* The color instance is converted to the RGB color space using color.rgb and then converted to HCL.
|
||||
* (Colors already in the HCL color space skip the conversion to RGB,
|
||||
* and colors in the Lab color space are converted directly to HCL.)
|
||||
*
|
||||
* @param color A permissible color space instance.
|
||||
*/
|
||||
(color: ColorSpaceObject | ColorCommonInstance): HCLColor;
|
||||
/**
|
||||
* Prototype of the factory, which can be used for instanceof testing
|
||||
*/
|
||||
readonly prototype: HCLColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* An LCH (CIELCH) color factory function to create an HCL color object.
|
||||
*/
|
||||
export interface LCHColorFactory {
|
||||
/**
|
||||
* Constructs a new HCL color based on the specified channel values and opacity.
|
||||
*
|
||||
* @param l Luminance channel value typically in the range [0, 100].
|
||||
* @param c Chroma channel value typically in [0, 230].
|
||||
* @param h Hue channel value typically in [0, 360).
|
||||
* @param opacity Optional opacity value, defaults to 1.
|
||||
*/
|
||||
(l: number, c: number, h: number, opacity?: number): HCLColor;
|
||||
/**
|
||||
* Parses the specified CSS Color Module Level 3 specifier string, returning an HCL color.
|
||||
* If the specifier was not valid, null is returned.
|
||||
*
|
||||
* @param cssColorSpecifier A CSS color Module Level 3 specifier string.
|
||||
*/
|
||||
(cssColorSpecifier: string): HCLColor;
|
||||
/**
|
||||
* Converts the provided color instance and returns an HCL color.
|
||||
* The color instance is converted to the RGB color space using color.rgb and then converted to HCL.
|
||||
* (Colors already in the HCL color space skip the conversion to RGB,
|
||||
* and colors in the Lab color space are converted directly to HCL.)
|
||||
*
|
||||
* @param color A permissible color space instance.
|
||||
*/
|
||||
(color: ColorSpaceObject | ColorCommonInstance): HCLColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dave Green’s Cubehelix color object.
|
||||
*/
|
||||
export interface CubehelixColor extends Color {
|
||||
/**
|
||||
* Hue channel value.
|
||||
*/
|
||||
h: number;
|
||||
/**
|
||||
* Saturation channel value.
|
||||
*/
|
||||
s: number;
|
||||
/**
|
||||
* Lightness channel value.
|
||||
*/
|
||||
l: number;
|
||||
/**
|
||||
* Opacity value.
|
||||
*/
|
||||
opacity: number;
|
||||
/**
|
||||
* Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be.
|
||||
* If k is not specified, it defaults to 1.
|
||||
*
|
||||
* @param k A color space dependent number to determine, how much brighter the returned color should be.
|
||||
*/
|
||||
brighter(k?: number): this;
|
||||
/**
|
||||
* Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be.
|
||||
* If k is not specified, it defaults to 1.
|
||||
*
|
||||
* @param k A color space dependent number to determine, how much darker the returned color should be.
|
||||
*/
|
||||
darker(k?: number): this;
|
||||
/**
|
||||
* Returns the RGB color equivalent of this color.
|
||||
*/
|
||||
rgb(): RGBColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* A color factory object for Dave Green's Cubehelix colors, which may also be used with instanceof to test if an object
|
||||
* is a Cubehelix color instance.
|
||||
*/
|
||||
export interface CubehelixColorFactory extends Function {
|
||||
/**
|
||||
* Constructs a new Cubehelix color based on the specified channel values and opacity.
|
||||
*
|
||||
* @param h Hue channel value.
|
||||
* @param s Saturation channel value.
|
||||
* @param l Lightness channel value.
|
||||
* @param opacity Optional opacity value, defaults to 1.
|
||||
*/
|
||||
(h: number, s: number, l: number, opacity?: number): CubehelixColor;
|
||||
/**
|
||||
* Parses the specified CSS Color Module Level 3 specifier string, returning an Cubehelix color.
|
||||
* If the specifier was not valid, null is returned.
|
||||
*
|
||||
* @param cssColorSpecifier A CSS Color Module Level 3 specifier string.
|
||||
*/
|
||||
(cssColorSpecifier: string): CubehelixColor;
|
||||
/**
|
||||
* Converts the provided color instance and returns a Cubehelix color.
|
||||
* The color instance is specified, it is converted to the RGB color space using color.rgb and then converted to Cubehelix.
|
||||
* (Colors already in the Cubehelix color space skip the conversion to RGB.)
|
||||
*
|
||||
* @param color A permissible color space instance.
|
||||
*/
|
||||
(color: ColorSpaceObject | ColorCommonInstance): CubehelixColor;
|
||||
/**
|
||||
* Prototype of the factory, which can be used for instanceof testing
|
||||
*/
|
||||
readonly prototype: CubehelixColor;
|
||||
}
|
||||
|
||||
@@ -129,14 +531,47 @@ export interface CubehelixColorFactory extends Function {
|
||||
// Color object factories
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* A Color factory object, which may also be used with instanceof to test if an object is a color instance.
|
||||
*/
|
||||
export const color: ColorFactory;
|
||||
|
||||
/**
|
||||
* An RGB color factory object, which may also be used with instanceof to test if an object
|
||||
* is an RGB color instance.
|
||||
*/
|
||||
export const rgb: RGBColorFactory;
|
||||
|
||||
/**
|
||||
* An HSL color factory object, which may also be used with instanceof to test if an object
|
||||
* is an HSL color instance.
|
||||
*/
|
||||
export const hsl: HSLColorFactory;
|
||||
|
||||
/**
|
||||
* A Lab (CIELAB) color factory object, which may also be used with instanceof to test if an object
|
||||
* is a Lab color instance.
|
||||
*/
|
||||
export const lab: LabColorFactory;
|
||||
|
||||
/**
|
||||
* A gray color factory for Lab (CIELAB) colors.
|
||||
*/
|
||||
export const gray: GrayColorFactory;
|
||||
|
||||
/**
|
||||
* An HCL (CIELCH) color factory object, which may also be used with instanceof to test if an object
|
||||
* is an HCL color instance.
|
||||
*/
|
||||
export const hcl: HCLColorFactory;
|
||||
|
||||
/**
|
||||
* An LCH (CIELCH) color factory function to create an HCL color object.
|
||||
*/
|
||||
export const lch: LCHColorFactory;
|
||||
|
||||
/**
|
||||
* A color factory object for Dave Green's Cubehelix colors, which may also be used with instanceof to test if an object
|
||||
* is a Cubehelix color instance.
|
||||
*/
|
||||
export const cubehelix: CubehelixColorFactory;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import * as d3Drag from 'd3-drag';
|
||||
import { event, select, Selection } from 'd3-selection';
|
||||
|
||||
// NB: Consider alternative approachto getting live event-binding
|
||||
// NB: Consider alternative approach to getting live event-binding
|
||||
// when using webpack as suggested by @ocombe in response to
|
||||
// event binding question https://github.com/d3/d3-zoom/issues/32#issuecomment-229889310
|
||||
// d3.getEvent = () => require("d3-selection").event;
|
||||
@@ -234,7 +234,7 @@ const sourceEvent: any = e.sourceEvent;
|
||||
// As always, the below tests are for signature only, no functional purpose
|
||||
|
||||
// remove event listeners for a given event type
|
||||
e = e.on('start.tmp', null); // chainability test through reassigment
|
||||
e = e.on('start.tmp', null); // chainability test through reassignment
|
||||
|
||||
e = e.on('drag', dragged);
|
||||
// e = e.on('drag', wrongDragHandler1); // fails, wrong datum type in handler
|
||||
|
||||
Vendored
+1
-1
@@ -199,7 +199,7 @@ export interface DragBehavior<GElement extends DraggedElementBaseType, Datum, Su
|
||||
/**
|
||||
* Set the maximum distance that the mouse can move between mousedown and mouseup that will trigger
|
||||
* a subsequent click event. If at any point between mousedown and mouseup the mouse is greater than or equal to
|
||||
* distance from its position on mousedown, the click event follwing mouseup will be suppressed.
|
||||
* distance from its position on mousedown, the click event following mouseup will be suppressed.
|
||||
*
|
||||
* @param distance The distance threshold between mousedown and mouseup measured in client coordinates (event.clientX and event.clientY).
|
||||
* The default is zero.
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import * as d3Dsv from 'd3-dsv';
|
||||
|
||||
// ------------------------------------------------------------------------------------------
|
||||
// Preperatory Steps
|
||||
// Preparatory Steps
|
||||
// ------------------------------------------------------------------------------------------
|
||||
|
||||
const csvTestString = '1997,Ford,E350,2.34\n2000,Mercury,Cougar,2.38';
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user