Merge branch 'master' of https://github.com/DefinitelyTyped/DefinitelyTyped into jest-23-breaking-changes

This commit is contained in:
khai96_
2018-06-01 18:16:50 +07:00
890 changed files with 39911 additions and 12080 deletions
+400 -176
View File
File diff suppressed because it is too large Load Diff
+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.
+6
View File
@@ -1158,6 +1158,12 @@
"sourceRepoURL": "https://github.com/react-ga/react-ga",
"asOfVersion": "2.3.0"
},
{
"libraryName": "react-monaco-editor",
"typingsPackageName": "react-monaco-editor",
"sourceRepoURL": "https://github.com/superRaytin/react-monaco-editor",
"asOfVersion": "0.16.0"
},
{
"libraryName": "react-native-collapsible",
"typingsPackageName": "react-native-collapsible",
+25 -25
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"
}
}
+22
View File
@@ -0,0 +1,22 @@
import AceDiff = require('ace-diff');
new AceDiff(); // $ExpectError
const aceDiffConstructorOpts = {
element: '.acediff',
left: { content: 'left content' },
right: { content: 'right content' },
};
new AceDiff(aceDiffConstructorOpts); // $ExpectType AceDiff
const differ = new AceDiff(aceDiffConstructorOpts);
differ.getEditors(); // $ExpectType { left: any; right: any; }
differ.setOptions(); // $ExpectError
const aceDiffOpts = {
diffGranularity: 'broad' as 'broad', // workaround: cast to avoid https://github.com/Microsoft/TypeScript/issues/11465#issuecomment-252453037
};
differ.setOptions(aceDiffOpts); // $ExpectType void
differ.getNumDiffs(); // $ExpectType number
differ.diff(); // $ExpectType void
differ.destroy(); // $ExpectType void
+52
View File
@@ -0,0 +1,52 @@
// Type definitions for ace-diff 2.1
// Project: https://ace-diff.github.io/ace-diff/
// Definitions by: Mike Dodge <https://github.com/innovation-team>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export as namespace AceDiff;
export = AceDiff;
declare class AceDiff {
constructor(opts: AceDiff.AceDiffConstructorOpts);
getEditors(): {
left: any;
right: any;
};
setOptions(options: AceDiff.AceDiffOpts): void;
getNumDiffs(): number;
diff(): void;
destroy(): void;
}
declare namespace AceDiff {
interface AceDiffLROpts {
content?: string | null;
mode?: string;
theme?: string;
editable?: boolean;
copyLinkEnabled?: boolean;
}
interface AceDiffConstructorOpts extends AceDiffOpts {
element: string | HTMLElement;
left: AceDiffLROpts;
right: AceDiffLROpts;
}
interface AceDiffOpts {
mode?: string;
theme?: string;
diffGranularity?: 'specific' | 'broad';
showDiffs?: boolean;
showConnectors?: boolean;
maxDiffs?: number;
left?: AceDiffLROpts;
right?: AceDiffLROpts;
classes?: {
diff: string;
connector: string;
newCodeConnectorLinkContent: string;
deletedCodeConnectorLinkContent: string;
};
}
}
+24
View File
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"ace-diff-tests.ts"
]
}
+3 -1
View File
@@ -1,3 +1,5 @@
/// <reference types="windows-script-host" />
let app = new ActiveXObject('Access.Application');
app.UserControl = true;
@@ -6,7 +8,7 @@ app.DoCmd.OpenForm('MyForm', Access.AcFormView.acNormal, '', 'LastName="Smith"')
// change the contents of a textbox
// tslint:disable-next-line:no-unnecessary-type-assertion
let textbox = app.Forms.Item('MyForm').Controls.Item('MyTextBox') as Access.TextBox;
let textbox = app.Forms('MyForm').Controls('MyTextBox') as Access.TextBox;
textbox.Text = 'Not Smith';
// save the current record on the active form
+794 -1507
View File
File diff suppressed because it is too large Load Diff
+1 -2
View File
@@ -2,8 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
"es5",
"scripthost"
"es5"
],
"noImplicitAny": true,
"noImplicitThis": true,
+2 -1
View File
@@ -1,6 +1,7 @@
{
"extends": "dtslint/dt.json",
"rules": {
"no-const-enum": false
"no-const-enum": false,
"max-line-length": false
}
}
+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,
+3 -6
View File
@@ -2,7 +2,9 @@
// Project: https://msdn.microsoft.com/en-us/library/windows/desktop/bb773938(v=vs.85).aspx
// Definitions by: Zev Spitz <https://github.com/zspitz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.5
// TypeScript Version: 2.6
/// <reference types="activex-interop" />
declare namespace DiskQuotaTypeLibrary {
// tslint:disable-next-line no-const-enum
@@ -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,
+10 -3
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;
@@ -295,11 +296,17 @@ const setColumnVisibility = (visible: boolean) => {
const combobox = sheet.OLEObjects('ComboBox1').Object as MSForms.ComboBox;
combobox.Clear();
const enumerator = new Enumerator(dict.Items());
// iterate over keys using Enumerator
const enumerator = new Enumerator(dict);
enumerator.moveFirst();
while (!enumerator.atEnd()) {
combobox.AddItem(enumerator.item());
enumerator.moveNext();
}
// alternatively, make a JS array out of the keys, and iterate using forEach
// new VBArray(dict.Keys()).toArray().forEach(x => combobox.AddItem(x));
})();
})();
-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,6 +1,7 @@
/// <reference types="activex-iwshruntimelibrary" />
/// <reference types="windows-script-host" />
/// <reference types="activex-scripting" />
const collectionToArray = <T>(col: { Item(index: any): T } | SafeArray<T>) => {
const collectionToArray = <T>(col: { Item(index: any): T }): T[] => {
const results: T[] = [];
const enumerator = new Enumerator<T>(col);
enumerator.moveFirst();
@@ -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 = {
@@ -422,7 +423,7 @@ the job?
document.GroupBroadcastReceipts = true;
const jobIDs = document.Submit('');
collectionToArray(jobIDs).forEach(jobID => WScript.Echo(`The job ID is ${jobID}`));
new VBArray(jobIDs).toArray().forEach(jobID => WScript.Echo(`The job ID is ${jobID}`));
while (recipients.Count > 0) {
recipients.Remove(1);
-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,
+10 -39
View File
@@ -1,49 +1,20 @@
// copied from the definitions in activex-scripting
interface Dictionary<TKey = any, TItem = any> {
/** Add a new key and item to the dictionary. */
Add(Key: TKey, Item: TItem): void;
/// <reference types="activex-scripting" />
/** Get the number of items in the dictionary. */
readonly Count: number;
/** Determine if a given key is in the dictionary. */
Exists(Key: TKey): boolean;
HashVal(Key: TKey): any;
/** Set or get the item for a given key */
Item(Key: TKey): TItem;
/** Get an array containing all items in the dictionary. */
Items(): SafeArray<TItem>;
/** Change a key to a different key. */
Key(Key: TKey): TKey;
/** Get an array containing all keys in the dictionary. */
Keys(): SafeArray<TKey>;
/** Remove a given key from the dictionary. */
Remove(Key: TKey): void;
/** Remove all information from the dictionary. */
RemoveAll(): void;
/** Set or get the item for a given key */
(Key: TKey): TItem;
}
interface ActiveXObjectNameMap {
'Scripting.Dictionary': Dictionary;
}
const dict: Dictionary<string, number> = new ActiveXObject('Scripting.Dictionary');
const dict: Scripting.Dictionary<string, number> = new ActiveXObject('Scripting.Dictionary');
dict.Add('one', 1);
dict.Add('two', 2);
dict.Add('three', 3);
const keyEnumerator = new Enumerator(dict.Keys());
const keyEnumerator = new Enumerator(dict);
keyEnumerator.moveFirst();
while (!keyEnumerator.atEnd()) {
const item = dict(keyEnumerator.item());
const power = Math.pow(item, 2);
}
const keysArray = new VBArray(dict.Keys()).toArray();
const itemsArray = new VBArray(dict.Items()).toArray();
for (let i = 0; i < keysArray.length; i++) {
const key = keysArray[i];
const item = itemsArray[i];
}
+3 -3
View File
@@ -2,7 +2,7 @@
// Project: https://msdn.microsoft.com/en-us/library/ff521046(v=vs.85).aspx
// Definitions by: Zev Spitz <https://github.com/zspitz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
// TypeScript Version: 2.6
// tslint:disable-next-line no-empty-interface
interface ActiveXObjectNameMap { }
@@ -50,8 +50,8 @@ interface Enumerator<T = any> {
}
interface EnumeratorConstructor {
new <T = any>(collection: SafeArray<T> | { Item(index: any): T }): Enumerator<T>;
new (collection: any): Enumerator;
new <T = any>(collection: { Item(index: any): T }): Enumerator<T>;
// new (collection: any): Enumerator;
}
declare var Enumerator: EnumeratorConstructor;
@@ -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.6
/// <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
+3 -4
View File
@@ -2,7 +2,9 @@
// Project: https://api.libreoffice.org/
// Definitions by: Zev Spitz <https://github.com/zspitz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
// TypeScript Version: 2.6
/// <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 -2
View File
@@ -2,7 +2,7 @@
// Project: https://msdn.microsoft.com/en-us/library/aa741317(v=vs.85).aspx
// Definitions by: Zev Spitz <https://github.com/zspitz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
// TypeScript Version: 2.6
declare namespace MSHTML {
const enum _BEHAVIOR_EVENT {
@@ -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');
+3 -2
View File
@@ -2,7 +2,9 @@
// Project: https://msdn.microsoft.com/en-us/library/ms763742.aspx
// Definitions by: Zev Spitz <https://github.com/zspitz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
// TypeScript Version: 2.6
/// <reference types="activex-interop" />
declare namespace MSXML2 {
/** Schema Object Model Content Types */
@@ -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[] => {
+7 -2
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,8 +491,7 @@ 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;
set<TKey = any, TValue = any>(obj: Scripting.Dictionary<TKey, TValue>, propertyName: 'Item', parameterTypes: [TKey], newValue: TValue): void;
}
interface ActiveXObjectNameMap {
@@ -498,3 +499,7 @@ interface ActiveXObjectNameMap {
'Scripting.Encoder': Scripting.Encoder;
'Scripting.FileSystemObject': Scripting.FileSystemObject;
}
interface EnumeratorConstructor {
new <TKey>(dict: Scripting.Dictionary<TKey>): Enumerator<TKey>;
}
+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,
+8 -1
View File
@@ -4,15 +4,23 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6
/// <reference types="activex-interop" />
declare namespace stdole {
type IFontDisp = StdFont;
type IPictureDisp = StdPicture;
type OLE_COLOR = number;
type OLE_XPOS_CONTAINER = number;
type OLE_XPOS_PIXELS = number;
type OLE_YPOS_CONTAINER = number;
type OLE_YPOS_PIXELS = number;
const enum LoadPictureConstants {
Color = 4,
Default = 0,
@@ -79,7 +87,6 @@ declare namespace stdole {
interface ActiveXObject {
on(obj: stdole.StdFont, event: 'FontChanged', argNames: ['PropertyName'], handler: (this: stdole.StdFont, parameter: {readonly PropertyName: string}) => void): void;
new<K extends keyof ActiveXObjectNameMap = any>(progid: K): ActiveXObjectNameMap[K];
}
interface ActiveXObjectNameMap {
+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 -48
View File
@@ -1406,52 +1406,6 @@ declare namespace algoliasearch {
userData?: string | object;
}
interface AlgoliaResponse {
/**
* Contains all the hits matching the query
* https://github.com/algolia/algoliasearch-client-js#response-format
*/
hits: any[];
/**
* Current page
* https://github.com/algolia/algoliasearch-client-js#response-format
*/
page: number;
/**
* Number of total hits matching the query
* https://github.com/algolia/algoliasearch-client-js#response-format
*/
nbHits: number;
/**
* Number of pages
* https://github.com/algolia/algoliasearch-client-js#response-format
*/
nbPage: number;
/**
* Number of hits per pages
* https://github.com/algolia/algoliasearch-client-js#response-format
*/
hitsPerPage: number;
/**
* Engine processing time (excluding network transfer)
* https://github.com/algolia/algoliasearch-client-js#response-format
*/
processingTimeMS: number;
/**
* Query used to perform the search
* https://github.com/algolia/algoliasearch-client-js#response-format
*/
query: string;
/**
* GET parameters used to perform the search
* https://github.com/algolia/algoliasearch-client-js#response-format
*/
params: string;
facets: {
[facetName: string]: { [facetValue: string]: number };
};
}
namespace SearchForFacetValues {
interface Parameters extends QueryParameters {
/**
@@ -1759,10 +1713,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 -49
View File
@@ -8,9 +8,9 @@
// TypeScript Version: 2.2
declare namespace algoliasearch {
/*
Interface for the algolia client object
*/
/**
* Interface for the algolia client object
*/
interface Client {
/**
* Initialization of the index
@@ -502,52 +502,6 @@ declare namespace algoliasearch {
userData?: string | object;
}
interface AlgoliaResponse {
/**
* Contains all the hits matching the query
* https://github.com/algolia/algoliasearch-client-js#response-format
*/
hits: any[];
/**
* Current page
* https://github.com/algolia/algoliasearch-client-js#response-format
*/
page: number;
/**
* Number of total hits matching the query
* https://github.com/algolia/algoliasearch-client-js#response-format
*/
nbHits: number;
/**
* Number of pages
* https://github.com/algolia/algoliasearch-client-js#response-format
*/
nbPage: number;
/**
* Number of hits per pages
* https://github.com/algolia/algoliasearch-client-js#response-format
*/
hitsPerPage: number;
/**
* Engine processing time (excluding network transfer)
* https://github.com/algolia/algoliasearch-client-js#response-format
*/
processingTimeMS: number;
/**
* Query used to perform the search
* https://github.com/algolia/algoliasearch-client-js#response-format
*/
query: string;
/**
* GET parameters used to perform the search
* https://github.com/algolia/algoliasearch-client-js#response-format
*/
params: string;
facets: {
[facetName: string]: { [facetValue: string]: number };
};
}
namespace SearchForFacetValues {
interface Parameters extends QueryParameters {
/**
@@ -0,0 +1,24 @@
import Allure from "allure-js-commons";
const shouldMakeError = new Allure("test"); // $ExpectError
const allure = new Allure();
allure.startSuite("suite");
allure.startCase("case");
allure.startCase("case", 123456789);
allure.endCase("passed");
allure.endCase("pending");
allure.endCase("skipped");
allure.endCase("failed");
allure.endCase("broken", 1232131232);
allure.endCase("error"); // $ExpectError
allure.startStep("error");
allure.endStep("error"); // $ExpectError
allure.setDescription("description");
allure.addAttachment("image", {}, "image/jpeg");
allure.pendingCase("pending");
allure.endSuite();
+111
View File
@@ -0,0 +1,111 @@
// Type definitions for allure-js-commons 0.0
// Project: https://github.com/allure-framework/allure-js-commons
// Definitions by: Denis Artyuhovich <https://github.com/zaqqaz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.7
declare class Allure {
constructor();
setOptions(options: Allure.Options): void;
getCurrentSuite(): Allure.Suite;
getCurrentTest(): Allure.Test;
startSuite(suiteName: string, timestamp?: number): void;
endSuite(timestamp?: number): void;
startCase(testName: string, timestamp?: number): void;
endCase(status: Allure.Status, err?: {}, timestamp?: number): void;
startStep(stepName: string, timestamp?: number): void;
endStep(status: Allure.Status, timestamp?: number): void;
setDescription(description: string, timestamp?: number): void;
addAttachment(attachmentName: string, buffer: any, type: string): void;
pendingCase(testName: string, timestamp?: number): void;
}
export = Allure;
export as namespace Allure;
declare namespace Allure {
interface Options {
targetDir: string;
}
type Status = "passed" | "pending" | "skipped" | "failed" | "broken";
enum TYPE {
TEXT = "text",
HTML = "html",
MARKDOWN = "markdown"
}
class Suite {
constructor(name: string, timestamp?: number);
name: string;
end(timestamp?: number): void;
hasTests(): boolean;
addTest(test: Test): boolean;
toXML(): string;
}
class Test {
constructor(name: string, timestamp?: number);
setDescription(description: string, type: TYPE): void;
addLabel(name: string, value: string): void;
addParameter(kind: any, name: string, value: string): void;
addStep(step: Step): void;
addAttachment(attachment: Attachment): void;
end(status: Status, error: Error, timestamp?: number): void;
toXML(): string;
}
class Description {
constructor(value: string, type: TYPE);
toXML(): string;
}
class Step {
constructor(name: string, timestamp?: number);
addStep(step: Step): void;
addAttachment(attachment: Attachment): void;
end(status: Status, error: Error, timestamp?: number): void;
toXML(): string;
}
class Attachment {
constructor(title: string, source: any, size: number, mime: string);
addStep(step: Step): void;
addAttachment(attachment: Attachment): void;
end(status: Status, error: Error, timestamp?: number): void;
toXML(): string;
}
}
+24
View File
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true
},
"files": [
"index.d.ts",
"allure-js-commons-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+2
View File
@@ -33,6 +33,8 @@ interface IItemLookupOptions {
searchIndex?: string;
truncateReviewsAt?: number;
variationPage?: string;
domain?: string;
request?: Function;
}
interface IBrowseNodeLookupOptions {
+3
View File
@@ -20,8 +20,11 @@ declare module 'angular' {
interface IAnimateCallbackObject {
eventFn?: (element: JQuery, doneFunction: Function, options: IAnimationOptions) => any;
beforeSetClass?: (element: JQuery, addedClasses: string, removedClasses: string, doneFunction: Function, options: IAnimationOptions) => any;
setClass?: (element: JQuery, addedClasses: string, removedClasses: string, doneFunction: Function, options: IAnimationOptions) => any;
beforeAddClass?: (element: JQuery, addedClasses: string, doneFunction: Function, options: IAnimationOptions) => any;
addClass?: (element: JQuery, addedClasses: string, doneFunction: Function, options: IAnimationOptions) => any;
beforeRemoveClass?: (element: JQuery, removedClasses: string, doneFunction: Function, options: IAnimationOptions) => any;
removeClass?: (element: JQuery, removedClasses: string, doneFunction: Function, options: IAnimationOptions) => any;
enter?: (element: JQuery, doneFunction: Function, options: IAnimationOptions) => any;
leave?: (element: JQuery, doneFunction: Function, options: IAnimationOptions) => any;
+3
View File
@@ -0,0 +1,3 @@
import * as ansi from "ansi-escapes";
console.log(ansi.cursorUp(2) + ansi.cursorLeft === "\u001B[2A\u001B[1000D");
+57
View File
@@ -0,0 +1,57 @@
// Type definitions for ansi-escapes 3.0
// Project: https://github.com/sindresorhus/ansi-escapes
// Definitions by: Rong Shen <https://github.com/jacobbubu>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
declare namespace Ansi {
interface ImageOptions {
width?: number;
height?: number;
preserveAspectRatio?: boolean;
}
interface Term {
setCwd(cwd: string): string;
}
interface AnsiEscapes {
cursorTo(x: number, y?: number): string;
cursorMove(x: number, y?: number): string;
cursorUp(count: number): string;
cursorDown(count: number): string;
cursorForward(count: number): string;
cursorBackward(count: number): string;
cursorLeft: string;
cursorSavePosition: string;
cursorRestorePosition: string;
cursorGetPosition: string;
cursorNextLine: string;
cursorPrevLine: string;
cursorHide: string;
cursorShow: string;
eraseLines(count: number): string;
eraseEndLine: string;
eraseStartLine: string;
eraseLine: string;
eraseDown: string;
eraseUp: string;
eraseScreen: string;
scrollUp: string;
scrollDown: string;
clearScreen: string;
beep: string;
link(text: string, url: string): string;
image(buf: Buffer, opts?: ImageOptions): string;
iTerm: Term;
}
}
declare const ansiEscapes: Ansi.AnsiEscapes;
export = ansiEscapes;
+16
View File
@@ -0,0 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": ["index.d.ts", "ansi-escapes-tests.ts"]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+6
View File
@@ -20,6 +20,12 @@ simpleExample.addArgument(
help: 'bar foo',
}
);
simpleExample.addArgument(
'positional',
{
help: 'bar foo',
}
);
simpleExample.printHelp();
console.log('-----------');
+2 -1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/nodeca/argparse
// Definitions by: Andrew Schurman <https://github.com/arcticwaters>
// Tomasz Łaziuk <https://github.com/tlaziuk>
// Sebastian Silbermann <https://github.com/eps1lon>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
@@ -34,7 +35,7 @@ export class SubParser {
}
export class ArgumentGroup {
addArgument(args: string[], options?: ArgumentOptions): void;
addArgument(args: string[] | string, options?: ArgumentOptions): void;
addArgumentGroup(options?: ArgumentGroupOptions): ArgumentGroup;
addMutuallyExclusiveGroup(options?: { required: boolean }): ArgumentGroup;
setDefaults(options?: {}): void;
+68 -5
View File
@@ -1327,6 +1327,9 @@ function testMarkerLayer() {
markers = markerLayer.findMarkers({ containsRange: [[0, 0], pos] });
markers = markerLayer.findMarkers({ containsRange: [[0, 0], [0, 0]] });
const role = markerLayer.getRole();
if (role) str = role;
// Marker creation
marker = markerLayer.markRange(range);
marker = markerLayer.markRange([pos, pos]);
@@ -1738,6 +1741,10 @@ function testProject() {
subscription = project.onDidAddBuffer(buffer => buffer.id);
subscription = project.observeBuffers(buffer => buffer.getUri());
subscription = project.onDidReplace(projectSpec => {
if (projectSpec != null) str = projectSpec.originPath;
});
// Accessing the git repository
repositories = project.getRepositories();
@@ -1950,32 +1957,54 @@ function testSelection() {
selection.insertText("Replacement", { autoDecreaseIndent: true });
selection.insertText("Replacement", { normalizeLineEndings: true });
selection.insertText("Replacement", { undo: "skip" });
selection.insertText("Replacement", { bypassReadOnly: true });
selection.insertText("Replacement", { select: true, autoIndent: true,
autoIndentNewline: true, autoDecreaseIndent: true, normalizeLineEndings: true,
undo: "skip", preserveTrailingLineIndentation: false });
undo: "skip", preserveTrailingLineIndentation: false, bypassReadOnly: false });
selection.backspace();
selection.backspace({ bypassReadOnly: true });
selection.deleteToPreviousWordBoundary();
selection.deleteToPreviousWordBoundary({ bypassReadOnly: false });
selection.deleteToNextWordBoundary();
selection.deleteToNextWordBoundary({ bypassReadOnly: true });
selection.deleteToBeginningOfWord();
selection.deleteToBeginningOfWord({ bypassReadOnly: false });
selection.deleteToBeginningOfLine();
selection.deleteToBeginningOfLine({ bypassReadOnly: true });
selection.delete();
selection.delete({ bypassReadOnly: false });
selection.deleteToEndOfLine();
selection.deleteToEndOfLine({ bypassReadOnly: true });
selection.deleteToEndOfWord();
selection.deleteToEndOfWord({ bypassReadOnly: false });
selection.deleteToBeginningOfSubword();
selection.deleteToBeginningOfSubword({ bypassReadOnly: true });
selection.deleteToEndOfSubword();
selection.deleteToEndOfSubword({ bypassReadOnly: false });
selection.deleteSelectedText();
selection.deleteSelectedText({ bypassReadOnly: true });
selection.deleteLine();
selection.deleteLine({ bypassReadOnly: false });
selection.joinLines();
selection.joinLines({ bypassReadOnly: true });
selection.outdentSelectedRows();
selection.outdentSelectedRows({ bypassReadOnly: false });
selection.autoIndentSelectedRows();
selection.autoIndentSelectedRows({ bypassReadOnly: true });
selection.toggleLineComments();
selection.toggleLineComments({ bypassReadOnly: false });
selection.cutToEndOfLine();
selection.cutToEndOfLine(true);
selection.cutToEndOfLine(undefined, { bypassReadOnly: true });
selection.cutToEndOfBufferLine();
selection.cutToEndOfBufferLine(true);
selection.cutToEndOfBufferLine(false, { bypassReadOnly: false });
selection.cut();
selection.cut(true);
selection.cut(true, true);
selection.cut(undefined, undefined, { bypassReadOnly: true });
selection.copy();
selection.copy(true);
@@ -1983,6 +2012,7 @@ function testSelection() {
selection.fold();
selection.indentSelectedRows();
selection.indentSelectedRows({ bypassReadOnly: false });
// Managing multiple selections
selection.addSelectionBelow();
@@ -2143,6 +2173,8 @@ function testTextBuffer() {
num = nextRow;
}
bool = buffer.hasAstral();
// Mutating Text
range = buffer.setText("Test");
buffer.setTextViaDiff("Test");
@@ -2232,9 +2264,13 @@ function testTextBuffer() {
// History
bool = buffer.undo();
bool = buffer.undo({ selectionsMarkerLayer: markerLayer });
bool = buffer.redo();
bool = buffer.redo({ selectionsMarkerLayer: markerLayer });
num = buffer.transact<number>(500, (): number => 42);
num = buffer.transact(500, (): number => 42);
num = buffer.transact({ groupingInterval: 500, selectionsMarkerLayer: markerLayer },
(): number => 42);
buffer.clearUndoStack();
num = buffer.createCheckpoint();
@@ -2434,6 +2470,8 @@ function testTextEditor() {
// Mutating Text
editor.setText("Test");
editor.setText("Test", {});
editor.setText("Text", { bypassReadOnly: true });
range = editor.setTextInBufferRange(range, "Test");
range = editor.setTextInBufferRange([pos, pos], "Test");
@@ -2443,7 +2481,7 @@ function testTextEditor() {
range = editor.setTextInBufferRange(range, "Test", {});
range = editor.setTextInBufferRange([pos, pos], "Test", { normalizeLineEndings: true });
range = editor.setTextInBufferRange(range, "Test", { normalizeLineEndings: true,
undo: "skip" });
undo: "skip", bypassReadOnly: false });
editor.insertText("Test");
editor.insertText("Test", {});
@@ -2455,27 +2493,45 @@ function testTextEditor() {
editor.insertText("Test", { undo: "skip" });
editor.insertText("Text", { autoDecreaseIndent: false, autoIndent: false,
autoIndentNewline: false, normalizeLineEndings: false, select: false,
undo: "skip", preserveTrailingLineIndentation: true });
undo: "skip", preserveTrailingLineIndentation: true, bypassReadOnly: true });
editor.insertNewline();
editor.insertNewline({ bypassReadOnly: false });
editor.delete();
editor.delete({ bypassReadOnly: true });
editor.backspace();
editor.backspace({ bypassReadOnly: false });
editor.mutateSelectedText((selection, index) => { selection.clear(); });
editor.transpose();
editor.transpose({ bypassReadOnly: true });
editor.upperCase();
editor.upperCase({ bypassReadOnly: false });
editor.lowerCase();
editor.lowerCase({ bypassReadOnly: true });
editor.toggleLineCommentsInSelection();
editor.toggleLineCommentsInSelection({ bypassReadOnly: false });
editor.insertNewlineBelow();
editor.insertNewlineBelow({ bypassReadOnly: true });
editor.insertNewlineAbove();
editor.insertNewlineAbove({ bypassReadOnly: false });
editor.deleteToBeginningOfWord();
editor.deleteToBeginningOfWord({ bypassReadOnly: true });
editor.deleteToPreviousWordBoundary();
editor.deleteToPreviousWordBoundary({ bypassReadOnly: false });
editor.deleteToNextWordBoundary();
editor.deleteToNextWordBoundary({ bypassReadOnly: true });
editor.deleteToBeginningOfSubword();
editor.deleteToBeginningOfSubword({ bypassReadOnly: false });
editor.deleteToEndOfSubword();
editor.deleteToEndOfSubword({ bypassReadOnly: true });
editor.deleteToBeginningOfLine();
editor.deleteToBeginningOfLine({ bypassReadOnly: false });
editor.deleteToEndOfLine();
editor.deleteToEndOfLine({ bypassReadOnly: true });
editor.deleteToEndOfWord();
editor.deleteToEndOfWord({ bypassReadOnly: false });
editor.deleteLine();
editor.deleteLine({ bypassReadOnly: true });
// History
editor.undo();
@@ -2923,9 +2979,12 @@ function testTextEditor() {
editor.setIndentationForBufferRow(42, 42, { preserveLeadingWhitespace: true });
editor.indentSelectedRows();
editor.indentSelectedRows({ bypassReadOnly: false });
editor.outdentSelectedRows();
editor.outdentSelectedRows({ bypassReadOnly: true });
num = editor.indentLevelForLine("Test");
editor.autoIndentSelectedRows();
editor.autoIndentSelectedRows({ bypassReadOnly: false });
// Grammars
grammar = editor.getGrammar();
@@ -2942,6 +3001,7 @@ function testTextEditor() {
// Clipboard Operations
editor.copySelectedText();
editor.cutSelectedText();
editor.cutSelectedText({ bypassReadOnly: true });
editor.pasteText();
editor.pasteText({});
@@ -2951,11 +3011,14 @@ function testTextEditor() {
editor.pasteText({ normalizeLineEndings: true });
editor.pasteText({ select: true });
editor.pasteText({ undo: "skip" });
editor.pasteText({ bypassReadOnly: false });
editor.pasteText({ autoIndentNewline: true, autoIndent: true, autoDecreaseIndent: true,
normalizeLineEndings: true, select: true, undo: "skip" });
normalizeLineEndings: true, select: true, undo: "skip", bypassReadOnly: true });
editor.cutToEndOfLine();
editor.cutToEndOfLine({ bypassReadOnly: false });
editor.cutToEndOfBufferLine();
editor.cutToEndOfBufferLine({ bypassReadOnly: true });
// Folds
editor.foldCurrentRow();
+99 -62
View File
@@ -1,4 +1,4 @@
// Type definitions for Atom 1.26
// Type definitions for Atom 1.27
// Project: https://github.com/atom/atom
// Definitions by: GlenCFL <https://github.com/GlenCFL>
// smhxx <https://github.com/smhxx>
@@ -7,7 +7,7 @@
// TypeScript Version: 2.3
// NOTE: only those classes exported within this file should be retain that status below.
// https://github.com/atom/atom/blob/v1.26.0/exports/atom.js
// https://github.com/atom/atom/blob/v1.27.0/exports/atom.js
/// <reference types="node" />
@@ -1004,6 +1004,9 @@ export interface MarkerLayer {
/** Find markers in the layer conforming to the given parameters. */
findMarkers(params: FindMarkerOptions): Marker[];
/** Get the role of the marker layer e.g. "atom.selection". */
getRole(): string | undefined;
// Marker Creation
/** Create a marker with the given range. */
markRange(range: RangeCompatible, options?: { reversed?: boolean, invalidate?:
@@ -1525,29 +1528,29 @@ export class TextEditor {
// Mutating Text
/** Replaces the entire contents of the buffer with the given string. */
setText(text: string): void;
setText(text: string, options?: ReadonlyEditOptions): void;
/** Set the text in the given Range in buffer coordinates. */
setTextInBufferRange(range: RangeCompatible, text: string, options?:
TextEditOptions): Range;
TextEditOptions & ReadonlyEditOptions): Range;
/* For each selection, replace the selected text with the given text. */
insertText(text: string, options?: TextInsertionOptions): Range|false;
insertText(text: string, options?: TextInsertionOptions & ReadonlyEditOptions): Range|false;
/** For each selection, replace the selected text with a newline. */
insertNewline(): void;
insertNewline(options?: ReadonlyEditOptions): void;
/**
* For each selection, if the selection is empty, delete the character following
* the cursor. Otherwise delete the selected text.
*/
delete(): void;
delete(options?: ReadonlyEditOptions): void;
/**
* For each selection, if the selection is empty, delete the character preceding
* the cursor. Otherwise delete the selected text.
*/
backspace(): void;
backspace(options?: ReadonlyEditOptions): void;
/**
* Mutate the text of all the selections in a single transaction.
@@ -1561,89 +1564,89 @@ export class TextEditor {
* If the selection is empty, the characters preceding and following the cursor
* are swapped. Otherwise, the selected characters are reversed.
*/
transpose(): void;
transpose(options?: ReadonlyEditOptions): void;
/**
* Convert the selected text to upper case.
* For each selection, if the selection is empty, converts the containing word
* to upper case. Otherwise convert the selected text to upper case.
*/
upperCase(): void;
upperCase(options?: ReadonlyEditOptions): void;
/**
* Convert the selected text to lower case.
* For each selection, if the selection is empty, converts the containing word
* to upper case. Otherwise convert the selected text to upper case.
*/
lowerCase(): void;
lowerCase(options?: ReadonlyEditOptions): void;
/**
* Toggle line comments for rows intersecting selections.
* If the current grammar doesn't support comments, does nothing.
*/
toggleLineCommentsInSelection(): void;
toggleLineCommentsInSelection(options?: ReadonlyEditOptions): void;
/** For each cursor, insert a newline at beginning the following line. */
insertNewlineBelow(): void;
insertNewlineBelow(options?: ReadonlyEditOptions): void;
/** For each cursor, insert a newline at the end of the preceding line. */
insertNewlineAbove(): void;
insertNewlineAbove(options?: ReadonlyEditOptions): void;
/**
* For each selection, if the selection is empty, delete all characters of the
* containing word that precede the cursor. Otherwise delete the selected text.
*/
deleteToBeginningOfWord(): void;
deleteToBeginningOfWord(options?: ReadonlyEditOptions): void;
/**
* Similar to ::deleteToBeginningOfWord, but deletes only back to the previous
* word boundary.
*/
deleteToPreviousWordBoundary(): void;
deleteToPreviousWordBoundary(options?: ReadonlyEditOptions): void;
/** Similar to ::deleteToEndOfWord, but deletes only up to the next word boundary. */
deleteToNextWordBoundary(): void;
deleteToNextWordBoundary(options?: ReadonlyEditOptions): void;
/**
* For each selection, if the selection is empty, delete all characters of the
* containing subword following the cursor. Otherwise delete the selected text.
*/
deleteToBeginningOfSubword(): void;
deleteToBeginningOfSubword(options?: ReadonlyEditOptions): void;
/**
* For each selection, if the selection is empty, delete all characters of the
* containing subword following the cursor. Otherwise delete the selected text.
*/
deleteToEndOfSubword(): void;
deleteToEndOfSubword(options?: ReadonlyEditOptions): void;
/**
* For each selection, if the selection is empty, delete all characters of the
* containing line that precede the cursor. Otherwise delete the selected text.
*/
deleteToBeginningOfLine(): void;
deleteToBeginningOfLine(options?: ReadonlyEditOptions): void;
/**
* For each selection, if the selection is not empty, deletes the selection
* otherwise, deletes all characters of the containing line following the cursor.
* If the cursor is already at the end of the line, deletes the following newline.
*/
deleteToEndOfLine(): void;
deleteToEndOfLine(options?: ReadonlyEditOptions): void;
/**
* For each selection, if the selection is empty, delete all characters of the
* containing word following the cursor. Otherwise delete the selected text.
*/
deleteToEndOfWord(): void;
deleteToEndOfWord(options?: ReadonlyEditOptions): void;
/** Delete all lines intersecting selections. */
deleteLine(): void;
deleteLine(options?: ReadonlyEditOptions): void;
// History
/** Undo the last change. */
undo(): void;
undo(options?: ReadonlyEditOptions): void;
/** Redo the last change. */
redo(): void;
redo(options?: ReadonlyEditOptions): void;
/**
* Batch multiple operations as a single undo/redo step.
@@ -2284,10 +2287,10 @@ export class TextEditor {
{ preserveLeadingWhitespace?: boolean }): void;
/** Indent rows intersecting selections by one level. */
indentSelectedRows(): void;
indentSelectedRows(options?: ReadonlyEditOptions): void;
/** Outdent rows intersecting selections by one level. */
outdentSelectedRows(): void;
outdentSelectedRows(options?: ReadonlyEditOptions): void;
/**
* Get the indentation level of the given line of text.
@@ -2298,7 +2301,7 @@ export class TextEditor {
indentLevelForLine(line: string): number;
/** Indent rows intersecting selections based on the grammar's suggested indent level. */
autoIndentSelectedRows(): void;
autoIndentSelectedRows(options?: ReadonlyEditOptions): void;
// Grammars
/** Get the current Grammar of this editor. */
@@ -2328,7 +2331,7 @@ export class TextEditor {
copySelectedText(): void;
/** For each selection, cut the selected text. */
cutSelectedText(): void;
cutSelectedText(options?: ReadonlyEditOptions): void;
/**
* For each selection, replace the selected text with the contents of the clipboard.
@@ -2336,19 +2339,19 @@ export class TextEditor {
* each selection will be replaced with the content of the corresponding clipboard
* selection text.
*/
pasteText(options?: TextInsertionOptions): void;
pasteText(options?: TextInsertionOptions & ReadonlyEditOptions): void;
/**
* For each selection, if the selection is empty, cut all characters of the
* containing screen line following the cursor. Otherwise cut the selected text.
*/
cutToEndOfLine(): void;
cutToEndOfLine(options?: ReadonlyEditOptions): void;
/**
* For each selection, if the selection is empty, cut all characters of the
* containing buffer line following the cursor. Otherwise cut the selected text.
*/
cutToEndOfBufferLine(): void;
cutToEndOfBufferLine(options?: ReadonlyEditOptions): void;
// Folds
/**
@@ -3322,7 +3325,7 @@ export class Directory {
/** Returns a boolean, always false. */
isFile(): this is File;
/** Returns a roolean, always true. */
/** Returns a boolean, always true. */
isDirectory(): this is Directory;
/** Returns a boolean indicating whether or not this is a symbolic link. */
@@ -4482,6 +4485,10 @@ export interface Project {
/** Invoke a callback when a filesystem change occurs within any open project path. */
onDidChangeFiles(callback: (events: FilesystemChangeEvent) => void): Disposable;
/** Invoke a callback whenever the project's configuration has been replaced. */
onDidReplace(callback: (projectSpec: ProjectSpecification | null | undefined) => void):
Disposable;
// Accessing the Git Repository
/**
* Get an Array of GitRepositorys associated with the project's directories.
@@ -4716,107 +4723,107 @@ export interface Selection {
// Modifying the selected text
/** Replaces text at the current selection. */
insertText(text: string, options?: TextInsertionOptions): void;
insertText(text: string, options?: TextInsertionOptions & ReadonlyEditOptions): void;
/**
* Removes the first character before the selection if the selection is empty
* otherwise it deletes the selection.
*/
backspace(): void;
backspace(options?: ReadonlyEditOptions): void;
/**
* Removes the selection or, if nothing is selected, then all characters from
* the start of the selection back to the previous word boundary.
*/
deleteToPreviousWordBoundary(): void;
deleteToPreviousWordBoundary(options?: ReadonlyEditOptions): void;
/**
* Removes the selection or, if nothing is selected, then all characters from
* the start of the selection up to the next word boundary.
*/
deleteToNextWordBoundary(): void;
deleteToNextWordBoundary(options?: ReadonlyEditOptions): void;
/**
* Removes from the start of the selection to the beginning of the current
* word if the selection is empty otherwise it deletes the selection.
*/
deleteToBeginningOfWord(): void;
deleteToBeginningOfWord(options?: ReadonlyEditOptions): void;
/**
* Removes from the beginning of the line which the selection begins on all
* the way through to the end of the selection.
*/
deleteToBeginningOfLine(): void;
deleteToBeginningOfLine(options?: ReadonlyEditOptions): void;
/**
* Removes the selection or the next character after the start of the selection
* if the selection is empty.
*/
delete(): void;
delete(options?: ReadonlyEditOptions): void;
/**
* If the selection is empty, removes all text from the cursor to the end of
* the line. If the cursor is already at the end of the line, it removes the following
* newline. If the selection isn't empty, only deletes the contents of the selection.
*/
deleteToEndOfLine(): void;
deleteToEndOfLine(options?: ReadonlyEditOptions): void;
/**
* Removes the selection or all characters from the start of the selection to
* the end of the current word if nothing is selected.
*/
deleteToEndOfWord(): void;
deleteToEndOfWord(options?: ReadonlyEditOptions): void;
/**
* Removes the selection or all characters from the start of the selection to
* the end of the current word if nothing is selected.
*/
deleteToBeginningOfSubword(): void;
deleteToBeginningOfSubword(options?: ReadonlyEditOptions): void;
/**
* Removes the selection or all characters from the start of the selection to
* the end of the current word if nothing is selected.
*/
deleteToEndOfSubword(): void;
deleteToEndOfSubword(options?: ReadonlyEditOptions): void;
/** Removes only the selected text. */
deleteSelectedText(): void;
deleteSelectedText(options?: ReadonlyEditOptions): void;
/**
* Removes the line at the beginning of the selection if the selection is empty
* unless the selection spans multiple lines in which case all lines are removed.
*/
deleteLine(): void;
deleteLine(options?: ReadonlyEditOptions): void;
/**
* Joins the current line with the one below it. Lines will be separated by a single space.
* If there selection spans more than one line, all the lines are joined together.
*/
joinLines(): void;
joinLines(options?: ReadonlyEditOptions): void;
/** Removes one level of indent from the currently selected rows. */
outdentSelectedRows(): void;
outdentSelectedRows(options?: ReadonlyEditOptions): void;
/**
* Sets the indentation level of all selected rows to values suggested by the
* relevant grammars.
*/
autoIndentSelectedRows(): void;
autoIndentSelectedRows(options?: ReadonlyEditOptions): void;
/**
* Wraps the selected lines in comments if they aren't currently part of a comment.
* Removes the comment if they are currently wrapped in a comment.
*/
toggleLineComments(): void;
toggleLineComments(options?: ReadonlyEditOptions): void;
/** Cuts the selection until the end of the screen line. */
cutToEndOfLine(): void;
cutToEndOfLine(maintainClipboard?: boolean, options?: ReadonlyEditOptions): void;
/** Cuts the selection until the end of the buffer line. */
cutToEndOfBufferLine(): void;
cutToEndOfBufferLine(maintainClipboard?: boolean, options?: ReadonlyEditOptions): void;
/** Copies the selection to the clipboard and then deletes it. */
cut(maintainClipboard?: boolean, fullLine?: boolean): void;
cut(maintainClipboard?: boolean, fullLine?: boolean, options?: ReadonlyEditOptions): void;
/** Copies the current selection to the clipboard. */
copy(maintainClipboard?: boolean, fullLine?: boolean): void;
@@ -4825,7 +4832,7 @@ export interface Selection {
fold(): void;
/** If the selection spans multiple rows, indent all of them. */
indentSelectedRows(): void;
indentSelectedRows(options?: ReadonlyEditOptions): void;
// Managing multiple selections
/** Moves the selection down one row. */
@@ -5134,6 +5141,12 @@ export class TextBuffer {
*/
nextNonBlankRow(startRow: number): number|null;
/**
* Return true if the buffer contains any astral-plane Unicode characters that
* are encoded as surrogate pairs.
*/
hasAstral(): boolean;
// Mutating Text
/** Replace the entire contents of the buffer with the given text. */
setText(text: string): Range;
@@ -5172,7 +5185,7 @@ export class TextBuffer {
// Markers
/** Create a layer to contain a set of related markers. */
addMarkerLayer(options?: { maintainHistory?: boolean, persistent?: boolean }):
addMarkerLayer(options?: { maintainHistory?: boolean, persistent?: boolean, role?: string }):
MarkerLayer;
/**
@@ -5210,16 +5223,18 @@ export class TextBuffer {
* Undo the last operation. If a transaction is in progress, aborts it.
* @return A boolean of whether or not a change was made.
*/
undo(): boolean;
undo(options?: HistoryTraversalOptions): boolean;
/**
* Redo the last operation.
* @return A boolean of whether or not a change was made.
*/
redo(): boolean;
redo(options?: HistoryTraversalOptions): boolean;
/** Batch multiple operations as a single undo/redo step. */
transact<T>(groupingInterval: number, fn: () => T): T;
transact<T>(optionsOrInterval: number | { groupingInterval?: number } &
HistoryTransactionOptions, fn: () => T): T;
/** Batch multiple operations as a single undo/redo step. */
transact<T>(fn: () => T): T;
/**
@@ -5237,20 +5252,21 @@ export class TextBuffer {
* `::revertToCheckpoint` and `::groupChangesSinceCheckpoint`.
* @return A checkpoint ID value.
*/
createCheckpoint(): number;
createCheckpoint(options?: HistoryTransactionOptions): number;
/**
* Revert the buffer to the state it was in when the given checkpoint was created.
* @return A boolean indicating whether the operation succeeded.
*/
revertToCheckpoint(checkpoint: number): boolean;
revertToCheckpoint(checkpoint: number, options?: HistoryTraversalOptions):
boolean;
/**
* Group all changes since the given checkpoint into a single transaction for
* purposes of undo/redo.
* @return A boolean indicating whether the operation succeeded.
*/
groupChangesSinceCheckpoint(checkpoint: number): boolean;
groupChangesSinceCheckpoint(checkpoint: number, options?: HistoryTransactionOptions): boolean;
/**
* Group the last two text changes for purposes of undo/redo.
@@ -5828,7 +5844,7 @@ export interface TextEditorObservedEvent {
// information under certain contexts.
// NOTE: the config schema with these defaults can be found here:
// https://github.com/atom/atom/blob/v1.26.0/src/config-schema.js
// https://github.com/atom/atom/blob/v1.27.0/src/config-schema.js
/**
* Allows you to strongly type Atom configuration variables. Additional key:value
* pairings merged into this interface will result in configuration values under
@@ -6356,6 +6372,16 @@ export interface FindMarkerOptions {
intersectsRow?: number;
}
export interface HistoryTransactionOptions {
/** When provided, skip taking snapshot for other selections markerLayers except given one. */
selectionsMarkerLayer?: MarkerLayer;
}
export interface HistoryTraversalOptions {
/** Restore snapshot of selections marker layer to given selectionsMarkerLayer. */
selectionsMarkerLayer?: MarkerLayer;
}
export interface MenuOptions {
/** The menu itme's label. */
label: string;
@@ -6413,6 +6439,11 @@ export interface ProcessOptions extends NodeProcessOptions {
autoStart?: boolean;
}
export interface ReadonlyEditOptions {
/** Whether the readonly protections on the text editor should be ignored. */
bypassReadOnly?: boolean;
}
export interface ScanContextOptions {
/** The number of lines before the matched line to include in the results object. */
leadingContextLineCount?: number;
@@ -6822,6 +6853,12 @@ export interface ProjectHistory {
lastOpened: Date;
}
export interface ProjectSpecification {
paths: string[];
originPath: string;
config?: ConfigValues;
}
export interface ScandalResult {
filePath: string;
matches: Array<{
+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;
}
+56
View File
@@ -93,6 +93,7 @@ str = apiGwEvtReqCtx.identity.sourceIp;
strOrNull = apiGwEvtReqCtx.identity.user;
strOrNull = apiGwEvtReqCtx.identity.userAgent;
strOrNull = apiGwEvtReqCtx.identity.userArn;
str = apiGwEvtReqCtx.path;
str = apiGwEvtReqCtx.stage;
str = apiGwEvtReqCtx.requestId;
str = apiGwEvtReqCtx.resourceId;
@@ -503,6 +504,7 @@ function callback(cb: AWSLambda.Callback) {
cb();
cb(null);
cb(error);
cb(str); // https://docs.aws.amazon.com/apigateway/latest/developerguide/handle-errors-in-lambda-integration.html
cb(null, anyObj);
cb(null, bool);
cb(null, str);
@@ -525,6 +527,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 +804,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);
+59 -1
View File
@@ -18,6 +18,7 @@
// David Hayden <https://github.com/Haydabase>
// Chris Redekop <https://github.com/repl-chris>
// Aneil Mallavarapu <https://github.com/aneilbaboo>
// Jeremy Nagel <https://github.com/jeznag>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -42,6 +43,7 @@ export interface APIGatewayEventRequestContext {
userAgent: string | null;
userArn: string | null;
};
path: string;
stage: string;
requestId: string;
requestTimeEpoch: number;
@@ -501,6 +503,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
@@ -608,9 +662,11 @@ export type Handler<TEvent = any, TResult = any> = (
* http://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-handler.html
*
* @param error – an optional parameter that you can use to provide results of the failed Lambda function execution.
* It can be a string for Lambda Proxy Integrations
* https://docs.aws.amazon.com/apigateway/latest/developerguide/handle-errors-in-lambda-integration.html
* @param result – an optional parameter that you can use to provide the result of a successful function execution. The result provided must be JSON.stringify compatible.
*/
export type Callback<TResult = any> = (error?: Error | null, result?: TResult) => void;
export type Callback<TResult = any> = (error?: Error | null | string, result?: TResult) => void;
// Begin defining Handler and Callback types for each API trigger type.
// Ordered by https://docs.aws.amazon.com/lambda/latest/dg/invoking-lambda-function.html
@@ -653,6 +709,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>;
+6 -2
View File
@@ -1,13 +1,15 @@
import * as babel from "babel-core";
// Example from https://github.com/babel/babel/tree/master/packages/babel-core
// Slightly modified example from https://github.com/babel/babel/tree/master/packages/babel-core
const code = `class Example {}`;
const result = babel.transform(code, { /* options */ });
result.code; // Generated code
result.map; // Sourcemap
result.ast; // AST
result.ignored;
result.metadata;
// Examples from http://babeljs.io/docs/usage/api/
// Slightly modified examples from http://babeljs.io/docs/usage/api/
const options: babel.TransformOptions = {
plugins: [
"es2015-arrow-functions",
@@ -24,6 +26,8 @@ babel.transformFile("filename.js", options, (err, result) => {
result.code;
result.map;
result.ast;
result.ignored;
result.metadata;
});
babel.transformFileSync("filename.js", options).code;
+21
View File
@@ -169,9 +169,30 @@ export interface TransformOptions {
wrapPluginVisitorMethod?(pluginAlias: string, visitorType: 'enter' | 'exit', callback: (path: NodePath, state: any) => void): (path: NodePath, state: any) => void ;
}
export interface BabelFileModulesMetadata {
imports: object[];
exports: {
exported: object[],
specifiers: object[]
};
}
export interface BabelFileMetadata {
usedHelpers: string[];
marked: Array<{
type: string;
message: string;
loc: object;
}>;
modules: BabelFileModulesMetadata;
}
export interface BabelFileResult {
ast?: Node;
code?: string;
ignored?: boolean;
map?: object;
metadata?: BabelFileMetadata;
}
export as namespace babel;
@@ -41,3 +41,22 @@ bitcoin.address.toBase58Check(rsBase58Check.hash, rsBase58Check.version);
bitcoin.address.toBech32(rsBech32.data, rsBech32.version, rsBech32.prefix);
bitcoin.address.toOutputScript(address);
bitcoin.address.toOutputScript(address, network);
const redeemScript = bitcoin.script.multisig.output.encode(
2,
[
new Buffer('12345678901234567890123456789012'),
new Buffer('12345678901234567890123456789012'),
new Buffer('12345678901234567890123456789012'),
]
);
bitcoin.script.scriptHash.input.encode(
bitcoin.script.multisig.input.encodeStack(
[
new Buffer('12345678901234567890123456789012'),
new Buffer('12345678901234567890123456789012'),
],
redeemScript,
),
redeemScript,
);
+15 -13
View File
@@ -1,10 +1,11 @@
// Type definitions for bitcoinjs-lib 3.3
// Type definitions for bitcoinjs-lib 3.4
// Project: https://github.com/bitcoinjs/bitcoinjs-lib
// Definitions by: Mohamed Hegazy <https://github.com/mhegazy>
// Daniel <https://github.com/dlebrecht>
// Ron Buckton <https://github.com/rbuckton>
// Satana Charuwichitratana <https://github.com/micksatana>
// Youssef GHOUBACH <https://github.com/youssefgh>
// Kento <https://github.com/kento1218>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Declaration file initially generated by dts-gen for bitcoinjs-lib 3.0.3
// based on the flow version found at https://github.com/flowtype/flow-typed/blob/master/definitions/npm/bitcoinjs-lib_v2.x.x/flow_v0.17.x-/bitcoinjs-lib_v2.x.x.js
@@ -27,6 +28,7 @@ export interface In {
}
export interface Network {
bech32?: string;
bip32: {
public: number;
private: number;
@@ -468,8 +470,8 @@ export namespace script {
check(script: Buffer, allowIncomplete: boolean): boolean;
decode(buffer: Buffer): Array<Buffer | number>;
decodeStack(stack: Buffer[], allowIncomplete: boolean): Array<Buffer | number>;
encode(signatures: ECSignature[], scriptPubKey: Buffer): Buffer;
encodeStack(signatures: ECSignature[], scriptPubKey: Buffer): ECSignature[];
encode(signatures: Buffer[], scriptPubKey: Buffer): Buffer;
encodeStack(signatures: Buffer[], scriptPubKey: Buffer): Buffer[];
};
output: {
check(script: Buffer, allowIncomplete: boolean): boolean;
@@ -483,8 +485,8 @@ export namespace script {
check(script: Buffer): boolean;
decode(buffer: Buffer): Array<Buffer | number>;
decodeStack(stack: Buffer[]): Array<Buffer | number>;
encode(signature: ECSignature): Buffer;
encodeStack(signature: ECSignature): ECSignature[];
encode(signature: Buffer): Buffer;
encodeStack(signature: Buffer): Buffer[];
};
output: {
@@ -497,10 +499,10 @@ export namespace script {
const pubKeyHash: {
input: {
check(script: Buffer): boolean;
decode(buffer: Buffer): { signature: ECSignature; pubKey: Buffer };
decodeStack(stack: Buffer[]): { signature: ECSignature; pubKey: Buffer };
encode(signature: ECSignature, pubKey: Buffer): Buffer;
encodeStack(signature: ECSignature, pubKey: Buffer): [ECSignature, Buffer];
decode(buffer: Buffer): { signature: Buffer; pubKey: Buffer };
decodeStack(stack: Buffer[]): { signature: Buffer; pubKey: Buffer };
encode(signature: Buffer, pubKey: Buffer): Buffer;
encodeStack(signature: Buffer, pubKey: Buffer): [Buffer, Buffer];
};
output: {
@@ -516,7 +518,7 @@ export namespace script {
decode(buffer: Buffer): { redeemScriptStack: Buffer[]; redeemScript: Buffer };
decodeStack(stack: Buffer[]): { redeemScriptStack: Buffer[]; redeemScript: Buffer };
encode(redeemScriptSig: Array<Buffer | number>, redeemScript: Buffer): Buffer;
encodeStack(redeemScriptStack: Buffer[], redeemScript: Buffer): Buffer;
encodeStack(redeemScriptStack: Buffer[], redeemScript: Buffer): Buffer[];
};
output: {
@@ -537,8 +539,8 @@ export namespace script {
const witnessPubKeyHash: {
input: {
check(script: Buffer): boolean;
decodeStack(stack: Buffer[]): { signature: ECSignature; pubKey: Buffer };
encodeStack(signature: ECSignature, pubKey: Buffer): [ECSignature, Buffer];
decodeStack(stack: Buffer[]): { signature: Buffer; pubKey: Buffer };
encodeStack(signature: Buffer, pubKey: Buffer): [Buffer, Buffer];
};
output: {
@@ -552,7 +554,7 @@ export namespace script {
input: {
check(script: Buffer, allowIncomplete: boolean): boolean;
decodeStack(stack: Buffer[]): { redeemScriptStack: Buffer[]; redeemScript: Buffer };
encodeStack(redeemScriptStack: Buffer[], redeemScript: Buffer): Buffer;
encodeStack(redeemScriptStack: Buffer[], redeemScript: Buffer): Buffer[];
};
output: {
+4
View File
@@ -0,0 +1,4 @@
import blockies = require('blockies');
const seed = 'seed';
blockies({ seed });
+14
View File
@@ -0,0 +1,14 @@
// Type definitions for blockies 0.0
// Project: https://github.com/goldylucks/blockies-npm
// Definitions by: Leonid Logvinov <https://github.com/LogvinovLeon>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface BlockiesIcon {
toDataURL(): string;
}
interface BlockiesConfig {
seed: string;
}
declare function blockies(config: BlockiesConfig): BlockiesIcon;
export = blockies;
+16
View File
@@ -0,0 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": ["index.d.ts", "blockies-tests.ts"]
}

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