This commit is contained in:
Maciej Blim
2018-05-21 09:09:23 +02:00
308 changed files with 6687 additions and 3089 deletions
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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.
+25 -25
View File
@@ -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"
}
}
+1 -1
View File
@@ -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-dao" />
/// <reference types="activex-vbide" />
@@ -8882,7 +8883,6 @@ interface ActiveXObject {
Access.OptionButton | Access.OptionGroup | Access.Page | Access.SubForm | Access.TabControl | Access.TextBox | Access.ToggleButton | Access.WebBrowserControl,
propertyName: 'accName' | 'accValue', parameterTypes: [any], newValue: string): void;
set(obj: Access._ControlInReportEvents | Access.ComboBox | Access.Control | Access.ListBox, propertyName: 'Selected', parameterTypes: [number], newValue: number): void;
new<K extends keyof ActiveXObjectNameMap = any>(progid: K): ActiveXObjectNameMap[K];
}
interface ActiveXObjectNameMap {
+1 -2
View File
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
"es5",
"scripthost"
"es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
+5 -2
View File
@@ -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 }) => {
+2 -1
View File
@@ -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;
+1 -2
View File
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
"es5",
"scripthost"
"es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
+2
View File
@@ -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);
+1 -4
View File
@@ -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;
+3 -2
View File
@@ -1,8 +1,9 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es5", "scripthost"],
"lib": [
"es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
+2
View File
@@ -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);
+2 -4
View File
@@ -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;
+1 -2
View File
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
"es5",
"scripthost"
"es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
+2 -5
View File
@@ -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>;
}
+1 -2
View File
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
"es5",
"scripthost"
"es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
+3 -2
View File
@@ -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;
-1
View File
@@ -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 {
+1 -2
View File
@@ -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 = {
-1
View File
@@ -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 {
+1 -2
View File
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
"es5",
"scripthost"
"es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
-1
View File
@@ -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 {
+1 -2
View File
@@ -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
View File
@@ -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
+2 -3
View File
@@ -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 {
/**
+1 -2
View File
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
"es5",
"scripthost"
"es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
-1
View File
@@ -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 {
+1 -2
View File
@@ -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;
-1
View File
@@ -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 {
+1 -2
View File
@@ -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');
+2 -1
View File
@@ -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 {
+1 -2
View File
@@ -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[] => {
+1 -2
View File
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
"es5",
"scripthost"
"es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
+1 -1
View File
@@ -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 {
+1 -2
View File
@@ -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());
-1
View File
@@ -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 {
+1 -2
View File
@@ -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[] => {
+2 -1
View File
@@ -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;
}
+1 -2
View File
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
"es5",
"scripthost"
"es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
+2 -5
View File
@@ -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>;
}
+1 -2
View File
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
"es5",
"scripthost"
"es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
+1 -1
View File
@@ -1,4 +1,4 @@
/// <reference types="activex-iwshruntimelibrary" />
/// <reference types="windows-script-host" />
const shell = new ActiveXObject('Shell.Application');
-1
View File
@@ -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 {
+1 -2
View File
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
"es5",
"scripthost"
"es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
+2 -1
View File
@@ -4,6 +4,8 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6
/// <reference types="activex-interop" />
declare namespace stdole {
type IPictureDisp = StdPicture;
@@ -79,7 +81,6 @@ declare namespace stdole {
interface ActiveXObject {
on(obj: stdole.StdFont, event: 'FontChanged', argNames: ['PropertyName'], handler: (this: stdole.StdFont, parameter: {readonly PropertyName: string}) => void): void;
new<K extends keyof ActiveXObjectNameMap = any>(progid: K): ActiveXObjectNameMap[K];
}
interface ActiveXObjectNameMap {
+1 -2
View File
@@ -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[] => {
+1 -2
View File
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
"es5",
"scripthost"
"es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
+2
View File
@@ -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[] => {
+2 -1
View File
@@ -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;
+1 -2
View File
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
"es5",
"scripthost"
"es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
+4 -2
View File
@@ -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)
+1 -1
View File
@@ -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 -4
View File
@@ -1,10 +1,7 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es5",
"scripthost"
],
"lib": ["es5"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
+2 -1
View File
@@ -94,7 +94,8 @@ let _algoliaIndexSettings: IndexSettings = {
allowCompressionOfIntegerArray: false,
altCorrections: [{}],
minProximity: 0,
placeholders: '',
placeholders: { '': [''] },
camelCaseAttributes: [''],
};
let _algoliaQueryParameters: QueryParameters = {
+10 -2
View File
@@ -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 {
+3 -2
View File
@@ -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;
}
+54
View File
@@ -525,6 +525,58 @@ function customAuthorizerCallback(cb: AWSLambda.CustomAuthorizerCallback) {
cb(null, authResponse);
}
/* CodePipeline events https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-invoke-lambda-function.html#actions-invoke-lambda-function-json-event-example */
const CodePipelineEvent: AWSLambda.CodePipelineEvent = {
"CodePipeline.job": {
id: "11111111-abcd-1111-abcd-111111abcdef",
accountId: "111111111111",
data: {
actionConfiguration: {
configuration: {
FunctionName: "MyLambdaFunctionForAWSCodePipeline",
UserParameters: "some-input-such-as-a-URL"
}
},
inputArtifacts: [
{
location: {
s3Location: {
bucketName: "the name of the bucket configured as the pipeline artifact store in Amazon S3, for example codepipeline-us-east-2-1234567890",
objectKey: "the name of the application, for example CodePipelineDemoApplication.zip"
},
type: "S3"
},
revision: null,
name: "ArtifactName"
}
],
outputArtifacts: [],
artifactCredentials: {
secretAccessKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
sessionToken: `MIICiTCCAfICCQD6m7oRw0uXOjANBgkqhkiG9w
0BAQUFADCBiDELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZ
WF0dGxlMQ8wDQYDVQQKEwZBbWF6b24xFDASBgNVBAsTC0lBTSBDb25zb2xlMRIw
EAYDVQQDEwlUZXN0Q2lsYWMxHzAdBgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5
jb20wHhcNMTEwNDI1MjA0NTIxWhcNMTIwNDI0MjA0NTIxWjCBiDELMAkGA1UEBh
MCVVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdTZWF0dGxlMQ8wDQYDVQQKEwZBb
WF6b24xFDASBgNVBAsTC0lBTSBDb25zb2xlMRIwEAYDVQQDEwlUZXN0Q2lsYWMx
HzAdBgkqhkiG9w0BCQEWEG5vb25lQGFtYXpvbi5jb20wgZ8wDQYJKoZIhvcNAQE
BBQADgY0AMIGJAoGBAMaK0dn+a4GmWIWJ21uUSfwfEvySWtC2XADZ4nB+BLYgVI
k60CpiwsZ3G93vUEIO3IyNoH/f0wYK8m9TrDHudUZg3qX4waLG5M43q7Wgc/MbQ
ITxOUSQv7c7ugFFDzQGBzZswY6786m86gpEIbb3OhjZnzcvQAaRHhdlQWIMm2nr
AgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAtCu4nUhVVxYUntneD9+h8Mg9q6q+auN
KyExzyLwaxlAoo7TJHidbtS4J5iNmZgXL0FkbFFBjvSfpJIlJ00zbhNYS5f6Guo
EDmFJl0ZxBHjJnyp378OD8uTs7fLvjx79LjSTbNYiytVbZPQUQ5Yaxu2jXnimvw
3rrszlaEXAMPLE=`,
accessKeyId: "AKIAIOSFODNN7EXAMPLE"
},
continuationToken: "A continuation token if continuing job"
}
}
};
CodePipelineEvent["CodePipeline.job"].data.encryptionKey = { type: 'KMS', id: 'key' };
/* CloudFront events, see http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html */
const CloudFrontRequestEvent: AWSLambda.CloudFrontRequestEvent = {
Records: [
@@ -750,6 +802,8 @@ let apiGtwProxyHandler: AWSLambda.APIGatewayProxyHandler = (event: AWSLambda.API
let proxyHandler: AWSLambda.ProxyHandler = (event: AWSLambda.APIGatewayEvent, context: AWSLambda.Context, cb: AWSLambda.ProxyCallback) => { };
apiGtwProxyHandler = proxyHandler;
let codePipelineHandler: AWSLambda.CodePipelineHandler = (event: AWSLambda.CodePipelineEvent, context: AWSLambda.Context, cb: AWSLambda.Callback<void>) => {};
let cloudFrontRequestHandler: AWSLambda.CloudFrontRequestHandler = (event: AWSLambda.CloudFrontRequestEvent, context: AWSLambda.Context, cb: AWSLambda.CloudFrontRequestCallback) => {
cb();
cb(null);
+54
View File
@@ -501,6 +501,58 @@ export interface AuthResponseContext {
[name: string]: any;
}
/**
* CodePipeline events
* https://docs.aws.amazon.com/codepipeline/latest/userguide/actions-invoke-lambda-function.html
*/
export interface S3ArtifactLocation {
bucketName: string;
objectKey: string;
}
export interface S3ArtifactStore {
type: 'S3';
s3Location: S3ArtifactLocation;
}
export type ArtifactLocation = S3ArtifactStore;
export interface Artifact {
name: string;
revision: string | null;
location: ArtifactLocation;
}
export interface Credentials {
accessKeyId: string;
secretAccessKey: string;
sessionToken?: string;
}
export interface EncryptionKey {
type: string;
id: string;
}
export interface CodePipelineEvent {
"CodePipeline.job": {
id: string;
accountId: string;
data: {
actionConfiguration: {
configuration: {
FunctionName: string;
UserParameters: string;
}
};
inputArtifacts: Artifact[];
outputArtifacts: Artifact[];
artifactCredentials: Credentials;
encryptionKey?: EncryptionKey & {type: 'KMS'};
continuationToken?: string;
};
};
}
/**
* CloudFront events
* http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html
@@ -653,6 +705,8 @@ export type ProxyCallback = APIGatewayProxyCallback; // Old name
// TODO: IoT
export type CodePipelineHandler = Handler<CodePipelineEvent, void>;
export type CloudFrontRequestHandler = Handler<CloudFrontRequestEvent, CloudFrontRequestResult>;
export type CloudFrontRequestCallback = Callback<CloudFrontRequestResult>;
+327 -271
View File
@@ -1,429 +1,485 @@
import Chartist = require("chartist");
Chartist.escapingMap = {
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
'\'': '&#039;',
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
'\'': '&#039;',
};
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;
}
}
});
+717 -692
View File
File diff suppressed because it is too large Load Diff
+46 -2
View File
@@ -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.
+1 -1
View File
@@ -224,7 +224,7 @@ declare namespace CKEDITOR {
focusPrevious(ignoreChildren?: boolean, indexToUse?: number): void;
forEach(callback: (node: node) => void, type?: number, skipRoot?: boolean): void;
getAttribute(name: string): string;
getBogus(): Object;
getBogus(): node|false;
getChild(indices: number): node;
getChild(indices: number[]): node;
getChildCount(): number;
+50
View File
@@ -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"] }
);
+45
View File
@@ -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;
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"cli-table-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+15
View File
@@ -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);
+35 -6
View File
@@ -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
@@ -27,11 +28,21 @@ export interface ColorCommonInstance {
brighter(k?: number): this;
darker(k?: number): this;
rgb(): RGBColor;
/**
* Returns a hexadecimal string representing this color.
* If this color is not displayable, a suitable displayable color is returned instead. For example, RGB channel values greater than 255 are clamped to 255.
*/
hex(): string;
}
export interface Color {
displayable(): boolean; // Note: While this method is used in prototyping for colors of specific colorspaces, it should not be called directly, as 'this.rgb' would not be implemented on Color
toString(): string; // Note: While this method is used in prototyping for colors of specific colorspaces, it should not be called directly, as 'this.rgb' would not be implemented on Color
/**
* Returns a hexadecimal string representing this color.
* If this color is not displayable, a suitable displayable color is returned instead. For example, RGB channel values greater than 255 are clamped to 255.
*/
hex(): string;
}
export interface ColorFactory extends Function {
@@ -47,6 +58,9 @@ export interface RGBColor extends Color {
opacity: number;
brighter(k?: number): this;
darker(k?: number): this;
/**
* Returns the RGB equivalent of this color.
*/
rgb(): this;
}
@@ -91,6 +105,11 @@ export interface LabColorFactory extends Function {
readonly prototype: LabColor;
}
/**
* Constructs a new Lab color with the specified l value and a = b = 0.
*/
export type GrayColorFactory = (l: number, opacity?: number) => LabColor;
export interface HCLColor extends Color {
h: number;
c: number;
@@ -108,6 +127,12 @@ export interface HCLColorFactory extends Function {
readonly prototype: HCLColor;
}
export interface LCHColorFactory {
(l: number, c: number, h: number, opacity?: number): HCLColor;
(cssColorSpecifier: string): HCLColor;
(color: ColorSpaceObject | ColorCommonInstance): HCLColor;
}
export interface CubehelixColor extends Color {
h: number;
s: number;
@@ -137,6 +162,10 @@ export const hsl: HSLColorFactory;
export const lab: LabColorFactory;
export const gray: GrayColorFactory;
export const hcl: HCLColorFactory;
export const lch: LCHColorFactory;
export const cubehelix: CubehelixColorFactory;
+1 -1
View File
@@ -1,6 +1,6 @@
// Type definitions for D3JS d3-geo module 1.10
// Project: https://github.com/d3/d3-geo/
// Definitions by: Hugues Stefanski <https://github.com/Ledragon>, Tom Wanzek <https://github.com/tomwanzek>, Alex Ford <https://github.com/gustavderdrache>, Boris Yankov <https://github.com/borisyankov>
// Definitions by: Hugues Stefanski <https://github.com/ledragon>, Tom Wanzek <https://github.com/tomwanzek>, Alex Ford <https://github.com/gustavderdrache>, Boris Yankov <https://github.com/borisyankov>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
+6
View File
@@ -68,6 +68,12 @@ export interface HSVColor extends Color {
* Returns the RGB equivalent of this color.
*/
rgb(): RGBColor;
/**
* Returns a hexadecimal string representing this color.
* If this color is not displayable, a suitable displayable color is returned instead. For example, RGB channel values greater than 255 are clamped to 255.
*/
hex(): string;
}
export const hsv: HSVColorFactory;
@@ -0,0 +1,16 @@
import * as discourseSSO from 'discourse-sso';
const sso = new discourseSSO('sso secret string');
if (sso.validate('payload', 'sig')) {
const nonce = sso.getNonce('payload');
const userParams: discourseSSO.UserParams = {
nonce,
external_id: '1',
email: 'omg@mail.com',
username: 'myuser',
name: 'This Guy'
};
const loginString: string = sso.buildLoginString(userParams);
}
+27
View File
@@ -0,0 +1,27 @@
// Type definitions for discourse-sso 1.0
// Project: https://github.com/ArmedGuy/discourse_sso_node
// Definitions by: Arnav Gupta <https://github.com/championswimmer>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare class DiscourseSSO {
constructor(ssoSecret: string);
validate(payload: string, sig: string): boolean;
getNonce(payload: string): string;
buildLoginString(params: DiscourseSSO.UserParams): string;
}
declare namespace DiscourseSSO {
interface UserParams {
nonce: string;
external_id: string;
email: string;
admin?: boolean;
moderator?: boolean;
username?: string;
name?: string;
avatar_url?: string;
add_groups?: string[];
remove_groups?: string[];
}
}
export = DiscourseSSO;
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"discourse-sso-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+28
View File
@@ -1685,6 +1685,10 @@ declare module 'ember' {
target: Target,
method: ObserverMethod<Target, this>
): void;
addObserver(
key: keyof this,
method: ObserverMethod<this, this>
): void;
/**
* Remove an observer you have previously registered on this object. Pass
* the same key, target, and method you passed to `addObserver()` and your
@@ -1695,6 +1699,10 @@ declare module 'ember' {
target: Target,
method: ObserverMethod<Target, this>
): any;
removeObserver(
key: keyof this,
method: ObserverMethod<this, this>
): any;
/**
* Retrieves the value of a property, or a default value in the case that the
* property returns `undefined`.
@@ -3010,6 +3018,11 @@ declare module 'ember' {
method: ObserverMethod<Target, Context>,
once?: boolean
): void;
function addListener<Context>(
obj: Context,
key: keyof Context,
method: ObserverMethod<Context, Context>
): void;
/**
* Remove an event listener
*/
@@ -3019,6 +3032,11 @@ declare module 'ember' {
target: Target,
method: ObserverMethod<Target, Context>
): any;
function removeListener<Context>(
obj: Context,
key: keyof Context,
method: ObserverMethod<Context, Context>
): any;
/**
* Send an event. The execution of suspended listeners
* is skipped, and once listeners are removed. A listener without
@@ -3112,6 +3130,11 @@ declare module 'ember' {
target: Target,
method: ObserverMethod<Target, Context>
): void;
function addObserver<Context>(
obj: Context,
key: keyof Context,
method: ObserverMethod<Context, Context>
): void;
/**
* Remove an observer you have previously registered on this object. Pass
* the same key, target, and method you passed to `addObserver()` and your
@@ -3123,6 +3146,11 @@ declare module 'ember' {
target: Target,
method: ObserverMethod<Target, Context>
): any;
function removeObserver<Context>(
obj: Context,
key: keyof Context,
method: ObserverMethod<Context, Context>
): any;
/**
* Gets the value of a property on an object. If the property is computed,
* the function will be invoked. If the property is not defined but the
+7
View File
@@ -14,6 +14,13 @@ class MyComponent extends Ember.Component {
this.removeObserver('foo', this, this.fooDidChange);
Ember.removeObserver(this, 'foo', this, 'fooDidChange');
Ember.removeObserver(this, 'foo', this, this.fooDidChange);
const lambda = () => {
this.fooDidChange(this, 'foo');
};
this.addObserver('foo', lambda);
this.removeObserver('foo', lambda);
Ember.addObserver(this, 'foo', lambda);
Ember.removeObserver(this, 'foo', lambda);
}
fooDidChange(sender: MyComponent, key: 'foo') {
@@ -0,0 +1,9 @@
import { ReactNativeFile, ReactNativeFileOptions } from "extract-files";
const options: ReactNativeFileOptions = {
name: "",
type: "",
uri: "",
};
new ReactNativeFile(options);
+20
View File
@@ -0,0 +1,20 @@
// Type definitions for extract-files 3.1
// Project: https://github.com/jaydenseric/extract-files#readme
// Definitions by: Edward Sammut Alessi <https://github.com/Slessi>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export interface ReactNativeFileOptions {
uri: string;
type: string;
name: string;
}
export class ReactNativeFile {
uri: string;
type: string;
name: string;
constructor(options: ReactNativeFileOptions);
static list(files: ReactNativeFileOptions[]): ReactNativeFile[];
}
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"extract-files-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+5
View File
@@ -2098,6 +2098,11 @@ interface IObjectOptions {
*/
backgroundColor?: string;
/**
* When `true`, object is cached on an additional canvas.
*/
objectCaching?: boolean;
/**
* When defined, an object is rendered via stroke and this property specifies its color
*/
+1 -2
View File
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"scripthost"
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
+11 -2
View File
@@ -54,11 +54,20 @@ texture2d(gl, ndarray([1, 2, 3]));
const texture = texture2d(gl, canvas);
texture.bind();
texture.bind(1);
texture.dispose();
texture.generateMipmap();
texture.bind();
texture.bind(1);
texture.setPixels(canvas);
texture.setPixels(video);
texture.setPixels(image);
texture.setPixels(imageData);
texture.setPixels(ndarray([1, 2, 3]));
texture.setPixels(canvas, [1, 1]);
texture.setPixels(canvas, [1, 1], 0);
texture.magFilter = 1;
texture.minFilter = 1;
texture.mipSamples = 1;
+1
View File
@@ -29,6 +29,7 @@ declare class Texture {
bind(id?: number): number;
dispose(): void;
generateMipmap(): void;
setPixels(data: InputType | RawObject | ndarray, offset?: [number, number], mipLevel?: GLenum): void;
}
declare function texture2d(gl: WebGLRenderingContext, array: ndarray): Texture;
+3
View File
@@ -25,6 +25,9 @@
],
"inert": [
"inert/v4"
],
"wreck": [
"wreck/v7"
]
},
"noEmit": true,
+19 -3
View File
@@ -1,10 +1,12 @@
// Type definitions for JW Player V8.0
// Type definitions for JW Player V8.2
// Project: https://github.com/jwplayer/jwplayer/
// Definitions by: Martin Duparc <https://github.com/martinduparc>
// Tomer Kruvi <https://github.com/kutomer>
// Philipp Gürtler <https://github.com/philippguertler>
// Daniel McGraw <https://github.com/danielmcgraw>
// Benjamin Dobson <https://github.com/bpdsw>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
// JW Player is the leading HTML5 & Flash video player, optimized for mobile and the desktop. Easy enough for beginners, advanced enough for pros.
@@ -89,6 +91,12 @@ interface AdImpressionParam extends CallbackParam {
wrapper: any[];
}
interface AdScheduleParam extends CallbackParam {
tag: string;
client: string;
adbreaks: object[];
}
interface AdStartedParam extends CallbackParam {
creativetype: string;
tag: string;
@@ -288,7 +296,11 @@ interface JWPlayer {
once(event: 'adRequest', callback: EventCallback<AdRequestParam>): void;
off(event: 'adRequest'): void;
trigger(event: 'adRequest', args: AdRequestParam): void;
on(event: 'adStarted', callback: EventCallback<AdStartedParam>): void;
on(event: 'adSchedule', callback: EventCallback<AdScheduleParam>): void;
once(event: 'adSchedule', callback: EventCallback<AdScheduleParam>): void;
off(event: 'adSchedule'): void;
trigger(event: 'adSchedule', args: AdScheduleParam): void;
on(event: 'adStarted', callback: EventCallback<AdStartedParam>): void;
once(event: 'adStarted', callback: EventCallback<AdStartedParam>): void;
off(event: 'adStarted'): void;
trigger(event: 'adStarted', args: AdStartedParam): void;
@@ -424,7 +436,11 @@ interface JWPlayer {
once(event: 'seek', callback: EventCallback<SeekParam>): void;
off(event: 'seek'): void;
trigger(event: 'seek', args: SeekParam): void;
on(event: 'setupError', callback: EventCallback<ErrorParam>): void;
on(event: 'seeked', callback: () => void): void;
once(event: 'seeked', callback: () => void): void;
off(event: 'seeked'): void;
trigger(event: 'seeked'): void
on(event: 'setupError', callback: EventCallback<ErrorParam>): void;
once(event: 'setupError', callback: EventCallback<ErrorParam>): void;
off(event: 'setupError'): void;
trigger(event: 'setupError', args: ErrorParam): void;
+1 -3
View File
@@ -9,9 +9,7 @@
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"typeRoots": [ "../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
+16 -16
View File
@@ -929,28 +929,28 @@ declare module "../index" {
// flattenDepth
interface LoDashStatic {
/**
* Recursively flatten array up to depth times.
*
* @param array The array to recursively flatten.
* @param number The maximum recursion depth.
* @return Returns the new flattened array.
*/
flattenDepth<T>(array: ListOfRecursiveArraysOrValues<T> | null | undefined, depth?: number): T[];
/**
* Recursively flatten array up to depth times.
*
* @param array The array to recursively flatten.
* @param number The maximum recursion depth.
* @return Returns the new flattened array.
*/
flattenDepth<T>(array: ListOfRecursiveArraysOrValues<T> | null | undefined, depth?: number): T[];
}
interface LoDashImplicitWrapper<TValue> {
/**
* @see _.flattenDeep
*/
flattenDepth<T>(this: LoDashImplicitWrapper<ListOfRecursiveArraysOrValues<T> | null | undefined>, depth?: number): LoDashImplicitWrapper<T[]>;
/**
* @see _.flattenDeep
*/
flattenDepth<T>(this: LoDashImplicitWrapper<ListOfRecursiveArraysOrValues<T> | null | undefined>, depth?: number): LoDashImplicitWrapper<T[]>;
}
interface LoDashExplicitWrapper<TValue> {
/**
* @see _.flattenDeep
*/
flattenDepth<T>(this: LoDashExplicitWrapper<ListOfRecursiveArraysOrValues<T> | null | undefined>, depth?: number): LoDashExplicitWrapper<T[]>;
/**
* @see _.flattenDeep
*/
flattenDepth<T>(this: LoDashExplicitWrapper<ListOfRecursiveArraysOrValues<T> | null | undefined>, depth?: number): LoDashExplicitWrapper<T[]>;
}
// fromPairs
+2
View File
@@ -217,6 +217,8 @@ declare module "../index" {
type PropertyName = string | number | symbol;
type PropertyPath = Many<PropertyName>;
type Omit<T, K extends keyof T> = Pick<T, ({ [P in keyof T]: P } & { [P in K]: never } & { [x: string]: never })[keyof T]>;
/** Common interface between Arrays and jQuery objects */
type List<T> = ArrayLike<T>;

Some files were not shown because too many files have changed in this diff Show More