From 04b8281f8760bd2e416806115053dc35db972f43 Mon Sep 17 00:00:00 2001 From: leanazulyoro Date: Mon, 16 Apr 2018 10:28:18 -0300 Subject: [PATCH 001/564] Add definitions for restify's conditionalHandler plugin --- types/restify/index.d.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/types/restify/index.d.ts b/types/restify/index.d.ts index b5f6dd6fe5..30a5220022 100644 --- a/types/restify/index.d.ts +++ b/types/restify/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for restify 5.0 // Project: https://github.com/restify/node-restify -// Definitions by: Bret Little , Steve Hipwell +// Definitions by: Bret Little , Steve Hipwell , Leandro Almeida // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -946,6 +946,17 @@ export namespace plugins { */ function authorizationParser(options?: any): RequestHandler; + interface HandlerCandidate { + handler: RequestHandler | RequestHandler[]; + version?: string | string[]; + contentType?: string | string[]; + } + + /** + * Runs first handler that matches to the condition + */ + function conditionalHandler(candidates: HandlerCandidate | HandlerCandidate[]): RequestHandler[]; + /** * Conditional headers (If-*) */ From b130408774ba0622125682402446ede98f514a08 Mon Sep 17 00:00:00 2001 From: leanazulyoro Date: Mon, 16 Apr 2018 10:36:38 -0300 Subject: [PATCH 002/564] Changed: restify's version in header of definitions --- types/restify/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/restify/index.d.ts b/types/restify/index.d.ts index 30a5220022..8a07519121 100644 --- a/types/restify/index.d.ts +++ b/types/restify/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for restify 5.0 +// Type definitions for restify 7.1.1 // Project: https://github.com/restify/node-restify // Definitions by: Bret Little , Steve Hipwell , Leandro Almeida // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 74a624759ba410b6f941f01d47c9156f49199c62 Mon Sep 17 00:00:00 2001 From: leanazulyoro Date: Mon, 16 Apr 2018 16:46:00 -0300 Subject: [PATCH 003/564] reverted version --- types/restify/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/restify/index.d.ts b/types/restify/index.d.ts index 8a07519121..30a5220022 100644 --- a/types/restify/index.d.ts +++ b/types/restify/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for restify 7.1.1 +// Type definitions for restify 5.0 // Project: https://github.com/restify/node-restify // Definitions by: Bret Little , Steve Hipwell , Leandro Almeida // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 076d8cafb4f6b8bf3928250d9a0a695dbee522c3 Mon Sep 17 00:00:00 2001 From: Gareth Parker Date: Thu, 19 Apr 2018 20:56:31 +0100 Subject: [PATCH 004/564] Glue - Fix to plugins --- types/glue/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/glue/index.d.ts b/types/glue/index.d.ts index 8e710d233a..d1bf010ffe 100644 --- a/types/glue/index.d.ts +++ b/types/glue/index.d.ts @@ -24,7 +24,7 @@ export interface Plugin { export interface Manifest { server: ServerOptions; register?: { - plugins: Plugin[] + plugins: string | Plugin[] }; } From 8f5e007f5e76260c6991523241dfc2112cbfcfd4 Mon Sep 17 00:00:00 2001 From: Zev Spitz Date: Fri, 20 Apr 2018 20:27:00 +0300 Subject: [PATCH 005/564] activex-dao: Default properties; removed Enumerator, SafeArray; default parameter values fix (#25138) * Default properties; fix jsdoc for default parameters; remove Enumerator * Fix extra line * Move test code into blocks * Recordset default property * Use default properties --- types/activex-dao/activex-dao-tests.ts | 193 +++++++----- types/activex-dao/index.d.ts | 404 ++++++++++++------------- 2 files changed, 307 insertions(+), 290 deletions(-) diff --git a/types/activex-dao/activex-dao-tests.ts b/types/activex-dao/activex-dao-tests.ts index 412bea60b5..7e8c2bef22 100644 --- a/types/activex-dao/activex-dao-tests.ts +++ b/types/activex-dao/activex-dao-tests.ts @@ -1,27 +1,48 @@ -let engine = new ActiveXObject('DAO.DBEngine.120'); +const collectionToArray = (col: { Item(key: any): T }): T[] => { + const results: T[] = []; + const enumerator = new Enumerator(col); + enumerator.moveFirst(); + while (!enumerator.atEnd()) { + results.push(enumerator.item()); + enumerator.moveNext(); + } + return results; +}; + +const dbOpenSnapshot = DAO.RecordsetTypeEnum.dbOpenSnapshot; + +let engine = new ActiveXObject('DAO.DBEngine'); let dbsNorthwind = engine.OpenDatabase('c:\\path\\to\\northwind.mdb'); -// adding a record to a recordset -- https://msdn.microsoft.com/VBA/Access-VBA/articles/add-a-record-to-a-dao-recordset -let rstShippers = dbsNorthwind.OpenRecordset('Shippers'); -rstShippers.AddNew(); -rstShippers.Fields.Item('CompanyName').Value = 'Global Parcel Service'; -// Set remaining fields -rstShippers.Update(); -rstShippers.Close(); +// https://msdn.microsoft.com/VBA/Access-VBA/articles/add-a-record-to-a-dao-recordset +{ + // adding a record to a recordset + const rstShippers = dbsNorthwind.OpenRecordset('Shippers'); + rstShippers.AddNew(); + rstShippers('CompanyName').Value = 'Global Parcel Service'; + // Set remaining fields + rstShippers.Update(); + rstShippers.Close(); +} -// create a QueryDef with the given SQL -- https://msdn.microsoft.com/VBA/Access-VBA/articles/build-sql-statements-that-include-variables-and-controls -let sql = 'SELECT * FROM Orders WHERE OrderDate > #3-31-2006#'; -let qdf = dbsNorthwind.CreateQueryDef('Second quarter', sql); -// using parameters -sql = ` - PARAMETERS QuarterStart DATETIME - SELECT * - FROM Orders - WHERE OrderDate > QuarterStart -`; -qdf = dbsNorthwind.CreateQueryDef('Second quarter (parameters)', sql); +// https://msdn.microsoft.com/VBA/Access-VBA/articles/build-sql-statements-that-include-variables-and-controls +{ + // create a QueryDef with the given SQL + let sql = 'SELECT * FROM Orders WHERE OrderDate > #3-31-2006#'; + let qdf = dbsNorthwind.CreateQueryDef('Second quarter', sql); + // using parameters + sql = ` + PARAMETERS QuarterStart DATETIME + SELECT * + FROM Orders + WHERE OrderDate > QuarterStart + `; + qdf = dbsNorthwind.CreateQueryDef('Second quarter (parameters)', sql); + WScript.Echo(`Field names: ${collectionToArray(qdf.Fields).map(fld => fld.Name).join(', ')}`); +} -// count the number of records in a Recordset -- https://msdn.microsoft.com/VBA/Access-VBA/articles/count-the-number-of-records-in-a-dao-recordset +// https://msdn.microsoft.com/VBA/Access-VBA/articles/count-the-number-of-records-in-a-dao-recordset +/** Count the number of records in a Recordset */ const findRecordCount = (dbs: DAO.Database, sql: string) => { let count = 0; const rstRecords = dbs.OpenRecordset(sql); @@ -33,113 +54,119 @@ const findRecordCount = (dbs: DAO.Database, sql: string) => { return count; }; -// delete records from a Recordset -- https://msdn.microsoft.com/VBA/Access-VBA/articles/delete-a-record-from-a-dao-recordset -rstShippers = dbsNorthwind.OpenRecordset('SELECT * FROM Shippers ORDER BY CompanyName, ShipperID', DAO.RecordsetTypeEnum.dbOpenDynaset); -if (!rstShippers.EOF) { - let name = rstShippers.Fields.Item('CompanyName').Value; - rstShippers.MoveNext(); - while (!rstShippers.EOF) { - const recordName: string = rstShippers.Fields.Item('CompanyName').Value; - if (recordName === name) { - rstShippers.Delete(); - } else { - name = recordName; - } +// https://msdn.microsoft.com/VBA/Access-VBA/articles/delete-a-record-from-a-dao-recordset +{ + // delete records from a Recordset + const rstShippers = dbsNorthwind.OpenRecordset('SELECT * FROM Shippers ORDER BY CompanyName, ShipperID', DAO.RecordsetTypeEnum.dbOpenDynaset); + if (!rstShippers.EOF) { + let name = rstShippers('CompanyName').Value; rstShippers.MoveNext(); + while (!rstShippers.EOF) { + const recordName: string = rstShippers('CompanyName').Value; + if (recordName === name) { + rstShippers.Delete(); + } else { + name = recordName; + } + rstShippers.MoveNext(); + } } + rstShippers.Close(); } -rstShippers.Close(); -// copy entire records to an array -- https://msdn.microsoft.com/VBA/Access-VBA/articles/extract-data-from-a-record-in-a-dao-recordset -let rstEmployees = dbsNorthwind.OpenRecordset('SELECT FirstName, LastName, Title FROM Employees', DAO.RecordsetTypeEnum.dbOpenSnapshot); -let records = new VBArray(rstEmployees.GetRows(3)); -let recordCount = records.ubound(2) + 1; -let columnCount = records.ubound(1) + 1; -for (let row = 0; row < recordCount; row += 1) { - for (let column = 0; column < columnCount; column += 1) { - WScript.Echo(records.getItem(column, row)); +// https://msdn.microsoft.com/VBA/Access-VBA/articles/extract-data-from-a-record-in-a-dao-recordset +{ + // copy entire records to an array + const rstEmployees = dbsNorthwind.OpenRecordset('SELECT FirstName, LastName, Title FROM Employees', dbOpenSnapshot); + const records = new VBArray(rstEmployees.GetRows(3)); + const recordCount = records.ubound(2) + 1; + const columnCount = records.ubound(1) + 1; + for (let row = 0; row < recordCount; row += 1) { + for (let column = 0; column < columnCount; column += 1) { + WScript.Echo(records.getItem(column, row)); + } } + if (rstEmployees.EOF) { WScript.Echo('At end of recordset'); } + rstEmployees.Close(); } -if (rstEmployees.EOF) { WScript.Echo('At end of recordset'); } -rstEmployees.Close(); // find a record in a dynaset-type or snapshot-type DAO Recordset -- https://msdn.microsoft.com/en-us/vba/access-vba/articles/find-a-record-in-a-dynaset-type-or-snapshot-type-dao-recordset -const findOrdersWithoutDetails = () => { +{ const orders: number[] = []; - const rstOrders = dbsNorthwind.OpenRecordset('SELECT * FROM Orders ORDER BY OrderID', DAO.RecordsetTypeEnum.dbOpenSnapshot); - const rstOrderDetails = dbsNorthwind.OpenRecordset('SELECT * FROM [Order Details] ORDER BY OrderID', DAO.RecordsetTypeEnum.dbOpenSnapshot); + const rstOrders = dbsNorthwind.OpenRecordset('SELECT * FROM Orders ORDER BY OrderID', dbOpenSnapshot); + const rstOrderDetails = dbsNorthwind.OpenRecordset('SELECT * FROM [Order Details] ORDER BY OrderID', dbOpenSnapshot); - const closeRecordsets = () => { - rstOrders.Close(); - rstOrderDetails.Close(); - }; - if (rstOrders.EOF || rstOrderDetails.EOF) { - closeRecordsets(); - return; - } - - while (!rstOrders.EOF) { - const orderID = rstOrders.Fields.Item('OrderID').Value; - rstOrderDetails.FindFirst(`OrderID=${orderID}`); - if (rstOrderDetails.NoMatch) { - orders.push(orderID); + if (!rstOrders.EOF && !rstOrderDetails.EOF) { + while (!rstOrders.EOF) { + const orderID = rstOrders('OrderID').Value; + rstOrderDetails.FindFirst(`OrderID=${orderID}`); + if (rstOrderDetails.NoMatch) { + orders.push(orderID); + } + rstOrders.MoveNext(); } - rstOrders.MoveNext(); } - closeRecordsets(); - return orders; -}; -// find a record in a table-type DAO Recordset -- https://msdn.microsoft.com/VBA/Access-VBA/articles/find-a-record-in-a-table-type-dao-recordset + rstOrders.Close(); + rstOrderDetails.Close(); + + WScript.Echo(orders.join('\n')); +} + +// https://msdn.microsoft.com/VBA/Access-VBA/articles/find-a-record-in-a-table-type-dao-recordset +/** Find a record in a table-type DAO Recordset */ const getHireDate = (employeeID: number) => { let hireDate: Date | undefined; const rstEmployees = dbsNorthwind.OpenRecordset('Employees'); rstEmployees.Index = 'PrimaryKey'; rstEmployees.Seek('=', employeeID); if (!rstEmployees.NoMatch) { - hireDate = new Date(rstEmployees.Fields.Item('HireDate').Value as VarDate); + hireDate = new Date(rstEmployees('HireDate').Value as VarDate); } return hireDate; }; -// manipulate multiple fields with DAO -- https://msdn.microsoft.com/VBA/Access-VBA/articles/manipulate-multivalued-fields-with-dao -const browseMultiValueField = () => { +// https://msdn.microsoft.com/VBA/Access-VBA/articles/manipulate-multivalued-fields-with-dao +{ + // manipulate multiple fields with DAO const rs = dbsNorthwind.OpenRecordset('Tasks'); rs.MoveFirst(); while (!rs.EOF) { - WScript.Echo(rs.Fields.Item('TaskName').Value); - const childRs = rs.Fields.Item('AssignedTo').Value as DAO.Recordset; + WScript.Echo(rs('TaskName').Value); + const childRs = rs('AssignedTo').Value as DAO.Recordset; if (childRs.EOF) { continue; } childRs.MoveFirst(); while (!childRs.EOF) { - WScript.Echo('\t' + childRs.Fields.Item('Value').Value); + WScript.Echo('\t' + childRs('Value').Value); } } -}; +} -// modifying an existing record in a DAO Recordset -- https://msdn.microsoft.com/VBA/Access-VBA/articles/modify-an-existing-record-in-a-dao-recordset -const changeTitleWithoutTransaction = () => { - rstEmployees = dbsNorthwind.OpenRecordset('Employees'); +// https://msdn.microsoft.com/VBA/Access-VBA/articles/modify-an-existing-record-in-a-dao-recordset +{ + // modifying an existing record in a DAO Recordset + const rstEmployees = dbsNorthwind.OpenRecordset('Employees'); while (!rstEmployees.EOF) { - if (rstEmployees.Fields.Item('Title').Value === 'Sales Representative') { + if (rstEmployees('Title').Value === 'Sales Representative') { rstEmployees.Edit(); - rstEmployees.Fields.Item('Title').Value = 'Account Executive'; + rstEmployees('Title').Value = 'Account Executive'; rstEmployees.Update(); } rstEmployees.MoveNext(); } rstEmployees.Close(); -}; +} -// using transactions in a DAO Recordset -- https://msdn.microsoft.com/VBA/Access-VBA/articles/use-transactions-in-a-dao-recordset +// https://msdn.microsoft.com/VBA/Access-VBA/articles/use-transactions-in-a-dao-recordset +/** using transactions in a DAO Recordset */ const changeTitleWithTransaction = (commitTransaction: boolean) => { - const currentWorkspace = engine.Workspaces.Item(0); - rstEmployees = dbsNorthwind.OpenRecordset('Employees'); + const currentWorkspace = engine.Workspaces(0); + const rstEmployees = dbsNorthwind.OpenRecordset('Employees'); currentWorkspace.BeginTrans(); while (!rstEmployees.EOF) { - if (rstEmployees.Fields.Item('Title').Value === 'Sales Representative') { + if (rstEmployees('Title').Value === 'Sales Representative') { rstEmployees.Edit(); - rstEmployees.Fields.Item('Title').Value = 'Account Executive'; + rstEmployees('Title').Value = 'Account Executive'; rstEmployees.Update(); } rstEmployees.MoveNext(); diff --git a/types/activex-dao/index.d.ts b/types/activex-dao/index.d.ts index 6db3e0bd0d..a2a159e324 100644 --- a/types/activex-dao/index.d.ts +++ b/types/activex-dao/index.d.ts @@ -1,8 +1,8 @@ -// Type definitions for Microsoft Office 14.0 Access Database Engine Object Library - DAO 14.0 +// Type definitions for Microsoft Office 16.0 Access Database Engine Object Library - DAO 16.0 // Project: https://msdn.microsoft.com/en-us/library/dn124645.aspx // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.6 declare namespace DAO { const enum _DAOSuppHelp { @@ -56,12 +56,15 @@ declare namespace DAO { } const enum DatabaseTypeEnum { + /** @deprecated */ dbDecrypt = 4, + /** @deprecated */ dbEncrypt = 2, dbVersion10 = 1, dbVersion11 = 8, dbVersion120 = 128, dbVersion140 = 256, + dbVersion150 = 512, dbVersion20 = 16, dbVersion30 = 32, dbVersion40 = 64, @@ -128,6 +131,15 @@ declare namespace DAO { dbRefreshCache = 8, } + const enum ISAMStatsEnum { + DiskReads = 0, + DiskWrites = 1, + LocksPlaced = 4, + LocksReleased = 5, + ReadsFromCache = 2, + ReadsFromReadAheadCache = 3, + } + const enum LanguageConstants { dbLangArabic = ';LANGID=0x0401;CP=1256;COUNTRY=0', dbLangChineseSimplified = ';LANGID=0x0804;CP=936;COUNTRY=0', @@ -308,18 +320,26 @@ declare namespace DAO { dbUseODBC = 1, } + type Bookmark = SafeArray; + + class ComplexType { + private 'DAO.ComplexType_typekey': ComplexType; + private constructor(); + readonly Fields: Fields; + } + class Connection { private 'DAO.Connection_typekey': Connection; private constructor(); Cancel(): void; Close(): void; readonly Connect: string; - CreateQueryDef(Name?: any, SQLText?: any): QueryDef; + CreateQueryDef(Name?: string, SQLText?: string): QueryDef; readonly Database: Database; - Execute(Query: string, Options?: any): void; + Execute(Query: string, Options?: RecordsetOptionEnum): void; readonly hDbc: number; readonly Name: string; - OpenRecordset(Name: string, Type?: any, Options?: any, LockEdit?: any): Recordset; + OpenRecordset(Name: string, Type?: RecordsetTypeEnum, Options?: RecordsetOptionEnum, LockEdit?: LockTypeEnum): Recordset; readonly QueryDefs: QueryDefs; QueryTimeout: number; readonly RecordsAffected: number; @@ -329,12 +349,11 @@ declare namespace DAO { readonly Updatable: boolean; } - class Connections { - private 'DAO.Connections_typekey': Connections; - private constructor(); + interface Connections { readonly Count: number; - Item(Item: any): Connection; + Item(Item: number | string): Connection; Refresh(): void; + (Item: number | string): Connection; } class Container { @@ -350,12 +369,11 @@ declare namespace DAO { UserName: string; } - class Containers { - private 'DAO.Containers_typekey': Containers; - private constructor(); + interface Containers { readonly Count: number; - Item(Item: any): Container; + Item(Item: number | string): Container; Refresh(): void; + (Item: number | string): Container; } class Database { @@ -366,16 +384,16 @@ declare namespace DAO { Connect: string; readonly Connection: Connection; readonly Containers: Containers; - CreateProperty(Name?: any, Type?: any, Value?: any, DDL?: any): Property; - CreateQueryDef(Name?: any, SQLText?: any): QueryDef; - CreateRelation(Name?: any, Table?: any, ForeignTable?: any, Attributes?: any): Relation; - CreateTableDef(Name?: any, Attributes?: any, SourceTableName?: any, Connect?: any): TableDef; + CreateProperty(Name?: string, Type?: DataTypeEnum, Value?: any, DDL?: boolean): Property; + CreateQueryDef(Name?: string, SQLText?: string): QueryDef; + CreateRelation(Name?: string, Table?: string, ForeignTable?: string, Attributes?: RelationAttributeEnum): Relation; + CreateTableDef(Name?: string, Attributes?: TableDefAttributeEnum, SourceTableName?: string, Connect?: string): TableDef; DesignMasterID: string; - Execute(Query: string, Options?: any): void; - MakeReplica(PathName: string, Description: string, Options?: any): void; + Execute(Query: string, Options?: RecordsetOptionEnum): void; + MakeReplica(PathName: string, Description: string, Options?: ReplicaTypeEnum): void; readonly Name: string; NewPassword(bstrOld: string, bstrNew: string): void; - OpenRecordset(Name: string, Type?: any, Options?: any, LockEdit?: any): Recordset; + OpenRecordset(Name: string, Type?: RecordsetTypeEnum, Options?: RecordsetOptionEnum, LockEdit?: LockTypeEnum): Recordset; PopulatePartial(DbPathName: string): void; readonly Properties: Properties; readonly QueryDefs: QueryDefs; @@ -384,19 +402,18 @@ declare namespace DAO { readonly Recordsets: Recordsets; readonly Relations: Relations; readonly ReplicaID: string; - Synchronize(DbPathName: string, ExchangeType?: any): void; + Synchronize(DbPathName: string, ExchangeType?: SynchronizeTypeEnum): void; readonly TableDefs: TableDefs; readonly Transactions: boolean; readonly Updatable: boolean; readonly Version: string; } - class Databases { - private 'DAO.Databases_typekey': Databases; - private constructor(); + interface Databases { readonly Count: number; - Item(Item: any): Database; + Item(Item: number | string): Database; Refresh(): void; + (Item: number | string): Database; } class DBEngine { @@ -404,26 +421,51 @@ declare namespace DAO { private constructor(); BeginTrans(): void; - /** @param number [Option=0] */ + /** @param Option [Option=0] */ CommitTrans(Option?: number): void; - CompactDatabase(SrcName: string, DstName: string, DstLocale?: any, Options?: any, SrcLocale?: any): void; - CreateDatabase(Name: string, Locale: string, Option?: any): Database; - CreateWorkspace(Name: string, UserName: string, Password: string, UseType?: any): Workspace; + + /** + * Compact a closed database + * + * @param DstLocale Specify one of the following: + * * the locale, using one of the language constants + * * the password, in the form `;pwd=MyNewPassword'` + * * both the constant and a password, e.g. `dbLangGreek + ';pwd=MyNewPassword'` + * + * @param Options `dbEncrypt` and `dbDecrypt` are deprecated, and unsupported for ACCDB + * @param password Deprecated, and unsupported for ACCDB + */ + CompactDatabase(SrcName: string, DstName: string, DstLocale?: LanguageConstants | string, Options?: DatabaseTypeEnum, password?: string): void; + + /** + * @param Locale Specify one of the following: + * * the locale, using one of the language constants + * * the password, in the form `;pwd=MyNewPassword'` + * * both the constant and a password, e.g. `dbLangGreek + ';pwd=MyNewPassword'` + */ + CreateDatabase(Name: string, Locale: LanguageConstants | string, Option?: DatabaseTypeEnum): Database; + CreateWorkspace(Name: string, UserName: string, Password: string, UseType?: WorkspaceTypeEnum): Workspace; readonly DefaultPassword: string; DefaultType: number; readonly DefaultUser: string; readonly Errors: Errors; - Idle(Action?: any): void; + Idle(Action?: IdleEnum): void; IniPath: string; - ISAMStats(StatNum: number, Reset?: any): number; + + /** Returns various statistics from the Jet engine */ + ISAMStats(StatNum: ISAMStatsEnum, Reset?: boolean): number; LoginTimeout: number; - OpenConnection(Name: string, Options?: any, ReadOnly?: any, Connect?: any): Connection; - OpenDatabase(Name: string, Options?: any, ReadOnly?: any, Connect?: any): Database; + + /** + * @param Connect ODBC connection string; prepend with `ODBC;` + */ + OpenConnection(Name: string, Options?: DriverPromptEnum | RecordsetOptionEnum.dbRunAsync, ReadOnly?: boolean, Connect?: string): Connection; + OpenDatabase(Name: string, Exclusive?: boolean, ReadOnly?: boolean, Connect?: string): Database; readonly Properties: Properties; RegisterDatabase(Dsn: string, Driver: string, Silent: boolean, Attributes: string): void; RepairDatabase(Name: string): void; Rollback(): void; - SetOption(Option: number, Value: any): void; + SetOption(Option: SetOptionEnum, Value: any): void; SystemDB: string; readonly Version: string; readonly Workspaces: Workspaces; @@ -434,9 +476,9 @@ declare namespace DAO { private constructor(); readonly AllPermissions: number; readonly Container: string; - CreateProperty(Name?: any, Type?: any, Value?: any, DDL?: any): Property; - readonly DateCreated: any; - readonly LastUpdated: any; + CreateProperty(Name?: string, Type?: DataTypeEnum, Value?: any, DDL?: boolean): Property; + readonly DateCreated: VarDate; + readonly LastUpdated: VarDate; readonly Name: string; Owner: string; Permissions: number; @@ -444,12 +486,11 @@ declare namespace DAO { UserName: string; } - class Documents { - private 'DAO.Documents_typekey': Documents; - private constructor(); + interface Documents { readonly Count: number; - Item(Item: any): Document; + Item(Item: number | string): Document; Refresh(): void; + (Item: number | string): Document; } class Error { @@ -462,33 +503,38 @@ declare namespace DAO { readonly Source: string; } - class Errors { - private 'DAO.Errors_typekey': Errors; - private constructor(); + interface Errors { readonly Count: number; Item(Item: any): Error; Refresh(): void; + (Item: any): Error; } class Field { - private 'DAO.Field_typekey': Field; private constructor(); + private 'DAO.Field2_typekey': Field; AllowZeroLength: boolean; AppendChunk(Val: any): void; + AppendOnly: boolean; Attributes: number; readonly CollatingOrder: number; readonly CollectionIndex: number; - CreateProperty(Name?: any, Type?: any, Value?: any, DDL?: any): Property; + readonly ComplexType: ComplexType; + CreateProperty(Name?: string, Type?: DataTypeEnum, Value?: any, DDL?: boolean): Property; readonly DataUpdatable: boolean; DefaultValue: any; + Expression: string; readonly FieldSize: number; ForeignName: string; GetChunk(Offset: number, Bytes: number): any; + readonly IsComplex: boolean; + LoadFromFile(FileName: string): void; Name: string; OrdinalPosition: number; readonly OriginalValue: any; readonly Properties: Properties; Required: boolean; + SaveToFile(FileName: string): void; Size: number; readonly SourceField: string; readonly SourceTable: string; @@ -500,44 +546,42 @@ declare namespace DAO { readonly VisibleValue: any; } - class Fields { - private 'DAO.Fields_typekey': Fields; - private constructor(); - Append(Object: any): void; + interface Fields { + Append(Field: Field): void; readonly Count: number; Delete(Name: string): void; - Item(Item: any): Field; + Item(Item: number | string): Field; Refresh(): void; + (Item: number | string): Field; } class Group { private 'DAO.Group_typekey': Group; private constructor(); - CreateUser(Name?: any, PID?: any, Password?: any): User; + CreateUser(Name?: string, PID?: string, Password?: string): User; Name: string; readonly PID: string; readonly Properties: Properties; readonly Users: Users; } - class Groups { - private 'DAO.Groups_typekey': Groups; - private constructor(); - Append(Object: any): void; + interface Groups { + Append(Group: Group): void; readonly Count: number; Delete(Name: string): void; - Item(Item: any): Group; + Item(Item: number | string): Group; Refresh(): void; + (Item: number | string): Group; } class Index { private 'DAO.Index_typekey': Index; private constructor(); Clustered: boolean; - CreateField(Name?: any, Type?: any, Size?: any): Field; - CreateProperty(Name?: any, Type?: any, Value?: any, DDL?: any): Property; + CreateField(Name?: string): Field; + CreateProperty(Name?: string, Type?: DataTypeEnum, Value?: any, DDL?: boolean): Property; readonly DistinctCount: number; - Fields: any; + Fields: Fields; readonly Foreign: boolean; IgnoreNulls: boolean; Name: string; @@ -547,14 +591,14 @@ declare namespace DAO { Unique: boolean; } - class Indexes { - private 'DAO.Indexes_typekey': Indexes; - private constructor(); - Append(Object: any): void; + // tslint:disable-next-line:interface-name + interface Indexes { + Append(Index: Index): void; readonly Count: number; Delete(Name: string): void; - Item(Item: any): Index; + Item(Item: number | string): Index; Refresh(): void; + (Item: number | string): Index; } class Parameter { @@ -567,53 +611,20 @@ declare namespace DAO { Value: any; } - class Parameters { - private 'DAO.Parameters_typekey': Parameters; - private constructor(); + interface Parameters { readonly Count: number; - Item(Item: any): Parameter; + Item(Item: number | string): Parameter; Refresh(): void; + (Item: number | string): Parameter; } - /** DAO 3.0 DBEngine (private) */ - class PrivDBEngine { - private 'DAO.PrivDBEngine_typekey': PrivDBEngine; - private constructor(); - BeginTrans(): void; - - /** @param number [Option=0] */ - CommitTrans(Option?: number): void; - CompactDatabase(SrcName: string, DstName: string, DstLocale?: any, Options?: any, SrcLocale?: any): void; - CreateDatabase(Name: string, Locale: string, Option?: any): Database; - CreateWorkspace(Name: string, UserName: string, Password: string, UseType?: any): Workspace; - readonly DefaultPassword: string; - DefaultType: number; - readonly DefaultUser: string; - readonly Errors: Errors; - Idle(Action?: any): void; - IniPath: string; - ISAMStats(StatNum: number, Reset?: any): number; - LoginTimeout: number; - OpenConnection(Name: string, Options?: any, ReadOnly?: any, Connect?: any): Connection; - OpenDatabase(Name: string, Options?: any, ReadOnly?: any, Connect?: any): Database; - readonly Properties: Properties; - RegisterDatabase(Dsn: string, Driver: string, Silent: boolean, Attributes: string): void; - RepairDatabase(Name: string): void; - Rollback(): void; - SetOption(Option: number, Value: any): void; - SystemDB: string; - readonly Version: string; - readonly Workspaces: Workspaces; - } - - class Properties { - private 'DAO.Properties_typekey': Properties; - private constructor(); - Append(Object: any): void; + interface Properties { + Append(Property: Property): void; readonly Count: number; Delete(Name: string): void; - Item(Item: any): Property; + Item(Item: number | string): Property; Refresh(): void; + (Item: number | string): Property; } class Property { @@ -633,81 +644,78 @@ declare namespace DAO { Cancel(): void; Close(): void; Connect: string; - CreateProperty(Name?: any, Type?: any, Value?: any, DDL?: any): Property; - readonly DateCreated: any; - Execute(Options?: any): void; + CreateProperty(Name?: string, Type?: DataTypeEnum, Value?: any, DDL?: boolean): Property; + readonly DateCreated: VarDate; + Execute(Options?: RecordsetOptionEnum): void; readonly Fields: Fields; readonly hStmt: number; - readonly LastUpdated: any; + readonly LastUpdated: VarDate; MaxRecords: number; Name: string; ODBCTimeout: number; - OpenRecordset(Type?: any, Options?: any, LockEdit?: any): Recordset; + OpenRecordset(Type?: RecordsetTypeEnum, Options?: RecordsetOptionEnum, LockEdit?: LockTypeEnum): Recordset; readonly Parameters: Parameters; - Prepare: any; + Prepare: QueryDefStateEnum; readonly Properties: Properties; readonly RecordsAffected: number; ReturnsRecords: boolean; SQL: string; readonly StillExecuting: boolean; - readonly Type: number; + readonly Type: QueryDefTypeEnum; readonly Updatable: boolean; } - class QueryDefs { - private 'DAO.QueryDefs_typekey': QueryDefs; - private constructor(); - Append(Object: any): void; + interface QueryDefs { + Append(QueryDef: QueryDef): void; readonly Count: number; Delete(Name: string): void; - Item(Item: any): QueryDef; + Item(Item: number | string): QueryDef; Refresh(): void; + (Item: number | string): QueryDef; } - class Recordset { - private 'DAO.Recordset_typekey': Recordset; - private constructor(); + interface Recordset { AbsolutePosition: number; AddNew(): void; readonly BatchCollisionCount: number; - readonly BatchCollisions: any; + readonly BatchCollisions: SafeArray; BatchSize: number; readonly BOF: boolean; - Bookmark: SafeArray; + Bookmark: Bookmark; readonly Bookmarkable: boolean; CacheSize: number; - CacheStart: SafeArray; + CacheStart: Bookmark; Cancel(): void; - /** @param number [UpdateType=1] */ + /** @param UpdateType [UpdateType=1] */ CancelUpdate(UpdateType?: number): void; Clone(): Recordset; Close(): void; Collect(Item: any): any; Connection: Connection; CopyQueryDef(): QueryDef; - readonly DateCreated: any; + readonly DateCreated: VarDate; Delete(): void; Edit(): void; - readonly EditMode: number; + readonly EditMode: EditModeEnum; readonly EOF: boolean; readonly Fields: Fields; - FillCache(Rows?: any, StartBookmark?: any): void; + FillCache(Rows?: number, StartBookmark?: string): void; Filter: string; FindFirst(Criteria: string): void; FindLast(Criteria: string): void; FindNext(Criteria: string): void; FindPrevious(Criteria: string): void; - GetRows(NumRows?: any): any; + GetRows(NumRows?: number): any; readonly hStmt: number; Index: string; - readonly LastModified: SafeArray; - readonly LastUpdated: any; + readonly LastModified: Bookmark; + readonly LastUpdated: VarDate; LockEdits: boolean; - Move(Rows: number, StartBookmark?: any): void; + Move(Rows: number, StartBookmark?: Bookmark): void; MoveFirst(): void; - /** @param number [Options=0] */ + /** @param Options [Options=0] */ MoveLast(Options?: number): void; MoveNext(): void; MovePrevious(): void; @@ -716,45 +724,44 @@ declare namespace DAO { readonly NoMatch: boolean; readonly ODBCFetchCount: number; readonly ODBCFetchDelay: number; - OpenRecordset(Type?: any, Options?: any): Recordset; + OpenRecordset(Type?: RecordsetTypeEnum, Options?: RecordsetOptionEnum): Recordset; readonly Parent: Database; PercentPosition: number; readonly Properties: Properties; readonly RecordCount: number; readonly RecordStatus: number; - Requery(NewQueryDef?: any): void; + Requery(NewQueryDef?: QueryDef): void; readonly Restartable: boolean; - Seek( - Comparison: string, Key1: any, Key2?: any, Key3?: any, Key4?: any, Key5?: any, Key6?: any, Key7?: any, Key8?: any, Key9?: any, Key10?: any, Key11?: any, Key12?: any, Key13?: any): void; + Seek(Comparison: string, Key1: any, Key2?: any, Key3?: any, Key4?: any, Key5?: any, Key6?: any, Key7?: any, Key8?: any, Key9?: any, Key10?: any, Key11?: any, Key12?: any, Key13?: any): void; Sort: string; readonly StillExecuting: boolean; readonly Transactions: boolean; - readonly Type: number; + readonly Type: RecordsetTypeEnum; readonly Updatable: boolean; /** - * @param number [UpdateType=1] - * @param boolean [Force=false] + * @param UpdateType [UpdateType=1] + * @param Force [Force=false] */ - Update(UpdateType?: number, Force?: boolean): void; - UpdateOptions: number; + Update(UpdateType?: UpdateTypeEnum, Force?: boolean): void; + UpdateOptions: UpdateCriteriaEnum; readonly ValidationRule: string; readonly ValidationText: string; + (FieldIndex: number | string): Field; } - class Recordsets { - private 'DAO.Recordsets_typekey': Recordsets; - private constructor(); + interface Recordsets { readonly Count: number; - Item(Item: any): Recordset; + Item(Item: number | string): Recordset; Refresh(): void; + (Item: number | string): Recordset; } class Relation { private 'DAO.Relation_typekey': Relation; private constructor(); - Attributes: number; - CreateField(Name?: any, Type?: any, Size?: any): Field; + Attributes: RelationAttributeEnum; + CreateField(Name?: string): Field; readonly Fields: Fields; ForeignTable: string; Name: string; @@ -763,55 +770,53 @@ declare namespace DAO { Table: string; } - class Relations { - private 'DAO.Relations_typekey': Relations; - private constructor(); - Append(Object: any): void; + interface Relations { + Append(Relation: Relation): void; readonly Count: number; Delete(Name: string): void; - Item(Item: any): Relation; + Item(Item: number | string): Relation; Refresh(): void; + (Item: number | string): Relation; } class TableDef { private 'DAO.TableDef_typekey': TableDef; private constructor(); - Attributes: number; + Attributes: TableDefAttributeEnum; readonly ConflictTable: string; Connect: string; - CreateField(Name?: any, Type?: any, Size?: any): Field; - CreateIndex(Name?: any): Index; - CreateProperty(Name?: any, Type?: any, Value?: any, DDL?: any): Property; - readonly DateCreated: any; + CreateField(Name?: string, Type?: DataTypeEnum, Size?: number): Field; + CreateIndex(Name?: string): Index; + CreateProperty(Name?: string, Type?: DataTypeEnum, Value?: any, DDL?: boolean): Property; + readonly DateCreated: VarDate; readonly Fields: Fields; readonly Indexes: Indexes; - readonly LastUpdated: any; + readonly LastUpdated: VarDate; Name: string; - OpenRecordset(Type?: any, Options?: any): Recordset; + OpenRecordset(Type?: RecordsetTypeEnum, Options?: RecordsetOptionEnum): Recordset; readonly Properties: Properties; readonly RecordCount: number; RefreshLink(): void; - ReplicaFilter: any; + ReplicaFilter: string | boolean; SourceTableName: string; readonly Updatable: boolean; ValidationRule: string; ValidationText: string; } - class TableDefs { - private 'DAO.TableDefs_typekey': TableDefs; - private constructor(); - Append(Object: any): void; + interface TableDefs { + Append(TableDef: TableDef): void; readonly Count: number; Delete(Name: string): void; - Item(Item: any): TableDef; + Item(Item: number | string): TableDef; Refresh(): void; + (Item: number | string): TableDef; } class User { private 'DAO.User_typekey': User; private constructor(); - CreateGroup(Name?: any, PID?: any): Group; + CreateGroup(Name?: string, PID?: string): Group; readonly Groups: Groups; Name: string; NewPassword(bstrOld: string, bstrNew: string): void; @@ -820,14 +825,13 @@ declare namespace DAO { readonly Properties: Properties; } - class Users { - private 'DAO.Users_typekey': Users; - private constructor(); - Append(Object: any): void; + interface Users { + Append(User: User): void; readonly Count: number; Delete(Name: string): void; - Item(Item: any): User; + Item(Item: number | string): User; Refresh(): void; + (Item: number | string): User; } class Workspace { @@ -836,12 +840,19 @@ declare namespace DAO { BeginTrans(): void; Close(): void; - /** @param number [Options=0] */ + /** @param Options [Options=0] */ CommitTrans(Options?: number): void; readonly Connections: Connections; - CreateDatabase(Name: string, Connect: string, Option?: any): Database; - CreateGroup(Name?: any, PID?: any): Group; - CreateUser(Name?: any, PID?: any, Password?: any): User; + + /** + * @param Connect Specify one of the following: + * * the locale, using one of the language constants + * * the password, in the form `;pwd=MyNewPassword'` + * * both the constant and a password, e.g. `dbLangGreek + ';pwd=MyNewPassword'` + */ + CreateDatabase(Name: string, Connect: string, Option?: DatabaseTypeEnum): Database; + CreateGroup(Name?: string, PID?: string): Group; + CreateUser(Name?: string, PID?: string, Password?: string): User; readonly Databases: Databases; DefaultCursorDriver: number; readonly Groups: Groups; @@ -849,8 +860,12 @@ declare namespace DAO { IsolateODBCTrans: number; LoginTimeout: number; Name: string; - OpenConnection(Name: string, Options?: any, ReadOnly?: any, Connect?: any): Connection; - OpenDatabase(Name: string, Options?: any, ReadOnly?: any, Connect?: any): Database; + + /** + * @param Connect ODBC connection string; prepend with `ODBC;` + */ + OpenConnection(Name: string, Options?: DriverPromptEnum | RecordsetOptionEnum.dbRunAsync, ReadOnly?: boolean, Connect?: string): Connection; + OpenDatabase(Name: string, Exclusive?: boolean, ReadOnly?: boolean, Connect?: string): Database; readonly Properties: Properties; Rollback(): void; readonly Type: number; @@ -858,14 +873,13 @@ declare namespace DAO { readonly Users: Users; } - class Workspaces { - private 'DAO.Workspaces_typekey': Workspaces; - private constructor(); - Append(Object: any): void; + interface Workspaces { + Append(Workspace: Workspace): void; readonly Count: number; Delete(Name: string): void; - Item(Item: any): Workspace; + Item(Item: number | string): Workspace; Refresh(): void; + (Item: number | string): Workspace; } } @@ -875,36 +889,12 @@ interface ActiveXObject { interface ActiveXObjectNameMap { 'DAO.DBEngine': DAO.DBEngine; - 'DAO.DBEngine.120': DAO.DBEngine; 'DAO.Field': DAO.Field; 'DAO.Group': DAO.Group; 'DAO.Index': DAO.Index; - 'DAO.PrivateDBEngine': DAO.PrivDBEngine; + 'DAO.PrivateDBEngine': DAO.DBEngine; 'DAO.QueryDef': DAO.QueryDef; 'DAO.Relation': DAO.Relation; 'DAO.TableDef': DAO.TableDef; 'DAO.User': DAO.User; } - -interface EnumeratorConstructor { - new(col: DAO.Connections): Enumerator; - new(col: DAO.Containers): Enumerator; - new(col: DAO.Databases): Enumerator; - new(col: DAO.Documents): Enumerator; - new(col: DAO.Errors): Enumerator; - new(col: DAO.Fields): Enumerator; - new(col: DAO.Groups): Enumerator; - new(col: DAO.Indexes): Enumerator; - new(col: DAO.Parameters): Enumerator; - new(col: DAO.Properties): Enumerator; - new(col: DAO.QueryDefs): Enumerator; - new(col: DAO.Recordsets): Enumerator; - new(col: DAO.Relations): Enumerator; - new(col: DAO.TableDefs): Enumerator; - new(col: DAO.Users): Enumerator; - new(col: DAO.Workspaces): Enumerator; -} - -interface SafeArray { - _brand: SafeArray; -} From cc428670a2d70bfb9b0d633cc6b644e3f7d93c12 Mon Sep 17 00:00:00 2001 From: heroboy Date: Sat, 21 Apr 2018 01:29:18 +0800 Subject: [PATCH 006/564] [THREE]fix class Raycaster and add jsdoc (#25151) * Update three-core.d.ts add `optionalTarget` parameter * Update three-core.d.ts add Curve.arcLengthDivisions * fix Indentation * fix class Raycaster --- types/three/three-core.d.ts | 53 ++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/types/three/three-core.d.ts b/types/three/three-core.d.ts index d3bd6fadcc..f97768d34f 100644 --- a/types/three/three-core.d.ts +++ b/types/three/three-core.d.ts @@ -1833,19 +1833,66 @@ export interface RaycasterParameters { } export class Raycaster { + /** + * This creates a new raycaster object. + * @param origin The origin vector where the ray casts from. + * @param direction The direction vector that gives direction to the ray. Should be normalized. + * @param near All results returned are further away than near. Near can't be negative. Default value is 0. + * @param far All results returned are closer then far. Far can't be lower then near . Default value is Infinity. + */ constructor(origin?: Vector3, direction?: Vector3, near?: number, far?: number); + /** The Ray used for the raycasting. */ ray: Ray; + + /** + * The near factor of the raycaster. This value indicates which objects can be discarded based on the + * distance. This value shouldn't be negative and should be smaller than the far property. + */ near: number; + + /** + * The far factor of the raycaster. This value indicates which objects can be discarded based on the + * distance. This value shouldn't be negative and should be larger than the near property. + */ far: number; + params: RaycasterParameters; - precision: number; + + /** + * The precision factor of the raycaster when intersecting Line objects. + */ linePrecision: number; + /** + * Updates the ray with a new origin and direction. + * @param origin The origin vector where the ray casts from. + * @param direction The normalized direction vector that gives direction to the ray. + */ set(origin: Vector3, direction: Vector3): void; + + /** + * Updates the ray with a new origin and direction. + * @param coords 2D coordinates of the mouse, in normalized device coordinates (NDC)---X and Y components should be between -1 and 1. + * @param camera camera from which the ray should originate + */ setFromCamera(coords: { x: number; y: number; }, camera: Camera ): void; - intersectObject(object: Object3D, recursive?: boolean): Intersection[]; - intersectObjects(objects: Object3D[], recursive?: boolean): Intersection[]; + + /** + * Checks all intersection between the ray and the object with or without the descendants. Intersections are returned sorted by distance, closest first. + * @param object The object to check for intersection with the ray. + * @param recursive If true, it also checks all descendants. Otherwise it only checks intersecton with the object. Default is false. + * @param optionalTarget (optional) target to set the result. Otherwise a new Array is instantiated. If set, you must clear this array prior to each call (i.e., array.length = 0;). + */ + intersectObject(object: Object3D, recursive?: boolean, optionalTarget?: Intersection[]): Intersection[]; + + /** + * Checks all intersection between the ray and the objects with or without the descendants. Intersections are returned sorted by distance, closest first. Intersections are of the same form as those returned by .intersectObject. + * @param objects The objects to check for intersection with the ray. + * @param recursive If true, it also checks all descendants of the objects. Otherwise it only checks intersecton with the objects. Default is false. + * @param optionalTarget (optional) target to set the result. Otherwise a new Array is instantiated. If set, you must clear this array prior to each call (i.e., array.length = 0;). + */ + intersectObjects(objects: Object3D[], recursive?: boolean, optionalTarget?: Intersection[]): Intersection[]; } export class Layers { From 1fc33c76c932afe616ab3d62c2d096d109c43cac Mon Sep 17 00:00:00 2001 From: Eduard Dyckman Date: Fri, 20 Apr 2018 20:29:38 +0300 Subject: [PATCH 007/564] Update index.d.ts (#25130) --- types/storybook__addon-info/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/storybook__addon-info/index.d.ts b/types/storybook__addon-info/index.d.ts index f694ad3eb4..c616933b8f 100644 --- a/types/storybook__addon-info/index.d.ts +++ b/types/storybook__addon-info/index.d.ts @@ -29,6 +29,6 @@ export interface Options { maxPropStringLength?: number; } -export function withInfo(textOrOptions: string | Options): (storyFn: RenderFunction) => () => React.ReactElement; +export function withInfo(textOrOptions: string | Options): (storyFn: RenderFunction) => (context?: object) => React.ReactElement; export function setDefaults(newDefaults: Options): Options; From a7eb125f90220a80698b0344be1e0a8d811cccd6 Mon Sep 17 00:00:00 2001 From: Curtis Maddalozzo Date: Fri, 20 Apr 2018 18:30:42 +0100 Subject: [PATCH 008/564] [Raven] Add types for default transport instances (#25161) * Add definitions for transports * Fix transport option. Add tests. * Bump version * Fix linting error * Add definitions for default transport instances --- types/raven/index.d.ts | 2 ++ types/raven/raven-tests.ts | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/types/raven/index.d.ts b/types/raven/index.d.ts index 5d478a496b..81a36ee8f1 100644 --- a/types/raven/index.d.ts +++ b/types/raven/index.d.ts @@ -158,4 +158,6 @@ export namespace transports { } class HTTPSTransport extends HTTPTransport { } + const https: HTTPSTransport; + const http: HTTPTransport; } diff --git a/types/raven/raven-tests.ts b/types/raven/raven-tests.ts index 6191f8f89d..fc89d88589 100644 --- a/types/raven/raven-tests.ts +++ b/types/raven/raven-tests.ts @@ -16,6 +16,11 @@ Raven.config({ release: 'foobar', transport }); + +Raven.config({ + transport: Raven.transports.https +}); + client.setContext({}); client.on('logged', () => { }); client.process({}); From 6e4734614deeb13174de0c7dcd07d85ab0695df7 Mon Sep 17 00:00:00 2001 From: Richard Hulm Date: Fri, 20 Apr 2018 18:31:33 +0100 Subject: [PATCH 009/564] react-stripe-elements - Add correct typings to creating a source object (#25169) * Update typings. Ensure the createSource typings are better, using the types from the main stripe package. Also update the injectStripe type to be more flexible in how it can be used, ensuring it allows components with state to be used * Tabs not spaces --- types/react-stripe-elements/index.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/types/react-stripe-elements/index.d.ts b/types/react-stripe-elements/index.d.ts index 0ef90dc839..d7cea98728 100644 --- a/types/react-stripe-elements/index.d.ts +++ b/types/react-stripe-elements/index.d.ts @@ -16,6 +16,8 @@ export namespace ReactStripeElements { import ElementsOptions = stripe.elements.ElementsOptions; import TokenOptions = stripe.TokenOptions; import TokenResponse = stripe.TokenResponse; + import SourceResponse = stripe.SourceResponse; + import SourceOptions = stripe.SourceOptions; /** * There's a bug in @types/stripe which defines the property as @@ -28,8 +30,7 @@ export namespace ReactStripeElements { type StripeProviderProps = { apiKey: string; stripe?: never; } | { apiKey?: never; stripe: StripeProps | null; }; interface StripeProps { - // I'm not sure what the definition for this is - createSource(): void; + createSource(sourceData?: SourceOptions): Promise; createToken(options?: TokenOptions): Promise; } From f5e6b5a365bd8ad2e393ae37316a6c43889fe0e5 Mon Sep 17 00:00:00 2001 From: Patrick Simmelbauer Date: Fri, 20 Apr 2018 19:32:43 +0200 Subject: [PATCH 010/564] Add typing for node and mark keys of prosemirror Schema in all prosemirror-* packages (#25061) * Add typing to nodes and mark of prosemirror Schema * Update typings of prosemirror-model * Update typings of prosemirror-view * Update typings of prosemirror-state * Remove warning comments and fix indentation * Fix indendation before comments * Add index signature to nodes and marks * Change default generic argument from Schema to any --- types/prosemirror-collab/index.d.ts | 28 +- types/prosemirror-commands/index.d.ts | 124 ++++-- types/prosemirror-gapcursor/index.d.ts | 10 +- types/prosemirror-history/index.d.ts | 22 +- types/prosemirror-inputrules/index.d.ts | 46 ++- types/prosemirror-keymap/index.d.ts | 11 +- types/prosemirror-markdown/index.d.ts | 52 ++- types/prosemirror-menu/index.d.ts | 67 +-- types/prosemirror-model/index.d.ts | 382 +++++++++++------- .../prosemirror-model-tests.ts | 38 +- types/prosemirror-schema-basic/index.d.ts | 34 +- types/prosemirror-schema-list/index.d.ts | 32 +- types/prosemirror-state/index.d.ts | 190 +++++---- types/prosemirror-tables/index.d.ts | 162 ++++++-- types/prosemirror-transform/index.d.ts | 160 +++++--- types/prosemirror-transform/tsconfig.json | 16 +- types/prosemirror-view/index.d.ts | 209 +++++++--- 17 files changed, 1029 insertions(+), 554 deletions(-) diff --git a/types/prosemirror-collab/index.d.ts b/types/prosemirror-collab/index.d.ts index 4b84101159..cb4949bcba 100644 --- a/types/prosemirror-collab/index.d.ts +++ b/types/prosemirror-collab/index.d.ts @@ -3,13 +3,11 @@ // Definitions by: Bradley Ayers // David Hahn // Tim Baumann +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. +// TypeScript Version: 2.3 +import { Schema } from 'prosemirror-model'; import { EditorState, Plugin, Transaction } from 'prosemirror-state'; import { Step } from 'prosemirror-transform'; @@ -17,13 +15,20 @@ import { Step } from 'prosemirror-transform'; * Creates a plugin that enables the collaborative editing framework * for the editor. */ -export function collab(config?: { version?: number | null, clientID?: number | string | null }): Plugin; +export function collab(config?: { + version?: number | null; + clientID?: number | string | null; +}): Plugin; /** * Create a transaction that represents a set of new steps received from * the authority. Applying this transaction moves the state forward to * adjust to the authority's view of the document. */ -export function receiveTransaction(state: EditorState, steps: Step[], clientIDs: Array): Transaction; +export function receiveTransaction( + state: EditorState, + steps: Array>, + clientIDs: Array +): Transaction; /** * Provides data describing the editor's unconfirmed steps, which need * to be sent to the central authority. Returns null when there is @@ -35,7 +40,14 @@ export function receiveTransaction(state: EditorState, steps: Step[], clientIDs: * rebased, whereas the origin transactions are still the old, * unchanged objects. */ -export function sendableSteps(state: EditorState): { version: number, steps: Step[], clientID: number | string, origins: Transaction[] } | null | void; +export function sendableSteps( + state: EditorState +): { + version: number; + steps: Array>; + clientID: number | string; + origins: Array>; +} | null | void; /** * Get the version up to which the collab plugin has synced with the * central authority. diff --git a/types/prosemirror-commands/index.d.ts b/types/prosemirror-commands/index.d.ts index 5f8cb75946..1f6fbee7b3 100644 --- a/types/prosemirror-commands/index.d.ts +++ b/types/prosemirror-commands/index.d.ts @@ -3,21 +3,21 @@ // Definitions by: Bradley Ayers // David Hahn // Tim Baumann +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.3 -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. - -import { MarkType, Node as ProsemirrorNode, NodeType } from 'prosemirror-model'; +import { MarkType, Node as ProsemirrorNode, NodeType, Schema } from 'prosemirror-model'; import { EditorState, Transaction } from 'prosemirror-state'; import { EditorView } from 'prosemirror-view'; /** * Delete the selection, if there is one. */ -export function deleteSelection(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function deleteSelection( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * If the selection is empty and at the start of a textblock, try to * reduce the distance between that block and the one before it—if @@ -27,7 +27,11 @@ export function deleteSelection(state: EditorState, dispatch?: (tr: Transaction) * into a parent of the previous block. Will use the view for accurate * (bidi-aware) start-of-textblock detection if given. */ -export function joinBackward(state: EditorState, dispatch?: (tr: Transaction) => void, view?: EditorView): boolean; +export function joinBackward( + state: EditorState, + dispatch?: (tr: Transaction) => void, + view?: EditorView +): boolean; /** * When the selection is empty and at the start of a textblock, select * the node before that textblock, if possible. This is intended to be @@ -36,7 +40,11 @@ export function joinBackward(state: EditorState, dispatch?: (tr: Transaction) => * commands, as a fall-back behavior when the schema doesn't allow * deletion at the selected point. */ -export function selectNodeBackward(state: EditorState, dispatch?: (tr: Transaction) => void, view?: EditorView): boolean; +export function selectNodeBackward( + state: EditorState, + dispatch?: (tr: Transaction) => void, + view?: EditorView +): boolean; /** * If the selection is empty and the cursor is at the end of a * textblock, try to reduce or remove the boundary between that block @@ -44,7 +52,11 @@ export function selectNodeBackward(state: EditorState, dispatch?: (tr: Transacti * block closer to this one in the tree structure. Will use the view * for accurate start-of-textblock detection if given. */ -export function joinForward(state: EditorState, dispatch?: (tr: Transaction) => void, view?: EditorView): boolean; +export function joinForward( + state: EditorState, + dispatch?: (tr: Transaction) => void, + view?: EditorView +): boolean; /** * When the selection is empty and at the end of a textblock, select * the node coming after that textblock, if possible. This is intended @@ -53,74 +65,117 @@ export function joinForward(state: EditorState, dispatch?: (tr: Transaction) => * commands, to provide a fall-back behavior when the schema doesn't * allow deletion at the selected point. */ -export function selectNodeForward(state: EditorState, dispatch?: (tr: Transaction) => void, view?: EditorView): boolean; +export function selectNodeForward( + state: EditorState, + dispatch?: (tr: Transaction) => void, + view?: EditorView +): boolean; /** * Join the selected block or, if there is a text selection, the * closest ancestor block of the selection that can be joined, with * the sibling above it. */ -export function joinUp(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function joinUp( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * Join the selected block, or the closest ancestor of the selection * that can be joined, with the sibling after it. */ -export function joinDown(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function joinDown( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * Lift the selected block, or the closest ancestor block of the * selection that can be lifted, out of its parent node. */ -export function lift(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function lift( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * If the selection is in a node whose type has a truthy * [`code`](#model.NodeSpec.code) property in its spec, replace the * selection with a newline character. */ -export function newlineInCode(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function newlineInCode( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * When the selection is in a node with a truthy * [`code`](#model.NodeSpec.code) property in its spec, create a * default block after the code block, and move the cursor there. */ -export function exitCode(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function exitCode( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * If a block node is selected, create an empty paragraph before (if * it is its parent's first child) or after it. */ -export function createParagraphNear(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function createParagraphNear( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * If the cursor is in an empty textblock that can be lifted, lift the * block. */ -export function liftEmptyBlock(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function liftEmptyBlock( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * Split the parent block of the selection. If the selection is a text * selection, also delete its content. */ -export function splitBlock(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function splitBlock( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * Acts like [`splitBlock`](#commands.splitBlock), but without * resetting the set of active marks at the cursor. */ -export function splitBlockKeepMarks(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function splitBlockKeepMarks( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * Move the selection to the node wrapping the current selection, if * any. (Will not select the document node.) */ -export function selectParentNode(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function selectParentNode( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * Select the whole document. */ -export function selectAll(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function selectAll( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * Wrap the selection in a node of the given type with the given * attributes. */ -export function wrapIn(nodeType: NodeType, attrs?: { [key: string]: any }): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; +export function wrapIn( + nodeType: NodeType, + attrs?: { [key: string]: any } +): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; /** * Returns a command that tries to set the textblock around the * selection to the given node type with the given attributes. */ -export function setBlockType(nodeType: NodeType, attrs?: { [key: string]: any }): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; +export function setBlockType( + nodeType: NodeType, + attrs?: { [key: string]: any } +): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; /** * Create a command function that toggles the given mark with the * given attributes. Will return `false` when the current selection @@ -130,7 +185,10 @@ export function setBlockType(nodeType: NodeType, attrs?: { [key: string]: any }) * marks](#state.EditorState.storedMarks) instead of a range of the * document. */ -export function toggleMark(markType: MarkType, attrs?: { [key: string]: any }): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; +export function toggleMark( + markType: MarkType, + attrs?: { [key: string]: any } +): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; /** * Wrap a command so that, when it produces a transform that causes * two joinable nodes to end up next to each other, those are joined. @@ -139,17 +197,19 @@ export function toggleMark(markType: MarkType, attrs?: { [key: string]: any }): * array of strings was passed, if their node type name is in that * array. */ -export function autoJoin( - command: (state: EditorState, p1?: (tr: Transaction) => void) => boolean, - isJoinable: ((before: ProsemirrorNode, after: ProsemirrorNode) => boolean) | string[] -): (state: EditorState, p1?: (tr: Transaction) => void) => boolean; +export function autoJoin( + command: (state: EditorState, p1?: (tr: Transaction) => void) => boolean, + isJoinable: ((before: ProsemirrorNode, after: ProsemirrorNode) => boolean) | string[] +): (state: EditorState, p1?: (tr: Transaction) => void) => boolean; /** * Combine a number of command functions into a single function (which * calls them one by one until one returns true). */ -export function chainCommands( - ...commands: Array<(p1: EditorState, p2?: (tr: Transaction) => void, p3?: EditorView) => boolean> -): (p1: EditorState, p2?: (tr: Transaction) => void, p3?: EditorView) => boolean; +export function chainCommands( + ...commands: Array< + (p1: EditorState, p2?: (tr: Transaction) => void, p3?: EditorView) => boolean + > +): (p1: EditorState, p2?: (tr: Transaction) => void, p3?: EditorView) => boolean; /** * A basic keymap containing bindings not specific to any schema. * Binds the following keys (when multiple commands are listed, they diff --git a/types/prosemirror-gapcursor/index.d.ts b/types/prosemirror-gapcursor/index.d.ts index 41edf50e3f..c1fe56425d 100644 --- a/types/prosemirror-gapcursor/index.d.ts +++ b/types/prosemirror-gapcursor/index.d.ts @@ -3,12 +3,9 @@ // Definitions by: Bradley Ayers // David Hahn // Tim Baumann +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. +// TypeScript Version: 2.3 import { Plugin, Selection } from 'prosemirror-state'; @@ -16,8 +13,7 @@ import { Plugin, Selection } from 'prosemirror-state'; * Gap cursor selections are represented using this class. Its * `$anchor` and `$head` properties both point at the cursor position. */ -export class GapCursor extends Selection { -} +export class GapCursor extends Selection { } /** * Create a gap cursor plugin. When enabled, this will capture clicks * near and arrow-key-motion past places that don't have a normally diff --git a/types/prosemirror-history/index.d.ts b/types/prosemirror-history/index.d.ts index 4fbb59ecb9..5d62c9267c 100644 --- a/types/prosemirror-history/index.d.ts +++ b/types/prosemirror-history/index.d.ts @@ -3,13 +3,11 @@ // Definitions by: Bradley Ayers // David Hahn // Tim Baumann +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. +// TypeScript Version: 2.3 +import { Schema } from 'prosemirror-model'; import { EditorState, Plugin, Transaction } from 'prosemirror-state'; /** @@ -17,7 +15,7 @@ import { EditorState, Plugin, Transaction } from 'prosemirror-state'; * from being appended to an existing history event (so that they * require a separate undo command to undo). */ -export function closeHistory(tr: Transaction): Transaction; +export function closeHistory(tr: Transaction): Transaction; /** * Returns a plugin that enables the undo history for an editor. The * plugin will track undo and redo stacks, which can be used with the @@ -27,15 +25,21 @@ export function closeHistory(tr: Transaction): Transaction; * property](#state.Transaction.setMeta) of `false` on a transaction * to prevent it from being rolled back by undo. */ -export function history(config?: { depth?: number | null, newGroupDelay?: number | null }): Plugin; +export function history(config?: { depth?: number | null; newGroupDelay?: number | null }): Plugin; /** * A command function that undoes the last change, if any. */ -export function undo(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function undo( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * A command function that redoes the last undone change, if any. */ -export function redo(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function redo( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; /** * The amount of undoable events available in a given state. */ diff --git a/types/prosemirror-inputrules/index.d.ts b/types/prosemirror-inputrules/index.d.ts index a75dc9cff5..7c405530e0 100644 --- a/types/prosemirror-inputrules/index.d.ts +++ b/types/prosemirror-inputrules/index.d.ts @@ -3,14 +3,11 @@ // Definitions by: Bradley Ayers // David Hahn // Tim Baumann +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.3 -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. - -import { Node as ProsemirrorNode, NodeType } from 'prosemirror-model'; +import { Node as ProsemirrorNode, NodeType, Schema } from 'prosemirror-model'; import { EditorState, Plugin, Transaction } from 'prosemirror-state'; /** @@ -19,7 +16,7 @@ import { EditorState, Plugin, Transaction } from 'prosemirror-state'; * changing two dashes into an emdash, wrapping a paragraph starting * with `"> "` into a blockquote, or something entirely different. */ -export class InputRule { +export class InputRule { /** * Create an input rule. The rule applies when the user typed * something and the text directly in front of the cursor matches @@ -36,19 +33,34 @@ export class InputRule { * return a [transaction](#state.Transaction) that describes the * rule's effect, or null to indicate the input was not handled. */ - constructor(match: RegExp, handler: string | ((state: EditorState, match: string[], start: number, end: number) => Transaction | null | void)); + constructor( + match: RegExp, + handler: + | string + | (( + state: EditorState, + match: string[], + start: number, + end: number + ) => Transaction | null | void) + ); } /** * Create an input rules plugin. When enabled, it will cause text * input that matches any of the given rules to trigger the rule's * action. */ -export function inputRules(config: { rules: InputRule[] }): Plugin; +export function inputRules(config: { + rules: Array>; +}): Plugin; /** * This is a command that will undo an input rule, if applying such a * rule was the last thing that the user did. */ -export function undoInputRule(state: EditorState, dispatch?: (p: Transaction) => void): boolean; +export function undoInputRule( + state: EditorState, + dispatch?: (p: Transaction) => void +): boolean; /** * Build an input rule for automatically wrapping a textblock when a * given string is typed. The `regexp` argument is @@ -66,12 +78,12 @@ export function undoInputRule(state: EditorState, dispatch?: (p: Transaction) => * expression match and the node before the wrapped node, and can * return a boolean to indicate whether a join should happen. */ -export function wrappingInputRule( +export function wrappingInputRule( regexp: RegExp, - nodeType: NodeType, + nodeType: NodeType, getAttrs?: { [key: string]: any } | ((p: string[]) => { [key: string]: any } | null | void), - joinPredicate?: (p1: string[], p2: ProsemirrorNode) => boolean -): InputRule; + joinPredicate?: (p1: string[], p2: ProsemirrorNode) => boolean +): InputRule; /** * Build an input rule that changes the type of a textblock when the * matched text is typed into it. You'll usually want to start your @@ -80,7 +92,11 @@ export function wrappingInputRule( * the new node's attributes, and works the same as in the * `wrappingInputRule` function. */ -export function textblockTypeInputRule(regexp: RegExp, nodeType: NodeType, getAttrs?: { [key: string]: any } | ((p: string[]) => { [key: string]: any } | null | void)): InputRule; +export function textblockTypeInputRule( + regexp: RegExp, + nodeType: NodeType, + getAttrs?: { [key: string]: any } | ((p: string[]) => { [key: string]: any } | null | void) +): InputRule; /** * Converts double dashes to an emdash. */ diff --git a/types/prosemirror-keymap/index.d.ts b/types/prosemirror-keymap/index.d.ts index 2e049948d5..8b418b08f5 100644 --- a/types/prosemirror-keymap/index.d.ts +++ b/types/prosemirror-keymap/index.d.ts @@ -3,12 +3,9 @@ // Definitions by: Bradley Ayers // David Hahn // Tim Baumann +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. +// TypeScript Version: 2.3 import { Plugin } from 'prosemirror-state'; import { EditorView } from 'prosemirror-view'; @@ -50,4 +47,6 @@ export function keymap(bindings: { [key: string]: any }): Plugin; * [`keymap`](#keymap.keymap), return a [keydown * handler](#view.EditorProps.handleKeyDown) handles them. */ -export function keydownHandler(bindings: { [key: string]: any }): (view: EditorView, event: Event) => boolean; +export function keydownHandler(bindings: { + [key: string]: any; +}): (view: EditorView, event: Event) => boolean; diff --git a/types/prosemirror-markdown/index.d.ts b/types/prosemirror-markdown/index.d.ts index 6617166c6e..7af366c04e 100644 --- a/types/prosemirror-markdown/index.d.ts +++ b/types/prosemirror-markdown/index.d.ts @@ -3,12 +3,9 @@ // Definitions by: Bradley Ayers // David Hahn // Tim Baumann +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. +// TypeScript Version: 2.3 import { MarkdownIt } from 'markdown-it'; import { Node as ProsemirrorNode, Schema } from 'prosemirror-model'; @@ -19,7 +16,7 @@ import { Node as ProsemirrorNode, Schema } from 'prosemirror-model'; * tokenize a file, and then runs the custom rules it is given over * the tokens to create a ProseMirror document tree. */ -export class MarkdownParser { +export class MarkdownParser { /** * Create a parser with the given configuration. You can configure * the markdown-it parser to parse the dialect you want, and provide @@ -58,7 +55,7 @@ export class MarkdownParser { * **`ignore`**`: ?bool` * : When true, ignore content for the matched token. */ - constructor(schema: Schema, tokenizer: MarkdownIt, tokens: { [key: string]: any }); + constructor(schema: S, tokenizer: MarkdownIt, tokens: { [key: string]: any }); /** * The value of the `tokens` object used to construct * this parser. Can be useful to copy and modify to base other @@ -70,7 +67,7 @@ export class MarkdownParser { * and create a ProseMirror document as prescribed by this parser's * rules. */ - parse(text: string): ProsemirrorNode; + parse(text: string): ProsemirrorNode; } /** * A parser parsing unextended [CommonMark](http://commonmark.org/), @@ -81,13 +78,23 @@ export let defaultMarkdownParser: MarkdownParser; * A specification for serializing a ProseMirror document as * Markdown/CommonMark text. */ -export class MarkdownSerializer { - constructor(nodes: { [name: string]: (state: MarkdownSerializerState, node: ProsemirrorNode, parent: ProsemirrorNode, index: number) => void }, marks: { [key: string]: any }); +export class MarkdownSerializer { + constructor( + nodes: { + [name: string]: ( + state: MarkdownSerializerState, + node: ProsemirrorNode, + parent: ProsemirrorNode, + index: number + ) => void; + }, + marks: { [key: string]: any } + ); /** * The node serializer * functions for this serializer. */ - nodes: { [name: string]: (p1: MarkdownSerializerState, p2: ProsemirrorNode) => void }; + nodes: { [name: string]: (p1: MarkdownSerializerState, p2: ProsemirrorNode) => void }; /** * The mark serializer info. */ @@ -96,7 +103,7 @@ export class MarkdownSerializer { * Serialize the content of the given node to * [CommonMark](http://commonmark.org/). */ - serialize(content: ProsemirrorNode, options?: { [key: string]: any }): string; + serialize(content: ProsemirrorNode, options?: { [key: string]: any }): string; } /** * A serializer for the [basic schema](#schema). @@ -107,7 +114,7 @@ export let defaultMarkdownSerializer: MarkdownSerializer; * methods related to markdown serialization. Instances are passed to * node and mark serialization methods (see `toMarkdown`). */ -export class MarkdownSerializerState { +export class MarkdownSerializerState { /** * The options passed to the serializer. */ @@ -118,7 +125,12 @@ export class MarkdownSerializerState { * the end of the block, and `f` is a function that renders the * content of the block. */ - wrapBlock(delim: string, firstDelim: string | undefined, node: ProsemirrorNode, f: () => void): void; + wrapBlock( + delim: string, + firstDelim: string | undefined, + node: ProsemirrorNode, + f: () => void + ): void; /** * Ensure the current content ends with a newline. */ @@ -132,7 +144,7 @@ export class MarkdownSerializerState { /** * Close the block for the given node. */ - closeBlock(node: ProsemirrorNode): void; + closeBlock(node: ProsemirrorNode): void; /** * Add the given text to the document. When escape is not `false`, * it will be escaped. @@ -141,22 +153,22 @@ export class MarkdownSerializerState { /** * Render the given node as a block. */ - render(node: ProsemirrorNode): void; + render(node: ProsemirrorNode): void; /** * Render the contents of `parent` as block nodes. */ - renderContent(parent: ProsemirrorNode): void; + renderContent(parent: ProsemirrorNode): void; /** * Render the contents of `parent` as inline content. */ - renderInline(parent: ProsemirrorNode): void; + renderInline(parent: ProsemirrorNode): void; /** * Render a node's content as a list. `delim` should be the extra * indentation added to all lines except the first in an item, * `firstDelim` is a function going from an item index to a * delimiter for the first line of the item. */ - renderList(node: ProsemirrorNode, delim: string, firstDelim: (p: number) => string): void; + renderList(node: ProsemirrorNode, delim: string, firstDelim: (p: number) => string): void; /** * Escape the given string so that it can safely appear in Markdown * content. If `startOfLine` is true, also escape characters that @@ -172,5 +184,5 @@ export class MarkdownSerializerState { * leading or trailing property of the return object will be undefined * if there is no match. */ - getEnclosingWhitespace(text: string): { leading?: string | null, trailing?: string | null }; + getEnclosingWhitespace(text: string): { leading?: string | null; trailing?: string | null }; } diff --git a/types/prosemirror-menu/index.d.ts b/types/prosemirror-menu/index.d.ts index 898fdffd20..75cc56966d 100644 --- a/types/prosemirror-menu/index.d.ts +++ b/types/prosemirror-menu/index.d.ts @@ -3,14 +3,11 @@ // Definitions by: Bradley Ayers // David Hahn // Tim Baumann +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.3 -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. - -import { NodeType } from 'prosemirror-model'; +import { NodeType, Schema } from 'prosemirror-model'; import { EditorState, Plugin, Transaction } from 'prosemirror-state'; import { EditorView } from 'prosemirror-view'; @@ -19,61 +16,61 @@ import { EditorView } from 'prosemirror-view'; * display in your menu. Anything that conforms to this interface can * be put into a menu structure. */ -export interface MenuElement { +export interface MenuElement { /** * Render the element for display in the menu. Must return a DOM * element and a function that can be used to update the element to * a new state. The `update` function will return false if the * update hid the entire element. */ - render(pm: EditorView): { dom: Node, update(p: EditorState): boolean }; + render(pm: EditorView): { dom: Node; update(p: EditorState): boolean }; } /** * An icon or label that, when clicked, executes a command. */ -export class MenuItem { - constructor(spec: MenuItemSpec); +export class MenuItem { + constructor(spec: MenuItemSpec); /** * The spec used to create the menu item. */ - spec: MenuItemSpec; + spec: MenuItemSpec; /** * Renders the icon according to its [display * spec](#menu.MenuItemSpec.display), and adds an event handler which * executes the command when the representation is clicked. */ - render(view: EditorView): { dom: Node, update(p: EditorState): boolean }; + render(view: EditorView): { dom: Node; update(p: EditorState): boolean }; } /** * The configuration object passed to the `MenuItem` constructor. */ -export interface MenuItemSpec { +export interface MenuItemSpec { /** * The function to execute when the menu item is activated. */ - run(p1: EditorState, p2: (p: Transaction) => void, p3: EditorView, p4: Event): void; + run(p1: EditorState, p2: (p: Transaction) => void, p3: EditorView, p4: Event): void; /** * Optional function that is used to determine whether the item is * appropriate at the moment. Deselected items will be hidden. */ - select?: ((p: EditorState) => boolean) | null; + select?: ((p: EditorState) => boolean) | null; /** * Function that is used to determine if the item is enabled. If * given and returning false, the item will be given a disabled * styling. */ - enable?: ((p: EditorState) => boolean) | null; + enable?: ((p: EditorState) => boolean) | null; /** * A predicate function to determine whether the item is 'active' (for * example, the item for toggling the strong mark might be active then * the cursor is in strong text). */ - active?: ((p: EditorState) => boolean) | null; + active?: ((p: EditorState) => boolean) | null; /** * A function that renders the item. You must provide either this, * [`icon`](#menu.MenuItemSpec.icon), or [`label`](#MenuItemSpec.label). */ - render?: ((p: EditorView) => Node) | null; + render?: ((p: EditorView) => Node) | null; /** * Describes an icon to show for this item. The object may specify * an SVG icon, in which case its `path` property should be an [SVG @@ -95,7 +92,7 @@ export interface MenuItemSpec { /** * Defines DOM title (mouseover) text for the item. */ - title?: string | ((p: EditorState) => string) | null; + title?: string | ((p: EditorState) => string) | null; /** * Optionally adds a CSS class to the item's DOM representation. */ @@ -115,7 +112,7 @@ export interface MenuItemSpec { * A drop-down menu, displayed as a label with a downwards-pointing * triangle to the right of it. */ -export class Dropdown { +export class Dropdown { /** * Create a dropdown wrapping the elements. Options may include * the following properties: @@ -134,17 +131,17 @@ export class Dropdown { * **`css`**`: string` * : When given, adds an extra set of CSS styles to the menu control. */ - constructor(content: MenuElement[], options?: { [key: string]: any }); + constructor(content: Array>, options?: { [key: string]: any }); /** * Render the dropdown menu and sub-items. */ - render(view: EditorView): { dom: Node, update(p: EditorState): void }; + render(view: EditorView): { dom: Node; update(p: EditorState): void }; } /** * Represents a submenu wrapping a group of elements that start * hidden and expand to the right when hovered over or tapped. */ -export class DropdownSubmenu { +export class DropdownSubmenu { /** * Creates a submenu for the given group of menu elements. The * following options are recognized: @@ -152,11 +149,11 @@ export class DropdownSubmenu { * **`label`**`: string` * : The label to show on the submenu. */ - constructor(content: MenuElement[], options?: { [key: string]: any }); + constructor(content: Array>, options?: { [key: string]: any }); /** * Renders the submenu. */ - render(view: EditorView): { dom: Node, update(p: EditorState): boolean }; + render(view: EditorView): { dom: Node; update(p: EditorState): boolean }; } /** * Render the given, possibly nested, array of menu elements into a @@ -164,7 +161,10 @@ export class DropdownSubmenu { * superfluous separators appear when some of the groups turn out to * be empty). */ -export function renderGrouped(view: EditorView, content: Array): { dom?: DocumentFragment | null, update(p: EditorState): boolean }; +export function renderGrouped( + view: EditorView, + content: Array | Array>> +): { dom?: DocumentFragment | null; update(p: EditorState): boolean }; /** * A set of basic editor-related icons. Contains the properties * `join`, `lift`, `selectParentNode`, `undo`, `redo`, `strong`, `em`, @@ -199,16 +199,25 @@ export function redoItem(p: { [key: string]: any }): MenuItem; * `options`. `options.attrs` may be an object or a function, as in * `toggleMarkItem`. */ -export function wrapItem(nodeType: NodeType, options: { [key: string]: any }): MenuItem; +export function wrapItem( + nodeType: NodeType, + options: { [key: string]: any } +): MenuItem; /** * Build a menu item for changing the type of the textblock around the * selection to the given type. Provides `run`, `active`, and `select` * properties. Others must be given in `options`. `options.attrs` may * be an object to provide the attributes for the textblock node. */ -export function blockTypeItem(nodeType: NodeType, options: { [key: string]: any }): MenuItem; +export function blockTypeItem( + nodeType: NodeType, + options: { [key: string]: any } +): MenuItem; /** * A plugin that will place a menu bar above the editor. Note that * this involves wrapping the editor in an additional `
`. */ -export function menuBar(options: { content: MenuElement[][], floating?: boolean | null }): Plugin; +export function menuBar(options: { + content: Array>>; + floating?: boolean | null; +}): Plugin; diff --git a/types/prosemirror-model/index.d.ts b/types/prosemirror-model/index.d.ts index 153358e3c6..adb8a6141c 100644 --- a/types/prosemirror-model/index.d.ts +++ b/types/prosemirror-model/index.d.ts @@ -1,15 +1,12 @@ -// Type definitions for prosemirror-model 1.1 +// Type definitions for prosemirror-model 1.4 // Project: https://github.com/ProseMirror/prosemirror-model // Definitions by: Bradley Ayers // David Hahn // Tim Baumann // Malte Blanken +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. +// TypeScript Version: 2.3 import OrderedMap = require('orderedmap'); @@ -19,7 +16,17 @@ import OrderedMap = require('orderedmap'); * used to find out whether further content matches here, and whether * a given position is a valid end of the node. */ -export class ContentMatch { +export class ContentMatch { + /** + * Get the first matching node type at this match position that can + * be generated. + */ + defaultType?: NodeType; + /** + * The number of outgoing edges this node has in the finite automaton + * that describes the content expression. + */ + edgeCount: number; /** * True when this match state represents a valid end of the node. */ @@ -28,12 +35,12 @@ export class ContentMatch { * Match a node type and marks, returning a match after that node * if successful. */ - matchType(type: NodeType): ContentMatch | null | void; + matchType(type: NodeType): ContentMatch | null | void; /** * Try to match a fragment. Returns the resulting match when * successful. */ - matchFragment(frag: Fragment, start?: number, end?: number): ContentMatch | null | void; + matchFragment(frag: Fragment, start?: number, end?: number): ContentMatch | null | void; /** * Try to match the given fragment, and if that fails, see if it can * be made to match by inserting nodes in front of it. When @@ -42,14 +49,19 @@ export class ContentMatch { * return a fragment if the resulting match goes to the end of the * content expression. */ - fillBefore(after: Fragment, toEnd?: boolean, startIndex?: number): Fragment | null | void; + fillBefore(after: Fragment, toEnd?: boolean, startIndex?: number): Fragment | null | void; /** * Find a set of wrapping node types that would allow a node of the * given type to appear at this position. The result may be empty * (when it fits directly) and will be null when no such wrapping * exists. */ - findWrapping(target: NodeType): NodeType[] | null | void; + findWrapping(target: NodeType): Array> | null | void; + /** + * Get the _n_th outgoing edge from this node in the finite automaton + * that describes the content expression. + */ + edge(n: number): { type: NodeType; next: ContentMatch }; } /** * A fragment represents a node's collection of child nodes. @@ -58,7 +70,7 @@ export class ContentMatch { * should not mutate them or their content. Rather, you create new * instances whenever needed. The API tries to make this easy. */ -export class Fragment { +export class Fragment { /** * The size of the fragment, which is the total of the size of its * content nodes. @@ -69,38 +81,54 @@ export class Fragment { * positions (relative to start of this fragment). Doesn't descend * into a node when the callback returns `false`. */ - nodesBetween(from: number, to: number, f: (node: ProsemirrorNode, start: number, parent: ProsemirrorNode, index: number) => boolean | null | void): void; + nodesBetween( + from: number, + to: number, + f: ( + node: ProsemirrorNode, + start: number, + parent: ProsemirrorNode, + index: number + ) => boolean | null | void, + startPos?: number + ): void; /** * Call the given callback for every descendant node. The callback * may return `false` to prevent traversal of a given node's children. */ - descendants(f: (node: ProsemirrorNode, pos: number, parent: ProsemirrorNode) => boolean | null | void): void; + descendants( + f: ( + node: ProsemirrorNode, + pos: number, + parent: ProsemirrorNode + ) => boolean | null | void + ): void; /** * Create a new fragment containing the combined content of this * fragment and the other. */ - append(other: Fragment): Fragment; + append(other: Fragment): Fragment; /** * Cut out the sub-fragment between the two given positions. */ - cut(from: number, to?: number): Fragment; + cut(from: number, to?: number): Fragment; /** * Create a new fragment in which the node at the given index is * replaced by the given node. */ - replaceChild(index: number, node: ProsemirrorNode): Fragment; + replaceChild(index: number, node: ProsemirrorNode): Fragment; /** * Compare this fragment to another one. */ - eq(other: Fragment): boolean; + eq(other: Fragment): boolean; /** * The first child of the fragment, or `null` if it is empty. */ - firstChild?: ProsemirrorNode | null; + firstChild?: ProsemirrorNode | null; /** * The last child of the fragment, or `null` if it is empty. */ - lastChild?: ProsemirrorNode | null; + lastChild?: ProsemirrorNode | null; /** * The number of child nodes in this fragment. */ @@ -109,28 +137,28 @@ export class Fragment { * Get the child node at the given index. Raise an error when the * index is out of range. */ - child(index: number): ProsemirrorNode; + child(index: number): ProsemirrorNode; /** * Get the child node at the given index, if it exists. */ - maybeChild(index: number): ProsemirrorNode | null | void; + maybeChild(index: number): ProsemirrorNode | null | void; /** * Call `f` for every child node, passing the node, its offset * into this parent node, and its index. */ - forEach(f: (node: ProsemirrorNode, offset: number, index: number) => void): void; + forEach(f: (node: ProsemirrorNode, offset: number, index: number) => void): void; /** * Find the first position at which this fragment and another * fragment differ, or `null` if they are the same. */ - findDiffStart(other: Fragment): number | null | void; + findDiffStart(other: Fragment): number | null | void; /** * Find the first position, searching from the end, at which this * fragment and the given fragment differ, or `null` if they are the * same. Since this position will not be the same in both nodes, an * object with two separate positions is returned. */ - findDiffEnd(other: ProsemirrorNode): { a: number, b: number } | null | void; + findDiffEnd(other: ProsemirrorNode): { a: number; b: number } | null | void; /** * Return a debugging string that describes this fragment. */ @@ -142,19 +170,24 @@ export class Fragment { /** * Deserialize a fragment from its JSON representation. */ - static fromJSON(schema: Schema, value?: { [key: string]: any }): Fragment; + static fromJSON( + schema: S, + value?: { [key: string]: any } + ): Fragment; /** * Build a fragment from an array of nodes. Ensures that adjacent * text nodes with the same marks are joined together. */ - static fromArray(array: ProsemirrorNode[]): Fragment; + static fromArray(array: Array>): Fragment; /** * Create a fragment from something that can be interpreted as a set * of nodes. For `null`, it returns the empty fragment. For a * fragment, the fragment itself. For a node or array of nodes, a * fragment containing those nodes. */ - static from(nodes?: Fragment | ProsemirrorNode | ProsemirrorNode[]): Fragment; + static from( + nodes?: Fragment | ProsemirrorNode | Array> + ): Fragment; /** * An empty fragment. Intended to be reused whenever a node doesn't * contain anything (rather than allocating a new empty fragment for @@ -167,13 +200,13 @@ export class Fragment { * [`parse`](#model.DOMParser.parse) and * [`parseSlice`](#model.DOMParser.parseSlice) methods. */ -export interface ParseOptions { +export interface ParseOptions { /** * By default, whitespace is collapsed as per HTML's rules. Pass * `true` to preserve whitespace, but normalize newlines to * spaces, and `"full"` to preserve whitespace entirely. */ - preserveWhitespace?: boolean | "full" | null; + preserveWhitespace?: boolean | 'full' | null; /** * When given, the parser will, beside parsing the content, * record the document positions of the given DOM positions. It @@ -181,7 +214,7 @@ export interface ParseOptions { * that holds the document position. DOM positions that are not * in the parsed content will not be written to. */ - findPositions?: Array<{ node: Node, offset: number }> | null; + findPositions?: Array<{ node: Node; offset: number }> | null; /** * The child node index to start parsing from. */ @@ -196,7 +229,7 @@ export interface ParseOptions { * option to use the type and attributes from a different node * as the top container. */ - topNode?: ProsemirrorNode | null; + topNode?: ProsemirrorNode | null; /** * Provide the starting content match that content parsed into the * top node is matched against. @@ -207,13 +240,13 @@ export interface ParseOptions { * [context](#model.ParseRule.context) when parsing, above the * given [top node](#model.ParseOptions.topNode). */ - context?: ResolvedPos | null; + context?: ResolvedPos | null; } /** * A value that describes how to parse a given DOM node or inline * style as a ProseMirror node or mark. */ -export interface ParseRule { +export interface ParseRule { /** * A CSS selector describing the kind of DOM elements to match. A * single rule should have _either_ a `tag` or a `style` property. @@ -308,7 +341,7 @@ export interface ParseRule { * present, instead of parsing the node's child nodes, the result of * this function is used. */ - getContent?: ((p: Node) => Fragment) | null; + getContent?: ((p: Node) => Fragment) | null; /** * Controls whether whitespace should be preserved when parsing the * content inside the matched element. `false` means whitespace may @@ -316,32 +349,32 @@ export interface ParseRule { * but newlines normalized to spaces, and `"full"` means that * newlines should also be preserved. */ - preserveWhitespace?: boolean | "full" | null; + preserveWhitespace?: boolean | 'full' | null; } /** * A DOM parser represents a strategy for parsing DOM content into * a ProseMirror document conforming to a given schema. Its behavior * is defined by an array of [rules](#model.ParseRule). */ -export class DOMParser { +export class DOMParser { /** * Create a parser that targets the given schema, using the given * parsing rules. */ - constructor(schema: Schema, rules: ParseRule[]); + constructor(schema: S, rules: Array>); /** * The schema into which the parser parses. */ - schema: Schema; + schema: S; /** * The set of [parse rules](#model.ParseRule) that the parser * uses, in order of precedence. */ - rules: ParseRule[]; + rules: Array>; /** * Parse a document from the content of a DOM node. */ - parse(dom: Node, options?: ParseOptions): ProsemirrorNode; + parse(dom: Node, options?: ParseOptions): ProsemirrorNode; /** * Parses the content of the given DOM node, like * [`parse`](#model.DOMParser.parse), and takes the same set of @@ -350,13 +383,13 @@ export class DOMParser { * the schema constraints aren't applied to the start of nodes to * the left of the input and the end of nodes at the end. */ - parseSlice(dom: Node, options?: ParseOptions): Slice; + parseSlice(dom: Node, options?: ParseOptions): Slice; /** * Construct a DOM parser using the parsing rules listed in a * schema's [node specs](#model.NodeSpec.parseDOM), reordered by * [priority](#model.ParseRule.priority). */ - static fromSchema(schema: Schema): DOMParser; + static fromSchema(schema: S): DOMParser; } /** * A mark is a piece of information that can be attached to a node, @@ -366,11 +399,11 @@ export class DOMParser { * `Schema`, which controls which types exist and which * attributes they have. */ -export class Mark { +export class Mark { /** * The type of this mark. */ - type: MarkType; + type: MarkType; /** * The attributes associated with this mark. */ @@ -382,35 +415,35 @@ export class Mark { * [exclusive](#model.MarkSpec.excludes) with this mark are present, * those are replaced by this one. */ - addToSet(set: Mark[]): Mark[]; + addToSet(set: Array>): Array>; /** * Remove this mark from the given set, returning a new set. If this * mark is not in the set, the set itself is returned. */ - removeFromSet(set: Mark[]): Mark[]; + removeFromSet(set: Array>): Array>; /** * Test whether this mark is in the given set of marks. */ - isInSet(set: Mark[]): boolean; + isInSet(set: Array>): boolean; /** * Test whether this mark has the same type and attributes as * another mark. */ - eq(other: Mark): boolean; + eq(other: Mark): boolean; /** * Convert this mark to a JSON-serializeable representation. */ toJSON(): { [key: string]: any }; - static fromJSON(schema: Schema, json: { [key: string]: any }): Mark; + static fromJSON(schema: S, json: { [key: string]: any }): Mark; /** * Test whether two sets of marks are identical. */ - static sameSet(a: Mark[], b: Mark[]): boolean; + static sameSet(a: Array>, b: Array>): boolean; /** * Create a properly sorted mark set from null, a single mark, or an * unsorted array of marks. */ - static setFrom(marks?: Mark | Mark[]): Mark[]; + static setFrom(marks?: Mark | Array>): Array>; /** * The empty set of marks. */ @@ -430,11 +463,11 @@ export class Mark { * **Do not** directly mutate the properties of a `Node` object. See * [the guide](/docs/guide/#doc) for more information. */ -declare class ProsemirrorNode { +declare class ProsemirrorNode { /** * The type of node that this is. */ - type: NodeType; + type: NodeType; /** * An object mapping attribute names to values. The kind of * attributes allowed and required are @@ -444,12 +477,12 @@ declare class ProsemirrorNode { /** * A container holding the node's children. */ - content: Fragment; + content: Fragment; /** * The marks (things like whether it is emphasized or part of a * link) applied to this node. */ - marks: Mark[]; + marks: Array>; /** * For text nodes, this contains the node's text content. */ @@ -470,16 +503,16 @@ declare class ProsemirrorNode { * Get the child node at the given index. Raises an error when the * index is out of range. */ - child(index: number): ProsemirrorNode; + child(index: number): ProsemirrorNode; /** * Get the child node at the given index, if it exists. */ - maybeChild(index: number): ProsemirrorNode | null | void; + maybeChild(index: number): ProsemirrorNode | null | void; /** * Call `f` for every child node, passing the node, its offset * into this parent node, and its index. */ - forEach(f: (node: ProsemirrorNode, offset: number, index: number) => void): void; + forEach(f: (node: ProsemirrorNode, offset: number, index: number) => void): void; /** * Invoke a callback for all descendant nodes recursively between * the given two positions that are relative to start of this node's @@ -488,12 +521,28 @@ declare class ProsemirrorNode { * When the callback returns false for a given node, that node's * children will not be recursed over. */ - nodesBetween(from: number, to: number, f: (node: ProsemirrorNode, pos: number, parent: ProsemirrorNode, index: number) => boolean | null | void): void; + nodesBetween( + from: number, + to: number, + f: ( + node: ProsemirrorNode, + pos: number, + parent: ProsemirrorNode, + index: number + ) => boolean | null | void, + startPos?: number + ): void; /** * Call the given callback for every descendant node. Doesn't * descend into a node when the callback returns `false`. */ - descendants(f: (node: ProsemirrorNode, pos: number, parent: ProsemirrorNode) => boolean | null | void): void; + descendants( + f: ( + node: ProsemirrorNode, + pos: number, + parent: ProsemirrorNode + ) => boolean | null | void + ): void; /** * Concatenates all the text nodes found in this fragment and its * children. @@ -510,47 +559,47 @@ declare class ProsemirrorNode { * Returns this node's first child, or `null` if there are no * children. */ - firstChild?: ProsemirrorNode | null; + firstChild?: ProsemirrorNode | null; /** * Returns this node's last child, or `null` if there are no * children. */ - lastChild?: ProsemirrorNode | null; + lastChild?: ProsemirrorNode | null; /** * Test whether two nodes represent the same piece of document. */ - eq(other: ProsemirrorNode): boolean; + eq(other: ProsemirrorNode): boolean; /** * Compare the markup (type, attributes, and marks) of this node to * those of another. Returns `true` if both have the same markup. */ - sameMarkup(other: ProsemirrorNode): boolean; + sameMarkup(other: ProsemirrorNode): boolean; /** * Check whether this node's markup correspond to the given type, * attributes, and marks. */ - hasMarkup(type: NodeType, attrs?: { [key: string]: any }, marks?: Mark[]): boolean; + hasMarkup(type: NodeType, attrs?: { [key: string]: any }, marks?: Array>): boolean; /** * Create a new node with the same markup as this node, containing * the given content (or empty, if no content is given). */ - copy(content?: Fragment): ProsemirrorNode; + copy(content?: Fragment): ProsemirrorNode; /** * Create a copy of this node, with the given set of marks instead * of the node's own marks. */ - mark(marks: Mark[]): ProsemirrorNode; + mark(marks: Array>): ProsemirrorNode; /** * Create a copy of this node with only the content between the * given positions. If `to` is not given, it defaults to the end of * the node. */ - cut(from: number, to?: number): ProsemirrorNode; + cut(from: number, to?: number): ProsemirrorNode; /** * Cut out the part of the document between the given positions, and * return it as a `Slice` object. */ - slice(from: number, to?: number): Slice; + slice(from: number, to?: number): Slice; /** * Replace the part of the document between the given positions with * the given slice. The slice must 'fit', meaning its open sides @@ -559,33 +608,33 @@ declare class ProsemirrorNode { * into. If any of this is violated, an error of type * [`ReplaceError`](#model.ReplaceError) is thrown. */ - replace(from: number, to: number, slice: Slice): ProsemirrorNode; + replace(from: number, to: number, slice: Slice): ProsemirrorNode; /** * Find the node starting at the given position. */ - nodeAt(pos: number): ProsemirrorNode | null | void; + nodeAt(pos: number): ProsemirrorNode | null | void; /** * Find the (direct) child node after the given offset, if any, * and return it along with its index and offset relative to this * node. */ - childAfter(pos: number): { node?: ProsemirrorNode | null, index: number, offset: number }; + childAfter(pos: number): { node?: ProsemirrorNode | null; index: number; offset: number }; /** * Find the (direct) child node before the given offset, if any, * and return it along with its index and offset relative to this * node. */ - childBefore(pos: number): { node?: ProsemirrorNode | null, index: number, offset: number }; + childBefore(pos: number): { node?: ProsemirrorNode | null; index: number; offset: number }; /** * Resolve the given position in the document, returning an * [object](#model.ResolvedPos) with information about its context. */ - resolve(pos: number): ResolvedPos; + resolve(pos: number): ResolvedPos; /** * Test whether a mark of the given type occurs in this document * between the two given positions. */ - rangeHasMark(from: number, to: number, type: MarkType): boolean; + rangeHasMark(from: number, to: number, type: MarkType): boolean; /** * True when this is a block (non-inline node) */ @@ -628,7 +677,7 @@ declare class ProsemirrorNode { /** * Get the content match in this node at the given index. */ - contentMatchAt(index: number): ContentMatch; + contentMatchAt(index: number): ContentMatch; /** * Test whether replacing the range between `from` and `to` (by * child index) with the given replacement fragment (which defaults @@ -636,19 +685,25 @@ declare class ProsemirrorNode { * can optionally pass `start` and `end` indices into the * replacement fragment. */ - canReplace(from: number, to: number, replacement?: Fragment, start?: number, end?: number): boolean; + canReplace( + from: number, + to: number, + replacement?: Fragment, + start?: number, + end?: number + ): boolean; /** * Test whether replacing the range `from` to `to` (by index) with a * node of the given type. */ - canReplaceWith(from: number, to: number, type: NodeType, marks?: Mark[]): boolean; + canReplaceWith(from: number, to: number, type: NodeType, marks?: Array>): boolean; /** * Test whether the given node's content could be appended to this * node. If that node is empty, this will only return true if there * is at least one node type that can appear in both nodes (to avoid * merging completely incompatible nodes). */ - canAppend(other: ProsemirrorNode): boolean; + canAppend(other: ProsemirrorNode): boolean; /** * Check whether this node and its descendants conform to the * schema, and raise error when they do not. @@ -661,21 +716,23 @@ declare class ProsemirrorNode { /** * Deserialize a node from its JSON representation. */ - static fromJSON(schema: Schema, json: { [key: string]: any }): ProsemirrorNode; + static fromJSON( + schema: S, + json: { [key: string]: any } + ): ProsemirrorNode; } export { ProsemirrorNode as Node }; /** * Error type raised by [`Node.replace`](#model.Node.replace) when * given an invalid replacement. */ -export class ReplaceError extends Error { -} +export class ReplaceError extends Error { } /** * A slice represents a piece cut out of a larger document. It * stores not only a fragment, but also the depth up to which nodes on * both side are ‘open’ (cut through). */ -export class Slice { +export class Slice { /** * Create a slice. When specifying a non-zero open depth, you must * make sure that there are nodes of at least that depth at the @@ -688,11 +745,11 @@ export class Slice { * start/end/middle for such a node, depending on which sides are * open. */ - constructor(content: Fragment, openStart: number, openEnd: number); + constructor(content: Fragment, openStart: number, openEnd: number); /** * The slice's content. */ - content: Fragment; + content: Fragment; /** * The open depth at the start. */ @@ -708,7 +765,7 @@ export class Slice { /** * Tests whether this slice is equal to another slice. */ - eq(other: Slice): boolean; + eq(other: Slice): boolean; /** * Convert a slice to a JSON-serializable representation. */ @@ -716,12 +773,15 @@ export class Slice { /** * Deserialize a slice from its JSON representation. */ - static fromJSON(schema: Schema, json?: { [key: string]: any }): Slice; + static fromJSON(schema: S, json?: { [key: string]: any }): Slice; /** * Create a slice from a fragment by taking the maximum possible * open value on both side of the fragment. */ - static maxOpen(fragment: Fragment, openIsolating?: boolean): Slice; + static maxOpen( + fragment: Fragment, + openIsolating?: boolean + ): Slice; /** * The empty slice. */ @@ -737,7 +797,7 @@ export class Slice { * parameter will interpret undefined as `this.depth` and negative * numbers as `this.depth + value`. */ -export class ResolvedPos { +export class ResolvedPos { /** * The position that was resolved. */ @@ -757,16 +817,16 @@ export class ResolvedPos { * a position points into a text node, that node is not considered * the parent—text nodes are ‘flat’ in this model, and have no content. */ - parent: ProsemirrorNode; + parent: ProsemirrorNode; /** * The root node in which the position was resolved. */ - doc: ProsemirrorNode; + doc: ProsemirrorNode; /** * The ancestor node at the given level. `p.node(p.depth)` is the * same as `p.parent`. */ - node(depth?: number): ProsemirrorNode; + node(depth?: number): ProsemirrorNode; /** * The index into the ancestor at the given level. If this points at * the 3rd node in the 2nd paragraph on the top level, for example, @@ -810,20 +870,20 @@ export class ResolvedPos { * points into a text node, only the part of that node after the * position is returned. */ - nodeAfter?: ProsemirrorNode | null; + nodeAfter?: ProsemirrorNode | null; /** * Get the node directly before the position, if any. If the * position points into a text node, only the part of that node * before the position is returned. */ - nodeBefore?: ProsemirrorNode | null; + nodeBefore?: ProsemirrorNode | null; /** * Get the marks at this position, factoring in the surrounding * marks' [`inclusive`](#model.MarkSpec.inclusive) property. If the * position is at the start of a non-empty node, the marks of the * node after it (if any) are returned. */ - marks(): Mark[]; + marks(): Array>; /** * Get the marks after the current position, if any, except those * that are non-inclusive and not present at position `$end`. This @@ -832,7 +892,7 @@ export class ResolvedPos { * its parent node or its parent node isn't a textblock (in which * case no marks should be preserved). */ - marksAcross($end: ResolvedPos): Mark[] | null | void; + marksAcross($end: ResolvedPos): Array> | null | void; /** * The depth up to which this position and the given (non-resolved) * position share the same parent nodes. @@ -847,31 +907,34 @@ export class ResolvedPos { * pass in an optional predicate that will be called with a parent * node to see if a range into that parent is acceptable. */ - blockRange(other?: ResolvedPos, pred?: (p: ProsemirrorNode) => boolean): NodeRange | null | void; + blockRange( + other?: ResolvedPos, + pred?: (p: ProsemirrorNode) => boolean + ): NodeRange | null | void; /** * Query whether the given position shares the same parent node. */ - sameParent(other: ResolvedPos): boolean; + sameParent(other: ResolvedPos): boolean; /** * Return the greater of this and the given position. */ - max(other: ResolvedPos): ResolvedPos; + max(other: ResolvedPos): ResolvedPos; /** * Return the smaller of this and the given position. */ - min(other: ResolvedPos): ResolvedPos; + min(other: ResolvedPos): ResolvedPos; } /** * Represents a flat range of content, i.e. one that starts and * ends in the same node. */ -export class NodeRange { +export class NodeRange { /** * Construct a node range. `$from` and `$to` should point into the * same node until at least the given `depth`, since a node range * denotes an adjacent set of nodes in a single parent node. */ - constructor($from: ResolvedPos, $to: ResolvedPos, depth: number); + constructor($from: ResolvedPos, $to: ResolvedPos, depth: number); /** * A resolved position along the start of the * content. May have a `depth` greater than this object's `depth` @@ -879,12 +942,12 @@ export class NodeRange { * compute the range, not re-resolved positions directly at its * boundaries. */ - $from: ResolvedPos; + $from: ResolvedPos; /** * A position along the end of the content. See * caveat for [`$from`](#model.NodeRange.$from). */ - $to: ResolvedPos; + $to: ResolvedPos; /** * The depth of the node that this range points into. */ @@ -900,7 +963,7 @@ export class NodeRange { /** * The parent node that the range points into. */ - parent: ProsemirrorNode; + parent: ProsemirrorNode; /** * The start index of the range in the parent node. */ @@ -916,7 +979,7 @@ export class NodeRange { * about the node type, such as its name and what kind of node it * represents. */ -export class NodeType { +export class NodeType { /** * The name the node type has in this schema. */ @@ -924,7 +987,7 @@ export class NodeType { /** * A link back to the `Schema` the node type belongs to. */ - schema: Schema; + schema: S; /** * The spec that this type is based on */ @@ -932,7 +995,7 @@ export class NodeType { /** * The starting match of the node type's content expression. */ - contentMatch: ContentMatch; + contentMatch: ContentMatch; /** * True if this node type has inline content. */ @@ -971,13 +1034,21 @@ export class NodeType { * `null`. Similarly `marks` may be `null` to default to the empty * set of marks. */ - create(attrs?: { [key: string]: any }, content?: Fragment | ProsemirrorNode | ProsemirrorNode[], marks?: Mark[]): ProsemirrorNode; + create( + attrs?: { [key: string]: any }, + content?: Fragment | ProsemirrorNode | Array>, + marks?: Array> + ): ProsemirrorNode; /** * Like [`create`](#model.NodeType.create), but check the given content * against the node type's content restrictions, and throw an error * if it doesn't match. */ - createChecked(attrs?: { [key: string]: any }, content?: Fragment | ProsemirrorNode | ProsemirrorNode[], marks?: Mark[]): ProsemirrorNode; + createChecked( + attrs?: { [key: string]: any }, + content?: Fragment | ProsemirrorNode | Array>, + marks?: Array> + ): ProsemirrorNode; /** * Like [`create`](#model.NodeType.create), but see if it is necessary to * add nodes to the start or end of the given fragment to make it @@ -986,24 +1057,28 @@ export class NodeType { * created, this will always succeed if you pass null or * `Fragment.empty` as content. */ - createAndFill(attrs?: { [key: string]: any }, content?: Fragment | ProsemirrorNode | ProsemirrorNode[], marks?: Mark[]): ProsemirrorNode | null | void; + createAndFill( + attrs?: { [key: string]: any }, + content?: Fragment | ProsemirrorNode | Array>, + marks?: Array> + ): ProsemirrorNode | null | void; /** * Returns true if the given fragment is valid content for this node * type with the given attributes. */ - validContent(content: Fragment): boolean; + validContent(content: Fragment): boolean; /** * Check whether the given mark type is allowed in this node. */ - allowsMarkType(markType: MarkType): boolean; + allowsMarkType(markType: MarkType): boolean; /** * Test whether the given set of marks are allowed in this node. */ - allowsMarks(marks: Mark[]): boolean; + allowsMarks(marks: Array>): boolean; /** * Removes the marks that are not allowed in this node from the given set. */ - allowedMarks(marks: Mark[]): Mark[]; + allowedMarks(marks: Array>): Array>; } /** * Like nodes, marks (which are associated with nodes to signify @@ -1011,7 +1086,7 @@ export class NodeType { * [tagged](#model.Mark.type) with type objects, which are * instantiated once per `Schema`. */ -export class MarkType { +export class MarkType { /** * The name of the mark type. */ @@ -1019,7 +1094,7 @@ export class MarkType { /** * The schema that this mark type instance is part of. */ - schema: Schema; + schema: S; /** * The spec on which the type is based. */ @@ -1029,27 +1104,27 @@ export class MarkType { * containing only some of the mark's attributes. The others, if * they have defaults, will be added. */ - create(attrs?: { [key: string]: any }): Mark; + create(attrs?: { [key: string]: any }): Mark; /** * When there is a mark of this type in the given set, a new set * without it is returned. Otherwise, the input set is returned. */ - removeFromSet(set: Mark[]): Mark[]; + removeFromSet(set: Array>): Array>; /** * Tests whether there is a mark of this type in the given set. */ - isInSet(set: Mark[]): Mark | null | void; + isInSet(set: Array>): Mark | null | void; /** * Queries whether a given mark type is * [excluded](#model.MarkSpec.excludes) by this one. */ - excludes(other: MarkType): boolean; + excludes(other: MarkType): boolean; } /** * An object describing a schema, as passed to the [`Schema`](#model.Schema) * constructor. */ -export interface SchemaSpec { +export interface SchemaSpec { /** * The node types in this schema. Maps names to * [`NodeSpec`](#model.NodeSpec) objects that describe the node type @@ -1058,14 +1133,14 @@ export interface SchemaSpec { * precedence by default, and which nodes come first in a given * [group](#model.NodeSpec.group). */ - nodes: { [name: string]: NodeSpec } | OrderedMap; + nodes: { [name in N]: NodeSpec } | OrderedMap; /** * The mark types that exist in this schema. The order in which they * are provided determines the order in which [mark * sets](#model.Mark.addToSet) are sorted and in which [parse * rules](#model.MarkSpec.parseDOM) are tried. */ - marks?: { [name: string]: MarkSpec } | OrderedMap | null; + marks?: { [name in M]: MarkSpec } | OrderedMap | null; /** * The name of the default top-level node for the schema. Defaults * to `"doc"`. @@ -1228,11 +1303,11 @@ export interface AttributeSpec { * occur in conforming documents, and provides functionality for * creating and deserializing such documents. */ -export class Schema { +export class Schema { /** * Construct a schema from a schema [specification](#model.SchemaSpec). */ - constructor(spec: SchemaSpec); + constructor(spec: SchemaSpec); /** * The [spec](#model.SchemaSpec) on which the schema is based, * with the added guarantee that its `nodes` and `marks` @@ -1240,20 +1315,20 @@ export class Schema { * [`OrderedMap`](https://github.com/marijnh/orderedmap) instances * (not raw objects). */ - spec: SchemaSpec; + spec: SchemaSpec; /** * An object mapping the schema's node names to node type objects. */ - nodes: { [name: string]: NodeType }; + nodes: { [name in N]: NodeType> } & { [key: string]: NodeType> }; /** * A map from mark names to mark type objects. */ - marks: { [name: string]: MarkType }; + marks: { [name in M]: MarkType> } & { [key: string]: NodeType> }; /** * The type of the [default top node](#model.SchemaSpec.topNode) * for this schema. */ - topNodeType: NodeType; + topNodeType: NodeType>; /** * An object for storing whatever values modules may want to * compute and cache per schema. (If you want to store something @@ -1266,26 +1341,34 @@ export class Schema { * with defaults, `content` may be a `Fragment`, * `null`, a `Node`, or an array of nodes. */ - node(type: string | NodeType, attrs?: { [key: string]: any }, content?: Fragment | ProsemirrorNode | ProsemirrorNode[], marks?: Mark[]): ProsemirrorNode; + node( + type: string | NodeType>, + attrs?: { [key: string]: any }, + content?: + | Fragment> + | ProsemirrorNode> + | Array>>, + marks?: Array>> + ): ProsemirrorNode>; /** * Create a text node in the schema. Empty text nodes are not * allowed. */ - text(text: string, marks?: Mark[]): ProsemirrorNode; + text(text: string, marks?: Array>>): ProsemirrorNode>; /** * Create a mark with the given type and attributes. */ - mark(type: string | MarkType, attrs?: { [key: string]: any }): Mark; + mark(type: string | MarkType>, attrs?: { [key: string]: any }): Mark>; /** * Deserialize a node from its JSON representation. This method is * bound. */ - nodeFromJSON(json: { [key: string]: any }): ProsemirrorNode; + nodeFromJSON(json: { [key: string]: any }): ProsemirrorNode>; /** * Deserialize a mark from its JSON representation. This method is * bound. */ - markFromJSON(json: { [key: string]: any }): Mark; + markFromJSON(json: { [key: string]: any }): Mark>; } export interface DOMOutputSpecArray { 0: string; @@ -1299,15 +1382,12 @@ export interface DOMOutputSpecArray { 8?: DOMOutputSpec | 0; 9?: DOMOutputSpec | 0; } -export type DOMOutputSpec - = string - | Node - | DOMOutputSpecArray; +export type DOMOutputSpec = string | Node | DOMOutputSpecArray; /** * A DOM serializer knows how to convert ProseMirror nodes and * marks of various types to DOM nodes. */ -export class DOMSerializer { +export class DOMSerializer { /** * Create a serializer. `nodes` should map node names to functions * that take a node and return a description of the corresponding @@ -1317,22 +1397,25 @@ export class DOMSerializer { * serializer may be `null` to indicate that marks of that type * should not be serialized. */ - constructor(nodes: { [name: string]: (node: ProsemirrorNode) => DOMOutputSpec }, marks: { [name: string]: (mark: Mark, inline: boolean) => DOMOutputSpec }); + constructor( + nodes: { [name: string]: (node: ProsemirrorNode) => DOMOutputSpec }, + marks: { [name: string]: (mark: Mark, inline: boolean) => DOMOutputSpec } + ); /** * The node serialization functions. */ - nodes: { [name: string]: (node: ProsemirrorNode) => DOMOutputSpec }; + nodes: { [name: string]: (node: ProsemirrorNode) => DOMOutputSpec }; /** * The mark serialization functions. */ - marks: { [name: string]: (mark: Mark, inline: boolean) => DOMOutputSpec }; + marks: { [name: string]: (mark: Mark, inline: boolean) => DOMOutputSpec }; /** * Serialize the content of this fragment to a DOM fragment. When * not in the browser, the `document` option, containing a DOM * document, should be passed so that the serializer can create * nodes. */ - serializeFragment(fragment: Fragment, options?: { [key: string]: any }): DocumentFragment; + serializeFragment(fragment: Fragment, options?: { [key: string]: any }): DocumentFragment; /** * Serialize this node to a DOM node. This can be useful when you * need to serialize a part of a document, as opposed to the whole @@ -1340,16 +1423,19 @@ export class DOMSerializer { * [`serializeFragment`](#model.DOMSerializer.serializeFragment) on * its [content](#model.Node.content). */ - serializeNode(node: ProsemirrorNode, options?: { [key: string]: any }): Node; + serializeNode(node: ProsemirrorNode, options?: { [key: string]: any }): Node; /** * Render an [output spec](#model.DOMOutputSpec) to a DOM node. If * the spec has a hole (zero) in it, `contentDOM` will point at the * node with the hole. */ - static renderSpec(doc: Document, structure: DOMOutputSpec): { dom: Node, contentDOM?: Node | null }; + static renderSpec( + doc: Document, + structure: DOMOutputSpec + ): { dom: Node; contentDOM?: Node | null }; /** * Build a serializer using the [`toDOM`](#model.NodeSpec.toDOM) * properties in a schema's node and mark specs. */ - static fromSchema(schema: Schema): DOMSerializer; + static fromSchema(schema: S): DOMSerializer; } diff --git a/types/prosemirror-model/prosemirror-model-tests.ts b/types/prosemirror-model/prosemirror-model-tests.ts index d6ac1c2a5f..98460d4313 100644 --- a/types/prosemirror-model/prosemirror-model-tests.ts +++ b/types/prosemirror-model/prosemirror-model-tests.ts @@ -13,26 +13,28 @@ domOutputSpec = ['div', ['div', { class: 'foo' }]]; domOutputSpec = ['div', ['div', { class: 'foo' }, 0]]; export const nodeSpec: model.NodeSpec = { - attrs: { - name: { default: '' }, - }, - parseDOM: [{ - tag: 'span[data-name]', - getAttrs(dom) { - if (dom instanceof HTMLElement) { - return { - name: dom.getAttribute('data-name')! + attrs: { + name: { default: '' } + }, + parseDOM: [ + { + tag: 'span[data-name]', + getAttrs(dom) { + if (dom instanceof HTMLElement) { + return { + name: dom.getAttribute('data-name')! + }; + } + } + } + ], + toDOM(node) { + const { name } = node.attrs; + const attrs = { + 'data-emoji-name': name }; - } + return ['span', attrs, 0]; } - }], - toDOM(node) { - const { name } = node.attrs; - const attrs = { - 'data-emoji-name': name, - }; - return ['span', attrs, 0]; - } }; const node = new model.Node(); diff --git a/types/prosemirror-schema-basic/index.d.ts b/types/prosemirror-schema-basic/index.d.ts index 0e7a6f7846..49c9d29851 100644 --- a/types/prosemirror-schema-basic/index.d.ts +++ b/types/prosemirror-schema-basic/index.d.ts @@ -3,12 +3,9 @@ // Definitions by: Bradley Ayers // David Hahn // Tim Baumann +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. +// TypeScript Version: 2.3 import { MarkSpec, NodeSpec, Schema } from 'prosemirror-model'; @@ -16,20 +13,25 @@ import { MarkSpec, NodeSpec, Schema } from 'prosemirror-model'; * [Specs](#model.NodeSpec) for the nodes defined in this schema. */ export let nodes: { - doc: NodeSpec, - paragraph: NodeSpec, - blockquote: NodeSpec, - horizontal_rule: NodeSpec, - heading: NodeSpec, - code_block: NodeSpec, - text: NodeSpec, - image: NodeSpec, - hard_break: NodeSpec + doc: NodeSpec; + paragraph: NodeSpec; + blockquote: NodeSpec; + horizontal_rule: NodeSpec; + heading: NodeSpec; + code_block: NodeSpec; + text: NodeSpec; + image: NodeSpec; + hard_break: NodeSpec; }; /** * [Specs](#model.MarkSpec) for the marks in the schema. */ -export let marks: { link: MarkSpec, em: MarkSpec, strong: MarkSpec, code: MarkSpec }; +export let marks: { + link: MarkSpec; + em: MarkSpec; + strong: MarkSpec; + code: MarkSpec; +}; /** * This schema rougly corresponds to the document schema used by * [CommonMark](http://commonmark.org/), minus the list elements, @@ -39,4 +41,4 @@ export let marks: { link: MarkSpec, em: MarkSpec, strong: MarkSpec, code: MarkSp * To reuse elements from this schema, extend or read from its * `spec.nodes` and `spec.marks` [properties](#model.Schema.spec). */ -export let schema: Schema; +export let schema: Schema; diff --git a/types/prosemirror-schema-list/index.d.ts b/types/prosemirror-schema-list/index.d.ts index 01053b06cd..9c97c3fcdb 100644 --- a/types/prosemirror-schema-list/index.d.ts +++ b/types/prosemirror-schema-list/index.d.ts @@ -3,15 +3,12 @@ // Definitions by: Bradley Ayers // David Hahn // Tim Baumann +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 - -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. +// TypeScript Version: 2.3 import OrderedMap = require('orderedmap'); -import { NodeSpec, NodeType } from 'prosemirror-model'; +import { NodeSpec, NodeType, Schema } from 'prosemirror-model'; import { EditorState, Transaction } from 'prosemirror-state'; /** @@ -43,26 +40,39 @@ export let listItem: NodeSpec; * given to assign a group name to the list node types, for example * `"block"`. */ -export function addListNodes(nodes: OrderedMap, itemContent: string, listGroup?: string): OrderedMap; +export function addListNodes( + nodes: OrderedMap, + itemContent: string, + listGroup?: string +): OrderedMap; /** * Returns a command function that wraps the selection in a list with * the given type an attributes. If `dispatch` is null, only return a * value to indicate whether this is possible, but don't actually * perform the change. */ -export function wrapInList(listType: NodeType, attrs?: { [key: string]: any }): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; +export function wrapInList( + listType: NodeType, + attrs?: { [key: string]: any } +): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; /** * Build a command that splits a non-empty textblock at the top level * of a list item by also splitting that list item. */ -export function splitListItem(itemType: NodeType): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; +export function splitListItem( + itemType: NodeType +): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; /** * Create a command to lift the list item around the selection up into * a wrapping list. */ -export function liftListItem(itemType: NodeType): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; +export function liftListItem( + itemType: NodeType +): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; /** * Create a command to sink the list item around the selection down * into an inner list. */ -export function sinkListItem(itemType: NodeType): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; +export function sinkListItem( + itemType: NodeType +): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; diff --git a/types/prosemirror-state/index.d.ts b/types/prosemirror-state/index.d.ts index 781a1459e9..6b210a73e1 100644 --- a/types/prosemirror-state/index.d.ts +++ b/types/prosemirror-state/index.d.ts @@ -1,16 +1,20 @@ -// Type definitions for prosemirror-state 1.0 +// Type definitions for prosemirror-state 1.1 // Project: https://github.com/ProseMirror/prosemirror-state // Definitions by: Bradley Ayers // David Hahn // Tim Baumann +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.3 -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. - -import { Mark, MarkType, Node as ProsemirrorNode, ResolvedPos, Schema, Slice } from 'prosemirror-model'; +import { + Mark, + MarkType, + Node as ProsemirrorNode, + ResolvedPos, + Schema, + Slice +} from 'prosemirror-model'; import { Mappable, Mapping, Transform } from 'prosemirror-transform'; import { EditorProps, EditorView } from 'prosemirror-view'; @@ -18,13 +22,13 @@ import { EditorProps, EditorView } from 'prosemirror-view'; * This is the type passed to the [`Plugin`](#state.Plugin) * constructor. It provides a definition for a plugin. */ -export interface PluginSpec { +export interface PluginSpec { /** * The [view props](#view.EditorProps) added by this plugin. Props * that are functions will be bound to have the plugin instance as * their `this` binding. */ - props?: EditorProps | null; + props?: EditorProps | null; /** * Allows a plugin to define a [state field](#state.StateField), an * extra slot in the state object in which it can keep its own data. @@ -36,20 +40,27 @@ export interface PluginSpec { * access the plugin's configuration and state through the key, * without having access to the plugin instance object. */ - key?: PluginKey | null; + key?: PluginKey | null; /** * When the plugin needs to interact with the editor view, or * set something up in the DOM, use this field. The function * will be called when the plugin's state is associated with an * editor view. */ - view?: ((p: EditorView) => { update?: ((view: EditorView, prevState: EditorState) => void) | null, destroy?: (() => void) | null }) | null; + view?: + | (( + p: EditorView + ) => { + update?: ((view: EditorView, prevState: EditorState) => void) | null; + destroy?: (() => void) | null; + }) + | null; /** * When present, this will be called before a transaction is * applied by the state, allowing the plugin to cancel it (by * returning false). */ - filterTransaction?: ((p1: Transaction, p2: EditorState) => boolean) | null; + filterTransaction?: ((p1: Transaction, p2: EditorState) => boolean) | null; /** * Allows the plugin to append another transaction to be applied * after the given array of transactions. When another plugin @@ -58,22 +69,28 @@ export interface PluginSpec { * transactions, i.e. it won't be passed transactions that it * already saw. */ - appendTransaction?: ((transactions: Transaction[], oldState: EditorState, newState: EditorState) => Transaction | null | void) | null; + appendTransaction?: + | (( + transactions: Transaction[], + oldState: EditorState, + newState: EditorState + ) => Transaction | null | void) + | null; } /** * Plugins bundle functionality that can be added to an editor. * They are part of the [editor state](#state.EditorState) and * may influence that state and the view that contains it. */ -export class Plugin { +export class Plugin { /** * Create a plugin. */ - constructor(spec: PluginSpec); + constructor(spec: PluginSpec); /** * The [props](#view.EditorProps) exported by this plugin. */ - props: EditorProps; + props: EditorProps; /** * The plugin's [spec object](#state.PluginSpec). */ @@ -81,7 +98,7 @@ export class Plugin { /** * Extract the plugin's state field from an editor state. */ - getState(state: EditorState): any; + getState(state: EditorState): any; } /** * A plugin spec may provide a state field (under its @@ -89,21 +106,21 @@ export class Plugin { * describes the state it wants to keep. Functions provided here are * always called with the plugin instance as their `this` binding. */ -export interface StateField { +export interface StateField { /** * Initialize the value of the field. `config` will be the object * passed to [`EditorState.create`](#state.EditorState^create). Note * that `instance` is a half-initialized state instance, and will * not have values for plugin fields initialized after this one. */ - init(config: { [key: string]: any }, instance: EditorState): T; + init(config: { [key: string]: any }, instance: EditorState): T; /** * Apply the given transaction to this state field, producing a new * field value. Note that the `newState` argument is again a partially * constructed state does not yet contain the state from plugins * coming after this one. */ - apply(tr: Transaction, value: T, oldState: EditorState, newState: EditorState): T; + apply(tr: Transaction, value: T, oldState: EditorState, newState: EditorState): T; /** * Convert this field to JSON. Optional, can be left off to disable * JSON serialization for the field. @@ -113,7 +130,7 @@ export interface StateField { * Deserialize the JSON representation of this field. Note that the * `state` argument is again a half-initialized state. */ - fromJSON?: ((config: { [key: string]: any }, value: any, state: EditorState) => T) | null; + fromJSON?: ((config: { [key: string]: any }, value: any, state: EditorState) => T) | null; } /** * A key is used to [tag](#state.PluginSpec.key) @@ -121,7 +138,7 @@ export interface StateField { * editor state. Assigning a key does mean only one plugin of that * type can be active in a state. */ -export class PluginKey { +export class PluginKey { /** * Create a plugin key. */ @@ -130,37 +147,37 @@ export class PluginKey { * Get the active plugin with this key, if any, from an editor * state. */ - get(state: EditorState): Plugin | null | void; + get(state: EditorState): Plugin | null | void; /** * Get the plugin's state from an editor state. */ - getState(state: EditorState): any | null | void; + getState(state: EditorState): any | null | void; } /** * Superclass for editor selections. Every selection type should * extend this. Should not be instantiated directly. */ -export class Selection { +export class Selection { /** * Initialize a selection with the head and anchor and ranges. If no * ranges are given, constructs a single range across `$anchor` and * `$head`. */ - constructor($anchor: ResolvedPos, $head: ResolvedPos, ranges?: SelectionRange[]); + constructor($anchor: ResolvedPos, $head: ResolvedPos, ranges?: Array>); /** * The ranges covered by the selection. */ - ranges: SelectionRange[]; + ranges: Array>; /** * The resolved anchor of the selection (the side that stays in * place when the selection is modified). */ - $anchor: ResolvedPos; + $anchor: ResolvedPos; /** * The resolved head of the selection (the side that moves when * the selection is modified). */ - $head: ResolvedPos; + $head: ResolvedPos; /** * The selection's anchor, as an unresolved position. */ @@ -180,11 +197,11 @@ export class Selection { /** * The resolved lower bound of the selection's main range. */ - $from: ResolvedPos; + $from: ResolvedPos; /** * The resolved upper bound of the selection's main range. */ - $to: ResolvedPos; + $to: ResolvedPos; /** * Indicates whether the selection contains any content. */ @@ -192,26 +209,26 @@ export class Selection { /** * Test whether the selection is the same as another selection. */ - eq(p: Selection): boolean; + eq(p: Selection): boolean; /** * Map this selection through a [mappable](#transform.Mappable) thing. `doc` * should be the new document to which we are mapping. */ - map(doc: ProsemirrorNode, mapping: Mappable): Selection; + map(doc: ProsemirrorNode, mapping: Mappable): Selection; /** * Get the content of this selection as a slice. */ - content(): Slice; + content(): Slice; /** * Replace the selection with a slice or, if no slice is given, * delete the selection. Will append to the given transaction. */ - replace(tr: Transaction, content?: Slice): void; + replace(tr: Transaction, content?: Slice): void; /** * Replace the selection with the given node, appending the changes * to the given transaction. */ - replaceWith(tr: Transaction, node: ProsemirrorNode): void; + replaceWith(tr: Transaction, node: ProsemirrorNode): void; /** * Convert the selection to a JSON representation. When implementing * this for a custom selection class, make sure to give the object a @@ -228,7 +245,7 @@ export class Selection { * this method just converts the selection to a text selection and * returns the bookmark for that. */ - getBookmark(): SelectionBookmark; + getBookmark(): SelectionBookmark; /** * Controls whether, when a selection of this type is active in the * browser, the selected range should be visible to the user. Defaults @@ -242,30 +259,37 @@ export class Selection { * selections. Will return null when no valid selection position is * found. */ - static findFrom($pos: ResolvedPos, dir: number, textOnly?: boolean): Selection | null | void; + static findFrom( + $pos: ResolvedPos, + dir: number, + textOnly?: boolean + ): Selection | null | void; /** * Find a valid cursor or leaf node selection near the given * position. Searches forward first by default, but if `bias` is * negative, it will search backwards first. */ - static near($pos: ResolvedPos, bias?: number): Selection; + static near($pos: ResolvedPos, bias?: number): Selection; /** * Find the cursor or leaf node selection closest to the start of * the given document. Will return an * [`AllSelection`](#state.AllSelection) if no valid position * exists. */ - static atStart(doc: ProsemirrorNode): Selection; + static atStart(doc: ProsemirrorNode): Selection; /** * Find the cursor or leaf node selection closest to the end of the * given document. */ - static atEnd(doc: ProsemirrorNode): Selection; + static atEnd(doc: ProsemirrorNode): Selection; /** * Deserialize the JSON representation of a selection. Must be * implemented for custom classes (as a static class method). */ - static fromJSON(doc: ProsemirrorNode, json: { [key: string]: any }): Selection; + static fromJSON( + doc: ProsemirrorNode, + json: { [key: string]: any } + ): Selection; /** * To be able to deserialize selections from JSON, custom selection * classes must register themselves with an ID string, so that they @@ -279,32 +303,32 @@ export class Selection { * You can define a custom bookmark type for a custom selection class * to make the history handle it well. */ -export interface SelectionBookmark { +export interface SelectionBookmark { /** * Map the bookmark through a set of changes. */ - map(mapping: Mapping): SelectionBookmark; + map(mapping: Mapping): SelectionBookmark; /** * Resolve the bookmark to a real selection again. This may need to * do some error checking and may fall back to a default (usually * [`TextSelection.between`](#state.TextSelection^between)) if * mapping made the bookmark invalid. */ - resolve(doc: ProsemirrorNode): Selection; + resolve(doc: ProsemirrorNode): Selection; } /** * Represents a selected range in a document. */ -export class SelectionRange { - constructor($from: ResolvedPos, $to: ResolvedPos); +export class SelectionRange { + constructor($from: ResolvedPos, $to: ResolvedPos); /** * The lower bound of the range. */ - $from: ResolvedPos; + $from: ResolvedPos; /** * The upper bound of the range. */ - $to: ResolvedPos; + $to: ResolvedPos; } /** * A text selection represents a classical editor selection, with @@ -312,20 +336,24 @@ export class SelectionRange { * point into textblock nodes. It can be empty (a regular cursor * position). */ -export class TextSelection extends Selection { +export class TextSelection extends Selection { /** * Construct a text selection between the given points. */ - constructor($anchor: ResolvedPos, $head?: ResolvedPos); + constructor($anchor: ResolvedPos, $head?: ResolvedPos); /** * Returns a resolved position if this is a cursor selection (an * empty text selection), and null otherwise. */ - $cursor?: ResolvedPos | null; + $cursor?: ResolvedPos | null; /** * Create a text selection from non-resolved positions. */ - static create(doc: ProsemirrorNode, anchor: number, head?: number): TextSelection; + static create( + doc: ProsemirrorNode, + anchor: number, + head?: number + ): TextSelection; /** * Return a text selection that spans the given positions or, if * they aren't text positions, find a text selection near them. @@ -334,7 +362,11 @@ export class TextSelection extends Selection { * [`Selection.near`](#state.Selection^near) when the document * doesn't contain a valid text position. */ - static between($anchor: ResolvedPos, $head: ResolvedPos, bias?: number): Selection; + static between( + $anchor: ResolvedPos, + $head: ResolvedPos, + bias?: number + ): Selection; } /** * A node selection is a selection that points at a single node. @@ -343,20 +375,23 @@ export class TextSelection extends Selection { * `to` point directly before and after the selected node, `anchor` * equals `from`, and `head` equals `to`.. */ -export class NodeSelection extends Selection { +export class NodeSelection extends Selection { /** * Create a node selection. Does not verify the validity of its * argument. */ - constructor($pos: ResolvedPos); + constructor($pos: ResolvedPos); /** * The selected node. */ - node: ProsemirrorNode; + node: ProsemirrorNode; /** * Create a node selection from non-resolved positions. */ - static create(doc: ProsemirrorNode, from: number): NodeSelection; + static create( + doc: ProsemirrorNode, + from: number + ): NodeSelection; /** * Determines whether the given node may be selected as a node * selection. @@ -369,11 +404,11 @@ export class NodeSelection extends Selection { * there are for example leaf block nodes at the start or end of the * document). */ -export class AllSelection extends Selection { +export class AllSelection extends Selection { /** * Create an all-selection over the given document. */ - constructor(doc: ProsemirrorNode); + constructor(doc: ProsemirrorNode); } /** * The state of a ProseMirror editor is represented by an object @@ -384,32 +419,32 @@ export class AllSelection extends Selection { * A state holds a number of built-in fields, and plugins can * [define](#state.PluginSpec.state) additional fields. */ -export class EditorState { +export class EditorState { /** * The current document. */ - doc: ProsemirrorNode; + doc: ProsemirrorNode; /** * The selection. */ - selection: Selection; + selection: Selection; /** * A set of marks to apply to the next input. Will be null when * no explicit marks have been set. */ - storedMarks?: Mark[] | null; + storedMarks?: Array> | null; /** * The schema of the state's document. */ - schema: Schema; + schema: S; /** * The plugins that are active in this state. */ - plugins: Plugin[]; + plugins: Array>; /** * Apply the given transaction to produce a new state. */ - apply(tr: Transaction): EditorState; + apply(tr: Transaction): EditorState; /** * Verbose variant of [`apply`](#state.EditorState.apply) that * returns the precise transactions that were applied (which might @@ -417,7 +452,7 @@ export class EditorState { * hooks](#state.PluginSpec.filterTransaction) of * plugins) along with the new state. */ - applyTransaction(tr: Transaction): { state: EditorState, transactions: Transaction[] }; + applyTransaction(tr: Transaction): { state: EditorState; transactions: Transaction[] }; /** * Start a [transaction](#state.Transaction) from this state. */ @@ -430,17 +465,22 @@ export class EditorState { * [`init`](#state.StateField.init) method, passing in the new * configuration object.. */ - reconfigure(config: { schema?: Schema | null, plugins?: Plugin[] | null }): EditorState; + reconfigure(config: { schema?: S | null; plugins?: Array> | null }): EditorState; /** * Serialize this state to JSON. If you want to serialize the state * of plugins, pass an object mapping property names to use in the * resulting JSON object to plugin objects. */ - toJSON(pluginFields?: { [name: string]: Plugin }): { [key: string]: any }; + toJSON(pluginFields?: { [name: string]: Plugin } | string | number): { [key: string]: any }; /** * Create a new state. */ - static create(config: { schema?: Schema | null, doc?: ProsemirrorNode | null, selection?: Selection | null, plugins?: Plugin[] | null }): EditorState; + static create(config: { + schema?: S | null; + doc?: ProsemirrorNode | null; + selection?: Selection | null; + plugins?: Array> | null; + }): EditorState; /** * Deserialize a JSON representation of a state. `config` should * have at least a `schema` field, and should contain array of @@ -448,7 +488,11 @@ export class EditorState { * to deserialize the state of plugins, by associating plugin * instances with the property names they use in the JSON object. */ - static fromJSON(config: { schema: Schema, plugins?: Plugin[] | null }, json: { [key: string]: any }, pluginFields?: { [name: string]: Plugin }): EditorState; + static fromJSON( + config: { schema: S; plugins?: Array> | null }, + json: { [key: string]: any }, + pluginFields?: { [name: string]: Plugin } + ): EditorState; } /** * An editor state transaction, which can be applied to a state to @@ -469,7 +513,7 @@ export class EditorState { * selection transactions directly caused by mouse or touch input, and * a `"paste"` property of true to transactions caused by a paste.. */ -export class Transaction extends Transform { +export class Transaction extends Transform { /** * The timestamp associated with this transaction, in the same * format as `Date.now()`. diff --git a/types/prosemirror-tables/index.d.ts b/types/prosemirror-tables/index.d.ts index 53df9fc220..9ae723910b 100644 --- a/types/prosemirror-tables/index.d.ts +++ b/types/prosemirror-tables/index.d.ts @@ -2,10 +2,12 @@ // Project: https://github.com/ProseMirror/prosemirror-tables // Definitions by: Oscar Wallhult // Eduard Shvedai +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 + import { EditorState, Plugin, SelectionRange, Transaction, PluginKey } from 'prosemirror-state'; -import { Node as ProsemirrorNode, NodeSpec, Slice, ResolvedPos } from 'prosemirror-model'; +import { Node as ProsemirrorNode, NodeSpec, Slice, ResolvedPos, Schema } from 'prosemirror-model'; import { NodeView } from 'prosemirror-view'; export interface TableNodesOptions { @@ -38,37 +40,50 @@ export interface CellSelectionJSON { head: number; } -export class CellSelection { - constructor($anchorCell: ResolvedPos, $headCell?: ResolvedPos); +export class CellSelection { + constructor($anchorCell: ResolvedPos, $headCell?: ResolvedPos); from: number; to: number; - $from: ResolvedPos; - $to: ResolvedPos; + $from: ResolvedPos; + $to: ResolvedPos; anchor: number; head: number; - $anchor: ResolvedPos; - $head: ResolvedPos; - $anchorCell: ResolvedPos; - $headCell: ResolvedPos; + $anchor: ResolvedPos; + $head: ResolvedPos; + $anchorCell: ResolvedPos; + $headCell: ResolvedPos; empty: boolean; - ranges: SelectionRange[]; + ranges: Array>; - map(doc: ProsemirrorNode, mapping: any): any; - content(): Slice; - replace(tr: Transaction, content: Slice): void; - replaceWith(tr: Transaction, node: ProsemirrorNode): void; - forEachCell(f: (node: ProsemirrorNode, pos: number) => void): void; + map(doc: ProsemirrorNode, mapping: any): any; + content(): Slice; + replace(tr: Transaction, content: Slice): void; + replaceWith(tr: Transaction, node: ProsemirrorNode): void; + forEachCell(f: (node: ProsemirrorNode, pos: number) => void): void; isRowSelection(): boolean; isColSelection(): boolean; eq(other: any): boolean; toJSON(): CellSelectionJSON; - getBookmark(): {anchor: number, head: number}; + getBookmark(): { anchor: number; head: number }; - static colSelection(anchorCell: ResolvedPos, headCell?: ResolvedPos): CellSelection; - static rowSelection(anchorCell: ResolvedPos, headCell?: ResolvedPos): CellSelection; - static create(doc: ProsemirrorNode, anchorCell: number, headCell?: number): CellSelection; - static fromJSON(doc: ProsemirrorNode, json: CellSelectionJSON): CellSelection; + static colSelection( + anchorCell: ResolvedPos, + headCell?: ResolvedPos + ): CellSelection; + static rowSelection( + anchorCell: ResolvedPos, + headCell?: ResolvedPos + ): CellSelection; + static create( + doc: ProsemirrorNode, + anchorCell: number, + headCell?: number + ): CellSelection; + static fromJSON( + doc: ProsemirrorNode, + json: CellSelectionJSON + ): CellSelection; } export interface Rect { @@ -96,52 +111,115 @@ export class TableMap { export function tableEditing(): Plugin; -export function deleteTable(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function deleteTable( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; -export function goToNextCell(direction: number): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; +export function goToNextCell( + direction: number +): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; -export function toggleHeaderCell(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function toggleHeaderCell( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; -export function toggleHeaderColumn(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function toggleHeaderColumn( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; -export function toggleHeaderRow(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function toggleHeaderRow( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; -export function setCellAttr(name: string, value: any): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; +export function setCellAttr( + name: string, + value: any +): (state: EditorState, dispatch?: (tr: Transaction) => void) => boolean; -export function splitCell(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function splitCell( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; -export function mergeCells(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function mergeCells( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; -export function deleteRow(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function deleteRow( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; -export function addRowAfter(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function addRowAfter( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; -export function addRowBefore(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function addRowBefore( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; -export function deleteColumn(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function deleteColumn( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; -export function addColumnAfter(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function addColumnAfter( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; -export function addColumnBefore(state: EditorState, dispatch?: (tr: Transaction) => void): boolean; +export function addColumnBefore( + state: EditorState, + dispatch?: (tr: Transaction) => void +): boolean; -export function columnResizing(props: { handleWidth?: number, cellMinWidth?: number, View?: NodeView }): Plugin; +export function columnResizing(props: { + handleWidth?: number; + cellMinWidth?: number; + View?: NodeView; +}): Plugin; export const columnResizingPluginKey: PluginKey; -export function updateColumnsOnResize(node: ProsemirrorNode, colgroup: Element, table: Element, cellMinWidth: number, overrideCol?: number, overrideValue?: number): void; +export function updateColumnsOnResize( + node: ProsemirrorNode, + colgroup: Element, + table: Element, + cellMinWidth: number, + overrideCol?: number, + overrideValue?: number +): void; -export function cellAround(pos: ResolvedPos): ResolvedPos | null; +export function cellAround(pos: ResolvedPos): ResolvedPos | null; export function isInTable(state: EditorState): boolean; -export function selectionCell(state: EditorState): ResolvedPos | null | undefined; +export function selectionCell( + state: EditorState +): ResolvedPos | null | undefined; -export function moveCellForward(pos: ResolvedPos): ResolvedPos; +export function moveCellForward(pos: ResolvedPos): ResolvedPos; -export function inSameTable($a: ResolvedPos, $b: ResolvedPos): boolean; +export function inSameTable( + $a: ResolvedPos, + $b: ResolvedPos +): boolean; -export function findCell(pos: ResolvedPos): {top: number, left: number, right: number, buttom: number}; +export function findCell( + pos: ResolvedPos +): { top: number; left: number; right: number; buttom: number }; export function colCount(pos: ResolvedPos): number; -export function nextCell(pos: ResolvedPos, axis: string, dir: number): null | ResolvedPos; +export function nextCell( + pos: ResolvedPos, + axis: string, + dir: number +): null | ResolvedPos; diff --git a/types/prosemirror-transform/index.d.ts b/types/prosemirror-transform/index.d.ts index 8f386b4bd3..c0b63136f4 100644 --- a/types/prosemirror-transform/index.d.ts +++ b/types/prosemirror-transform/index.d.ts @@ -3,14 +3,21 @@ // Definitions by: Bradley Ayers // David Hahn // Tim Baumann +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.3 -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. - -import { ContentMatch, Fragment, Mark, MarkType, Node as ProsemirrorNode, NodeRange, NodeType, Schema, Slice } from 'prosemirror-model'; +import { + ContentMatch, + Fragment, + Mark, + MarkType, + Node as ProsemirrorNode, + NodeRange, + NodeType, + Schema, + Slice +} from 'prosemirror-model'; /** * There are several things that positions can be mapped through. @@ -160,14 +167,14 @@ export class Mapping implements Mappable { /** * Add a mark to all inline content between two positions. */ -export class AddMarkStep extends Step { - constructor(from: number, to: number, mark: Mark); +export class AddMarkStep extends Step { + constructor(from: number, to: number, mark: Mark); } /** * Remove a mark from all inline content between two positions. */ -export class RemoveMarkStep extends Step { - constructor(from: number, to: number, mark: Mark); +export class RemoveMarkStep extends Step { + constructor(from: number, to: number, mark: Mark); } /** * Abstraction to build up and track an array of @@ -176,39 +183,43 @@ export class RemoveMarkStep extends Step { * Most transforming methods return the `Transform` object itself, so * that they can be chained. */ -export class Transform { +export class Transform { /** * Create a transform that starts with the given document. */ - constructor(doc: ProsemirrorNode); + constructor(doc: ProsemirrorNode); /** * Add the given mark to the inline content between `from` and `to`. */ - addMark(from: number, to: number, mark: Mark): this; + addMark(from: number, to: number, mark: Mark): this; /** * Remove marks from inline nodes between `from` and `to`. When `mark` * is a single mark, remove precisely that mark. When it is a mark type, * remove all marks of that type. When it is null, remove all marks of * any type. */ - removeMark(from: number, to: number, mark?: Mark | MarkType): this; + removeMark(from: number, to: number, mark?: Mark | MarkType): this; /** * Removes all marks and nodes from the content of the node at `pos` * that don't match the given new parent node type. Accepts an * optional starting [content match](#model.ContentMatch) as third * argument. */ - clearIncompatible(pos: number, parentType: NodeType, match?: ContentMatch): this; + clearIncompatible(pos: number, parentType: NodeType, match?: ContentMatch): this; /** * Replace the part of the document between `from` and `to` with the * given `slice`. */ - replace(from: number, to?: number, slice?: Slice): this; + replace(from: number, to?: number, slice?: Slice): this; /** * Replace the given range with the given content, which may be a * fragment, node, or array of nodes. */ - replaceWith(from: number, to: number, content: Fragment | ProsemirrorNode | ProsemirrorNode[]): this; + replaceWith( + from: number, + to: number, + content: Fragment | ProsemirrorNode | Array> + ): this; /** * Delete the content between the given positions. */ @@ -216,7 +227,10 @@ export class Transform { /** * Insert the given content at the given position. */ - insert(pos: number, content: Fragment | ProsemirrorNode | ProsemirrorNode[]): this; + insert( + pos: number, + content: Fragment | ProsemirrorNode | Array> + ): this; /** * Replace a range of the document with a given slice, using `from`, * `to`, and the slice's [`openStart`](#model.Slice.openStart) property @@ -234,7 +248,7 @@ export class Transform { * range, and is useful in situations where you need more precise * control over what happens. */ - replaceRange(from: number, to: number, slice: Slice): this; + replaceRange(from: number, to: number, slice: Slice): this; /** * Replace the given range with a node, but use `from` and `to` as * hints, rather than precise positions. When from and to are the same @@ -244,7 +258,7 @@ export class Transform { * completely covers a parent node, this method may completely replace * that parent node. */ - replaceRangeWith(from: number, to: number, node: ProsemirrorNode): this; + replaceRangeWith(from: number, to: number, node: ProsemirrorNode): this; /** * Delete the given range, expanding it to cover fully covered * parent nodes until a valid replace is found. @@ -257,23 +271,36 @@ export class Transform { * [`liftTarget`](#transform.liftTarget) to compute `target`, to make * sure the lift is valid. */ - lift(range: NodeRange, target: number): this; + lift(range: NodeRange, target: number): this; /** * Wrap the given [range](#model.NodeRange) in the given set of wrappers. * The wrappers are assumed to be valid in this position, and should * probably be computed with [`findWrapping`](#transform.findWrapping). */ - wrap(range: NodeRange, wrappers: Array<{ type: NodeType, attrs?: { [key: string]: any } | null }>): this; + wrap( + range: NodeRange, + wrappers: Array<{ type: NodeType; attrs?: { [key: string]: any } | null }> + ): this; /** * Set the type of all textblocks (partly) between `from` and `to` to * the given node type with the given attributes. */ - setBlockType(from: number, to: number | undefined, type: NodeType, attrs?: { [key: string]: any }): this; + setBlockType( + from: number, + to: number | undefined, + type: NodeType, + attrs?: { [key: string]: any } + ): this; /** * Change the type, attributes, and/or marks of the node at `pos`. * When `nodeType` is null, the existing node type is preserved, */ - setNodeMarkup(pos: number, type?: NodeType, attrs?: { [key: string]: any }, marks?: Mark[]): this; + setNodeMarkup( + pos: number, + type?: NodeType, + attrs?: { [key: string]: any }, + marks?: Array> + ): this; /** * Split the node at the given position, and optionally, if `depth` is * greater than one, any number of nodes above that. By default, the @@ -281,7 +308,11 @@ export class Transform { * This can be changed by passing an array of types and attributes to * use after the split. */ - split(pos: number, depth?: number, typesAfter?: Array<{ type: NodeType, attrs?: { [key: string]: any } | null }>): this; + split( + pos: number, + depth?: number, + typesAfter?: Array<{ type: NodeType; attrs?: { [key: string]: any } | null }> + ): this; /** * Join the blocks around the given position. If depth is 2, their * last and first siblings are also joined, and so on. @@ -291,15 +322,15 @@ export class Transform { * The current document (the result of applying the steps in the * transform). */ - doc: ProsemirrorNode; + doc: ProsemirrorNode; /** * The steps in this transform. */ - steps: Step[]; + steps: Array>; /** * The documents before each of the steps. */ - docs: ProsemirrorNode[]; + docs: Array>; /** * A mapping with the maps for each of the steps in this transform. */ @@ -307,17 +338,17 @@ export class Transform { /** * The starting document. */ - before: ProsemirrorNode; + before: ProsemirrorNode; /** * Apply a new step in this transform, saving the result. Throws an * error when the step fails. */ - step(step: Step): this; + step(step: Step): this; /** * Try to apply a step in this transformation, ignoring it if it * fails. Returns the step result. */ - maybeStep(step: Step): StepResult; + maybeStep(step: Step): StepResult; /** * True when the document has been changed (when there are any * steps). @@ -327,7 +358,7 @@ export class Transform { /** * Replace a part of the document with a slice of new content. */ -export class ReplaceStep extends Step { +export class ReplaceStep extends Step { /** * The given `slice` should fit the 'gap' between `from` and * `to`—the depths must line up, and the surrounding nodes must be @@ -337,21 +368,29 @@ export class ReplaceStep extends Step { * tokens (this is to guard against rebased replace steps * overwriting something they weren't supposed to). */ - constructor(from: number, to: number, slice: Slice, structure?: boolean); + constructor(from: number, to: number, slice: Slice, structure?: boolean); } /** * Replace a part of the document with a slice of content, but * preserve a range of the replaced content by moving it into the * slice. */ -export class ReplaceAroundStep extends Step { +export class ReplaceAroundStep extends Step { /** * Create a replace-around step with the given range and gap. * `insert` should be the point in the slice into which the content * of the gap should be moved. `structure` has the same meaning as * it has in the [`ReplaceStep`](#transform.ReplaceStep) class. */ - constructor(from: number, to: number, gapFrom: number, gapTo: number, slice: Slice, insert: number, structure?: boolean); + constructor( + from: number, + to: number, + gapFrom: number, + gapTo: number, + slice: Slice, + insert: number, + structure?: boolean + ); } /** * ‘Fit’ a slice into a given position in the document, producing a @@ -359,7 +398,12 @@ export class ReplaceAroundStep extends Step { * there's no meaningful way to insert the slice here, or inserting it * would be a no-op (an empty slice over an empty range). */ -export function replaceStep(doc: ProsemirrorNode, from: number, to?: number, slice?: Slice): Step | null | void; +export function replaceStep( + doc: ProsemirrorNode, + from: number, + to?: number, + slice?: Slice +): Step | null | void; /** * A step object represents an atomic change. It generally applies * only to the document it was created for, since the positions @@ -371,14 +415,14 @@ export function replaceStep(doc: ProsemirrorNode, from: number, to?: number, sli * JSON-serialization identifier using * [`Step.jsonID`](#transform.Step^jsonID). */ -export class Step { +export class Step { /** * Applies this step to the given document, returning a result * object that either indicates failure, if the step can not be * applied to this document, or indicates success by containing a * transformed document. */ - apply(doc: ProsemirrorNode): StepResult; + apply(doc: ProsemirrorNode): StepResult; /** * Get the step map that represents the changes made by this step, * and which can be used to transform between positions in the old @@ -389,19 +433,19 @@ export class Step { * Create an inverted version of this step. Needs the document as it * was before the step as argument. */ - invert(doc: ProsemirrorNode): Step; + invert(doc: ProsemirrorNode): Step; /** * Map this step through a mappable thing, returning either a * version of that step with its positions adjusted, or `null` if * the step was entirely deleted by the mapping. */ - map(mapping: Mappable): Step | null | void; + map(mapping: Mappable): Step | null | void; /** * Try to merge this step with another one, to be applied directly * after it. Returns the merged step when possible, null if the * steps can't be merged. */ - merge(other: Step): Step | null | void; + merge(other: Step): Step | null | void; /** * Create a JSON-serializeable representation of this step. When * defining this for a custom subclass, make sure the result object @@ -413,7 +457,7 @@ export class Step { * Deserialize a step from its JSON representation. Will call * through to the step class' own implementation of this method. */ - static fromJSON(schema: Schema, json: { [key: string]: any }): Step; + static fromJSON(schema: S, json: { [key: string]: any }): Step; /** * To be able to serialize steps to JSON, each step needs a string * ID to attach to its JSON representation. Use this method to @@ -426,11 +470,11 @@ export class Step { * The result of [applying](#transform.Step.apply) a step. Contains either a * new document or a failure value. */ -export class StepResult { +export class StepResult { /** * The transformed document. */ - doc?: ProsemirrorNode | null; + doc?: ProsemirrorNode | null; /** * Text providing information about a failed step. */ @@ -438,7 +482,7 @@ export class StepResult { /** * Create a successful step result. */ - static ok(doc: ProsemirrorNode): StepResult; + static ok(doc: ProsemirrorNode): StepResult; /** * Create a failed step result. */ @@ -448,7 +492,12 @@ export class StepResult { * arguments. Create a successful result if it succeeds, and a * failed one if it throws a `ReplaceError`. */ - static fromReplace(doc: ProsemirrorNode, from: number, to: number, slice: Slice): StepResult; + static fromReplace( + doc: ProsemirrorNode, + from: number, + to: number, + slice: Slice + ): StepResult; } /** * Try to find a target depth to which the content in the given range @@ -462,11 +511,20 @@ export function liftTarget(range: NodeRange): number | null | void; * the wrapper node, if necessary. Returns null if no valid wrapping * could be found. */ -export function findWrapping(range: NodeRange, nodeType: NodeType, attrs?: { [key: string]: any }): Array<{ type: NodeType, attrs?: { [key: string]: any } | null }> | null | void; +export function findWrapping( + range: NodeRange, + nodeType: NodeType, + attrs?: { [key: string]: any } +): Array<{ type: NodeType; attrs?: { [key: string]: any } | null }> | null | void; /** * Check whether splitting at the given position is allowed. */ -export function canSplit(doc: ProsemirrorNode, pos: number, depth?: number, typesAfter?: Array<{ type: NodeType, attrs?: { [key: string]: any } | null }>): boolean; +export function canSplit( + doc: ProsemirrorNode, + pos: number, + depth?: number, + typesAfter?: Array<{ type: NodeType; attrs?: { [key: string]: any } | null }> +): boolean; /** * Test whether the blocks before and after a given position can be * joined. @@ -484,4 +542,8 @@ export function joinPoint(doc: ProsemirrorNode, pos: number, dir?: number): numb * isn't a valid place but is at the start or end of a node. Return * null if no position was found. */ -export function insertPoint(doc: ProsemirrorNode, pos: number, nodeType: NodeType): number | null | void; +export function insertPoint( + doc: ProsemirrorNode, + pos: number, + nodeType: NodeType +): number | null | void; diff --git a/types/prosemirror-transform/tsconfig.json b/types/prosemirror-transform/tsconfig.json index c5799c88a6..31a3452e16 100644 --- a/types/prosemirror-transform/tsconfig.json +++ b/types/prosemirror-transform/tsconfig.json @@ -1,24 +1,16 @@ { "compilerOptions": { "module": "commonjs", - "lib": [ - "es6", - "dom" - ], + "lib": ["es6", "dom"], "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", - "typeRoots": [ - "../" - ], + "typeRoots": ["../"], "types": [], "noEmit": true, "forceConsistentCasingInFileNames": true }, - "files": [ - "index.d.ts", - "prosemirror-transform-tests.ts" - ] -} \ No newline at end of file + "files": ["index.d.ts", "prosemirror-transform-tests.ts"] +} diff --git a/types/prosemirror-view/index.d.ts b/types/prosemirror-view/index.d.ts index 0ce2e37794..f24a5270d1 100644 --- a/types/prosemirror-view/index.d.ts +++ b/types/prosemirror-view/index.d.ts @@ -1,16 +1,21 @@ -// Type definitions for prosemirror-view 1.0 +// Type definitions for prosemirror-view 1.2 // Project: https://github.com/ProseMirror/prosemirror-view // Definitions by: Bradley Ayers // David Hahn // Tim Baumann +// Patrick Simmelbauer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.3 -// IMPORTANT -// This file was generated by https://github.com/bradleyayers/getdocs2ts. Please do not edit manually. -// When you find an error in these declarations, fix the getdocs comment upstream or 'getdocs2ts', then regenerate. - -import { DOMParser, DOMSerializer, Node as ProsemirrorNode, ResolvedPos, Slice } from 'prosemirror-model'; +import { + DOMParser, + DOMSerializer, + Node as ProsemirrorNode, + ResolvedPos, + Slice, + Schema, + Mark +} from 'prosemirror-model'; import { EditorState, Selection, Transaction } from 'prosemirror-state'; import { Mapping } from 'prosemirror-transform'; @@ -38,18 +43,37 @@ export class Decoration { * Creates a widget decoration, which is a DOM node that's shown in * the document at the given position. */ - static widget(pos: number, dom: Node, spec?: { side?: number | null, stopEvent?: ((event: Event) => boolean) | null, key?: string | null }): Decoration; + static widget( + pos: number, + dom: Node, + spec?: { + side?: number | null; + marks?: Mark[]; + stopEvent?: ((event: Event) => boolean) | null; + key?: string | null; + } + ): Decoration; /** * Creates an inline decoration, which adds the given attributes to * each inline node between `from` and `to`. */ - static inline(from: number, to: number, attrs: DecorationAttrs, spec?: { inclusiveStart?: boolean | null, inclusiveEnd?: boolean | null }): Decoration; + static inline( + from: number, + to: number, + attrs: DecorationAttrs, + spec?: { inclusiveStart?: boolean | null; inclusiveEnd?: boolean | null } + ): Decoration; /** * Creates a node decoration. `from` and `to` should point precisely * before and after a node in the document. That node, and only that * node, will receive the given attributes. */ - static node(from: number, to: number, attrs: DecorationAttrs, spec?: { [key: string]: any }): Decoration; + static node( + from: number, + to: number, + attrs: DecorationAttrs, + spec?: { [key: string]: any } + ): Decoration; } /** * A set of attributes to add to a decorated node. Most properties @@ -78,7 +102,7 @@ export interface DecorationAttrs { * compare them. This is a persistent data structure—it is not * modified, updates create a new value. */ -export class DecorationSet { +export class DecorationSet { /** * Find all decorations in this set which touch the given range * (including decorations that start or end directly at the @@ -87,28 +111,39 @@ export class DecorationSet { * considered. When `predicate` isn't given, all decorations are * asssumed to match. */ - find(start?: number, end?: number, predicate?: (spec: { [key: string]: any }) => boolean): Decoration[]; + find( + start?: number, + end?: number, + predicate?: (spec: { [key: string]: any }) => boolean + ): Decoration[]; /** * Map the set of decorations in response to a change in the * document. */ - map(mapping: Mapping, doc: ProsemirrorNode, options?: { onRemove?: ((decorationSpec: { [key: string]: any }) => void) | null }): DecorationSet; + map( + mapping: Mapping, + doc: ProsemirrorNode, + options?: { onRemove?: ((decorationSpec: { [key: string]: any }) => void) | null } + ): DecorationSet; /** * Add the given array of decorations to the ones in the set, * producing a new set. Needs access to the current document to * create the appropriate tree structure. */ - add(doc: ProsemirrorNode, decorations: Decoration[]): DecorationSet; + add(doc: ProsemirrorNode, decorations: Decoration[]): DecorationSet; /** * Create a new set that contains the decorations in this set, minus * the ones in the given array. */ - remove(decorations: Decoration[]): DecorationSet; + remove(decorations: Decoration[]): DecorationSet; /** * Create a set of decorations, using the structure of the given * document. */ - static create(doc: ProsemirrorNode, decorations: Decoration[]): DecorationSet; + static create( + doc: ProsemirrorNode, + decorations: Decoration[] + ): DecorationSet; /** * The empty set of decorations. */ @@ -119,7 +154,7 @@ export class DecorationSet { * editable document. Its state and behavior are determined by its * [props](#view.DirectEditorProps). */ -export class EditorView { +export class EditorView { /** * Create a view. `place` may be a DOM node that the editor should * be appended to, a function that will place it into the document, @@ -127,11 +162,14 @@ export class EditorView { * document container. If it is `null`, the editor will not be added * to the document. */ - constructor(place: Node | ((p: Node) => void) | { mount: Node } | undefined, props: DirectEditorProps); + constructor( + place: Node | ((p: Node) => void) | { mount: Node } | undefined, + props: DirectEditorProps + ); /** * The view's current [state](#state.EditorState). */ - state: EditorState; + state: EditorState; /** * An editable DOM node containing the document. (You probably * should not directly interfere with its content.) @@ -142,27 +180,27 @@ export class EditorView { * information about the dragged slice and whether it is being * copied or moved. At any other time, it is null. */ - dragging?: { slice: Slice, move: boolean } | null; + dragging?: { slice: Slice; move: boolean } | null; /** * The view's current [props](#view.EditorProps). */ - props: DirectEditorProps; + props: DirectEditorProps; /** * Update the view's props. Will immediately cause an update to * the DOM. */ - update(props: DirectEditorProps): void; + update(props: DirectEditorProps): void; /** * Update the view by updating existing props object with the object * given as argument. Equivalent to `view.update(Object.assign({}, * view.props, props))`. */ - setProps(props: DirectEditorProps): void; + setProps(props: DirectEditorProps): void; /** * Update the editor's `state` prop, without touching any of the * other props. */ - updateState(state: EditorState): void; + updateState(state: EditorState): void; /** * Goes over the values of a prop, first those provided directly, * then those from plugins (in order), and calls `f` every time a @@ -196,20 +234,23 @@ export class EditorView { * inner node that the position falls inside of, or -1 if it is at * the top level, not in any node. */ - posAtCoords(coords: { left: number, top: number }): { pos: number, inside: number } | null | void; + posAtCoords(coords: { + left: number; + top: number; + }): { pos: number; inside: number } | null | void; /** * Returns the viewport rectangle at a given document position. `left` * and `right` will be the same number, as this returns a flat * cursor-ish rectangle. */ - coordsAtPos(pos: number): { left: number, right: number, top: number, bottom: number }; + coordsAtPos(pos: number): { left: number; right: number; top: number; bottom: number }; /** * Find the DOM position that corresponds to the given document * position. Note that you should **not** mutate the editor's * internal DOM, only inspect it (and even that is usually not * necessary). */ - domAtPos(pos: number): { node: Node, offset: number }; + domAtPos(pos: number): { node: Node; offset: number }; /** * Find out whether the selection is at the end of a textblock when * moving in a given direction. When, for example, given `"left"`, @@ -218,7 +259,10 @@ export class EditorView { * to the view's current state by default, but it is possible to * pass a different state. */ - endOfTextblock(dir: "up" | "down" | "left" | "right" | "forward" | "backward", state?: EditorState): boolean; + endOfTextblock( + dir: 'up' | 'down' | 'left' | 'right' | 'forward' | 'backward', + state?: EditorState + ): boolean; /** * Removes the editor from the DOM and destroys all [node * views](#view.NodeView). @@ -233,7 +277,7 @@ export class EditorView { * This method is bound to the view instance, so that it can be * easily passed around. */ - dispatch(tr: Transaction): void; + dispatch(tr: Transaction): void; } /** * Props are configuration values that can be passed to an editor view @@ -250,7 +294,7 @@ export class EditorView { * them returns true. For some props, the first plugin that yields a * value gets precedence. */ -export interface EditorProps { +export interface EditorProps { /** * Can be an object mapping DOM event type names to functions that * handle them. Such functions will be called before any handling @@ -260,78 +304,115 @@ export interface EditorProps { * `preventDefault` yourself (or not, if you want to allow the * default behavior). */ - handleDOMEvents?: { [name: string]: (view: EditorView, event: Event) => boolean } | null; + handleDOMEvents?: { [name: string]: (view: EditorView, event: Event) => boolean } | null; /** * Called when the editor receives a `keydown` event. */ - handleKeyDown?: ((view: EditorView, event: KeyboardEvent) => boolean) | null; + handleKeyDown?: ((view: EditorView, event: KeyboardEvent) => boolean) | null; /** * Handler for `keypress` events. */ - handleKeyPress?: ((view: EditorView, event: KeyboardEvent) => boolean) | null; + handleKeyPress?: ((view: EditorView, event: KeyboardEvent) => boolean) | null; /** * Whenever the user directly input text, this handler is called * before the input is applied. If it returns `true`, the default * behavior of actually inserting the text is suppressed. */ - handleTextInput?: ((view: EditorView, from: number, to: number, text: string) => boolean) | null; + handleTextInput?: + | ((view: EditorView, from: number, to: number, text: string) => boolean) + | null; /** * Called for each node around a click, from the inside out. The * `direct` flag will be true for the inner node. */ - handleClickOn?: ((view: EditorView, pos: number, node: ProsemirrorNode, nodePos: number, event: MouseEvent, direct: boolean) => boolean) | null; + handleClickOn?: + | (( + view: EditorView, + pos: number, + node: ProsemirrorNode, + nodePos: number, + event: MouseEvent, + direct: boolean + ) => boolean) + | null; /** * Called when the editor is clicked, after `handleClickOn` handlers * have been called. */ - handleClick?: ((view: EditorView, pos: number, event: MouseEvent) => boolean) | null; + handleClick?: ((view: EditorView, pos: number, event: MouseEvent) => boolean) | null; /** * Called for each node around a double click. */ - handleDoubleClickOn?: ((view: EditorView, pos: number, node: ProsemirrorNode, nodePos: number, event: MouseEvent, direct: boolean) => boolean) | null; + handleDoubleClickOn?: + | (( + view: EditorView, + pos: number, + node: ProsemirrorNode, + nodePos: number, + event: MouseEvent, + direct: boolean + ) => boolean) + | null; /** * Called when the editor is double-clicked, after `handleDoubleClickOn`. */ - handleDoubleClick?: ((view: EditorView, pos: number, event: MouseEvent) => boolean) | null; + handleDoubleClick?: ((view: EditorView, pos: number, event: MouseEvent) => boolean) | null; /** * Called for each node around a triple click. */ - handleTripleClickOn?: ((view: EditorView, pos: number, node: ProsemirrorNode, nodePos: number, event: MouseEvent, direct: boolean) => boolean) | null; + handleTripleClickOn?: + | (( + view: EditorView, + pos: number, + node: ProsemirrorNode, + nodePos: number, + event: MouseEvent, + direct: boolean + ) => boolean) + | null; /** * Called when the editor is triple-clicked, after `handleTripleClickOn`. */ - handleTripleClick?: ((view: EditorView, pos: number, event: MouseEvent) => boolean) | null; + handleTripleClick?: ((view: EditorView, pos: number, event: MouseEvent) => boolean) | null; /** * Can be used to override the behavior of pasting. `slice` is the * pasted content parsed by the editor, but you can directly access * the event to get at the raw content. */ - handlePaste?: ((view: EditorView, event: Event, slice: Slice) => boolean) | null; + handlePaste?: ((view: EditorView, event: Event, slice: Slice) => boolean) | null; /** * Called when something is dropped on the editor. `moved` will be * true if this drop moves from the current selection (which should * thus be deleted). */ - handleDrop?: ((view: EditorView, event: Event, slice: Slice, moved: boolean) => boolean) | null; + handleDrop?: + | ((view: EditorView, event: Event, slice: Slice, moved: boolean) => boolean) + | null; /** * Called when the view, after updating its state, tries to scroll * the selection into view. A handler function may return false to * indicate that it did not handle the scrolling and further * handlers or the default behavior should be tried. */ - handleScrollToSelection?: ((view: EditorView) => boolean) | null; + handleScrollToSelection?: ((view: EditorView) => boolean) | null; /** * Can be used to override the way a selection is created when * reading a DOM selection between the given anchor and head. */ - createSelectionBetween?: ((view: EditorView, anchor: ResolvedPos, head: ResolvedPos) => Selection | null | void) | null; + createSelectionBetween?: + | (( + view: EditorView, + anchor: ResolvedPos, + head: ResolvedPos + ) => Selection | null | void) + | null; /** * The [parser](#model.DOMParser) to use when reading editor changes * from the DOM. Defaults to calling * [`DOMParser.fromSchema`](#model.DOMParser^fromSchema) on the * editor's schema. */ - domParser?: DOMParser | null; + domParser?: DOMParser | null; /** * Can be used to transform pasted HTML text, _before_ it is parsed, * for example to clean it up. @@ -342,7 +423,7 @@ export interface EditorProps { * the clipboard. When not given, the value of the * [`domParser`](#view.EditorProps.domParser) prop is used. */ - clipboardParser?: DOMParser | null; + clipboardParser?: DOMParser | null; /** * Transform pasted plain text. */ @@ -355,12 +436,12 @@ export interface EditorProps { * in `

` tags, and call * [`clipboardParser`](#view.EditorProps.clipboardParser) on it. */ - clipboardTextParser?: ((text: string, $context: ResolvedPos) => Slice) | null; + clipboardTextParser?: ((text: string, $context: ResolvedPos) => Slice) | null; /** * Can be used to transform pasted content before it is applied to * the document. */ - transformPasted?: ((p: Slice) => Slice) | null; + transformPasted?: ((p: Slice) => Slice) | null; /** * Allows you to pass custom rendering and behavior logic for nodes * and marks. Should map node and mark names to constructor @@ -375,31 +456,38 @@ export interface EditorProps { * they can also be used as a way to provide context information to * the node view without adding it to the document itself. */ - nodeViews?: { [name: string]: (node: ProsemirrorNode, view: EditorView, getPos: () => number, decorations: Decoration[]) => NodeView } | null; + nodeViews?: { + [name: string]: ( + node: ProsemirrorNode, + view: EditorView, + getPos: () => number, + decorations: Decoration[] + ) => NodeView; + } | null; /** * The DOM serializer to use when putting content onto the * clipboard. If not given, the result of * [`DOMSerializer.fromSchema`](#model.DOMSerializer^fromSchema) * will be used. */ - clipboardSerializer?: DOMSerializer | null; + clipboardSerializer?: DOMSerializer | null; /** * A function that will be called to get the text for the current * selection when copying text to the clipboard. By default, the * editor will use [`textBetween`](#model.Node.textBetween) on the * selected range. */ - clipboardTextSerializer?: ((p: Slice) => string) | null; + clipboardTextSerializer?: ((p: Slice) => string) | null; /** * A set of [document decorations](#view.Decoration) to show in the * view. */ - decorations?: ((state: EditorState) => DecorationSet | null | void) | null; + decorations?: ((state: EditorState) => DecorationSet | null | void) | null; /** * When this returns false, the content of the view is not directly * editable. */ - editable?: ((state: EditorState) => boolean) | null; + editable?: ((state: EditorState) => boolean) | null; /** * Control the DOM attributes of the editable element. May be either * an object or a function going from an editor state to an object. @@ -410,7 +498,10 @@ export interface EditorProps { * the value provided first (as in * [`someProp`](#view.EditorView.someProp)) will be used. */ - attributes?: { [name: string]: string } | ((p: EditorState) => { [name: string]: string } | null | void) | null; + attributes?: + | { [name: string]: string } + | ((p: EditorState) => { [name: string]: string } | null | void) + | null; /** * Determines the distance (in pixels) between the cursor and the * end of the visible viewport at which point, when scrolling the @@ -427,11 +518,11 @@ export interface EditorProps { * The props object given directly to the editor view supports two * fields that can't be used in plugins: */ -export interface DirectEditorProps extends EditorProps { +export interface DirectEditorProps extends EditorProps { /** * The current state of the editor. */ - state: EditorState; + state: EditorState; /** * The callback over which to send transactions (state updates) * produced by the view. If you specify this, you probably want to @@ -440,7 +531,7 @@ export interface DirectEditorProps extends EditorProps { * state that has the transaction * [applied](#state.EditorState.apply). */ - dispatchTransaction?: ((tr: Transaction) => void) | null; + dispatchTransaction?: ((tr: Transaction) => void) | null; } /** * By default, document nodes are rendered using the result of the @@ -452,7 +543,7 @@ export interface DirectEditorProps extends EditorProps { * * Objects returned as node views must conform to this interface. */ -export interface NodeView { +export interface NodeView { /** * The outer DOM node that represents the document node. When not * given, the default strategy is used to create a DOM node. @@ -477,7 +568,7 @@ export interface NodeView { * no `dom` property), updating its child nodes will be handled by * ProseMirror. */ - update?: ((node: ProsemirrorNode, decorations: Decoration[]) => boolean) | null; + update?: ((node: ProsemirrorNode, decorations: Decoration[]) => boolean) | null; /** * Can be used to override the way the node's selected status (as a * node selection) is displayed. From 363064fd25970814fe08a66549962530d26a753b Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Fri, 20 Apr 2018 19:33:07 +0200 Subject: [PATCH 011/564] chai: Add Date comparison overloads (#25163) --- types/chai/chai-tests.ts | 60 ++++++++++++++++++++++++++++++++++++++++ types/chai/index.d.ts | 4 ++- 2 files changed, 63 insertions(+), 1 deletion(-) diff --git a/types/chai/chai-tests.ts b/types/chai/chai-tests.ts index 57b7d127ac..f19514fe71 100644 --- a/types/chai/chai-tests.ts +++ b/types/chai/chai-tests.ts @@ -191,6 +191,18 @@ function within() { expect(10).to.be.within(50, 100, 'blah'); (10).should.be.within(50, 100, 'blah'); + expect(new Date('December 17, 1995 03:24:30')).to.not.be.within(new Date('December 17, 1995 03:24:20'), new Date('December 17, 1995 03:24:40')); + new Date('December 17, 1995 03:24:30').should.not.be.within(new Date('December 17, 1995 03:24:20'), new Date('December 17, 1995 03:24:40')); + + expect(new Date('December 17, 1995 03:24:30')).to.be.within(new Date('December 17, 1995 03:24:20'), new Date('December 17, 1995 03:24:40')); + new Date('December 17, 1995 03:24:30').should.be.within(new Date('December 17, 1995 03:24:20'), new Date('December 17, 1995 03:24:40')); + + expect(new Date('December 17, 1995 03:24:30')).to.not.be.within(new Date('December 17, 1995 03:24:20'), new Date('December 17, 1995 03:24:40'), 'blah'); + new Date('December 17, 1995 03:24:30').should.not.be.within(new Date('December 17, 1995 03:24:20'), new Date('December 17, 1995 03:24:40'), 'blah'); + + expect(new Date('December 17, 1995 03:24:30')).to.be.within(new Date('December 17, 1995 03:24:20'), new Date('December 17, 1995 03:24:40'), 'blah'); + new Date('December 17, 1995 03:24:30').should.be.within(new Date('December 17, 1995 03:24:20'), new Date('December 17, 1995 03:24:40'), 'blah'); + expect('foo').to.have.length.within(5, 7, 'blah'); 'foo'.should.have.length.within(5, 7, 'blah'); @@ -218,6 +230,18 @@ function above() { expect(10).to.not.be.above(6, 'blah'); (10).should.not.be.above(6, 'blah'); + expect(new Date('December 17, 1995 03:24:30')).to.not.be.above(new Date('December 17, 1995 03:24:20')); + new Date('December 17, 1995 03:24:30').should.not.be.above(new Date('December 17, 1995 03:24:20')); + + expect(new Date('December 17, 1995 03:24:30')).to.be.above(new Date('December 17, 1995 03:24:20')); + new Date('December 17, 1995 03:24:30').should.be.above(new Date('December 17, 1995 03:24:20')); + + expect(new Date('December 17, 1995 03:24:30')).to.not.be.above(new Date('December 17, 1995 03:24:20'), 'blah'); + new Date('December 17, 1995 03:24:30').should.not.be.above(new Date('December 17, 1995 03:24:20'), 'blah'); + + expect(new Date('December 17, 1995 03:24:30')).to.be.above(new Date('December 17, 1995 03:24:20'), 'blah'); + new Date('December 17, 1995 03:24:30').should.be.above(new Date('December 17, 1995 03:24:20'), 'blah'); + expect('foo').to.have.length.above(4, 'blah'); 'foo'.should.have.length.above(4, 'blah'); @@ -243,6 +267,18 @@ function least() { expect(10).to.not.be.at.least(6, 'blah'); (10).should.not.be.at.least(6, 'blah'); + expect(new Date('December 17, 1995 03:24:30')).to.not.be.least(new Date('December 17, 1995 03:24:20')); + new Date('December 17, 1995 03:24:30').should.not.be.least(new Date('December 17, 1995 03:24:20')); + + expect(new Date('December 17, 1995 03:24:30')).to.be.least(new Date('December 17, 1995 03:24:20')); + new Date('December 17, 1995 03:24:30').should.be.least(new Date('December 17, 1995 03:24:20')); + + expect(new Date('December 17, 1995 03:24:30')).to.not.be.least(new Date('December 17, 1995 03:24:20'), 'blah'); + new Date('December 17, 1995 03:24:30').should.not.be.least(new Date('December 17, 1995 03:24:20'), 'blah'); + + expect(new Date('December 17, 1995 03:24:30')).to.be.least(new Date('December 17, 1995 03:24:20'), 'blah'); + new Date('December 17, 1995 03:24:30').should.be.least(new Date('December 17, 1995 03:24:20'), 'blah'); + expect('foo').to.have.length.of.at.least(4, 'blah'); 'foo'.should.have.length.of.at.least(4, 'blah'); @@ -273,6 +309,18 @@ function below() { expect(6).to.not.be.below(10, 'blah'); (6).should.not.be.below(10, 'blah'); + expect(new Date('December 17, 1995 03:24:30')).to.not.be.below(new Date('December 17, 1995 03:24:20')); + new Date('December 17, 1995 03:24:30').should.not.be.below(new Date('December 17, 1995 03:24:20')); + + expect(new Date('December 17, 1995 03:24:30')).to.be.below(new Date('December 17, 1995 03:24:20')); + new Date('December 17, 1995 03:24:30').should.be.below(new Date('December 17, 1995 03:24:20')); + + expect(new Date('December 17, 1995 03:24:30')).to.not.be.below(new Date('December 17, 1995 03:24:20'), 'blah'); + new Date('December 17, 1995 03:24:30').should.not.be.below(new Date('December 17, 1995 03:24:20'), 'blah'); + + expect(new Date('December 17, 1995 03:24:30')).to.be.below(new Date('December 17, 1995 03:24:20'), 'blah'); + new Date('December 17, 1995 03:24:30').should.be.below(new Date('December 17, 1995 03:24:20'), 'blah'); + expect('foo').to.have.length.below(2, 'blah'); 'foo'.should.have.length.below(2, 'blah'); @@ -300,6 +348,18 @@ function most() { expect(6).to.not.be.at.most(10, 'blah'); (6).should.not.be.at.most(10, 'blah'); + expect(new Date('December 17, 1995 03:24:30')).to.not.be.most(new Date('December 17, 1995 03:24:20')); + new Date('December 17, 1995 03:24:30').should.not.be.most(new Date('December 17, 1995 03:24:20')); + + expect(new Date('December 17, 1995 03:24:30')).to.be.most(new Date('December 17, 1995 03:24:20')); + new Date('December 17, 1995 03:24:30').should.be.most(new Date('December 17, 1995 03:24:20')); + + expect(new Date('December 17, 1995 03:24:30')).to.not.be.most(new Date('December 17, 1995 03:24:20'), 'blah'); + new Date('December 17, 1995 03:24:30').should.not.be.most(new Date('December 17, 1995 03:24:20'), 'blah'); + + expect(new Date('December 17, 1995 03:24:30')).to.be.most(new Date('December 17, 1995 03:24:20'), 'blah'); + new Date('December 17, 1995 03:24:30').should.be.most(new Date('December 17, 1995 03:24:20'), 'blah'); + expect('foo').to.have.length.of.at.most(2, 'blah'); 'foo'.should.have.length.of.at.most(2, 'blah'); diff --git a/types/chai/index.d.ts b/types/chai/index.d.ts index 02bca8909f..d0f5ab099c 100644 --- a/types/chai/index.d.ts +++ b/types/chai/index.d.ts @@ -9,6 +9,7 @@ // Shaun Luttin // Gintautas Miselis // Satana Charuwichitratana +// Erik Schierboom // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace Chai { @@ -150,10 +151,11 @@ declare namespace Chai { most: NumberComparer; lte: NumberComparer; within(start: number, finish: number, message?: string): Assertion; + within(start: Date, finish: Date, message?: string): Assertion; } interface NumberComparer { - (value: number, message?: string): Assertion; + (value: number | Date, message?: string): Assertion; } interface TypeComparison { From 4bc92af1335740a888eb6203683d00a7546e3e05 Mon Sep 17 00:00:00 2001 From: Abram Booth Date: Fri, 20 Apr 2018 13:35:02 -0400 Subject: [PATCH 012/564] Allow augmenting DS namespace (#25174) see Microsoft/TypeScript#11034 --- types/ember-data/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/ember-data/index.d.ts b/types/ember-data/index.d.ts index 5e4fa4eb60..a5918f9375 100644 --- a/types/ember-data/index.d.ts +++ b/types/ember-data/index.d.ts @@ -43,7 +43,7 @@ declare module 'ember-data' { isRelationship: true; } - namespace DS { + export namespace DS { /** * Convert an hash of errors into an array with errors in JSON-API format. */ From 3bd123248502acfbd50596957db94c11b393c07e Mon Sep 17 00:00:00 2001 From: Avi Vahl Date: Fri, 20 Apr 2018 20:36:06 +0300 Subject: [PATCH 013/564] [react-is] Initial package typings (#25176) * [react-is] Initial typings for package React introduced the react-is for assertions on elements and element types. I took the README and tests and created the matching ts types. * Add TypeScript 2.6 comment this package uses @types/react, and it requires 2.6 or above. * Match strictFunctionTypes config of react * Remove unneeded generics per https://github.com/Microsoft/dtslint/blob/master/docs/no-unnecessary-generics.md React uses this pattern (providing the Props interface via generics) and turned off the linting. We'll use the default lint options and `any` props. * Use ReactType instead of an explicit union * Cleanup unused imports --- types/react-is/index.d.ts | 26 +++++++++++ types/react-is/react-is-tests.tsx | 74 +++++++++++++++++++++++++++++++ types/react-is/tsconfig.json | 25 +++++++++++ types/react-is/tslint.json | 1 + 4 files changed, 126 insertions(+) create mode 100644 types/react-is/index.d.ts create mode 100644 types/react-is/react-is-tests.tsx create mode 100644 types/react-is/tsconfig.json create mode 100644 types/react-is/tslint.json diff --git a/types/react-is/index.d.ts b/types/react-is/index.d.ts new file mode 100644 index 0000000000..f088b1bcc9 --- /dev/null +++ b/types/react-is/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for react-is 16.3 +// Project: https://reactjs.org/ +// Definitions by: Avi Vahl +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +export as namespace ReactIs; + +import { ReactElement, ReactType } from 'react'; + +export function typeOf(value: any): symbol | undefined; +export function isValidElementType(value: any): value is ReactType; + +export function isContextConsumer(value: any): value is ReactElement; +export function isContextProvider(value: any): value is ReactElement; +export function isElement(value: any): value is ReactElement; +export function isFragment(value: any): value is ReactElement; +export function isPortal(value: any): value is ReactElement; +export function isStrictMode(value: any): value is ReactElement; + +export const ContextProvider: symbol; +export const ContextConsumer: symbol; +export const Element: symbol; +export const Fragment: symbol; +export const Portal: symbol; +export const StrictMode: symbol; diff --git a/types/react-is/react-is-tests.tsx b/types/react-is/react-is-tests.tsx new file mode 100644 index 0000000000..a03ad7b534 --- /dev/null +++ b/types/react-is/react-is-tests.tsx @@ -0,0 +1,74 @@ +import * as React from 'react'; +import * as ReactDOM from 'react-dom'; +import * as ReactIs from 'react-is'; + +// Below is taken from README of react-is +// Determining if a Component is Valid + +interface CompProps { + forwardedRef?: React.Ref; + children?: React.ReactNode; +} + +class ClassComponent extends React.Component { + render() { + return React.createElement('div'); + } +} + +const StatelessComponent = () => React.createElement('div'); + +const ForwardRefComponent = React.forwardRef((props, ref) => + React.createElement(ClassComponent, { forwardedRef: ref, ...props }) +); + +const Context = React.createContext(false); + +ReactIs.isValidElementType('div'); // true +ReactIs.isValidElementType(ClassComponent); // true +ReactIs.isValidElementType(StatelessComponent); // true +ReactIs.isValidElementType(ForwardRefComponent); // true +ReactIs.isValidElementType(Context.Provider); // true +ReactIs.isValidElementType(Context.Consumer); // true +ReactIs.isValidElementType(React.createFactory('div')); // true + +// Determining an Element's Type + +// AsyncMode - unstable_AsyncMode is not implemented in @types/react yet +// ReactIs.isAsyncMode(); // true +// ReactIs.typeOf() === ReactIs.AsyncMode; // true + +// Context +const ThemeContext = React.createContext('blue'); + +ReactIs.isContextConsumer(); // true +ReactIs.isContextProvider(); // true +ReactIs.typeOf() === ReactIs.ContextConsumer; // true +ReactIs.typeOf() === ReactIs.ContextProvider; // true + +// Element +ReactIs.isElement(

); // true +ReactIs.typeOf(
) === ReactIs.Element; // true + +// Fragment +ReactIs.isFragment(<>); // true +ReactIs.typeOf(<>) === ReactIs.Fragment; // true + +// Portal +const div = document.createElement('div'); +const portal = ReactDOM.createPortal(
, div); + +ReactIs.isPortal(portal); // true +ReactIs.typeOf(portal) === ReactIs.Portal; // true + +// StrictMode +ReactIs.isStrictMode(); // true +ReactIs.typeOf() === ReactIs.StrictMode; // true + +// Verify typeOf accepts any type of value (taken from tests of react-is) +ReactIs.typeOf('abc') === undefined; +ReactIs.typeOf(true) === undefined; +ReactIs.typeOf(123) === undefined; +ReactIs.typeOf({}) === undefined; +ReactIs.typeOf(null) === undefined; +ReactIs.typeOf(undefined) === undefined; diff --git a/types/react-is/tsconfig.json b/types/react-is/tsconfig.json new file mode 100644 index 0000000000..9ef6f3da96 --- /dev/null +++ b/types/react-is/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": false, + "jsx": "preserve" + }, + "files": [ + "index.d.ts", + "react-is-tests.tsx" + ] +} diff --git a/types/react-is/tslint.json b/types/react-is/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-is/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From f38bda6988e396db11ba424fe5b946895a984bea Mon Sep 17 00:00:00 2001 From: tbounsiar Date: Fri, 20 Apr 2018 19:37:27 +0200 Subject: [PATCH 014/564] React owl carousel (#25170) * adding react-owl-carousel types * Update Definitions by list Fix Test error * Fix tslint Fix tsconfig * Add docs Fix Bugs --- types/react-owl-carousel/index.d.ts | 414 ++++++++++++++++++ .../react-owl-carousel-tests.tsx | 30 ++ types/react-owl-carousel/tsconfig.json | 26 ++ types/react-owl-carousel/tslint.json | 3 + 4 files changed, 473 insertions(+) create mode 100644 types/react-owl-carousel/index.d.ts create mode 100644 types/react-owl-carousel/react-owl-carousel-tests.tsx create mode 100644 types/react-owl-carousel/tsconfig.json create mode 100644 types/react-owl-carousel/tslint.json diff --git a/types/react-owl-carousel/index.d.ts b/types/react-owl-carousel/index.d.ts new file mode 100644 index 0000000000..bcd9af38b5 --- /dev/null +++ b/types/react-owl-carousel/index.d.ts @@ -0,0 +1,414 @@ +// Type definitions for react-owl-carousel 2.2 +// Project: https://github.com/seal789ie/react-owl-carousel +// Definitions by: T Bounsiar , Ismael Gorissen , Kenneth Ceyer +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import * as React from "react"; + +export type HandlerCallback = (...args: any[]) => void; + +export interface Options { + // OPTIONS + /** + * Default: + * Adding a -striped className to OwlCarousel. + */ + className?: string; + /** + * Default: 3 + * The number of items you want to see on the screen. + */ + items?: number; + /** + * Default: 0 + * margin-right(px) on item. + */ + margin?: number; + /** + * Default: false + * Infinity loop. Duplicate last and first items to get loop illusion. + */ + loop?: boolean; + /** + * Default: false + * Center item. Works well with even an odd number of items. + */ + center?: boolean; + /** + * Default: true + * Mouse drag enabled. + */ + mouseDrag?: boolean; + /** + * Default: true + * Touch drag enabled. + */ + touchDrag?: boolean; + /** + * Default: true + * Stage pull to edge. + */ + pullDrag?: boolean; + /** + * Default: false + * Item pull to edge. + */ + freeDrag?: boolean; + /** + * Default: 0 + * Padding left and right on stage (can see neighbours). + */ + stagePadding?: number; + /** + * Default: false + * Merge items. Looking for data-merge='{number}' inside item. + */ + merge?: boolean; + /** + * Default: true + * Fit merged items if screen is smaller than items value. + */ + mergeFit?: boolean; + /** + * Default: false + * Set non grid content. Try using width style on divs. + */ + autoWidth?: boolean; + /** + * Default: 0 + * Start position or URL Hash string like '#id'. + */ + startPosition?: number | string; + /** + * Default: false + * Listen to url hash changes. data-hash on items is required. + */ + URLhashListener?: boolean; + /** + * Default: false + * Show next/prev buttons. + */ + nav?: boolean; + /** + * Default: true + * Go backwards when the boundary has reached. + */ + rewind?: boolean; + /** + * Default: ['next','prev'] + * HTML allowed. + */ + navText?: string[]; + /** + * Default: div + * DOM element type for a single directional navigation link. + */ + navElement?: string; + /** + * Default: 1 + * Navigation slide by x. 'page' string can be set to slide by page. + */ + slideBy?: number | string; + /** + * Default: true + * Show dots navigation. + */ + dots?: boolean; + /** + * Default: false + * Show dots each x item. + */ + dotsEach?: number | boolean; + /** + * Default: false + * Used by data-dot content. + */ + dotData?: boolean; + /** + * Default: false + * Lazy load images. data-src and data-src-retina for highres. + * Also load images into background inline style if element is not . + */ + lazyLoad?: boolean; + /** + * Default: false + * lazyContent was introduced during beta tests but i removed it from the final release due to bad implementation. + * It is a nice options so i will work on it in the nearest feature. + */ + lazyContent?: boolean; + /** + * Default: false + * Autoplay. + */ + autoplay?: boolean; + /** + * Default: 5000 + * Autoplay interval timeout. + */ + autoplayTimeout?: number; + /** + * Default: false + * Pause on mouse hover. + */ + autoplayHoverPause?: boolean; + /** + * Default: 250 + * Speed Calculate. More info to come.. + */ + smartSpeed?: number | boolean; + /** + * Default: Number + * Speed Calculate. More info to come.. + */ + fluidSpeed?: number | boolean; + /** + * Default: false + * autoplay speed. + */ + autoplaySpeed?: number | boolean; + /** + * Default: false + * Navigation speed. + */ + navSpeed?: number | boolean; + /** + * Default: Number/Boolean + * Pagination speed. + */ + dotsSpeed?: number | boolean; + /** + * Default: false + * Drag end speed. + */ + dragEndSpeed?: number | boolean; + /** + * Default: true + * Enable callback events. + */ + callbacks?: boolean; + /** + * Default: empty object + * Object containing responsive options. Can be set to false to remove responsive capabilities.. + */ + responsive?: { [breakpoint: string]: Options }; + /** + * Default: 200 + * Responsive refresh rate. + */ + responsiveRefreshRate?: number; + /** + * Default: window + * Set on any DOM element. + * If you care about non responsive browser (like ie8) then use it on main wrapper. This will prevent from crazy resizing. + */ + responsiveBaseElement?: Element; + /** + * Default: false + * Enable fetching YouTube/Vimeo/Vzaar videos. + */ + video?: boolean; + /** + * Default: false + * Set height for videos. + */ + videoHeight?: number | boolean; + /** + * Default: false + * Set width for videos. + */ + videoWidth?: number | boolean; + /** + * Default: false + * Class for CSS3 animation out. + */ + animateOut?: string | boolean; + /** + * Default: false + * Class for CSS3 animation in. + */ + animateIn?: string | boolean; + /** + * Default: swing + * Easing for CSS2 $.animate. + */ + fallbackEasing?: string; + /** + * Default: false + * Callback to retrieve basic information (current item/pages/widths). + * Info function second parameter is Owl DOM object reference. + */ + info?: HandlerCallback; + /** + * Default: false + * Use it if owl items are deep nested inside some generated content. E.g 'youritem'. Dont use dot before class name. + */ + nestedItemSelector?: string; + /** + * Default: div + * DOM element type for owl-item. + */ + itemElement?: string; + /** + * Default: div + * DOM element type for owl-stage. + */ + stageElement?: string; + /** + * Default: false + * Set your own container for nav. + */ + navContainer?: string | boolean; + /** + * Default: false + * Set your own container for nav. + */ + dotsContainer?: string | boolean; + + // CLASSES + /** + * Default: owl-refresh + * Class during refresh. + */ + refreshClass?: string; + /** + * Default: owl-loading + * Class during load. + */ + loadingClass?: string; + /** + * Default: owl-loaded + * Class after load. + */ + loadedClass?: string; + /** + * Default: owl-rtl + * Class for right to left mode. + */ + rtlClass?: string; + /** + * Default: owl-drag + * Class for mouse drag mode. + */ + dragClass?: string; + /** + * Default: owl-grab + * Class during mouse drag. + */ + grabClass?: string; + /** + * Default: owl-stage + * Stage class. + */ + stageClass?: string; + /** + * Default: owl-stage-outer + * Stage outer class. + */ + stageOuterClass?: string; + /** + * Default: owl-nav + * Navigation container class. + */ + navContainerClass?: string; + /** + * Default: ['owl-prev','owl-next'] + * Navigation buttons classes. + */ + navClass?: string[]; + /** + * Default: owl-controls + * Controls container class - wrapper for navs and dots. + */ + controlsClass?: string; + /** + * Default: owl-dot + * Dot Class. + */ + dotClass?: string; + /** + * Default: owl-dots + * Dots container class. + */ + dotsClass?: string; + /** + * Default: owl-height + * Auto height class. + */ + autoHeightClass?: string; + /** + * Default: false + * Optional helper class. + * Add '-' class to main element. Can be used to stylize content on given breakpoint. + */ + responsiveClass?: string | boolean; + + // EVENTS + /** + * When the plugin initializes. + */ + onInitialize?: HandlerCallback; + /** + * When the plugin has initialized. + */ + onInitialized?: HandlerCallback; + /** + * When the plugin gets resized. + */ + onResize?: HandlerCallback; + /** + * When the plugin has resized. + */ + onResized?: HandlerCallback; + /** + * When the internal state of the plugin needs update. + */ + onRefresh?: HandlerCallback; + /** + * When the internal state of the plugin has updated. + */ + onRefreshed?: HandlerCallback; + /** + * When the dragging of an item is started. + */ + onDrag?: HandlerCallback; + /** + * When the dragging of an item has finished. + */ + onDragged?: HandlerCallback; + /** + * When the translation of the stage starts. + */ + onTranslate?: HandlerCallback; + /** + * When the translation of the stage has finished. + */ + onTranslated?: HandlerCallback; + /** + * When a property is going to change its value. + */ + onChange?: HandlerCallback; + /** + * When a property has changed its value. + */ + onChanged?: HandlerCallback; + /** + * When lazy image loads. + */ + onLoadLazy?: HandlerCallback; + /** + * When lazy image has loaded. + */ + onLoadedLazy?: HandlerCallback; + /** + * When video has unloaded. + */ + onStopVideo?: HandlerCallback; + /** + * When video has loaded. + */ + onPlayVideo?: HandlerCallback; +} + +export default class OwlCarousel extends React.Component { +} diff --git a/types/react-owl-carousel/react-owl-carousel-tests.tsx b/types/react-owl-carousel/react-owl-carousel-tests.tsx new file mode 100644 index 0000000000..ba65ca9557 --- /dev/null +++ b/types/react-owl-carousel/react-owl-carousel-tests.tsx @@ -0,0 +1,30 @@ +import * as React from "react"; +import * as ReactDOM from 'react-dom'; + +// Import React Owl Carousel +import OwlCarousel from "react-owl-carousel"; + +export class ReactOwlCarouselTest extends React.Component { + render() { + return ( +
+ +

1

+

2

+

3

+

4

+

5

+

6

+

7

+

8

+

9

+

10

+

11

+

12

+
+
+ ); + } +} + +ReactDOM.render(, document.getElementById("root")); diff --git a/types/react-owl-carousel/tsconfig.json b/types/react-owl-carousel/tsconfig.json new file mode 100644 index 0000000000..3733b428c9 --- /dev/null +++ b/types/react-owl-carousel/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "jsx": "react", + "strictNullChecks": true, + "strictFunctionTypes": true, + "noImplicitAny": true, + "noImplicitThis": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true, + "experimentalDecorators": true + }, + "files": [ + "index.d.ts", + "react-owl-carousel-tests.tsx" + ] +} diff --git a/types/react-owl-carousel/tslint.json b/types/react-owl-carousel/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/react-owl-carousel/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From ce61935ac80e1cd10c47defee0fdebba6da2a322 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Dal=C3=A9n?= Date: Fri, 20 Apr 2018 19:38:45 +0200 Subject: [PATCH 015/564] Make all options optional (#25160) The package uses `Object.assign` and has default values, so these are all optional: https://github.com/SamVerschueren/aws-lambda-mock-context/blob/master/index.js#L11-L18 --- types/aws-lambda-mock-context/index.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/types/aws-lambda-mock-context/index.d.ts b/types/aws-lambda-mock-context/index.d.ts index 6fc5fda67a..b5a3768f2d 100644 --- a/types/aws-lambda-mock-context/index.d.ts +++ b/types/aws-lambda-mock-context/index.d.ts @@ -26,10 +26,10 @@ interface Context { } interface Options { - region: string; - account: string; - functionName: string; - functionVersion: string; - memoryLimitInMB: string; + region?: string; + account?: string; + functionName?: string; + functionVersion?: string; + memoryLimitInMB?: string; alias?: string; } From 19493d0fb16f8d86d2935d897b3d1450e0e92a46 Mon Sep 17 00:00:00 2001 From: Hirotaka Ikoma Date: Sat, 21 Apr 2018 02:40:03 +0900 Subject: [PATCH 016/564] Add type definitions for pngquant-bin (#25159) --- types/pngquant-bin/index.d.ts | 9 +++++++++ types/pngquant-bin/pngquant-bin-tests.ts | 6 ++++++ types/pngquant-bin/tsconfig.json | 23 +++++++++++++++++++++++ types/pngquant-bin/tslint.json | 1 + 4 files changed, 39 insertions(+) create mode 100644 types/pngquant-bin/index.d.ts create mode 100644 types/pngquant-bin/pngquant-bin-tests.ts create mode 100644 types/pngquant-bin/tsconfig.json create mode 100644 types/pngquant-bin/tslint.json diff --git a/types/pngquant-bin/index.d.ts b/types/pngquant-bin/index.d.ts new file mode 100644 index 0000000000..928ef83333 --- /dev/null +++ b/types/pngquant-bin/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for pngquant-bin 4.0 +// Project: https://github.com/imagemin/pngquant-bin#readme +// Definitions by: Hirotaka Ikoma +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare const pngquant: string; +export = pngquant; diff --git a/types/pngquant-bin/pngquant-bin-tests.ts b/types/pngquant-bin/pngquant-bin-tests.ts new file mode 100644 index 0000000000..40f79d1371 --- /dev/null +++ b/types/pngquant-bin/pngquant-bin-tests.ts @@ -0,0 +1,6 @@ +import { execFile } from "child_process"; +import * as pngquant from "pngquant-bin"; + +execFile(pngquant, ["-o", "output.png", "input.png"], { encoding: "utf-8" }, (err: Error | null) => { + console.log("Image minified!"); +}); diff --git a/types/pngquant-bin/tsconfig.json b/types/pngquant-bin/tsconfig.json new file mode 100644 index 0000000000..770ff62c3f --- /dev/null +++ b/types/pngquant-bin/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "pngquant-bin-tests.ts" + ] +} diff --git a/types/pngquant-bin/tslint.json b/types/pngquant-bin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pngquant-bin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From c3748d5c111eedbefd99bf7260e7f05b51307754 Mon Sep 17 00:00:00 2001 From: Hirotaka Ikoma Date: Sat, 21 Apr 2018 02:40:43 +0900 Subject: [PATCH 017/564] Add type definitions for mozjpeg (#25155) --- types/mozjpeg/index.d.ts | 9 +++++++++ types/mozjpeg/mozjpeg-tests.ts | 6 ++++++ types/mozjpeg/tsconfig.json | 23 +++++++++++++++++++++++ types/mozjpeg/tslint.json | 1 + 4 files changed, 39 insertions(+) create mode 100644 types/mozjpeg/index.d.ts create mode 100644 types/mozjpeg/mozjpeg-tests.ts create mode 100644 types/mozjpeg/tsconfig.json create mode 100644 types/mozjpeg/tslint.json diff --git a/types/mozjpeg/index.d.ts b/types/mozjpeg/index.d.ts new file mode 100644 index 0000000000..064d7b16e3 --- /dev/null +++ b/types/mozjpeg/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for mozjpeg 5.0 +// Project: https://github.com/imagemin/mozjpeg-bin#readme +// Definitions by: Hirotaka Ikoma +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare const mozjpeg: string; +export = mozjpeg; diff --git a/types/mozjpeg/mozjpeg-tests.ts b/types/mozjpeg/mozjpeg-tests.ts new file mode 100644 index 0000000000..6915acf946 --- /dev/null +++ b/types/mozjpeg/mozjpeg-tests.ts @@ -0,0 +1,6 @@ +import { execFile } from "child_process"; +import * as mozjpeg from "mozjpeg"; + +execFile(mozjpeg, ["-outfile", "output.jpg", "input.jpg"], {encoding: "utf-8"}, (err: Error | null) => { + console.log("Image minified!"); +}); diff --git a/types/mozjpeg/tsconfig.json b/types/mozjpeg/tsconfig.json new file mode 100644 index 0000000000..caea469f46 --- /dev/null +++ b/types/mozjpeg/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "mozjpeg-tests.ts" + ] +} diff --git a/types/mozjpeg/tslint.json b/types/mozjpeg/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/mozjpeg/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 8a377075d9150ce48d7530016b765c2ebbf87f80 Mon Sep 17 00:00:00 2001 From: Hirotaka Ikoma Date: Sat, 21 Apr 2018 02:41:04 +0900 Subject: [PATCH 018/564] Add type definitions for jpegtran-bin (#25156) --- types/jpegtran-bin/index.d.ts | 9 +++++++++ types/jpegtran-bin/jpegtran-bin-tests.ts | 6 ++++++ types/jpegtran-bin/tsconfig.json | 23 +++++++++++++++++++++++ types/jpegtran-bin/tslint.json | 1 + 4 files changed, 39 insertions(+) create mode 100644 types/jpegtran-bin/index.d.ts create mode 100644 types/jpegtran-bin/jpegtran-bin-tests.ts create mode 100644 types/jpegtran-bin/tsconfig.json create mode 100644 types/jpegtran-bin/tslint.json diff --git a/types/jpegtran-bin/index.d.ts b/types/jpegtran-bin/index.d.ts new file mode 100644 index 0000000000..b946d056b7 --- /dev/null +++ b/types/jpegtran-bin/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for jpegtran-bin 3.2 +// Project: https://github.com/imagemin/jpegtran-bin#readme +// Definitions by: Hirotaka Ikoma +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare const jpegtran: string; +export = jpegtran; diff --git a/types/jpegtran-bin/jpegtran-bin-tests.ts b/types/jpegtran-bin/jpegtran-bin-tests.ts new file mode 100644 index 0000000000..9f3e8318fd --- /dev/null +++ b/types/jpegtran-bin/jpegtran-bin-tests.ts @@ -0,0 +1,6 @@ +import { execFile } from "child_process"; +import * as jpegtran from "jpegtran-bin"; + +execFile(jpegtran, ["-outfile", "output.jpg", "input.jpg"], { encoding: "utf-8" }, (err: Error | null) => { + console.log("Image minified!"); +}); diff --git a/types/jpegtran-bin/tsconfig.json b/types/jpegtran-bin/tsconfig.json new file mode 100644 index 0000000000..5f260cfaed --- /dev/null +++ b/types/jpegtran-bin/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jpegtran-bin-tests.ts" + ] +} diff --git a/types/jpegtran-bin/tslint.json b/types/jpegtran-bin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jpegtran-bin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 2e1b78adc09a5205cc04dc6398f60cdef5481398 Mon Sep 17 00:00:00 2001 From: Hirotaka Ikoma Date: Sat, 21 Apr 2018 02:41:19 +0900 Subject: [PATCH 019/564] Add type definitions for zopflipng-bin (#25158) --- types/zopflipng-bin/index.d.ts | 8 ++++++++ types/zopflipng-bin/tsconfig.json | 23 ++++++++++++++++++++++ types/zopflipng-bin/tslint.json | 1 + types/zopflipng-bin/zopflipng-bin-tests.ts | 6 ++++++ 4 files changed, 38 insertions(+) create mode 100644 types/zopflipng-bin/index.d.ts create mode 100644 types/zopflipng-bin/tsconfig.json create mode 100644 types/zopflipng-bin/tslint.json create mode 100644 types/zopflipng-bin/zopflipng-bin-tests.ts diff --git a/types/zopflipng-bin/index.d.ts b/types/zopflipng-bin/index.d.ts new file mode 100644 index 0000000000..8fc2242b98 --- /dev/null +++ b/types/zopflipng-bin/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for zopflipng-bin 4.1 +// Project: https://github.com/imagemin/zopflipng-bin#readme +// Definitions by: Hirotaka Ikoma +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +declare const zopflipng: string; +export = zopflipng; diff --git a/types/zopflipng-bin/tsconfig.json b/types/zopflipng-bin/tsconfig.json new file mode 100644 index 0000000000..5a929c6d3a --- /dev/null +++ b/types/zopflipng-bin/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "zopflipng-bin-tests.ts" + ] +} diff --git a/types/zopflipng-bin/tslint.json b/types/zopflipng-bin/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/zopflipng-bin/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/zopflipng-bin/zopflipng-bin-tests.ts b/types/zopflipng-bin/zopflipng-bin-tests.ts new file mode 100644 index 0000000000..28c3fe491f --- /dev/null +++ b/types/zopflipng-bin/zopflipng-bin-tests.ts @@ -0,0 +1,6 @@ +import { execFile } from "child_process"; +import * as zopflipng from "zopflipng-bin"; + +execFile(zopflipng, ["-m", "--lossy_8bit", "input.png", "outout.png"], { encoding: "utf-8" }, (err: Error | null) => { + console.log("Image minified!"); +}); From 68d4475fa9fc769044ceaeddd71b49642139868f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Szabo?= Date: Fri, 20 Apr 2018 19:46:39 +0200 Subject: [PATCH 020/564] [Ramda] Added memoizeWith definition (#24895) * Ramda: added memoizeWith definition * Ramda: added memoizeWith definition * Ramda: added memoizeWith definition - narrowed generic --- types/ramda/index.d.ts | 8 ++++++++ types/ramda/ramda-tests.ts | 30 ++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index 70200aae41..69acb41dc6 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -17,6 +17,7 @@ // Ethan Resnick // Jack Leigh // Keagan McClelland +// Tomas Szabo // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -1027,6 +1028,13 @@ declare namespace R { */ memoize(fn: (...a: any[]) => T): (...a: any[]) => T; + /** + * A customisable version of R.memoize. memoizeWith takes an additional function that will be applied to a given + * argument set and used to create the cache key under which the results of the function to be memoized will be stored. + * Care must be taken when implementing key generation to avoid clashes that may overwrite previous entries erroneously. + */ + memoizeWith any>(keyFn: (...v: any[]) => string, fn: T): T; + /** * Create a new object with the own properties of a * merged with the own properties of object b. diff --git a/types/ramda/ramda-tests.ts b/types/ramda/ramda-tests.ts index dbb697e658..81eb438535 100644 --- a/types/ramda/ramda-tests.ts +++ b/types/ramda/ramda-tests.ts @@ -309,6 +309,36 @@ R.times(i, 5); const isLong = memoStringLength('short') > 10; // false })(); +(() => { + interface Vector { + x: number; + y: number; + } + + let numberOfCalls = 0; + + function vectorSum(a: Vector, b: Vector): Vector { + numberOfCalls += 1; + return { + x: a.x + b.x, + y: a.y + b.y + }; + } + + const memoVectorSum = R.memoizeWith(JSON.stringify, vectorSum); + + memoVectorSum({ x: 1, y: 1 }, { x: 2, y: 2 }); // => { x: 3, y: 3 } + numberOfCalls; // => 1 + memoVectorSum({ x: 1, y: 1 }, { x: 2, y: 2 }); // => { x: 3, y: 3 } + numberOfCalls; // => 1 + memoVectorSum({ x: 1, y: 2 }, { x: 2, y: 3 }); // => { x: 3, y: 5 } + numberOfCalls; // => 2 + + // Note that argument order matters + memoVectorSum({ x: 2, y: 3 }, { x: 1, y: 2 }); // => { x: 3, y: 5 } + numberOfCalls; // => 3 +})(); + (() => { const addOneOnce = R.once((x: number) => x + 1); addOneOnce(10); // => 11 From 182a90fc99ab676a03815ff009c809d880c583cb Mon Sep 17 00:00:00 2001 From: Pine Mizune Date: Sat, 21 Apr 2018 02:48:10 +0900 Subject: [PATCH 021/564] Fix `gulp-mustache` types (#25165) * Fix gulp-mustache types * Fix `gulp-mustache` test --- types/gulp-mustache/gulp-mustache-tests.ts | 27 ++++++++++++++++++++++ types/gulp-mustache/index.d.ts | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/types/gulp-mustache/gulp-mustache-tests.ts b/types/gulp-mustache/gulp-mustache-tests.ts index d8285370e7..d7fb994a58 100644 --- a/types/gulp-mustache/gulp-mustache-tests.ts +++ b/types/gulp-mustache/gulp-mustache-tests.ts @@ -4,6 +4,33 @@ import { Transform } from "stream"; mustache({ // $ExpectType Transform msg: "Hello Gulp!" }); +mustache({ + name: "Chris", + value: 10000, + taxed_value: 10000 - (10000 * 0.4), + in_ca: true +}); +mustache({ + repo: [ + { name: "resque" }, + { name: "hub" }, + { name: "rip" } + ] +}); +mustache({ + name: "Willy", + wrapped: () => { + return (text: string, render: (arg: string) => string) => { + return `${render(text)}`; + }; + } +}); +mustache({ + "person?": { name: "Jon" } +}); +mustache({ + repo: [] +}); mustache({ // $ExpectType Transform msg: "Hello Gulp!", diff --git a/types/gulp-mustache/index.d.ts b/types/gulp-mustache/index.d.ts index 13e0198558..ba6b22df9d 100644 --- a/types/gulp-mustache/index.d.ts +++ b/types/gulp-mustache/index.d.ts @@ -11,7 +11,7 @@ declare namespace GulpMustache { type View = Hash | string | undefined; interface Hash { - [key: string]: string; + [key: string]: any; } interface Options { From b8d8d08301f0e41b19ea234f19ceafc014c32e42 Mon Sep 17 00:00:00 2001 From: Kevin Lau Date: Fri, 20 Apr 2018 10:53:05 -0700 Subject: [PATCH 022/564] node-common-errors: Rename to common-errors (#25153) --- .../common-errors-tests.ts} | 2 +- types/{node-common-errors => common-errors}/index.d.ts | 4 ++-- types/{node-common-errors => common-errors}/tsconfig.json | 4 ++-- types/{node-common-errors => common-errors}/tslint.json | 0 4 files changed, 5 insertions(+), 5 deletions(-) rename types/{node-common-errors/node-common-errors-tests.ts => common-errors/common-errors-tests.ts} (98%) rename types/{node-common-errors => common-errors}/index.d.ts (99%) rename types/{node-common-errors => common-errors}/tsconfig.json (92%) rename types/{node-common-errors => common-errors}/tslint.json (100%) diff --git a/types/node-common-errors/node-common-errors-tests.ts b/types/common-errors/common-errors-tests.ts similarity index 98% rename from types/node-common-errors/node-common-errors-tests.ts rename to types/common-errors/common-errors-tests.ts index 9554c31dff..ed2c1cdf15 100644 --- a/types/node-common-errors/node-common-errors-tests.ts +++ b/types/common-errors/common-errors-tests.ts @@ -1,4 +1,4 @@ -import * as errors from 'node-common-errors'; +import * as errors from 'common-errors'; errors.log(new Error()); // $ExpectType Error errors.log(new Error(), ''); // $ExpectType Error diff --git a/types/node-common-errors/index.d.ts b/types/common-errors/index.d.ts similarity index 99% rename from types/node-common-errors/index.d.ts rename to types/common-errors/index.d.ts index 06bcb9e754..da0230b084 100644 --- a/types/node-common-errors/index.d.ts +++ b/types/common-errors/index.d.ts @@ -1,5 +1,5 @@ -// Type definitions for node-common-errors 0.4 -// Project: https://github.com/shutterstock/node-errors +// Type definitions for common-errors 1.0 +// Project: https://github.com/shutterstock/node-common-errors // Definitions by: Ian Copp // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 diff --git a/types/node-common-errors/tsconfig.json b/types/common-errors/tsconfig.json similarity index 92% rename from types/node-common-errors/tsconfig.json rename to types/common-errors/tsconfig.json index a862893b87..a4c4800e39 100644 --- a/types/node-common-errors/tsconfig.json +++ b/types/common-errors/tsconfig.json @@ -18,6 +18,6 @@ }, "files": [ "index.d.ts", - "node-common-errors-tests.ts" + "common-errors-tests.ts" ] -} \ No newline at end of file +} diff --git a/types/node-common-errors/tslint.json b/types/common-errors/tslint.json similarity index 100% rename from types/node-common-errors/tslint.json rename to types/common-errors/tslint.json From 38a994187eb1228c759e50bcf5bd05621390297a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=98i=C4=8Da=C5=99?= Date: Fri, 20 Apr 2018 19:53:45 +0200 Subject: [PATCH 023/564] [react-popover] Create new definition (#25146) --- types/react-popover/index.d.ts | 35 +++++++++++++++++++++ types/react-popover/react-popover-tests.tsx | 23 ++++++++++++++ types/react-popover/tsconfig.json | 25 +++++++++++++++ types/react-popover/tslint.json | 1 + 4 files changed, 84 insertions(+) create mode 100644 types/react-popover/index.d.ts create mode 100644 types/react-popover/react-popover-tests.tsx create mode 100644 types/react-popover/tsconfig.json create mode 100644 types/react-popover/tslint.json diff --git a/types/react-popover/index.d.ts b/types/react-popover/index.d.ts new file mode 100644 index 0000000000..20958f3040 --- /dev/null +++ b/types/react-popover/index.d.ts @@ -0,0 +1,35 @@ +// Type definitions for react-popover 0.5 +// Project: https://github.com/littlebits/react-popover +// Definitions by: Jakub Řičař +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import * as React from 'react'; + +export type PopoverPlace = + | 'above' + | 'right' + | 'below' + | 'left' + | 'row' + | 'column' + | 'start' + | 'end'; + +export interface PopoverProps { + body: React.ReactNode; + isOpen?: boolean; + preferPlace?: PopoverPlace; + place?: PopoverPlace; + onOuterAction?: (event: Event) => void; + refreshIntervalMs?: number; + enterExitTransitionDurationMs?: number; + tipSize?: number; + className?: string; + style?: React.CSSProperties; + target?: React.ReactElement; + appendTarget?: Element; +} + +declare class Popover extends React.Component {} +export default Popover; diff --git a/types/react-popover/react-popover-tests.tsx b/types/react-popover/react-popover-tests.tsx new file mode 100644 index 0000000000..39cb256c73 --- /dev/null +++ b/types/react-popover/react-popover-tests.tsx @@ -0,0 +1,23 @@ +import * as React from 'react'; +import Popover from 'react-popover'; + +class Test extends React.Component { + render() { + return ( + body
} + isOpen + preferPlace="above" + place="below" + onOuterAction={event => console.log(event)} + refreshIntervalMs={10} + enterExitTransitionDurationMs={10} + tipSize={10} + className="xxx" + style={{ display: 'block' }} + target={
target
} + appendTarget={document.createElement('div')} + /> + ); + } +} diff --git a/types/react-popover/tsconfig.json b/types/react-popover/tsconfig.json new file mode 100644 index 0000000000..723d670093 --- /dev/null +++ b/types/react-popover/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react" + }, + "files": [ + "index.d.ts", + "react-popover-tests.tsx" + ] +} diff --git a/types/react-popover/tslint.json b/types/react-popover/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-popover/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From f9810f1caa738e724cfdc07533c139486cbf5146 Mon Sep 17 00:00:00 2001 From: Gareth Parker Date: Fri, 20 Apr 2018 21:25:56 +0100 Subject: [PATCH 024/564] Plugins can now be string arrays rather that just strings --- types/glue/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/glue/index.d.ts b/types/glue/index.d.ts index d1bf010ffe..f347e69746 100644 --- a/types/glue/index.d.ts +++ b/types/glue/index.d.ts @@ -24,7 +24,7 @@ export interface Plugin { export interface Manifest { server: ServerOptions; register?: { - plugins: string | Plugin[] + plugins: string[] | Plugin[] }; } From 0a74c04ab86341362b6f57b252eb27fb4e684e1a Mon Sep 17 00:00:00 2001 From: Gareth Parker Date: Fri, 20 Apr 2018 23:03:51 +0100 Subject: [PATCH 025/564] Plugins can now be string arrays (#25184) * Glue - Fix to plugins * Plugins can now be string arrays rather that just strings --- types/glue/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/glue/index.d.ts b/types/glue/index.d.ts index d1bf010ffe..f347e69746 100644 --- a/types/glue/index.d.ts +++ b/types/glue/index.d.ts @@ -24,7 +24,7 @@ export interface Plugin { export interface Manifest { server: ServerOptions; register?: { - plugins: string | Plugin[] + plugins: string[] | Plugin[] }; } From 841c9f9a0b8d054cd15f286637fd143a2f3bec30 Mon Sep 17 00:00:00 2001 From: "James C. Davis" Date: Fri, 20 Apr 2018 18:04:36 -0400 Subject: [PATCH 026/564] Change allowed return type of Ember helper function to any (#25183) --- types/ember/index.d.ts | 2 +- types/ember/test/helper.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts index 81d3bd69e6..a35ed40dec 100755 --- a/types/ember/index.d.ts +++ b/types/ember/index.d.ts @@ -3461,7 +3461,7 @@ declare module '@ember/component/helper' { * }); * ``` */ - export function helper(helperFn: (params: any[], hash?: any) => string): any; + export function helper(helperFn: (params: any[], hash?: any) => any): any; } declare module '@ember/component/text-area' { diff --git a/types/ember/test/helper.ts b/types/ember/test/helper.ts index cba5709b10..2aa79a5ba1 100755 --- a/types/ember/test/helper.ts +++ b/types/ember/test/helper.ts @@ -33,3 +33,9 @@ function typedHelp(/*params, hash*/) { } export default helper(typedHelp); + +function arrayNumHelp(/*params, hash*/) { + return [1, 2, 3]; +} + +helper(arrayNumHelp); From 060127cc737534335b672963d83c5a99ad513fdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Moln=C3=A1r?= Date: Sat, 21 Apr 2018 00:05:59 +0200 Subject: [PATCH 027/564] Updated leaflet-gpx definitions with actual types (#25008) * added actual types * added descriptive argument names * type tests for all methods * updated header * fixed header --- types/leaflet-gpx/index.d.ts | 91 +++++++++++++------------- types/leaflet-gpx/leaflet-gpx-tests.ts | 84 ++++++++++++++++++++++++ 2 files changed, 130 insertions(+), 45 deletions(-) diff --git a/types/leaflet-gpx/index.d.ts b/types/leaflet-gpx/index.d.ts index 1071ef7b2f..7165aaba28 100644 --- a/types/leaflet-gpx/index.d.ts +++ b/types/leaflet-gpx/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for leaflet-gpx 1.1 +// Type definitions for leaflet-gpx 1.3 // Project: https://github.com/mpetazzoni/leaflet-gpx -// Definitions by: Viktor Soucek +// Definitions by: Viktor Soucek , Márton Molnár // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -8,62 +8,63 @@ import * as L from 'leaflet'; declare module 'leaflet' { interface GPXOptions { - async?: boolean; + async?: boolean; max_point_interval?: number; marker_options?: MarkerOptions; polyline_options?: PolylineOptions; gpx_options?: { parseElements: ['track', 'route', 'waypoint'] }; } + class GPX extends FeatureGroup { - constructor(gpx: any, options?: GPXOptions); - get_duration_string(duration: any, hidems: any): any; - get_duration_string_iso(duration: any, hidems: any): any; - to_miles(v: any): any; - to_ft(v: any): any; - m_to_km(v: any): any; - m_to_mi(v: any): any; + constructor(gpx: string, options?: GPXOptions); + get_duration_string(duration: number, hidems: boolean): string; + get_duration_string_iso(duration: number, hidems: boolean): string; + to_miles(kilometers: number): number; + to_ft(meters: number): number; + m_to_km(meters: number): number; + m_to_mi(meters: number): number; - get_name(): any; - get_desc(): any; - get_author(): any; - get_copyright(): any; - get_distance(): any; - get_distance_imp(): any; + get_name(): string; + get_desc(): string; + get_author(): string; + get_copyright(): string; + get_distance(): number; + get_distance_imp(): number; - get_start_time(): any; - get_end_time(): any; - get_moving_time(): any; - get_total_time(): any; + get_start_time(): Date; + get_end_time(): Date; + get_moving_time(): number; + get_total_time(): number; - get_moving_pace(): any; - get_moving_pace_imp(): any; + get_moving_pace(): number; + get_moving_pace_imp(): number; - get_moving_speed(): any; - get_moving_speed_imp(): any; + get_moving_speed(): number; + get_moving_speed_imp(): number; - get_total_speed(): any; - get_total_speed_imp(): any; + get_total_speed(): number; + get_total_speed_imp(): number; - get_elevation_gain(): any; - get_elevation_loss(): any; - get_elevation_gain_imp(): any; - get_elevation_loss_imp(): any; - get_elevation_data(): any; - get_elevation_data_imp(): any; - get_elevation_max(): any; - get_elevation_min(): any; - get_elevation_max_imp(): any; - get_elevation_min_imp(): any; + get_elevation_gain(): number; + get_elevation_loss(): number; + get_elevation_gain_imp(): number; + get_elevation_loss_imp(): number; + get_elevation_data(): Array<[number, number, string]>; + get_elevation_data_imp(): Array<[number, number, string]>; + get_elevation_max(): number; + get_elevation_min(): number; + get_elevation_max_imp(): number; + get_elevation_min_imp(): number; - get_average_hr(): any; - get_average_temp(): any; - get_average_cadence(): any; - get_heartrate_data(): any; - get_heartrate_data_imp(): any; - get_cadence_data(): any; - get_temp_data(): any; - get_cadence_data_imp(): any; - get_temp_data_imp(): any; + get_average_hr(): number; + get_average_temp(): number; + get_average_cadence(): number; + get_heartrate_data(): Array<[number, number, string]>; + get_heartrate_data_imp(): Array<[number, number, string]>; + get_cadence_data(): Array<[number, number, string]>; + get_temp_data(): Array<[number, number, string]>; + get_cadence_data_imp(): Array<[number, number, string]>; + get_temp_data_imp(): Array<[number, number, string]>; reload(): void; } diff --git a/types/leaflet-gpx/leaflet-gpx-tests.ts b/types/leaflet-gpx/leaflet-gpx-tests.ts index 342d1d00d7..fa61696bb0 100644 --- a/types/leaflet-gpx/leaflet-gpx-tests.ts +++ b/types/leaflet-gpx/leaflet-gpx-tests.ts @@ -4,6 +4,7 @@ const osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; const osmAttrib = '© OpenStreetMap contributors'; const osm = L.tileLayer(osmUrl, { maxZoom: 18, attribution: osmAttrib }); const map = L.map('map', { layers: [osm], center: L.latLng(-37.7772, 175.2756), zoom: 15 }); + const gpx = new L.GPX( '\ { map.fitBounds(e.target.getBounds()); }).addTo(map); + +const durationString: string = gpx.get_duration_string(1000, true); +const durationStringIso: string = gpx.get_duration_string_iso(1000, true); +const miles: number = gpx.to_miles(1.5); +const feet: number = gpx.to_ft(1.5); +const km: number = gpx.m_to_km(1500); +const mi: number = gpx.m_to_mi(1500); + +const name: string = gpx.get_name(); +const desc: string = gpx.get_desc(); +const author: string = gpx.get_author(); +const copyright: string = gpx.get_copyright(); +const distance: number = gpx.get_distance(); +const distanceImp: number = gpx.get_distance_imp(); + +const startTime: Date = gpx.get_start_time(); +const endTime: Date = gpx.get_end_time(); +const movingTime: number = gpx.get_moving_time(); +const totalTime: number = gpx.get_total_time(); + +const movingPace: number = gpx.get_moving_pace(); +const movingPaceImp: number = gpx.get_moving_pace_imp(); + +const movingSpeed: number = gpx.get_moving_speed(); +const movingSpeedImp: number = gpx.get_moving_speed_imp(); + +const totalSpeed: number = gpx.get_total_speed(); +const totalSpeedImp: number = gpx.get_total_speed_imp(); + +const elevationGain: number = gpx.get_elevation_gain(); +const elevationLoss: number = gpx.get_elevation_loss(); +const elevationGainImp: number = gpx.get_elevation_gain_imp(); +const elevationLossImp: number = gpx.get_elevation_loss_imp(); +const elevationData = gpx.get_elevation_data(); +const firstElevationData = elevationData[0]; +const elevationDistance: number = firstElevationData[0]; +const elevationValue: number = firstElevationData[1]; +const elevationTooltip: string = firstElevationData[2]; +const elevationDataImp = gpx.get_elevation_data_imp(); +const firstElevationDataImp = elevationDataImp[0]; +const elevationDistanceImp: number = firstElevationDataImp[0]; +const elevationValueImp: number = firstElevationDataImp[1]; +const elevationTooltipImp: string = firstElevationDataImp[2]; +const elevationMax: number = gpx.get_elevation_max(); +const elevationMin: number = gpx.get_elevation_min(); +const elevationMaxImp: number = gpx.get_elevation_max_imp(); +const elevationMinImp: number = gpx.get_elevation_min_imp(); + +const averageHr: number = gpx.get_average_hr(); +const averageTemp: number = gpx.get_average_temp(); +const averageCadence: number = gpx.get_average_cadence(); +const heartrateData = gpx.get_heartrate_data(); +const firstHeartrateData = heartrateData[0]; +const heartrateDistance: number = firstHeartrateData[0]; +const heartrateValue: number = firstHeartrateData[1]; +const heartrateTooltip: string = firstHeartrateData[2]; +const heartrateDataImp = gpx.get_heartrate_data_imp(); +const firstHeartrateDataImp = heartrateDataImp[0]; +const heartrateDistanceImp: number = firstHeartrateDataImp[0]; +const heartrateValueImp: number = firstHeartrateDataImp[1]; +const heartrateTooltipImp: string = firstHeartrateDataImp[2]; +const tempData = gpx.get_temp_data(); +const firstTempData = tempData[0]; +const tempDistance: number = firstTempData[0]; +const tempValue: number = firstTempData[1]; +const tempTooltip: string = firstTempData[2]; +const tempDataImp = gpx.get_temp_data_imp(); +const firstTempDataImp = tempDataImp[0]; +const tempDistanceImp: number = firstTempDataImp[0]; +const tempValueImp: number = firstTempDataImp[1]; +const tempTooltipImp: string = firstTempDataImp[2]; +const cadenceData = gpx.get_cadence_data(); +const firstCadenceData = cadenceData[0]; +const cadenceDistance: number = firstCadenceData[0]; +const cadenceValue: number = firstCadenceData[1]; +const cadenceTooltip: string = firstCadenceData[2]; +const cadenceDataImp = gpx.get_cadence_data_imp(); +const firstCadenceDataImp = cadenceDataImp[0]; +const cadenceDistanceImp: number = firstCadenceDataImp[0]; +const cadenceValueImp: number = firstCadenceDataImp[1]; +const cadenceTooltipImp: string = firstCadenceDataImp[2]; + +gpx.reload(); From cf0ccd4511208373e6729bc64ce54ddf07e84830 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Sat, 21 Apr 2018 14:26:41 -0700 Subject: [PATCH 028/564] Use namespace with 'export =' to model self-referential chaining API in 'temp'. --- types/temp/index.d.ts | 71 ++++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/types/temp/index.d.ts b/types/temp/index.d.ts index 0a452a221b..eaf9adde66 100644 --- a/types/temp/index.d.ts +++ b/types/temp/index.d.ts @@ -5,41 +5,44 @@ /// -import * as temp from "."; import * as fs from "fs"; -export interface OpenFile { - path: string; - fd: number; +declare namespace temp { + export interface OpenFile { + path: string; + fd: number; + } + + export interface Stats { + files: number; + dirs: number; + } + + export interface AffixOptions { + prefix?: string; + suffix?: string; + dir?: string; + } + + export let dir: string; + + export function track(value?: boolean): typeof temp; + + export function mkdir(affixes?: string | AffixOptions, callback?: (err: any, dirPath: string) => void): void; + + export function mkdirSync(affixes?: string | AffixOptions): string; + + export function open(affixes?: string | AffixOptions, callback?: (err: any, result: OpenFile) => void): void; + + export function openSync(affixes?: string | AffixOptions): OpenFile; + + export function path(affixes?: string | AffixOptions, defaultPrefix?: string): string; + + export function cleanup(callback?: (result: boolean | Stats) => void): void; + + export function cleanupSync(): boolean | Stats; + + export function createWriteStream(affixes?: string | AffixOptions): fs.WriteStream; } -export interface Stats { - files: number; - dirs: number; -} - -export interface AffixOptions { - prefix?: string; - suffix?: string; - dir?: string; -} - -export let dir: string; - -export function track(value?: boolean): typeof temp; - -export function mkdir(affixes?: string | AffixOptions, callback?: (err: any, dirPath: string) => void): void; - -export function mkdirSync(affixes?: string | AffixOptions): string; - -export function open(affixes?: string | AffixOptions, callback?: (err: any, result: OpenFile) => void): void; - -export function openSync(affixes?: string | AffixOptions): OpenFile; - -export function path(affixes?: string | AffixOptions, defaultPrefix?: string): string; - -export function cleanup(callback?: (result: boolean | Stats) => void): void; - -export function cleanupSync(): boolean | Stats; - -export function createWriteStream(affixes?: string | AffixOptions): fs.WriteStream; +export = temp; From 526ca393cb2532ff562d9e8c48ae6c10ef59858f Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Sat, 21 Apr 2018 15:06:59 -0700 Subject: [PATCH 029/564] Fix lint nits. --- types/temp/index.d.ts | 26 +++++++++++++------------- types/temp/tslint.json | 1 + 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/types/temp/index.d.ts b/types/temp/index.d.ts index eaf9adde66..25a76ec47e 100644 --- a/types/temp/index.d.ts +++ b/types/temp/index.d.ts @@ -8,41 +8,41 @@ import * as fs from "fs"; declare namespace temp { - export interface OpenFile { + interface OpenFile { path: string; fd: number; } - export interface Stats { + interface Stats { files: number; dirs: number; } - export interface AffixOptions { + interface AffixOptions { prefix?: string; suffix?: string; dir?: string; } - export let dir: string; + let dir: string; - export function track(value?: boolean): typeof temp; + function track(value?: boolean): typeof temp; - export function mkdir(affixes?: string | AffixOptions, callback?: (err: any, dirPath: string) => void): void; + function mkdir(affixes?: string | AffixOptions, callback?: (err: any, dirPath: string) => void): void; - export function mkdirSync(affixes?: string | AffixOptions): string; + function mkdirSync(affixes?: string | AffixOptions): string; - export function open(affixes?: string | AffixOptions, callback?: (err: any, result: OpenFile) => void): void; + function open(affixes?: string | AffixOptions, callback?: (err: any, result: OpenFile) => void): void; - export function openSync(affixes?: string | AffixOptions): OpenFile; + function openSync(affixes?: string | AffixOptions): OpenFile; - export function path(affixes?: string | AffixOptions, defaultPrefix?: string): string; + function path(affixes?: string | AffixOptions, defaultPrefix?: string): string; - export function cleanup(callback?: (result: boolean | Stats) => void): void; + function cleanup(callback?: (result: boolean | Stats) => void): void; - export function cleanupSync(): boolean | Stats; + function cleanupSync(): boolean | Stats; - export function createWriteStream(affixes?: string | AffixOptions): fs.WriteStream; + function createWriteStream(affixes?: string | AffixOptions): fs.WriteStream; } export = temp; diff --git a/types/temp/tslint.json b/types/temp/tslint.json index 495d29983d..adaee1b55f 100644 --- a/types/temp/tslint.json +++ b/types/temp/tslint.json @@ -1,5 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { + "export-just-namespace": false } } From 54a59cd8f0bdbee257ada2716fdc1b7c94909c40 Mon Sep 17 00:00:00 2001 From: Alan Plum Date: Mon, 23 Apr 2018 17:00:09 +0200 Subject: [PATCH 030/564] [cors] Add delegate function and change owner (#25177) * Add cors delegate function * Remove Mihhail Lapushkin as per his wishes --- types/cors/cors-tests.ts | 7 +++++++ types/cors/index.d.ts | 13 ++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/types/cors/cors-tests.ts b/types/cors/cors-tests.ts index 83975549c7..ed4cd77213 100644 --- a/types/cors/cors-tests.ts +++ b/types/cors/cors-tests.ts @@ -47,4 +47,11 @@ app.use(cors({ } } })); +app.use(cors((req, cb) => { + if (req.query.trusted) { + cb(null, {origin: 'http://example.com', credentials: true}); + } else { + cb(new Error('Not trusted')); + } +})) diff --git a/types/cors/index.d.ts b/types/cors/index.d.ts index ab8ba2ed2d..bc7a567fc7 100644 --- a/types/cors/index.d.ts +++ b/types/cors/index.d.ts @@ -1,12 +1,9 @@ // Type definitions for cors 2.8 // Project: https://github.com/troygoode/node-cors/ -// Definitions by: Mihhail Lapushkin +// Definitions by: Alan Plum // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 - - - import express = require('express'); type CustomOrigin = ( @@ -25,7 +22,13 @@ declare namespace e { preflightContinue?: boolean; optionsSuccessStatus?: number; } + type CorsOptionsDelegate = ( + req: express.Request, + callback: (err: Error | null, options?: CorsOptions) => void + ) => void; } -declare function e(options?: e.CorsOptions): express.RequestHandler; +declare function e( + options?: e.CorsOptions | e.CorsOptionsDelegate +): express.RequestHandler; export = e; From 4411dfcac089a7bdb2259d195061af55813d5116 Mon Sep 17 00:00:00 2001 From: Zev Spitz Date: Wed, 25 Apr 2018 01:53:31 +0300 Subject: [PATCH 031/564] activex-msxml2: default properties (#25266) * Default properties * Reduce any * dtslint fixes * Replace IIFEs with blocks in tests * Deleted unneeded file --- types/activex-msxml2/activex-msxml2-tests.ts | 48 ++++++------- types/activex-msxml2/index.d.ts | 74 +++++++++----------- types/activex-msxml2/tslint.json | 3 +- 3 files changed, 61 insertions(+), 64 deletions(-) diff --git a/types/activex-msxml2/activex-msxml2-tests.ts b/types/activex-msxml2/activex-msxml2-tests.ts index a793c08db5..470f35d785 100644 --- a/types/activex-msxml2/activex-msxml2-tests.ts +++ b/types/activex-msxml2/activex-msxml2-tests.ts @@ -1,18 +1,18 @@ // https://msdn.microsoft.com/en-us/library/ms764708(v=vs.85).aspx -(() => { +{ const dom = new ActiveXObject('Msxml2.DOMDocument.6.0'); dom.async = false; dom.resolveExternals = false; dom.loadXML('A'); WScript.Echo(`dom: ${dom.xml}`); -})(); +} // https://msdn.microsoft.com/en-us/library/ms766390(v=vs.85).aspx -(() => { +{ const doc = new ActiveXObject('Msxml2.DOMDocument.6.0'); doc.load('test.xml'); WScript.Echo(`doc: ${doc.xml}`); -})(); +} const MakeDOM = () => { try { @@ -37,7 +37,7 @@ const LoadDOM = (file: string) => { }; // https://msdn.microsoft.com/en-us/library/ms759105(v=vs.85).aspx -(() => { +{ const doc = new ActiveXObject('Msxml2.DOMDocument.6.0'); doc.async = false; doc.resolveExternals = false; @@ -60,10 +60,10 @@ const LoadDOM = (file: string) => { `; doc.loadXML(xml); doc.save('saved.xml'); -})(); +} // https://msdn.microsoft.com/en-us/library/ms764656(v=vs.85).aspx -(() => { +{ const doc = LoadDOM('test.xml')!; const xsl = (LoadDOM('test.xsl')! as any) as MSXML2.IXMLDOMNode; @@ -73,10 +73,10 @@ const LoadDOM = (file: string) => { const out = MakeDOM()!; doc.transformNodeToObject(xsl, out); WScript.Echo('\ndoc.transformNodeToObject:\n' + out.xml); -})(); +} // https://msdn.microsoft.com/en-us/library/ms763685(v=vs.85).aspx -(() => { +{ const dom = MakeDOM()!; // Create a processing instruction targeted for xml. @@ -148,10 +148,10 @@ const LoadDOM = (file: string) => { // Save the XML document to a file. dom.save("dynamDom.xml"); -})(); +} // https://msdn.microsoft.com/en-us/library/ms757050(v=vs.85).aspx -(() => { +{ const dom = LoadDOM("stocks.xml")!; try { // Query a single node. @@ -172,17 +172,17 @@ const LoadDOM = (file: string) => { } catch (e) { WScript.Echo(e.description); } -})(); +} // https://msdn.microsoft.com/en-us/library/ms757064(v=vs.85).aspx -(() => { +{ const xhr = new ActiveXObject("Msxml2.XMLHTTP.6.0"); xhr.open("GET", "http://localhost/sxh/contact.asp?SearchID=John Doe", false); xhr.send(); const doc = xhr.responseXML; WScript.Echo(doc.xml); -})(); +} const xmlValidation = (fn: (x: MSXML2.DOMDocument60) => void) => { // Create and initialize the DOMDocument object @@ -212,16 +212,16 @@ ${x.xml} }; // https://msdn.microsoft.com/en-us/library/ms766449(v=vs.85).aspx -(() => { +{ const validateFile = (filename: string) => xmlValidation(x => x.load(filename)); let sOutput = validateFile("nn-valid.xml"); sOutput = sOutput + validateFile("nn-notValid.xml"); WScript.Echo(sOutput); -})(); +} // https://msdn.microsoft.com/en-us/library/ms767542(v=vs.85).aspx -(() => { +{ const validateFile = (filename: string) => xmlValidation(x => { // Configure DOM properties for namespace selection. x.setProperty("SelectionLanguage", "XPath"); @@ -235,10 +235,10 @@ ${x.xml} let sOutput = validateFile("sl-valid.xml"); sOutput = sOutput + validateFile("sl-notValid.xml"); WScript.Echo(sOutput); -})(); +} // https://msdn.microsoft.com/en-us/library/ms766439(v=vs.85).aspx -(() => { +{ const validateFile = (filename: string) => xmlValidation(xd => { // Create a schema cache and add books.xsd to it. const xs = new ActiveXObject('Msxml2.XMLSchemaCache'); @@ -253,10 +253,10 @@ ${x.xml} let sOutput = validateFile("sc-valid.xml"); sOutput = sOutput + validateFile("sc-notValid.xml"); WScript.Echo(sOutput); -})(); +} // https://msdn.microsoft.com/en-us/library/ms767636(v=vs.85).aspx -(() => { +{ const validateFile = (filename: string) => xmlValidation(x => { x.setProperty("UseInlineSchema", true); x.load(filename); @@ -265,10 +265,10 @@ ${x.xml} let sOutput = validateFile("valid.xml"); sOutput = sOutput + validateFile("notValid.xml"); WScript.Echo(sOutput); -})(); +} // https://msdn.microsoft.com/en-us/library/ms757833(v=vs.85).aspx -(() => { +{ // Load an XML document into a DOM instance. const oXMLDoc = LoadDOM("books.xml")!; @@ -326,4 +326,4 @@ ${oError.reason}`; } WScript.Echo(msg); } -})(); +} diff --git a/types/activex-msxml2/index.d.ts b/types/activex-msxml2/index.d.ts index 76dc3d9415..6f43ba02c5 100644 --- a/types/activex-msxml2/index.d.ts +++ b/types/activex-msxml2/index.d.ts @@ -424,7 +424,7 @@ declare namespace MSXML2 { createEntityReference(name: string): IXMLDOMEntityReference; /** create a node of the specified node type and name */ - createNode(type: any, name: string, namespaceURI: string): IXMLDOMNode; + createNode(type: DOMNodeType.NODE_ATTRIBUTE | DOMNodeType.NODE_CDATA_SECTION | DOMNodeType.NODE_COMMENT | DOMNodeType.NODE_DOCUMENT_FRAGMENT | DOMNodeType.NODE_TEXT | DOMNodeType.NODE_ELEMENT | DOMNodeType.NODE_ENTITY_REFERENCE | DOMNodeType.NODE_PROCESSING_INSTRUCTION, name: string, namespaceURI: string): IXMLDOMNode; /** create a processing instruction node */ createProcessingInstruction(target: string, data: string): IXMLDOMProcessingInstruction; @@ -433,7 +433,7 @@ declare namespace MSXML2 { createTextNode(data: string): IXMLDOMText; /** the data type of the node */ - dataType: any; + dataType: string | null; /** pointer to the definition of the node in the DTD or schema */ readonly definition: IXMLDOMNode; @@ -497,7 +497,7 @@ declare namespace MSXML2 { readonly nodeTypeString: string; /** value stored in the node */ - nodeValue: any; + nodeValue: string | null; /** register an ondataavailable event handler */ readonly ondataavailable: any; @@ -795,8 +795,7 @@ declare namespace MSXML2 { getAllResponseHeaders(ppwszHeaders: string): void; GetCookie(pwszUrl: string, pwszName: string, dwFlags: number, pcCookies: number, ppCookies: tagXHR_COOKIE): void; getResponseHeader(pwszHeader: string, ppwszValue: string): void; - open( - pwszMethod: string, pwszUrl: string, pStatusCallback: IXMLHTTPRequest2Callback, pwszUserName: string, pwszPassword: string, pwszProxyUserName: string, pwszProxyPassword: string): void; + open(pwszMethod: string, pwszUrl: string, pStatusCallback: IXMLHTTPRequest2Callback, pwszUserName: string, pwszPassword: string, pwszProxyUserName: string, pwszProxyPassword: string): void; send(pBody: ISequentialStream, cbBody: number): void; SetCookie(pCookie: tagXHR_COOKIE, pdwCookieState: number): void; SetCustomResponseStream(pSequentialStream: ISequentialStream): void; @@ -805,11 +804,11 @@ declare namespace MSXML2 { } /** IMXNamespacePrefixes interface */ - class IMXNamespacePrefixes { - private 'MSXML2.IMXNamespacePrefixes_typekey': IMXNamespacePrefixes; - private constructor(); + // tslint:disable-next-line:interface-name + interface IMXNamespacePrefixes { item(index: number): string; readonly length: number; + (index: number): string; } /** XML Schema */ @@ -848,21 +847,21 @@ declare namespace MSXML2 { } /** XML Schema Item Collection */ - class ISchemaItemCollection { - private 'MSXML2.ISchemaItemCollection_typekey': ISchemaItemCollection; - private constructor(); + // tslint:disable-next-line:interface-name + interface ISchemaItemCollection { item(index: number): ISchemaItem; itemByName(name: string): ISchemaItem; itemByQName(name: string, namespaceURI: string): ISchemaItem; readonly length: number; + (index: number): ISchemaItem; } /** XML Schema String Collection */ - class ISchemaStringCollection { - private 'MSXML2.ISchemaStringCollection_typekey': ISchemaStringCollection; - private constructor(); + // tslint:disable-next-line:interface-name + interface ISchemaStringCollection { item(index: number): string; readonly length: number; + (index: number): string; } class ISequentialStream { @@ -1960,10 +1959,8 @@ declare namespace MSXML2 { hasFeature(feature: string, version: string): boolean; } - class IXMLDOMNamedNodeMap { - private 'MSXML2.IXMLDOMNamedNodeMap_typekey': IXMLDOMNamedNodeMap; - private constructor(); - + // tslint:disable-next-line:interface-name + interface IXMLDOMNamedNodeMap { /** lookup item by name */ getNamedItem(name: string): IXMLDOMNode; @@ -1990,6 +1987,9 @@ declare namespace MSXML2 { /** set item by name */ setNamedItem(newItem: IXMLDOMNode): IXMLDOMNode; + + /** collection of nodes */ + (index: number): IXMLDOMNode; } /** Core DOM node interface */ @@ -2090,10 +2090,8 @@ declare namespace MSXML2 { readonly xml: string; } - class IXMLDOMNodeList { - private 'MSXML2.IXMLDOMNodeList_typekey': IXMLDOMNodeList; - private constructor(); - + // tslint:disable-next-line:interface-name + interface IXMLDOMNodeList { /** collection of nodes */ item(index: number): IXMLDOMNode; @@ -2105,6 +2103,9 @@ declare namespace MSXML2 { /** reset the position of iterator */ reset(): void; + + /** collection of nodes */ + (index: number): IXMLDOMNode; } /** structure for reporting parser errors */ @@ -2238,10 +2239,8 @@ declare namespace MSXML2 { } /** XML Schemas Collection */ - class IXMLDOMSchemaCollection { - private 'MSXML2.IXMLDOMSchemaCollection_typekey': IXMLDOMSchemaCollection; - private constructor(); - + // tslint:disable-next-line:interface-name + interface IXMLDOMSchemaCollection { /** add a new schema */ add(namespaceURI: string, var_1: any): void; @@ -2259,6 +2258,9 @@ declare namespace MSXML2 { /** remove schema by namespaceURI */ remove(namespaceURI: string): void; + + /** Get namespaceURI for schema by index */ + (index: number): string; } class IXMLDOMText { @@ -2403,7 +2405,7 @@ declare namespace MSXML2 { /** * set values - * @param string [namespaceURI=''] + * @param namespaceURI [namespaceURI='0'] */ addParameter(baseName: string, parameter: any, namespaceURI?: string): void; @@ -2424,7 +2426,7 @@ declare namespace MSXML2 { /** * set XSL mode and it's namespace - * @param string [namespaceURI=''] + * @param namespaceURI [namespaceURI='0'] */ setStartMode(mode: string, namespaceURI?: string): void; @@ -2487,7 +2489,7 @@ declare namespace MSXML2 { popContext(): void; pushContext(): void; - /** @param boolean [fDeep=true] */ + /** @param fDeep [fDeep=true] */ pushNodeContext(contextNode: IXMLDOMNode, fDeep?: boolean): void; reset(): void; } @@ -2730,10 +2732,7 @@ declare namespace MSXML2 { } /** XML Schema Cache 6.0 */ - class XMLSchemaCache60 { - private 'MSXML2.XMLSchemaCache60_typekey': XMLSchemaCache60; - private constructor(); - + interface XMLSchemaCache60 { /** add a new schema */ add(namespaceURI: string, var_1: any): void; @@ -2755,6 +2754,9 @@ declare namespace MSXML2 { remove(namespaceURI: string): void; validate(): void; validateOnLoad: boolean; + + /** Get namespaceURI for schema by index */ + (index: number): string; } /** XSL Stylesheet Cache 6.0 */ @@ -2787,12 +2789,6 @@ interface ActiveXObjectNameMap { 'Msxml2.SAXXMLReader': MSXML2.SAXXMLReader60; 'Msxml2.ServerXMLHTTP': MSXML2.ServerXMLHTTP60; 'Msxml2.XMLHTTP': MSXML2.XMLHTTP60; - 'Msxml2.XMLHTTP.6.0': MSXML2.XMLHTTP60; 'Msxml2.XMLSchemaCache': MSXML2.XMLSchemaCache60; - 'Msxml2.XMLSchemaCache.6.0': MSXML2.XMLSchemaCache60; 'Msxml2.XSLTemplate': MSXML2.XSLTemplate60; } - -interface SafeArray { - _brand: SafeArray; -} diff --git a/types/activex-msxml2/tslint.json b/types/activex-msxml2/tslint.json index 3224b40b8b..7b89accc6d 100644 --- a/types/activex-msxml2/tslint.json +++ b/types/activex-msxml2/tslint.json @@ -1,6 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - "no-const-enum": false + "no-const-enum": false, + "max-line-length": false } } From 482390bbe7ad17f916bea462f354a7477a87906b Mon Sep 17 00:00:00 2001 From: Jan Lohage Date: Wed, 25 Apr 2018 00:53:53 +0200 Subject: [PATCH 032/564] Update index.d.ts (#25260) --- types/feathersjs__errors/index.d.ts | 32 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/types/feathersjs__errors/index.d.ts b/types/feathersjs__errors/index.d.ts index 9eacd9ce7e..056acff676 100644 --- a/types/feathersjs__errors/index.d.ts +++ b/types/feathersjs__errors/index.d.ts @@ -9,67 +9,67 @@ export class FeathersError extends Error { } export class BadRequest extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class NotAuthenticated extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class PaymentError extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class Forbidden extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class NotFound extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class MethodNotAllowed extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class NotAcceptable extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class Timeout extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class Conflict extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class LengthRequired extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class Unprocessable extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class TooManyRequests extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class GeneralError extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class NotImplemented extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class BadGateway extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export class Unavailable extends FeathersError { - constructor(msg: string | Error, data?: any); + constructor(msg?: string | Error, data?: any); } export interface Errors { From 2f5d1477b95df0eb40558898f9abe4f9a66e0b77 Mon Sep 17 00:00:00 2001 From: denisname Date: Wed, 25 Apr 2018 00:54:31 +0200 Subject: [PATCH 033/564] Chosen.js update types for v1.8.5 (#25238) Add new options: group_search, hide_results_on_select, rtl Activate `strictNullChecks` Remove colon after `@default` Add jsDoc to `on` and `trigger` function Add line return before jsDoc first line Remove all exception rules to tslint (unified-signatures, max-line-length) --- types/chosen-js/chosen-js-tests.ts | 17 ++-- types/chosen-js/index.d.ts | 128 ++++++++++++++++++++--------- types/chosen-js/tsconfig.json | 2 +- types/chosen-js/tslint.json | 78 +----------------- 4 files changed, 104 insertions(+), 121 deletions(-) diff --git a/types/chosen-js/chosen-js-tests.ts b/types/chosen-js/chosen-js-tests.ts index 575b7503ea..811ff4994b 100644 --- a/types/chosen-js/chosen-js-tests.ts +++ b/types/chosen-js/chosen-js-tests.ts @@ -1,5 +1,3 @@ - - // Options $(".my_select_box").chosen(); @@ -12,14 +10,23 @@ $(".my_select_box").chosen({ width: "95%" }); +$(".chosen-select").chosen({ + rtl: true +}); + // Destroy $(".my_select_box").chosen("destroy"); // Triggered Events -$(".my_select_box").on("change", function(evt, params) { +$(".my_select_box").on("change", (evt, params) => { evt.preventDefault(); - let s = params.selected; - console.log(s); + const s: string = params.selected; + const d: string = params.deselected; + console.log(s, d); +}); + +$(".chosen-select").on("chosen:maxselected", () => { + alert("Max selected"); }); // Triggerable Events diff --git a/types/chosen-js/index.d.ts b/types/chosen-js/index.d.ts index c9a5556c26..e9a67550db 100644 --- a/types/chosen-js/index.d.ts +++ b/types/chosen-js/index.d.ts @@ -1,9 +1,11 @@ -// Type definitions for Chosen.JQuery 1.6.1 +// Type definitions for Chosen 1.8 // Project: http://harvesthq.github.com/chosen/ -// Definitions by: Boris Yankov , denis +// Definitions by: Boris Yankov , denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 +// Validated against Chosen version 1.8.5 + /// declare namespace Chosen { @@ -11,71 +13,107 @@ declare namespace Chosen { type TriggerEvent = "chosen:updated" | "chosen:activate" | "chosen:open" | "chosen:close"; interface Options { - /**When set to true on a single select, Chosen adds a UI element which selects the first element (if it is blank). - * @default: false + /** + * When set to true on a single select, Chosen adds a UI element which selects the first element (if it is blank). + * @default false */ allow_single_deselect?: boolean; - /**By default Chosen's search is case-insensitive. Setting this option to true makes the search case-sensitive. - * @default: false + /** + * By default, Chosen's search is case-insensitive. Setting this option to true makes the search case-sensitive. + * @default false */ case_sensitive_search?: boolean; - /**When set to true, Chosen will not display the search field (single selects only). - * @default: false + /** + * When set to true, Chosen will not display the search field (single selects only). + * @default false */ disable_search?: boolean; - /**Hide the search input on single selects if there are n or fewer options. - * @default: 0 + /** + * Hide the search input on single selects if there are n or fewer options. + * @default 0 */ disable_search_threshold?: number; - /**By default, searching will match on any word within an option tag. Set this option to false if you want to only match on the entire text of an option tag. - * @default: true + /** + * By default, searching will match on any word within an option tag. Set this option to false if you want to only match on the entire text of an option tag. + * @default true */ enable_split_word_search?: boolean; - /**When set to true, Chosen will grab any classes on the original select field and add them to Chosen’s container div. - * @default: false + /** + * By default, Chosen will search group labels as well as options, and filter to show all options below matching groups. Set this to false to search only in the options. + * @default true + */ + group_search?: boolean; + /** + * By default, Chosen's results are hidden after a option is selected. Setting this option to false will keep the results open after selection. This only applies to multiple selects. + * @default true + */ + hide_results_on_select?: boolean; + /** + * When set to true, Chosen will grab any classes on the original select field and add them to Chosen’s container div. + * @default false */ inherit_select_classes?: boolean; - /**Limits how many options the user can select. When the limit is reached, the chosen:maxselected event is triggered. - * @default: Infinity + /** + * Limits how many options the user can select. When the limit is reached, the `chosen:maxselected` event is triggered. + * @default Infinity */ max_selected_options?: number; - /**The text to be displayed when no matching results are found. The current search is shown at the end of the text (e.g., No results match "Bad Search"). - * @default: "No results match" + /** + * The text to be displayed when no matching results are found. The current search is shown at the end of the text (e.g., No results match "Bad Search"). + * @default "No results match" */ no_results_text?: string; - /**The text to be displayed as a placeholder when no options are selected for a multiple select. - * @default: "Select Some Options" + /** + * The text to be displayed as a placeholder when no options are selected for a multiple select. + * @default "Select Some Options" */ placeholder_text_multiple?: string; - /**The text to be displayed as a placeholder when no options are selected for a single select. - * @default: "Select an Option" + /** + * The text to be displayed as a placeholder when no options are selected for a single select. + * @default "Select an Option" */ placeholder_text_single?: string; - /**By default, Chosen’s search matches starting at the beginning of a word. Setting this option to true allows matches starting from anywhere within a word. This is especially useful for options that include a lot of special characters or phrases in ()s and []s. - * @default: false + /** + * Chosen supports right-to-left text in select boxes. Set this option to true to support right-to-left text options. + * @default false + */ + rtl?: boolean; + /** + * By default, Chosen’s search matches starting at the beginning of a word. Setting this option to true allows matches starting from anywhere within a word. + * This is especially useful for options that include a lot of special characters or phrases in ()s and []s. + * @default false */ search_contains?: boolean; - /**By default, pressing delete/backspace on multiple selects will remove a selected choice. When false, pressing delete/backspace will highlight the last choice, and a second press deselects it. - * @default: true + /** + * By default, pressing delete/backspace on multiple selects will remove a selected choice. + * When false, pressing delete/backspace will highlight the last choice, and a second press deselects it. + * @default true */ single_backstroke_delete?: boolean; - /**The width of the Chosen select box. By default, Chosen attempts to match the width of the select box you are replacing. If your select is hidden when Chosen is instantiated, you must specify a width or the select will show up with a width of 0. */ + /** + * The width of the Chosen select box. By default, Chosen attempts to match the width of the select box you are replacing. + * If your select is hidden when Chosen is instantiated, you must specify a width or the select will show up with a width of 0. + */ width?: string; - /**By default, Chosen includes disabled options in search results with a special styling. Setting this option to false will hide disabled results and exclude them from searches. - * @default: true + /** + * By default, Chosen includes disabled options in search results with a special styling. Setting this option to false will hide disabled results and exclude them from searches. + * @default true */ display_disabled_options?: boolean; - /**By default, Chosen includes selected options in search results with a special styling. Setting this option to false will hide selected results and exclude them from searches. + /** + * By default, Chosen includes selected options in search results with a special styling. Setting this option to false will hide selected results and exclude them from searches. * Note: this is for multiple selects only. In single selects, the selected result will always be displayed. - * @default: true + * @default true */ display_selected_options?: boolean; - /**By default, Chosen only shows the text of a selected option. Setting this option to true will show the text and group (if any) of the selected option. - * @default: false + /** + * By default, Chosen only shows the text of a selected option. Setting this option to true will show the text and group (if any) of the selected option. + * @default false */ include_group_label_in_selected?: boolean; - /**Only show the first (n) matching options in the results. This can be used to increase performance for selects with very many options. - * @default: Infinity + /** + * Only show the first (n) matching options in the results. This can be used to increase performance for selects with very many options. + * @default Infinity */ max_shown_results?: number; } @@ -87,13 +125,27 @@ declare namespace Chosen { } interface JQuery { - chosen(): JQuery; - chosen(options: Chosen.Options | "destroy"): JQuery; + chosen(options?: Chosen.Options | "destroy"): JQuery; - /**Chosen triggers the standard DOM event whenever a selection is made (it also sends a selected or deselected parameter that tells you which option was changed). */ + /** + * Chosen triggers the standard DOM event whenever a selection is made (it also sends a selected or deselected parameter that tells you which option was changed). + */ on(events: "change", handler: (eventObject: JQueryEventObject, args: Chosen.SelectedData) => any): JQuery; + /** + * * `chosen:ready` Triggered after Chosen has been fully instantiated. + * * `chosen:maxselected` Triggered if max_selected_options is set and that total is broken. + * * `chosen:showing_dropdown` Triggered when Chosen’s dropdown is opened. + * * `chosen:hiding_dropdown` Triggered when Chosen’s dropdown is closed. + * * `chosen:no_results` Triggered when a search returns no matching results. + */ on(events: Chosen.OnEvent, handler: (eventObject: JQueryEventObject) => any): JQuery; + /** + * * `chosen:updated` This event should be triggered whenever Chosen’s underlying select element changes (such as a change in selected options). + * * `chosen:activate` This is the equivalant of focusing a standard HTML select field. When activated, Chosen will capure keypress events as if you had clicked the field directly. + * * `chosen:open` This event activates Chosen and also displays the search results. + * * `chosen:close` This event deactivates Chosen and hides the search results. + */ trigger(eventType: Chosen.TriggerEvent): JQuery; } diff --git a/types/chosen-js/tsconfig.json b/types/chosen-js/tsconfig.json index 9f4ce049cb..93360e6201 100644 --- a/types/chosen-js/tsconfig.json +++ b/types/chosen-js/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/chosen-js/tslint.json b/types/chosen-js/tslint.json index a41bf5d19a..f93cf8562a 100644 --- a/types/chosen-js/tslint.json +++ b/types/chosen-js/tslint.json @@ -1,79 +1,3 @@ { - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } + "extends": "dtslint/dt.json" } From eb895995a75491a41804373a28855d34ca1bf9d9 Mon Sep 17 00:00:00 2001 From: Fernando Alex Helwanger Date: Tue, 24 Apr 2018 19:55:02 -0300 Subject: [PATCH 034/564] Fix reverseGeocodeAsync return type (#25233) --- types/expo/expo-tests.tsx | 8 +++++++- types/expo/index.d.ts | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/types/expo/expo-tests.tsx b/types/expo/expo-tests.tsx index d1b543c591..c40b76d93d 100644 --- a/types/expo/expo-tests.tsx +++ b/types/expo/expo-tests.tsx @@ -30,9 +30,15 @@ import { ScreenOrientation, SQLite, Calendar, - MailComposer + MailComposer, + Location } from 'expo'; +const reverseGeocode: Promise = Location.reverseGeocodeAsync({ + latitude: 0, + longitude: 0 +}); + Accelerometer.addListener((obj) => { obj.x; obj.y; diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index 8e35cb8631..3726249cc7 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -1622,7 +1622,7 @@ export namespace Location { function getHeadingAsync(): Promise; function watchHeadingAsync(callback: (status: HeadingStatus) => void): EventSubscription; function geocodeAsync(address: string): Promise; - function reverseGeocodeAsync(location: LocationProps): Promise; + function reverseGeocodeAsync(location: LocationProps): Promise; function setApiKey(key: string): void; } From cfe11e8e8360f1154258aa67a0b114cbe08b538a Mon Sep 17 00:00:00 2001 From: Bryan Hughes Date: Tue, 24 Apr 2018 15:55:57 -0700 Subject: [PATCH 035/564] Updated various raspi-* modules to pull in breaking changes (#25203) --- types/raspi-board/index.d.ts | 3 ++- types/raspi-gpio/index.d.ts | 2 +- types/raspi-i2c/index.d.ts | 2 +- types/raspi-pwm/index.d.ts | 2 +- types/raspi-serial/index.d.ts | 2 +- types/raspi-soft-pwm/index.d.ts | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/types/raspi-board/index.d.ts b/types/raspi-board/index.d.ts index a244577c2b..5347c58e7f 100644 --- a/types/raspi-board/index.d.ts +++ b/types/raspi-board/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for raspi-board 5.0 +// Type definitions for raspi-board 5.2 // Project: https://github.com/nebrius/raspi-board // Definitions by: Bryan Hughes // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -13,6 +13,7 @@ export const VERSION_1_MODEL_ZERO = "rpi1_zero"; export const VERSION_1_MODEL_ZERO_W = "rpi1_zerow"; export const VERSION_2_MODEL_B = "rpi2_b"; export const VERSION_3_MODEL_B = "rpi3_b"; +export const VERSION_3_MODEL_B_PLUS = "rpi3_bplus"; export const VERSION_UNKNOWN = "unknown"; export interface PinInfo { pins: string[]; diff --git a/types/raspi-gpio/index.d.ts b/types/raspi-gpio/index.d.ts index 4daf607b87..60c0c125c1 100644 --- a/types/raspi-gpio/index.d.ts +++ b/types/raspi-gpio/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for raspi-gpio 5.0 +// Type definitions for raspi-gpio 6.0 // Project: https://github.com/nebrius/raspi-gpio // Definitions by: Bryan Hughes // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/raspi-i2c/index.d.ts b/types/raspi-i2c/index.d.ts index ce71190055..317a34f311 100644 --- a/types/raspi-i2c/index.d.ts +++ b/types/raspi-i2c/index.d.ts @@ -12,7 +12,6 @@ export class I2C extends Peripheral { private _devices; constructor(); destroy(): void; - private _getDevice(address); read(address: number, length: number, cb: ReadCallback): void; read(address: number, register: number, length: number, cb: ReadCallback): void; readSync(address: number, registerOrLength: number | undefined, length?: number): Buffer; @@ -32,4 +31,5 @@ export class I2C extends Peripheral { writeWord(address: number, word: number, cb?: WriteCallback): void; writeWord(address: number, register: number, word: number, cb?: WriteCallback): void; writeWordSync(address: number, registerOrWord: number, word?: number): void; + private _getDevice(address); } diff --git a/types/raspi-pwm/index.d.ts b/types/raspi-pwm/index.d.ts index 42c122c75d..aa6b5e4774 100644 --- a/types/raspi-pwm/index.d.ts +++ b/types/raspi-pwm/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for raspi-pwm 5.0 +// Type definitions for raspi-pwm 6.0 // Project: https://github.com/nebrius/raspi-pwm // Definitions by: Bryan Hughes // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/raspi-serial/index.d.ts b/types/raspi-serial/index.d.ts index 033c0682c3..c26b9a6852 100644 --- a/types/raspi-serial/index.d.ts +++ b/types/raspi-serial/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for raspi-serial 4.0 +// Type definitions for raspi-serial 5.0 // Project: https://github.com/nebrius/raspi-serial // Definitions by: Bryan Hughes // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/types/raspi-soft-pwm/index.d.ts b/types/raspi-soft-pwm/index.d.ts index 098cf9aff7..3e3296d979 100644 --- a/types/raspi-soft-pwm/index.d.ts +++ b/types/raspi-soft-pwm/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for raspi-soft-pwm 4.0 +// Type definitions for raspi-soft-pwm 5.0 // Project: https://github.com/nebrius/raspi-soft-pwm // Definitions by: Bryan Hughes // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From c8ca0b5b8f028bc158fd380c8f65135c48576dc6 Mon Sep 17 00:00:00 2001 From: Dolan Date: Tue, 24 Apr 2018 23:56:52 +0100 Subject: [PATCH 036/564] Jsforce updates (#25152) * Add bulk, batch and job and clean up * Add streaming api * Put test dependencies into test file * Update OAuth2 typings * Fix linting * Add Bulk and Streaming tests * Fix linting * Fix lint rules for new dtslinter * Make Id optional * Make T any by default * Set callbacks to have Error as first argument * Remove blank interface * Clean up and remove unused and duplicated typings * Sort exports --- types/jsforce/api/analytics.d.ts | 53 +++++++++++++--------------- types/jsforce/api/chatter.d.ts | 16 ++++----- types/jsforce/api/metadata.d.ts | 46 ++++++++++++------------ types/jsforce/batch.d.ts | 26 ++++++++++++++ types/jsforce/bulk.d.ts | 31 ++++++++++++++++ types/jsforce/channel.d.ts | 5 +++ types/jsforce/connection.d.ts | 29 ++++++++------- types/jsforce/index.d.ts | 39 ++++++++++---------- types/jsforce/job.d.ts | 24 +++++++++++++ types/jsforce/jsforce-tests.ts | 50 +++++++++++++++++++++++--- types/jsforce/oauth2.d.ts | 22 +++++++----- types/jsforce/record.d.ts | 8 +++-- types/jsforce/salesforce-object.d.ts | 17 +-------- types/jsforce/streaming.d.ts | 23 ++++++++++++ types/jsforce/topic.d.ts | 8 +++++ types/jsforce/tsconfig.json | 10 +----- 16 files changed, 273 insertions(+), 134 deletions(-) create mode 100644 types/jsforce/batch.d.ts create mode 100644 types/jsforce/bulk.d.ts create mode 100644 types/jsforce/channel.d.ts create mode 100644 types/jsforce/job.d.ts create mode 100644 types/jsforce/streaming.d.ts create mode 100644 types/jsforce/topic.d.ts diff --git a/types/jsforce/api/analytics.d.ts b/types/jsforce/api/analytics.d.ts index 02f04fac41..09784acfed 100644 --- a/types/jsforce/api/analytics.d.ts +++ b/types/jsforce/api/analytics.d.ts @@ -1,64 +1,59 @@ -import { callback } from '../connection'; - -interface ReportInfo { -} +import { Callback } from '../connection'; +import { ExplainInfo } from '../query'; export class Dashboard { - describe(callback?: callback): Promise; + describe(callback?: Callback): Promise; - del(callback?: callback): Promise; + del(callback?: Callback): Promise; - destory(callback?: callback): Promise; + destory(callback?: Callback): Promise; - delete(callback?: callback): Promise; + delete(callback?: Callback): Promise; - components(componentIds: () => any | string[] | string, callback?: callback): Promise; + components(componentIds: () => any | string[] | string, callback?: Callback): Promise; - status(callback?: callback): Promise; + status(callback?: Callback): Promise; - refresh(callback?: callback): Promise; + refresh(callback?: Callback): Promise; - clone(name: string | object, folderid: string, callback?: callback): Promise; + clone(name: string | object, folderid: string, callback?: Callback): Promise; } export class ReportInstance { constructor(report: Report, id: string); - retrieve(callback: callback): Promise + retrieve(callback: Callback): Promise } export class Report { - describe(callback?: callback): Promise; + describe(callback?: Callback): Promise; - del(callback?: callback): Promise; + del(callback?: Callback): Promise; - destory(callback?: callback): Promise; + destory(callback?: Callback): Promise; - delete(callback?: callback): Promise; + delete(callback?: Callback): Promise; - clone(name: string, callback?: callback): Promise; + clone(name: string, callback?: Callback): Promise; - explain(callback?: callback): Promise; + explain(callback?: Callback): Promise; - run(options: () => any | object, callback?: callback): Promise; + run(options: () => any | object, callback?: Callback): Promise; - exec(options: () => any | object, callback?: callback): Promise; + exec(options: () => any | object, callback?: Callback): Promise; - execute(options: () => any | object, callback?: callback): Promise; + execute(options: () => any | object, callback?: Callback): Promise; - executeAsync(options: () => any | object, callback?: callback): Promise; + executeAsync(options: () => any | object, callback?: Callback): Promise; instance(id: string): ReportInstance; - instances(callback?: callback): Promise; + instances(callback?: Callback): Promise; } export interface ReportInstanceAttrs { } -export interface ExplainInfo { -} - export interface ReportMetadata { } @@ -74,9 +69,9 @@ export interface DashboardInfo { export class Analytics { report(id: string): Promise; - reports(callback?: callback): Promise; + reports(callback?: Callback): Promise; dashboard(id: string): Promise; - dashboards(callback?: callback): Promise; + dashboards(callback?: Callback): Promise; } diff --git a/types/jsforce/api/chatter.d.ts b/types/jsforce/api/chatter.d.ts index 05fc4551e0..4e0982ca24 100644 --- a/types/jsforce/api/chatter.d.ts +++ b/types/jsforce/api/chatter.d.ts @@ -1,4 +1,4 @@ -import { Connection, callback } from '../connection'; +import { Connection, Callback } from '../connection'; import { Query } from '../query'; import { Stream } from 'stream'; @@ -49,23 +49,23 @@ export class Request implements Promise { export class Resource extends Request { constructor(chatter: Chatter, url: string, queryParams?: object); - create(data: object | string, callback?: callback): Request; + create(data: object | string, callback?: Callback): Request; - del(callback?: callback): Request; + del(callback?: Callback): Request; - delete(callback?: callback): Request; + delete(callback?: Callback): Request; - retrieve(callback?: callback): Request; + retrieve(callback?: Callback): Request; - update(data: object, callback?: callback): Request; + update(data: object, callback?: Callback): Request; } export class Chatter { constructor(conn: Connection); - batch(callback?: callback): Promise; + batch(callback?: Callback): Promise; - request(params: RequestParams, callback?: callback>): Request; + request(params: RequestParams, callback?: Callback>): Request; resource(url: string, queryParams?: object): Resource } diff --git a/types/jsforce/api/metadata.d.ts b/types/jsforce/api/metadata.d.ts index c867ece15b..15f0fe249e 100644 --- a/types/jsforce/api/metadata.d.ts +++ b/types/jsforce/api/metadata.d.ts @@ -1,4 +1,4 @@ -import { callback, Connection } from '../connection'; +import { Callback, Connection } from '../connection'; import { EventEmitter } from 'events'; import { Stream } from 'stream'; @@ -113,9 +113,9 @@ interface DeployOptions { } export class AsyncResultLocator extends EventEmitter implements Promise { - check(callback?: callback): Promise + check(callback?: Callback): Promise - complete(callback?: callback): Promise + complete(callback?: Callback): Promise poll(interval: number, timeout: number): void; @@ -136,43 +136,43 @@ export class Metadata { constructor(conn: Connection); - checkDeployStatus(id: string, includeDetails?: boolean, callback?: callback): Promise + checkDeployStatus(id: string, includeDetails?: boolean, callback?: Callback): Promise - checkRetrieveStatus(id: string, callback?: callback): Promise + checkRetrieveStatus(id: string, callback?: Callback): Promise - checkStatus(ids: string | string[], callback?: callback>): AsyncResultLocator> + checkStatus(ids: string | string[], callback?: Callback>): AsyncResultLocator> - create(type: string, metadata: MetadataInfo | Array, callback?: callback>): Promise> + create(type: string, metadata: MetadataInfo | Array, callback?: Callback>): Promise> - createAsync(type: string, metadata: MetadataInfo | Array, callback?: callback>): Promise> + createAsync(type: string, metadata: MetadataInfo | Array, callback?: Callback>): Promise> - createSync(type: string, metadata: MetadataInfo | Array, callback?: callback>): Promise>; + createSync(type: string, metadata: MetadataInfo | Array, callback?: Callback>): Promise>; - delete(type: string, fullNames: string | string[], callback?: callback>): Promise>; + delete(type: string, fullNames: string | string[], callback?: Callback>): Promise>; - deleteAsync(type: string, metadata: string | string[] | MetadataInfo | Array, callback?: callback>): AsyncResultLocator> + deleteAsync(type: string, metadata: string | string[] | MetadataInfo | Array, callback?: Callback>): AsyncResultLocator> - deleteSync(type: string, fullNames: string | string[], callback?: callback>): Promise>; + deleteSync(type: string, fullNames: string | string[], callback?: Callback>): Promise>; - deploy(zipInput: Stream | Buffer | string, options: DeployOptions, callback?:callback): DeployResultLocator; + deploy(zipInput: Stream | Buffer | string, options: DeployOptions, callback?:Callback): DeployResultLocator; - describe(version?: string, callback?: callback): Promise; + describe(version?: string, callback?: Callback): Promise; - list(queries: ListMetadataQuery | Array, version?: string, callback?: callback>): Promise>; + list(queries: ListMetadataQuery | Array, version?: string, callback?: Callback>): Promise>; - read(type: string, fullNames: string | string[], callback?: callback>): Promise>; + read(type: string, fullNames: string | string[], callback?: Callback>): Promise>; - readSync(type: string, fullNames: string | string[], callback?: callback>): Promise>; + readSync(type: string, fullNames: string | string[], callback?: Callback>): Promise>; - rename(type: string, oldFullName: string, newFullName: string, callback?: callback): Promise + rename(type: string, oldFullName: string, newFullName: string, callback?: Callback): Promise - retrieve(request: RetrieveRequest, callback: callback): RetrieveResultLocator + retrieve(request: RetrieveRequest, callback: Callback): RetrieveResultLocator - update(type: string, updateMetadata: MetadataInfo | Array, callback?: callback>): Promise> + update(type: string, updateMetadata: MetadataInfo | Array, callback?: Callback>): Promise> - updateAsync(type: string, updateMetadata: MetadataInfo, callback?: callback>): AsyncResultLocator> + updateAsync(type: string, updateMetadata: MetadataInfo, callback?: Callback>): AsyncResultLocator> - updateSync(type: string, updateMetadata: MetadataInfo | Array, callback?: callback>): Promise> + updateSync(type: string, updateMetadata: MetadataInfo | Array, callback?: Callback>): Promise> - upsert(type: string, metadata: MetadataInfo | Array, callback?: callback>): Promise> + upsert(type: string, metadata: MetadataInfo | Array, callback?: Callback>): Promise> } diff --git a/types/jsforce/batch.d.ts b/types/jsforce/batch.d.ts new file mode 100644 index 0000000000..94a24fa2cd --- /dev/null +++ b/types/jsforce/batch.d.ts @@ -0,0 +1,26 @@ +import { Stream, Writable } from 'stream'; + +import { RecordResult } from './record-result'; +import { Record } from './record'; + +export interface BatchInfo { + id: string; + jobId: string; + state: string; + stateMessage: string; +} + +export interface BatchResultInfo { + id: string; + batchId: string; + jobId: string; +} + +export class Batch extends Writable { + check(callback?: (batchInfo: BatchInfo) => void): Promise; + execute(input?: Record[] | Stream | string, callback?: (err: Error, result: RecordResult[] | BatchResultInfo[]) => void): Batch; + poll(interval: number, timeout: number): void; + retrieve(callback?: (batchInfo: BatchInfo) => void): Promise; + then(): Promise; + thenAll(callback: (data: any) => void): void; +} diff --git a/types/jsforce/bulk.d.ts b/types/jsforce/bulk.d.ts new file mode 100644 index 0000000000..51708f59f1 --- /dev/null +++ b/types/jsforce/bulk.d.ts @@ -0,0 +1,31 @@ +import { Stream } from 'stream'; + +import { Connection } from './connection'; +import { RecordResult } from './record-result'; +import { Record } from './record'; +import { Job } from './job'; +import { Batch, BatchResultInfo } from './batch'; + +export interface BulkOptions { + extIdField: string; + concurrencyMode: 'Serial' | 'Parallel'; +} + +type BulkLoadOperation = + | 'insert' + | 'update' + | 'upsert' + | 'delete' + | 'hardDelete'; + +export class Bulk { + constructor(connection: Connection); + + pollInterval: number; + pollTimeout: number; + + createJob(type: string, operation: string, options?: BulkOptions): Job; + job(id: string): Job; + load(type: string, operation: BulkLoadOperation, options?: BulkOptions, input?: Record[] | Stream | string, callback?: (err: Error, result: RecordResult[] | BatchResultInfo[]) => void): Batch; + query(soql: string): any; +} diff --git a/types/jsforce/channel.d.ts b/types/jsforce/channel.d.ts new file mode 100644 index 0000000000..a290c04d88 --- /dev/null +++ b/types/jsforce/channel.d.ts @@ -0,0 +1,5 @@ +import { Streaming } from "./streaming"; + +export class Channel { + constructor(streaming: Streaming, name: string); +} diff --git a/types/jsforce/connection.d.ts b/types/jsforce/connection.d.ts index 06cda5e29f..2283320912 100644 --- a/types/jsforce/connection.d.ts +++ b/types/jsforce/connection.d.ts @@ -7,12 +7,14 @@ import { SObject } from './salesforce-object'; import { Analytics } from './api/analytics'; import { Chatter } from './api/chatter'; import { Metadata } from './api/metadata'; +import { Bulk } from './bulk'; +import { OAuth2, Streaming } from '.'; -export type callback = (err: Error, result: T) => void; +export type Callback = (err: Error, result: T) => void; // These are pulled out because according to http://jsforce.github.io/jsforce/doc/connection.js.html#line49 // the oauth options can either be in the `oauth2` proeprty OR spread across the main connection -export interface OAuth2Options { +export interface PartialOAuth2Options { clientId?: string; clientSecret?: string; loginUrl?: string; @@ -25,14 +27,14 @@ export interface RequestInfo { headers?: object; } -export interface ConnectionOptions extends OAuth2Options { +export interface ConnectionOptions extends PartialOAuth2Options { accessToken?: string; callOptions?: Object; instanceUrl?: string; loginUrl?: string; logLevel?: string; maxRequest?: number; - oauth2?: Partial; + oauth2?: Partial; proxyUrl?: string; redirectUri?: string; refreshToken?: string; @@ -82,21 +84,21 @@ export abstract class BaseConnection extends EventEmitter { request(info: RequestInfo | string, options?: Object, callback?: (err: Error, Object: object) => void): Promise; query(soql: string, callback?: (err: Error, result: QueryResult) => void): Query>; queryMore(locator: string, options?: object, callback?: (err: Error, result: QueryResult) => void): Promise>; - create(type: string, records: Record|Array>, options?: Object, + create(type: string, records: Record | Array>, options?: Object, callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; - insert(type: string, records: Record|Array>, options?: Object, + insert(type: string, records: Record | Array>, options?: Object, callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; - retrieve(type: string, ids: string|string[], options?: Object, + retrieve(type: string, ids: string | string[], options?: Object, callback?: (err: Error, result: Record | Array>) => void): Promise<(Record | Array>)>; - update(type: string, records: Record|Array>, options?: Object, + update(type: string, records: Record | Array>, options?: Object, callback?: (err: Error, result: RecordResult | Array>) => void): Promise<(RecordResult | RecordResult[])>; - upsert(type: string, records: Record|Array>, extIdField: string, options?: Object, + upsert(type: string, records: Record | Array>, extIdField: string, options?: Object, callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; - del(type: string, ids: string|string[], options?: Object, + del(type: string, ids: string | string[], options?: Object, callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; - delete(type: string, ids: string|string[], options?: Object, + delete(type: string, ids: string | string[], options?: Object, callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; - destroy(type: string, ids: string|string[], options?: Object, + destroy(type: string, ids: string | string[], options?: Object, callback?: (err: Error, result: RecordResult | RecordResult[]) => void): Promise<(RecordResult | RecordResult[])>; describe(type: string, callback?: (err: Error, result: DescribeSObjectResult) => void): Promise; describeGlobal(callback?: (err: Error, result: DescribeGlobalResult) => void): Promise; @@ -110,6 +112,9 @@ export class Connection extends BaseConnection { analytics: Analytics; chatter: Chatter; metadata: Metadata; + bulk: Bulk; + oauth2: OAuth2; + streaming: Streaming; // Specific to Connection instanceUrl: string; diff --git a/types/jsforce/index.d.ts b/types/jsforce/index.d.ts index edb2830f52..704bb07655 100644 --- a/types/jsforce/index.d.ts +++ b/types/jsforce/index.d.ts @@ -7,24 +7,21 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -import * as fs from 'fs'; -import * as stream from 'stream'; -import * as express from 'express'; -import * as glob from 'glob'; - -export { Date } from './date-enum'; -export { Record } from './record'; -export { RecordResult } from './record-result'; -export { Connection, ConnectionOptions, RequestInfo, Tooling, callback } from './connection'; -export { SObject } from './salesforce-object'; -export { SalesforceId } from './salesforce-id'; -export { OAuth2, OAuth2Options } from './oauth2'; -export { Query, QueryResult } from './query'; -export { Promise } from './promise'; -export { Report, Dashboard, Analytics, ReportInstance, DashboardInfo, ReportInfo, ExplainInfo, ReportInstanceAttrs, - ReportMetadata, ReportResult } from './api/analytics'; -export { Chatter, Request, RequestResult, BatchRequestResults, BatchRequestParams, - Resource, BatchRequestResult, RequestParams } from './api/chatter'; -export { Metadata, SaveResult, MetadataInfo, AsyncResult, RetrieveResultLocator, RetrieveRequest, FileProperties, - ListMetadataQuery, DescribeMetadataResult, DeployOptions, AsyncResultLocator, RetrieveResult, MetadataObject, - DeployResult, DeployResultLocator, UpdateMetadataInfo, UpsertResult } from './api/metadata'; +export * from './api/analytics'; +export * from './api/chatter'; +export * from './api/metadata'; +export * from './batch'; +export * from './bulk'; +export * from './channel'; +export * from './connection'; +export * from './date-enum'; +export * from './job'; +export * from './oauth2'; +export * from './promise'; +export * from './query'; +export * from './record'; +export * from './record-result'; +export * from './salesforce-id'; +export * from './salesforce-object'; +export * from './streaming'; +export * from './topic'; diff --git a/types/jsforce/job.d.ts b/types/jsforce/job.d.ts new file mode 100644 index 0000000000..bdad4bf564 --- /dev/null +++ b/types/jsforce/job.d.ts @@ -0,0 +1,24 @@ +import { EventEmitter } from 'events'; + +import { Bulk, BulkOptions } from './bulk'; +import { Batch, BatchInfo } from './batch'; + +export interface JobInfo { + id: string; + object: string; + operation: string; + state: string; +} + +export class Job extends EventEmitter { + constructor(bulk: Bulk, type?: string, operation?: string, options?: BulkOptions, jobId?: string); + + abort(callback?: (err: Error, jobInfo: JobInfo) => void): Promise; + batch(batchId: string): Batch; + check(callback?: (err: Error, jobInfo: JobInfo) => void): Promise; + close(callback?: (err: Error, jobInfo: JobInfo) => void): Promise; + createBatch(): Batch; + info(callback?: (err: Error, jobInfo: JobInfo) => void): Promise; + list(callback?: (err: Error, jobInfo: BatchInfo) => void): Promise; + open(callback?: (err: Error, jobInfo: JobInfo) => void): Promise; +} diff --git a/types/jsforce/jsforce-tests.ts b/types/jsforce/jsforce-tests.ts index 9205d59096..156b0d292b 100644 --- a/types/jsforce/jsforce-tests.ts +++ b/types/jsforce/jsforce-tests.ts @@ -1,3 +1,8 @@ +import * as fs from 'fs'; +import * as stream from 'stream'; +import * as express from 'express'; +import * as glob from 'glob'; + import * as sf from 'jsforce'; export interface DummyRecord { @@ -125,7 +130,7 @@ async function testMetadata(conn: sf.Connection): Promise { m.metadataObjects.filter((value: sf.MetadataObject) => value.directoryName === 'pages'); console.log(`ApexPage?: ${pages[0].xmlName === 'ApexPage'}`); - const types: sf.ListMetadataQuery[] = [{type: 'CustomObject', folder: null}]; + const types: sf.ListMetadataQuery[] = [{ type: 'CustomObject', folder: null }]; md.list(types, '39.0', (err, properties: sf.FileProperties[]) => { if (err) { console.error('err', err); @@ -147,7 +152,7 @@ async function testMetadata(conn: sf.Connection): Promise { console.log('type: ' + meta.type); }); - const fullNames: string[] = [ 'Account', 'Contact' ]; + const fullNames: string[] = ['Account', 'Contact']; const info: sf.MetadataInfo | sf.MetadataInfo[] = await md.read('CustomObject', fullNames); console.log((info as sf.MetadataInfo[])[0].fullName); console.log((info as sf.MetadataInfo[])[1].fullName); @@ -196,7 +201,7 @@ async function testChatter(conn: sf.Connection): Promise { text: 'This is new post' }] }, - feedElementType : 'FeedItem', + feedElementType: 'FeedItem', subjectId: 'me' }, (err: Error, result: any) => { if (err) { @@ -255,7 +260,7 @@ async function testChatter(conn: sf.Connection): Promise { text: 'This is new comment on the post' }] }, - feedElementType : 'FeedItem', + feedElementType: 'FeedItem', subjectId: 'me' }) as Promise); @@ -264,7 +269,7 @@ async function testChatter(conn: sf.Connection): Promise { const itemsLikeResource: sf.Resource = chatter.resource(itemLikesUrl); const itemsLikeCreateResult: sf.RequestResult = await (itemsLikeResource.create('') as Promise); - console.log(`itemsLikeCreateResult['likedItem']: ${itemsLikeCreateResult as any ['likedItem']}`); + console.log(`itemsLikeCreateResult['likedItem']: ${itemsLikeCreateResult as any['likedItem']}`); } (async () => { @@ -277,3 +282,38 @@ async function testChatter(conn: sf.Connection): Promise { await testChatter(salesforceConnection); await testMetadata(salesforceConnection); })(); + +const oauth2 = new sf.OAuth2({ + // you can change loginUrl to connect to sandbox or prerelease env. + // loginUrl : 'https://test.salesforce.com', + clientId: '', + clientSecret: '', + redirectUri: '' +}); +oauth2.getAuthorizationUrl({ scope: 'api id web' }); + +const job = salesforceConnection.bulk.createJob("Account", "insert"); +const batch = job.createBatch(); +batch.execute(undefined); +batch.on("queue", (batchInfo) => { // fired when batch request is queued in server. + console.log('batchInfo:', batchInfo); + const batchId = batchInfo.id; + const jobId = batchInfo.jobId; +}); +job.batch("batchId"); +batch.poll(1000, 20000); +batch.on("response", (rets) => { + for (let i = 0; i < rets.length; i++) { + if (rets[i].success) { + console.log(`# ${(i + 1)} loaded successfully, id = ${rets[i].id}`); + } else { + console.log(`# ${(i + 1)} error occurred, message = ${rets[i].errors.join(', ')}`); + } + } +}); + +salesforceConnection.streaming.topic("InvoiceStatementUpdates").subscribe((message) => { + console.log('Event Type : ' + message.event.type); + console.log('Event Created : ' + message.event.createdDate); + console.log('Object Id : ' + message.sobject.Id); +}); diff --git a/types/jsforce/oauth2.d.ts b/types/jsforce/oauth2.d.ts index 833a9d45fd..64e26e1719 100644 --- a/types/jsforce/oauth2.d.ts +++ b/types/jsforce/oauth2.d.ts @@ -14,10 +14,13 @@ export interface OAuth2Options { privateKey?: string; // Used for sfdx auth files for legacy support reasons } -export class OAuth2 { - constructor (options? : OAuth2Options); +export interface TokenResponse { + access_token: string; + refresh_token: string; +} - protected _postParams(options: any, callback: () => any): void +export class OAuth2 { + constructor(options?: OAuth2Options); loginUrl: string; authzServiceUrl: string; @@ -27,9 +30,12 @@ export class OAuth2 { clientSecret: string; redirectUri: string; - getAuthorizationUrl(params: any): string; - refreshToken(code: string, callback?: () => any): Promise; - requestToken(code: string, callback?: () => any): Promise; - authenticate(username: string, password: string, callback?: () => any): Promise; - revokeToken(accessToken: string, callback?: () => any): Promise; + getAuthorizationUrl(params: { + scope?: string, + state?: string + }): string; + refreshToken(code: string, callback?: (err: Error, tokenResponse: TokenResponse) => void): Promise; + requestToken(code: string, callback?: (err: Error, tokenResponse: TokenResponse) => void): Promise; + authenticate(username: string, password: string, callback?: (err: Error, tokenResponse: TokenResponse) => void): Promise; + revokeToken(accessToken: string, callback?: (err: Error, ) => void): Promise; } diff --git a/types/jsforce/record.d.ts b/types/jsforce/record.d.ts index 3dd0bca1da..25ca2d62f4 100644 --- a/types/jsforce/record.d.ts +++ b/types/jsforce/record.d.ts @@ -1,10 +1,12 @@ +import { Stream } from 'stream'; + import { RecordResult } from './record-result'; import { Connection } from './connection'; import { SalesforceId } from './salesforce-id'; -import { Stream } from 'stream'; -export class RecordReference { +export class RecordReference { constructor(conn: Connection, type: string, id: SalesforceId); + blob(fieldName: string): Stream; del(options?: Object, callback?: (err: Error, result: RecordResult) => void): Promise; delete(options?: Object, callback?: (err: Error, result: RecordResult) => void): Promise; @@ -13,4 +15,4 @@ export class RecordReference { update(record: Partial, options?: Object, callback?: (err: Error, result: RecordResult) => void): Promise; } -export type Record = {Id: SalesforceId } & T; +export type Record = { Id?: SalesforceId } & T; diff --git a/types/jsforce/salesforce-object.d.ts b/types/jsforce/salesforce-object.d.ts index 86ec7ecaf4..2c54d598fc 100644 --- a/types/jsforce/salesforce-object.d.ts +++ b/types/jsforce/salesforce-object.d.ts @@ -7,6 +7,7 @@ import { Record, RecordReference } from './record'; import { RecordResult } from './record-result'; import { Connection } from './connection'; import { SalesforceId } from './salesforce-id'; +import { Batch, BatchResultInfo } from './batch'; export class SObject { record(id: SalesforceId): RecordReference; @@ -61,9 +62,6 @@ export interface ApprovalLayoutInfo { approvalLayouts: Object[]; } -export class Batch extends stream.Writable { -} - export interface CompactLayoutInfo { compactLayouts: Object[]; defaultCompactLayoutId: string; @@ -88,18 +86,5 @@ export class ListView { constructor(connection: Connection, type: string, id: SalesforceId) } -export interface BatchInfo { - id: string; - jobId: string; - state: string; - stateMessage: string; -} - -export interface BatchResultInfo { - id: string; - batchId: string; - jobId: string; -} - export class ListViewsInfo { } export class QuickAction { } diff --git a/types/jsforce/streaming.d.ts b/types/jsforce/streaming.d.ts new file mode 100644 index 0000000000..9d91de90f1 --- /dev/null +++ b/types/jsforce/streaming.d.ts @@ -0,0 +1,23 @@ +import { EventEmitter } from 'events'; + +import { Connection } from './connection'; +import { Record } from './record'; +import { Channel } from './channel'; +import { Topic } from './topic'; + +export interface StreamingMessage { + event: { + type: object + createdDate: any; + }; + sobject: Record +} + +export class Streaming extends EventEmitter { + constructor(connection: Connection); + + channel(channelId: string): Channel; + subscribe(name: string, listener: StreamingMessage): any; // Faye Subscription + topic(namne: string): Topic; + unsubscribe(name: string, listener: StreamingMessage): Streaming; +} diff --git a/types/jsforce/topic.d.ts b/types/jsforce/topic.d.ts new file mode 100644 index 0000000000..1de6f41aad --- /dev/null +++ b/types/jsforce/topic.d.ts @@ -0,0 +1,8 @@ +import { Streaming, StreamingMessage } from "./streaming"; + +export class Topic { + constructor(streaming: Streaming, name: string); + + subscribe(listener: (streamingMessage: StreamingMessage) => void): any; // Faye Subscription + unsubscribe(listener: (streamingMessage: StreamingMessage) => void): Topic; +} diff --git a/types/jsforce/tsconfig.json b/types/jsforce/tsconfig.json index 0d480d799f..bf92077cd0 100644 --- a/types/jsforce/tsconfig.json +++ b/types/jsforce/tsconfig.json @@ -18,14 +18,6 @@ }, "files": [ "index.d.ts", - "connection.d.ts", - "create-options.d.ts", - "date-enum.d.ts", - "salesforce-object-options.d.ts", - "salesforce-object.d.ts", - "salesforce-id.d.ts", - "query.d.ts", - "describe-result.d.ts", "jsforce-tests.ts" ] -} \ No newline at end of file +} From e87728aa06a5ca7e9ff2435dea72e3abac81645f Mon Sep 17 00:00:00 2001 From: "Kees C. Bakker" Date: Wed, 25 Apr 2018 00:57:07 +0200 Subject: [PATCH 037/564] Added alias, name, helpCommands and loadFile (#25012) * Added some extra defintions - Alias and name can be used to identify the name of the bot. - helpCommands will list all help commands - loadFile will load a script file from a directory into the bot * Update index.d.ts * Making CLI happy. --- types/hubot/index.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/hubot/index.d.ts b/types/hubot/index.d.ts index 7da5501736..1b90a512af 100644 --- a/types/hubot/index.d.ts +++ b/types/hubot/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for hubot 2.19 // Project: https://github.com/github/hubot // Definitions by: Dirk Gadsden +// Kees C. Bakker // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace Hubot { @@ -33,12 +34,16 @@ declare namespace Hubot { type ListenerCallback = (response: Response) => void; class Robot { + alias: string; brain: Brain; + name: string; readonly adapter: A; constructor(adapterPath: string, adapter: string, httpd: boolean, name: string, alias?: string); hear(regex: RegExp, callback: ListenerCallback): void; hear(regex: RegExp, options: any, callback: ListenerCallback): void; + helpCommands(): string[]; + loadFile(directory: string, fileName: string): void; respond(regex: RegExp, callback: ListenerCallback): void; respond(regex: RegExp, options: any, callback: ListenerCallback): void; } From b11cc1ee031e676f848d2ff639ca8e6172230ec7 Mon Sep 17 00:00:00 2001 From: Aankhen Date: Wed, 25 Apr 2018 04:27:24 +0530 Subject: [PATCH 038/564] [puppeteer] Add `Request.failure` and test. (#25178) --- types/puppeteer/index.d.ts | 5 +++++ types/puppeteer/puppeteer-tests.ts | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/types/puppeteer/index.d.ts b/types/puppeteer/index.d.ts index 9298d6c631..4b5be6bbc8 100644 --- a/types/puppeteer/index.d.ts +++ b/types/puppeteer/index.d.ts @@ -627,6 +627,11 @@ export interface Request { */ continue(overrides?: Overrides): Promise; + /** + * @returns An object if the request failed, null otherwise. + */ + failure(): { errorText: string; } | null; + /** * @returns The `Frame` object that initiated the request, or `null` if navigating to error pages */ diff --git a/types/puppeteer/puppeteer-tests.ts b/types/puppeteer/puppeteer-tests.ts index 3d7d44d0ca..043c2f5c78 100644 --- a/types/puppeteer/puppeteer-tests.ts +++ b/types/puppeteer/puppeteer-tests.ts @@ -282,6 +282,24 @@ puppeteer.launch().then(async browser => { browser.close(); })(); +// Test 0.13 features +(async () => { + const browser = await puppeteer.launch(); + const page = await browser.newPage(); + const handler = (r: puppeteer.Request) => { + const failure = r.failure(); + + if (failure == null) { + console.error("Request completed successfully"); + return; + } + + console.log("Request failed", failure.errorText.toUpperCase()); + }; + page.on('requestfinished', handler); + page.on('requestfailed', handler); +})(); + // Test 1.0 features (async () => { const browser = await puppeteer.launch({ From 2f3c13b0d372adbca88a5c87cdf6783643df2fb0 Mon Sep 17 00:00:00 2001 From: Rogerio Teixeira nunes Date: Wed, 25 Apr 2018 00:58:36 +0200 Subject: [PATCH 039/564] Fabric (#25168) * Add types backend filter * Add types backend filter * Add types backend filter * Add types backend filter(review) --- types/fabric/fabric-impl.d.ts | 188 ++++++++++++++++++++++------------ types/fabric/index.d.ts | 1 + types/fabric/test/index.ts | 6 ++ 3 files changed, 129 insertions(+), 66 deletions(-) diff --git a/types/fabric/fabric-impl.d.ts b/types/fabric/fabric-impl.d.ts index 369856130c..e35b0ebe0d 100644 --- a/types/fabric/fabric-impl.d.ts +++ b/types/fabric/fabric-impl.d.ts @@ -283,7 +283,7 @@ interface IObservable { * Observes specified event * @param eventName Object with key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler}) */ - on(events: {[eventName: string]: (e: IEvent) => void}): T; + on(events: { [eventName: string]: (e: IEvent) => void }): T; /** * Fires event with an optional options object * @param eventName Event name to fire @@ -296,7 +296,7 @@ interface IObservable { * @param eventName Event name (eg. 'after:render') or object with key/value pairs (eg. {'after:render': handler, 'selection:cleared': handler}) * @param handler Function to be deleted from EventListeners */ - off(eventName?: string|any, handler?: (e: IEvent) => void): T; + off(eventName?: string | any, handler?: (e: IEvent) => void): T; } interface Callbacks { @@ -337,7 +337,7 @@ interface IObjectAnimation { * @param value Value to animate property * @param options The animation options */ - animate(property: string, value: number|string, options?: IAnimationOptions): Object; + animate(property: string, value: number | string, options?: IAnimationOptions): Object; /** * Animates object's properties * object.animate({ left: ..., top: ... }, { duration: ... }); @@ -350,7 +350,7 @@ interface IAnimationOptions { /** * Allows to specify starting value of animatable property (if we don't want current value to be used). */ - from?: string|number; + from?: string | number; /** * Defaults to 500 (ms). Can be used to change duration of an animation. */ @@ -443,7 +443,7 @@ export class Color { /** * Overlays color with another color */ - overlayWith(otherColor: string|Color): Color; + overlayWith(otherColor: string | Color): Color; /** * Returns new color object, when given a color in RGB format @@ -551,7 +551,7 @@ interface IGradient extends IGradientOptions { toLive(ctx: CanvasRenderingContext2D, object?: PathGroup): CanvasGradient; } interface IGrandientStatic { - new (options?: IGradientOptions): IGradient; + new(options?: IGradientOptions): IGradient; /** * Returns instance from an SVG element * @param el SVG gradient element @@ -612,10 +612,10 @@ interface IPatternOptions { /** * The source for the pattern */ - source: string|HTMLImageElement; + source: string | HTMLImageElement; } -export interface Pattern extends IPatternOptions {} -export class Pattern { +export interface Pattern extends IPatternOptions { } +export class Pattern { constructor(options?: IPatternOptions); initialise(options?: IPatternOptions): Pattern; @@ -797,10 +797,10 @@ interface IShadowOptions { */ offsetY: number; } -export interface Shadow extends IShadowOptions {} +export interface Shadow extends IShadowOptions { } export class Shadow { constructor(options?: IShadowOptions); - initialize(options?: IShadowOptions|string): Shadow; + initialize(options?: IShadowOptions | string): Shadow; /** * Returns object representation of a shadow */ @@ -874,7 +874,7 @@ interface IStaticCanvasOptions { * Background color of canvas instance. * Should be set via setBackgroundColor */ - backgroundColor?: string|Pattern; + backgroundColor?: string | Pattern; /** * Background image of canvas instance. * Should be set via setBackgroundImage @@ -902,7 +902,7 @@ interface IStaticCanvasOptions { * Overlay color of canvas instance. * Should be set via setOverlayColor */ - overlayColor?: string|Pattern; + overlayColor?: string | Pattern; /** * Overlay image of canvas instance. * Should be set via setOverlayImage @@ -922,14 +922,14 @@ interface IStaticCanvasOptions { */ stateful?: boolean; } -export interface StaticCanvas extends IObservable, IStaticCanvasOptions, ICollection, ICanvasAnimation {} +export interface StaticCanvas extends IObservable, IStaticCanvasOptions, ICollection, ICanvasAnimation { } export class StaticCanvas { /** * Constructor * @param element element to initialize instance on * @param [options] Options object */ - constructor(element: HTMLCanvasElement|string, options?: ICanvasOptions); + constructor(element: HTMLCanvasElement | string, options?: ICanvasOptions); /** * Calculates canvas element offset relative to the document @@ -943,7 +943,7 @@ export class StaticCanvas { * @param callback callback to invoke when image is loaded and set as an overlay * @param [options] Optional options to set for the {@link fabric.Image|overlay image}. */ - setOverlayImage(image: Image|string, callback: (img: HTMLImageElement) => void, options?: IImageOptions): this; + setOverlayImage(image: Image | string, callback: (img: HTMLImageElement) => void, options?: IImageOptions): this; /** * Sets {@link fabric.StaticCanvas#backgroundImage|background image} for this canvas @@ -951,21 +951,21 @@ export class StaticCanvas { * @param callback Callback to invoke when image is loaded and set as background * @param [options] Optional options to set for the {@link fabric.Image|background image}. */ - setBackgroundImage(image: Image|string, callback?: (img: HTMLImageElement) => void, options?: IImageOptions): this; + setBackgroundImage(image: Image | string, callback?: (img: HTMLImageElement) => void, options?: IImageOptions): this; /** * Sets {@link fabric.StaticCanvas#overlayColor|background color} for this canvas * @param overlayColor Color or pattern to set background color to * @param callback Callback to invoke when background color is set */ - setOverlayColor(overlayColor: string|Pattern, callback: (pattern: Pattern | undefined) => void): this; + setOverlayColor(overlayColor: string | Pattern, callback: (pattern: Pattern | undefined) => void): this; /** * Sets {@link fabric.StaticCanvas#backgroundColor|background color} for this canvas * @param backgroundColor Color or pattern to set background color to * @param callback Callback to invoke when background color is set */ - setBackgroundColor(backgroundColor: string|Pattern, callback: (pattern: Pattern | undefined) => void): StaticCanvas; + setBackgroundColor(backgroundColor: string | Pattern, callback: (pattern: Pattern | undefined) => void): StaticCanvas; /** * Returns canvas width (in px) @@ -982,14 +982,14 @@ export class StaticCanvas { * @param value Value to set width to * @param [options] Options object */ - setWidth(value: number|string, options?: ICanvasDimensionsOptions): this; + setWidth(value: number | string, options?: ICanvasDimensionsOptions): this; /** * Sets height of this canvas instance * @param value Value to set height to * @param [options] Options object */ - setHeight(value: number|string, options?: ICanvasDimensionsOptions): this; + setHeight(value: number | string, options?: ICanvasDimensionsOptions): this; /** * Sets dimensions (width, height) of this canvas instance. when options.cssOnly flag active you should also supply the unit of measure (px/%/em) @@ -1213,7 +1213,7 @@ export class StaticCanvas { * are initialized * @param [reviver] Method for further parsing of JSON elements, called after each fabric object created. */ - loadFromJSON(json: string|any, callback: () => void, reviver?: Function): this; + loadFromJSON(json: string | any, callback: () => void, reviver?: Function): this; /** * Clones canvas instance * @param [callback] Receives cloned instance as a first argument @@ -1364,8 +1364,8 @@ interface ICanvasOptions extends IStaticCanvasOptions { */ isDrawingMode?: boolean; } -export interface Canvas extends StaticCanvas {} -export interface Canvas extends ICanvasOptions {} +export interface Canvas extends StaticCanvas { } +export interface Canvas extends ICanvasOptions { } export class Canvas { /** * Constructor @@ -1509,7 +1509,7 @@ interface ICircleOptions extends IObjectOptions { */ endAngle?: number; } -export interface Circle extends Object, ICircleOptions {} +export interface Circle extends Object, ICircleOptions { } export class Circle { constructor(options?: ICircleOptions); @@ -1571,7 +1571,7 @@ interface IEllipseOptions extends IObjectOptions { */ ry?: number; } -export interface Ellipse extends Object, IEllipseOptions {} +export interface Ellipse extends Object, IEllipseOptions { } export class Ellipse { constructor(options?: IEllipseOptions); @@ -1621,7 +1621,7 @@ export class Ellipse { static fromObject(object: any): Ellipse; } -export interface Group extends Object, ICollection {} +export interface Group extends Object, ICollection { } export class Group { /** * Constructor @@ -1713,7 +1713,7 @@ export class Group { /////////////////////////////////////////////////////////////////////////////// // ActiveSelection ////////////////////////////////////////////////////////////////////////////// -export interface ActiveSelection extends Object, ICollection {} +export interface ActiveSelection extends Object, ICollection { } export class ActiveSelection { /** * Constructor @@ -1781,7 +1781,7 @@ interface IImageOptions extends IObjectOptions { */ filters?: IBaseFilter[]; } -interface Image extends Object, IImageOptions {} +interface Image extends Object, IImageOptions { } export class Image { /** * Constructor @@ -1790,7 +1790,7 @@ export class Image { */ constructor(element: HTMLImageElement, objObjects: IObjectOptions); - initialize(element?: string|HTMLImageElement, options?: IImageOptions): void; + initialize(element?: string | HTMLImageElement, options?: IImageOptions): void; /** * Applies filters assigned to this image (from "filters" array) * @param callback Callback is invoked when all filters have been applied and new image is generated @@ -1907,7 +1907,7 @@ interface ILineOptions extends IObjectOptions { */ y2: number; } -export interface Line extends Object, ILineOptions {} +export interface Line extends Object, ILineOptions { } export class Line { /** * Constructor @@ -2131,7 +2131,7 @@ interface IObjectOptions { /** * Shadow object representing shadow of this shape */ - shadow?: Shadow|string; + shadow?: Shadow | string; /** * Opacity of object's controlling borders when object is active and moving @@ -2250,7 +2250,7 @@ interface IObjectOptions { */ data?: any; } -export interface Object extends IObservable, IObjectOptions, IObjectAnimation {} +export interface Object extends IObservable, IObjectOptions, IObjectAnimation { } export class Object { getCurrentWidth(): number; getCurrentHeight(): number; @@ -2656,7 +2656,8 @@ export class Object { mt?: boolean; tl?: boolean; tr?: boolean; - mtr?: boolean; }): this; + mtr?: boolean; + }): this; // functions from geometry mixin // ------------------------------------------------------------------------------------------------------------------------------- @@ -2731,14 +2732,14 @@ interface IPathOptions extends IObjectOptions { */ minY?: number; } -export interface Path extends Object, IPathOptions {} +export interface Path extends Object, IPathOptions { } export class Path { /** * Constructor * @param path Path data (sequence of coordinates and corresponding "command" tokens) * @param [options] Options object */ - constructor(path?: string|any[], options?: IPathOptions); + constructor(path?: string | any[], options?: IPathOptions); pathOffset: Point; @@ -2871,7 +2872,7 @@ interface IPolygonOptions extends IObjectOptions { */ minY?: number; } -export interface Polygon extends IPolygonOptions {} +export interface Polygon extends IPolygonOptions { } export class Polygon extends Object { /** * Constructor @@ -2933,7 +2934,7 @@ interface IPolylineOptions extends IObjectOptions { */ minY?: number; } -export interface Polyline extends IPolylineOptions {} +export interface Polyline extends IPolylineOptions { } export class Polyline extends Object { /** * Constructor @@ -2993,7 +2994,7 @@ interface IRectOptions extends IObjectOptions { ry?: number; } -export interface Rect extends IRectOptions {} +export interface Rect extends IRectOptions { } export class Rect extends Object { /** * Constructor @@ -3044,7 +3045,7 @@ interface ITextOptions extends IObjectOptions { /** * Font weight (e.g. bold, normal, 400, 600, 800) */ - fontWeight?: number|string; + fontWeight?: number | string; /** * Font family */ @@ -3074,7 +3075,7 @@ interface ITextOptions extends IObjectOptions { * Shadow object representing shadow of this shape. * Backwards incompatibility note?: This property was named "textShadow" (String) until v1.2.11 */ - shadow?: Shadow|string; + shadow?: Shadow | string; /** * Background color of text lines */ @@ -3084,7 +3085,7 @@ interface ITextOptions extends IObjectOptions { useNative?: boolean; text?: string; } -export interface Text extends ITextOptions {} +export interface Text extends ITextOptions { } export class Text extends Object { /** * Constructor @@ -3127,12 +3128,12 @@ export class Text extends Object { /** * Retrieves object's fontWeight */ - getFontWeight(): number|string; + getFontWeight(): number | string; /** * Sets object's fontWeight * @param fontWeight Font weight */ - setFontWeight(fontWeight: string|number): Text; + setFontWeight(fontWeight: string | number): Text; /** * Retrieves object's fontFamily */ @@ -3281,7 +3282,7 @@ interface IITextOptions extends IObjectOptions, ITextOptions { */ caching?: boolean; } -export interface IText extends Text, IITextOptions {} +export interface IText extends Text, IITextOptions { } export class IText extends Object { /** * Constructor @@ -3566,14 +3567,14 @@ interface IAllFilters { * Constructor * @param [options] Options object */ - new (options?: any): IBaseFilter; + new(options?: any): IBaseFilter; }; Blend: { /** * Constructor * @param [options] Options object */ - new (options?: { color?: string; mode?: string; alpha?: number; image?: Image }): IBlendFilter; + new(options?: { color?: string; mode?: string; alpha?: number; image?: Image }): IBlendFilter; /** * Returns filter instance from an object representation * @param object Object to create an instance from @@ -3581,7 +3582,7 @@ interface IAllFilters { fromObject(object: any): IBlendFilter }; Brightness: { - new (options?: { + new(options?: { /** * Value to brighten the image up (0..255) * @default 0 @@ -3595,7 +3596,7 @@ interface IAllFilters { fromObject(object: any): IBrightnessFilter }; Convolute: { - new (options?: { + new(options?: { opaque?: boolean, /** Filter matrix */ matrix?: number[], @@ -3607,7 +3608,7 @@ interface IAllFilters { fromObject(object: any): IConvoluteFilter }; GradientTransparency: { - new (options?: { + new(options?: { /** @default 100 */ threshold?: number; }): IGradientTransparencyFilter; @@ -3618,7 +3619,7 @@ interface IAllFilters { fromObject(object: any): IGradientTransparencyFilter }; Grayscale: { - new (options?: any): IGrayscaleFilter; + new(options?: any): IGrayscaleFilter; /** * Returns filter instance from an object representation * @param object Object to create an instance from @@ -3630,7 +3631,7 @@ interface IAllFilters { * Constructor * @param [options] Options object */ - new (options?: any): IInvertFilter; + new(options?: any): IInvertFilter; /** * Returns filter instance from an object representation * @param object Object to create an instance from @@ -3638,7 +3639,7 @@ interface IAllFilters { fromObject(object: any): IInvertFilter }; Mask: { - new (options?: { + new(options?: { /** Mask image object */ mask?: Image, /** @@ -3654,7 +3655,7 @@ interface IAllFilters { fromObject(object: any): IMaskFilter }; Multiply: { - new (options?: { + new(options?: { /** * Color to multiply the image pixels with * @default #000000 @@ -3668,7 +3669,7 @@ interface IAllFilters { fromObject(object: any): IMultiplyFilter }; Noise: { - new (options?: { + new(options?: { /** @default 0 */ noise: number, }): INoiseFilter; @@ -3679,7 +3680,7 @@ interface IAllFilters { fromObject(object: any): INoiseFilter }; Pixelate: { - new (options?: { + new(options?: { /** * Blocksize for pixelate * @default 4 @@ -3693,7 +3694,7 @@ interface IAllFilters { fromObject(object: any): IPixelateFilter }; RemoveWhite: { - new (options?: { + new(options?: { /** @default 30 */ threshold?: number, /** @default 20 */ @@ -3706,7 +3707,7 @@ interface IAllFilters { fromObject(object: any): IRemoveWhiteFilter }; Resize: { - new (options?: any): IResizeFilter; + new(options?: any): IResizeFilter; /** * Returns filter instance from an object representation * @param object Object to create an instance from @@ -3714,7 +3715,7 @@ interface IAllFilters { fromObject(object: any): IResizeFilter }; Sepia2: { - new (options?: any): ISepia2Filter; + new(options?: any): ISepia2Filter; /** * Returns filter instance from an object representation * @param object Object to create an instance from @@ -3722,7 +3723,7 @@ interface IAllFilters { fromObject(object: any): ISepia2Filter }; Sepia: { - new (options?: any): ISepiaFilter; + new(options?: any): ISepiaFilter; /** * Returns filter instance from an object representation * @param object Object to create an instance from @@ -3730,7 +3731,7 @@ interface IAllFilters { fromObject(object: any): ISepiaFilter }; Tint: { - new (options?: { + new(options?: { /** * Color to tint the image with * @default #000000 @@ -3905,7 +3906,7 @@ export class BaseBrush { * Backwards incompatibility note: This property replaces "shadowColor" (String), "shadowOffsetX" (Number), * "shadowOffsetY" (Number) and "shadowBlur" (Number) since v1.2.12 */ - shadow: Shadow|string; + shadow: Shadow | string; /** * Line endings style of a brush (one of "butt", "round", "square") */ @@ -3925,7 +3926,7 @@ export class BaseBrush { * Sets shadow of an object * @param [options] Options object or string (e.g. "2px 2px 10px rgba(0,0,0,0.2)") */ - setShadow(options: string|any): BaseBrush; + setShadow(options: string | any): BaseBrush; } export class CircleBrush extends BaseBrush { @@ -4133,7 +4134,7 @@ interface IUtilDomMisc { /** * Takes id and returns an element with that id (if one exists in a document) */ - getById(id: string|HTMLElement): HTMLElement; + getById(id: string | HTMLElement): HTMLElement; /** * Converts an array-like object (e.g. arguments or NodeList) to an array */ @@ -4157,7 +4158,7 @@ interface IUtilDomMisc { * @param wrapper Element to wrap with * @param [attributes] Attributes to set on a wrapper */ - wrapElement(element: HTMLElement, wrapper: HTMLElement|string, attributes?: any): HTMLElement; + wrapElement(element: HTMLElement, wrapper: HTMLElement | string, attributes?: any): HTMLElement; /** * Returns element scroll offsets * @param element Element to operate on @@ -4353,7 +4354,7 @@ interface IUtilMisc { * Returns converted pixels or original value not converted. * @param value number to operate on */ - parseUnit(value: number|string, fontSize?: number): number|string; + parseUnit(value: number | string, fontSize?: number): number | string; /** * Function which always returns `false`. @@ -4480,3 +4481,58 @@ interface IUtil extends IUtilAnimation, IUtilArc, IObservable, IUtilDomEv object: IUtilObject; string: IUtilString; } + +export interface Resources { + [key: string]: HTMLCanvasElement +} +export interface FilterBackend { + resources: Resources; + + applyFilters(filters: IBaseFilter[], sourceElement: HTMLImageElement | HTMLCanvasElement, sourceWidth: number, sourceHeight: number, targetCanvas: HTMLCanvasElement,cacheKey?: string): any; + + evictCachesForKey(cacheKey: string): void; + + dispose(): void; + + clearWebGLCaches(): void; + +} +export let filterBackend: FilterBackend; +export interface Canvas2dFilterBackend extends FilterBackend { } +export class Canvas2dFilterBackend { + constructor(); +} + +export interface GPUInfo{ + renderer:string; + vendor:string; +} + +export interface WebglFilterBackendOptions { + tileSize: number; +} +export interface WebglFilterBackend extends FilterBackend, WebglFilterBackendOptions { + setupGLContext(width: number, height: number): void; + + chooseFastestCopyGLTo2DMethod(width: number, height: number): void; + + createWebGLCanvas(width: number, height: number): void; + + applyFiltersDebug(filters: IBaseFilter[], sourceElement: HTMLImageElement | HTMLCanvasElement, sourceWidth: number, sourceHeight: number, targetCanvas: HTMLCanvasElement, cacheKey?: string): any; + + glErrorToString(context: any, errorCode: any): string; + + createTexture(gl: WebGLRenderingContext, width: number, height: number, textureImageSource?: HTMLImageElement | HTMLCanvasElement): WebGLTexture; + + getCachedTexture(uniqueId: string, textureImageSource: HTMLImageElement | HTMLCanvasElement): WebGLTexture; + + copyGLTo2D(gl: WebGLRenderingContext, pipelineState: any): void; + + captureGPUInfo(): GPUInfo; + +} + +export class WebglFilterBackend { + constructor(options?: WebglFilterBackendOptions); +} + diff --git a/types/fabric/index.d.ts b/types/fabric/index.d.ts index 38277c5708..76ed1ab054 100644 --- a/types/fabric/index.d.ts +++ b/types/fabric/index.d.ts @@ -5,6 +5,7 @@ // Michael Randolph // Tiger Oakes // Brian Martinson +// Rogerio Teixeira // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 export import fabric = require("./fabric-impl"); diff --git a/types/fabric/test/index.ts b/types/fabric/test/index.ts index dfdaafce06..1060525a00 100644 --- a/types/fabric/test/index.ts +++ b/types/fabric/test/index.ts @@ -1061,3 +1061,9 @@ function sample10() { canvas.add(objB); const objArray = canvas.getActiveObjects(); } + +function sample11() { + const canvas2dFilterBackend = new fabric.Canvas2dFilterBackend(); + const webglFilterBackend = new fabric.WebglFilterBackend(); + fabric.filterBackend = new fabric.Canvas2dFilterBackend(); +} From 23ff949115428b0e2b2c6e1f4c4a7c884d491341 Mon Sep 17 00:00:00 2001 From: ufolux Date: Wed, 25 Apr 2018 06:58:52 +0800 Subject: [PATCH 040/564] export NativeSyntheticEvent (#25190) Due to WebView onMessage function need a event param --- types/react-native/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index e42f1f2055..db4b5c33ce 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -347,7 +347,7 @@ type TaskProvider = () => Task; type NodeHandle = number; // Similar to React.SyntheticEvent except for nativeEvent -interface NativeSyntheticEvent { +export interface NativeSyntheticEvent { bubbles: boolean; cancelable: boolean; currentTarget: NodeHandle; From 53b8794401092be07f9e1e9400d67543d103bf09 Mon Sep 17 00:00:00 2001 From: ufolux Date: Wed, 25 Apr 2018 06:59:13 +0800 Subject: [PATCH 041/564] Update index.d.ts (#25194) --- types/react-native/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index db4b5c33ce..4fc6592c80 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -3522,7 +3522,7 @@ export interface ViewabilityConfig { * @see https://facebook.github.io/react-native/docs/flatlist.html#props */ -interface ListRenderItemInfo { +export interface ListRenderItemInfo { item: ItemT; index: number; @@ -3534,7 +3534,7 @@ interface ListRenderItemInfo { }; } -type ListRenderItem = (info: ListRenderItemInfo) => React.ReactElement | null; +export type ListRenderItem = (info: ListRenderItemInfo) => React.ReactElement | null; export interface FlatListProperties extends VirtualizedListProperties { /** From dac6c4fc10b7926e9892a3091d4fbc534d4962ae Mon Sep 17 00:00:00 2001 From: Kevin Perrine Date: Tue, 24 Apr 2018 17:59:33 -0500 Subject: [PATCH 042/564] [react-sortable-tree] Added props for custom themes (#25179) * initial addition of theme prop to react-sortable-tree Signed-off-by: Kevin * fix TreeRenderer and it's Props. Signed-off-by: Kevin * bump version, add theme prop to test Signed-off-by: Kevin * added "by" line Signed-off-by: Kevin --- types/react-sortable-tree/index.d.ts | 82 ++++++++++++++++--- .../react-sortable-tree-tests.tsx | 6 +- 2 files changed, 75 insertions(+), 13 deletions(-) diff --git a/types/react-sortable-tree/index.d.ts b/types/react-sortable-tree/index.d.ts index 0a0efc7f31..db90ce90f9 100644 --- a/types/react-sortable-tree/index.d.ts +++ b/types/react-sortable-tree/index.d.ts @@ -1,13 +1,19 @@ -// Type definitions for react-sortable-tree 0.1 +// Type definitions for react-sortable-tree 0.2 // Project: https://fritz-c.github.io/react-sortable-tree // Definitions by: Wouter Hardeman // Jovica Zoric +// Kevin Perrine // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 import * as React from 'react'; import { ListProps, Index } from 'react-virtualized'; -import { ConnectDragSource, ConnectDragPreview, DragSourceMonitor } from 'react-dnd'; +import { + ConnectDragSource, + ConnectDragPreview, + ConnectDropTarget, + DragSourceMonitor +} from 'react-dnd'; export * from './utils/tree-data-utils'; export * from './utils/default-handlers'; @@ -70,44 +76,93 @@ export interface NodeRendererProps { canDrag: boolean; scaffoldBlockPxWidth: number; toggleChildrenVisibility?(data: NodeData): void; - buttons?: any[]; + buttons?: JSX.Element[]; className?: string; - style?: {[index: string]: any}; + style?: { [index: string]: any }; + title?: (data: NodeData) => JSX.Element | JSX.Element; + subtitle?: (data: NodeData) => JSX.Element | JSX.Element; + icons?: JSX.Element[]; + lowerSiblingCounts: number[]; + swapDepth?: number; + swapFrom?: number; + swapLength?: number; + listIndex: number; + treeId: string; connectDragPreview: ConnectDragPreview; connectDragSource: ConnectDragSource; - parentNode?: {[index: string]: any}; + parentNode?: { [index: string]: any }; startDrag: any; endDrag: any; isDragging: boolean; didDrop: boolean; - draggedNode?: {[index: string]: any}; + draggedNode?: { [index: string]: any }; isOver: boolean; canDrop?: boolean; } -export type PlaceholderRenderer = React.ComponentClass; +export type PlaceholderRenderer = React.ComponentClass< + PlaceholderRendererProps +>; export interface PlaceholderRendererProps { isOver: boolean; canDrop: boolean; - draggedNode: {[index: string]: any}; + draggedNode: { [index: string]: any }; } type NumberArrayOrStringArray = string[] | number[]; +export type TreeRenderer = React.ComponentClass; + +export interface TreeRendererProps { + treeIndex: number; + treeId: string; + swapFrom?: number; + swapDepth?: number; + swapLength?: number; + scaffoldBlockPxWidth: number; + lowerSiblingCounts: number[]; + + listIndex: number; + children: JSX.Element[]; + + // Drop target + connectDropTarget: ConnectDropTarget; + isOver: boolean; + canDrop?: boolean; + draggedNode?: { [index: string]: any }; + + // used in dndManager + getPrevRow: any; // @TODO what is this method? + node: TreeItem; + path: NumberArrayOrStringArray; +} + +export interface ThemeProps { + style?: { [index: string]: any }; + innerStyle?: { [index: string]: any }; + reactVirtualizedListProps?: ListProps; + scaffoldBlockPxWidth?: number; + slideRegionSize?: number; + rowHeight?: ((info: Index) => number) | number; + treeNodeRenderer?: TreeRenderer; + nodeContentRenderer?: NodeRenderer; + placeholderRenderer?: PlaceholderRenderer; +} + export interface ReactSortableTreeProps { treeData: TreeItem[]; onChange(treeData: TreeItem[]): void; - style?: {[index: string]: any; }; + style?: { [index: string]: any }; className?: string; - innerStyle?: {[index: string]: any; }; + innerStyle?: { [index: string]: any }; maxDepth?: number; searchMethod?(data: SearchData): boolean; searchQuery?: string | any; searchFocusOffset?: number; searchFinishCallback?(matches: NodeData[]): void; - generateNodeProps?(data: ExtendedNodeData): {[index: string]: any}; + generateNodeProps?(data: ExtendedNodeData): { [index: string]: any }; getNodeKey?(data: TreeNode & TreeIndex): string | number; onMoveNode?(data: NodeData & FullTree): void; onVisibilityToggle?(data: OnVisibilityToggleData): void; @@ -121,10 +176,13 @@ export interface ReactSortableTreeProps { nodeContentRenderer?: NodeRenderer; dndType?: string; placeholderRenderer?: PlaceholderRenderer; + theme?: ThemeProps; } declare const SortableTree: React.ComponentClass; -export const SortableTreeWithoutDndContext: React.ComponentClass; +export const SortableTreeWithoutDndContext: React.ComponentClass< + ReactSortableTreeProps +>; export default SortableTree; diff --git a/types/react-sortable-tree/react-sortable-tree-tests.tsx b/types/react-sortable-tree/react-sortable-tree-tests.tsx index d67e6ad123..f29e814cc9 100644 --- a/types/react-sortable-tree/react-sortable-tree-tests.tsx +++ b/types/react-sortable-tree/react-sortable-tree-tests.tsx @@ -12,7 +12,8 @@ import SortableTree, FullTree, OnVisibilityToggleData, PreviousAndNextLocation, - PlaceholderRendererProps + PlaceholderRendererProps, + ThemeProps } from "react-sortable-tree"; import { ListProps, ListRowRenderer } from "react-virtualized"; @@ -37,6 +38,8 @@ class Test extends React.Component { width: 100, height: 44, rowCount: 3, rowHeight: 44, rowRenderer: "test" as any as ListRowRenderer }; const nodeRenderer: NodeRenderer = "test" as any as NodeRenderer; + const theme: ThemeProps = { nodeContentRenderer: nodeRenderer } as any as ThemeProps; + return (
Date: Tue, 24 Apr 2018 19:00:18 -0400 Subject: [PATCH 043/564] [eslint] CLIEngine ignorePattern can be a string or string[] (#25197) --- types/eslint/eslint-tests.ts | 1 + types/eslint/index.d.ts | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/types/eslint/eslint-tests.ts b/types/eslint/eslint-tests.ts index 376cdf0a92..a281991918 100644 --- a/types/eslint/eslint-tests.ts +++ b/types/eslint/eslint-tests.ts @@ -456,6 +456,7 @@ cli = new CLIEngine({ globals: ['foo'] }); cli = new CLIEngine({ ignore: true }); cli = new CLIEngine({ ignorePath: 'foo' }); cli = new CLIEngine({ ignorePattern: 'foo' }); +cli = new CLIEngine({ ignorePattern: ['foo', 'bar'] }); cli = new CLIEngine({ useEslintrc: false }); cli = new CLIEngine({ parserOptions: {} }); cli = new CLIEngine({ plugins: ['foo'] }); diff --git a/types/eslint/index.d.ts b/types/eslint/index.d.ts index 9e0e68af0b..76f04617d8 100644 --- a/types/eslint/index.d.ts +++ b/types/eslint/index.d.ts @@ -2,6 +2,7 @@ // Project: https://eslint.org // Definitions by: Pierre-Marie Dartus // Jed Fox +// Saad Quadri // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -491,7 +492,7 @@ export namespace CLIEngine { globals?: string[]; ignore?: boolean; ignorePath?: string; - ignorePattern?: string; + ignorePattern?: string | string[]; useEslintrc?: boolean; parser?: string; parserOptions?: Linter.ParserOptions; From 2f1a4cda5ce0365fc3272f89f66bacab992c5a4f Mon Sep 17 00:00:00 2001 From: Christophe Hurpeau Date: Wed, 25 Apr 2018 01:00:59 +0200 Subject: [PATCH 044/564] webpack: Add Configuration.Resolve.cacheWithContext (#25209) https://webpack.js.org/configuration/resolve/#resolve-cachewithcontext --- types/webpack/index.d.ts | 9 +++++++++ types/webpack/v3/index.d.ts | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/types/webpack/index.d.ts b/types/webpack/index.d.ts index 8c93019f24..e422c58b32 100644 --- a/types/webpack/index.d.ts +++ b/types/webpack/index.d.ts @@ -11,6 +11,7 @@ // Spencer Elliott // Jason Cheatham // Dennis George +// Christophe Hurpeau // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -320,6 +321,14 @@ declare namespace webpack { * Defaults to `true` */ symlinks?: boolean; + + /** + * If unsafe cache is enabled, includes request.context in the cache key. + * This option is taken into account by the enhanced-resolve module. + * Since webpack 3.1.0 context in resolve caching is ignored when resolve or resolveLoader plugins are provided. + * This addresses a performance regression. + */ + cacheWithContext?: boolean; } interface ResolveLoader extends Resolve { diff --git a/types/webpack/v3/index.d.ts b/types/webpack/v3/index.d.ts index 7f943d4151..262b52a286 100644 --- a/types/webpack/v3/index.d.ts +++ b/types/webpack/v3/index.d.ts @@ -10,6 +10,7 @@ // Alan Agius // Spencer Elliott // Jason Cheatham +// Christophe Hurpeau // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -318,6 +319,14 @@ declare namespace webpack { * Defaults to `true` */ symlinks?: boolean; + + /** + * If unsafe cache is enabled, includes request.context in the cache key. + * This option is taken into account by the enhanced-resolve module. + * Since webpack 3.1.0 context in resolve caching is ignored when resolve or resolveLoader plugins are provided. + * This addresses a performance regression. + */ + cacheWithContext?: boolean; } interface ResolveLoader extends Resolve { From 3d6c3d223baa56d7983b6a0ea7673cd1f3ac1a91 Mon Sep 17 00:00:00 2001 From: Andrei Markeev Date: Wed, 25 Apr 2018 02:02:21 +0300 Subject: [PATCH 045/564] meteor: strong typings for mongo collections selectors and modifiers (#25210) * meteor: strong typings for mongo collections selectors and modifiers * meteor: updated dependent packages * bugfix in $push->$each block, added more tests --- types/angular-meteor/index.d.ts | 4 +- types/meteor-jboulhous-dev/index.d.ts | 1 + types/meteor-persistent-session/index.d.ts | 1 + .../meteor-prime8consulting-oauth2/index.d.ts | 1 + types/meteor-publish-composite/index.d.ts | 1 + types/meteor-roles/index.d.ts | 1 + types/meteor/index.d.ts | 10 +- types/meteor/meteor-tests.ts | 54 ++++ types/meteor/mongo.d.ts | 264 ++++++++++++++++-- 9 files changed, 313 insertions(+), 24 deletions(-) diff --git a/types/angular-meteor/index.d.ts b/types/angular-meteor/index.d.ts index c842dd2cf0..11d782ee47 100644 --- a/types/angular-meteor/index.d.ts +++ b/types/angular-meteor/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/Urigo/angular-meteor // Definitions by: Peter Grman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.8 /// @@ -101,7 +101,7 @@ declare module 'angular' { * @param [autoClientSave=true] - By default, changes in the Angular object will automatically update the Meteor object. * - However if set to false, changes in the client won't be automatically propagated back to the Meteor object. */ - object(collection: Mongo.Collection, selector: Mongo.Selector|Mongo.ObjectID|string, autoClientSave?: boolean): AngularMeteorObject; + object(collection: Mongo.Collection, selector: Mongo.Selector|Mongo.ObjectID|string, autoClientSave?: boolean): AngularMeteorObject; /** * A service which is a wrapper for Meteor.subscribe. It subscribes to a Meteor.publish method in the client and returns a AngularJS promise when ready. diff --git a/types/meteor-jboulhous-dev/index.d.ts b/types/meteor-jboulhous-dev/index.d.ts index 6b529740b5..28d7ec19cd 100644 --- a/types/meteor-jboulhous-dev/index.d.ts +++ b/types/meteor-jboulhous-dev/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/jboulhous/dev // Definitions by: Robbie Van Gorkom // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 /// diff --git a/types/meteor-persistent-session/index.d.ts b/types/meteor-persistent-session/index.d.ts index f122c412dd..5efaed6dfa 100644 --- a/types/meteor-persistent-session/index.d.ts +++ b/types/meteor-persistent-session/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/okgrow/meteor-persistent-session // Definitions by: Robbie Van Gorkom // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 /// diff --git a/types/meteor-prime8consulting-oauth2/index.d.ts b/types/meteor-prime8consulting-oauth2/index.d.ts index ca92d7445d..f9f08efca3 100644 --- a/types/meteor-prime8consulting-oauth2/index.d.ts +++ b/types/meteor-prime8consulting-oauth2/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/prime-8-consulting/meteor-oauth2/ // Definitions by: Robbie Van Gorkom // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 /// diff --git a/types/meteor-publish-composite/index.d.ts b/types/meteor-publish-composite/index.d.ts index a5f6205913..428175f6ad 100644 --- a/types/meteor-publish-composite/index.d.ts +++ b/types/meteor-publish-composite/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/englue/meteor-publish-composite // Definitions by: Robert Van Gorkom // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 /// diff --git a/types/meteor-roles/index.d.ts b/types/meteor-roles/index.d.ts index ed91f96ab5..348f6eef9c 100644 --- a/types/meteor-roles/index.d.ts +++ b/types/meteor-roles/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Robbie Van Gorkom // Matthew Zartman // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 /// diff --git a/types/meteor/index.d.ts b/types/meteor/index.d.ts index 1d95ba429d..fad7da05bf 100644 --- a/types/meteor/index.d.ts +++ b/types/meteor/index.d.ts @@ -1,7 +1,15 @@ // Type definitions for Meteor 1.4 // Project: http://www.meteor.com/ -// Definitions by: Alex Borodach , Dave Allen , Olivier Refalo , Daniel Neveux , Birk Skyum , Arda TANRIKULU , Stefan Holzapfel +// Definitions by: Alex Borodach +// Dave Allen +// Olivier Refalo +// Daniel Neveux +// Birk Skyum +// Arda TANRIKULU +// Stefan Holzapfel +// Andrey Markeev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 /// /// diff --git a/types/meteor/meteor-tests.ts b/types/meteor/meteor-tests.ts index 0e457b9fc5..f9cf039c84 100644 --- a/types/meteor/meteor-tests.ts +++ b/types/meteor/meteor-tests.ts @@ -352,6 +352,60 @@ let cursor: Mongo.Cursor; // After five seconds, stop keeping the count. setTimeout(function () { handle.stop(); }, 5000); +// Additional testing for Mongo.Collection +enum InlineObjectType { + Invalid, + Link, + Image, + Video, + Person +} +interface CommentsDAO { + text: string; + authorId: string; + inlineLinks: { objectType: InlineObjectType, objectId: string, objectUrl: string }[], + tags: string[], + viewNumber: number, + private: boolean +} + +var Comments = new Mongo.Collection("comments"); + +Comments.find({ text: { $regex: /test/ } }); +Comments.find({ viewNumber: { $gt: 100 } }); +Comments.find({ viewNumber: { $not: { $lt: 100, $gt: 1000 } } }); +Comments.find({ tags: { $in: [ "tag-1", "tag-2", "tag-3" ] } }); +Comments.find({ $or: [ { text: "hello" }, { text: "world" } ] }); +Comments.find({ $or: [ + { text: "hello" }, + { text: "world", viewNumber: { $gt: 0 } } +], authorId: "test-author-id" }); +Comments.find({ $and: [ + { $or: [{ authorId: "author-id-1" }, { authorId: "author-id-2" }] }, + { $or: [{ tags: "tag-1" }, { tags: "tag-2" }] } +]}); + +Comments.find({ inlineLinks: { $exists: true, $type: "array" } }); +Comments.find({ inlineLinks: { $elemMatch: { + objectType: InlineObjectType.Image, + objectUrl: { $regex: "https://(www\.?)youtube\.com" } +} } }); +Comments.find({ "inlineLinks.objectType": InlineObjectType.Person }); +Comments.find({ tags: "tag-1" }); +Comments.find({ tags: { $all: ["tag-1", "tag2"] } }); + +Comments.update({ viewNumber: { $exists: false } }, { $set: { viewNumber: 0 } }); +Comments.update({ authorId: "author-id-1" }, { $push: { tags: "test-tag-1" } }); +Comments.update({ authorId: "author-id-1" }, { $push: { tags: { $each: [ "test-tag-2", "test-tag-3" ] } } }); + +Comments.update({ authorId: "author-id-1" }, { $push: { inlineLinks: { + objectId: "test-object-id", + objectType: InlineObjectType.Link, + objectUrl: "https://test.url/" +} } }); +Comments.update({ viewNumber: { $exists: false } }, { $set: { viewNumber: 0 } }); +Comments.update({ private: true }, { $unset: { tags: true } }); + /** * From Sessions, Session.set section */ diff --git a/types/meteor/mongo.d.ts b/types/meteor/mongo.d.ts index 28e1868840..248f5a22af 100644 --- a/types/meteor/mongo.d.ts +++ b/types/meteor/mongo.d.ts @@ -1,9 +1,121 @@ declare module Mongo { - interface Selector { - [key: string]: any; + + type BsonType = 1 | "double" | + 2 | "string" | + 3 | "object" | + 4 | "array" | + 5 | "binData" | + 6 | "undefined" | + 7 | "objectId" | + 8 | "bool" | + 9 | "date" | + 10 | "null" | + 11 | "regex" | + 12 | "dbPointer" | + 13 | "javascript" | + 14 | "symbol" | + 15 | "javascriptWithScope" | + 16 | "int" | + 17 | "timestamp" | + 18 | "long" | + 19 | "decimal" | + -1 | "minKey" | + 127 | "maxKey" | "number" + + type FieldExpression = { + $eq?: T, + $gt?: T, + $gte?: T, + $lt?: T, + $lte?: T, + $in?: T[], + $nin?: T[], + $ne?: T, + $exists?: boolean, + $type?: BsonType[] | BsonType, + $not?: FieldExpression, + $expr?: FieldExpression, + $jsonSchema?: any, + $mod?: number[], + $regex?: RegExp | string, + $options?: string, + $text?: { $search: string, $language?: string, $caseSensitive?: boolean, $diacriticSensitive?: boolean }, + $where?: string | Function, + $geoIntersects?: any, + $geoWithin?: any, + $near?: any, + $nearSphere?: any, + $all?: T[], + $elemMatch?: T extends {} ? Query : FieldExpression, + $size?: number, + $bitsAllClear?: any, + $bitsAllSet?: any, + $bitsAnyClear?: any, + $bitsAnySet?: any, + $comment?: string } - interface Selector extends Object { } - interface Modifier { } + + type Flatten = T extends any[] ? T[0] : T + + type Query = { + [P in keyof T]?: Flatten | RegExp | FieldExpression> + } & { + $or?: Query[], + $and?: Query[], + $nor?: Query[] + } & Dictionary + + type QueryWithModifiers = { + $query: Query, + $comment?: string, + $explain?: any, + $hint?: any, + $maxScan?: any, + $max?: any, + $maxTimeMS?: any, + $min?: any, + $orderby?: any, + $returnKey?: any, + $showDiskLoc?: any, + $natural?: any + } + + type Selector = Query | QueryWithModifiers + + type Dictionary = { [key: string]: T } + type PartialMapTo = Partial> + type OnlyArrays = T extends any[] ? T : never; + type OnlyElementsOfArrays = T extends any[] ? Partial : never + type ElementsOf = { + [P in keyof T]?: OnlyElementsOfArrays + } + type PushModifier = { + [P in keyof T]?: + OnlyElementsOfArrays | + { $each?: T[P], $position?: number, $slice?: number, $sort?: 1 | -1 | Dictionary } + } + type ArraysOrEach = { + [P in keyof T]?: OnlyArrays | { $each: T[P] } + } + type CurrentDateModifier = { $type: "timestamp" | "date" } | true + type Modifier = T | { + $currentDate?: Partial> & Dictionary, + $inc?: PartialMapTo & Dictionary, + $min?: PartialMapTo & Dictionary, + $max?: PartialMapTo & Dictionary, + $mul?: PartialMapTo & Dictionary, + $rename?: PartialMapTo & Dictionary, + $set?: Partial & Dictionary, + $setOnInsert?: Partial & Dictionary, + $unset?: PartialMapTo & Dictionary, + $addToSet?: ArraysOrEach & Dictionary, + $push?: PushModifier & Dictionary, + $pull?: ElementsOf & Dictionary, + $pullAll?: Partial & Dictionary, + $pop?: PartialMapTo & Dictionary<1 | -1>, + } + + interface SortSpecifier { } interface FieldSpecifier { [id: string]: Number; @@ -32,7 +144,7 @@ declare module Mongo { fetch?: string[]; transform?: Function; }): boolean; - find(selector?: Selector | ObjectID | string, options?: { + find(selector?: Selector | ObjectID | string, options?: { sort?: SortSpecifier; skip?: number; limit?: number; @@ -40,7 +152,7 @@ declare module Mongo { reactive?: boolean; transform?: Function; }): Cursor; - findOne(selector?: Selector | ObjectID | string, options?: { + findOne(selector?: Selector | ObjectID | string, options?: { sort?: SortSpecifier; skip?: number; fields?: FieldSpecifier; @@ -50,12 +162,12 @@ declare module Mongo { insert(doc: T, callback?: Function): string; rawCollection(): any; rawDatabase(): any; - remove(selector: Selector | ObjectID | string, callback?: Function): number; - update(selector: Selector | ObjectID | string, modifier: Modifier, options?: { + remove(selector: Selector | ObjectID | string, callback?: Function): number; + update(selector: Selector | ObjectID | string, modifier: Modifier, options?: { multi?: boolean; upsert?: boolean; }, callback?: Function): number; - upsert(selector: Selector | ObjectID | string, modifier: Modifier, options?: { + upsert(selector: Selector | ObjectID | string, modifier: Modifier, options?: { multi?: boolean; }, callback?: Function): { numberAffected?: number; insertedId?: string; @@ -101,7 +213,7 @@ declare module Mongo { var ObjectID: ObjectIDStatic; interface ObjectIDStatic { - new (hexString?: string): ObjectID; + new(hexString?: string): ObjectID; } interface ObjectID { toHexString(): string; @@ -113,11 +225,121 @@ declare module Mongo { declare module "meteor/mongo" { module Mongo { - interface Selector { - [key: string]: any; + type BsonType = 1 | "double" | + 2 | "string" | + 3 | "object" | + 4 | "array" | + 5 | "binData" | + 6 | "undefined" | + 7 | "objectId" | + 8 | "bool" | + 9 | "date" | + 10 | "null" | + 11 | "regex" | + 12 | "dbPointer" | + 13 | "javascript" | + 14 | "symbol" | + 15 | "javascriptWithScope" | + 16 | "int" | + 17 | "timestamp" | + 18 | "long" | + 19 | "decimal" | + -1 | "minKey" | + 127 | "maxKey" | "number" + + type FieldExpression = { + $eq?: T, + $gt?: T, + $gte?: T, + $lt?: T, + $lte?: T, + $in?: T[], + $nin?: T[], + $ne?: T, + $exists?: boolean, + $type?: BsonType[] | BsonType, + $not?: FieldExpression, + $expr?: FieldExpression, + $jsonSchema?: any, + $mod?: number[], + $regex?: RegExp | string, + $options?: string, + $text?: { $search: string, $language?: string, $caseSensitive?: boolean, $diacriticSensitive?: boolean }, + $where?: string | Function, + $geoIntersects?: any, + $geoWithin?: any, + $near?: any, + $nearSphere?: any, + $all?: T[], + $elemMatch?: T extends {} ? Query : FieldExpression, + $size?: number, + $bitsAllClear?: any, + $bitsAllSet?: any, + $bitsAnyClear?: any, + $bitsAnySet?: any, + $comment?: string } - interface Selector extends Object { } - interface Modifier { } + + type Flatten = T extends any[] ? T[0] : T + + type Query = { + [P in keyof T]?: Flatten | RegExp | FieldExpression> + } & { + $or?: Query[], + $and?: Query[], + $nor?: Query[] + } & Dictionary + + type QueryWithModifiers = { + $query: Query, + $comment?: string, + $explain?: any, + $hint?: any, + $maxScan?: any, + $max?: any, + $maxTimeMS?: any, + $min?: any, + $orderby?: any, + $returnKey?: any, + $showDiskLoc?: any, + $natural?: any + } + + type Selector = Query | QueryWithModifiers + + type Dictionary = { [key: string]: T } + type PartialMapTo = Partial> + type OnlyArrays = T extends any[] ? T : never; + type OnlyElementsOfArrays = T extends any[] ? Partial : never + type ElementsOf = { + [P in keyof T]?: OnlyElementsOfArrays + } + type PushModifier = { + [P in keyof T]?: + OnlyElementsOfArrays | + { $each?: T[P], $position?: number, $slice?: number, $sort?: 1 | -1 | Dictionary } + } + type ArraysOrEach = { + [P in keyof T]?: OnlyArrays | { $each: T[P] } + } + type CurrentDateModifier = { $type: "timestamp" | "date" } | true + type Modifier = T | { + $currentDate?: Partial> & Dictionary, + $inc?: PartialMapTo & Dictionary, + $min?: PartialMapTo & Dictionary, + $max?: PartialMapTo & Dictionary, + $mul?: PartialMapTo & Dictionary, + $rename?: PartialMapTo & Dictionary, + $set?: Partial & Dictionary, + $setOnInsert?: Partial & Dictionary, + $unset?: PartialMapTo & Dictionary, + $addToSet?: ArraysOrEach & Dictionary, + $push?: PushModifier & Dictionary, + $pull?: ElementsOf & Dictionary, + $pullAll?: Partial & Dictionary, + $pop?: PartialMapTo & Dictionary<1 | -1>, + } + interface SortSpecifier { } interface FieldSpecifier { [id: string]: Number; @@ -146,7 +368,7 @@ declare module "meteor/mongo" { fetch?: string[]; transform?: Function; }): boolean; - find(selector?: Selector | ObjectID | string, options?: { + find(selector?: Selector | ObjectID | string, options?: { sort?: SortSpecifier; skip?: number; limit?: number; @@ -154,7 +376,7 @@ declare module "meteor/mongo" { reactive?: boolean; transform?: Function; }): Cursor; - findOne(selector?: Selector | ObjectID | string, options?: { + findOne(selector?: Selector | ObjectID | string, options?: { sort?: SortSpecifier; skip?: number; fields?: FieldSpecifier; @@ -164,12 +386,12 @@ declare module "meteor/mongo" { insert(doc: T, callback?: Function): string; rawCollection(): any; rawDatabase(): any; - remove(selector: Selector | ObjectID | string, callback?: Function): number; - update(selector: Selector | ObjectID | string, modifier: Modifier, options?: { + remove(selector: Selector | ObjectID | string, callback?: Function): number; + update(selector: Selector | ObjectID | string, modifier: Modifier, options?: { multi?: boolean; upsert?: boolean; }, callback?: Function): number; - upsert(selector: Selector | ObjectID | string, modifier: Modifier, options?: { + upsert(selector: Selector | ObjectID | string, modifier: Modifier, options?: { multi?: boolean; }, callback?: Function): { numberAffected?: number; insertedId?: string; @@ -215,12 +437,12 @@ declare module "meteor/mongo" { var ObjectID: ObjectIDStatic; interface ObjectIDStatic { - new (hexString?: string): ObjectID; + new(hexString?: string): ObjectID; } interface ObjectID { toHexString(): string; equals(otherID: ObjectID): boolean; - } + } function setConnectionOptions(options: any): void; } From 64104e9760065bd498a3d62d98bb05ea26500dc2 Mon Sep 17 00:00:00 2001 From: AJ Richardson Date: Tue, 24 Apr 2018 19:03:38 -0400 Subject: [PATCH 046/564] Lowdb test fix (#25204) * lodash: _.get should with numeric keys, too. Also added some better tests. * lodash: add one more NumericDictionary overload for _.get * lodash: more reasonable index for _.get tests * lodash: object type should not be here (fixes #23293) * lodash: reduce should always return T if no accumulator (#14758) * lodash: fix iterator types, remove thisArg from documentation * lodash: return more specific type for stubTrue and stubFalse * lowdb: fix failing tests --- types/lodash/common/array.d.ts | 149 +- types/lodash/common/collection.d.ts | 312 +-- types/lodash/common/common.d.ts | 2 +- types/lodash/common/math.d.ts | 24 +- types/lodash/common/object.d.ts | 48 +- types/lodash/common/seq.d.ts | 4 +- types/lodash/common/util.d.ts | 12 +- types/lodash/fp.d.ts | 81 +- types/lodash/lodash-tests.ts | 157 +- types/lodash/readme.md | 4 +- types/lodash/scripts/generate-fp.ts | 35 +- types/lodash/scripts/generate-lowdb.ts | 165 ++ types/lodash/scripts/package.json | 4 +- types/lodash/scripts/utils.ts | 38 + types/lowdb/_lodash.d.ts | 3134 ++++++++++++++++++++++++ types/lowdb/index.d.ts | 347 +-- types/lowdb/lowdb-tests.ts | 73 +- types/lowdb/tslint.json | 75 +- 18 files changed, 3719 insertions(+), 945 deletions(-) create mode 100644 types/lodash/scripts/generate-lowdb.ts create mode 100644 types/lodash/scripts/utils.ts create mode 100644 types/lowdb/_lodash.d.ts diff --git a/types/lodash/common/array.d.ts b/types/lodash/common/array.d.ts index 34b9548221..5591bce088 100644 --- a/types/lodash/common/array.d.ts +++ b/types/lodash/common/array.d.ts @@ -577,20 +577,10 @@ declare module "../index" { interface LoDashStatic { /** * Creates a slice of array excluding elements dropped from the end. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * match the properties of the given object, else false. + * returns falsey. The predicate is invoked with three arguments: (value, index, array). * * @param array The array to query. * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. * @return Returns the slice of array. */ dropRightWhile( @@ -624,20 +614,10 @@ declare module "../index" { interface LoDashStatic { /** * Creates a slice of array excluding elements dropped from the beginning. Elements are dropped until predicate - * returns falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. + * returns falsey. The predicate is invoked with three arguments: (value, index, array). * * @param array The array to query. * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. * @return Returns the slice of array. */ dropWhile( @@ -797,15 +777,6 @@ declare module "../index" { * This method is like _.find except that it returns the index of the first element predicate returns truthy * for instead of the element itself. * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * * @param array The array to search. * @param predicate The function invoked per iteration. * @param fromIndex The index to search from. @@ -846,15 +817,6 @@ declare module "../index" { /** * This method is like _.findIndex except that it iterates over elements of collection from right to left. * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * * @param array The array to search. * @param predicate The function invoked per iteration. * @param fromIndex The index to search from. @@ -1881,22 +1843,12 @@ declare module "../index" { interface LoDashStatic { /** * Removes all elements from array that predicate returns truthy for and returns an array of the removed - * elements. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. + * elements. The predicate is invoked with three arguments: (value, index, array). * * Note: Unlike _.filter, this method mutates array. * * @param array The array to modify. * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. * @return Returns the new array of removed elements. */ remove( @@ -2359,53 +2311,29 @@ declare module "../index" { * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); * // => [1.1, 2.2] */ - sortedUniqBy( - array: string | null | undefined, - iteratee: StringIterator - ): string[]; - - /** - * @see _.sortedUniqBy - */ sortedUniqBy( array: List | null | undefined, - iteratee: ListIteratee + iteratee: ValueIteratee ): T[]; } interface LoDashImplicitWrapper { - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - this: LoDashImplicitWrapper, - iteratee: StringIterator - ): LoDashImplicitWrapper; - /** * @see _.sortedUniqBy */ sortedUniqBy( this: LoDashImplicitWrapper | null | undefined>, - iteratee: ListIteratee + iteratee: ValueIteratee ): LoDashImplicitWrapper; } interface LoDashExplicitWrapper { - /** - * @see _.sortedUniqBy - */ - sortedUniqBy( - this: LoDashExplicitWrapper, - iteratee: StringIterator - ): LoDashExplicitWrapper; - /** * @see _.sortedUniqBy */ sortedUniqBy( this: LoDashExplicitWrapper | null | undefined>, - iteratee: ListIteratee + iteratee: ValueIteratee ): LoDashExplicitWrapper; } @@ -2512,20 +2440,10 @@ declare module "../index" { interface LoDashStatic { /** * Creates a slice of array with elements taken from the end. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. + * falsey. The predicate is invoked with three arguments: (value, index, array). * * @param array The array to query. * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. * @return Returns the slice of array. */ takeRightWhile( @@ -2559,20 +2477,10 @@ declare module "../index" { interface LoDashStatic { /** * Creates a slice of array with elements taken from the beginning. Elements are taken until predicate returns - * falsey. The predicate is bound to thisArg and invoked with three arguments: (value, index, array). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. + * falsey. The predicate is invoked with three arguments: (value, index, array). * * @param array The array to query. * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. * @return Returns the slice of array. */ takeWhile( @@ -2958,53 +2866,29 @@ declare module "../index" { * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }, { 'x': 2 }] */ - uniqBy( - array: string | null | undefined, - iteratee: StringIterator - ): string[]; - - /** - * @see _.uniqBy - */ uniqBy( array: List | null | undefined, - iteratee: ListIteratee + iteratee: ValueIteratee ): T[]; } interface LoDashImplicitWrapper { - /** - * @see _.uniqBy - */ - uniqBy( - this: LoDashImplicitWrapper, - iteratee: StringIterator - ): LoDashImplicitWrapper; - /** * @see _.uniqBy */ uniqBy( this: LoDashImplicitWrapper | null | undefined>, - iteratee: ListIteratee + iteratee: ValueIteratee ): LoDashImplicitWrapper; } interface LoDashExplicitWrapper { - /** - * @see _.uniqBy - */ - uniqBy( - this: LoDashExplicitWrapper, - iteratee: StringIterator - ): LoDashExplicitWrapper; - /** * @see _.uniqBy */ uniqBy( this: LoDashExplicitWrapper | null | undefined>, - iteratee: ListIteratee + iteratee: ValueIteratee ): LoDashExplicitWrapper; } @@ -3085,12 +2969,10 @@ declare module "../index" { interface LoDashStatic { /** * This method is like _.unzip except that it accepts an iteratee to specify how regrouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, - * group). + * combined. The iteratee is invoked with four arguments: (accumulator, value, index, group). * * @param array The array of grouped elements to process. * @param iteratee The function to combine regrouped values. - * @param thisArg The this binding of iteratee. * @return Returns the new array of regrouped elements. */ unzipWith( @@ -3643,11 +3525,10 @@ declare module "../index" { interface LoDashStatic { /** * This method is like _.zip except that it accepts an iteratee to specify how grouped values should be - * combined. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, value, index, + * combined. The iteratee is invoked with four arguments: (accumulator, value, index, * group). - * @param [arrays] The arrays to process. - * @param [iteratee] The function to combine grouped values. - * @param [thisArg] The `this` binding of `iteratee`. + * @param arrays The arrays to process. + * @param iteratee The function to combine grouped values. * @return Returns the new array of grouped elements. */ zipWith( diff --git a/types/lodash/common/collection.d.ts b/types/lodash/common/collection.d.ts index 3c7e65d38f..2e38422b2d 100644 --- a/types/lodash/common/collection.d.ts +++ b/types/lodash/common/collection.d.ts @@ -6,34 +6,15 @@ declare module "../index" { /** * Creates an object composed of keys generated from the results of running each element of collection through * iteratee. The corresponding value of each key is the number of times the key was returned by iteratee. The - * iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. + * iteratee is invoked with one argument: (value). * * @param collection The collection to iterate over. * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. * @return Returns the composed aggregate object. */ - countBy( - collection: string | null | undefined, - iteratee?: StringIterator - ): Dictionary; - - /** - * @see _.countBy - */ countBy( collection: List | null | undefined, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): Dictionary; /** @@ -41,25 +22,17 @@ declare module "../index" { */ countBy( collection: T | null | undefined, - iteratee?: ObjectIteratee + iteratee?: ValueIteratee ): Dictionary; } interface LoDashImplicitWrapper { - /** - * @see _.countBy - */ - countBy( - this: LoDashImplicitWrapper, - iteratee?: StringIterator - ): LoDashImplicitWrapper>; - /** * @see _.countBy */ countBy( this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): LoDashImplicitWrapper>; /** @@ -67,25 +40,17 @@ declare module "../index" { */ countBy( this: LoDashImplicitWrapper, - iteratee?: ObjectIteratee + iteratee?: ValueIteratee ): LoDashImplicitWrapper>; } interface LoDashExplicitWrapper { - /** - * @see _.countBy - */ - countBy( - this: LoDashExplicitWrapper, - iteratee?: StringIterator - ): LoDashExplicitWrapper>; - /** * @see _.countBy */ countBy( this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): LoDashExplicitWrapper>; /** @@ -93,7 +58,7 @@ declare module "../index" { */ countBy( this: LoDashExplicitWrapper, - iteratee?: ObjectIteratee + iteratee?: ValueIteratee ): LoDashExplicitWrapper>; } @@ -243,20 +208,10 @@ declare module "../index" { interface LoDashStatic { /** * Iterates over elements of collection, returning an array of all elements predicate returns truthy for. The - * predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. + * predicate is invoked with three arguments: (value, index|key, collection). * * @param collection The collection to iterate over. * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. * @return Returns the new filtered array. */ filter( @@ -386,16 +341,7 @@ declare module "../index" { interface LoDashStatic { /** * Iterates over elements of collection, returning the first element predicate returns truthy for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. + * The predicate is invoked with three arguments: (value, index|key, collection). * * @param collection The collection to search. * @param predicate The function invoked per iteration. @@ -1070,8 +1016,7 @@ declare module "../index" { interface LoDashStatic { /** - * Iterates over elements of collection invoking iteratee for each element. The iteratee is bound to thisArg - * and invoked with three arguments: + * Iterates over elements of collection invoking iteratee for each element. The iteratee is invoked with three arguments: * (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false. * * Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To @@ -1081,7 +1026,6 @@ declare module "../index" { * * @param collection The collection to iterate over. * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. */ forEach( collection: T[], @@ -1189,7 +1133,6 @@ declare module "../index" { * * @param collection The collection to iterate over. * @param iteratee The function called per iteration. - * @param thisArg The this binding of callback. */ forEachRight( collection: T[], @@ -1293,34 +1236,15 @@ declare module "../index" { /** * Creates an object composed of keys generated from the results of running each element of collection through * iteratee. The corresponding value of each key is an array of the elements responsible for generating the - * key. The iteratee is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. + * key. The iteratee is invoked with one argument: (value). * * @param collection The collection to iterate over. * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. * @return Returns the composed aggregate object. */ - groupBy( - collection: string | null | undefined, - iteratee?: StringIterator - ): Dictionary; - - /** - * @see _.groupBy - */ groupBy( collection: List | null | undefined, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): Dictionary; /** @@ -1328,25 +1252,17 @@ declare module "../index" { */ groupBy( collection: T | null | undefined, - iteratee?: ObjectIteratee + iteratee?: ValueIteratee ): Dictionary>; } interface LoDashImplicitWrapper { - /** - * @see _.groupBy - */ - groupBy( - this: LoDashImplicitWrapper, - iteratee?: StringIterator - ): LoDashImplicitWrapper>; - /** * @see _.groupBy */ groupBy( this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): LoDashImplicitWrapper>; /** @@ -1354,25 +1270,17 @@ declare module "../index" { */ groupBy( this: LoDashImplicitWrapper, - iteratee?: ObjectIteratee + iteratee?: ValueIteratee ): LoDashImplicitWrapper>>; } interface LoDashExplicitWrapper { - /** - * @see _.groupBy - */ - groupBy( - this: LoDashExplicitWrapper, - iteratee?: StringIterator - ): LoDashExplicitWrapper>; - /** * @see _.groupBy */ groupBy( this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): LoDashExplicitWrapper>; /** @@ -1380,7 +1288,7 @@ declare module "../index" { */ groupBy( this: LoDashExplicitWrapper, - iteratee?: ObjectIteratee + iteratee?: ValueIteratee ): LoDashExplicitWrapper>>; } @@ -1489,34 +1397,15 @@ declare module "../index" { /** * Creates an object composed of keys generated from the results of running each element of collection through * iteratee. The corresponding value of each key is the last element responsible for generating the key. The - * iteratee function is bound to thisArg and invoked with three arguments: - * (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. + * iteratee function is invoked with one argument: (value). * * @param collection The collection to iterate over. * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. * @return Returns the composed aggregate object. */ - keyBy( - collection: string | null | undefined, - iteratee?: StringIterator - ): Dictionary; - - /** - * @see _.keyBy - */ keyBy( collection: List | null | undefined, - iteratee?: ListIterateeCustom + iteratee?: ValueIterateeCustom ): Dictionary; /** @@ -1524,25 +1413,17 @@ declare module "../index" { */ keyBy( collection: T | null | undefined, - iteratee?: ObjectIterateeCustom + iteratee?: ValueIterateeCustom ): Dictionary; } interface LoDashImplicitWrapper { - /** - * @see _.keyBy - */ - keyBy( - this: LoDashImplicitWrapper, - iteratee?: StringIterator - ): LoDashImplicitWrapper>; - /** * @see _.keyBy */ keyBy( this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ListIterateeCustom + iteratee?: ValueIterateeCustom ): LoDashImplicitWrapper>; /** @@ -1550,25 +1431,17 @@ declare module "../index" { */ keyBy( this: LoDashImplicitWrapper, - iteratee?: ObjectIterateeCustom + iteratee?: ValueIterateeCustom ): LoDashImplicitWrapper>; } interface LoDashExplicitWrapper { - /** - * @see _.keyBy - */ - keyBy( - this: LoDashExplicitWrapper, - iteratee?: StringIterator - ): LoDashExplicitWrapper>; - /** * @see _.keyBy */ keyBy( this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ListIterateeCustom + iteratee?: ValueIterateeCustom ): LoDashExplicitWrapper>; /** @@ -1576,7 +1449,7 @@ declare module "../index" { */ keyBy( this: LoDashExplicitWrapper, - iteratee?: ObjectIterateeCustom + iteratee?: ValueIterateeCustom ): LoDashExplicitWrapper>; } @@ -1584,17 +1457,8 @@ declare module "../index" { interface LoDashStatic { /** - * Creates an array of values by running each element in collection through iteratee. The iteratee is bound to - * thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for iteratee the created _.property style callback returns the property value - * of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for iteratee the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. + * Creates an array of values by running each element in collection through iteratee. The iteratee is + * invoked with three arguments: (value, index|key, collection). * * Many lodash methods are guarded to work as iteratees for methods like _.every, _.filter, _.map, _.mapValues, * _.reject, and _.some. @@ -1606,7 +1470,6 @@ declare module "../index" { * * @param collection The collection to iterate over. * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. * @return Returns the new mapped array. */ map( @@ -1908,20 +1771,10 @@ declare module "../index" { /** * Creates an array of elements split into two groups, the first of which contains elements predicate returns truthy for, * while the second of which contains elements predicate returns falsey for. - * The predicate is bound to thisArg and invoked with three arguments: (value, index|key, collection). - * - * If a property name is provided for predicate the created _.property style callback - * returns the property value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback - * returns true for elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns - * true for elements that have the properties of the given object, else false. + * The predicate is invoked with three arguments: (value, index|key, collection). * * @param collection The collection to iterate over. * @param callback The function called per iteration. - * @param thisArg The this binding of predicate. * @return Returns the array of grouped elements. **/ partition( @@ -1982,7 +1835,7 @@ declare module "../index" { * element in the collection through the callback, where each successive callback execution * consumes the return value of the previous execution. If accumulator is not provided the * first element of the collection will be used as the initial accumulator value. The callback - * is bound to thisArg and invoked with four arguments; (accumulator, value, index|key, collection). + * is invoked with four arguments: (accumulator, value, index|key, collection). * @param collection The collection to iterate over. * @param callback The function called per iteration. * @param accumulator Initial value of the accumulator. @@ -2015,26 +1868,26 @@ declare module "../index" { /** * @see _.reduce **/ - reduce( + reduce( collection: T[] | null | undefined, - callback: MemoListIterator - ): TResult | undefined; + callback: MemoListIterator + ): T | undefined; /** * @see _.reduce **/ - reduce( + reduce( collection: List | null | undefined, - callback: MemoListIterator> - ): TResult | undefined; + callback: MemoListIterator> + ): T | undefined; /** * @see _.reduce **/ - reduce( + reduce( collection: T | null | undefined, - callback: MemoObjectIterator - ): TResult | undefined; + callback: MemoObjectIterator + ): T[keyof T] | undefined; } interface LoDashImplicitWrapper { @@ -2068,26 +1921,26 @@ declare module "../index" { /** * @see _.reduce **/ - reduce( + reduce( this: LoDashImplicitWrapper, - callback: MemoListIterator - ): TResult | undefined; + callback: MemoListIterator + ): T | undefined; /** * @see _.reduce **/ - reduce( + reduce( this: LoDashImplicitWrapper | null | undefined>, - callback: MemoListIterator> - ): TResult | undefined; + callback: MemoListIterator> + ): T | undefined; /** * @see _.reduce **/ - reduce( + reduce( this: LoDashImplicitWrapper, - callback: MemoObjectIterator - ): TResult | undefined; + callback: MemoObjectIterator + ): T[keyof T] | undefined; } interface LoDashExplicitWrapper { @@ -2121,26 +1974,26 @@ declare module "../index" { /** * @see _.reduce **/ - reduce( + reduce( this: LoDashExplicitWrapper, - callback: MemoListIterator - ): LoDashExplicitWrapper; + callback: MemoListIterator + ): LoDashExplicitWrapper; /** * @see _.reduce **/ - reduce( + reduce( this: LoDashExplicitWrapper | null | undefined>, - callback: MemoListIterator> - ): LoDashExplicitWrapper; + callback: MemoListIterator> + ): LoDashExplicitWrapper; /** * @see _.reduce **/ - reduce( + reduce( this: LoDashExplicitWrapper, - callback: MemoObjectIterator - ): LoDashExplicitWrapper; + callback: MemoObjectIterator + ): LoDashExplicitWrapper; } // reduceRight @@ -2181,26 +2034,26 @@ declare module "../index" { /** * @see _.reduceRight **/ - reduceRight( + reduceRight( collection: T[] | null | undefined, - callback: MemoListIterator - ): TResult | undefined; + callback: MemoListIterator + ): T | undefined; /** * @see _.reduceRight **/ - reduceRight( + reduceRight( collection: List | null | undefined, - callback: MemoListIterator> - ): TResult | undefined; + callback: MemoListIterator> + ): T | undefined; /** * @see _.reduceRight **/ - reduceRight( + reduceRight( collection: T | null | undefined, - callback: MemoObjectIterator - ): TResult | undefined; + callback: MemoObjectIterator + ): T[keyof T] | undefined; } interface LoDashImplicitWrapper { @@ -2234,26 +2087,26 @@ declare module "../index" { /** * @see _.reduceRight **/ - reduceRight( + reduceRight( this: LoDashImplicitWrapper, - callback: MemoListIterator - ): TResult | undefined; + callback: MemoListIterator + ): T | undefined; /** * @see _.reduceRight **/ - reduceRight( + reduceRight( this: LoDashImplicitWrapper | null | undefined>, - callback: MemoListIterator> - ): TResult | undefined; + callback: MemoListIterator> + ): T | undefined; /** * @see _.reduceRight **/ - reduceRight( + reduceRight( this: LoDashImplicitWrapper, - callback: MemoObjectIterator - ): TResult | undefined; + callback: MemoObjectIterator + ): T[keyof T] | undefined; } interface LoDashExplicitWrapper { @@ -2287,26 +2140,26 @@ declare module "../index" { /** * @see _.reduceRight **/ - reduceRight( + reduceRight( this: LoDashExplicitWrapper, - callback: MemoListIterator - ): LoDashExplicitWrapper; + callback: MemoListIterator + ): LoDashExplicitWrapper; /** * @see _.reduceRight **/ - reduceRight( + reduceRight( this: LoDashExplicitWrapper | null | undefined>, - callback: MemoListIterator> - ): LoDashExplicitWrapper; + callback: MemoListIterator> + ): LoDashExplicitWrapper; /** * @see _.reduceRight **/ - reduceRight( + reduceRight( this: LoDashExplicitWrapper, - callback: MemoObjectIterator - ): LoDashExplicitWrapper; + callback: MemoObjectIterator + ): LoDashExplicitWrapper; } // reject @@ -2318,7 +2171,6 @@ declare module "../index" { * * @param collection The collection to iterate over. * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. * @return Returns the new filtered array. */ reject( diff --git a/types/lodash/common/common.d.ts b/types/lodash/common/common.d.ts index 17d5e04b36..28c4437073 100644 --- a/types/lodash/common/common.d.ts +++ b/types/lodash/common/common.d.ts @@ -182,7 +182,7 @@ declare module "../index" { type ArrayIterator = (value: T, index: number, collection: T[]) => TResult; type ListIterator = (value: T, index: number, collection: List) => TResult; type ListIteratee = ListIterator | string | [string, any] | PartialDeep; - type ListIterateeCustom = ListIterator | string | object | [string, any] | PartialDeep; + type ListIterateeCustom = ListIterator | string | [string, any] | PartialDeep; type ListIteratorTypeGuard = (value: T, index: number, collection: List) => value is S; // Note: key should be string, not keyof T, because the actual object may contain extra properties that were not specified in the type. diff --git a/types/lodash/common/math.d.ts b/types/lodash/common/math.d.ts index b38a7df970..640fbc429d 100644 --- a/types/lodash/common/math.d.ts +++ b/types/lodash/common/math.d.ts @@ -160,7 +160,7 @@ declare module "../index" { * * @category Math * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. + * @param iteratee The iteratee invoked per element. * @returns Returns the maximum value. * @example * @@ -175,7 +175,7 @@ declare module "../index" { */ maxBy( collection: List | null | undefined, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): T | undefined; } @@ -185,7 +185,7 @@ declare module "../index" { */ maxBy( this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): T | undefined; } @@ -195,7 +195,7 @@ declare module "../index" { */ maxBy( this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): LoDashExplicitWrapper; } @@ -240,7 +240,7 @@ declare module "../index" { * * @category Math * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. + * @param iteratee The iteratee invoked per element. * @returns Returns the mean. * @example * @@ -249,7 +249,7 @@ declare module "../index" { */ meanBy( collection: List | null | undefined, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): number; } @@ -259,7 +259,7 @@ declare module "../index" { */ meanBy( this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): number; } @@ -269,7 +269,7 @@ declare module "../index" { */ meanBy( this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): LoDashExplicitWrapper; } @@ -313,7 +313,7 @@ declare module "../index" { * * @category Math * @param array The array to iterate over. - * @param [iteratee=_.identity] The iteratee invoked per element. + * @param iteratee The iteratee invoked per element. * @returns Returns the minimum value. * @example * @@ -328,7 +328,7 @@ declare module "../index" { */ minBy( collection: List | null | undefined, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): T | undefined; } @@ -338,7 +338,7 @@ declare module "../index" { */ minBy( this: LoDashImplicitWrapper | null | undefined>, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): T | undefined; } @@ -348,7 +348,7 @@ declare module "../index" { */ minBy( this: LoDashExplicitWrapper | null | undefined>, - iteratee?: ListIteratee + iteratee?: ValueIteratee ): LoDashExplicitWrapper; } diff --git a/types/lodash/common/object.d.ts b/types/lodash/common/object.d.ts index 4845e7f31b..e0b1f3ebf1 100644 --- a/types/lodash/common/object.d.ts +++ b/types/lodash/common/object.d.ts @@ -1370,18 +1370,8 @@ declare module "../index" { * This method is like _.find except that it returns the key of the first element predicate returns truthy for * instead of the element itself. * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * * @param object The object to search. * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. * @return Returns the key of the matched element, else undefined. */ findKey( @@ -1416,18 +1406,8 @@ declare module "../index" { /** * This method is like _.findKey except that it iterates over elements of a collection in the opposite order. * - * If a property name is provided for predicate the created _.property style callback returns the property - * value of the given element. - * - * If a value is also provided for thisArg the created _.matchesProperty style callback returns true for - * elements that have a matching property value, else false. - * - * If an object is provided for predicate the created _.matches style callback returns true for elements that - * have the properties of the given object, else false. - * * @param object The object to search. * @param predicate The function invoked per iteration. - * @param thisArg The this binding of predicate. * @return Returns the key of the matched element, else undefined. */ findLastKey( @@ -1461,12 +1441,11 @@ declare module "../index" { interface LoDashStatic { /** * Iterates over own and inherited enumerable properties of an object invoking iteratee for each property. The - * iteratee is bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may + * iteratee is invoked with three arguments: (value, key, object). Iteratee functions may * exit iteration early by explicitly returning false. * * @param object The object to iterate over. * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. * @return Returns object. */ forIn( @@ -1501,7 +1480,6 @@ declare module "../index" { * * @param object The object to iterate over. * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. * @return Returns object. */ forInRight( @@ -1533,12 +1511,11 @@ declare module "../index" { interface LoDashStatic { /** * Iterates over own enumerable properties of an object invoking iteratee for each property. The iteratee is - * bound to thisArg and invoked with three arguments: (value, key, object). Iteratee functions may exit + * invoked with three arguments: (value, key, object). Iteratee functions may exit * iteration early by explicitly returning false. * * @param object The object to iterate over. * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. * @return Returns object. */ forOwn( @@ -1573,7 +1550,6 @@ declare module "../index" { * * @param object The object to iterate over. * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. * @return Returns object. */ forOwnRight( @@ -2199,7 +2175,6 @@ declare module "../index" { * * @param object The object to iterate over. * @param iteratee The function invoked per iteration. - * @param thisArg The this binding of iteratee. * @return Returns the new mapped object. */ mapKeys( @@ -2257,21 +2232,11 @@ declare module "../index" { interface LoDashStatic { /** * Creates an object with the same keys as object and values generated by running each own - * enumerable property of object through iteratee. The iteratee function is bound to thisArg - * and invoked with three arguments: (value, key, object). - * - * If a property name is provided iteratee the created "_.property" style callback returns - * the property value of the given element. - * - * If a value is also provided for thisArg the creted "_.matchesProperty" style callback returns - * true for elements that have a matching property value, else false;. - * - * If an object is provided for iteratee the created "_.matches" style callback returns true - * for elements that have the properties of the given object, else false. + * enumerable property of object through iteratee. The iteratee function is + * invoked with three arguments: (value, key, object). * * @param object The object to iterate over. - * @param [iteratee=_.identity] The function invoked per iteration. - * @param [thisArg] The `this` binding of `iteratee`. + * @param iteratee The function invoked per iteration. * @return Returns the new mapped object. */ mapValues(obj: string | null | undefined, callback: StringIterator): NumericDictionary; @@ -3363,13 +3328,12 @@ declare module "../index" { /** * An alternative to _.reduce; this method transforms object to a new accumulator object which is the result of * running each of its own enumerable properties through iteratee, with each invocation potentially mutating - * the accumulator object. The iteratee is bound to thisArg and invoked with four arguments: (accumulator, + * the accumulator object. The iteratee is invoked with four arguments: (accumulator, * value, key, object). Iteratee functions may exit iteration early by explicitly returning false. * * @param object The object to iterate over. * @param iteratee The function invoked per iteration. * @param accumulator The custom accumulator value. - * @param thisArg The this binding of iteratee. * @return Returns the accumulated value. */ transform( diff --git a/types/lodash/common/seq.d.ts b/types/lodash/common/seq.d.ts index 22a7a14746..bc3cc39963 100644 --- a/types/lodash/common/seq.d.ts +++ b/types/lodash/common/seq.d.ts @@ -141,13 +141,12 @@ declare module "../index" { interface LoDashStatic { /** - * This method invokes interceptor and returns value. The interceptor is bound to thisArg and invoked with one + * This method invokes interceptor and returns value. The interceptor is invoked with one * argument; (value). The purpose of this method is to "tap into" a method chain in order to perform operations * on intermediate results within the chain. * * @param value The value to provide to interceptor. * @param interceptor The function to invoke. - * @parem thisArg The this binding of interceptor. * @return Returns value. **/ tap( @@ -173,7 +172,6 @@ declare module "../index" { * * @param value The value to provide to interceptor. * @param interceptor The function to invoke. - * @param thisArg The this binding of interceptor. * @return Returns the result of interceptor. */ thru( diff --git a/types/lodash/common/util.d.ts b/types/lodash/common/util.d.ts index 8aad451ca1..80b06778fd 100644 --- a/types/lodash/common/util.d.ts +++ b/types/lodash/common/util.d.ts @@ -1250,21 +1250,21 @@ declare module "../index" { * * @returns Returns `false`. */ - stubFalse(): boolean; + stubFalse(): false; } interface LoDashImplicitWrapper { /** * @see _.stubFalse */ - stubFalse(): boolean; + stubFalse(): false; } interface LoDashExplicitWrapper { /** * @see _.stubFalse */ - stubFalse(): LoDashExplicitWrapper; + stubFalse(): LoDashExplicitWrapper; } // stubObject @@ -1325,21 +1325,21 @@ declare module "../index" { * * @returns Returns `true`. */ - stubTrue(): boolean; + stubTrue(): true; } interface LoDashImplicitWrapper { /** * @see _.stubTrue */ - stubTrue(): boolean; + stubTrue(): true; } interface LoDashExplicitWrapper { /** * @see _.stubTrue */ - stubTrue(): LoDashExplicitWrapper; + stubTrue(): LoDashExplicitWrapper; } // times diff --git a/types/lodash/fp.d.ts b/types/lodash/fp.d.ts index 725ee237aa..d577414aa4 100644 --- a/types/lodash/fp.d.ts +++ b/types/lodash/fp.d.ts @@ -350,20 +350,15 @@ declare namespace _ { type LodashContains1x1 = (collection: lodash.List | lodash.Dictionary | lodash.NumericDictionary | null | undefined) => boolean; type LodashContains1x2 = (target: T) => boolean; interface LodashCountBy { - (iteratee: (value: string) => T): LodashCountBy1x1; - (iteratee: lodash.__, collection: string | null | undefined): LodashCountBy1x2; - (iteratee: (value: string) => T, collection: string | null | undefined): lodash.Dictionary; - (iteratee: lodash.ValueIteratee): LodashCountBy2x1; - (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashCountBy2x2; + (iteratee: lodash.ValueIteratee): LodashCountBy1x1; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashCountBy1x2; (iteratee: lodash.ValueIteratee, collection: lodash.List | null | undefined): lodash.Dictionary; - (iteratee: lodash.__, collection: T | null | undefined): LodashCountBy3x2; + (iteratee: lodash.__, collection: T | null | undefined): LodashCountBy2x2; (iteratee: lodash.ValueIteratee, collection: T | null | undefined): lodash.Dictionary; } - type LodashCountBy1x1 = (collection: string | null | undefined) => lodash.Dictionary; - type LodashCountBy1x2 = (iteratee: (value: string) => T) => lodash.Dictionary; - type LodashCountBy2x1 = (collection: lodash.List | object | null | undefined) => lodash.Dictionary; - type LodashCountBy2x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary; - type LodashCountBy3x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary; + type LodashCountBy1x1 = (collection: lodash.List | object | null | undefined) => lodash.Dictionary; + type LodashCountBy1x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary; + type LodashCountBy2x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary; type LodashCreate = (prototype: T) => T & U; interface LodashCurry { (func: (t1: T1) => R): lodash.CurriedFunction1; @@ -744,7 +739,7 @@ declare namespace _ { } type LodashExtendWith1x5 = (object: TObject) => TObject & TSource; type LodashExtendWith1x6 = (customizer: lodash.AssignCustomizer) => TObject & TSource; - type LodashStubFalse = () => boolean; + type LodashStubFalse = () => false; interface LodashFill { (start: number): LodashFill1x1; (start: lodash.__, end: number): LodashFill1x2; @@ -1580,20 +1575,15 @@ declare namespace _ { type LodashGetOr4x5 = (path: lodash.PropertyPath) => any; type LodashGetOr4x6 = (defaultValue: any) => any; interface LodashGroupBy { - (iteratee: (value: string) => lodash.NotVoid): LodashGroupBy1x1; - (iteratee: lodash.__, collection: string | null | undefined): LodashGroupBy1x2; - (iteratee: (value: string) => lodash.NotVoid, collection: string | null | undefined): lodash.Dictionary; - (iteratee: lodash.ValueIteratee): LodashGroupBy2x1; - (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashGroupBy2x2; + (iteratee: lodash.ValueIteratee): LodashGroupBy1x1; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashGroupBy1x2; (iteratee: lodash.ValueIteratee, collection: lodash.List | null | undefined): lodash.Dictionary; - (iteratee: lodash.__, collection: T | null | undefined): LodashGroupBy3x2; + (iteratee: lodash.__, collection: T | null | undefined): LodashGroupBy2x2; (iteratee: lodash.ValueIteratee, collection: T | null | undefined): lodash.Dictionary>; } - type LodashGroupBy1x1 = (collection: string | null | undefined) => lodash.Dictionary; - type LodashGroupBy1x2 = (iteratee: (value: string) => lodash.NotVoid) => lodash.Dictionary; - type LodashGroupBy2x1 = (collection: lodash.List | object | null | undefined) => lodash.Dictionary; - type LodashGroupBy2x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary; - type LodashGroupBy3x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary>; + type LodashGroupBy1x1 = (collection: lodash.List | object | null | undefined) => lodash.Dictionary; + type LodashGroupBy1x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary; + type LodashGroupBy2x2 = (iteratee: lodash.ValueIteratee) => lodash.Dictionary>; interface LodashGt { (value: any): LodashGt1x1; (value: lodash.__, other: any): LodashGt1x2; @@ -1661,20 +1651,15 @@ declare namespace _ { type LodashIncludesFrom1x5 = (fromIndex: number) => boolean; type LodashIncludesFrom1x6 = (target: T) => boolean; interface LodashKeyBy { - (iteratee: (value: string) => lodash.PropertyName): LodashKeyBy1x1; - (iteratee: lodash.__, collection: string | null | undefined): LodashKeyBy1x2; - (iteratee: (value: string) => lodash.PropertyName, collection: string | null | undefined): lodash.Dictionary; - (iteratee: lodash.ValueIterateeCustom): LodashKeyBy2x1; - (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashKeyBy2x2; + (iteratee: lodash.ValueIterateeCustom): LodashKeyBy1x1; + (iteratee: lodash.__, collection: lodash.List | null | undefined): LodashKeyBy1x2; (iteratee: lodash.ValueIterateeCustom, collection: lodash.List | null | undefined): lodash.Dictionary; - (iteratee: lodash.__, collection: T | null | undefined): LodashKeyBy3x2; + (iteratee: lodash.__, collection: T | null | undefined): LodashKeyBy2x2; (iteratee: lodash.ValueIterateeCustom, collection: T | null | undefined): lodash.Dictionary; } - type LodashKeyBy1x1 = (collection: string | null | undefined) => lodash.Dictionary; - type LodashKeyBy1x2 = (iteratee: (value: string) => lodash.PropertyName) => lodash.Dictionary; - type LodashKeyBy2x1 = (collection: lodash.List | object | null | undefined) => lodash.Dictionary; - type LodashKeyBy2x2 = (iteratee: lodash.ValueIterateeCustom) => lodash.Dictionary; - type LodashKeyBy3x2 = (iteratee: lodash.ValueIterateeCustom) => lodash.Dictionary; + type LodashKeyBy1x1 = (collection: lodash.List | object | null | undefined) => lodash.Dictionary; + type LodashKeyBy1x2 = (iteratee: lodash.ValueIterateeCustom) => lodash.Dictionary; + type LodashKeyBy2x2 = (iteratee: lodash.ValueIterateeCustom) => lodash.Dictionary; interface LodashIndexOf { (value: T): LodashIndexOf1x1; (value: lodash.__, array: lodash.List | null | undefined): LodashIndexOf1x2; @@ -3546,17 +3531,12 @@ declare namespace _ { type LodashSortedLastIndexOf1x2 = (value: T) => number; type LodashSortedUniq = (array: lodash.List | null | undefined) => T[]; interface LodashSortedUniqBy { - (iteratee: (value: string) => lodash.NotVoid): LodashSortedUniqBy1x1; - (iteratee: lodash.__, array: string | null | undefined): LodashSortedUniqBy1x2; - (iteratee: (value: string) => lodash.NotVoid, array: string | null | undefined): string[]; - (iteratee: lodash.ValueIteratee): LodashSortedUniqBy2x1; - (iteratee: lodash.__, array: lodash.List | null | undefined): LodashSortedUniqBy2x2; + (iteratee: lodash.ValueIteratee): LodashSortedUniqBy1x1; + (iteratee: lodash.__, array: lodash.List | null | undefined): LodashSortedUniqBy1x2; (iteratee: lodash.ValueIteratee, array: lodash.List | null | undefined): T[]; } - type LodashSortedUniqBy1x1 = (array: string | null | undefined) => string[]; - type LodashSortedUniqBy1x2 = (iteratee: (value: string) => lodash.NotVoid) => string[]; - type LodashSortedUniqBy2x1 = (array: lodash.List | null | undefined) => T[]; - type LodashSortedUniqBy2x2 = (iteratee: lodash.ValueIteratee) => T[]; + type LodashSortedUniqBy1x1 = (array: lodash.List | null | undefined) => T[]; + type LodashSortedUniqBy1x2 = (iteratee: lodash.ValueIteratee) => T[]; interface LodashSplit { (separator: RegExp|string): LodashSplit1x1; (separator: lodash.__, string: string): LodashSplit1x2; @@ -3583,7 +3563,7 @@ declare namespace _ { type LodashStubArray = () => any[]; type LodashStubObject = () => any; type LodashStubString = () => string; - type LodashStubTrue = () => boolean; + type LodashStubTrue = () => true; interface LodashSubtract { (minuend: number): LodashSubtract1x1; (minuend: lodash.__, subtrahend: number): LodashSubtract1x2; @@ -3900,17 +3880,12 @@ declare namespace _ { type LodashUnionWith1x6 = (comparator: lodash.Comparator) => T[]; type LodashUniq = (array: lodash.List | null | undefined) => T[]; interface LodashUniqBy { - (iteratee: (value: string) => lodash.NotVoid): LodashUniqBy1x1; - (iteratee: lodash.__, array: string | null | undefined): LodashUniqBy1x2; - (iteratee: (value: string) => lodash.NotVoid, array: string | null | undefined): string[]; - (iteratee: lodash.ValueIteratee): LodashUniqBy2x1; - (iteratee: lodash.__, array: lodash.List | null | undefined): LodashUniqBy2x2; + (iteratee: lodash.ValueIteratee): LodashUniqBy1x1; + (iteratee: lodash.__, array: lodash.List | null | undefined): LodashUniqBy1x2; (iteratee: lodash.ValueIteratee, array: lodash.List | null | undefined): T[]; } - type LodashUniqBy1x1 = (array: string | null | undefined) => string[]; - type LodashUniqBy1x2 = (iteratee: (value: string) => lodash.NotVoid) => string[]; - type LodashUniqBy2x1 = (array: lodash.List | null | undefined) => T[]; - type LodashUniqBy2x2 = (iteratee: lodash.ValueIteratee) => T[]; + type LodashUniqBy1x1 = (array: lodash.List | null | undefined) => T[]; + type LodashUniqBy1x2 = (iteratee: lodash.ValueIteratee) => T[]; type LodashUniqueId = (prefix: string) => string; interface LodashUniqWith { (comparator: lodash.Comparator): LodashUniqWith1x1; diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index ee86770a2a..fbb164c4c5 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -1399,35 +1399,33 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; - const stringIterator = (value: string, index: number, collection: string) => ""; - const listIterator = (value: AbcObject, index: number, collection: _.List) => 0; - const stringIterator2 = (value: string) => ""; - const listIterator2 = (value: AbcObject) => 0; + const stringIterator = (value: string) => ""; + const valueIterator = (value: AbcObject) => 0; _.uniqBy("abc", stringIterator); // $ExpectType string[] - _.uniqBy(list, listIterator); // $ExpectType AbcObject[] + _.uniqBy(list, valueIterator); // $ExpectType AbcObject[] _.uniqBy(list, "a"); // $ExpectType AbcObject[] - _(list).uniqBy(listIterator); // $ExpectType LoDashImplicitWrapper + _(list).uniqBy(valueIterator); // $ExpectType LoDashImplicitWrapper _(list).uniqBy("a"); // $ExpectType LoDashImplicitWrapper - _.chain(list).uniqBy(listIterator); // $ExpectType LoDashExplicitWrapper + _.chain(list).uniqBy(valueIterator); // $ExpectType LoDashExplicitWrapper _.chain(list).uniqBy("a"); // $ExpectType LoDashExplicitWrapper - fp.uniqBy(stringIterator2, "abc"); // $ExpectType string[] - fp.uniqBy(listIterator2, list); // $ExpectType AbcObject[] - fp.uniqBy(listIterator2)(list); // $ExpectType AbcObject[] + fp.uniqBy(stringIterator, "abc"); // $ExpectType string[] + fp.uniqBy(valueIterator, list); // $ExpectType AbcObject[] + fp.uniqBy(valueIterator)(list); // $ExpectType AbcObject[] fp.uniqBy("a", list); // $ExpectType AbcObject[] _.sortedUniqBy("abc", stringIterator); // $ExpectType string[] - _.sortedUniqBy(list, listIterator); // $ExpectType AbcObject[] + _.sortedUniqBy(list, valueIterator); // $ExpectType AbcObject[] _.sortedUniqBy(list, "a"); // $ExpectType AbcObject[] - _(list).sortedUniqBy(listIterator); // $ExpectType LoDashImplicitWrapper + _(list).sortedUniqBy(valueIterator); // $ExpectType LoDashImplicitWrapper _(list).sortedUniqBy("a"); // $ExpectType LoDashImplicitWrapper - _.chain(list).sortedUniqBy(listIterator); // $ExpectType LoDashExplicitWrapper + _.chain(list).sortedUniqBy(valueIterator); // $ExpectType LoDashExplicitWrapper _.chain(list).sortedUniqBy("a"); // $ExpectType LoDashExplicitWrapper - fp.sortedUniqBy(stringIterator2, "abc"); // $ExpectType string[] - fp.sortedUniqBy(listIterator2, list); // $ExpectType AbcObject[] - fp.sortedUniqBy(listIterator2)(list); // $ExpectType AbcObject[] + fp.sortedUniqBy(stringIterator, "abc"); // $ExpectType string[] + fp.sortedUniqBy(valueIterator, list); // $ExpectType AbcObject[] + fp.sortedUniqBy(valueIterator)(list); // $ExpectType AbcObject[] fp.sortedUniqBy("a", list); // $ExpectType AbcObject[] } @@ -1725,26 +1723,24 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; const numericDictionary: _.NumericDictionary | null | undefined = anything; - const stringIterator = (value: string, index: number, collection: string) => 1; - const listIterator = (value: AbcObject, index: number, collection: _.List) => 1; - const dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => 1; - const numericDictionaryIterator = (value: AbcObject, key: string, collection: _.NumericDictionary) => 1; + const stringIterator = (value: string) => 1; + const valueIterator = (value: AbcObject) => 1; _.countBy(""); // $ExpectType Dictionary _.countBy("", stringIterator); // $ExpectType Dictionary _.countBy(list); // $ExpectType Dictionary - _.countBy(list, listIterator); // $ExpectType Dictionary + _.countBy(list, valueIterator); // $ExpectType Dictionary _.countBy(list, ""); // $ExpectType Dictionary _.countBy(list, { a: 42 }); // $ExpectType Dictionary _.countBy(dictionary); // $ExpectType Dictionary - _.countBy(dictionary, dictionaryIterator); // $ExpectType Dictionary + _.countBy(dictionary, valueIterator); // $ExpectType Dictionary _.countBy(dictionary, ""); // $ExpectType Dictionary _.countBy(dictionary, { a: 42 }); // $ExpectType Dictionary _.countBy(numericDictionary); // $ExpectType Dictionary - _.countBy(numericDictionary, numericDictionaryIterator); // $ExpectType Dictionary + _.countBy(numericDictionary, valueIterator); // $ExpectType Dictionary _.countBy(numericDictionary, ""); // $ExpectType Dictionary _.countBy(numericDictionary, { a: 42 }); // $ExpectType Dictionary @@ -1752,17 +1748,17 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper> _(list).countBy(); // $ExpectType LoDashImplicitWrapper> - _(list).countBy(listIterator); // $ExpectType LoDashImplicitWrapper> + _(list).countBy(valueIterator); // $ExpectType LoDashImplicitWrapper> _(list).countBy(""); // $ExpectType LoDashImplicitWrapper> _(list).countBy({ a: 42 }); // $ExpectType LoDashImplicitWrapper> _(dictionary).countBy(); // $ExpectType LoDashImplicitWrapper> - _(dictionary).countBy(dictionaryIterator); // $ExpectType LoDashImplicitWrapper> + _(dictionary).countBy(valueIterator); // $ExpectType LoDashImplicitWrapper> _(dictionary).countBy(""); // $ExpectType LoDashImplicitWrapper> _(dictionary).countBy({ a: 42 }); // $ExpectType LoDashImplicitWrapper> _(numericDictionary).countBy(); // $ExpectType LoDashImplicitWrapper> - _(numericDictionary).countBy(numericDictionaryIterator); // $ExpectType LoDashImplicitWrapper> + _(numericDictionary).countBy(valueIterator); // $ExpectType LoDashImplicitWrapper> _(numericDictionary).countBy(""); // $ExpectType LoDashImplicitWrapper> _(numericDictionary).countBy({ a: 42 }); // $ExpectType LoDashImplicitWrapper> @@ -1770,30 +1766,28 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper> _.chain(list).countBy(); // $ExpectType LoDashExplicitWrapper> - _.chain(list).countBy(listIterator); // $ExpectType LoDashExplicitWrapper> + _.chain(list).countBy(valueIterator); // $ExpectType LoDashExplicitWrapper> _.chain(list).countBy(""); // $ExpectType LoDashExplicitWrapper> _.chain(list).countBy({ a: 42 }); // $ExpectType LoDashExplicitWrapper> _.chain(dictionary).countBy(); // $ExpectType LoDashExplicitWrapper> - _.chain(dictionary).countBy(dictionaryIterator); // $ExpectType LoDashExplicitWrapper> + _.chain(dictionary).countBy(valueIterator); // $ExpectType LoDashExplicitWrapper> _.chain(dictionary).countBy(""); // $ExpectType LoDashExplicitWrapper> _.chain(dictionary).countBy({ a: 42 }); // $ExpectType LoDashExplicitWrapper> _.chain(numericDictionary).countBy(); // $ExpectType LoDashExplicitWrapper> - _.chain(numericDictionary).countBy(numericDictionaryIterator); // $ExpectType LoDashExplicitWrapper> + _.chain(numericDictionary).countBy(valueIterator); // $ExpectType LoDashExplicitWrapper> _.chain(numericDictionary).countBy(""); // $ExpectType LoDashExplicitWrapper> _.chain(numericDictionary).countBy({ a: 42 }); // $ExpectType LoDashExplicitWrapper> - const stringIterator2 = (value: string) => 1; - const listIterator2 = (value: AbcObject) => 1; - fp.countBy(stringIterator2, ""); // $ExpectType Dictionary - fp.countBy(stringIterator2)(""); // $ExpectType Dictionary - fp.countBy(listIterator2, list); // $ExpectType Dictionary + fp.countBy(stringIterator, ""); // $ExpectType Dictionary + fp.countBy(stringIterator)(""); // $ExpectType Dictionary + fp.countBy(valueIterator, list); // $ExpectType Dictionary fp.countBy("", list); // $ExpectType Dictionary fp.countBy({ a: 42 }, list); // $ExpectType Dictionary - fp.countBy(listIterator2, dictionary); // $ExpectType Dictionary + fp.countBy(valueIterator, dictionary); // $ExpectType Dictionary fp.countBy({ a: 42 }, dictionary); // $ExpectType Dictionary - fp.countBy(listIterator2, numericDictionary); // $ExpectType Dictionary + fp.countBy(valueIterator, numericDictionary); // $ExpectType Dictionary fp.countBy({ a: 42 }, numericDictionary); // $ExpectType Dictionary } @@ -2656,41 +2650,39 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = [] as any; const dictionary: _.Dictionary | null | undefined = anything; - const stringIterator = (char: string, index: number, string: string) => 0; - const listIterator = (value: AbcObject, index: number, collection: _.List) => 0; - const dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => 0; + const stringIterator = (char: string) => 0; const valueIterator = (value: AbcObject) => 0; _.groupBy(""); // $ExpectType Dictionary _.groupBy("", stringIterator); // $ExpectType Dictionary _.groupBy(list); // $ExpectType Dictionary - _.groupBy(list, listIterator); // $ExpectType Dictionary + _.groupBy(list, valueIterator); // $ExpectType Dictionary _.groupBy(list, "a"); // $ExpectType Dictionary _.groupBy(list, { a: 42 }); // $ExpectType Dictionary _.groupBy(dictionary); // $ExpectType Dictionary - _.groupBy(dictionary, dictionaryIterator); // $ExpectType Dictionary + _.groupBy(dictionary, valueIterator); // $ExpectType Dictionary _.groupBy(dictionary, ""); // $ExpectType Dictionary _.groupBy(dictionary, { a: 42 }); // $ExpectType Dictionary _("").groupBy(); // $ExpectType LoDashImplicitWrapper> - _("").groupBy((char: string, index: number, string: ArrayLike) => 0); // $ExpectType LoDashImplicitWrapper> + _("").groupBy(stringIterator); // $ExpectType LoDashImplicitWrapper> _(list).groupBy(); // $ExpectType LoDashImplicitWrapper> - _(list).groupBy(listIterator); // $ExpectType LoDashImplicitWrapper> + _(list).groupBy(valueIterator); // $ExpectType LoDashImplicitWrapper> _(list).groupBy(""); // $ExpectType LoDashImplicitWrapper> _(list).groupBy({ a: 42 }); // $ExpectType LoDashImplicitWrapper> _(dictionary).groupBy(); // $ExpectType LoDashImplicitWrapper> - _(dictionary).groupBy(dictionaryIterator); // $ExpectType LoDashImplicitWrapper> + _(dictionary).groupBy(valueIterator); // $ExpectType LoDashImplicitWrapper> _(dictionary).groupBy(""); // $ExpectType LoDashImplicitWrapper> _(dictionary).groupBy({ a: 42 }); // $ExpectType LoDashImplicitWrapper> _.chain("").groupBy(); // $ExpectType LoDashExplicitWrapper> - _.chain("").groupBy((char: string, index: number, string: ArrayLike) => 0); // $ExpectType LoDashExplicitWrapper> + _.chain("").groupBy(stringIterator); // $ExpectType LoDashExplicitWrapper> _.chain(list).groupBy(); // $ExpectType LoDashExplicitWrapper> - _.chain(list).groupBy(listIterator); // $ExpectType LoDashExplicitWrapper> + _.chain(list).groupBy(valueIterator); // $ExpectType LoDashExplicitWrapper> _.chain(list).groupBy(""); // $ExpectType LoDashExplicitWrapper> _.chain(list).groupBy({ a: 42 }); // $ExpectType LoDashExplicitWrapper> _.chain(dictionary).groupBy(); // $ExpectType LoDashExplicitWrapper> - _.chain(dictionary).groupBy(dictionaryIterator); // $ExpectType LoDashExplicitWrapper> + _.chain(dictionary).groupBy(valueIterator); // $ExpectType LoDashExplicitWrapper> _.chain(dictionary).groupBy(""); // $ExpectType LoDashExplicitWrapper> _.chain(dictionary).groupBy({ a: 42 }); // $ExpectType LoDashExplicitWrapper> @@ -2741,57 +2733,54 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper | null | undefined = anything; const numericDictionary: _.NumericDictionary | null | undefined = anything; - const stringIterator = (value: string, index: number, collection: string) => "a"; - const listIterator = (value: AbcObject, index: number, collection: _.List) => 1; - const dictionaryIterator = (value: AbcObject, key: string, collection: _.Dictionary) => Symbol.name; - const numericDictionaryIterator = (value: AbcObject, key: string, collection: _.NumericDictionary) => "a"; + const stringIterator = (value: string) => "a"; const valueIterator = (value: AbcObject) => 1; _.keyBy("abcd"); // $ExpectType Dictionary _.keyBy("abcd", stringIterator); // $ExpectType Dictionary _.keyBy(list); // $ExpectType Dictionary - _.keyBy(list, listIterator); // $ExpectType Dictionary + _.keyBy(list, valueIterator); // $ExpectType Dictionary _.keyBy(list, "a"); // $ExpectType Dictionary _.keyBy(list, { a: 42 }); // $ExpectType Dictionary _.keyBy(dictionary); // $ExpectType Dictionary - _.keyBy(dictionary, dictionaryIterator); // $ExpectType Dictionary + _.keyBy(dictionary, valueIterator); // $ExpectType Dictionary _.keyBy(dictionary, "a"); // $ExpectType Dictionary _.keyBy(dictionary, { a: 42 }); // $ExpectType Dictionary // These fail in TS 2.4 // _.keyBy(numericDictionary); // Dictionary - // _.keyBy(numericDictionary, numericDictionaryIterator); // Dictionary + // _.keyBy(numericDictionary, valueIterator); // Dictionary // _.keyBy(numericDictionary, "a"); // Dictionary // _.keyBy(numericDictionary, { a: 42 }); // Dictionary _("abcd").keyBy(); // $ExpectType LoDashImplicitWrapper> _("abcd").keyBy(stringIterator); // $ExpectType LoDashImplicitWrapper> _(list).keyBy(); // $ExpectType LoDashImplicitWrapper> - _(list).keyBy(listIterator); // $ExpectType LoDashImplicitWrapper> + _(list).keyBy(valueIterator); // $ExpectType LoDashImplicitWrapper> _(list).keyBy("a"); // $ExpectType LoDashImplicitWrapper> _(list).keyBy({ a: 42 }); // $ExpectType LoDashImplicitWrapper> _(dictionary).keyBy(); // $ExpectType LoDashImplicitWrapper> - _(dictionary).keyBy(dictionaryIterator); // $ExpectType LoDashImplicitWrapper> + _(dictionary).keyBy(valueIterator); // $ExpectType LoDashImplicitWrapper> _(dictionary).keyBy("a"); // $ExpectType LoDashImplicitWrapper> _(dictionary).keyBy({ a: 42 }); // $ExpectType LoDashImplicitWrapper> // These fail in TS 2.4 // _(numericDictionary).keyBy(); // LoDashImplicitWrapper> - // _(numericDictionary).keyBy(numericDictionaryIterator); // LoDashImplicitWrapper> + // _(numericDictionary).keyBy(valueIterator); // LoDashImplicitWrapper> // _(numericDictionary).keyBy("a"); // LoDashImplicitWrapper> // _(numericDictionary).keyBy({ a: 42 }); // LoDashImplicitWrapper> _.chain("abcd").keyBy(); // $ExpectType LoDashExplicitWrapper> _.chain("abcd").keyBy(stringIterator); // $ExpectType LoDashExplicitWrapper> _.chain(list).keyBy(); // $ExpectType LoDashExplicitWrapper> - _.chain(list).keyBy(listIterator); // $ExpectType LoDashExplicitWrapper> + _.chain(list).keyBy(valueIterator); // $ExpectType LoDashExplicitWrapper> _.chain(list).keyBy("a"); // $ExpectType LoDashExplicitWrapper> _.chain(list).keyBy({ a: 42 }); // $ExpectType LoDashExplicitWrapper> _.chain(dictionary).keyBy(); // $ExpectType LoDashExplicitWrapper> - _.chain(dictionary).keyBy(dictionaryIterator); // $ExpectType LoDashExplicitWrapper> + _.chain(dictionary).keyBy(valueIterator); // $ExpectType LoDashExplicitWrapper> _.chain(dictionary).keyBy("a"); // $ExpectType LoDashExplicitWrapper> _.chain(dictionary).keyBy({ a: 42 }); // $ExpectType LoDashExplicitWrapper> // These fail in TS 2.4 // _.chain(numericDictionary).keyBy(); // LoDashExplicitWrapper> - // _.chain(numericDictionary).keyBy(numericDictionaryIterator); // LoDashExplicitWrapper> + // _.chain(numericDictionary).keyBy(valueIterator); // LoDashExplicitWrapper> // _.chain(numericDictionary).keyBy("a"); // LoDashExplicitWrapper> // _.chain(numericDictionary).keyBy({ a: 42 }); // LoDashExplicitWrapper> @@ -3085,27 +3074,34 @@ _.chain([1, 2, 3, 4]).unshift(5, 6); // $ExpectType LoDashExplicitWrapper sum + num); // $ExpectType number | undefined + // $ExpectType number | undefined + _.reduce([1, 2, 3], (sum, curr, key, coll) => { + sum; // $ExpectType number + curr; // $ExpectType number + key; // $ExpectType number + coll; // $ExpectType number[] + return sum + curr; + }); _.reduce(null, (sum: number, num: number) => sum + num); // $ExpectType number | undefined _.reduce({ a: 1, b: 2, c: 3 }, (r: ABC, num: number, key: string) => r, initial); // $ExpectType ABC - _([1, 2, 3]).reduce((sum: number, num: number) => sum + num); // $ExpectType number | undefined + _([1, 2, 3]).reduce((sum, num) => sum + num); // $ExpectType number | undefined _({ a: 1, b: 2, c: 3 }).reduce((r: ABC, num: number, key: string) => r, initial); // $ExpectType ABC - _.chain([1, 2, 3]).reduce((sum: number, num: number) => sum + num); // $ExpectType LoDashExplicitWrapper + _.chain([1, 2, 3]).reduce((sum, num) => sum + num); // $ExpectType LoDashExplicitWrapper _.chain({ a: 1, b: 2, c: 3 }).reduce((r: ABC, num: number, key: string) => r, initial); // $ExpectType LoDashExplicitWrapper fp.reduce((s: string, num: number) => s + num, "", [1, 2, 3]); // $ExpectType string fp.reduce((s: string, num: number) => s + num)("")([1, 2, 3]); // $ExpectType string - _.reduceRight([1, 2, 3], (sum: number, num: number) => sum + num); // $ExpectType number | undefined + _.reduceRight([1, 2, 3], (sum, num) => sum + num); // $ExpectType number | undefined _.reduceRight(null, (sum: number, num: number) => sum + num); // $ExpectType number | undefined _.reduceRight({ a: 1, b: 2, c: 3 }, (r: ABC, num: number, key: string) => r, initial); // $ExpectType ABC - _([1, 2, 3]).reduceRight((sum: number, num: number) => sum + num); // $ExpectType number | undefined + _([1, 2, 3]).reduceRight((sum, num) => sum + num); // $ExpectType number | undefined _({ a: 1, b: 2, c: 3 }).reduceRight((r: ABC, num: number, key: string) => r, initial); // $ExpectType ABC - _.chain([1, 2, 3]).reduceRight((sum: number, num: number) => sum + num); // $ExpectType LoDashExplicitWrapper + _.chain([1, 2, 3]).reduceRight((sum, num) => sum + num); // $ExpectType LoDashExplicitWrapper _.chain({ a: 1, b: 2, c: 3 }).reduceRight((r: ABC, num: number, key: string) => r, initial); // $ExpectType LoDashExplicitWrapper fp.reduceRight((num: number, s: string) => s + num, "", [1, 2, 3]); // $ExpectType string @@ -4886,29 +4882,28 @@ fp.now(); // $ExpectType number { const list: ArrayLike = anything; - const listIterator = (value: AbcObject, index: number, collection: ArrayLike) => 0; const valueIterator = (value: AbcObject) => 0; - _.maxBy(list, listIterator); // $ExpectType AbcObject | undefined + _.maxBy(list, valueIterator); // $ExpectType AbcObject | undefined _.maxBy(list, "a"); // $ExpectType AbcObject | undefined _.maxBy(list, { a: 42 }); // $ExpectType AbcObject | undefined - _(list).maxBy(listIterator); // $ExpectType AbcObject | undefined + _(list).maxBy(valueIterator); // $ExpectType AbcObject | undefined _(list).maxBy("a"); // $ExpectType AbcObject | undefined _(list).maxBy({ a: 42 }); // $ExpectType AbcObject | undefined - _.chain(list).maxBy(listIterator); // $ExpectType LoDashExplicitWrapper + _.chain(list).maxBy(valueIterator); // $ExpectType LoDashExplicitWrapper _.chain(list).maxBy("a"); // $ExpectType LoDashExplicitWrapper _.chain(list).maxBy({ a: 42 }); // $ExpectType LoDashExplicitWrapper fp.maxBy(valueIterator)(list); // $ExpectType AbcObject | undefined fp.maxBy("a", list); // $ExpectType AbcObject | undefined fp.maxBy({ a: 42 }, list); // $ExpectType AbcObject | undefined - _.minBy(list, listIterator); // $ExpectType AbcObject | undefined + _.minBy(list, valueIterator); // $ExpectType AbcObject | undefined _.minBy(list, "a"); // $ExpectType AbcObject | undefined _.minBy(list, { a: 42 }); // $ExpectType AbcObject | undefined - _(list).minBy(listIterator); // $ExpectType AbcObject | undefined + _(list).minBy(valueIterator); // $ExpectType AbcObject | undefined _(list).minBy("a"); // $ExpectType AbcObject | undefined _(list).minBy({ a: 42 }); // $ExpectType AbcObject | undefined - _.chain(list).minBy(listIterator); // $ExpectType LoDashExplicitWrapper + _.chain(list).minBy(valueIterator); // $ExpectType LoDashExplicitWrapper _.chain(list).minBy("a"); // $ExpectType LoDashExplicitWrapper _.chain(list).minBy({ a: 42 }); // $ExpectType LoDashExplicitWrapper fp.minBy(valueIterator)(list); // $ExpectType AbcObject | undefined @@ -7139,10 +7134,10 @@ fp.now(); // $ExpectType number // _.stubFalse { - _.stubFalse(); // $ExpectType boolean - _(anything).stubFalse(); // $ExpectType boolean - _.chain(anything).stubFalse(); // $ExpectType LoDashExplicitWrapper - fp.stubFalse(); // $ExpectType boolean + _.stubFalse(); // $ExpectType false + _(anything).stubFalse(); // $ExpectType false + _.chain(anything).stubFalse(); // $ExpectType LoDashExplicitWrapper + fp.stubFalse(); // $ExpectType false } // _.stubObject @@ -7163,10 +7158,10 @@ fp.now(); // $ExpectType number // _.stubTrue { - _.stubTrue(); // $ExpectType boolean - _(anything).stubTrue(); // $ExpectType boolean - _.chain(anything).stubTrue(); // $ExpectType LoDashExplicitWrapper - fp.stubTrue(); // $ExpectType boolean + _.stubTrue(); // $ExpectType true + _(anything).stubTrue(); // $ExpectType true + _.chain(anything).stubTrue(); // $ExpectType LoDashExplicitWrapper + fp.stubTrue(); // $ExpectType true } // _.times diff --git a/types/lodash/readme.md b/types/lodash/readme.md index d65d7f878f..e605e30784 100644 --- a/types/lodash/readme.md +++ b/types/lodash/readme.md @@ -18,7 +18,7 @@ You should not modify these scripts directly - you should use a script to re-generate them (see below). - `scripts` directory: contains code generation scripts. - Before running any scripts, run `npm install` in this directory (it contains its own `package.json`). - - Most notable script is `npm run fp`, which re-generates all of the `fp` files. + - Most notable script is `npm run generate`, which re-generates all of the `fp` files and `lowdb` wrapper extensions. - `v3` directory: contains types for lodash v3. ## Different ways people might use lodash @@ -38,7 +38,7 @@ ## Before creating a PR - For every function you modify, don't forget to update the corresponding wrapper functions. -- Re-generate the `fp` types by opening a terminal in the `scripts` directory and running `npm run fp`. +- Re-generate the `fp` types by opening a terminal in the `scripts` directory and running `npm run generate`. - Note that this directory has its own `package.json`, so you'll need to run `npm install` first if you haven't already. - Back at the root directory, do `npm run lint lodash` and make sure there are no errors. diff --git a/types/lodash/scripts/generate-fp.ts b/types/lodash/scripts/generate-fp.ts index 3b8320b59c..77f11b46ac 100644 --- a/types/lodash/scripts/generate-fp.ts +++ b/types/lodash/scripts/generate-fp.ts @@ -13,6 +13,7 @@ import fs from "fs"; import _ from "lodash"; import convert from "lodash/fp/convert"; import path from "path"; +import { readFile, getLineBreak, tab, getLineNumber } from "./utils"; interface Definition { name: string; @@ -45,10 +46,8 @@ interface TypeParam { let lineBreak = "\n"; async function main() { + lineBreak = await getLineBreak(); const commonTypes: string[] = []; - const tsconfigPath = path.join("..", "tsconfig.json"); - const tsconfigFile = await readFile(tsconfigPath); - lineBreak = _.find(["\r\n", "\n", "\r"], x => tsconfigFile.includes(x)) || "\n"; // Read each function definition and fp-ify it const subfolders = ["common"]; @@ -106,7 +105,7 @@ async function main() { const fpFile = [ "// AUTO-GENERATED: do not modify this file directly.", "// If you need to make changes, modify generate-fp.ts (if necessary), then open a terminal in types/lodash/scripts, and do:", - "// npm run fp", + "// npm install && npm run generate", "", 'import lodash = require("./index");', "", @@ -130,6 +129,8 @@ async function main() { }); // Make sure the generated files are listed in tsconfig.json, so they are included in the lint checks + const tsconfigPath = path.join("..", "tsconfig.json"); + const tsconfigFile = await readFile(tsconfigPath); const tsconfig = tsconfigFile.split(lineBreak).filter(row => !row.includes("fp/") || row.includes("fp/convert.d.ts")); const newRows = interfaceGroups.map(g => ` "fp/${g.functionName}.d.ts",`) .concat(["__", "placeholder"].map(p => ` "fp/${p}.d.ts",`)); @@ -146,22 +147,6 @@ async function main() { }); } -function readFile(filePath: string): Promise { - return new Promise((resolve, reject) => { - fs.readFile(filePath, "utf8", (err, data) => { - if (err) { - reject(err); - return; - } - try { - resolve(data); - } catch (e) { - reject(e); - } - }); - }); -} - async function processDefinitions(filePaths: string[], commonTypes: string[]): Promise { const builder: { [name: string]: (...args: number[][]) => () => Interface[] } = {}; const unconvertedBuilder: { [name: string]: (...args: number[][]) => () => Interface[] } = {}; @@ -255,7 +240,6 @@ async function parseFile(filePath: string, commonTypes: string[]): Promise !_.isEmpty(d.constants)); return definitons; } @@ -899,15 +883,6 @@ function getPreviousLine(s: string, index: number): string { return s.substring(bol + 1, eol); } -function getLineNumber(fileContents: string, index: number) { - return fileContents.substring(0, index).split(lineBreak).length + 1; -} - -function tab(s: string, count: number) { - const prepend: string = " ".repeat(count * 4); - return (s[0] === "\n" || s[0] === "\r" ? "" : prepend) + s.replace(/(?:\r\n|\n|\r)(.)/g, `${lineBreak}${prepend}$1`); -} - function indexOfAny(source: string, values: string[], position?: number): number { const indexes: number[] = []; for (const value of values) { diff --git a/types/lodash/scripts/generate-lowdb.ts b/types/lodash/scripts/generate-lowdb.ts new file mode 100644 index 0000000000..13fbd18fe4 --- /dev/null +++ b/types/lodash/scripts/generate-lowdb.ts @@ -0,0 +1,165 @@ +// Script for converting the lodash types into functional programming (FP) format. +// The convertion is done based on this guide: https://github.com/lodash/lodash/wiki/FP-Guide + +// Assumptions: +// - All functions are defined in one of the files in the "common" subfolder +// - All functions are defined inside of the LoDashStatic interface (although functions like _.partial may refer to another interface in the same file) +// - Consistent indentation is used for the start and end of the above interface +// - Consistent spacing is used for interface definitions: interface MyInterface { +// - Consistent line breaks (\n, \r, or \r\n) are used in all files +// - All overloads of a given function are defined in the same file + +import fs from "fs"; +import _ from "lodash"; +import path from "path"; +import { getLineBreak, getLineNumber } from "./utils"; + +interface Definition { + name: string; + overloads: Overload[]; + constants: string[]; + jsdoc: string; +} +interface InterfaceGroup { + functionName: string; + interfaces: Interface[]; +} +interface Interface { + name: string; + typeParams: TypeParam[]; + overloads: Overload[]; + constants: string[]; +} +interface Overload { + typeParams: TypeParam[]; + params: string[]; + returnType: string; + jsdoc: string; + tslintDisable?: string; +} +interface TypeParam { + name: string; + extends?: string; + equals?: string; +} + +// Get the correct line break for the current OS (git for windows will generally convert \n to \r\n during checkout) +let lineBreak = "\n"; +async function main() { + lineBreak = await getLineBreak(); + const commonTypes: string[] = []; + const tsconfigPath = path.join("..", "tsconfig.json"); + + const subfolders = ["common"]; + const promises: Array> = []; + for (const subfolder of subfolders) { + promises.push(new Promise((resolve, reject) => { + fs.readdir(path.join("..", subfolder), (err, files) => { + if (err) { + console.error(`failed to list directory contents for '${subfolder}': `, err); + reject(err); + return; + } + const filePaths = files.map(f => path.join("..", subfolder, f)); + try { + resolve(processDefinitions(filePaths, commonTypes)); + } catch (e) { + console.error(`failed to process files in '${subfolder}': `, e); + reject(e); + } + }); + })); + } + + let functions: string; + try { + functions = _.flatten(await Promise.all(promises)).join(lineBreak); + } catch (err) { + console.error("Failed to parse all functions: ", err); + return; + } + _.pull(commonTypes, "LoDashExplicitWrapper"); + const commonTypeSearch = new RegExp(`\\b(${commonTypes.join("|")})\\b`, "g"); + functions = functions.replace(commonTypeSearch, "_.$1"); + const syncFunctions = functions.replace(/\bLoDashExplicitWrapper\b/g, "LoDashExplicitSyncWrapper"); + const asyncFunctions = functions.replace(/\bLoDashExplicitWrapper\b/g, "LoDashExplicitAsyncWrapper"); + + const lodashFile = [ + "// AUTO-GENERATED: do not modify this file directly.", + "// If you need to make changes, modify types/lodash/scripts/generate-lowdb.ts (if necessary), then open a terminal in types/lodash/scripts, and do:", + "// npm install && npm run generate", + "", + 'import _ = require("lodash");', + 'declare module "./index" {', + " interface LoDashExplicitSyncWrapper {", + syncFunctions, // TODO: write sync? + " }", + "", + " interface LoDashExplicitAsyncWrapper {", + asyncFunctions, // TODO: write async? + " }", + "}", + "", + ].join(lineBreak); + const lodashFilePath = path.resolve(__dirname, "..", "..", "lowdb", "_lodash.d.ts"); + fs.writeFile(lodashFilePath, lodashFile, (err) => { + if (err) + console.error(`Failed to write ${lodashFilePath}: `, err); + }); +} + +function readFile(filePath: string): Promise { + return new Promise((resolve, reject) => { + fs.readFile(filePath, "utf8", (err, data) => { + if (err) { + reject(err); + return; + } + try { + resolve(data); + } catch (e) { + reject(e); + } + }); + }); +} + +async function processDefinitions(filePaths: string[], commonTypes: string[]): Promise { + const functions: string[] = []; + for (const filePath of filePaths) + functions.push(...await parseFile(filePath, commonTypes)); + return functions; +} + +async function parseFile(filePath: string, commonTypes: string[]): Promise { + const definitionString = await readFile(filePath); + const newCommonTypeRegExp = / (?:type|interface) ([A-Za-z0-9_]+)/g; + let newCommonType = newCommonTypeRegExp.exec(definitionString); + while (newCommonType) { + if (!commonTypes.includes(newCommonType[1])) + commonTypes.push(newCommonType[1]); + newCommonType = newCommonTypeRegExp.exec(definitionString); + } + + const functions: string[] = []; + const lodashWrapperRegExp = /( *)interface +LoDashExplicitWrapper<\w+> *(?:extends .+)? *{/g; + let lodashWrapperMatch = lodashWrapperRegExp.exec(definitionString); + while (lodashWrapperMatch) { + const startIndex = definitionString.indexOf(lineBreak, lodashWrapperMatch.index) + lineBreak.length; + const endIndex = definitionString.indexOf(`${lineBreak}${lodashWrapperMatch[1]}}`, startIndex); + if (endIndex === -1) { + const lineNumber = getLineNumber(definitionString, startIndex); + console.warn(`Failed to find end of interface 'LoDashExplicitWrapper' (starting at ${filePath} line ${lineNumber}).`); + break; + } + let functionString = definitionString.substring(startIndex, endIndex); + // Remove comments since they're generally useless (e.g. @see XXXX) + functionString = functionString.replace(/ *\/\*\*[\s\S]+?\*\/(?:\r\n|\n|\r)/g, ""); + functionString = functionString.replace(/(?:(\r\n){2,}|(\n){2,}|(\r){2,})/g, "$1$2$3"); + functions.push(functionString); + lodashWrapperMatch = lodashWrapperRegExp.exec(definitionString); + } + return functions; +} + +main(); diff --git a/types/lodash/scripts/package.json b/types/lodash/scripts/package.json index f98c233642..a91ecd226e 100644 --- a/types/lodash/scripts/package.json +++ b/types/lodash/scripts/package.json @@ -3,7 +3,9 @@ "name": "lodash-scripts", "version": "0.0.1", "scripts": { - "fp": "ts-node generate-fp" + "generate": "ts-node generate-fp && ts-node generate-lowdb", + "fp": "ts-node generate-fp", + "lowdb": "ts-node generate-lowdb" }, "devDependencies": { "lodash": "^4.17.4", diff --git a/types/lodash/scripts/utils.ts b/types/lodash/scripts/utils.ts new file mode 100644 index 0000000000..59bdd448a9 --- /dev/null +++ b/types/lodash/scripts/utils.ts @@ -0,0 +1,38 @@ +import fs from "fs"; +import _ from "lodash"; +import path from "path"; + +export function readFile(filePath: string): Promise { + return new Promise((resolve, reject) => { + fs.readFile(filePath, "utf8", (err, data) => { + if (err) { + reject(err); + return; + } + try { + resolve(data); + } catch (e) { + reject(e); + } + }); + }); +} + +let lineBreak = "\n"; + +/** Gets the correct line break for the current OS (git for windows will generally convert \n to \r\n during checkout) */ +export async function getLineBreak(): Promise { + const tsconfigPath = path.join("..", "tsconfig.json"); + const tsconfigFile = await readFile(tsconfigPath); + lineBreak = _.find(["\r\n", "\n", "\r"], x => tsconfigFile.includes(x)) || "\n"; + return lineBreak; +} + +export function getLineNumber(fileContents: string, index: number) { + return fileContents.substring(0, index).split(/\r\n|\n|\r/g).length + 1; +} + +export function tab(s: string, count: number) { + const prepend: string = " ".repeat(count * 4); + return (s[0] === "\n" || s[0] === "\r" ? "" : prepend) + s.replace(/(?:\r\n|\n|\r)(.)/g, `${lineBreak}${prepend}$1`); +} diff --git a/types/lowdb/_lodash.d.ts b/types/lowdb/_lodash.d.ts new file mode 100644 index 0000000000..78ff4901af --- /dev/null +++ b/types/lowdb/_lodash.d.ts @@ -0,0 +1,3134 @@ +// AUTO-GENERATED: do not modify this file directly. +// If you need to make changes, modify types/lodash/scripts/generate-lowdb.ts (if necessary), then open a terminal in types/lodash/scripts, and do: +// npm install && npm run generate + +import _ = require("lodash"); +declare module "./index" { + interface LoDashExplicitSyncWrapper { + chunk( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + size?: number, + ): LoDashExplicitSyncWrapper; + compact(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; + concat(this: LoDashExplicitSyncWrapper<_.Many>, ...values: Array<_.Many>): LoDashExplicitSyncWrapper; + difference( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + ...values: Array<_.List> + ): LoDashExplicitSyncWrapper; + differenceBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + differenceBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + differenceBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + values3: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + differenceBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + values3: _.List, + values4: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + differenceBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + values3: _.List, + values4: _.List, + values5: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + differenceBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + values3: _.List, + values4: _.List, + values5: _.List, + ...values: Array<_.List | _.ValueIteratee> + ): LoDashExplicitSyncWrapper; + differenceBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + ...values: Array<_.List> + ): LoDashExplicitSyncWrapper; + differenceWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values: _.List, + comparator: _.Comparator2 + ): LoDashExplicitSyncWrapper; + differenceWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + comparator: _.Comparator2 + ): LoDashExplicitSyncWrapper; + differenceWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + ...values: Array<_.List | _.Comparator2> + ): LoDashExplicitSyncWrapper; + differenceWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + ...values: Array<_.List> + ): LoDashExplicitSyncWrapper; + drop(this: LoDashExplicitSyncWrapper<_.List | null | undefined>, n?: number): LoDashExplicitSyncWrapper; + dropRight(this: LoDashExplicitSyncWrapper<_.List | null | undefined>, n?: number): LoDashExplicitSyncWrapper; + dropRightWhile( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate?: _.ListIteratee + ): LoDashExplicitSyncWrapper; + dropWhile( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate?: _.ListIteratee + ): LoDashExplicitSyncWrapper; + fill( + this: LoDashExplicitSyncWrapper, + value: T + ): LoDashExplicitSyncWrapper; + fill( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + value: T + ): LoDashExplicitSyncWrapper<_.List>; + fill( + this: LoDashExplicitSyncWrapper, + value: T, + start?: number, + end?: number + ): LoDashExplicitSyncWrapper>; + fill( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + value: T, + start?: number, + end?: number + ): LoDashExplicitSyncWrapper<_.List>; + findIndex( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom, + fromIndex?: number + ): LoDashExplicitSyncWrapper; + findLastIndex( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom, + fromIndex?: number + ): LoDashExplicitSyncWrapper; + first(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; + flatten(this: LoDashExplicitSyncWrapper<_.List<_.Many> | null | undefined>): LoDashExplicitSyncWrapper; + flattenDeep(this: LoDashExplicitSyncWrapper<_.ListOfRecursiveArraysOrValues | null | undefined>): LoDashExplicitSyncWrapper; + flattenDepth(this: LoDashExplicitSyncWrapper<_.ListOfRecursiveArraysOrValues | null | undefined>, depth?: number): LoDashExplicitSyncWrapper; + fromPairs( + this: LoDashExplicitSyncWrapper<_.List<[_.PropertyName, T]> | null | undefined> + ): LoDashExplicitSyncWrapper<_.Dictionary>; + fromPairs( + this: LoDashExplicitSyncWrapper<_.List | null | undefined> + ): LoDashExplicitSyncWrapper<_.Dictionary>; + head(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; + indexOf( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + value: T, + fromIndex?: number + ): LoDashExplicitSyncWrapper; + initial(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; + intersection( + this: LoDashExplicitSyncWrapper<_.List>, + ...arrays: Array<_.List> + ): LoDashExplicitSyncWrapper; + intersectionBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + intersectionBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + intersectionBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + ...values: Array<_.List | _.ValueIteratee> + ): LoDashExplicitSyncWrapper; + intersectionBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + ...values: Array<_.List> + ): LoDashExplicitSyncWrapper; + intersectionWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values: _.List, + comparator: _.Comparator2 + ): LoDashExplicitSyncWrapper; + intersectionWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + comparator: _.Comparator2 + ): LoDashExplicitSyncWrapper; + intersectionWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + ...values: Array<_.List | _.Comparator2> + ): LoDashExplicitSyncWrapper; + intersectionWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + ...values: Array<_.List> + ): LoDashExplicitSyncWrapper; + join(separator?: string): LoDashExplicitSyncWrapper; + last(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; + lastIndexOf( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + value: T, + fromIndex?: true|number + ): LoDashExplicitSyncWrapper; + nth( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + n?: number + ): LoDashExplicitSyncWrapper; + pull( + this: LoDashExplicitSyncWrapper<_.List>, + ...values: T[] + ): this; + pullAll( + this: LoDashExplicitSyncWrapper<_.List>, + values?: _.List + ): this; + remove( + this: LoDashExplicitSyncWrapper<_.List>, + predicate?: _.ListIteratee + ): LoDashExplicitSyncWrapper; + slice( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + start?: number, + end?: number + ): LoDashExplicitSyncWrapper; + sortedIndex( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + value: T + ): LoDashExplicitSyncWrapper; + sortedIndex( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + value: T + ): LoDashExplicitSyncWrapper; + sortedIndexBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + value: T, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + sortedIndexOf( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + value: T + ): LoDashExplicitSyncWrapper; + sortedLastIndex( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + value: T + ): LoDashExplicitSyncWrapper; + sortedLastIndexBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + value: T, + iteratee: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + sortedLastIndexOf( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + value: T + ): LoDashExplicitSyncWrapper; + sortedUniq(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; + sortedUniqBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + tail(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; + take( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + n?: number + ): LoDashExplicitSyncWrapper; + takeRight( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + n?: number + ): LoDashExplicitSyncWrapper; + takeRightWhile( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate?: _.ListIteratee + ): LoDashExplicitSyncWrapper; + takeWhile( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate?: _.ListIteratee + ): LoDashExplicitSyncWrapper; + union( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + ...arrays: Array<_.List | null | undefined> + ): LoDashExplicitSyncWrapper; + unionBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + unionBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + unionBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + arrays3: _.List | null | undefined, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + unionBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + arrays3: _.List | null | undefined, + arrays4: _.List | null | undefined, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + unionBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + arrays3: _.List | null | undefined, + arrays4: _.List | null | undefined, + arrays5: _.List | null | undefined, + ...iteratee: Array<_.ValueIteratee | _.List | null | undefined> + ): LoDashExplicitSyncWrapper; + unionWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + comparator?: _.Comparator + ): LoDashExplicitSyncWrapper; + unionWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + comparator?: _.Comparator + ): LoDashExplicitSyncWrapper; + unionWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + arrays3: _.List | null | undefined, + ...comparator: Array<_.Comparator | _.List | null | undefined> + ): LoDashExplicitSyncWrapper; + uniq(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; + uniqBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + uniqWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + comparator?: _.Comparator + ): LoDashExplicitSyncWrapper; + unzip(this: LoDashExplicitSyncWrapper> | null | undefined>): LoDashExplicitSyncWrapper; + unzipWith( + this: LoDashExplicitSyncWrapper<_.List<_.List> | null | undefined>, + iteratee: (...values: T[]) => TResult + ): LoDashExplicitSyncWrapper; + unzipWith( + this: LoDashExplicitSyncWrapper<_.List<_.List> | null | undefined> + ): LoDashExplicitSyncWrapper; + without( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + ...values: T[] + ): LoDashExplicitSyncWrapper; + xor( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + ...arrays: Array<_.List | null | undefined> + ): LoDashExplicitSyncWrapper; + xorBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + xorBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + xorBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + arrays3: _.List | null | undefined, + ...iteratee: Array<_.ValueIteratee | _.List | null | undefined> + ): LoDashExplicitSyncWrapper; + xorWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + comparator?: _.Comparator + ): LoDashExplicitSyncWrapper; + xorWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + comparator?: _.Comparator + ): LoDashExplicitSyncWrapper; + xorWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + arrays3: _.List | null | undefined, + ...comparator: Array<_.Comparator | _.List | null | undefined> + ): LoDashExplicitSyncWrapper; + zip( + this: LoDashExplicitSyncWrapper<_.List>, + arrays2: _.List, + ): LoDashExplicitSyncWrapper>; + zip( + this: LoDashExplicitSyncWrapper<_.List>, + arrays2: _.List, + arrays3: _.List, + ): LoDashExplicitSyncWrapper>; + zip( + this: LoDashExplicitSyncWrapper<_.List>, + arrays2: _.List, + arrays3: _.List, + arrays4: _.List, + ): LoDashExplicitSyncWrapper>; + zip( + this: LoDashExplicitSyncWrapper<_.List>, + arrays2: _.List, + arrays3: _.List, + arrays4: _.List, + arrays5: _.List, + ): LoDashExplicitSyncWrapper>; + zip( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + ...arrays: Array<_.List | null | undefined> + ): LoDashExplicitSyncWrapper>>; + zipObject( + this: LoDashExplicitSyncWrapper<_.List<_.PropertyName>>, + values: _.List + ): LoDashExplicitSyncWrapper<_.Dictionary>; + zipObject( + this: LoDashExplicitSyncWrapper<_.List<_.PropertyName>> + ): LoDashExplicitSyncWrapper<_.Dictionary>; + zipObjectDeep( + this: LoDashExplicitSyncWrapper<_.List<_.PropertyPath>>, + values?: _.List + ): LoDashExplicitSyncWrapper; + zipWith( + this: LoDashExplicitSyncWrapper<_.List>, + iteratee: (value1: T) => TResult + ): LoDashExplicitSyncWrapper; + zipWith( + this: LoDashExplicitSyncWrapper<_.List>, + arrays2: _.List, + iteratee: (value1: T1, value2: T2) => TResult + ): LoDashExplicitSyncWrapper; + zipWith( + this: LoDashExplicitSyncWrapper<_.List>, + arrays2: _.List, + arrays3: _.List, + iteratee: (value1: T1, value2: T2, value3: T3) => TResult + ): LoDashExplicitSyncWrapper; + zipWith( + this: LoDashExplicitSyncWrapper<_.List>, + arrays2: _.List, + arrays3: _.List, + arrays4: _.List, + iteratee: (value1: T1, value2: T2, value3: T3, value4: T4) => TResult + ): LoDashExplicitSyncWrapper; + zipWith( + this: LoDashExplicitSyncWrapper<_.List>, + arrays2: _.List, + arrays3: _.List, + arrays4: _.List, + arrays5: _.List, + iteratee: (value1: T1, value2: T2, value3: T3, value4: T4, value5: T5) => TResult + ): LoDashExplicitSyncWrapper; + zipWith( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + ...iteratee: Array<((...group: T[]) => TResult) | _.List | null | undefined> + ): LoDashExplicitSyncWrapper; + countBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper<_.Dictionary>; + countBy( + this: LoDashExplicitSyncWrapper, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper<_.Dictionary>; + every( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom + ): LoDashExplicitSyncWrapper; + every( + this: LoDashExplicitSyncWrapper, + predicate?: _.ObjectIterateeCustom + ): LoDashExplicitSyncWrapper; + filter( + this: LoDashExplicitSyncWrapper, + predicate?: _.StringIterator + ): LoDashExplicitSyncWrapper; + filter( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate: _.ListIteratorTypeGuard + ): LoDashExplicitSyncWrapper; + filter( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom + ): LoDashExplicitSyncWrapper; + filter( + this: LoDashExplicitSyncWrapper, + predicate: _.ObjectIteratorTypeGuard + ): LoDashExplicitSyncWrapper; + filter( + this: LoDashExplicitSyncWrapper, + predicate?: _.ObjectIterateeCustom + ): LoDashExplicitSyncWrapper>; + find( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate: _.ListIteratorTypeGuard, + fromIndex?: number + ): LoDashExplicitSyncWrapper; + find( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom, + fromIndex?: number + ): LoDashExplicitSyncWrapper; + find( + this: LoDashExplicitSyncWrapper, + predicate: _.ObjectIteratorTypeGuard, + fromIndex?: number + ): LoDashExplicitSyncWrapper; + find( + this: LoDashExplicitSyncWrapper, + predicate?: _.ObjectIterateeCustom, + fromIndex?: number + ): LoDashExplicitSyncWrapper; + findLast( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate: _.ListIteratorTypeGuard, + fromIndex?: number + ): LoDashExplicitSyncWrapper; + findLast( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom, + fromIndex?: number + ): LoDashExplicitSyncWrapper; + findLast( + this: LoDashExplicitSyncWrapper, + predicate: _.ObjectIteratorTypeGuard, + fromIndex?: number + ): LoDashExplicitSyncWrapper; + findLast( + this: LoDashExplicitSyncWrapper, + predicate?: _.ObjectIterateeCustom, + fromIndex?: number + ): LoDashExplicitSyncWrapper; + flatMap(this: LoDashExplicitSyncWrapper<_.List<_.Many> | _.Dictionary<_.Many> | _.NumericDictionary<_.Many> | null | undefined>): LoDashExplicitSyncWrapper; + flatMap(): LoDashExplicitSyncWrapper; + flatMap( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee: _.ListIterator> + ): LoDashExplicitSyncWrapper; + flatMap( + this: LoDashExplicitSyncWrapper, + iteratee: _.ObjectIterator> + ): LoDashExplicitSyncWrapper; + flatMap( + iteratee: string + ): LoDashExplicitSyncWrapper; + flatMap( + iteratee: object + ): LoDashExplicitSyncWrapper; + flatMapDeep( + this: LoDashExplicitSyncWrapper<_.List<_.ListOfRecursiveArraysOrValues | T> | _.Dictionary<_.ListOfRecursiveArraysOrValues | T> | _.NumericDictionary<_.ListOfRecursiveArraysOrValues | T> | null | undefined> + ): LoDashExplicitSyncWrapper; + flatMapDeep( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee: _.ListIterator | TResult> + ): LoDashExplicitSyncWrapper; + flatMapDeep( + this: LoDashExplicitSyncWrapper, + iteratee: _.ObjectIterator | TResult> + ): LoDashExplicitSyncWrapper; + flatMapDeep( + this: LoDashExplicitSyncWrapper, + iteratee: string + ): LoDashExplicitSyncWrapper; + flatMapDeep( + this: LoDashExplicitSyncWrapper, + iteratee: object + ): LoDashExplicitSyncWrapper; + flatMapDepth( + this: LoDashExplicitSyncWrapper<_.List<_.ListOfRecursiveArraysOrValues | T> | _.Dictionary<_.ListOfRecursiveArraysOrValues | T> | _.NumericDictionary<_.ListOfRecursiveArraysOrValues | T> | null | undefined> + ): LoDashExplicitSyncWrapper; + flatMapDepth( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee: _.ListIterator | TResult>, + depth?: number + ): LoDashExplicitSyncWrapper; + flatMapDepth( + this: LoDashExplicitSyncWrapper, + iteratee: _.ObjectIterator | TResult>, + depth?: number + ): LoDashExplicitSyncWrapper; + flatMapDepth( + this: LoDashExplicitSyncWrapper, + iteratee: string, + depth?: number + ): LoDashExplicitSyncWrapper; + flatMapDepth( + this: LoDashExplicitSyncWrapper, + iteratee: object, + depth?: number + ): LoDashExplicitSyncWrapper; + groupBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper<_.Dictionary>; + groupBy( + this: LoDashExplicitSyncWrapper, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper<_.Dictionary>>; + includes( + this: LoDashExplicitSyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + target: T, + fromIndex?: number + ): LoDashExplicitSyncWrapper; + invokeMap( + methodName: string, + ...args: any[]): LoDashExplicitSyncWrapper; + invokeMap( + method: (...args: any[]) => TResult, + ...args: any[]): LoDashExplicitSyncWrapper; + keyBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIterateeCustom + ): LoDashExplicitSyncWrapper<_.Dictionary>; + keyBy( + this: LoDashExplicitSyncWrapper, + iteratee?: _.ValueIterateeCustom + ): LoDashExplicitSyncWrapper<_.Dictionary>; + map( + this: LoDashExplicitSyncWrapper, + iteratee: _.ArrayIterator + ): LoDashExplicitSyncWrapper; + map( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee: _.ListIterator + ): LoDashExplicitSyncWrapper; + map(this: LoDashExplicitSyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>): LoDashExplicitSyncWrapper; + map( + this: LoDashExplicitSyncWrapper, + iteratee: _.ObjectIterator + ): LoDashExplicitSyncWrapper; + map( + this: LoDashExplicitSyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + iteratee: K + ): LoDashExplicitSyncWrapper>; + map( + this: LoDashExplicitSyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + iteratee?: string + ): LoDashExplicitSyncWrapper; + map( + this: LoDashExplicitSyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + iteratee?: object + ): LoDashExplicitSyncWrapper; + orderBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratees?: _.Many<_.ListIterator>, + orders?: _.Many + ): LoDashExplicitSyncWrapper; + orderBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratees?: _.Many<_.ListIteratee>, + orders?: _.Many + ): LoDashExplicitSyncWrapper; + orderBy( + this: LoDashExplicitSyncWrapper, + iteratees?: _.Many<_.ObjectIterator>, + orders?: _.Many + ): LoDashExplicitSyncWrapper>; + orderBy( + this: LoDashExplicitSyncWrapper, + iteratees?: _.Many<_.ObjectIteratee>, + orders?: _.Many + ): LoDashExplicitSyncWrapper>; + partition( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + callback: _.ValueIteratee + ): LoDashExplicitSyncWrapper<[T[], T[]]>; + partition( + this: LoDashExplicitSyncWrapper, + callback: _.ValueIteratee + ): LoDashExplicitSyncWrapper<[Array, Array]>; + reduce( + this: LoDashExplicitSyncWrapper, + callback: _.MemoListIterator, + accumulator: TResult + ): LoDashExplicitSyncWrapper; + reduce( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + callback: _.MemoListIterator>, + accumulator: TResult + ): LoDashExplicitSyncWrapper; + reduce( + this: LoDashExplicitSyncWrapper, + callback: _.MemoObjectIterator, + accumulator: TResult + ): LoDashExplicitSyncWrapper; + reduce( + this: LoDashExplicitSyncWrapper, + callback: _.MemoListIterator + ): LoDashExplicitSyncWrapper; + reduce( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + callback: _.MemoListIterator> + ): LoDashExplicitSyncWrapper; + reduce( + this: LoDashExplicitSyncWrapper, + callback: _.MemoObjectIterator + ): LoDashExplicitSyncWrapper; + reduceRight( + this: LoDashExplicitSyncWrapper, + callback: _.MemoListIterator, + accumulator: TResult + ): LoDashExplicitSyncWrapper; + reduceRight( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + callback: _.MemoListIterator>, + accumulator: TResult + ): LoDashExplicitSyncWrapper; + reduceRight( + this: LoDashExplicitSyncWrapper, + callback: _.MemoObjectIterator, + accumulator: TResult + ): LoDashExplicitSyncWrapper; + reduceRight( + this: LoDashExplicitSyncWrapper, + callback: _.MemoListIterator + ): LoDashExplicitSyncWrapper; + reduceRight( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + callback: _.MemoListIterator> + ): LoDashExplicitSyncWrapper; + reduceRight( + this: LoDashExplicitSyncWrapper, + callback: _.MemoObjectIterator + ): LoDashExplicitSyncWrapper; + reject( + this: LoDashExplicitSyncWrapper, + predicate?: _.StringIterator + ): LoDashExplicitSyncWrapper; + reject( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom + ): LoDashExplicitSyncWrapper; + reject( + this: LoDashExplicitSyncWrapper, + predicate?: _.ObjectIterateeCustom + ): LoDashExplicitSyncWrapper>; + sample( + this: LoDashExplicitSyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined> + ): LoDashExplicitSyncWrapper; + sample( + this: LoDashExplicitSyncWrapper + ): LoDashExplicitSyncWrapper; + sampleSize( + this: LoDashExplicitSyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + n?: number + ): LoDashExplicitSyncWrapper; + sampleSize( + this: LoDashExplicitSyncWrapper, + n?: number + ): LoDashExplicitSyncWrapper>; + shuffle(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; + shuffle(this: LoDashExplicitSyncWrapper): LoDashExplicitSyncWrapper>; + size(): LoDashExplicitSyncWrapper; + some( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom + ): LoDashExplicitSyncWrapper; + some( + this: LoDashExplicitSyncWrapper, + predicate?: _.ObjectIterateeCustom + ): LoDashExplicitSyncWrapper; + sortBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + ...iteratees: Array<_.Many<_.ListIteratee>> + ): LoDashExplicitSyncWrapper; + sortBy( + this: LoDashExplicitSyncWrapper, + ...iteratees: Array<_.Many<_.ObjectIteratee>> + ): LoDashExplicitSyncWrapper>; + pop(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; + push(this: LoDashExplicitSyncWrapper<_.List | null | undefined>, ...items: T[]): this; + shift(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; + sort(this: LoDashExplicitSyncWrapper<_.List | null | undefined>, compareFn?: (a: T, b: T) => number): this; + splice(this: LoDashExplicitSyncWrapper<_.List | null | undefined>, start: number, deleteCount?: number, ...items: T[]): this; + unshift(this: LoDashExplicitSyncWrapper<_.List | null | undefined>, ...items: T[]): this; + now(): LoDashExplicitSyncWrapper; + after any>(func: TFunc): LoDashExplicitSyncWrapper; + ary(n?: number): LoDashExplicitSyncWrapper<(...args: any[]) => any>; + before any>(func: TFunc): LoDashExplicitSyncWrapper; + bind( + thisArg: any, + ...partials: any[] + ): LoDashExplicitSyncWrapper<(...args: any[]) => any>; + bindKey( + key: string, + ...partials: any[] + ): LoDashExplicitSyncWrapper<(...args: any[]) => any>; + curry(this: LoDashExplicitSyncWrapper<(t1: T1) => R>): + LoDashExplicitSyncWrapper<_.CurriedFunction1>; + curry(this: LoDashExplicitSyncWrapper<(t1: T1, t2: T2) => R>): + LoDashExplicitSyncWrapper<_.CurriedFunction2>; + curry(this: LoDashExplicitSyncWrapper<(t1: T1, t2: T2, t3: T3) => R>): + LoDashExplicitSyncWrapper<_.CurriedFunction3>; + curry(this: LoDashExplicitSyncWrapper<(t1: T1, t2: T2, t3: T3, t4: T4) => R>): + LoDashExplicitSyncWrapper<_.CurriedFunction4>; + curry(this: LoDashExplicitSyncWrapper<(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R>): + LoDashExplicitSyncWrapper<_.CurriedFunction5>; + curry(arity?: number): LoDashExplicitSyncWrapper<(...args: any[]) => any>; + curryRight(this: LoDashExplicitSyncWrapper<(t1: T1) => R>, arity?: number): + LoDashExplicitSyncWrapper<_.RightCurriedFunction1>; + curryRight(this: LoDashExplicitSyncWrapper<(t1: T1, t2: T2) => R>, arity?: number): + LoDashExplicitSyncWrapper<_.RightCurriedFunction2>; + curryRight(this: LoDashExplicitSyncWrapper<(t1: T1, t2: T2, t3: T3) => R>, arity?: number): + LoDashExplicitSyncWrapper<_.RightCurriedFunction3>; + curryRight(this: LoDashExplicitSyncWrapper<(t1: T1, t2: T2, t3: T3, t4: T4) => R>, arity?: number): + LoDashExplicitSyncWrapper<_.RightCurriedFunction4>; + curryRight(this: LoDashExplicitSyncWrapper<(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R>, arity?: number): + LoDashExplicitSyncWrapper<_.RightCurriedFunction5>; + curryRight(arity?: number): LoDashExplicitSyncWrapper<(...args: any[]) => any>; + debounce( + wait?: number, + options?: _.DebounceSettings + ): LoDashExplicitSyncWrapper; + defer(...args: any[]): LoDashExplicitSyncWrapper; + delay( + wait: number, + ...args: any[] + ): LoDashExplicitSyncWrapper; + memoize(resolver?: (...args: any[]) => any): LoDashExplicitSyncWrapper; + overArgs(...transforms: Array<_.Many<(...args: any[]) => any>>): LoDashExplicitSyncWrapper<(...args: any[]) => any>; + partial: _.ExplicitPartial; + partialRight: _.ExplicitPartialRight; + rearg(...indexes: Array<_.Many>): LoDashExplicitSyncWrapper<(...args: any[]) => any>; + rest(start?: number): LoDashExplicitSyncWrapper<(...args: any[]) => any>; + spread(this: LoDashExplicitSyncWrapper<(...args: any[]) => TResult>): LoDashExplicitSyncWrapper<(...args: any[]) => TResult>; + spread(this: LoDashExplicitSyncWrapper<(...args: any[]) => TResult>, start: number): LoDashExplicitSyncWrapper<(...args: any[]) => TResult>; + throttle( + wait?: number, + options?: _.ThrottleSettings + ): LoDashExplicitSyncWrapper; + unary(this: LoDashExplicitSyncWrapper<(arg1: T, ...args: any[]) => TResult>): LoDashExplicitSyncWrapper<(arg1: T) => TResult>; + wrap( + wrapper: (value: TValue, ...args: TArgs[]) => TResult + ): LoDashExplicitSyncWrapper<(...args: TArgs[]) => TResult>; + wrap( + wrapper: (value: TValue, ...args: any[]) => TResult + ): LoDashExplicitSyncWrapper<(...args: any[]) => TResult>; + castArray(this: LoDashExplicitSyncWrapper<_.Many>): LoDashExplicitSyncWrapper; + clone(): this; + cloneDeep(): this; + cloneDeepWith( + customizer: _.CloneDeepWithCustomizer + ): LoDashExplicitSyncWrapper; + cloneDeepWith(): this; + cloneWith( + customizer: _.CloneWithCustomizer + ): LoDashExplicitSyncWrapper; + cloneWith( + customizer: _.CloneWithCustomizer + ): LoDashExplicitSyncWrapper; + cloneWith(): this; + conformsTo(this: LoDashExplicitSyncWrapper, source: _.ConformsPredicateObject): LoDashExplicitSyncWrapper; + // Note: we can't use TValue here, because it generates a typescript error when strictFunctionTypes is enabled. + eq( + other: any + ): LoDashExplicitSyncWrapper; + gt(other: any): LoDashExplicitSyncWrapper; + gte(other: any): LoDashExplicitSyncWrapper; + isArguments(): LoDashExplicitSyncWrapper; + isArray(): LoDashExplicitSyncWrapper; + isArrayBuffer(): LoDashExplicitSyncWrapper; + isArrayLike(): LoDashExplicitSyncWrapper; + isArrayLikeObject(): LoDashExplicitSyncWrapper; + isBoolean(): LoDashExplicitSyncWrapper; + isBuffer(): LoDashExplicitSyncWrapper; + isDate(): LoDashExplicitSyncWrapper; + isElement(): LoDashExplicitSyncWrapper; + isEmpty(): LoDashExplicitSyncWrapper; + isEqual( + other: any + ): LoDashExplicitSyncWrapper; + isEqualWith( + other: any, + customizer?: _.IsEqualCustomizer + ): LoDashExplicitSyncWrapper; + isError(): LoDashExplicitSyncWrapper; + isFinite(): LoDashExplicitSyncWrapper; + isFunction(): LoDashExplicitSyncWrapper; + isInteger(): LoDashExplicitSyncWrapper; + isLength(): LoDashExplicitSyncWrapper; + isMap(): LoDashExplicitSyncWrapper; + isMatch(source: object): LoDashExplicitSyncWrapper; + isMatchWith(source: object, customizer: _.isMatchWithCustomizer): LoDashExplicitSyncWrapper; + isNaN(): LoDashExplicitSyncWrapper; + isNative(): LoDashExplicitSyncWrapper; + isNil(): LoDashExplicitSyncWrapper; + isNull(): LoDashExplicitSyncWrapper; + isNumber(): LoDashExplicitSyncWrapper; + isObject(): LoDashExplicitSyncWrapper; + isObjectLike(): LoDashExplicitSyncWrapper; + isPlainObject(): LoDashExplicitSyncWrapper; + isRegExp(): LoDashExplicitSyncWrapper; + isSafeInteger(): LoDashExplicitSyncWrapper; + isSet(): LoDashExplicitSyncWrapper; + isString(): LoDashExplicitSyncWrapper; + isSymbol(): LoDashExplicitSyncWrapper; + isTypedArray(): LoDashExplicitSyncWrapper; + isUndefined(): LoDashExplicitSyncWrapper; + isWeakMap(): LoDashExplicitSyncWrapper; + isWeakSet(): LoDashExplicitSyncWrapper; + lt(other: any): LoDashExplicitSyncWrapper; + lte(other: any): LoDashExplicitSyncWrapper; + toArray(this: LoDashExplicitSyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>): LoDashExplicitSyncWrapper; + toArray(this: _.LoDashImplicitWrapper): LoDashExplicitSyncWrapper>; + toFinite(): LoDashExplicitSyncWrapper; + toInteger(): LoDashExplicitSyncWrapper; + toLength(): LoDashExplicitSyncWrapper; + toNumber(): LoDashExplicitSyncWrapper; + toPlainObject(): LoDashExplicitSyncWrapper; + toSafeInteger(): LoDashExplicitSyncWrapper; + add(addend: number): LoDashExplicitSyncWrapper; + ceil(precision?: number): LoDashExplicitSyncWrapper; + divide(divisor: number): LoDashExplicitSyncWrapper; + floor(precision?: number): LoDashExplicitSyncWrapper; + max(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; + maxBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + mean(): LoDashExplicitSyncWrapper; + meanBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + min(this: LoDashExplicitSyncWrapper<_.List | null | undefined>): LoDashExplicitSyncWrapper; + minBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper; + multiply(multiplicand: number): LoDashExplicitSyncWrapper; + round(precision?: number): LoDashExplicitSyncWrapper; + subtract( + subtrahend: number + ): LoDashExplicitSyncWrapper; + sum(): LoDashExplicitSyncWrapper; + sumBy( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee?: ((value: T) => number) | string + ): LoDashExplicitSyncWrapper; + clamp( + lower: number, + upper: number + ): LoDashExplicitSyncWrapper; + clamp( + upper: number + ): LoDashExplicitSyncWrapper; + inRange( + start: number, + end?: number + ): LoDashExplicitSyncWrapper; + random(floating?: boolean): LoDashExplicitSyncWrapper; + random( + max: number, + floating?: boolean + ): LoDashExplicitSyncWrapper; + assign( + source: TSource + ): LoDashExplicitSyncWrapper; + assign( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitSyncWrapper; + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitSyncWrapper; + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitSyncWrapper; + assign(): LoDashExplicitSyncWrapper; + assign(...otherArgs: any[]): LoDashExplicitSyncWrapper; + assignIn( + source: TSource + ): LoDashExplicitSyncWrapper; + assignIn( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitSyncWrapper; + assignIn( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitSyncWrapper; + assignIn( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitSyncWrapper; + assignIn(): LoDashExplicitSyncWrapper; + assignIn(...otherArgs: any[]): LoDashExplicitSyncWrapper; + assignInWith( + source: TSource, + customizer: _.AssignCustomizer + ): LoDashExplicitSyncWrapper; + assignInWith( + source1: TSource1, + source2: TSource2, + customizer: _.AssignCustomizer + ): LoDashExplicitSyncWrapper; + assignInWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: _.AssignCustomizer + ): LoDashExplicitSyncWrapper; + assignInWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: _.AssignCustomizer + ): LoDashExplicitSyncWrapper; + assignInWith(): LoDashExplicitSyncWrapper; + assignInWith(...otherArgs: any[]): LoDashExplicitSyncWrapper; + assignWith( + source: TSource, + customizer: _.AssignCustomizer + ): LoDashExplicitSyncWrapper; + assignWith( + source1: TSource1, + source2: TSource2, + customizer: _.AssignCustomizer + ): LoDashExplicitSyncWrapper; + assignWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: _.AssignCustomizer + ): LoDashExplicitSyncWrapper; + assignWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: _.AssignCustomizer + ): LoDashExplicitSyncWrapper; + assignWith(): LoDashExplicitSyncWrapper; + assignWith(...otherArgs: any[]): LoDashExplicitSyncWrapper; + at( + this: LoDashExplicitSyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + ...props: _.PropertyPath[] + ): LoDashExplicitSyncWrapper; + at( + this: LoDashExplicitSyncWrapper, + ...props: Array<_.Many> + ): LoDashExplicitSyncWrapper>; + create(properties?: U): LoDashExplicitSyncWrapper; + defaults( + source: TSource + ): LoDashExplicitSyncWrapper; + defaults( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitSyncWrapper; + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitSyncWrapper; + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitSyncWrapper; + defaults(): LoDashExplicitSyncWrapper; + defaults(...sources: any[]): LoDashExplicitSyncWrapper; + defaultsDeep(...sources: any[]): LoDashExplicitSyncWrapper; + entries(this: LoDashExplicitSyncWrapper<_.Dictionary | _.NumericDictionary>): LoDashExplicitSyncWrapper>; + entries(): LoDashExplicitSyncWrapper>; + entriesIn(this: LoDashExplicitSyncWrapper<_.Dictionary | _.NumericDictionary>): LoDashExplicitSyncWrapper>; + entriesIn(): LoDashExplicitSyncWrapper>; + extend( + source: TSource + ): LoDashExplicitSyncWrapper; + extend( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitSyncWrapper; + extend( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitSyncWrapper; + extend( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitSyncWrapper; + extend(): LoDashExplicitSyncWrapper; + extend(...otherArgs: any[]): LoDashExplicitSyncWrapper; + extendWith( + source: TSource, + customizer: _.AssignCustomizer + ): LoDashExplicitSyncWrapper; + extendWith( + source1: TSource1, + source2: TSource2, + customizer: _.AssignCustomizer + ): LoDashExplicitSyncWrapper; + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: _.AssignCustomizer + ): LoDashExplicitSyncWrapper; + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: _.AssignCustomizer + ): LoDashExplicitSyncWrapper; + extendWith(): LoDashExplicitSyncWrapper; + extendWith(...otherArgs: any[]): LoDashExplicitSyncWrapper; + findKey( + this: LoDashExplicitSyncWrapper, + predicate?: _.ObjectIteratee + ): LoDashExplicitSyncWrapper; + findLastKey( + this: LoDashExplicitSyncWrapper, + predicate?: _.ObjectIteratee + ): LoDashExplicitSyncWrapper; + functions(): LoDashExplicitSyncWrapper; + functionsIn(): LoDashExplicitSyncWrapper; + get( + path: TKey | [TKey] + ): LoDashExplicitSyncWrapper; + get( + this: LoDashExplicitSyncWrapper, + path: TKey | [TKey], + ): LoDashExplicitSyncWrapper; + get( + this: LoDashExplicitSyncWrapper, + path: TKey | [TKey], + defaultValue: TDefault + ): LoDashExplicitSyncWrapper; + get( + this: LoDashExplicitSyncWrapper<_.NumericDictionary>, + path: number + ): LoDashExplicitSyncWrapper; + get( + this: LoDashExplicitSyncWrapper<_.NumericDictionary | null | undefined>, + path: number + ): LoDashExplicitSyncWrapper; + get( + this: LoDashExplicitSyncWrapper<_.NumericDictionary | null | undefined>, + path: number, + defaultValue: TDefault + ): LoDashExplicitSyncWrapper; + get( + this: LoDashExplicitSyncWrapper, + path: _.PropertyPath, + defaultValue: TDefault + ): LoDashExplicitSyncWrapper; + get( + this: LoDashExplicitSyncWrapper, + path: _.PropertyPath + ): LoDashExplicitSyncWrapper; + get( + path: _.PropertyPath, + defaultValue?: any + ): LoDashExplicitSyncWrapper; + has(path: _.PropertyPath): LoDashExplicitSyncWrapper; + hasIn(path: _.PropertyPath): LoDashExplicitSyncWrapper; + invert(): LoDashExplicitSyncWrapper<_.Dictionary>; + invertBy( + this: LoDashExplicitSyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + interatee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper<_.Dictionary>; + invertBy( + this: LoDashExplicitSyncWrapper, + interatee?: _.ValueIteratee + ): LoDashExplicitSyncWrapper<_.Dictionary>; + invoke( + path: _.PropertyPath, + ...args: any[]): LoDashExplicitSyncWrapper; + keys(): LoDashExplicitSyncWrapper; + keysIn(): LoDashExplicitSyncWrapper; + mapKeys( + this: LoDashExplicitSyncWrapper<_.List | null | undefined>, + iteratee?: _.ListIteratee + ): LoDashExplicitSyncWrapper<_.Dictionary>; + mapKeys( + this: LoDashExplicitSyncWrapper, + iteratee?: _.ObjectIteratee + ): LoDashExplicitSyncWrapper<_.Dictionary>; + mapValues( + this: LoDashExplicitSyncWrapper, + callback: _.StringIterator + ): LoDashExplicitSyncWrapper<_.NumericDictionary>; + mapValues( + this: LoDashExplicitSyncWrapper<_.Dictionary | _.NumericDictionary | null | undefined>, + callback: _.DictionaryIterator + ): LoDashExplicitSyncWrapper<_.Dictionary>; + mapValues( + this: LoDashExplicitSyncWrapper, + callback: _.ObjectIterator + ): LoDashExplicitSyncWrapper<{ [P in keyof T]: TResult }>; + mapValues( + this: LoDashExplicitSyncWrapper<_.Dictionary | _.NumericDictionary | null | undefined>, + iteratee: object + ): LoDashExplicitSyncWrapper<_.Dictionary>; + mapValues( + this: LoDashExplicitSyncWrapper, + iteratee: object + ): LoDashExplicitSyncWrapper<{ [P in keyof T]: boolean }>; + mapValues( + this: LoDashExplicitSyncWrapper<_.Dictionary | _.NumericDictionary | null | undefined>, + iteratee: TKey + ): LoDashExplicitSyncWrapper<_.Dictionary>; + mapValues( + this: LoDashExplicitSyncWrapper<_.Dictionary | _.NumericDictionary | null | undefined>, + iteratee: string + ): LoDashExplicitSyncWrapper<_.Dictionary>; + mapValues( + this: LoDashExplicitSyncWrapper, + iteratee: string + ): LoDashExplicitSyncWrapper<{ [P in keyof T]: any }>; + mapValues(this: LoDashExplicitSyncWrapper): LoDashExplicitSyncWrapper<_.NumericDictionary>; + mapValues(this: LoDashExplicitSyncWrapper<_.Dictionary | _.NumericDictionary | null | undefined>): LoDashExplicitSyncWrapper<_.Dictionary>; + mapValues(this: LoDashExplicitSyncWrapper): LoDashExplicitSyncWrapper; + mapValues(this: LoDashExplicitSyncWrapper): LoDashExplicitSyncWrapper<_.PartialObject>; + merge( + source: TSource + ): LoDashExplicitSyncWrapper; + merge( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitSyncWrapper; + merge( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitSyncWrapper; + merge( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitSyncWrapper; + merge( + ...otherArgs: any[] + ): LoDashExplicitSyncWrapper; + mergeWith( + source: TSource, + customizer: _.MergeWithCustomizer + ): LoDashExplicitSyncWrapper; + mergeWith( + source1: TSource1, + source2: TSource2, + customizer: _.MergeWithCustomizer + ): LoDashExplicitSyncWrapper; + mergeWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: _.MergeWithCustomizer + ): LoDashExplicitSyncWrapper; + mergeWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: _.MergeWithCustomizer + ): LoDashExplicitSyncWrapper; + mergeWith( + ...otherArgs: any[] + ): LoDashExplicitSyncWrapper; + omit( + this: LoDashExplicitSyncWrapper, + ...paths: _.PropertyPath[] + ): LoDashExplicitSyncWrapper; + omit( + this: LoDashExplicitSyncWrapper, + ...paths: _.PropertyPath[] + ): LoDashExplicitSyncWrapper<_.PartialObject>; + omitBy( + this: LoDashExplicitSyncWrapper, + predicate: _.ValueKeyIteratee + ): LoDashExplicitSyncWrapper<_.PartialObject>; + pick( + this: LoDashExplicitSyncWrapper, + ...props: Array<_.Many> + ): LoDashExplicitSyncWrapper>; + pick( + this: LoDashExplicitSyncWrapper, + ...props: _.PropertyPath[] + ): LoDashExplicitSyncWrapper<_.PartialObject>; + pickBy( + this: LoDashExplicitSyncWrapper, + predicate?: _.ValueKeyIteratee + ): LoDashExplicitSyncWrapper<_.PartialObject>; + result( + path: _.PropertyPath, + defaultValue?: TResult|((...args: any[]) => TResult) + ): LoDashExplicitSyncWrapper; + set( + path: _.PropertyPath, + value: any + ): this; + set( + path: _.PropertyPath, + value: any + ): LoDashExplicitSyncWrapper; + setWith( + path: _.PropertyPath, + value: any, + customizer?: _.SetWithCustomizer + ): this; + setWith( + path: _.PropertyPath, + value: any, + customizer?: _.SetWithCustomizer + ): LoDashExplicitSyncWrapper; + toPairs(this: LoDashExplicitSyncWrapper<_.Dictionary | _.NumericDictionary>): LoDashExplicitSyncWrapper>; + toPairs(): LoDashExplicitSyncWrapper>; + toPairsIn(this: LoDashExplicitSyncWrapper<_.Dictionary | _.NumericDictionary>): LoDashExplicitSyncWrapper>; + toPairsIn(): LoDashExplicitSyncWrapper>; + transform( + this: LoDashExplicitSyncWrapper, + iteratee: _.MemoVoidArrayIterator, + accumulator?: TResult[] + ): LoDashExplicitSyncWrapper; + transform( + this: LoDashExplicitSyncWrapper, + iteratee: _.MemoVoidArrayIterator>, + accumulator?: _.Dictionary + ): LoDashExplicitSyncWrapper<_.Dictionary>; + transform( + this: LoDashExplicitSyncWrapper<_.Dictionary>, + iteratee: _.MemoVoidDictionaryIterator>, + accumulator?: _.Dictionary + ): LoDashExplicitSyncWrapper<_.Dictionary>; + transform( + this: LoDashExplicitSyncWrapper<_.Dictionary>, + iteratee: _.MemoVoidDictionaryIterator, + accumulator?: TResult[] + ): LoDashExplicitSyncWrapper; + transform( + this: LoDashExplicitSyncWrapper, + ): LoDashExplicitSyncWrapper; + transform(): LoDashExplicitSyncWrapper<_.Dictionary>; + unset(path: _.PropertyPath): LoDashExplicitSyncWrapper; + update( + path: _.PropertyPath, + updater: (value: any) => any + ): LoDashExplicitSyncWrapper; + updateWith( + path: _.PropertyPath, + updater: (oldValue: any) => any, + customizer?: _.SetWithCustomizer + ): this; + updateWith( + path: _.PropertyPath, + updater: (oldValue: any) => any, + customizer?: _.SetWithCustomizer + ): LoDashExplicitSyncWrapper; + values(this: LoDashExplicitSyncWrapper<_.Dictionary | _.NumericDictionary | _.List | null | undefined>): LoDashExplicitSyncWrapper; + values(this: LoDashExplicitSyncWrapper): LoDashExplicitSyncWrapper>; + values(): LoDashExplicitSyncWrapper; + valuesIn(this: LoDashExplicitSyncWrapper<_.Dictionary | _.NumericDictionary | _.List | null | undefined>): LoDashExplicitSyncWrapper; + valuesIn(this: LoDashExplicitSyncWrapper): LoDashExplicitSyncWrapper>; + chain(): this; + chain(): this; + plant(value: T): LoDashExplicitSyncWrapper; + thru(interceptor: (value: TValue) => TResult): LoDashExplicitSyncWrapper; + camelCase(): LoDashExplicitSyncWrapper; + capitalize(): LoDashExplicitSyncWrapper; + deburr(): LoDashExplicitSyncWrapper; + endsWith( + target?: string, + position?: number + ): LoDashExplicitSyncWrapper; + escape(): LoDashExplicitSyncWrapper; + escapeRegExp(): LoDashExplicitSyncWrapper; + kebabCase(): LoDashExplicitSyncWrapper; + lowerCase(): LoDashExplicitSyncWrapper; + lowerFirst(): LoDashExplicitSyncWrapper; + pad( + length?: number, + chars?: string + ): LoDashExplicitSyncWrapper; + padEnd( + length?: number, + chars?: string + ): LoDashExplicitSyncWrapper; + padStart( + length?: number, + chars?: string + ): LoDashExplicitSyncWrapper; + parseInt(radix?: number): LoDashExplicitSyncWrapper; + repeat(n?: number): LoDashExplicitSyncWrapper; + replace( + pattern: RegExp | string, + replacement: _.ReplaceFunction | string + ): LoDashExplicitSyncWrapper; + replace( + replacement: _.ReplaceFunction | string + ): LoDashExplicitSyncWrapper; + snakeCase(): LoDashExplicitSyncWrapper; + split( + separator?: RegExp|string, + limit?: number + ): LoDashExplicitSyncWrapper; + startCase(): LoDashExplicitSyncWrapper; + startsWith( + target?: string, + position?: number + ): LoDashExplicitSyncWrapper; + template(options?: _.TemplateOptions): LoDashExplicitSyncWrapper<_.TemplateExecutor>; + toLower(): LoDashExplicitSyncWrapper; + toUpper(): LoDashExplicitSyncWrapper; + trim(chars?: string): LoDashExplicitSyncWrapper; + trimEnd(chars?: string): LoDashExplicitSyncWrapper; + trimStart(chars?: string): LoDashExplicitSyncWrapper; + truncate(options?: _.TruncateOptions): LoDashExplicitSyncWrapper; + unescape(): LoDashExplicitSyncWrapper; + upperCase(): LoDashExplicitSyncWrapper; + upperFirst(): LoDashExplicitSyncWrapper; + words(pattern?: string|RegExp): LoDashExplicitSyncWrapper; + attempt(...args: any[]): LoDashExplicitSyncWrapper; + conforms(this: LoDashExplicitSyncWrapper<_.ConformsPredicateObject>): LoDashExplicitSyncWrapper<(value: T) => boolean>; + constant(): LoDashExplicitSyncWrapper<() => TValue>; + defaultTo(this: LoDashExplicitSyncWrapper, defaultValue: T): LoDashExplicitSyncWrapper; + defaultTo( + this: LoDashExplicitSyncWrapper, + defaultValue: TDefault + ): LoDashExplicitSyncWrapper; + // 0-argument first function + flow(this: LoDashExplicitSyncWrapper<() => R1>, f2: (a: R1) => R2): LoDashExplicitSyncWrapper<() => R2>; + flow(this: LoDashExplicitSyncWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitSyncWrapper<() => R3>; + flow(this: LoDashExplicitSyncWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitSyncWrapper<() => R4>; + flow(this: LoDashExplicitSyncWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitSyncWrapper<() => R5>; + flow(this: LoDashExplicitSyncWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitSyncWrapper<() => R6>; + flow(this: LoDashExplicitSyncWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitSyncWrapper<() => R7>; + flow(this: LoDashExplicitSyncWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitSyncWrapper<() => any>; + // 1-argument first function + flow(this: LoDashExplicitSyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2): LoDashExplicitSyncWrapper<(a1: A1) => R2>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitSyncWrapper<(a1: A1) => R3>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitSyncWrapper<(a1: A1) => R4>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitSyncWrapper<(a1: A1) => R5>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitSyncWrapper<(a1: A1) => R6>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitSyncWrapper<(a1: A1) => R7>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitSyncWrapper<(a1: A1) => any>; + // 2-argument first function + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R2>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R3>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R4>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R5>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R6>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R7>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => any>; + // 3-argument first function + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R2>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R3>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R4>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R5>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R6>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R7>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => any>; + // 4-argument first function + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R2>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R3>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R4>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R5>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R6>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R7>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => any>; + // any-argument first function + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R2>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R3>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R4>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R5>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R6>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R7>; + flow(this: LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => any>; + flow(this: LoDashExplicitSyncWrapper<(...args: any[]) => any>, funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitSyncWrapper<(...args: any[]) => any>; + // 0-argument first function + flowRight(this: LoDashExplicitSyncWrapper<(a: R1) => R2>, f1: () => R1): LoDashExplicitSyncWrapper<() => R2>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitSyncWrapper<() => R3>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitSyncWrapper<() => R4>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitSyncWrapper<() => R5>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitSyncWrapper<() => R6>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitSyncWrapper<() => R7>; + // 1-argument first function + flowRight(this: LoDashExplicitSyncWrapper<(a: R1) => R2>, f1: (a1: A1) => R1): LoDashExplicitSyncWrapper<(a1: A1) => R2>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitSyncWrapper<(a1: A1) => R3>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitSyncWrapper<(a1: A1) => R4>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitSyncWrapper<(a1: A1) => R5>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitSyncWrapper<(a1: A1) => R6>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitSyncWrapper<(a1: A1) => R7>; + // 2-argument first function + flowRight(this: LoDashExplicitSyncWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R2>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R3>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R4>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R5>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R6>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2) => R7>; + // 3-argument first function + flowRight(this: LoDashExplicitSyncWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R2>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R3>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R4>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R5>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R6>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3) => R7>; + // 4-argument first function + flowRight(this: LoDashExplicitSyncWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R2>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R3>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R4>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R5>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R6>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitSyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R7>; + // any-argument first function + flowRight(this: LoDashExplicitSyncWrapper<(a: R1) => R2>, f1: (...args: any[]) => R1): LoDashExplicitSyncWrapper<(...args: any[]) => R2>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R1) => R2>, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitSyncWrapper<(...args: any[]) => R3>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R1) => R2>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitSyncWrapper<(...args: any[]) => R4>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R1) => R2>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitSyncWrapper<(...args: any[]) => R5>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R1) => R2>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitSyncWrapper<(...args: any[]) => R6>; + flowRight(this: LoDashExplicitSyncWrapper<(a: R1) => R2>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitSyncWrapper<(...args: any[]) => R7>; + flowRight(this: LoDashExplicitSyncWrapper<(a: any) => any>, f6: (a: any) => any, f5: (a: any) => any, f4: (a: any) => any, f3: (a: any) => any, f2: (a: any) => any, f1: () => any, ...funcs: Array<_.Many<(...args: any[]) => any>>): LoDashExplicitSyncWrapper<(...args: any[]) => any>; + flowRight(this: LoDashExplicitSyncWrapper<(a: any) => any>, funcs: Array<_.Many<(...args: any[]) => any>>): LoDashExplicitSyncWrapper<(...args: any[]) => any>; + identity(): this; + iteratee any>( + this: LoDashExplicitSyncWrapper + ): LoDashExplicitSyncWrapper; + matches(): LoDashExplicitSyncWrapper<(value: V) => boolean>; + matchesProperty( + srcValue: SrcValue + ): LoDashExplicitSyncWrapper<(value: any) => boolean>; + matchesProperty( + srcValue: SrcValue + ): LoDashExplicitSyncWrapper<(value: Value) => boolean>; + method(...args: any[]): LoDashExplicitSyncWrapper<(object: any) => any>; + methodOf( + ...args: any[] + ): LoDashExplicitSyncWrapper<(path: _.PropertyPath) => any>; + mixin( + source: _.Dictionary<(...args: any[]) => any>, + options?: _.MixinOptions + ): this; + mixin( + options?: _.MixinOptions + ): LoDashExplicitSyncWrapper<_.LoDashStatic>; + noConflict(): LoDashExplicitSyncWrapper; + noop(...args: any[]): LoDashExplicitSyncWrapper; + nthArg(): LoDashExplicitSyncWrapper<(...args: any[]) => any>; + over( + this: LoDashExplicitSyncWrapper<_.Many<(...args: any[]) => TResult>>, + ...iteratees: Array<_.Many<(...args: any[]) => TResult>> + ): LoDashExplicitSyncWrapper<(...args: any[]) => TResult[]>; + overEvery(...predicates: Array<_.Many<(...args: T[]) => boolean>>): LoDashExplicitSyncWrapper<(...args: T[]) => boolean>; + overSome(...predicates: Array<_.Many<(...args: T[]) => boolean>>): LoDashExplicitSyncWrapper<(...args: T[]) => boolean>; + property(): LoDashExplicitSyncWrapper<(obj: TObj) => TResult>; + propertyOf(): LoDashExplicitSyncWrapper<(path: _.PropertyPath) => any>; + range( + end?: number, + step?: number + ): LoDashExplicitSyncWrapper; + rangeRight( + end?: number, + step?: number + ): LoDashExplicitSyncWrapper; + stubArray(): LoDashExplicitSyncWrapper; + stubFalse(): LoDashExplicitSyncWrapper; + stubObject(): LoDashExplicitSyncWrapper; + stubString(): LoDashExplicitSyncWrapper; + stubTrue(): LoDashExplicitSyncWrapper; + times( + iteratee: (num: number) => TResult + ): LoDashExplicitSyncWrapper; + times(): LoDashExplicitSyncWrapper; + toPath(): LoDashExplicitSyncWrapper; + uniqueId(): LoDashExplicitSyncWrapper; + } + + interface LoDashExplicitAsyncWrapper { + chunk( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + size?: number, + ): LoDashExplicitAsyncWrapper; + compact(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; + concat(this: LoDashExplicitAsyncWrapper<_.Many>, ...values: Array<_.Many>): LoDashExplicitAsyncWrapper; + difference( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + ...values: Array<_.List> + ): LoDashExplicitAsyncWrapper; + differenceBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + differenceBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + differenceBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + values3: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + differenceBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + values3: _.List, + values4: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + differenceBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + values3: _.List, + values4: _.List, + values5: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + differenceBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + values3: _.List, + values4: _.List, + values5: _.List, + ...values: Array<_.List | _.ValueIteratee> + ): LoDashExplicitAsyncWrapper; + differenceBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + ...values: Array<_.List> + ): LoDashExplicitAsyncWrapper; + differenceWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values: _.List, + comparator: _.Comparator2 + ): LoDashExplicitAsyncWrapper; + differenceWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + comparator: _.Comparator2 + ): LoDashExplicitAsyncWrapper; + differenceWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + ...values: Array<_.List | _.Comparator2> + ): LoDashExplicitAsyncWrapper; + differenceWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + ...values: Array<_.List> + ): LoDashExplicitAsyncWrapper; + drop(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, n?: number): LoDashExplicitAsyncWrapper; + dropRight(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, n?: number): LoDashExplicitAsyncWrapper; + dropRightWhile( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate?: _.ListIteratee + ): LoDashExplicitAsyncWrapper; + dropWhile( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate?: _.ListIteratee + ): LoDashExplicitAsyncWrapper; + fill( + this: LoDashExplicitAsyncWrapper, + value: T + ): LoDashExplicitAsyncWrapper; + fill( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + value: T + ): LoDashExplicitAsyncWrapper<_.List>; + fill( + this: LoDashExplicitAsyncWrapper, + value: T, + start?: number, + end?: number + ): LoDashExplicitAsyncWrapper>; + fill( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + value: T, + start?: number, + end?: number + ): LoDashExplicitAsyncWrapper<_.List>; + findIndex( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom, + fromIndex?: number + ): LoDashExplicitAsyncWrapper; + findLastIndex( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom, + fromIndex?: number + ): LoDashExplicitAsyncWrapper; + first(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; + flatten(this: LoDashExplicitAsyncWrapper<_.List<_.Many> | null | undefined>): LoDashExplicitAsyncWrapper; + flattenDeep(this: LoDashExplicitAsyncWrapper<_.ListOfRecursiveArraysOrValues | null | undefined>): LoDashExplicitAsyncWrapper; + flattenDepth(this: LoDashExplicitAsyncWrapper<_.ListOfRecursiveArraysOrValues | null | undefined>, depth?: number): LoDashExplicitAsyncWrapper; + fromPairs( + this: LoDashExplicitAsyncWrapper<_.List<[_.PropertyName, T]> | null | undefined> + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + fromPairs( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined> + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + head(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; + indexOf( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + value: T, + fromIndex?: number + ): LoDashExplicitAsyncWrapper; + initial(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; + intersection( + this: LoDashExplicitAsyncWrapper<_.List>, + ...arrays: Array<_.List> + ): LoDashExplicitAsyncWrapper; + intersectionBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + intersectionBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + iteratee: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + intersectionBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + ...values: Array<_.List | _.ValueIteratee> + ): LoDashExplicitAsyncWrapper; + intersectionBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + ...values: Array<_.List> + ): LoDashExplicitAsyncWrapper; + intersectionWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values: _.List, + comparator: _.Comparator2 + ): LoDashExplicitAsyncWrapper; + intersectionWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + comparator: _.Comparator2 + ): LoDashExplicitAsyncWrapper; + intersectionWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + values1: _.List, + values2: _.List, + ...values: Array<_.List | _.Comparator2> + ): LoDashExplicitAsyncWrapper; + intersectionWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + ...values: Array<_.List> + ): LoDashExplicitAsyncWrapper; + join(separator?: string): LoDashExplicitAsyncWrapper; + last(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; + lastIndexOf( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + value: T, + fromIndex?: true|number + ): LoDashExplicitAsyncWrapper; + nth( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + n?: number + ): LoDashExplicitAsyncWrapper; + pull( + this: LoDashExplicitAsyncWrapper<_.List>, + ...values: T[] + ): this; + pullAll( + this: LoDashExplicitAsyncWrapper<_.List>, + values?: _.List + ): this; + remove( + this: LoDashExplicitAsyncWrapper<_.List>, + predicate?: _.ListIteratee + ): LoDashExplicitAsyncWrapper; + slice( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + start?: number, + end?: number + ): LoDashExplicitAsyncWrapper; + sortedIndex( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + value: T + ): LoDashExplicitAsyncWrapper; + sortedIndex( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + value: T + ): LoDashExplicitAsyncWrapper; + sortedIndexBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + value: T, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + sortedIndexOf( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + value: T + ): LoDashExplicitAsyncWrapper; + sortedLastIndex( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + value: T + ): LoDashExplicitAsyncWrapper; + sortedLastIndexBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + value: T, + iteratee: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + sortedLastIndexOf( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + value: T + ): LoDashExplicitAsyncWrapper; + sortedUniq(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; + sortedUniqBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + tail(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; + take( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + n?: number + ): LoDashExplicitAsyncWrapper; + takeRight( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + n?: number + ): LoDashExplicitAsyncWrapper; + takeRightWhile( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate?: _.ListIteratee + ): LoDashExplicitAsyncWrapper; + takeWhile( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate?: _.ListIteratee + ): LoDashExplicitAsyncWrapper; + union( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + ...arrays: Array<_.List | null | undefined> + ): LoDashExplicitAsyncWrapper; + unionBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + unionBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + unionBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + arrays3: _.List | null | undefined, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + unionBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + arrays3: _.List | null | undefined, + arrays4: _.List | null | undefined, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + unionBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + arrays3: _.List | null | undefined, + arrays4: _.List | null | undefined, + arrays5: _.List | null | undefined, + ...iteratee: Array<_.ValueIteratee | _.List | null | undefined> + ): LoDashExplicitAsyncWrapper; + unionWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + comparator?: _.Comparator + ): LoDashExplicitAsyncWrapper; + unionWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + comparator?: _.Comparator + ): LoDashExplicitAsyncWrapper; + unionWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + arrays3: _.List | null | undefined, + ...comparator: Array<_.Comparator | _.List | null | undefined> + ): LoDashExplicitAsyncWrapper; + uniq(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; + uniqBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + uniqWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + comparator?: _.Comparator + ): LoDashExplicitAsyncWrapper; + unzip(this: LoDashExplicitAsyncWrapper> | null | undefined>): LoDashExplicitAsyncWrapper; + unzipWith( + this: LoDashExplicitAsyncWrapper<_.List<_.List> | null | undefined>, + iteratee: (...values: T[]) => TResult + ): LoDashExplicitAsyncWrapper; + unzipWith( + this: LoDashExplicitAsyncWrapper<_.List<_.List> | null | undefined> + ): LoDashExplicitAsyncWrapper; + without( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + ...values: T[] + ): LoDashExplicitAsyncWrapper; + xor( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + ...arrays: Array<_.List | null | undefined> + ): LoDashExplicitAsyncWrapper; + xorBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + xorBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + xorBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + arrays3: _.List | null | undefined, + ...iteratee: Array<_.ValueIteratee | _.List | null | undefined> + ): LoDashExplicitAsyncWrapper; + xorWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + comparator?: _.Comparator + ): LoDashExplicitAsyncWrapper; + xorWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + comparator?: _.Comparator + ): LoDashExplicitAsyncWrapper; + xorWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + arrays2: _.List | null | undefined, + arrays3: _.List | null | undefined, + ...comparator: Array<_.Comparator | _.List | null | undefined> + ): LoDashExplicitAsyncWrapper; + zip( + this: LoDashExplicitAsyncWrapper<_.List>, + arrays2: _.List, + ): LoDashExplicitAsyncWrapper>; + zip( + this: LoDashExplicitAsyncWrapper<_.List>, + arrays2: _.List, + arrays3: _.List, + ): LoDashExplicitAsyncWrapper>; + zip( + this: LoDashExplicitAsyncWrapper<_.List>, + arrays2: _.List, + arrays3: _.List, + arrays4: _.List, + ): LoDashExplicitAsyncWrapper>; + zip( + this: LoDashExplicitAsyncWrapper<_.List>, + arrays2: _.List, + arrays3: _.List, + arrays4: _.List, + arrays5: _.List, + ): LoDashExplicitAsyncWrapper>; + zip( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + ...arrays: Array<_.List | null | undefined> + ): LoDashExplicitAsyncWrapper>>; + zipObject( + this: LoDashExplicitAsyncWrapper<_.List<_.PropertyName>>, + values: _.List + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + zipObject( + this: LoDashExplicitAsyncWrapper<_.List<_.PropertyName>> + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + zipObjectDeep( + this: LoDashExplicitAsyncWrapper<_.List<_.PropertyPath>>, + values?: _.List + ): LoDashExplicitAsyncWrapper; + zipWith( + this: LoDashExplicitAsyncWrapper<_.List>, + iteratee: (value1: T) => TResult + ): LoDashExplicitAsyncWrapper; + zipWith( + this: LoDashExplicitAsyncWrapper<_.List>, + arrays2: _.List, + iteratee: (value1: T1, value2: T2) => TResult + ): LoDashExplicitAsyncWrapper; + zipWith( + this: LoDashExplicitAsyncWrapper<_.List>, + arrays2: _.List, + arrays3: _.List, + iteratee: (value1: T1, value2: T2, value3: T3) => TResult + ): LoDashExplicitAsyncWrapper; + zipWith( + this: LoDashExplicitAsyncWrapper<_.List>, + arrays2: _.List, + arrays3: _.List, + arrays4: _.List, + iteratee: (value1: T1, value2: T2, value3: T3, value4: T4) => TResult + ): LoDashExplicitAsyncWrapper; + zipWith( + this: LoDashExplicitAsyncWrapper<_.List>, + arrays2: _.List, + arrays3: _.List, + arrays4: _.List, + arrays5: _.List, + iteratee: (value1: T1, value2: T2, value3: T3, value4: T4, value5: T5) => TResult + ): LoDashExplicitAsyncWrapper; + zipWith( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + ...iteratee: Array<((...group: T[]) => TResult) | _.List | null | undefined> + ): LoDashExplicitAsyncWrapper; + countBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + countBy( + this: LoDashExplicitAsyncWrapper, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + every( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom + ): LoDashExplicitAsyncWrapper; + every( + this: LoDashExplicitAsyncWrapper, + predicate?: _.ObjectIterateeCustom + ): LoDashExplicitAsyncWrapper; + filter( + this: LoDashExplicitAsyncWrapper, + predicate?: _.StringIterator + ): LoDashExplicitAsyncWrapper; + filter( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate: _.ListIteratorTypeGuard + ): LoDashExplicitAsyncWrapper; + filter( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom + ): LoDashExplicitAsyncWrapper; + filter( + this: LoDashExplicitAsyncWrapper, + predicate: _.ObjectIteratorTypeGuard + ): LoDashExplicitAsyncWrapper; + filter( + this: LoDashExplicitAsyncWrapper, + predicate?: _.ObjectIterateeCustom + ): LoDashExplicitAsyncWrapper>; + find( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate: _.ListIteratorTypeGuard, + fromIndex?: number + ): LoDashExplicitAsyncWrapper; + find( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom, + fromIndex?: number + ): LoDashExplicitAsyncWrapper; + find( + this: LoDashExplicitAsyncWrapper, + predicate: _.ObjectIteratorTypeGuard, + fromIndex?: number + ): LoDashExplicitAsyncWrapper; + find( + this: LoDashExplicitAsyncWrapper, + predicate?: _.ObjectIterateeCustom, + fromIndex?: number + ): LoDashExplicitAsyncWrapper; + findLast( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate: _.ListIteratorTypeGuard, + fromIndex?: number + ): LoDashExplicitAsyncWrapper; + findLast( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom, + fromIndex?: number + ): LoDashExplicitAsyncWrapper; + findLast( + this: LoDashExplicitAsyncWrapper, + predicate: _.ObjectIteratorTypeGuard, + fromIndex?: number + ): LoDashExplicitAsyncWrapper; + findLast( + this: LoDashExplicitAsyncWrapper, + predicate?: _.ObjectIterateeCustom, + fromIndex?: number + ): LoDashExplicitAsyncWrapper; + flatMap(this: LoDashExplicitAsyncWrapper<_.List<_.Many> | _.Dictionary<_.Many> | _.NumericDictionary<_.Many> | null | undefined>): LoDashExplicitAsyncWrapper; + flatMap(): LoDashExplicitAsyncWrapper; + flatMap( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee: _.ListIterator> + ): LoDashExplicitAsyncWrapper; + flatMap( + this: LoDashExplicitAsyncWrapper, + iteratee: _.ObjectIterator> + ): LoDashExplicitAsyncWrapper; + flatMap( + iteratee: string + ): LoDashExplicitAsyncWrapper; + flatMap( + iteratee: object + ): LoDashExplicitAsyncWrapper; + flatMapDeep( + this: LoDashExplicitAsyncWrapper<_.List<_.ListOfRecursiveArraysOrValues | T> | _.Dictionary<_.ListOfRecursiveArraysOrValues | T> | _.NumericDictionary<_.ListOfRecursiveArraysOrValues | T> | null | undefined> + ): LoDashExplicitAsyncWrapper; + flatMapDeep( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee: _.ListIterator | TResult> + ): LoDashExplicitAsyncWrapper; + flatMapDeep( + this: LoDashExplicitAsyncWrapper, + iteratee: _.ObjectIterator | TResult> + ): LoDashExplicitAsyncWrapper; + flatMapDeep( + this: LoDashExplicitAsyncWrapper, + iteratee: string + ): LoDashExplicitAsyncWrapper; + flatMapDeep( + this: LoDashExplicitAsyncWrapper, + iteratee: object + ): LoDashExplicitAsyncWrapper; + flatMapDepth( + this: LoDashExplicitAsyncWrapper<_.List<_.ListOfRecursiveArraysOrValues | T> | _.Dictionary<_.ListOfRecursiveArraysOrValues | T> | _.NumericDictionary<_.ListOfRecursiveArraysOrValues | T> | null | undefined> + ): LoDashExplicitAsyncWrapper; + flatMapDepth( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee: _.ListIterator | TResult>, + depth?: number + ): LoDashExplicitAsyncWrapper; + flatMapDepth( + this: LoDashExplicitAsyncWrapper, + iteratee: _.ObjectIterator | TResult>, + depth?: number + ): LoDashExplicitAsyncWrapper; + flatMapDepth( + this: LoDashExplicitAsyncWrapper, + iteratee: string, + depth?: number + ): LoDashExplicitAsyncWrapper; + flatMapDepth( + this: LoDashExplicitAsyncWrapper, + iteratee: object, + depth?: number + ): LoDashExplicitAsyncWrapper; + groupBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + groupBy( + this: LoDashExplicitAsyncWrapper, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper<_.Dictionary>>; + includes( + this: LoDashExplicitAsyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + target: T, + fromIndex?: number + ): LoDashExplicitAsyncWrapper; + invokeMap( + methodName: string, + ...args: any[]): LoDashExplicitAsyncWrapper; + invokeMap( + method: (...args: any[]) => TResult, + ...args: any[]): LoDashExplicitAsyncWrapper; + keyBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIterateeCustom + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + keyBy( + this: LoDashExplicitAsyncWrapper, + iteratee?: _.ValueIterateeCustom + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + map( + this: LoDashExplicitAsyncWrapper, + iteratee: _.ArrayIterator + ): LoDashExplicitAsyncWrapper; + map( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee: _.ListIterator + ): LoDashExplicitAsyncWrapper; + map(this: LoDashExplicitAsyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>): LoDashExplicitAsyncWrapper; + map( + this: LoDashExplicitAsyncWrapper, + iteratee: _.ObjectIterator + ): LoDashExplicitAsyncWrapper; + map( + this: LoDashExplicitAsyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + iteratee: K + ): LoDashExplicitAsyncWrapper>; + map( + this: LoDashExplicitAsyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + iteratee?: string + ): LoDashExplicitAsyncWrapper; + map( + this: LoDashExplicitAsyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + iteratee?: object + ): LoDashExplicitAsyncWrapper; + orderBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratees?: _.Many<_.ListIterator>, + orders?: _.Many + ): LoDashExplicitAsyncWrapper; + orderBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratees?: _.Many<_.ListIteratee>, + orders?: _.Many + ): LoDashExplicitAsyncWrapper; + orderBy( + this: LoDashExplicitAsyncWrapper, + iteratees?: _.Many<_.ObjectIterator>, + orders?: _.Many + ): LoDashExplicitAsyncWrapper>; + orderBy( + this: LoDashExplicitAsyncWrapper, + iteratees?: _.Many<_.ObjectIteratee>, + orders?: _.Many + ): LoDashExplicitAsyncWrapper>; + partition( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + callback: _.ValueIteratee + ): LoDashExplicitAsyncWrapper<[T[], T[]]>; + partition( + this: LoDashExplicitAsyncWrapper, + callback: _.ValueIteratee + ): LoDashExplicitAsyncWrapper<[Array, Array]>; + reduce( + this: LoDashExplicitAsyncWrapper, + callback: _.MemoListIterator, + accumulator: TResult + ): LoDashExplicitAsyncWrapper; + reduce( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + callback: _.MemoListIterator>, + accumulator: TResult + ): LoDashExplicitAsyncWrapper; + reduce( + this: LoDashExplicitAsyncWrapper, + callback: _.MemoObjectIterator, + accumulator: TResult + ): LoDashExplicitAsyncWrapper; + reduce( + this: LoDashExplicitAsyncWrapper, + callback: _.MemoListIterator + ): LoDashExplicitAsyncWrapper; + reduce( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + callback: _.MemoListIterator> + ): LoDashExplicitAsyncWrapper; + reduce( + this: LoDashExplicitAsyncWrapper, + callback: _.MemoObjectIterator + ): LoDashExplicitAsyncWrapper; + reduceRight( + this: LoDashExplicitAsyncWrapper, + callback: _.MemoListIterator, + accumulator: TResult + ): LoDashExplicitAsyncWrapper; + reduceRight( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + callback: _.MemoListIterator>, + accumulator: TResult + ): LoDashExplicitAsyncWrapper; + reduceRight( + this: LoDashExplicitAsyncWrapper, + callback: _.MemoObjectIterator, + accumulator: TResult + ): LoDashExplicitAsyncWrapper; + reduceRight( + this: LoDashExplicitAsyncWrapper, + callback: _.MemoListIterator + ): LoDashExplicitAsyncWrapper; + reduceRight( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + callback: _.MemoListIterator> + ): LoDashExplicitAsyncWrapper; + reduceRight( + this: LoDashExplicitAsyncWrapper, + callback: _.MemoObjectIterator + ): LoDashExplicitAsyncWrapper; + reject( + this: LoDashExplicitAsyncWrapper, + predicate?: _.StringIterator + ): LoDashExplicitAsyncWrapper; + reject( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom + ): LoDashExplicitAsyncWrapper; + reject( + this: LoDashExplicitAsyncWrapper, + predicate?: _.ObjectIterateeCustom + ): LoDashExplicitAsyncWrapper>; + sample( + this: LoDashExplicitAsyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined> + ): LoDashExplicitAsyncWrapper; + sample( + this: LoDashExplicitAsyncWrapper + ): LoDashExplicitAsyncWrapper; + sampleSize( + this: LoDashExplicitAsyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + n?: number + ): LoDashExplicitAsyncWrapper; + sampleSize( + this: LoDashExplicitAsyncWrapper, + n?: number + ): LoDashExplicitAsyncWrapper>; + shuffle(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; + shuffle(this: LoDashExplicitAsyncWrapper): LoDashExplicitAsyncWrapper>; + size(): LoDashExplicitAsyncWrapper; + some( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + predicate?: _.ListIterateeCustom + ): LoDashExplicitAsyncWrapper; + some( + this: LoDashExplicitAsyncWrapper, + predicate?: _.ObjectIterateeCustom + ): LoDashExplicitAsyncWrapper; + sortBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + ...iteratees: Array<_.Many<_.ListIteratee>> + ): LoDashExplicitAsyncWrapper; + sortBy( + this: LoDashExplicitAsyncWrapper, + ...iteratees: Array<_.Many<_.ObjectIteratee>> + ): LoDashExplicitAsyncWrapper>; + pop(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; + push(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, ...items: T[]): this; + shift(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; + sort(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, compareFn?: (a: T, b: T) => number): this; + splice(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, start: number, deleteCount?: number, ...items: T[]): this; + unshift(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, ...items: T[]): this; + now(): LoDashExplicitAsyncWrapper; + after any>(func: TFunc): LoDashExplicitAsyncWrapper; + ary(n?: number): LoDashExplicitAsyncWrapper<(...args: any[]) => any>; + before any>(func: TFunc): LoDashExplicitAsyncWrapper; + bind( + thisArg: any, + ...partials: any[] + ): LoDashExplicitAsyncWrapper<(...args: any[]) => any>; + bindKey( + key: string, + ...partials: any[] + ): LoDashExplicitAsyncWrapper<(...args: any[]) => any>; + curry(this: LoDashExplicitAsyncWrapper<(t1: T1) => R>): + LoDashExplicitAsyncWrapper<_.CurriedFunction1>; + curry(this: LoDashExplicitAsyncWrapper<(t1: T1, t2: T2) => R>): + LoDashExplicitAsyncWrapper<_.CurriedFunction2>; + curry(this: LoDashExplicitAsyncWrapper<(t1: T1, t2: T2, t3: T3) => R>): + LoDashExplicitAsyncWrapper<_.CurriedFunction3>; + curry(this: LoDashExplicitAsyncWrapper<(t1: T1, t2: T2, t3: T3, t4: T4) => R>): + LoDashExplicitAsyncWrapper<_.CurriedFunction4>; + curry(this: LoDashExplicitAsyncWrapper<(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R>): + LoDashExplicitAsyncWrapper<_.CurriedFunction5>; + curry(arity?: number): LoDashExplicitAsyncWrapper<(...args: any[]) => any>; + curryRight(this: LoDashExplicitAsyncWrapper<(t1: T1) => R>, arity?: number): + LoDashExplicitAsyncWrapper<_.RightCurriedFunction1>; + curryRight(this: LoDashExplicitAsyncWrapper<(t1: T1, t2: T2) => R>, arity?: number): + LoDashExplicitAsyncWrapper<_.RightCurriedFunction2>; + curryRight(this: LoDashExplicitAsyncWrapper<(t1: T1, t2: T2, t3: T3) => R>, arity?: number): + LoDashExplicitAsyncWrapper<_.RightCurriedFunction3>; + curryRight(this: LoDashExplicitAsyncWrapper<(t1: T1, t2: T2, t3: T3, t4: T4) => R>, arity?: number): + LoDashExplicitAsyncWrapper<_.RightCurriedFunction4>; + curryRight(this: LoDashExplicitAsyncWrapper<(t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => R>, arity?: number): + LoDashExplicitAsyncWrapper<_.RightCurriedFunction5>; + curryRight(arity?: number): LoDashExplicitAsyncWrapper<(...args: any[]) => any>; + debounce( + wait?: number, + options?: _.DebounceSettings + ): LoDashExplicitAsyncWrapper; + defer(...args: any[]): LoDashExplicitAsyncWrapper; + delay( + wait: number, + ...args: any[] + ): LoDashExplicitAsyncWrapper; + memoize(resolver?: (...args: any[]) => any): LoDashExplicitAsyncWrapper; + overArgs(...transforms: Array<_.Many<(...args: any[]) => any>>): LoDashExplicitAsyncWrapper<(...args: any[]) => any>; + partial: _.ExplicitPartial; + partialRight: _.ExplicitPartialRight; + rearg(...indexes: Array<_.Many>): LoDashExplicitAsyncWrapper<(...args: any[]) => any>; + rest(start?: number): LoDashExplicitAsyncWrapper<(...args: any[]) => any>; + spread(this: LoDashExplicitAsyncWrapper<(...args: any[]) => TResult>): LoDashExplicitAsyncWrapper<(...args: any[]) => TResult>; + spread(this: LoDashExplicitAsyncWrapper<(...args: any[]) => TResult>, start: number): LoDashExplicitAsyncWrapper<(...args: any[]) => TResult>; + throttle( + wait?: number, + options?: _.ThrottleSettings + ): LoDashExplicitAsyncWrapper; + unary(this: LoDashExplicitAsyncWrapper<(arg1: T, ...args: any[]) => TResult>): LoDashExplicitAsyncWrapper<(arg1: T) => TResult>; + wrap( + wrapper: (value: TValue, ...args: TArgs[]) => TResult + ): LoDashExplicitAsyncWrapper<(...args: TArgs[]) => TResult>; + wrap( + wrapper: (value: TValue, ...args: any[]) => TResult + ): LoDashExplicitAsyncWrapper<(...args: any[]) => TResult>; + castArray(this: LoDashExplicitAsyncWrapper<_.Many>): LoDashExplicitAsyncWrapper; + clone(): this; + cloneDeep(): this; + cloneDeepWith( + customizer: _.CloneDeepWithCustomizer + ): LoDashExplicitAsyncWrapper; + cloneDeepWith(): this; + cloneWith( + customizer: _.CloneWithCustomizer + ): LoDashExplicitAsyncWrapper; + cloneWith( + customizer: _.CloneWithCustomizer + ): LoDashExplicitAsyncWrapper; + cloneWith(): this; + conformsTo(this: LoDashExplicitAsyncWrapper, source: _.ConformsPredicateObject): LoDashExplicitAsyncWrapper; + // Note: we can't use TValue here, because it generates a typescript error when strictFunctionTypes is enabled. + eq( + other: any + ): LoDashExplicitAsyncWrapper; + gt(other: any): LoDashExplicitAsyncWrapper; + gte(other: any): LoDashExplicitAsyncWrapper; + isArguments(): LoDashExplicitAsyncWrapper; + isArray(): LoDashExplicitAsyncWrapper; + isArrayBuffer(): LoDashExplicitAsyncWrapper; + isArrayLike(): LoDashExplicitAsyncWrapper; + isArrayLikeObject(): LoDashExplicitAsyncWrapper; + isBoolean(): LoDashExplicitAsyncWrapper; + isBuffer(): LoDashExplicitAsyncWrapper; + isDate(): LoDashExplicitAsyncWrapper; + isElement(): LoDashExplicitAsyncWrapper; + isEmpty(): LoDashExplicitAsyncWrapper; + isEqual( + other: any + ): LoDashExplicitAsyncWrapper; + isEqualWith( + other: any, + customizer?: _.IsEqualCustomizer + ): LoDashExplicitAsyncWrapper; + isError(): LoDashExplicitAsyncWrapper; + isFinite(): LoDashExplicitAsyncWrapper; + isFunction(): LoDashExplicitAsyncWrapper; + isInteger(): LoDashExplicitAsyncWrapper; + isLength(): LoDashExplicitAsyncWrapper; + isMap(): LoDashExplicitAsyncWrapper; + isMatch(source: object): LoDashExplicitAsyncWrapper; + isMatchWith(source: object, customizer: _.isMatchWithCustomizer): LoDashExplicitAsyncWrapper; + isNaN(): LoDashExplicitAsyncWrapper; + isNative(): LoDashExplicitAsyncWrapper; + isNil(): LoDashExplicitAsyncWrapper; + isNull(): LoDashExplicitAsyncWrapper; + isNumber(): LoDashExplicitAsyncWrapper; + isObject(): LoDashExplicitAsyncWrapper; + isObjectLike(): LoDashExplicitAsyncWrapper; + isPlainObject(): LoDashExplicitAsyncWrapper; + isRegExp(): LoDashExplicitAsyncWrapper; + isSafeInteger(): LoDashExplicitAsyncWrapper; + isSet(): LoDashExplicitAsyncWrapper; + isString(): LoDashExplicitAsyncWrapper; + isSymbol(): LoDashExplicitAsyncWrapper; + isTypedArray(): LoDashExplicitAsyncWrapper; + isUndefined(): LoDashExplicitAsyncWrapper; + isWeakMap(): LoDashExplicitAsyncWrapper; + isWeakSet(): LoDashExplicitAsyncWrapper; + lt(other: any): LoDashExplicitAsyncWrapper; + lte(other: any): LoDashExplicitAsyncWrapper; + toArray(this: LoDashExplicitAsyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>): LoDashExplicitAsyncWrapper; + toArray(this: _.LoDashImplicitWrapper): LoDashExplicitAsyncWrapper>; + toFinite(): LoDashExplicitAsyncWrapper; + toInteger(): LoDashExplicitAsyncWrapper; + toLength(): LoDashExplicitAsyncWrapper; + toNumber(): LoDashExplicitAsyncWrapper; + toPlainObject(): LoDashExplicitAsyncWrapper; + toSafeInteger(): LoDashExplicitAsyncWrapper; + add(addend: number): LoDashExplicitAsyncWrapper; + ceil(precision?: number): LoDashExplicitAsyncWrapper; + divide(divisor: number): LoDashExplicitAsyncWrapper; + floor(precision?: number): LoDashExplicitAsyncWrapper; + max(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; + maxBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + mean(): LoDashExplicitAsyncWrapper; + meanBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + min(this: LoDashExplicitAsyncWrapper<_.List | null | undefined>): LoDashExplicitAsyncWrapper; + minBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper; + multiply(multiplicand: number): LoDashExplicitAsyncWrapper; + round(precision?: number): LoDashExplicitAsyncWrapper; + subtract( + subtrahend: number + ): LoDashExplicitAsyncWrapper; + sum(): LoDashExplicitAsyncWrapper; + sumBy( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee?: ((value: T) => number) | string + ): LoDashExplicitAsyncWrapper; + clamp( + lower: number, + upper: number + ): LoDashExplicitAsyncWrapper; + clamp( + upper: number + ): LoDashExplicitAsyncWrapper; + inRange( + start: number, + end?: number + ): LoDashExplicitAsyncWrapper; + random(floating?: boolean): LoDashExplicitAsyncWrapper; + random( + max: number, + floating?: boolean + ): LoDashExplicitAsyncWrapper; + assign( + source: TSource + ): LoDashExplicitAsyncWrapper; + assign( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitAsyncWrapper; + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitAsyncWrapper; + assign( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitAsyncWrapper; + assign(): LoDashExplicitAsyncWrapper; + assign(...otherArgs: any[]): LoDashExplicitAsyncWrapper; + assignIn( + source: TSource + ): LoDashExplicitAsyncWrapper; + assignIn( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitAsyncWrapper; + assignIn( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitAsyncWrapper; + assignIn( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitAsyncWrapper; + assignIn(): LoDashExplicitAsyncWrapper; + assignIn(...otherArgs: any[]): LoDashExplicitAsyncWrapper; + assignInWith( + source: TSource, + customizer: _.AssignCustomizer + ): LoDashExplicitAsyncWrapper; + assignInWith( + source1: TSource1, + source2: TSource2, + customizer: _.AssignCustomizer + ): LoDashExplicitAsyncWrapper; + assignInWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: _.AssignCustomizer + ): LoDashExplicitAsyncWrapper; + assignInWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: _.AssignCustomizer + ): LoDashExplicitAsyncWrapper; + assignInWith(): LoDashExplicitAsyncWrapper; + assignInWith(...otherArgs: any[]): LoDashExplicitAsyncWrapper; + assignWith( + source: TSource, + customizer: _.AssignCustomizer + ): LoDashExplicitAsyncWrapper; + assignWith( + source1: TSource1, + source2: TSource2, + customizer: _.AssignCustomizer + ): LoDashExplicitAsyncWrapper; + assignWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: _.AssignCustomizer + ): LoDashExplicitAsyncWrapper; + assignWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: _.AssignCustomizer + ): LoDashExplicitAsyncWrapper; + assignWith(): LoDashExplicitAsyncWrapper; + assignWith(...otherArgs: any[]): LoDashExplicitAsyncWrapper; + at( + this: LoDashExplicitAsyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + ...props: _.PropertyPath[] + ): LoDashExplicitAsyncWrapper; + at( + this: LoDashExplicitAsyncWrapper, + ...props: Array<_.Many> + ): LoDashExplicitAsyncWrapper>; + create(properties?: U): LoDashExplicitAsyncWrapper; + defaults( + source: TSource + ): LoDashExplicitAsyncWrapper; + defaults( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitAsyncWrapper; + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitAsyncWrapper; + defaults( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitAsyncWrapper; + defaults(): LoDashExplicitAsyncWrapper; + defaults(...sources: any[]): LoDashExplicitAsyncWrapper; + defaultsDeep(...sources: any[]): LoDashExplicitAsyncWrapper; + entries(this: LoDashExplicitAsyncWrapper<_.Dictionary | _.NumericDictionary>): LoDashExplicitAsyncWrapper>; + entries(): LoDashExplicitAsyncWrapper>; + entriesIn(this: LoDashExplicitAsyncWrapper<_.Dictionary | _.NumericDictionary>): LoDashExplicitAsyncWrapper>; + entriesIn(): LoDashExplicitAsyncWrapper>; + extend( + source: TSource + ): LoDashExplicitAsyncWrapper; + extend( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitAsyncWrapper; + extend( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitAsyncWrapper; + extend( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitAsyncWrapper; + extend(): LoDashExplicitAsyncWrapper; + extend(...otherArgs: any[]): LoDashExplicitAsyncWrapper; + extendWith( + source: TSource, + customizer: _.AssignCustomizer + ): LoDashExplicitAsyncWrapper; + extendWith( + source1: TSource1, + source2: TSource2, + customizer: _.AssignCustomizer + ): LoDashExplicitAsyncWrapper; + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: _.AssignCustomizer + ): LoDashExplicitAsyncWrapper; + extendWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: _.AssignCustomizer + ): LoDashExplicitAsyncWrapper; + extendWith(): LoDashExplicitAsyncWrapper; + extendWith(...otherArgs: any[]): LoDashExplicitAsyncWrapper; + findKey( + this: LoDashExplicitAsyncWrapper, + predicate?: _.ObjectIteratee + ): LoDashExplicitAsyncWrapper; + findLastKey( + this: LoDashExplicitAsyncWrapper, + predicate?: _.ObjectIteratee + ): LoDashExplicitAsyncWrapper; + functions(): LoDashExplicitAsyncWrapper; + functionsIn(): LoDashExplicitAsyncWrapper; + get( + path: TKey | [TKey] + ): LoDashExplicitAsyncWrapper; + get( + this: LoDashExplicitAsyncWrapper, + path: TKey | [TKey], + ): LoDashExplicitAsyncWrapper; + get( + this: LoDashExplicitAsyncWrapper, + path: TKey | [TKey], + defaultValue: TDefault + ): LoDashExplicitAsyncWrapper; + get( + this: LoDashExplicitAsyncWrapper<_.NumericDictionary>, + path: number + ): LoDashExplicitAsyncWrapper; + get( + this: LoDashExplicitAsyncWrapper<_.NumericDictionary | null | undefined>, + path: number + ): LoDashExplicitAsyncWrapper; + get( + this: LoDashExplicitAsyncWrapper<_.NumericDictionary | null | undefined>, + path: number, + defaultValue: TDefault + ): LoDashExplicitAsyncWrapper; + get( + this: LoDashExplicitAsyncWrapper, + path: _.PropertyPath, + defaultValue: TDefault + ): LoDashExplicitAsyncWrapper; + get( + this: LoDashExplicitAsyncWrapper, + path: _.PropertyPath + ): LoDashExplicitAsyncWrapper; + get( + path: _.PropertyPath, + defaultValue?: any + ): LoDashExplicitAsyncWrapper; + has(path: _.PropertyPath): LoDashExplicitAsyncWrapper; + hasIn(path: _.PropertyPath): LoDashExplicitAsyncWrapper; + invert(): LoDashExplicitAsyncWrapper<_.Dictionary>; + invertBy( + this: LoDashExplicitAsyncWrapper<_.List | _.Dictionary | _.NumericDictionary | null | undefined>, + interatee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + invertBy( + this: LoDashExplicitAsyncWrapper, + interatee?: _.ValueIteratee + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + invoke( + path: _.PropertyPath, + ...args: any[]): LoDashExplicitAsyncWrapper; + keys(): LoDashExplicitAsyncWrapper; + keysIn(): LoDashExplicitAsyncWrapper; + mapKeys( + this: LoDashExplicitAsyncWrapper<_.List | null | undefined>, + iteratee?: _.ListIteratee + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + mapKeys( + this: LoDashExplicitAsyncWrapper, + iteratee?: _.ObjectIteratee + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + mapValues( + this: LoDashExplicitAsyncWrapper, + callback: _.StringIterator + ): LoDashExplicitAsyncWrapper<_.NumericDictionary>; + mapValues( + this: LoDashExplicitAsyncWrapper<_.Dictionary | _.NumericDictionary | null | undefined>, + callback: _.DictionaryIterator + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + mapValues( + this: LoDashExplicitAsyncWrapper, + callback: _.ObjectIterator + ): LoDashExplicitAsyncWrapper<{ [P in keyof T]: TResult }>; + mapValues( + this: LoDashExplicitAsyncWrapper<_.Dictionary | _.NumericDictionary | null | undefined>, + iteratee: object + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + mapValues( + this: LoDashExplicitAsyncWrapper, + iteratee: object + ): LoDashExplicitAsyncWrapper<{ [P in keyof T]: boolean }>; + mapValues( + this: LoDashExplicitAsyncWrapper<_.Dictionary | _.NumericDictionary | null | undefined>, + iteratee: TKey + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + mapValues( + this: LoDashExplicitAsyncWrapper<_.Dictionary | _.NumericDictionary | null | undefined>, + iteratee: string + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + mapValues( + this: LoDashExplicitAsyncWrapper, + iteratee: string + ): LoDashExplicitAsyncWrapper<{ [P in keyof T]: any }>; + mapValues(this: LoDashExplicitAsyncWrapper): LoDashExplicitAsyncWrapper<_.NumericDictionary>; + mapValues(this: LoDashExplicitAsyncWrapper<_.Dictionary | _.NumericDictionary | null | undefined>): LoDashExplicitAsyncWrapper<_.Dictionary>; + mapValues(this: LoDashExplicitAsyncWrapper): LoDashExplicitAsyncWrapper; + mapValues(this: LoDashExplicitAsyncWrapper): LoDashExplicitAsyncWrapper<_.PartialObject>; + merge( + source: TSource + ): LoDashExplicitAsyncWrapper; + merge( + source1: TSource1, + source2: TSource2 + ): LoDashExplicitAsyncWrapper; + merge( + source1: TSource1, + source2: TSource2, + source3: TSource3 + ): LoDashExplicitAsyncWrapper; + merge( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4 + ): LoDashExplicitAsyncWrapper; + merge( + ...otherArgs: any[] + ): LoDashExplicitAsyncWrapper; + mergeWith( + source: TSource, + customizer: _.MergeWithCustomizer + ): LoDashExplicitAsyncWrapper; + mergeWith( + source1: TSource1, + source2: TSource2, + customizer: _.MergeWithCustomizer + ): LoDashExplicitAsyncWrapper; + mergeWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + customizer: _.MergeWithCustomizer + ): LoDashExplicitAsyncWrapper; + mergeWith( + source1: TSource1, + source2: TSource2, + source3: TSource3, + source4: TSource4, + customizer: _.MergeWithCustomizer + ): LoDashExplicitAsyncWrapper; + mergeWith( + ...otherArgs: any[] + ): LoDashExplicitAsyncWrapper; + omit( + this: LoDashExplicitAsyncWrapper, + ...paths: _.PropertyPath[] + ): LoDashExplicitAsyncWrapper; + omit( + this: LoDashExplicitAsyncWrapper, + ...paths: _.PropertyPath[] + ): LoDashExplicitAsyncWrapper<_.PartialObject>; + omitBy( + this: LoDashExplicitAsyncWrapper, + predicate: _.ValueKeyIteratee + ): LoDashExplicitAsyncWrapper<_.PartialObject>; + pick( + this: LoDashExplicitAsyncWrapper, + ...props: Array<_.Many> + ): LoDashExplicitAsyncWrapper>; + pick( + this: LoDashExplicitAsyncWrapper, + ...props: _.PropertyPath[] + ): LoDashExplicitAsyncWrapper<_.PartialObject>; + pickBy( + this: LoDashExplicitAsyncWrapper, + predicate?: _.ValueKeyIteratee + ): LoDashExplicitAsyncWrapper<_.PartialObject>; + result( + path: _.PropertyPath, + defaultValue?: TResult|((...args: any[]) => TResult) + ): LoDashExplicitAsyncWrapper; + set( + path: _.PropertyPath, + value: any + ): this; + set( + path: _.PropertyPath, + value: any + ): LoDashExplicitAsyncWrapper; + setWith( + path: _.PropertyPath, + value: any, + customizer?: _.SetWithCustomizer + ): this; + setWith( + path: _.PropertyPath, + value: any, + customizer?: _.SetWithCustomizer + ): LoDashExplicitAsyncWrapper; + toPairs(this: LoDashExplicitAsyncWrapper<_.Dictionary | _.NumericDictionary>): LoDashExplicitAsyncWrapper>; + toPairs(): LoDashExplicitAsyncWrapper>; + toPairsIn(this: LoDashExplicitAsyncWrapper<_.Dictionary | _.NumericDictionary>): LoDashExplicitAsyncWrapper>; + toPairsIn(): LoDashExplicitAsyncWrapper>; + transform( + this: LoDashExplicitAsyncWrapper, + iteratee: _.MemoVoidArrayIterator, + accumulator?: TResult[] + ): LoDashExplicitAsyncWrapper; + transform( + this: LoDashExplicitAsyncWrapper, + iteratee: _.MemoVoidArrayIterator>, + accumulator?: _.Dictionary + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + transform( + this: LoDashExplicitAsyncWrapper<_.Dictionary>, + iteratee: _.MemoVoidDictionaryIterator>, + accumulator?: _.Dictionary + ): LoDashExplicitAsyncWrapper<_.Dictionary>; + transform( + this: LoDashExplicitAsyncWrapper<_.Dictionary>, + iteratee: _.MemoVoidDictionaryIterator, + accumulator?: TResult[] + ): LoDashExplicitAsyncWrapper; + transform( + this: LoDashExplicitAsyncWrapper, + ): LoDashExplicitAsyncWrapper; + transform(): LoDashExplicitAsyncWrapper<_.Dictionary>; + unset(path: _.PropertyPath): LoDashExplicitAsyncWrapper; + update( + path: _.PropertyPath, + updater: (value: any) => any + ): LoDashExplicitAsyncWrapper; + updateWith( + path: _.PropertyPath, + updater: (oldValue: any) => any, + customizer?: _.SetWithCustomizer + ): this; + updateWith( + path: _.PropertyPath, + updater: (oldValue: any) => any, + customizer?: _.SetWithCustomizer + ): LoDashExplicitAsyncWrapper; + values(this: LoDashExplicitAsyncWrapper<_.Dictionary | _.NumericDictionary | _.List | null | undefined>): LoDashExplicitAsyncWrapper; + values(this: LoDashExplicitAsyncWrapper): LoDashExplicitAsyncWrapper>; + values(): LoDashExplicitAsyncWrapper; + valuesIn(this: LoDashExplicitAsyncWrapper<_.Dictionary | _.NumericDictionary | _.List | null | undefined>): LoDashExplicitAsyncWrapper; + valuesIn(this: LoDashExplicitAsyncWrapper): LoDashExplicitAsyncWrapper>; + chain(): this; + chain(): this; + plant(value: T): LoDashExplicitAsyncWrapper; + thru(interceptor: (value: TValue) => TResult): LoDashExplicitAsyncWrapper; + camelCase(): LoDashExplicitAsyncWrapper; + capitalize(): LoDashExplicitAsyncWrapper; + deburr(): LoDashExplicitAsyncWrapper; + endsWith( + target?: string, + position?: number + ): LoDashExplicitAsyncWrapper; + escape(): LoDashExplicitAsyncWrapper; + escapeRegExp(): LoDashExplicitAsyncWrapper; + kebabCase(): LoDashExplicitAsyncWrapper; + lowerCase(): LoDashExplicitAsyncWrapper; + lowerFirst(): LoDashExplicitAsyncWrapper; + pad( + length?: number, + chars?: string + ): LoDashExplicitAsyncWrapper; + padEnd( + length?: number, + chars?: string + ): LoDashExplicitAsyncWrapper; + padStart( + length?: number, + chars?: string + ): LoDashExplicitAsyncWrapper; + parseInt(radix?: number): LoDashExplicitAsyncWrapper; + repeat(n?: number): LoDashExplicitAsyncWrapper; + replace( + pattern: RegExp | string, + replacement: _.ReplaceFunction | string + ): LoDashExplicitAsyncWrapper; + replace( + replacement: _.ReplaceFunction | string + ): LoDashExplicitAsyncWrapper; + snakeCase(): LoDashExplicitAsyncWrapper; + split( + separator?: RegExp|string, + limit?: number + ): LoDashExplicitAsyncWrapper; + startCase(): LoDashExplicitAsyncWrapper; + startsWith( + target?: string, + position?: number + ): LoDashExplicitAsyncWrapper; + template(options?: _.TemplateOptions): LoDashExplicitAsyncWrapper<_.TemplateExecutor>; + toLower(): LoDashExplicitAsyncWrapper; + toUpper(): LoDashExplicitAsyncWrapper; + trim(chars?: string): LoDashExplicitAsyncWrapper; + trimEnd(chars?: string): LoDashExplicitAsyncWrapper; + trimStart(chars?: string): LoDashExplicitAsyncWrapper; + truncate(options?: _.TruncateOptions): LoDashExplicitAsyncWrapper; + unescape(): LoDashExplicitAsyncWrapper; + upperCase(): LoDashExplicitAsyncWrapper; + upperFirst(): LoDashExplicitAsyncWrapper; + words(pattern?: string|RegExp): LoDashExplicitAsyncWrapper; + attempt(...args: any[]): LoDashExplicitAsyncWrapper; + conforms(this: LoDashExplicitAsyncWrapper<_.ConformsPredicateObject>): LoDashExplicitAsyncWrapper<(value: T) => boolean>; + constant(): LoDashExplicitAsyncWrapper<() => TValue>; + defaultTo(this: LoDashExplicitAsyncWrapper, defaultValue: T): LoDashExplicitAsyncWrapper; + defaultTo( + this: LoDashExplicitAsyncWrapper, + defaultValue: TDefault + ): LoDashExplicitAsyncWrapper; + // 0-argument first function + flow(this: LoDashExplicitAsyncWrapper<() => R1>, f2: (a: R1) => R2): LoDashExplicitAsyncWrapper<() => R2>; + flow(this: LoDashExplicitAsyncWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitAsyncWrapper<() => R3>; + flow(this: LoDashExplicitAsyncWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitAsyncWrapper<() => R4>; + flow(this: LoDashExplicitAsyncWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitAsyncWrapper<() => R5>; + flow(this: LoDashExplicitAsyncWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitAsyncWrapper<() => R6>; + flow(this: LoDashExplicitAsyncWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitAsyncWrapper<() => R7>; + flow(this: LoDashExplicitAsyncWrapper<() => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitAsyncWrapper<() => any>; + // 1-argument first function + flow(this: LoDashExplicitAsyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2): LoDashExplicitAsyncWrapper<(a1: A1) => R2>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitAsyncWrapper<(a1: A1) => R3>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitAsyncWrapper<(a1: A1) => R4>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitAsyncWrapper<(a1: A1) => R5>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitAsyncWrapper<(a1: A1) => R6>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitAsyncWrapper<(a1: A1) => R7>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitAsyncWrapper<(a1: A1) => any>; + // 2-argument first function + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R2>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R3>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R4>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R5>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R6>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R7>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => any>; + // 3-argument first function + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R2>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R3>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R4>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R5>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R6>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R7>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => any>; + // 4-argument first function + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R2>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R3>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R4>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R5>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R6>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R7>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => any>; + // any-argument first function + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R2>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R3>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R4>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R5>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R6>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R7>; + flow(this: LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => R1>, f2: (a: R1) => R2, f3: (a: R2) => R3, f4: (a: R3) => R4, f5: (a: R4) => R5, f6: (a: R5) => R6, f7: (a: R6) => R7, ...funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4, ...args: any[]) => any>; + flow(this: LoDashExplicitAsyncWrapper<(...args: any[]) => any>, funcs: Array<_.Many<(a: any) => any>>): LoDashExplicitAsyncWrapper<(...args: any[]) => any>; + // 0-argument first function + flowRight(this: LoDashExplicitAsyncWrapper<(a: R1) => R2>, f1: () => R1): LoDashExplicitAsyncWrapper<() => R2>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitAsyncWrapper<() => R3>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitAsyncWrapper<() => R4>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitAsyncWrapper<() => R5>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitAsyncWrapper<() => R6>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: () => R1): LoDashExplicitAsyncWrapper<() => R7>; + // 1-argument first function + flowRight(this: LoDashExplicitAsyncWrapper<(a: R1) => R2>, f1: (a1: A1) => R1): LoDashExplicitAsyncWrapper<(a1: A1) => R2>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitAsyncWrapper<(a1: A1) => R3>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitAsyncWrapper<(a1: A1) => R4>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitAsyncWrapper<(a1: A1) => R5>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitAsyncWrapper<(a1: A1) => R6>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1) => R1): LoDashExplicitAsyncWrapper<(a1: A1) => R7>; + // 2-argument first function + flowRight(this: LoDashExplicitAsyncWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R2>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R3>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R4>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R5>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R6>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2) => R7>; + // 3-argument first function + flowRight(this: LoDashExplicitAsyncWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R2>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R3>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R4>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R5>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R6>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3) => R7>; + // 4-argument first function + flowRight(this: LoDashExplicitAsyncWrapper<(a: R1) => R2>, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R2>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R2) => R3>, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R3>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R3) => R4>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R4>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R4) => R5>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R5>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R5) => R6>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R6>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R6) => R7>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (a1: A1, a2: A2, a3: A3, a4: A4) => R1): LoDashExplicitAsyncWrapper<(a1: A1, a2: A2, a3: A3, a4: A4) => R7>; + // any-argument first function + flowRight(this: LoDashExplicitAsyncWrapper<(a: R1) => R2>, f1: (...args: any[]) => R1): LoDashExplicitAsyncWrapper<(...args: any[]) => R2>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R1) => R2>, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitAsyncWrapper<(...args: any[]) => R3>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R1) => R2>, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitAsyncWrapper<(...args: any[]) => R4>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R1) => R2>, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitAsyncWrapper<(...args: any[]) => R5>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R1) => R2>, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitAsyncWrapper<(...args: any[]) => R6>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: R1) => R2>, f6: (a: R5) => R6, f5: (a: R4) => R5, f4: (a: R3) => R4, f3: (a: R2) => R3, f2: (a: R1) => R2, f1: (...args: any[]) => R1): LoDashExplicitAsyncWrapper<(...args: any[]) => R7>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: any) => any>, f6: (a: any) => any, f5: (a: any) => any, f4: (a: any) => any, f3: (a: any) => any, f2: (a: any) => any, f1: () => any, ...funcs: Array<_.Many<(...args: any[]) => any>>): LoDashExplicitAsyncWrapper<(...args: any[]) => any>; + flowRight(this: LoDashExplicitAsyncWrapper<(a: any) => any>, funcs: Array<_.Many<(...args: any[]) => any>>): LoDashExplicitAsyncWrapper<(...args: any[]) => any>; + identity(): this; + iteratee any>( + this: LoDashExplicitAsyncWrapper + ): LoDashExplicitAsyncWrapper; + matches(): LoDashExplicitAsyncWrapper<(value: V) => boolean>; + matchesProperty( + srcValue: SrcValue + ): LoDashExplicitAsyncWrapper<(value: any) => boolean>; + matchesProperty( + srcValue: SrcValue + ): LoDashExplicitAsyncWrapper<(value: Value) => boolean>; + method(...args: any[]): LoDashExplicitAsyncWrapper<(object: any) => any>; + methodOf( + ...args: any[] + ): LoDashExplicitAsyncWrapper<(path: _.PropertyPath) => any>; + mixin( + source: _.Dictionary<(...args: any[]) => any>, + options?: _.MixinOptions + ): this; + mixin( + options?: _.MixinOptions + ): LoDashExplicitAsyncWrapper<_.LoDashStatic>; + noConflict(): LoDashExplicitAsyncWrapper; + noop(...args: any[]): LoDashExplicitAsyncWrapper; + nthArg(): LoDashExplicitAsyncWrapper<(...args: any[]) => any>; + over( + this: LoDashExplicitAsyncWrapper<_.Many<(...args: any[]) => TResult>>, + ...iteratees: Array<_.Many<(...args: any[]) => TResult>> + ): LoDashExplicitAsyncWrapper<(...args: any[]) => TResult[]>; + overEvery(...predicates: Array<_.Many<(...args: T[]) => boolean>>): LoDashExplicitAsyncWrapper<(...args: T[]) => boolean>; + overSome(...predicates: Array<_.Many<(...args: T[]) => boolean>>): LoDashExplicitAsyncWrapper<(...args: T[]) => boolean>; + property(): LoDashExplicitAsyncWrapper<(obj: TObj) => TResult>; + propertyOf(): LoDashExplicitAsyncWrapper<(path: _.PropertyPath) => any>; + range( + end?: number, + step?: number + ): LoDashExplicitAsyncWrapper; + rangeRight( + end?: number, + step?: number + ): LoDashExplicitAsyncWrapper; + stubArray(): LoDashExplicitAsyncWrapper; + stubFalse(): LoDashExplicitAsyncWrapper; + stubObject(): LoDashExplicitAsyncWrapper; + stubString(): LoDashExplicitAsyncWrapper; + stubTrue(): LoDashExplicitAsyncWrapper; + times( + iteratee: (num: number) => TResult + ): LoDashExplicitAsyncWrapper; + times(): LoDashExplicitAsyncWrapper; + toPath(): LoDashExplicitAsyncWrapper; + uniqueId(): LoDashExplicitAsyncWrapper; + } +} diff --git a/types/lowdb/index.d.ts b/types/lowdb/index.d.ts index bab0116404..a8146ef8a2 100644 --- a/types/lowdb/index.d.ts +++ b/types/lowdb/index.d.ts @@ -1,83 +1,77 @@ -// Type definitions for Lowdb 1.0.0 +// Type definitions for Lowdb 1.0 // Project: https://github.com/typicode/lowdb // Definitions by: typicode // Bazyli Brzóska // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 -import { LoDashExplicitWrapper, LoDashStatic } from "lodash"; +/// + +import { LoDashStatic } from "lodash"; declare let Lowdb: Lowdb.lowdb; export = Lowdb; declare namespace Lowdb { - export type AdapterOptions = { + interface AdapterOptions { defaultValue?: SchemaT; serialize?: (data: SchemaT) => string; deserialize?: (serializedData: string) => SchemaT; - }; + } - export interface BaseAdapter - extends AdapterOptions { + interface BaseAdapter extends AdapterOptions { readonly "@@reference": SchemaT; - new ( + new ( source: string, options?: AdapterOptions ): BaseAdapter; source: string; } - export interface AdapterSync - extends BaseAdapter { - new ( + interface AdapterSync extends BaseAdapter { + new ( source: string, options?: AdapterOptions ): AdapterSync; - readonly "@@isAsync": False; - write(state: Object): void; + write(state: object): void; } - export interface AdapterAsync - extends BaseAdapter { - new ( + interface AdapterAsync extends BaseAdapter { + new ( source: string, options?: AdapterOptions ): AdapterAsync; - readonly "@@isAsync": True; - write(state: Object): Promise; + write(state: object): Promise; } - export type Adapter = - | AdapterSync - | AdapterAsync; - - export interface LowdbBase< - SchemaT extends {}, - AdapterT extends Adapter - > { - read: () => Wrapper; + interface LowdbBase { getState: () => SchemaT; setState: (state: SchemaT) => this; } - export interface Lowdb> - extends LowdbBase, - LoDashExplicitWrapper { + interface LowdbSync extends LowdbBase, LoDashExplicitSyncWrapper { _: LoDashStatic; + read: () => this; /** * @description Be careful: This function overwrites the whole database. */ - write(returnValue?: T): Wrapper; + write(returnValue?: T): T; } - export interface LowdbFp< - SchemaT extends {} = any, - AdapterT extends Adapter = Adapter - > extends LowdbBase { + interface LowdbAsync extends LowdbBase, LoDashExplicitAsyncWrapper { + _: LoDashStatic; + read: () => Promise; /** * @description Be careful: This function overwrites the whole database. */ - write(returnValue?: T): Wrapper; + write(returnValue?: T): Promise; + } + + interface LowdbFpSync extends LowdbBase { + /** + * @description Be careful: This function overwrites the whole database. + */ + write(returnValue?: T): T; /** * @description Returns a function that allows you to access/modify the database at a given path. * @example @@ -90,11 +84,11 @@ declare namespace Lowdb { ( path: TKey | [TKey], defaultValue?: SchemaT[TKey] - ): FpReturn; + ): FpReturnSync; ( path: [TKey, TSubKey], defaultValue?: SchemaT[TKey][TSubKey] - ): FpReturn; + ): FpReturnSync; < TKey extends keyof SchemaT, TSubKey extends keyof SchemaT[TKey], @@ -102,7 +96,7 @@ declare namespace Lowdb { >( path: [TKey, TSubKey, TSubKey2], defaultValue?: SchemaT[TKey][TSubKey][TSubKey2] - ): FpReturn; + ): FpReturnSync; < TKey extends keyof SchemaT, TSubKey extends keyof SchemaT[TKey], @@ -111,7 +105,7 @@ declare namespace Lowdb { >( path: [TKey, TSubKey, TSubKey2, TSubKey3], defaultValue?: SchemaT[TKey][TSubKey][TSubKey2][TSubKey3] - ): FpReturn; + ): FpReturnSync; < TKey extends keyof SchemaT, TSubKey extends keyof SchemaT[TKey], @@ -121,10 +115,63 @@ declare namespace Lowdb { >( path: [TKey, TSubKey, TSubKey2, TSubKey3, TSubKey4], defaultValue?: SchemaT[TKey][TSubKey][TSubKey2][TSubKey3][TSubKey4] - ): FpReturn; - (path: string | Array, defaultValue?: T): T; + ): FpReturnSync; + (path: string | string[], defaultValue?: T): FpReturnSync; } - export interface FpReturn { + + interface LowdbFpAsync extends LowdbBase { + /** + * @description Be careful: This function overwrites the whole database. + */ + write(returnValue?: T): Promise; + /** + * @description Returns a function that allows you to access/modify the database at a given path. + * @example + * ```js + * const posts = db('posts') + * const firstPost = posts(all => all[0]) + * posts.write((allPosts) => [...allPosts, {title: 'Yup!'}]) + * ``` + */ + ( + path: TKey | [TKey], + defaultValue?: SchemaT[TKey] + ): FpReturnAsync; + ( + path: [TKey, TSubKey], + defaultValue?: SchemaT[TKey][TSubKey] + ): FpReturnAsync; + < + TKey extends keyof SchemaT, + TSubKey extends keyof SchemaT[TKey], + TSubKey2 extends keyof SchemaT[TKey][TSubKey] + >( + path: [TKey, TSubKey, TSubKey2], + defaultValue?: SchemaT[TKey][TSubKey][TSubKey2] + ): FpReturnAsync; + < + TKey extends keyof SchemaT, + TSubKey extends keyof SchemaT[TKey], + TSubKey2 extends keyof SchemaT[TKey][TSubKey], + TSubKey3 extends keyof SchemaT[TKey][TSubKey][TSubKey2] + >( + path: [TKey, TSubKey, TSubKey2, TSubKey3], + defaultValue?: SchemaT[TKey][TSubKey][TSubKey2][TSubKey3] + ): FpReturnAsync; + < + TKey extends keyof SchemaT, + TSubKey extends keyof SchemaT[TKey], + TSubKey2 extends keyof SchemaT[TKey][TSubKey], + TSubKey3 extends keyof SchemaT[TKey][TSubKey][TSubKey2], + TSubKey4 extends keyof SchemaT[TKey][TSubKey][TSubKey2][TSubKey3] + >( + path: [TKey, TSubKey, TSubKey2, TSubKey3, TSubKey4], + defaultValue?: SchemaT[TKey][TSubKey][TSubKey2][TSubKey3][TSubKey4] + ): FpReturnAsync; + (path: string | string[], defaultValue?: T): FpReturnAsync; + } + + interface FpReturnBase { /** * Execute a series of functions on the data at a given path. * Result of previous function is the input of the next one. @@ -168,7 +215,8 @@ declare namespace Lowdb { ] ): R7; (funcs: Array<(a: any) => any>): any; - + } + interface FpReturnSync extends FpReturnBase { /** * @description Writes the change to the database, based on the callback's return value. * @example @@ -176,198 +224,37 @@ declare namespace Lowdb { * posts.write((allPosts) => [...allPosts, {title: 'Yup!'}]) * ``` */ - write(f1: (a1: PathT) => R1): Wrapper; + write(f1: (a1: PathT) => R1): R1; + } + interface FpReturnAsync extends FpReturnBase { + /** + * @description Writes the change to the database, based on the callback's return value. + * @example + * ```js + * posts.write((allPosts) => [...allPosts, {title: 'Yup!'}]) + * ``` + */ + write(f1: (a1: PathT) => R1): Promise; } - export type lowdb = < - SchemaT extends AdapterT[ReferenceProperty], - AdapterT extends Adapter - >( - adapter: AdapterT - ) => If< - AdapterT[AsyncProperty], - Promise, AdapterT>>, - Lowdb, AdapterT> - >; + interface lowdb { + (adapter: AdapterT): Promise>; + (adapter: AdapterT): LowdbSync; + } - export type lowdbFp = < - SchemaT extends AdapterT[ReferenceProperty], - AdapterT extends Adapter - >( - adapter: AdapterT - ) => If< - AdapterT[AsyncProperty], - Promise>, - LowdbFp - >; + interface lowdbFp { + (adapter: AdapterT): Promise>; + (adapter: AdapterT): LowdbFpSync; + } - export type Wrapper = WrapInPromiseIfTrue< - T, - AdapterT[AsyncProperty] - >; -} - -/** - * lodash augmentation is necessary in order not to duplicate the whole lodash definition - * it's mostly harmless, aside from the fact that 'write' becomes a method in a lodash.chain() - */ -declare module "lodash" { - interface LoDashExplicitWrapper { - write(): WrapInPromiseIfAsyncTag>; - // override lodash's methods only if source tag is present: - value(): GetReferenceTypeIfDefined; + // Note: this interface is augmented in _lodash.d.ts + interface LoDashExplicitSyncWrapper extends _.LoDashWrapper { + write(): TValue; + } + // Note: this interface is augmented in _lodash.d.ts + interface LoDashExplicitAsyncWrapper extends _.LoDashWrapper { + write(): Promise; } } -// utility types: -type WrapInPromiseIfTrue = If, T>; type ReferenceProperty = "@@reference"; -/** - * Hidden source property for resolving to the correct type. - * It is doubly nested so that we retain all nullability information - */ -type SourceReference = { - readonly "@@reference"?: { readonly "@@reference": T }; -}; -type GetReferenceParent> = NonNull< - U[keyof U & ReferenceProperty] ->; -type GetDefinedReferenceType< - TValue, - SourceParent = GetReferenceParent -> = SourceParent[keyof SourceParent & ReferenceProperty]; -type AsyncProperty = "@@isAsync"; -type AsyncTag = { readonly "@@reference"?: { readonly "@@isAsync"?: true } }; -type SyncTag = {}; -type HasAsyncTag> = If< - HasReferenceProperty, - UnionHasKey, - False ->; -type HasReferenceProperty = UnionHasKey, ReferenceProperty>; -type WrapInPromiseIfAsyncTag< - TaggedT, - WrappedT = GetReferenceTypeIfDefined -> = WrapInPromiseIfTrue>; - -/** - * Resolves the hidden source type - * while preserving nullability as much as possible - */ -type GetReferenceType> = If< - IsEmptyType, - Source | undefined, - Source ->; - -type GetReferenceTypeIfDefined = If< - HasReferenceProperty, - GetReferenceType, - T ->; - -type RecursivelyExtend = If< - IsArrayType, - MapArrayType, AddT>, - MapScalarOrObjectType -> & - SourceReference; - -type MapScalarOrObjectType = If< - IsScalarOrInstance, - T, - MapObjectWithPossibleArrays & SourceReference & AddT ->; - -type MapObjectWithPossibleArrays = { - [P in keyof T]: If< - IsArrayType, - MapArrayType, AddT> & SourceReference, - MapScalarOrObjectType - > -}; - -type MapArrayType, AddT, T = Arr[-1]> = Array< - MapObjectWithPossibleArrays & SourceReference & AddT -> & - AddT; - -////////////////////////////////////////// -// generic utils (some from https://github.com/tycho01/typical/): - -type False = "0"; -type True = "1"; -type Bool = True | False; -type If = { 1: Then; 0: Else }[Cond]; - -type Obj = { [k: string]: T }; - -type And = ({ 1: { 1: "1" } & Obj<"0"> } & Obj< - Obj<"0"> ->)[A][B]; - -type UnionHasKey = ({ - [S in Union]: "1" -} & - Obj<"0">)[K]; - -type Indeterminate = And< - UnionHasKey, - UnionHasKey ->; - -type Not = { "1": "0"; "0": "1" }[T]; - -type Determinate = Not>; - -type DefinitelyYes = And>; - -type UnionContained = DefinitelyYes< - ({ [P in U]: "1" } & Obj<"0">)[T | U] ->; - -type UnionEmpty = And< - UnionContained, - UnionContained ->; - -type UnionToObject = { [K in Keys]: K }; - -type Keyed = { [K in keyof T]: K }; - -type KeyedSafe = Keyed & Obj; - -type IntersectionUnions = KeyedSafe< - UnionToObject ->[Big]; -type UnionsOverlap = Not< - UnionEmpty> ->; - -type DiffUnion = ({ [P in T]: P } & - { [P in U]: never } & { [k: string]: never })[T]; - -type ObjectHasKey = UnionHasKey; - -type ArrayPrototypeProperties = DiffUnion< - keyof Array, - "toString" | "toLocaleString" ->; -type IsArrayType = DefinitelyYes>; -/** - * either: undefined, never, null or {} - * can also be used to check if one union contains one of the above - **/ -type IsEmptyType = UnionEmpty; - -/** - * false for: undefined, interfaces - * true for: Array, boolean, number, string, Object - */ -type IsScalarOrInstance = ObjectHasKeySafe; -type ObjectHasKeySafe = UnionsOverlap; -type NonNull = T & {}; - -interface List { - readonly [n: number]: T; -} diff --git a/types/lowdb/lowdb-tests.ts b/types/lowdb/lowdb-tests.ts index d466681ab4..45662ce342 100644 --- a/types/lowdb/lowdb-tests.ts +++ b/types/lowdb/lowdb-tests.ts @@ -1,12 +1,14 @@ import * as low from "lowdb"; import * as lowfp from "lowdb/lib/fp"; +import * as Base from "lowdb/adapters/Base"; import * as FileSync from "lowdb/adapters/FileSync"; import * as FileAsync from "lowdb/adapters/FileAsync"; import * as LocalStorage from "lowdb/adapters/LocalStorage"; +import { find, filter, random, concat, sortBy, take, set } from "lodash/fp"; -const adapterSync: low.AdapterSync<{}> = new FileSync("db.json"); -const adapterAsync: low.AdapterAsync<{}> = new FileAsync("db.json"); -const db = low(adapterSync); +const adapterSync = new FileSync("db.json"); +const adapterAsync = new FileAsync("db.json"); +const db = low(adapterSync); const write: DbSchema = db.defaults({ posts: [] }).write(); @@ -15,25 +17,16 @@ const result: Post[] = db .push({ title: "hello", views: 123 }) .value(); -const teste = db.get("user").value(); -const post: Post | undefined = db - .get("posts") +// $ExpectType Post | undefined +db.get("posts") .find({ id: 123 }) .value(); - -// $ExpectError -const postAssertWithUndefined: Post = db - .get("posts") - .find({ id: 123 }) - .value(); - -// $ExpectError -const postAssertWithUndefined2: Post = db - .get("posts") +// $ExpectType Post | undefined +db.get("posts") .find({ id: 123 }) .write(); -low(adapterAsync).then(dbAsync => { +low(adapterAsync).then(dbAsync => { const writeAction: Promise = dbAsync .get("posts") .push({ title: "async hello" }) @@ -76,11 +69,10 @@ async () => { const dbSync = low(adapterSync); const dbAsync = await low(adapterAsync); - const dbAssertTypeSync: low.Lowdb = dbSync; - const dbAssertTypeAsync: low.Lowdb< - ExampleSchema, - typeof adapterAsync - > = dbAsync; + // $ExpectType LowdbSync + dbSync; + // $ExpectType LowdbAsync + dbAsync; const xSync: ExampleSchema = dbSync .defaults({ posts: [{ name: "baz" }] }) @@ -100,7 +92,9 @@ async () => { .push({ name: "hello" }) .write(); - const dbPromise = low(adapterAsync); + const otherAdapterAsync = new FileAsync("db.json"); + + const dbPromise = low(otherAdapterAsync); const db = await dbPromise; const nested: OtherSchema["nested"] = db.get("nested").value(); @@ -124,37 +118,32 @@ const weDidNotBreakLodash: ExampleSchema["posts"] = lodashChain const adapterLS = new LocalStorage("test.json"); const dbFP = lowfp(adapterLS); // Get posts - const postsFP: low.FpReturn> = dbFP( - "posts" - ); + const postsFP = dbFP("posts"); // replace posts with a new array resulting from concat // and persist database const write: Post[] = postsFP.write( - concat({ title: "lowdb is awesome", views: random(0, 5) }) + concat({ title: "lowdb is awesome", views: random(0, 5) }) ); // Find post by id - const post: Post = postsFP(find({ id: 1 })); + const post: Post | undefined = postsFP(find({ id: 1 })); // Find top 5 fives posts const popular: Post[] = postsFP([ - sortBy("views") as PostsAction, + sortBy("views") as PostsAction, take(5) as PostsAction ]); - const filtered: Post[] = dbFP("posts")(filter({ published: true })); - const writeAction: Post[] = dbFP("posts").write(concat({ id: "123" })); - const writeAction2: string = dbFP(["user", "name"]).write(set("typicode")); + const filtered: Post[] = dbFP("posts")(filter({ published: true })); + const writeAction: Post[] = dbFP("posts").write(concat({ id: 123 })); + const writeAction2: string = dbFP(["user", "name"]).write(() => "typicode"); async () => { const adapterAsync = new FileAsync("test.json"); const dbAsyncPromise = lowfp(adapterAsync); const dbAsync = await dbAsyncPromise; - const postsWithDefault: low.FpReturn< - Post[], - low.AdapterAsync - > = dbAsync("posts", [{ title: "baz" }] as Post[]); + const postsWithDefault = dbAsync("posts", [{ title: "baz" }] as Post[]); const func: Promise = postsWithDefault.write(post => [ ...post, @@ -165,16 +154,8 @@ const weDidNotBreakLodash: ExampleSchema["posts"] = lodashChain type PostsAction = (posts: Post[]) => Post[]; }; -declare function find(a: B): (arr: A[]) => A; -declare function filter(a: B): (arr: A[]) => A[]; -declare function random(a: number, b: number): number; -declare function concat(a: any): (arr: A) => A; -declare function sortBy(a: any): (arr: A) => A; -declare function take(a: A): (arr: A) => A; -declare function set(a: A): (val: A) => A; - interface DbSchema { - posts: Array; + posts: Post[]; user: { name: string; }; @@ -184,7 +165,7 @@ interface Post { title?: string; views?: number; id?: number; - published?: boolean | undefined; + published?: boolean; tuple?: [boolean, number]; } diff --git a/types/lowdb/tslint.json b/types/lowdb/tslint.json index a41bf5d19a..dfea11be1a 100644 --- a/types/lowdb/tslint.json +++ b/types/lowdb/tslint.json @@ -1,79 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + "no-misused-new": false } } From af589d355f308cb4df34f25f0ca222ac5bac1d96 Mon Sep 17 00:00:00 2001 From: denisname Date: Wed, 25 Apr 2018 01:04:48 +0200 Subject: [PATCH 047/564] d3-color: strict null checks and `instanceof` (#25211) * Strict null checks strict null check, uncomment prototypes, RGBColor#rgb returns this, remove `displayable` and `toString` when inherits `Color` * Contributors --- types/d3-color/d3-color-tests.ts | 50 ++++++++++++++++++-------------- types/d3-color/index.d.ts | 26 ++++++++--------- types/d3-color/tsconfig.json | 2 +- 3 files changed, 43 insertions(+), 35 deletions(-) diff --git a/types/d3-color/d3-color-tests.ts b/types/d3-color/d3-color-tests.ts index c001080d36..47f191073b 100644 --- a/types/d3-color/d3-color-tests.ts +++ b/types/d3-color/d3-color-tests.ts @@ -8,37 +8,21 @@ import * as d3Color from 'd3-color'; -// RGB and HSL Typeguards - -function isRGB(color: d3Color.RGBColor | d3Color.HSLColor): color is d3Color.RGBColor { - return (color instanceof d3Color.rgb); -} - -function isHSL(color: d3Color.RGBColor | d3Color.HSLColor): color is d3Color.HSLColor { - return (color instanceof d3Color.hsl); -} - // Signature tests for 'color', rgb and hsl -let c: d3Color.RGBColor | d3Color.HSLColor; +let c: d3Color.RGBColor | d3Color.HSLColor | null; let cRGB: d3Color.RGBColor; let cHSL: d3Color.HSLColor; let displayable: boolean; let cString: string; +let nil: null; -// string signature +c = d3Color.color('oops'); c = d3Color.color('steelblue'); - -if (isRGB(c)) { - cRGB = c; -} else { - cHSL = c; -} - c = d3Color.color('rgba(20, 100, 200, 0.5)'); -c = d3Color.color(cRGB); +c = d3Color.color(d3Color.rgb(0, 0, 0)); -cRGB = d3Color.color('hsl(60, 100%, 20%, 0.5)').rgb(); +cRGB = d3Color.color('hsl(60, 100%, 20%, 0.5)')!.rgb(); cRGB = d3Color.rgb(20, 100, 200); cRGB = d3Color.rgb(20, 100, 200, 0.5); @@ -126,3 +110,27 @@ displayable = cCubehelix.displayable(); cString = cCubehelix.toString(); console.log('Channels = (h : %d, s: %d, l: %d)', cCubehelix.h, cCubehelix.s, cCubehelix.l); console.log('Opacity = %d', cCubehelix.opacity); + +// Prototype, instanceof and typeguard + +declare let color: d3Color.RGBColor | d3Color.HSLColor | d3Color.LabColor | d3Color.HCLColor | d3Color.CubehelixColor | null; + +if (color instanceof d3Color.rgb) { + cRGB = color; +} else if (color instanceof d3Color.hsl) { + cHSL = color; +} else if (color instanceof d3Color.lab) { + cLab = color; +} else if (color instanceof d3Color.hcl) { + cHcl = color; +} else if (color instanceof d3Color.cubehelix) { + cCubehelix = color; +} else if (color === null) { + nil = color; +} + +if (color instanceof d3Color.color) { + console.log(color.toString(), color.darker()); +} else { + nil = color; +} diff --git a/types/d3-color/index.d.ts b/types/d3-color/index.d.ts index 96b24fd09e..825b82d9c4 100644 --- a/types/d3-color/index.d.ts +++ b/types/d3-color/index.d.ts @@ -1,9 +1,12 @@ // Type definitions for D3JS d3-color module 1.0 // Project: https://github.com/d3/d3-color/ -// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov +// Definitions by: Tom Wanzek +// Alex Ford +// Boris Yankov +// denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Last module patch version validated against: 1.0.1 +// Last module patch version validated against: 1.0.3 // --------------------------------------------------------------------------- // Shared Type Definitions and Interfaces @@ -32,9 +35,9 @@ export interface Color { } export interface ColorFactory extends Function { - (cssColorSpecifier: string): RGBColor | HSLColor; + (cssColorSpecifier: string): RGBColor | HSLColor | null; (color: ColorSpaceObject | ColorCommonInstance): RGBColor | HSLColor; - // prototype: Color; + readonly prototype: Color; } export interface RGBColor extends Color { @@ -44,16 +47,14 @@ export interface RGBColor extends Color { opacity: number; brighter(k?: number): this; darker(k?: number): this; - displayable(): boolean; - rgb(): RGBColor; - toString(): string; + rgb(): this; } export interface RGBColorFactory extends Function { (r: number, g: number, b: number, opacity?: number): RGBColor; (cssColorSpecifier: string): RGBColor; (color: ColorSpaceObject | ColorCommonInstance): RGBColor; - // prototype: RGBColor; + readonly prototype: RGBColor; } export interface HSLColor extends Color { @@ -63,7 +64,6 @@ export interface HSLColor extends Color { opacity: number; brighter(k?: number): this; darker(k?: number): this; - displayable(): boolean; rgb(): RGBColor; } @@ -71,7 +71,7 @@ export interface HSLColorFactory extends Function { (h: number, s: number, l: number, opacity?: number): HSLColor; (cssColorSpecifier: string): HSLColor; (color: ColorSpaceObject | ColorCommonInstance): HSLColor; - // prototype: HSLColor; + readonly prototype: HSLColor; } export interface LabColor extends Color { @@ -88,7 +88,7 @@ export interface LabColorFactory extends Function { (l: number, a: number, b: number, opacity?: number): LabColor; (cssColorSpecifier: string): LabColor; (color: ColorSpaceObject | ColorCommonInstance): LabColor; - // prototype: LabColor; + readonly prototype: LabColor; } export interface HCLColor extends Color { @@ -105,7 +105,7 @@ export interface HCLColorFactory extends Function { (h: number, l: number, c: number, opacity?: number): HCLColor; (cssColorSpecifier: string): HCLColor; (color: ColorSpaceObject | ColorCommonInstance): HCLColor; - // prototype: HCLColor; + readonly prototype: HCLColor; } export interface CubehelixColor extends Color { @@ -122,7 +122,7 @@ export interface CubehelixColorFactory extends Function { (h: number, s: number, l: number, opacity?: number): CubehelixColor; (cssColorSpecifier: string): CubehelixColor; (color: ColorSpaceObject | ColorCommonInstance): CubehelixColor; - // prototype: CubehelixColor; + readonly prototype: CubehelixColor; } // -------------------------------------------------------------------------- diff --git a/types/d3-color/tsconfig.json b/types/d3-color/tsconfig.json index d783922755..f5229e4fd8 100644 --- a/types/d3-color/tsconfig.json +++ b/types/d3-color/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ From 3363dfb20e55319cb0d9e996bb7394e8d790141b Mon Sep 17 00:00:00 2001 From: Colin Luo Date: Wed, 25 Apr 2018 07:05:35 +0800 Subject: [PATCH 048/564] Update `klaw-sync` module interface from v1.0 to v2.0.0 + (#25134) * commit 'Update `klaw-sync` module interface to v2.0.0 + [v2.0.0 apis](https://github.com/manidlou/node-klaw-sync/tree/v2.0.0) [v3.0.2 apis](https://github.com/manidlou/node-klaw-sync/tree/v3.0.2) * Update `klaw-sync` module interface from v1.0 to v2.0.0 + * Update `klaw-sync` module interface from v1.0 to v2.0.0 + * Change `klaw-sync` types version from `3.0` to `2.0` and remove ignore parameter. * Update test case. * Improve the test case of `options.filter`. * Add definitions of `klaw-sync` * Remove `Colin Luo` from `klaw-sync` Difinitions. --- types/klaw-sync/index.d.ts | 69 ++++++++++++++++++------------ types/klaw-sync/klaw-sync-tests.ts | 11 +++-- 2 files changed, 49 insertions(+), 31 deletions(-) diff --git a/types/klaw-sync/index.d.ts b/types/klaw-sync/index.d.ts index 1bdd409dfc..f222804222 100644 --- a/types/klaw-sync/index.d.ts +++ b/types/klaw-sync/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for klaw-sync 1.1 +// Type definitions for klaw-sync 2.0 // Project: https://github.com/manidlou/node-klaw-sync // Definitions by: Brendan Forster // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -6,35 +6,50 @@ /// import * as fs from 'fs' - declare namespace klawSync { - interface Item { - path: string - stats: fs.Stats - } + interface Item { + path: string + stats: fs.Stats + } - interface Options { - /** - * any paths or `micromatch` patterns to ignore. - * - * For more information on micromatch patterns: https://github.com/jonschlinkert/micromatch#features - */ - ignore?: string | string[] - /** - * True to only return files (ignore directories). - * - * Defaults to false if not specified. - */ - nodir?: boolean - /** - * True to only return directories (ignore files). - * - * Defaults to false if not specified. - */ - nofile?: boolean - } + type Filter = (item: Item) => boolean + + interface Options { + /** + * @description True to only return files (ignore directories). + * Defaults to false if not specified. + * @default false + */ + nodir?: boolean + + /** + * @description True to only return directories (ignore files). + * Defaults to false if not specified. + * @default false + */ + nofile?: boolean + + /** + * @description when filter function is used, the default behavior is to read all directories even + * if they don't pass the filter function (won't be included but still will be traversed). + * If you set true, there will be neither inclusion nor traversal for directories that + * don't pass the filter function + * @since v2.0.0 + */ + noRecurseOnFailedFilter?: boolean + + /** + * @description function that gets one argument fn({path: '', stats: {}}) and returns true to include + * or false to exclude the item + * @since v2.0.0 + */ + filter?: Filter + } } -declare function klawSync(root: string, options?: klawSync.Options): ReadonlyArray +declare function klawSync( + root: string, + options?: klawSync.Options, +): ReadonlyArray export = klawSync diff --git a/types/klaw-sync/klaw-sync-tests.ts b/types/klaw-sync/klaw-sync-tests.ts index 4808146882..5875c528fd 100644 --- a/types/klaw-sync/klaw-sync-tests.ts +++ b/types/klaw-sync/klaw-sync-tests.ts @@ -2,7 +2,7 @@ import * as path from 'path' import klawSync = require('klaw-sync') const outputMessage = (result: klawSync.Item) => { - console.log(`file: ${result.path} has size '${result.stats.size}'`) + console.log(`file: ${result.path} has size '${result.stats.size}'`) } klawSync('/some/dir').forEach(outputMessage) @@ -12,9 +12,12 @@ const defaultOptions = {} klawSync('/some/dir', defaultOptions).forEach(outputMessage) const options = { - ignore: ['.exe'], - nodir: true, - nofile: false, + nodir: true, + nofile: false, + noRecurseOnFailedFilter: false, + filter(item: klawSync.Item) { + return item.path.indexOf('node_modules') < 0 + }, } klawSync('/some/dir', options).forEach(outputMessage) From 0c0e3799ecd229f671b9e6598f7db85b561db959 Mon Sep 17 00:00:00 2001 From: denisname Date: Wed, 25 Apr 2018 01:06:06 +0200 Subject: [PATCH 049/564] d3-axis strictNullChecks and strictFunctionTypes (#25066) --- types/d3-axis/d3-axis-tests.ts | 26 +++++++++++++----- types/d3-axis/index.d.ts | 48 ++++++++++++++++++++-------------- types/d3-axis/tsconfig.json | 2 +- 3 files changed, 48 insertions(+), 28 deletions(-) diff --git a/types/d3-axis/d3-axis-tests.ts b/types/d3-axis/d3-axis-tests.ts index f2b47beaa8..8edd1ab1c4 100644 --- a/types/d3-axis/d3-axis-tests.ts +++ b/types/d3-axis/d3-axis-tests.ts @@ -47,6 +47,7 @@ axisScaleNumber = scaleBand(); axisScaleNumber = scalePoint(); axisScaleString = scaleBand(); axisScaleString = scalePoint(); + // -------------------------------------------------------------------------- // Test AxisContainerElement // -------------------------------------------------------------------------- @@ -58,7 +59,8 @@ const canvas: HTMLCanvasElement = select('canvas').node( containerElement = svg; containerElement = g; -// containerElement = canvas; // fails, incompatible type +// $ExpectError +containerElement = canvas; // fails, incompatible type // -------------------------------------------------------------------------- // Test Axis Generators @@ -77,14 +79,13 @@ let leftAxis: d3Axis.Axis = d3Axis.axisLeft(scal leftAxis = leftAxis.scale(scalePow()); const powerScale: ScalePower = leftAxis.scale>(); -// powerScale = leftAxis.scale(); // fails, without casting as AxisScale is purposely generic bottomAxis = bottomAxis.scale(scaleOrdinal()); -// bottomAxis = bottomAxis.scale(scalePow()) // fails, domain of scale incompatible with domain of axis +// $ExpectError +bottomAxis = bottomAxis.scale(scalePow()); // fails, domain of scale incompatible with domain of axis const axisScale: d3Axis.AxisScale = bottomAxis.scale(); const ordinalScale: ScaleOrdinal = bottomAxis.scale>(); -// ordinalScale = bottomAxis.scale(); // fails, without casting as AxisScale is purposely generic // ticks(...) ---------------------------------------------------------------- @@ -119,6 +120,7 @@ const formatFn: ((domainValue: string, index: number) => string) | null = bottom bottomAxis.tickFormat((d, i) => '#' + i); bottomAxis.tickFormat(d => d + '!'); + // tickSize(...) ---------------------------------------------------------------- rightAxis = rightAxis.tickSize(5); @@ -149,14 +151,24 @@ const gTransition = gSelection.transition(); gSelection.call(topAxis); gTransition.call(topAxis); -const svgSelection: Selection = select('g'); +const svgSelection: Selection = select('svg'); const svgTransition = svgSelection.transition(); svgSelection.call(leftAxis); svgTransition.call(leftAxis); +const pathSelection: Selection = select('path'); +const pathTransition = svgSelection.transition(); + +// // $ExpectError +// pathSelection.call(bottomAxis); +// // $ExpectError +// pathSelection.call(bottomAxis); + const canvasSelection: Selection = select('canvas'); const canvasTransition = canvasSelection.transition(); -// canvasSelection.call(rightAxis); // fails, incompatible context container element -// canvasTransition.call(rightAxis); // fails, incompatible context container element +// $ExpectError +canvasSelection.call(rightAxis); // fails, incompatible context container element +// $ExpectError +canvasTransition.call(rightAxis); // fails, incompatible context container element diff --git a/types/d3-axis/index.d.ts b/types/d3-axis/index.d.ts index 1c7820c809..ea67b74209 100644 --- a/types/d3-axis/index.d.ts +++ b/types/d3-axis/index.d.ts @@ -1,6 +1,9 @@ // Type definitions for D3JS d3-axis module 1.0 // Project: https://github.com/d3/d3-axis/ -// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov +// Definitions by: Tom Wanzek +// Alex Ford +// Boris Yankov +// denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Last module patch version validated against: 1.0.8 @@ -11,6 +14,11 @@ import { Selection, TransitionLike } from 'd3-selection'; // Shared Types and Interfaces // -------------------------------------------------------------------------- +/** + * A helper type to alias elements which can serve as a domain for an axis. + */ +export type AxisDomain = number | string | Date | { valueOf(): number}; + /** * A helper interface to describe the minimal contract to be met by a time interval * which can be passed into the Axis.ticks(...) or Axis.tickArguments(...) methods when @@ -29,7 +37,7 @@ export interface AxisTimeInterval { /** * A helper interface to which a scale passed into axis must conform (at a minimum) - * for axis to use the scale without error + * for axis to use the scale without error. */ export interface AxisScale { (x: Domain): number | undefined; @@ -37,7 +45,7 @@ export interface AxisScale { range(): number[]; copy(): this; bandwidth?(): number; - // TODO: Reconsider the below, note that the compiler does not differentiate the overloads w.r.t. optionality + // TODO: Reconsider the below, note that the compiler does not differentiate the overloads w.r.t. optionality // ticks?(count?: number): Domain[]; // ticks?(count?: AxisTimeInterval): Date[]; // tickFormat?(count?: number, specifier?: string): ((d: number) => string); @@ -45,12 +53,12 @@ export interface AxisScale { } /** - * A helper type to alias elements which can serve as a container for an axis + * A helper type to alias elements which can serve as a container for an axis. */ export type AxisContainerElement = SVGSVGElement | SVGGElement; /** - * Interface defining an axis generator. The generic is the type of the axis domain + * Interface defining an axis generator. The generic is the type of the axis domain. */ export interface Axis { /** @@ -58,14 +66,14 @@ export interface Axis { * * @param context A selection of SVG containers (either SVG or G elements). */ - (context: Selection): void; + (context: Selection | Selection): void; /** * Render the axis to the given context. * * @param context A transition defined on SVG containers (either SVG or G elements). */ - (context: TransitionLike): void; + (context: TransitionLike | TransitionLike): void; /** * Gets the current scale underlying the axis. @@ -75,7 +83,7 @@ export interface Axis { /** * Sets the scale and returns the axis. * - * @param scale The scale to be used for axis generation + * @param scale The scale to be used for axis generation. */ scale(scale: AxisScale): this; @@ -86,7 +94,7 @@ export interface Axis { * * This method is also a convenience function for axis.tickArguments. * - * @param count Number of ticks that should be rendered + * @param count Number of ticks that should be rendered. * @param specifier An optional format specifier to customize how the tick values are formatted. */ ticks(count: number, specifier?: string): this; @@ -178,7 +186,7 @@ export interface Axis { * * See also axis.ticks. * - * @param args An array with arguments suitable for the scale to be used for tick generation + * @param args An array with arguments suitable for the scale to be used for tick generation. */ tickArguments(args: any[]): this; @@ -210,7 +218,7 @@ export interface Axis { tickFormat(): ((domainValue: Domain, index: number) => string) | null; /** - * Sets the tick format function and returns the axis. + * Sets the tick format function and returns the axis. * * @param format A function mapping a value from the axis Domain to a formatted string * for display purposes. When invoked, the format function is also passed a second argument representing the zero-based index @@ -287,7 +295,7 @@ export interface Axis { /** * Set the current padding and return the axis. * - * @param padding Padding in pixels (Default is 3). + * @param padding Padding in pixels (Default is 3). */ tickPadding(padding: number): this; } @@ -296,30 +304,30 @@ export interface Axis { * Constructs a new top-oriented axis generator for the given scale, with empty tick arguments, * a tick size of 6 and padding of 3. In this orientation, ticks are drawn above the horizontal domain path. * - * @param scale The scale to be used for axis generation + * @param scale The scale to be used for axis generation. */ -export function axisTop(scale: AxisScale): Axis; +export function axisTop(scale: AxisScale): Axis; /** * Constructs a new right-oriented axis generator for the given scale, with empty tick arguments, * a tick size of 6 and padding of 3. In this orientation, ticks are drawn to the right of the vertical domain path. * - * @param scale The scale to be used for axis generation + * @param scale The scale to be used for axis generation. */ -export function axisRight(scale: AxisScale): Axis; +export function axisRight(scale: AxisScale): Axis; /** * Constructs a new bottom-oriented axis generator for the given scale, with empty tick arguments, * a tick size of 6 and padding of 3. In this orientation, ticks are drawn below the horizontal domain path. * - * @param scale The scale to be used for axis generation + * @param scale The scale to be used for axis generation. */ -export function axisBottom(scale: AxisScale): Axis; +export function axisBottom(scale: AxisScale): Axis; /** * Constructs a new left-oriented axis generator for the given scale, with empty tick arguments, * a tick size of 6 and padding of 3. In this orientation, ticks are drawn to the left of the vertical domain path. * - * @param scale The scale to be used for axis generation + * @param scale The scale to be used for axis generation. */ -export function axisLeft(scale: AxisScale): Axis; +export function axisLeft(scale: AxisScale): Axis; diff --git a/types/d3-axis/tsconfig.json b/types/d3-axis/tsconfig.json index 5b54d1f622..0e15092e48 100644 --- a/types/d3-axis/tsconfig.json +++ b/types/d3-axis/tsconfig.json @@ -8,7 +8,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, - "strictFunctionTypes": false, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" From 02ed6f6b493e23f8df3d95c4c12c5bafcbdc8b8b Mon Sep 17 00:00:00 2001 From: Martin Donath Date: Wed, 25 Apr 2018 01:06:22 +0200 Subject: [PATCH 050/564] Added missing field `apiKeyId` to API Gateway request context (#25195) * Added missing field `apiKeyId` to API Gateway request context `$context.identity.apiKeyId`: The API key ID associated with the key-enabled API request. See the [AWS documentation](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html) and search for `apiKeyId`. * Added missing tests for new apiKeyId field in aws-lambda typings --- types/aws-lambda/aws-lambda-tests.ts | 1 + types/aws-lambda/index.d.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index dc16eca58f..8ffff3d8a3 100644 --- a/types/aws-lambda/aws-lambda-tests.ts +++ b/types/aws-lambda/aws-lambda-tests.ts @@ -83,6 +83,7 @@ str = apiGwEvtReqCtx.httpMethod; strOrNull = apiGwEvtReqCtx.identity.accessKey; strOrNull = apiGwEvtReqCtx.identity.accountId; strOrNull = apiGwEvtReqCtx.identity.apiKey; +strOrNull = apiGwEvtReqCtx.identity.apiKeyId; strOrNull = apiGwEvtReqCtx.identity.caller; strOrNull = apiGwEvtReqCtx.identity.cognitoAuthenticationProvider; strOrNull = apiGwEvtReqCtx.identity.cognitoAuthenticationType; diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index c060bc10ee..cdee868594 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -31,6 +31,7 @@ export interface APIGatewayEventRequestContext { accessKey: string | null; accountId: string | null; apiKey: string | null; + apiKeyId: string | null; caller: string | null; cognitoAuthenticationProvider: string | null; cognitoAuthenticationType: string | null; From 2d3747f9986d74f8e793a7c042c1a5619d693c2e Mon Sep 17 00:00:00 2001 From: Simon Schick Date: Wed, 25 Apr 2018 01:06:35 +0200 Subject: [PATCH 051/564] fix(hapi): make all ext options properties optional (#25214) --- types/hapi/index.d.ts | 6 +++--- types/hapi/test/request/event-types.ts | 10 ++++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/types/hapi/index.d.ts b/types/hapi/index.d.ts index d4072b0cd7..f0730e6f67 100644 --- a/types/hapi/index.d.ts +++ b/types/hapi/index.d.ts @@ -2472,15 +2472,15 @@ export interface ServerExtOptions { /** * a string or array of strings of plugin names this method must execute before (on the same event). Otherwise, extension methods are executed in the order added. */ - before: string | string[]; + before?: string | string[]; /** * a string or array of strings of plugin names this method must execute after (on the same event). Otherwise, extension methods are executed in the order added. */ - after: string | string[]; + after?: string | string[]; /** * a context object passed back to the provided method (via this) when called. Ignored if the method is an arrow function. */ - bind: object; + bind?: object; /** * if set to 'plugin' when adding a request extension points the extension is only added to routes defined by the current plugin. Not allowed when configuring route-level extensions, or when * adding server extensions. Defaults to 'server' which applies to any route added to the server the extension is added to. diff --git a/types/hapi/test/request/event-types.ts b/types/hapi/test/request/event-types.ts index 386b93e19d..4d4f3f01ca 100644 --- a/types/hapi/test/request/event-types.ts +++ b/types/hapi/test/request/event-types.ts @@ -1,6 +1,6 @@ // https://github.com/hapijs/hapi/blob/master/API.md#-servereventevents // https://github.com/hapijs/hapi/blob/master/API.md#-requestevents -import { Lifecycle, Request, ResponseToolkit, RouteOptions, Server, ServerOptions, ServerRoute } from "hapi"; +import { Lifecycle, Request, Server, ServerOptions, ServerRoute } from "hapi"; import * as Crypto from 'crypto'; const options: ServerOptions = { @@ -10,7 +10,7 @@ const options: ServerOptions = { const serverRoute: ServerRoute = { path: '/', method: 'GET', - handler(request, h) { + handler(request) { return 'ok: ' + request.path; } }; @@ -42,7 +42,7 @@ const onRequest: Lifecycle.Method = (request, h) => { */ const hash = Crypto.createHash('sha1'); - request.events.on("peek", (chunk, encoding) => { + request.events.on("peek", (chunk) => { hash.update(chunk); }); @@ -59,7 +59,9 @@ const onRequest: Lifecycle.Method = (request, h) => { const server = new Server(options); server.route(serverRoute); -server.ext('onRequest', onRequest); +server.ext('onRequest', onRequest, { + before: 'test', +}); server.start(); console.log('Server started at: ' + server.info.uri); From b4ea50c7a999cd4c63b4305a8664c643c2350a40 Mon Sep 17 00:00:00 2001 From: Mike Fisher Date: Wed, 25 Apr 2018 09:06:57 +1000 Subject: [PATCH 052/564] [auth0] Fix ManagementClient.linkUsers signature (#25219) --- types/auth0/auth0-tests.ts | 9 +++++++++ types/auth0/index.d.ts | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/types/auth0/auth0-tests.ts b/types/auth0/auth0-tests.ts index 0572c2b0e7..9c1bbe8856 100644 --- a/types/auth0/auth0-tests.ts +++ b/types/auth0/auth0-tests.ts @@ -141,3 +141,12 @@ management.createPasswordChangeTicket({ }, (err: Error, data) => { console.log(data.ticket); }); + +// Link users +management.linkUsers('primaryId', { user_id: 'secondaryId' }) + .then((result: any) => console.log(result)); + +// Link users with callback +management.linkUsers('primaryId', { user_id: 'secondaryId' }, + (err: Error, result: any) => {}); + diff --git a/types/auth0/index.d.ts b/types/auth0/index.d.ts index 58013848f8..050f463bfb 100644 --- a/types/auth0/index.d.ts +++ b/types/auth0/index.d.ts @@ -664,8 +664,8 @@ export class ManagementClient { unlinkUsers(params: UnlinkAccountsParams): Promise; unlinkUsers(params: UnlinkAccountsParams, cb: (err: Error, data: UnlinkAccountsResponse) => void): void; - linkUsers(params: ObjectWithId, data: LinkAccountsData): Promise; - linkUsers(params: ObjectWithId, data: LinkAccountsData, cb: (err: Error, data: any) => void): void; + linkUsers(userId: string, data: LinkAccountsData): Promise; + linkUsers(userId: string, data: LinkAccountsData, cb: (err: Error, data: any) => void): void; // Tokens From ba5f8c991240e9cceeb73a20e4213b4eb373dccd Mon Sep 17 00:00:00 2001 From: Alexander Kachkaev Date: Wed, 25 Apr 2018 00:07:44 +0100 Subject: [PATCH 053/564] Add tOptions prop to in react-i18next (#25089) --- types/react-i18next/index.d.ts | 2 +- types/react-i18next/src/trans.d.ts | 5 +++++ types/react-i18next/test/react-i18next-tests.tsx | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/types/react-i18next/index.d.ts b/types/react-i18next/index.d.ts index 356418fe2e..5ea0e7cb91 100644 --- a/types/react-i18next/index.d.ts +++ b/types/react-i18next/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-i18next 7.3 +// Type definitions for react-i18next 7.6 // Project: https://github.com/i18next/react-i18next // Definitions by: Giedrius Grabauskas // Simon Baumann diff --git a/types/react-i18next/src/trans.d.ts b/types/react-i18next/src/trans.d.ts index 8b12c81fc9..c5652315c7 100644 --- a/types/react-i18next/src/trans.d.ts +++ b/types/react-i18next/src/trans.d.ts @@ -1,12 +1,17 @@ import * as React from "react"; import { i18n, TranslationFunction } from "i18next"; +export interface TOptions { + [key: string]: any; +} + export interface TransProps { i18nKey?: string; count?: number; parent?: string; i18n?: i18n; t?: TranslationFunction; + tOptions?: TOptions; } export default class Trans extends React.Component { } diff --git a/types/react-i18next/test/react-i18next-tests.tsx b/types/react-i18next/test/react-i18next-tests.tsx index 46d212e680..7f49913c44 100644 --- a/types/react-i18next/test/react-i18next-tests.tsx +++ b/types/react-i18next/test/react-i18next-tests.tsx @@ -119,6 +119,7 @@ loadNamespaces({components: [App], i18n}).then(() => { ; +; type Key = "view" | "nav"; From de9b889ba9a40380cd429defda16034a3ff02ddb Mon Sep 17 00:00:00 2001 From: Bradley Ayers Date: Wed, 25 Apr 2018 09:08:18 +1000 Subject: [PATCH 054/564] fix(node-fetch): Headers#get may return null (#25218) See https://github.com/bitinn/node-fetch/blob/master/src/headers.js#L117 --- types/node-fetch/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/node-fetch/index.d.ts b/types/node-fetch/index.d.ts index aaaf30a5e3..874e216e89 100644 --- a/types/node-fetch/index.d.ts +++ b/types/node-fetch/index.d.ts @@ -63,7 +63,7 @@ type RequestCache = export class Headers { append(name: string, value: string): void; delete(name: string): void; - get(name: string): string; + get(name: string): string | null; getAll(name: string): Array; has(name: string): boolean; set(name: string, value: string): void; From 8797fe7279a88bf0bec7f701a200332c15e061f4 Mon Sep 17 00:00:00 2001 From: qqilihq Date: Wed, 25 Apr 2018 01:08:55 +0200 Subject: [PATCH 055/564] Fix `validator` types (#25212) Make `require_host` optional, adjust tests so that they catch options not set as optional --- types/validator/index.d.ts | 3 ++- types/validator/validator-tests.ts | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/types/validator/index.d.ts b/types/validator/index.d.ts index e91bd36ce2..d51465d1a7 100644 --- a/types/validator/index.d.ts +++ b/types/validator/index.d.ts @@ -7,6 +7,7 @@ // Kacper Polak // Bonggyun Lee // Naoto Yokoyama +// Philipp Katz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare namespace ValidatorJS { @@ -356,7 +357,7 @@ declare namespace ValidatorJS { protocols?: string[]; require_tld?: boolean; require_protocol?: boolean; - require_host: boolean; + require_host?: boolean; require_valid_protocol?: boolean; allow_underscores?: boolean; host_whitelist?: (string | RegExp)[]; diff --git a/types/validator/validator-tests.ts b/types/validator/validator-tests.ts index c3d4327d84..784528d963 100644 --- a/types/validator/validator-tests.ts +++ b/types/validator/validator-tests.ts @@ -402,36 +402,36 @@ let any: any; result = validator.isBoolean('sample'); - let isByteLengthOptions: ValidatorJS.IsByteLengthOptions; + let isByteLengthOptions: ValidatorJS.IsByteLengthOptions = {}; result = validator.isByteLength('sample', isByteLengthOptions); result = validator.isByteLength('sample', 0); result = validator.isByteLength('sample', 0, 42); result = validator.isCreditCard('sample'); - let isCurrencyOptions: ValidatorJS.IsCurrencyOptions; + let isCurrencyOptions: ValidatorJS.IsCurrencyOptions = {}; result = validator.isCurrency('sample'); result = validator.isCurrency('sample', isCurrencyOptions); result = validator.isDataURI('sample'); - let isDecimalOptions: ValidatorJS.IsDecimalOptions; + let isDecimalOptions: ValidatorJS.IsDecimalOptions = {}; result = validator.isDecimal('sample'); result = validator.isDecimal('sample', isDecimalOptions); result = validator.isDivisibleBy('sample', 2); - let isEmailOptions: ValidatorJS.IsEmailOptions; + let isEmailOptions: ValidatorJS.IsEmailOptions = {}; result = validator.isEmail('sample'); result = validator.isEmail('sample', isEmailOptions); result = validator.isEmpty('sample'); - let isFQDNOptions: ValidatorJS.IsFQDNOptions; + let isFQDNOptions: ValidatorJS.IsFQDNOptions = {}; result = validator.isFQDN('sample'); result = validator.isFQDN('sample', isFQDNOptions); - let isFloatOptions: ValidatorJS.IsFloatOptions; + let isFloatOptions: ValidatorJS.IsFloatOptions = {}; result = validator.isFloat('sample'); result = validator.isFloat('sample', isFloatOptions); @@ -463,7 +463,7 @@ let any: any; result = validator.isISBN('sample'); result = validator.isISBN('sample', 13); - let isISSNOptions: ValidatorJS.IsISSNOptions; + let isISSNOptions: ValidatorJS.IsISSNOptions = {}; result = validator.isISSN('sample'); result = validator.isISSN('sample', isISSNOptions); @@ -477,7 +477,7 @@ let any: any; result = validator.isIn('sample', []); - let isIntOptions: ValidatorJS.IsIntOptions; + let isIntOptions: ValidatorJS.IsIntOptions = {}; result = validator.isInt('sample'); result = validator.isInt('sample', isIntOptions); @@ -485,7 +485,7 @@ let any: any; result = validator.isLatLong('sample'); - let isLengthOptions: ValidatorJS.IsLengthOptions; + let isLengthOptions: ValidatorJS.IsLengthOptions = {}; result = validator.isLength('sample', isLengthOptions); result = validator.isLength('sample', 3); result = validator.isLength('sample', 3, 5); @@ -498,7 +498,7 @@ let any: any; result = validator.isMimeType('sample'); - let isMobilePhoneOptions: ValidatorJS.IsMobilePhoneOptions; + let isMobilePhoneOptions: ValidatorJS.IsMobilePhoneOptions = {}; result = validator.isMobilePhone('sample', 'any', isMobilePhoneOptions); result = validator.isMobilePhone('sample', 'ar-AE'); result = validator.isMobilePhone('sample', 'ar-DZ'); @@ -607,7 +607,7 @@ let any: any; result = validator.isSurrogatePair('sample'); - let isURLOptions: ValidatorJS.IsURLOptions; + let isURLOptions: ValidatorJS.IsURLOptions = {}; result = validator.isURL('sample'); result = validator.isURL('sample', isURLOptions); @@ -642,7 +642,7 @@ let any: any; result = validator.ltrim('sample'); result = validator.ltrim('sample', ' '); - let normalizeEmailOptions: ValidatorJS.NormalizeEmailOptions; + let normalizeEmailOptions: ValidatorJS.NormalizeEmailOptions = {}; let normalizeResult: string | false; normalizeResult = validator.normalizeEmail('sample'); normalizeResult = validator.normalizeEmail('sample', normalizeEmailOptions); From a39131b390c06a0dd6ad9aa7d15fce414d3b7b79 Mon Sep 17 00:00:00 2001 From: Shude Li Date: Wed, 25 Apr 2018 07:09:44 +0800 Subject: [PATCH 056/564] feat(node-v8): add `TextDecoder` and `TextEncoder` for `util` module (#25221) * feat(node-v8): add `TextDecoder` and `TextEncoder` for `util` module * fix(node-v8): change constructor's first param name * style(node-v8): styling `TextDecoder` * refact(node-v8): using class instead interface+var * test(node-v8): add tests for util.TextDecoder and util.TextEncoder * fix(node-v8): fix param type of TextDecoder.decode --- types/node/v8/index.d.ts | 33 +++++++++++++++++++++++++++++++++ types/node/v8/node-tests.ts | 29 +++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/types/node/v8/index.d.ts b/types/node/v8/index.d.ts index f055cd0716..2d705270ef 100644 --- a/types/node/v8/index.d.ts +++ b/types/node/v8/index.d.ts @@ -21,6 +21,7 @@ // Nicolas Even // Bruno Scheufler // Hoàng Văn Khải +// Lishude // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -5575,6 +5576,38 @@ declare module "util" { export namespace promisify { const custom: symbol; } + + export class TextDecoder { + readonly encoding: string; + readonly fatal: boolean; + readonly ignoreBOM: boolean; + constructor( + encoding?: string, + options?: { fatal?: boolean; ignoreBOM?: boolean } + ); + decode( + input?: + | Int8Array + | Int16Array + | Int32Array + | Uint8Array + | Uint16Array + | Uint32Array + | Uint8ClampedArray + | Float32Array + | Float64Array + | DataView + | ArrayBuffer + | null, + options?: { stream?: boolean } + ): string; + } + + export class TextEncoder { + readonly encoding: string; + constructor(); + encode(input?: string): Uint8Array; + } } declare module "assert" { diff --git a/types/node/v8/node-tests.ts b/types/node/v8/node-tests.ts index a79d96aa6a..d37aa70ad5 100644 --- a/types/node/v8/node-tests.ts +++ b/types/node/v8/node-tests.ts @@ -825,6 +825,35 @@ namespace util_tests { util.deprecate(foo, 'foo() is deprecated, use bar() instead'); // $ExpectType (fn: T, message: string) => T util.deprecate(util.deprecate, 'deprecate() is deprecated, use bar() instead'); + + // util.TextDecoder() + var td = new util.TextDecoder(); + new util.TextDecoder("utf-8"); + new util.TextDecoder("utf-8", { fatal: true }); + new util.TextDecoder("utf-8", { fatal: true, ignoreBOM: true }); + var ignoreBom: boolean = td.ignoreBOM; + var fatal: boolean = td.fatal; + var encoding: string = td.encoding; + td.decode(new Int8Array(1)); + td.decode(new Int16Array(1)); + td.decode(new Int32Array(1)); + td.decode(new Uint8Array(1)); + td.decode(new Uint16Array(1)); + td.decode(new Uint32Array(1)); + td.decode(new Uint8ClampedArray(1)); + td.decode(new Float32Array(1)); + td.decode(new Float64Array(1)); + td.decode(new DataView(new Int8Array(1).buffer)); + td.decode(new ArrayBuffer(1)); + td.decode(null); + td.decode(null, { stream: true }); + td.decode(new Int8Array(1), { stream: true }); + var decode: string = td.decode(new Int8Array(1)); + + // util.TextEncoder() + var te = new util.TextEncoder(); + var teEncoding: string = te.encoding; + var teEncodeRes: Uint8Array = te.encode("TextEncoder"); } } From 06dca562095a88cfcc3678f11d0d66e8e7745247 Mon Sep 17 00:00:00 2001 From: Bruno Lemos Date: Tue, 24 Apr 2018 20:11:37 -0300 Subject: [PATCH 057/564] [sequelize] Change ReplicationOptions.read type to array (#25207) --- types/sequelize/index.d.ts | 2 +- types/sequelize/sequelize-tests.ts | 4 ++-- types/sequelize/v3/index.d.ts | 2 +- types/sequelize/v3/sequelize-tests.ts | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index d20bd83b86..b6d1da1e55 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -5320,7 +5320,7 @@ declare namespace sequelize { username?: string; password?: string; database?: string; - }; + }[]; write?: { host?: string; diff --git a/types/sequelize/sequelize-tests.ts b/types/sequelize/sequelize-tests.ts index 6c4f6c0a6f..1572b91c00 100644 --- a/types/sequelize/sequelize-tests.ts +++ b/types/sequelize/sequelize-tests.ts @@ -1243,11 +1243,11 @@ new Sequelize( 'wat', 'trololo', 'wow', { port : 99999 } ); new Sequelize( 'localhost', 'wtf', 'lol', { port : 99999 } ); new Sequelize( 'sequelize', null, null, { replication : { - read : { + read : [{ host : 'localhost', username : 'omg', password : 'lol' - } + }] } } ); new Sequelize( { diff --git a/types/sequelize/v3/index.d.ts b/types/sequelize/v3/index.d.ts index 9453a8473d..eafa70b641 100644 --- a/types/sequelize/v3/index.d.ts +++ b/types/sequelize/v3/index.d.ts @@ -5067,7 +5067,7 @@ declare namespace sequelize { username?: string; password?: string; database?: string; - }; + }[]; write?: { host?: string; diff --git a/types/sequelize/v3/sequelize-tests.ts b/types/sequelize/v3/sequelize-tests.ts index b575271867..ccc0a66c96 100644 --- a/types/sequelize/v3/sequelize-tests.ts +++ b/types/sequelize/v3/sequelize-tests.ts @@ -1165,11 +1165,11 @@ new Sequelize( 'wat', 'trololo', 'wow', { port : 99999 } ); new Sequelize( 'localhost', 'wtf', 'lol', { port : 99999 } ); new Sequelize( 'sequelize', null, null, { replication : { - read : { + read : [{ host : 'localhost', username : 'omg', password : 'lol' - } + }] } } ); new Sequelize( { From 4a866a79f107d3bad50ebb6727486d7942328554 Mon Sep 17 00:00:00 2001 From: Drew Diamantoukos Date: Tue, 24 Apr 2018 19:11:49 -0400 Subject: [PATCH 058/564] Plotly.js: Added pointcloud type for ScatterData and sizemax property for Marker (#25234) * Adding pointcloud type for Plotly scatter type and sizemax for Marker * Added xy field for ScatterData, which is used by pointcloud --- types/plotly.js/index.d.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/types/plotly.js/index.d.ts b/types/plotly.js/index.d.ts index 9fbbeaa92f..6b405d3e53 100644 --- a/types/plotly.js/index.d.ts +++ b/types/plotly.js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for plotly.js 1.35 +// Type definitions for plotly.js 1.36 // Project: https://plot.ly/javascript/ // Definitions by: Chris Gervang // Martin Duparc @@ -6,6 +6,7 @@ // taoqf // Dadstart // Jared Szechy +// Drew Diamantoukos // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -354,10 +355,11 @@ export type Color = string | Array | Array Date: Tue, 24 Apr 2018 18:12:30 -0500 Subject: [PATCH 059/564] reactstrap: Add Missing Prop Types (#25104) * reactstrap: Add hideArrow PropType to * reactstrap: Remove dropup prop in favor of direction for * reactstrap: Update the version to 5.0 in index.d.ts header --- types/reactstrap/index.d.ts | 1 + types/reactstrap/lib/Dropdown.d.ts | 8 +++++++- types/reactstrap/lib/Popover.d.ts | 3 ++- types/reactstrap/reactstrap-tests.tsx | 4 ++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/types/reactstrap/index.d.ts b/types/reactstrap/index.d.ts index 359090b5b2..c8ff3e452f 100644 --- a/types/reactstrap/index.d.ts +++ b/types/reactstrap/index.d.ts @@ -7,6 +7,7 @@ // FaithForHumans // Kurt Preston // Tim Chen +// Pat Gaffney // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 diff --git a/types/reactstrap/lib/Dropdown.d.ts b/types/reactstrap/lib/Dropdown.d.ts index 17805d4908..52194dac65 100644 --- a/types/reactstrap/lib/Dropdown.d.ts +++ b/types/reactstrap/lib/Dropdown.d.ts @@ -1,5 +1,11 @@ import { CSSModule } from '../index'; +export type Direction = + | "up" + | "down" + | "left" + | "right" + export interface UncontrolledProps extends React.HTMLAttributes { isOpen?: boolean; toggle?: () => void; @@ -14,7 +20,7 @@ export interface UncontrolledDropdownProps extends UncontrolledProps { export interface Props extends UncontrolledProps { disabled?: boolean; - dropup?: boolean; + direction?: Direction; group?: boolean; size?: string; tag?: React.ReactType; diff --git a/types/reactstrap/lib/Popover.d.ts b/types/reactstrap/lib/Popover.d.ts index 07634cd787..3012b64485 100644 --- a/types/reactstrap/lib/Popover.d.ts +++ b/types/reactstrap/lib/Popover.d.ts @@ -1,7 +1,7 @@ /// import { CSSModule } from '../index'; -import {Popper} from './Popper'; +import { Popper } from './Popper'; export interface PopoverProps extends React.HTMLAttributes { isOpen?: boolean; @@ -12,6 +12,7 @@ export interface PopoverProps extends React.HTMLAttributes { placement?: Popper.Placement; innerClassName?: string; disabled?: boolean; + hideArrow?: boolean; placementPrefix?: string; delay?: number | {show: number, hide: number}; modifiers?: Popper.Modifiers; diff --git a/types/reactstrap/reactstrap-tests.tsx b/types/reactstrap/reactstrap-tests.tsx index 1b777d173c..f8515bf2b5 100644 --- a/types/reactstrap/reactstrap-tests.tsx +++ b/types/reactstrap/reactstrap-tests.tsx @@ -413,7 +413,7 @@ const Example18 = ( ); const Example19 = ( - true} dropup> + true} direction="up"> Dropup @@ -2533,7 +2533,7 @@ class PopoverItem extends React.Component { - + Popover Title Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. From 6a7b69883e41782ce32f49ad0fdaf0bc17b07ac1 Mon Sep 17 00:00:00 2001 From: Florent SCHILDKNECHT Date: Wed, 25 Apr 2018 01:13:13 +0200 Subject: [PATCH 060/564] [reactstrap] Correct FormGroups props typings (#25208) --- types/reactstrap/lib/FormGroup.d.ts | 2 +- types/reactstrap/reactstrap-tests.tsx | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/types/reactstrap/lib/FormGroup.d.ts b/types/reactstrap/lib/FormGroup.d.ts index 5827f2c17b..52c96f3060 100644 --- a/types/reactstrap/lib/FormGroup.d.ts +++ b/types/reactstrap/lib/FormGroup.d.ts @@ -3,9 +3,9 @@ import { CSSModule } from '../index'; export interface FormGroupProps extends React.HTMLProps { row?: boolean; check?: boolean; + inline?: boolean; disabled?: boolean; tag?: React.ReactType; - color?: string; className?: string; cssModule?: CSSModule; } diff --git a/types/reactstrap/reactstrap-tests.tsx b/types/reactstrap/reactstrap-tests.tsx index f8515bf2b5..9215bc7ba9 100644 --- a/types/reactstrap/reactstrap-tests.tsx +++ b/types/reactstrap/reactstrap-tests.tsx @@ -1141,6 +1141,20 @@ class Example45 extends React.Component { Check me out + + + + + + + + ); From d29b31e5dba366eba1a4f41d2ac42d616115ee6f Mon Sep 17 00:00:00 2001 From: Sam Walsh Date: Wed, 25 Apr 2018 11:13:27 +1200 Subject: [PATCH 061/564] @types/material-ui -ToggleProps.label change string to React.ReactNode (#25241) * @types/material-ui - Change `ToggleProps` `label` type to `React.ReactNode` instead of `string` * Amend samwalshnz github username to authors list for material-ui --- types/material-ui/index.d.ts | 3 ++- types/material-ui/material-ui-tests.tsx | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/types/material-ui/index.d.ts b/types/material-ui/index.d.ts index 8c7a49c96d..307ce84115 100644 --- a/types/material-ui/index.d.ts +++ b/types/material-ui/index.d.ts @@ -11,6 +11,7 @@ // Artyom Stukans // Dan Jones // Daisuke Mino +// Sam Walsh // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -1583,7 +1584,7 @@ declare namespace __MaterialUI { elementStyle?: React.CSSProperties; iconStyle?: React.CSSProperties; inputStyle?: React.CSSProperties; - label?: string; + label?: React.ReactNode; labelPosition?: "left" | "right"; labelStyle?: React.CSSProperties; onToggle?(e: React.MouseEvent<{}>, isInputChecked: boolean): void; diff --git a/types/material-ui/material-ui-tests.tsx b/types/material-ui/material-ui-tests.tsx index a416670d0d..a7bb59fcf8 100644 --- a/types/material-ui/material-ui-tests.tsx +++ b/types/material-ui/material-ui-tests.tsx @@ -5709,6 +5709,10 @@ const ToggleExampleSimple = () => ( label="Simple" style={styles.toggle} /> + Element} + style={styles.toggle} + /> Date: Tue, 24 Apr 2018 16:13:52 -0700 Subject: [PATCH 062/564] Update react-slick types (#25112) * Update types for react-slick 0.23.1 * Fix tests * Update react-slick version in comment * Don't include patch version --- types/react-slick/index.d.ts | 45 +++++++++++++++---------- types/react-slick/react-slick-tests.tsx | 6 ++-- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/types/react-slick/index.d.ts b/types/react-slick/index.d.ts index 475b9afcfc..fc7568ac4c 100644 --- a/types/react-slick/index.d.ts +++ b/types/react-slick/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-slick 0.15 +// Type definitions for react-slick 0.23 // Project: https://github.com/akiran/react-slick // Definitions by: Andrey Balokha // Giedrius Grabauskas @@ -27,54 +27,63 @@ export type SwipeDirection = "left" | "down" | "right" | "up" | string; export interface Settings { accessibility?: boolean; - className?: string; adaptiveHeight?: boolean; + afterChange?(currentSlide: number): void; + appendDots?(dots: React.ReactNode): JSX.Element; arrows?: boolean; - nextArrow?: JSX.Element; - prevArrow?: JSX.Element; - autoplay?: boolean; + asNavFor?: Slider; autoplaySpeed?: number; + autoplay?: boolean; + beforeChange?(currentSlide: number, nextSlide: number): void; centerMode?: boolean; centerPadding?: string; + className?: string; cssEase?: string; customPaging?(index: number): JSX.Element; - dots?: boolean; dotsClass?: string; + dots?: boolean; draggable?: boolean; easing?: string; + edgeFriction?: number; fade?: boolean; focusOnSelect?: boolean; infinite?: boolean; initialSlide?: number; - lazyLoad?: boolean; + lazyLoad?: "ondemand" | "progressive"; + nextArrow?: JSX.Element; + onEdge?(swipeDirection: SwipeDirection): void; + onInit?(): void; + onLazyLoad?(slidesToLoad: number[]): void; + onReInit?(): void; + onSwipe?(swipeDirection: SwipeDirection): void; + pauseOnDotsHover?: boolean; + pauseOnFocus?: boolean; pauseOnHover?: boolean; + prevArrow?: JSX.Element; responsive?: ResponsiveObject[]; + rows?: number; rtl?: boolean; slide?: string; - slidesToShow?: number; + slidesPerRow?: number; slidesToScroll?: number; + slidesToShow?: number; speed?: number; - swipe?: boolean; swipeToSlide?: boolean; + swipe?: boolean; + swipeEvent?(swipeDirection: SwipeDirection): void; touchMove?: boolean; touchThreshold?: number; - variableWidth?: boolean; useCSS?: boolean; + useTransform?: boolean; + variableWidth?: boolean; vertical?: boolean; - afterChange?(currentSlide: number): void; - beforeChange?(currentSlide: number, nextSlide: number): void; - slickGoTo?: number; - edgeFriction?: number; waitForAnimate?: boolean; - edgeEvent?(swipeDirection: SwipeDirection): void; - swipeEvent?(swipeDirection: SwipeDirection): void; - init?(): void; } declare class Slider extends React.Component { slickNext(): void; slickPrev(): void; - slickGoTo(slideNumber: number): void; + slickGoTo(slideNumber: number, dontAnimate?: boolean): void; } export default Slider; diff --git a/types/react-slick/react-slick-tests.tsx b/types/react-slick/react-slick-tests.tsx index 18a104049f..aebcabc81d 100644 --- a/types/react-slick/react-slick-tests.tsx +++ b/types/react-slick/react-slick-tests.tsx @@ -40,7 +40,7 @@ const defaultSettings: Settings = { focusOnSelect: false, infinite: true, initialSlide: 0, - lazyLoad: false, + lazyLoad: "progressive", pauseOnHover: true, responsive: [{ breakpoint: 1000, settings: "unslick" }, { breakpoint: 2000, settings: { arrows: false } }], rtl: false, @@ -58,8 +58,8 @@ const defaultSettings: Settings = { waitForAnimate: true, afterChange: (currentSlide: number) => { }, beforeChange: (currentSlide: number, nextSlide: number) => { }, - edgeEvent: (swipeDirection: string) => { }, - init: () => { }, + onEdge: (swipeDirection: string) => { }, + onInit: () => { }, swipeEvent: (swipeDirection: string) => { }, nextArrow: , prevArrow: From 7f5ae12581aa76ff9ae2064008d5d120b60d08d3 Mon Sep 17 00:00:00 2001 From: Toby Rahilly Date: Wed, 25 Apr 2018 09:14:10 +1000 Subject: [PATCH 063/564] react-dnd-touch-backend: Add touchSlop, ignoreContextMenu and scrollAngleRanges options. (#25244) * Add touchSlop, ignoreContextMenu and scrollAngleRanges to the TouchBackendOptions type. * v4 --- types/react-dnd-touch-backend/index.d.ts | 16 +++++++++++++++- .../react-dnd-touch-backend-tests.ts | 4 ++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/types/react-dnd-touch-backend/index.d.ts b/types/react-dnd-touch-backend/index.d.ts index d8e1681f96..86ba0d1d10 100644 --- a/types/react-dnd-touch-backend/index.d.ts +++ b/types/react-dnd-touch-backend/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-dnd-touch-backend 0.3 +// Type definitions for react-dnd-touch-backend 0.4 // Project: https://github.com/yahoo/react-dnd-touch-backend#readme // Definitions by: Daniel Król , Janeene Beeforth // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -31,4 +31,18 @@ export interface TouchBackendOptions { * @deprecated replaced by delayTouchStart and delayMouseStart, but is still supported at present. */ delay?: number; + /** + * Specifies the pixel distance moved before a drag is signaled. Default 0. + */ + touchSlop?: number; + /** + * If true, prevents the contextmenu event from canceling a drag. Default false. + */ + ignoreContextMenu?: boolean; + /** + * Specifies ranges of angles in degrees that drag events should be ignored. This is useful when you want to allow + * the user to scroll in a particular direction instead of dragging. Degrees move clockwise, 0/360 pointing to the + * left. Default: undefined + */ + scrollAngleRanges?: ReadonlyArray<{ start?: number, end?: number }>; } diff --git a/types/react-dnd-touch-backend/react-dnd-touch-backend-tests.ts b/types/react-dnd-touch-backend/react-dnd-touch-backend-tests.ts index 3e77b52d78..dbf807a6a8 100644 --- a/types/react-dnd-touch-backend/react-dnd-touch-backend-tests.ts +++ b/types/react-dnd-touch-backend/react-dnd-touch-backend-tests.ts @@ -11,3 +11,7 @@ const dndComponentKeyboardEvents = ReactDnd.DragDropContext(TouchBackend({enable const dndComponentOldDelay = ReactDnd.DragDropContext(TouchBackend({delay: 300})); const dndComponentAllCurrentEvents = ReactDnd.DragDropContext(TouchBackend( {enableKeyboardEvents: true, enableMouseEvents: true, delayMouseStart: 100, delayTouchStart: 200})); +const dndComponentWithScrollAngleRanges = ReactDnd.DragDropContext(TouchBackend( + { scrollAngleRanges: [{ start: 0, end: 0 }, { start: 0 }, { end: 0 }] })); +const dndComponentWithTouchSlop = ReactDnd.DragDropContext(TouchBackend({ touchSlop: 0 })); +const dndComponentWithIgnoreContextMenu = ReactDnd.DragDropContext(TouchBackend({ ignoreContextMenu: true })); From 959c2e2e3572f68bf1dcff140e9908982f3e286b Mon Sep 17 00:00:00 2001 From: Arjun Jhawar Date: Wed, 25 Apr 2018 11:14:38 +1200 Subject: [PATCH 064/564] Bugfix: change url to uri property name under SourceLocation to match API (#25243) --- types/cucumber/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/cucumber/index.d.ts b/types/cucumber/index.d.ts index d93ad4c7b2..03dda3d736 100644 --- a/types/cucumber/index.d.ts +++ b/types/cucumber/index.d.ts @@ -81,7 +81,7 @@ export interface HookScenarioResult { export interface SourceLocation { line: number; - url: string; + uri: string; } export interface ScenarioResult { From 73619f74ffedb15ca332a4a934c58f75f5fd7310 Mon Sep 17 00:00:00 2001 From: Nick Schultz Date: Tue, 24 Apr 2018 19:17:23 -0400 Subject: [PATCH 065/564] [Sequelize] Fix types error with UpsertOptions requiring the returning option if they are defined at all (#25240) * upsert should compile with options that dont include returning * fix parens * bump version for bugfix --- types/sequelize/index.d.ts | 4 ++-- types/sequelize/sequelize-tests.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index b6d1da1e55..37a0b46829 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Sequelize 4.27.9 +// Type definitions for Sequelize 4.27.10 // Project: http://sequelizejs.com // Definitions by: samuelneff // Peter Harris @@ -4006,7 +4006,7 @@ declare namespace sequelize { * because SQLite always runs INSERT OR IGNORE + UPDATE, in a single query, so there is no way to know * whether the row was inserted or not. */ - upsert(values: TAttributes, options?: UpsertOptions & { returning: false | undefined }): Promise; + upsert(values: TAttributes, options?: UpsertOptions & { returning?: false | undefined }): Promise; upsert(values: TAttributes, options?: UpsertOptions & { returning: true }): Promise<[TInstance, boolean]>; insertOrUpdate(values: TAttributes, options?: UpsertOptions & { returning: false | undefined }): Promise; insertOrUpdate(values: TAttributes, options?: UpsertOptions & { returning: true }): Promise<[TInstance, boolean]>; diff --git a/types/sequelize/sequelize-tests.ts b/types/sequelize/sequelize-tests.ts index 1572b91c00..9c5eb13708 100644 --- a/types/sequelize/sequelize-tests.ts +++ b/types/sequelize/sequelize-tests.ts @@ -1055,6 +1055,7 @@ findOrRetVal = User.findOrCreate( { where : { email : 'unique.email.@d.com', com findOrRetVal = User.findOrCreate( { where : { objectId : 1 }, defaults : { bool : false } } ); let upsertPromiseNoOptions: Bluebird = User.upsert( { id : 42, username : 'doe', foo : s.fn( 'upper', 'mixedCase2' ) } ); +let upsertPromiseWithNonReturningOptions: Bluebird = User.upsert( { id : 42, username : 'doe', foo : s.fn( 'upper', 'mixedCase2' ) }, { logging: true } ); let upsertPromiseReturning: Bluebird<[AnyInstance, boolean]> = User.upsert( { id : 42, username : 'doe', foo : s.fn( 'upper', 'mixedCase2' ) }, { returning: true } ); let upsertPromiseNotReturning: Bluebird = User.upsert( { id : 42, username : 'doe', foo : s.fn( 'upper', 'mixedCase2' ) }, { returning: false } ); From 49b8178b77118ea713351a78639f74e8e1149b11 Mon Sep 17 00:00:00 2001 From: Ben Cook Date: Tue, 24 Apr 2018 18:19:00 -0500 Subject: [PATCH 066/564] Add type definitions for base64-arraybuffer (#25239) * Added declarations for 'base64-arraybuffer' * fix linting and header --- .../base64-arraybuffer-tests.ts | 4 ++++ types/base64-arraybuffer/index.d.ts | 7 ++++++ types/base64-arraybuffer/tsconfig.json | 23 +++++++++++++++++++ types/base64-arraybuffer/tslint.json | 1 + 4 files changed, 35 insertions(+) create mode 100644 types/base64-arraybuffer/base64-arraybuffer-tests.ts create mode 100644 types/base64-arraybuffer/index.d.ts create mode 100644 types/base64-arraybuffer/tsconfig.json create mode 100644 types/base64-arraybuffer/tslint.json diff --git a/types/base64-arraybuffer/base64-arraybuffer-tests.ts b/types/base64-arraybuffer/base64-arraybuffer-tests.ts new file mode 100644 index 0000000000..3263f45afe --- /dev/null +++ b/types/base64-arraybuffer/base64-arraybuffer-tests.ts @@ -0,0 +1,4 @@ +import { encode, decode } from 'base64-arraybuffer'; + +encode(new Float32Array([1, 2, 3]).buffer); // $ExpectType string +decode('AACAPwAAAEAAAEBA'); // $ExpectType ArrayBuffer diff --git a/types/base64-arraybuffer/index.d.ts b/types/base64-arraybuffer/index.d.ts new file mode 100644 index 0000000000..8d8f5b8285 --- /dev/null +++ b/types/base64-arraybuffer/index.d.ts @@ -0,0 +1,7 @@ +// Type definitions for base64-arraybuffer 0.1 +// Project: https://github.com/niklasvh/base64-arraybuffer +// Definitions by: Ben Cook +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function encode(arraybuffer: ArrayBuffer): string; +export function decode(base64: string): ArrayBuffer; diff --git a/types/base64-arraybuffer/tsconfig.json b/types/base64-arraybuffer/tsconfig.json new file mode 100644 index 0000000000..5d6ba6ac31 --- /dev/null +++ b/types/base64-arraybuffer/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "base64-arraybuffer-tests.ts" + ] +} diff --git a/types/base64-arraybuffer/tslint.json b/types/base64-arraybuffer/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/base64-arraybuffer/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 8231b1a62a5f69e489a48c4f002b05eed128d884 Mon Sep 17 00:00:00 2001 From: Michael Utz Date: Wed, 25 Apr 2018 02:20:12 +0300 Subject: [PATCH 067/564] added jest-each module declarations (#25224) * added jest-each module declarations * test: updated tests for `it.skip` and `it.only` --- types/jest-each/index.d.ts | 42 ++++++++++++++++++++++++++++++ types/jest-each/jest-each-tests.ts | 19 ++++++++++++++ types/jest-each/tsconfig.json | 23 ++++++++++++++++ types/jest-each/tslint.json | 1 + 4 files changed, 85 insertions(+) create mode 100644 types/jest-each/index.d.ts create mode 100644 types/jest-each/jest-each-tests.ts create mode 100644 types/jest-each/tsconfig.json create mode 100644 types/jest-each/tslint.json diff --git a/types/jest-each/index.d.ts b/types/jest-each/index.d.ts new file mode 100644 index 0000000000..01d13db0e4 --- /dev/null +++ b/types/jest-each/index.d.ts @@ -0,0 +1,42 @@ +// Type definitions for jest-each 0.3 +// Project: https://github.com/mattphillips/jest-each +// Definitions by: Michael Utz +// Definitions: +// TypeScript Version: 2.1 + +export = JestEach; + +declare function JestEach(parameters: any[][]): JestEach.ReturnType; + +declare namespace JestEach { + type SyncCallback = (...args: string[]) => void; + type AsyncCallback = () => void; + + type TestCallback = SyncCallback | AsyncCallback; + + type TestFn = (name: string, fn: TestCallback) => void; + type DescribeFn = (name: string, fn: SyncCallback) => void; + + interface TestObj { + (name: string, fn: TestCallback): void; + only: TestFn; + skip: TestFn; + } + + interface DescribeObj { + (name: string, fn: DescribeFn): void; + only: DescribeFn; + skip: DescribeFn; + } + + interface ReturnType { + test: TestObj; + it: TestObj; + fit: TestFn; + xit: TestFn; + xtest: TestFn; + describe: DescribeObj; + fdescribe: DescribeFn; + xdescribe: DescribeFn; + } +} diff --git a/types/jest-each/jest-each-tests.ts b/types/jest-each/jest-each-tests.ts new file mode 100644 index 0000000000..bbfbcabe05 --- /dev/null +++ b/types/jest-each/jest-each-tests.ts @@ -0,0 +1,19 @@ +import * as each from 'jest-each'; + +const params = [[1, 0, 1], [1, 1, 0], ['1', 'two', 'three']]; + +each(params).test('', () => {}); +each(params).it('', () => {}); +each(params).test.only('', () => {}); +each(params).it.only('', () => {}); +each(params).fit('', () => {}); +each(params).test.skip('', () => {}); +each(params).it.skip('', () => {}); +each(params).xit('', () => {}); +each(params).xtest('', () => {}); + +each(params).describe('', () => {}); +each(params).describe.only('', () => {}); +each(params).fdescribe('', () => {}); +each(params).describe.skip('', () => {}); +each(params).xdescribe('', () => {}); diff --git a/types/jest-each/tsconfig.json b/types/jest-each/tsconfig.json new file mode 100644 index 0000000000..62a3193837 --- /dev/null +++ b/types/jest-each/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jest-each-tests.ts" + ] +} diff --git a/types/jest-each/tslint.json b/types/jest-each/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jest-each/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From fd5742930d73d2889b2ab03da84ffe9b3be01298 Mon Sep 17 00:00:00 2001 From: Andrew Houghton Date: Tue, 24 Apr 2018 16:21:17 -0700 Subject: [PATCH 068/564] (new definition) add mjml (mjml.io) types (#25217) * add mjml (mjml.io) types * update mjml definition, actually verify linter runs, be more explicit in re: error types * mjml: int -> number. why does lint pass w/ 'int'? ah well. * per @plantain-00 CR --- types/mjml/index.d.ts | 29 +++++++++++++++++++++++++++++ types/mjml/mjml-tests.ts | 10 ++++++++++ types/mjml/tsconfig.json | 23 +++++++++++++++++++++++ types/mjml/tslint.json | 1 + 4 files changed, 63 insertions(+) create mode 100644 types/mjml/index.d.ts create mode 100644 types/mjml/mjml-tests.ts create mode 100644 types/mjml/tsconfig.json create mode 100644 types/mjml/tslint.json diff --git a/types/mjml/index.d.ts b/types/mjml/index.d.ts new file mode 100644 index 0000000000..bccb7d319d --- /dev/null +++ b/types/mjml/index.d.ts @@ -0,0 +1,29 @@ +// Type definitions for mjml 4.0 +// Project: https://github.com/mjmlio/mjml +// Definitions by: aahoughton +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface MJMLParsingOpts { + fonts?: { [key: string]: string; }; + keepComments?: boolean; + beautify?: boolean; + minify?: boolean; + validationLevel?: 'strict' | 'soft' | 'skip'; + filePath?: boolean; +} + +interface MJMLParseError { + line: number; + message: string; + tagName: string; + formattedMessage: string; +} + +interface MJMLParseResults { + html: string; + errors: MJMLParseError[]; +} + +declare function mjml2html(inp: string, opts?: MJMLParsingOpts): MJMLParseResults; + +export = mjml2html; diff --git a/types/mjml/mjml-tests.ts b/types/mjml/mjml-tests.ts new file mode 100644 index 0000000000..3a7711d08b --- /dev/null +++ b/types/mjml/mjml-tests.ts @@ -0,0 +1,10 @@ +import mjml2html = require('mjml'); + +const simple_test = mjml2html(""); +const html = simple_test.html; +const errors = simple_test.errors; +let formattedMessage = errors[0].formattedMessage; +formattedMessage = "force string test"; + +const minimal_opts_test = mjml2html("", {beautify: true}); +const validation_level_test = mjml2html("", {validationLevel: "strict"}); diff --git a/types/mjml/tsconfig.json b/types/mjml/tsconfig.json new file mode 100644 index 0000000000..5fb996bbe9 --- /dev/null +++ b/types/mjml/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "mjml-tests.ts" + ] +} diff --git a/types/mjml/tslint.json b/types/mjml/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/mjml/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 25c7bb748453909dfb7268ee96e5856325dae4a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=98i=C4=8Da=C5=99?= Date: Wed, 25 Apr 2018 01:22:23 +0200 Subject: [PATCH 069/564] [react-popover] Fix for users without allowSyntheticDefaultExports or esModuleInterop (#25216) --- types/react-popover/index.d.ts | 53 +++++++++++---------- types/react-popover/react-popover-tests.tsx | 2 +- 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/types/react-popover/index.d.ts b/types/react-popover/index.d.ts index 20958f3040..fed9c4c32d 100644 --- a/types/react-popover/index.d.ts +++ b/types/react-popover/index.d.ts @@ -6,30 +6,33 @@ import * as React from 'react'; -export type PopoverPlace = - | 'above' - | 'right' - | 'below' - | 'left' - | 'row' - | 'column' - | 'start' - | 'end'; +export = Popover; -export interface PopoverProps { - body: React.ReactNode; - isOpen?: boolean; - preferPlace?: PopoverPlace; - place?: PopoverPlace; - onOuterAction?: (event: Event) => void; - refreshIntervalMs?: number; - enterExitTransitionDurationMs?: number; - tipSize?: number; - className?: string; - style?: React.CSSProperties; - target?: React.ReactElement; - appendTarget?: Element; +declare class Popover extends React.Component {} + +declare namespace Popover { + type PopoverPlace = + | 'above' + | 'right' + | 'below' + | 'left' + | 'row' + | 'column' + | 'start' + | 'end'; + + interface PopoverProps { + body: React.ReactNode; + isOpen?: boolean; + preferPlace?: PopoverPlace; + place?: PopoverPlace; + onOuterAction?: (event: Event) => void; + refreshIntervalMs?: number; + enterExitTransitionDurationMs?: number; + tipSize?: number; + className?: string; + style?: React.CSSProperties; + target?: React.ReactElement; + appendTarget?: Element; + } } - -declare class Popover extends React.Component {} -export default Popover; diff --git a/types/react-popover/react-popover-tests.tsx b/types/react-popover/react-popover-tests.tsx index 39cb256c73..c0912d1f50 100644 --- a/types/react-popover/react-popover-tests.tsx +++ b/types/react-popover/react-popover-tests.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import Popover from 'react-popover'; +import Popover = require('react-popover'); class Test extends React.Component { render() { From 958ae300398af83fd4d4767d7b272ca1e5faf3d5 Mon Sep 17 00:00:00 2001 From: Max Date: Tue, 24 Apr 2018 16:25:01 -0700 Subject: [PATCH 070/564] add types for 'fluxible' and 'fluxible-router' (#25198) * add types for package 'fluxible' * add fluxible router types * fix tests * fixed annotation --- types/fluxible-router/index.d.ts | 28 ++++++ types/fluxible-router/tsconfig.json | 23 +++++ types/fluxible-router/tslint.json | 1 + types/fluxible/addons/BaseStore.d.ts | 4 + types/fluxible/addons/createStore.d.ts | 3 + types/fluxible/fluxible-tests.ts | 36 +++++++ types/fluxible/index.d.ts | 126 +++++++++++++++++++++++++ types/fluxible/tsconfig.json | 26 +++++ types/fluxible/tslint.json | 1 + 9 files changed, 248 insertions(+) create mode 100644 types/fluxible-router/index.d.ts create mode 100644 types/fluxible-router/tsconfig.json create mode 100644 types/fluxible-router/tslint.json create mode 100644 types/fluxible/addons/BaseStore.d.ts create mode 100644 types/fluxible/addons/createStore.d.ts create mode 100644 types/fluxible/fluxible-tests.ts create mode 100644 types/fluxible/index.d.ts create mode 100644 types/fluxible/tsconfig.json create mode 100644 types/fluxible/tslint.json diff --git a/types/fluxible-router/index.d.ts b/types/fluxible-router/index.d.ts new file mode 100644 index 0000000000..2dea024107 --- /dev/null +++ b/types/fluxible-router/index.d.ts @@ -0,0 +1,28 @@ +// Type definitions for fluxible-router 1.5 +// Project: https://github.com/yahoo/fluxible#readme +// Definitions by: xbim +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 +/// +import * as React from 'react'; +import { FluxibleContext } from 'fluxible'; +import BaseStore = require('fluxible/addons/BaseStore'); + +export class NavLink extends React.Component { } + +export class RouteStore extends BaseStore { + static withStaticRoutes(routes: object): typeof RouteStore; +} + +export function handleHistory(Component: typeof React.Component, opts?: object): typeof React.Component; + +export function navigateAction(context: FluxibleContext, params: object): undefined; + +export class NavLinkProps { + href?: string; + routeName?: string; + activeStyle?: object; + preserveScrollPosition?: boolean; + className?: string; + type?: string; +} diff --git a/types/fluxible-router/tsconfig.json b/types/fluxible-router/tsconfig.json new file mode 100644 index 0000000000..1ce319bb08 --- /dev/null +++ b/types/fluxible-router/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "esModuleInterop": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} diff --git a/types/fluxible-router/tslint.json b/types/fluxible-router/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/fluxible-router/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/fluxible/addons/BaseStore.d.ts b/types/fluxible/addons/BaseStore.d.ts new file mode 100644 index 0000000000..78b51c53c5 --- /dev/null +++ b/types/fluxible/addons/BaseStore.d.ts @@ -0,0 +1,4 @@ +/// +import BaseStore = require('dispatchr/addons/BaseStore'); + +export = BaseStore; diff --git a/types/fluxible/addons/createStore.d.ts b/types/fluxible/addons/createStore.d.ts new file mode 100644 index 0000000000..319a02dc51 --- /dev/null +++ b/types/fluxible/addons/createStore.d.ts @@ -0,0 +1,3 @@ +import createStore = require('dispatchr/addons/createStore'); + +export = createStore; diff --git a/types/fluxible/fluxible-tests.ts b/types/fluxible/fluxible-tests.ts new file mode 100644 index 0000000000..27de6d1b1e --- /dev/null +++ b/types/fluxible/fluxible-tests.ts @@ -0,0 +1,36 @@ +import { createDispatcher, Store } from 'dispatchr'; +import createStore = require('fluxible/addons/createStore'); +import BaseStore = require('fluxible/addons/BaseStore'); +import { Fluxible } from 'fluxible'; + +const TestStore = createStore({ + storeName: 'TestStore', + + handlers: { + ACTION_NAME: 'actionHandler' + }, + + statics: { + staticMethod() { + } + }, + + initialize() {}, +}); + +class ExtendedStore extends BaseStore { + static handlers = { + ACTION_NAME: 'actionHandler' + }; + + actionHandler() { + this.emitChange(); + } +} + +const app = new Fluxible({ + component: {} +}); + +app.registerStore(TestStore); +app.registerStore(ExtendedStore); diff --git a/types/fluxible/index.d.ts b/types/fluxible/index.d.ts new file mode 100644 index 0000000000..d317662e1b --- /dev/null +++ b/types/fluxible/index.d.ts @@ -0,0 +1,126 @@ +// Type definitions for fluxible 1.4 +// Project: https://fluxible.io/ +// Definitions by: xbim +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.5 +/// +import { Dispatcher, DispatcherInterface, StoreClass } from 'dispatchr'; +import BaseStore = require('./addons/BaseStore'); + +export interface FluxibleConfiguration { + /** + * App level component action handler + */ + componentActionHandler?: () => void; + /** + * Stores your top level React component for access using `getComponent()` + */ + component: any; +} + +/** + * Provides a structured way of registering an application's configuration and + * resources. + */ +export class Fluxible { + /** + * @param [options] + * @example + * var app = new Fluxible({ + * component: require('./components/App.jsx') + * }); + */ + constructor(options?: FluxibleConfiguration); + + /** + * Creates an isolated context for a request/session + * @param [contextOptions] The options object. Please refer to FluxibleContext's constructor + * doc for supported subfields and detailed description. + */ + createContext(contextOptions?: any): FluxibleContext; + + /** + * Creates a new dispatcher instance using the application's dispatchr class. Used by + * FluxibleContext to create new dispatcher instance + * @param contextOptions The context options to be provided to each store instance + */ + createDispatcherInstance(contextOptions?: any): Dispatcher; + + /** + * Provides plugin mechanism for adding application level settings that are persisted + * between server/client and also modification of the FluxibleContext + * @param plugin + * @param plugin.name Name of the plugin + * @param plugin.plugContext Method called after context is created to allow + * dynamically plugging the context + * @param [plugin.dehydrate] Method called to serialize the plugin settings to be persisted + * to the client + * @param [plugin.rehydrate] Method called to rehydrate the plugin settings from the server + */ + plug(plugin: any): void; + + /** + * Provides access to a plugin instance by name + * @param pluginName The plugin name + */ + getPlugin(pluginName: string): any; + + /** + * Getter for the top level react component for the application + */ + getComponent(): any; + + /** + * Registers a store to the dispatcher so it can listen for actions + */ + registerStore(store: StoreClass| typeof BaseStore): void; + + /** + * Creates a serializable state of the application and a given context for sending to the client + * @param context + */ + dehydrate(context?: FluxibleContext): any; + + /** + * Rehydrates the application and creates a new context with the state from the server + * @param obj Raw object of dehydrated state + * @param obj.plugins Dehydrated app plugin state + * @param obj.context Dehydrated context state. See FluxibleContext's + * rehydrate() for subfields in this object. + * @param callback + * @async Rehydration may require more asset loading or async IO calls + */ + rehydrate(state: any): void; +} + +/** + * A request or browser-session context + */ +export class FluxibleContext { + /** + * @param options The options sharable by the context and context plugins + */ + + constructor(options?: FluxibleConfiguration); + + /** + * Provides plugin mechanism for adding application level settings that are persisted + * between server/client and also modification of the FluxibleContext + */ + plug(plugin: any): void; + + /** + * Returns a serializable context state + */ + dehydrate(): any; + + /** + * Rehydrates the context state + */ + rehydrate(state: any): void; + + /** + * Getter for store from dispatcher + */ + getStore(store: { new(dispatcher?: DispatcherInterface): T; }): T; +} diff --git a/types/fluxible/tsconfig.json b/types/fluxible/tsconfig.json new file mode 100644 index 0000000000..9af8323ce8 --- /dev/null +++ b/types/fluxible/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "esModuleInterop": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "addons/createStore.d.ts", + "addons/BaseStore.d.ts", + "fluxible-tests.ts" + ] +} diff --git a/types/fluxible/tslint.json b/types/fluxible/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/fluxible/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From ddb98c71c2126e077c4a4749fc15b53519ba97a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anderson=20Fria=C3=A7a?= Date: Tue, 24 Apr 2018 19:26:13 -0400 Subject: [PATCH 071/564] Types for JQuery Loading Overlay (#25189) --- types/jquery-loading-overlay/index.d.ts | 46 +++++++++++++++++++ .../jquery-loading-overlay-tests.ts | 23 ++++++++++ types/jquery-loading-overlay/tsconfig.json | 25 ++++++++++ types/jquery-loading-overlay/tslint.json | 1 + 4 files changed, 95 insertions(+) create mode 100644 types/jquery-loading-overlay/index.d.ts create mode 100644 types/jquery-loading-overlay/jquery-loading-overlay-tests.ts create mode 100644 types/jquery-loading-overlay/tsconfig.json create mode 100644 types/jquery-loading-overlay/tslint.json diff --git a/types/jquery-loading-overlay/index.d.ts b/types/jquery-loading-overlay/index.d.ts new file mode 100644 index 0000000000..ff5fa59976 --- /dev/null +++ b/types/jquery-loading-overlay/index.d.ts @@ -0,0 +1,46 @@ +// Type definitions for JQuery Loading Overlay 1.0 +// Project: https://github.com/jgerigmeyer/jquery-loading-overlay +// Definitions by: Anderson Friaça +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +export type Options = Partial<{ + /** + * Class added to target while loading + */ + loadingClass: string; + + /** + * Class added to overlay (style with CSS) + */ + overlayClass: string; + + /** + * Class added to loading overlay spinner + */ + spinnerClass: string; + + /** + * Class added to loading overlay spinner + */ + iconClass: string; + + /** + * Class added to loading overlay spinner + */ + textClass: string; + + /** + * Text within loading overlay + */ + loadingText: string; +}>; + +declare global { + interface JQuery { + loadingOverlay(options?: Options): JQuery; + loadingOverlay(method: 'remove', options?: Options): JQuery; + } +} diff --git a/types/jquery-loading-overlay/jquery-loading-overlay-tests.ts b/types/jquery-loading-overlay/jquery-loading-overlay-tests.ts new file mode 100644 index 0000000000..a4d2afec9a --- /dev/null +++ b/types/jquery-loading-overlay/jquery-loading-overlay-tests.ts @@ -0,0 +1,23 @@ +import { Options } from "jquery-loading-overlay"; + +// Basic usage +$('#target').loadingOverlay(); + +$('#target').loadingOverlay('remove'); + +// With options +const options: Options = { + loadingClass: 'loading', + overlayClass: 'loading-overlay', + spinnerClass: 'loading-spinner', + iconClass: 'loading-icon', + textClass: 'loading-text', + loadingText: 'loading' +}; + +$('#target').loadingOverlay(options); + +$('#target').loadingOverlay('remove', { + loadingClass: 'loading', + overlayClass: 'loading-overlay' +}); diff --git a/types/jquery-loading-overlay/tsconfig.json b/types/jquery-loading-overlay/tsconfig.json new file mode 100644 index 0000000000..cb40c55c09 --- /dev/null +++ b/types/jquery-loading-overlay/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "jquery-loading-overlay-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jquery-loading-overlay/tslint.json b/types/jquery-loading-overlay/tslint.json new file mode 100644 index 0000000000..d04fe2e1fa --- /dev/null +++ b/types/jquery-loading-overlay/tslint.json @@ -0,0 +1 @@ +{"extends": "dtslint/dt.json"} \ No newline at end of file From 6c26901d8b20c4ee1b0827390697fe61f75f148a Mon Sep 17 00:00:00 2001 From: Alan Plum Date: Wed, 25 Apr 2018 01:28:27 +0200 Subject: [PATCH 072/564] Add ArangoDB typescript typings (#25087) * Initial declaration WIP * Unexplode linter * Some linting * More linting * More linting This was the last of the low-hanging fruit. * Use generic string index types There doesn't seem to be a way to set a "fallback" string index type so I guess this has to be as generic as necessary. * Expand stub interfaces * Get rid of extra declares These seem to be redundant * Get rid of extra exports and const enum This seems to simply work. * @arangodb/index -> @arangodb * Escape 'new' attribute to be safe? * Replace string index types with compositesa This seems to achieve the behaviour we want: typeof db.asdfg == ArangoDB.Collection | undefined typeof db._query == Function * Both options actually exist Thanks @Simran-B for clarifying this. * Remove PlainObject interface Turns out we actually want `object` as the default type almost everywhere. * Bolt down generics No sense defaulting to object if we don't also enforce extending object. Also those Documents and Edges might contain literally anything so let's allow that. * This is probably a hack but at least it works * Add example stub * Deduplicate route handler signatures * Brute force? This feels wrong. There must be a better way. * Pass linting * Possible workaround for globals * Unnecessary qualifier * Override NodeJS types * Add View API * Slightly more specific graphql types * Use actual graphql module for types * Better model manifest/config/deps * Apparently this doesn't require escaping * Fix InsertResult * Functions that always throw should return never? * Add HttpStatus * Add Console#logLines * type to interface * More example code * Inline some types * Inline JwtStorageOptions * Add sessions middleware example * Fix aql template string handler --- types/arangodb/arangodb-tests.ts | 63 + types/arangodb/index.d.ts | 1851 ++++++++++++++++++++++++++++++ types/arangodb/tsconfig.json | 16 + types/arangodb/tslint.json | 1 + 4 files changed, 1931 insertions(+) create mode 100644 types/arangodb/arangodb-tests.ts create mode 100644 types/arangodb/index.d.ts create mode 100644 types/arangodb/tsconfig.json create mode 100644 types/arangodb/tslint.json diff --git a/types/arangodb/arangodb-tests.ts b/types/arangodb/arangodb-tests.ts new file mode 100644 index 0000000000..b498caf6af --- /dev/null +++ b/types/arangodb/arangodb-tests.ts @@ -0,0 +1,63 @@ +import { db, aql } from "@arangodb"; +import { md5 } from "@arangodb/crypto"; +import { createRouter } from "@arangodb/foxx"; +import sessionsMiddleware = require("@arangodb/foxx/sessions"); +import jwtStorage = require("@arangodb/foxx/sessions/storages/jwt"); +import cookieTransport = require("@arangodb/foxx/sessions/transports/cookie"); + +console.warnStack(new Error(), "something went wrong"); + +interface User { + username: string; + password?: string; +} +const coll = module.context.collection("users")!; +coll.save({ username: "user" }); +const doc = coll.any(); +console.log(doc.username); + +const users = coll as ArangoDB.Collection; +const admin = users.firstExample({ username: "admin" })!; +users.update(admin, { password: md5("hunter2") }); +console.logLines("user", admin._key, admin.username); + +const query = aql` + FOR u IN ${users} + RETURN u +`; + +db._createDocumentCollection("bananas").ensureIndex({ + type: "hash", + unique: true, + fields: ["color", "shape"] +}); + +const router = createRouter(); +module.context.use(router); + +router.get("/", (req, res) => { + if (req.cookie("sid", { secret: "keyboardcat" })) { + res.set("content-type", "text/plain"); + res.write("Welcome back, Commander"); + } else { + res.json({ success: false }); + } +}); + +router.use((req, res, next) => { + if (req.is("json")) res.throw("too many requests"); + next(); +}); + +router.use( + sessionsMiddleware({ + storage: jwtStorage({ algorithm: "none" }), + transport: "header" + }) +); +router.use( + sessionsMiddleware({ + storage: jwtStorage({ algorithm: "HS512", secret: "tacocat" }), + transport: cookieTransport({ secret: "banana", algorithm: "sha256" }) + }) +); diff --git a/types/arangodb/index.d.ts b/types/arangodb/index.d.ts new file mode 100644 index 0000000000..34cf3ef99e --- /dev/null +++ b/types/arangodb/index.d.ts @@ -0,0 +1,1851 @@ +// Type definitions for ArangoDB 3.4 +// Project: https://github.com/arangodb/arangodb +// Definitions by: Alan Plum +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/// + +declare namespace ArangoDB { + type JwtAlgorithm = "HS512" | "HS384" | "HS256"; + type HashAlgorithm = + | "sha512" + | "sha384" + | "sha256" + | "sha224" + | "sha1" + | "md5"; + type HttpMethod = + | "HEAD" + | "GET" + | "POST" + | "PUT" + | "PATCH" + | "DELETE" + | "OPTIONS"; + type HttpStatus = + | "continue" + | "switching protocols" + | "processing" + | "ok" + | "created" + | "accepted" + | "non-authoritative information" + | "no content" + | "reset content" + | "partial content" + | "multi-status" + | "already reported" + | "im used" + | "multiple choices" + | "moved permanently" + | "found" + | "see other" + | "not modified" + | "use proxy" + | "(unused)" + | "temporary redirect" + | "permanent redirect" + | "bad request" + | "unauthorized" + | "payment required" + | "forbidden" + | "not found" + | "method not allowed" + | "not acceptable" + | "proxy authentication required" + | "request timeout" + | "conflict" + | "gone" + | "length required" + | "precondition failed" + | "payload too large" + | "uri too long" + | "unsupported media type" + | "range not satisfiable" + | "expectation failed" + | "i'm a teapot" + | "misdirected request" + | "unprocessable entity" + | "locked" + | "failed dependency" + | "unordered collection" + | "upgrade required" + | "precondition required" + | "too many requests" + | "request header fields too large" + | "unavailable for legal reasons" + | "internal server error" + | "not implemented" + | "bad gateway" + | "service unavailable" + | "gateway timeout" + | "http version not supported" + | "variant also negotiates" + | "insufficient storage" + | "loop detected" + | "bandwidth limit exceeded" + | "not extended" + | "network authentication required"; + type EdgeDirection = "any" | "inbound" | "outbound"; + type EngineType = "mmfiles" | "rocksdb"; + type IndexType = "hash" | "skiplist" | "fulltext" | "geo1" | "geo2"; + type ViewType = "arangosearch"; + type ErrorName = + | "ERROR_NO_ERROR" + | "ERROR_FAILED" + | "ERROR_SYS_ERROR" + | "ERROR_OUT_OF_MEMORY" + | "ERROR_INTERNAL" + | "ERROR_ILLEGAL_NUMBER" + | "ERROR_NUMERIC_OVERFLOW" + | "ERROR_ILLEGAL_OPTION" + | "ERROR_DEAD_PID" + | "ERROR_NOT_IMPLEMENTED" + | "ERROR_BAD_PARAMETER" + | "ERROR_FORBIDDEN" + | "ERROR_OUT_OF_MEMORY_MMAP" + | "ERROR_CORRUPTED_CSV" + | "ERROR_FILE_NOT_FOUND" + | "ERROR_CANNOT_WRITE_FILE" + | "ERROR_CANNOT_OVERWRITE_FILE" + | "ERROR_TYPE_ERROR" + | "ERROR_LOCK_TIMEOUT" + | "ERROR_CANNOT_CREATE_DIRECTORY" + | "ERROR_CANNOT_CREATE_TEMP_FILE" + | "ERROR_REQUEST_CANCELED" + | "ERROR_DEBUG" + | "ERROR_IP_ADDRESS_INVALID" + | "ERROR_FILE_EXISTS" + | "ERROR_LOCKED" + | "ERROR_DEADLOCK" + | "ERROR_SHUTTING_DOWN" + | "ERROR_ONLY_ENTERPRISE" + | "ERROR_RESOURCE_LIMIT" + | "ERROR_ARANGO_ICU_ERROR" + | "ERROR_CANNOT_READ_FILE" + | "ERROR_HTTP_BAD_PARAMETER" + | "ERROR_HTTP_UNAUTHORIZED" + | "ERROR_HTTP_FORBIDDEN" + | "ERROR_HTTP_NOT_FOUND" + | "ERROR_HTTP_METHOD_NOT_ALLOWED" + | "ERROR_HTTP_NOT_ACCEPTABLE" + | "ERROR_HTTP_PRECONDITION_FAILED" + | "ERROR_HTTP_SERVER_ERROR" + | "ERROR_HTTP_SERVICE_UNAVAILABLE" + | "ERROR_HTTP_GATEWAY_TIMEOUT" + | "ERROR_HTTP_CORRUPTED_JSON" + | "ERROR_HTTP_SUPERFLUOUS_SUFFICES" + | "ERROR_ARANGO_ILLEGAL_STATE" + | "ERROR_ARANGO_DATAFILE_SEALED" + | "ERROR_ARANGO_READ_ONLY" + | "ERROR_ARANGO_DUPLICATE_IDENTIFIER" + | "ERROR_ARANGO_DATAFILE_UNREADABLE" + | "ERROR_ARANGO_DATAFILE_EMPTY" + | "ERROR_ARANGO_RECOVERY" + | "ERROR_ARANGO_DATAFILE_STATISTICS_NOT_FOUND" + | "ERROR_ARANGO_CORRUPTED_DATAFILE" + | "ERROR_ARANGO_ILLEGAL_PARAMETER_FILE" + | "ERROR_ARANGO_CORRUPTED_COLLECTION" + | "ERROR_ARANGO_MMAP_FAILED" + | "ERROR_ARANGO_FILESYSTEM_FULL" + | "ERROR_ARANGO_NO_JOURNAL" + | "ERROR_ARANGO_DATAFILE_ALREADY_EXISTS" + | "ERROR_ARANGO_DATADIR_LOCKED" + | "ERROR_ARANGO_COLLECTION_DIRECTORY_ALREADY_EXISTS" + | "ERROR_ARANGO_MSYNC_FAILED" + | "ERROR_ARANGO_DATADIR_UNLOCKABLE" + | "ERROR_ARANGO_SYNC_TIMEOUT" + | "ERROR_ARANGO_CONFLICT" + | "ERROR_ARANGO_DATADIR_INVALID" + | "ERROR_ARANGO_DOCUMENT_NOT_FOUND" + | "ERROR_ARANGO_DATA_SOURCE_NOT_FOUND" + | "ERROR_ARANGO_COLLECTION_PARAMETER_MISSING" + | "ERROR_ARANGO_DOCUMENT_HANDLE_BAD" + | "ERROR_ARANGO_MAXIMAL_SIZE_TOO_SMALL" + | "ERROR_ARANGO_DUPLICATE_NAME" + | "ERROR_ARANGO_ILLEGAL_NAME" + | "ERROR_ARANGO_NO_INDEX" + | "ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED" + | "ERROR_ARANGO_INDEX_NOT_FOUND" + | "ERROR_ARANGO_CROSS_COLLECTION_REQUEST" + | "ERROR_ARANGO_INDEX_HANDLE_BAD" + | "ERROR_ARANGO_DOCUMENT_TOO_LARGE" + | "ERROR_ARANGO_COLLECTION_NOT_UNLOADED" + | "ERROR_ARANGO_COLLECTION_TYPE_INVALID" + | "ERROR_ARANGO_VALIDATION_FAILED" + | "ERROR_ARANGO_ATTRIBUTE_PARSER_FAILED" + | "ERROR_ARANGO_DOCUMENT_KEY_BAD" + | "ERROR_ARANGO_DOCUMENT_KEY_UNEXPECTED" + | "ERROR_ARANGO_DATADIR_NOT_WRITABLE" + | "ERROR_ARANGO_OUT_OF_KEYS" + | "ERROR_ARANGO_DOCUMENT_KEY_MISSING" + | "ERROR_ARANGO_DOCUMENT_TYPE_INVALID" + | "ERROR_ARANGO_DATABASE_NOT_FOUND" + | "ERROR_ARANGO_DATABASE_NAME_INVALID" + | "ERROR_ARANGO_USE_SYSTEM_DATABASE" + | "ERROR_ARANGO_ENDPOINT_NOT_FOUND" + | "ERROR_ARANGO_INVALID_KEY_GENERATOR" + | "ERROR_ARANGO_INVALID_EDGE_ATTRIBUTE" + | "ERROR_ARANGO_INDEX_DOCUMENT_ATTRIBUTE_MISSING" + | "ERROR_ARANGO_INDEX_CREATION_FAILED" + | "ERROR_ARANGO_WRITE_THROTTLE_TIMEOUT" + | "ERROR_ARANGO_COLLECTION_TYPE_MISMATCH" + | "ERROR_ARANGO_COLLECTION_NOT_LOADED" + | "ERROR_ARANGO_DOCUMENT_REV_BAD" + | "ERROR_ARANGO_DATAFILE_FULL" + | "ERROR_ARANGO_EMPTY_DATADIR" + | "ERROR_ARANGO_TRY_AGAIN" + | "ERROR_ARANGO_BUSY" + | "ERROR_ARANGO_MERGE_IN_PROGRESS" + | "ERROR_ARANGO_IO_ERROR" + | "ERROR_REPLICATION_NO_RESPONSE" + | "ERROR_REPLICATION_INVALID_RESPONSE" + | "ERROR_REPLICATION_MASTER_ERROR" + | "ERROR_REPLICATION_MASTER_INCOMPATIBLE" + | "ERROR_REPLICATION_MASTER_CHANGE" + | "ERROR_REPLICATION_LOOP" + | "ERROR_REPLICATION_UNEXPECTED_MARKER" + | "ERROR_REPLICATION_INVALID_APPLIER_STATE" + | "ERROR_REPLICATION_UNEXPECTED_TRANSACTION" + | "ERROR_REPLICATION_INVALID_APPLIER_CONFIGURATION" + | "ERROR_REPLICATION_RUNNING" + | "ERROR_REPLICATION_APPLIER_STOPPED" + | "ERROR_REPLICATION_NO_START_TICK" + | "ERROR_REPLICATION_START_TICK_NOT_PRESENT" + | "ERROR_REPLICATION_WRONG_CHECKSUM" + | "ERROR_REPLICATION_SHARD_NONEMPTY" + | "ERROR_CLUSTER_NO_AGENCY" + | "ERROR_CLUSTER_NO_COORDINATOR_HEADER" + | "ERROR_CLUSTER_COULD_NOT_LOCK_PLAN" + | "ERROR_CLUSTER_COLLECTION_ID_EXISTS" + | "ERROR_CLUSTER_COULD_NOT_CREATE_COLLECTION_IN_PLAN" + | "ERROR_CLUSTER_COULD_NOT_READ_CURRENT_VERSION" + | "ERROR_CLUSTER_COULD_NOT_CREATE_COLLECTION" + | "ERROR_CLUSTER_TIMEOUT" + | "ERROR_CLUSTER_COULD_NOT_REMOVE_COLLECTION_IN_PLAN" + | "ERROR_CLUSTER_COULD_NOT_REMOVE_COLLECTION_IN_CURRENT" + | "ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE_IN_PLAN" + | "ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE" + | "ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_PLAN" + | "ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_CURRENT" + | "ERROR_CLUSTER_SHARD_GONE" + | "ERROR_CLUSTER_CONNECTION_LOST" + | "ERROR_CLUSTER_MUST_NOT_SPECIFY_KEY" + | "ERROR_CLUSTER_GOT_CONTRADICTING_ANSWERS" + | "ERROR_CLUSTER_NOT_ALL_SHARDING_ATTRIBUTES_GIVEN" + | "ERROR_CLUSTER_MUST_NOT_CHANGE_SHARDING_ATTRIBUTES" + | "ERROR_CLUSTER_UNSUPPORTED" + | "ERROR_CLUSTER_ONLY_ON_COORDINATOR" + | "ERROR_CLUSTER_READING_PLAN_AGENCY" + | "ERROR_CLUSTER_COULD_NOT_TRUNCATE_COLLECTION" + | "ERROR_CLUSTER_AQL_COMMUNICATION" + | "ERROR_ARANGO_DOCUMENT_NOT_FOUND_OR_SHARDING_ATTRIBUTES_CHANGED" + | "ERROR_CLUSTER_COULD_NOT_DETERMINE_ID" + | "ERROR_CLUSTER_ONLY_ON_DBSERVER" + | "ERROR_CLUSTER_BACKEND_UNAVAILABLE" + | "ERROR_CLUSTER_UNKNOWN_CALLBACK_ENDPOINT" + | "ERROR_CLUSTER_AGENCY_STRUCTURE_INVALID" + | "ERROR_CLUSTER_AQL_COLLECTION_OUT_OF_SYNC" + | "ERROR_CLUSTER_COULD_NOT_CREATE_INDEX_IN_PLAN" + | "ERROR_CLUSTER_COULD_NOT_DROP_INDEX_IN_PLAN" + | "ERROR_CLUSTER_CHAIN_OF_DISTRIBUTESHARDSLIKE" + | "ERROR_CLUSTER_MUST_NOT_DROP_COLL_OTHER_DISTRIBUTESHARDSLIKE" + | "ERROR_CLUSTER_UNKNOWN_DISTRIBUTESHARDSLIKE" + | "ERROR_CLUSTER_INSUFFICIENT_DBSERVERS" + | "ERROR_CLUSTER_COULD_NOT_DROP_FOLLOWER" + | "ERROR_CLUSTER_SHARD_LEADER_REFUSES_REPLICATION" + | "ERROR_CLUSTER_SHARD_FOLLOWER_REFUSES_OPERATION" + | "ERROR_CLUSTER_SHARD_LEADER_RESIGNED" + | "ERROR_CLUSTER_AGENCY_COMMUNICATION_FAILED" + | "ERROR_CLUSTER_DISTRIBUTE_SHARDS_LIKE_REPLICATION_FACTOR" + | "ERROR_CLUSTER_DISTRIBUTE_SHARDS_LIKE_NUMBER_OF_SHARDS" + | "ERROR_CLUSTER_LEADERSHIP_CHALLENGE_ONGOING" + | "ERROR_CLUSTER_NOT_LEADER" + | "ERROR_CLUSTER_COULD_NOT_CREATE_VIEW_IN_PLAN" + | "ERROR_QUERY_KILLED" + | "ERROR_QUERY_PARSE" + | "ERROR_QUERY_EMPTY" + | "ERROR_QUERY_SCRIPT" + | "ERROR_QUERY_NUMBER_OUT_OF_RANGE" + | "ERROR_QUERY_VARIABLE_NAME_INVALID" + | "ERROR_QUERY_VARIABLE_REDECLARED" + | "ERROR_QUERY_VARIABLE_NAME_UNKNOWN" + | "ERROR_QUERY_COLLECTION_LOCK_FAILED" + | "ERROR_QUERY_TOO_MANY_COLLECTIONS" + | "ERROR_QUERY_DOCUMENT_ATTRIBUTE_REDECLARED" + | "ERROR_QUERY_FUNCTION_NAME_UNKNOWN" + | "ERROR_QUERY_FUNCTION_ARGUMENT_NUMBER_MISMATCH" + | "ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH" + | "ERROR_QUERY_INVALID_REGEX" + | "ERROR_QUERY_BIND_PARAMETERS_INVALID" + | "ERROR_QUERY_BIND_PARAMETER_MISSING" + | "ERROR_QUERY_BIND_PARAMETER_UNDECLARED" + | "ERROR_QUERY_BIND_PARAMETER_TYPE" + | "ERROR_QUERY_INVALID_LOGICAL_VALUE" + | "ERROR_QUERY_INVALID_ARITHMETIC_VALUE" + | "ERROR_QUERY_DIVISION_BY_ZERO" + | "ERROR_QUERY_ARRAY_EXPECTED" + | "ERROR_QUERY_FAIL_CALLED" + | "ERROR_QUERY_GEO_INDEX_MISSING" + | "ERROR_QUERY_FULLTEXT_INDEX_MISSING" + | "ERROR_QUERY_INVALID_DATE_VALUE" + | "ERROR_QUERY_MULTI_MODIFY" + | "ERROR_QUERY_INVALID_AGGREGATE_EXPRESSION" + | "ERROR_QUERY_COMPILE_TIME_OPTIONS" + | "ERROR_QUERY_EXCEPTION_OPTIONS" + | "ERROR_QUERY_COLLECTION_USED_IN_EXPRESSION" + | "ERROR_QUERY_DISALLOWED_DYNAMIC_CALL" + | "ERROR_QUERY_ACCESS_AFTER_MODIFICATION" + | "ERROR_QUERY_FUNCTION_INVALID_NAME" + | "ERROR_QUERY_FUNCTION_INVALID_CODE" + | "ERROR_QUERY_FUNCTION_NOT_FOUND" + | "ERROR_QUERY_FUNCTION_RUNTIME_ERROR" + | "ERROR_QUERY_BAD_JSON_PLAN" + | "ERROR_QUERY_NOT_FOUND" + | "ERROR_QUERY_IN_USE" + | "ERROR_QUERY_USER_ASSERT" + | "ERROR_QUERY_USER_WARN" + | "ERROR_CURSOR_NOT_FOUND" + | "ERROR_CURSOR_BUSY" + | "ERROR_TRANSACTION_INTERNAL" + | "ERROR_TRANSACTION_NESTED" + | "ERROR_TRANSACTION_UNREGISTERED_COLLECTION" + | "ERROR_TRANSACTION_DISALLOWED_OPERATION" + | "ERROR_TRANSACTION_ABORTED" + | "ERROR_USER_INVALID_NAME" + | "ERROR_USER_INVALID_PASSWORD" + | "ERROR_USER_DUPLICATE" + | "ERROR_USER_NOT_FOUND" + | "ERROR_USER_CHANGE_PASSWORD" + | "ERROR_USER_EXTERNAL" + | "ERROR_SERVICE_INVALID_NAME" + | "ERROR_SERVICE_INVALID_MOUNT" + | "ERROR_SERVICE_DOWNLOAD_FAILED" + | "ERROR_SERVICE_UPLOAD_FAILED" + | "ERROR_LDAP_CANNOT_INIT" + | "ERROR_LDAP_CANNOT_SET_OPTION" + | "ERROR_LDAP_CANNOT_BIND" + | "ERROR_LDAP_CANNOT_UNBIND" + | "ERROR_LDAP_CANNOT_SEARCH" + | "ERROR_LDAP_CANNOT_START_TLS" + | "ERROR_LDAP_FOUND_NO_OBJECTS" + | "ERROR_LDAP_NOT_ONE_USER_FOUND" + | "ERROR_LDAP_USER_NOT_IDENTIFIED" + | "ERROR_LDAP_INVALID_MODE" + | "ERROR_TASK_INVALID_ID" + | "ERROR_TASK_DUPLICATE_ID" + | "ERROR_TASK_NOT_FOUND" + | "ERROR_GRAPH_INVALID_GRAPH" + | "ERROR_GRAPH_COULD_NOT_CREATE_GRAPH" + | "ERROR_GRAPH_INVALID_VERTEX" + | "ERROR_GRAPH_COULD_NOT_CREATE_VERTEX" + | "ERROR_GRAPH_COULD_NOT_CHANGE_VERTEX" + | "ERROR_GRAPH_INVALID_EDGE" + | "ERROR_GRAPH_COULD_NOT_CREATE_EDGE" + | "ERROR_GRAPH_COULD_NOT_CHANGE_EDGE" + | "ERROR_GRAPH_TOO_MANY_ITERATIONS" + | "ERROR_GRAPH_INVALID_FILTER_RESULT" + | "ERROR_GRAPH_EMPTY" + | "ERROR_SESSION_UNKNOWN" + | "ERROR_SESSION_EXPIRED" + | "SIMPLE_CLIENT_UNKNOWN_ERROR" + | "SIMPLE_CLIENT_COULD_NOT_CONNECT" + | "SIMPLE_CLIENT_COULD_NOT_WRITE" + | "SIMPLE_CLIENT_COULD_NOT_READ" + | "COMMUNICATOR_REQUEST_ABORTED" + | "COMMUNICATOR_DISABLED" + | "ERROR_MALFORMED_MANIFEST_FILE" + | "ERROR_INVALID_SERVICE_MANIFEST" + | "ERROR_SERVICE_FILES_MISSING" + | "ERROR_SERVICE_FILES_OUTDATED" + | "ERROR_INVALID_FOXX_OPTIONS" + | "ERROR_INVALID_MOUNTPOINT" + | "ERROR_SERVICE_NOT_FOUND" + | "ERROR_SERVICE_NEEDS_CONFIGURATION" + | "ERROR_SERVICE_MOUNTPOINT_CONFLICT" + | "ERROR_SERVICE_MANIFEST_NOT_FOUND" + | "ERROR_SERVICE_OPTIONS_MALFORMED" + | "ERROR_SERVICE_SOURCE_NOT_FOUND" + | "ERROR_SERVICE_SOURCE_ERROR" + | "ERROR_SERVICE_UNKNOWN_SCRIPT" + | "ERROR_MODULE_NOT_FOUND" + | "ERROR_MODULE_SYNTAX_ERROR" + | "ERROR_MODULE_FAILURE" + | "ERROR_NO_SMART_COLLECTION" + | "ERROR_NO_SMART_GRAPH_ATTRIBUTE" + | "ERROR_CANNOT_DROP_SMART_COLLECTION" + | "ERROR_KEY_MUST_BE_PREFIXED_WITH_SMART_GRAPH_ATTRIBUTE" + | "ERROR_ILLEGAL_SMART_GRAPH_ATTRIBUTE" + | "ERROR_AGENCY_INQUIRY_SYNTAX" + | "ERROR_AGENCY_INFORM_MUST_BE_OBJECT" + | "ERROR_AGENCY_INFORM_MUST_CONTAIN_TERM" + | "ERROR_AGENCY_INFORM_MUST_CONTAIN_ID" + | "ERROR_AGENCY_INFORM_MUST_CONTAIN_ACTIVE" + | "ERROR_AGENCY_INFORM_MUST_CONTAIN_POOL" + | "ERROR_AGENCY_INFORM_MUST_CONTAIN_MIN_PING" + | "ERROR_AGENCY_INFORM_MUST_CONTAIN_MAX_PING" + | "ERROR_AGENCY_INFORM_MUST_CONTAIN_TIMEOUT_MULT" + | "ERROR_AGENCY_INQUIRE_CLIENT_ID_MUST_BE_STRING" + | "ERROR_AGENCY_CANNOT_REBUILD_DBS" + | "ERROR_SUPERVISION_GENERAL_FAILURE" + | "ERROR_DISPATCHER_IS_STOPPING" + | "ERROR_QUEUE_UNKNOWN" + | "ERROR_QUEUE_FULL"; + + // Collection + + type DocumentCollectionType = 2; + type EdgeCollectionType = 3; + type CollectionType = DocumentCollectionType | EdgeCollectionType; + + interface CollectionChecksum { + checksum: string; + revision: string; + } + + interface CollectionFigures { + alive: { + count: number; + size: number; + }; + dead: { + count: number; + size: number; + deletion: number; + }; + datafiles: { + count: number; + fileSize: number; + }; + journals: { + count: number; + fileSize: number; + }; + compactors: { + count: number; + fileSize: number; + }; + shapefiles: { + count: number; + fileSize: number; + }; + shapes: { + count: number; + size: number; + }; + attributes: { + count: number; + size: number; + }; + indexes: { + count: number; + size: number; + }; + lastTick: number; + uncollectedLogfileEntries: number; + documentReferences: number; + waitingFor: string; + compactionStatus: { + time: string; + message: string; + count: number; + filesCombined: number; + bytesRead: number; + bytesWritten: number; + }; + } + + interface CollectionPropertiesOptions { + waitForSync?: boolean; + journalSize?: number; + indexBuckets?: number; + replicationFactor?: number; + } + + interface CollectionProperties { + waitForSync: boolean; + journalSize: number; + isVolatile: boolean; + keyOptions?: { + type: string; + allowUserKeys: boolean; + increment?: number; + offset?: number; + }; + indexBuckets: number; + numberOfShards?: number; + shardKeys?: string[]; + replicationFactor?: number; + } + + // Indexes + + interface IndexLike { + [key: string]: any; + id: string; + } + + interface IndexDescription { + type: IndexType; + fields: ReadonlyArray; + sparse?: boolean; + unique?: boolean; + deduplicate?: boolean; + } + + interface Index { + id: string; + type: IndexType; + fields: Array; + sparse: boolean; + unique: boolean; + deduplicate: boolean; + isNewlyCreated: boolean; + selectivityEstimate: number; + code: number; + } + + // Document + + interface ObjectWithId { + [key: string]: any; + _id: string; + } + + interface ObjectWithKey { + [key: string]: any; + _key: string; + } + + type DocumentLike = ObjectWithId | ObjectWithKey; + + interface DocumentMetadata { + _key: string; + _id: string; + _rev: string; + } + + interface UpdateMetadata extends DocumentMetadata { + _oldRev: string; + } + + type Document = { [K in keyof T]: T[K] } & + DocumentMetadata & { _from?: string; _to?: string } & { + [key: string]: any; + }; + type DocumentData = { [K in keyof T]: T[K] } & + Partial; + type Edge = Document & { + _from: string; + _to: string; + }; + + interface InsertResult extends DocumentMetadata { + new?: Document; + } + interface UpdateResult extends UpdateMetadata { + old?: Document; + new?: Document; + } + interface RemoveResult extends DocumentMetadata { + old?: Document; + } + + interface InsertOptions { + waitForSync?: boolean; + silent?: boolean; + returnNew?: boolean; + } + + interface ReplaceOptions extends InsertOptions { + overwrite?: boolean; + returnOld?: boolean; + } + + interface UpdateOptions extends ReplaceOptions { + keepNull?: boolean; + mergeObjects?: boolean; + } + + interface UpdateByExampleOptions { + keepNull?: boolean; + waitForSync?: boolean; + limit?: number; + } + + interface RemoveOptions { + waitForSync?: boolean; + overwrite?: boolean; + returnOld?: boolean; + silent?: boolean; + } + + interface RemoveByExampleOptions { + waitForSync?: boolean; + limit?: number; + } + + interface IterateOptions { + limit?: number; + probability?: number; + } + + type DocumentIterator = ( + document: Document, + number: number + ) => void; + + interface Collection { + // Collection + checksum( + withRevisions?: boolean, + withData?: boolean + ): CollectionChecksum; + count(): number; + drop(options?: { isSystem?: boolean }): void; + figures(): CollectionFigures; + load(): void; + path(): string; + properties( + properties?: CollectionPropertiesOptions + ): CollectionProperties; + revision(): string; + rotate(): void; + toArray(): Array>; + truncate(): void; + type(): CollectionType; + unload(): void; + + // Indexes + dropIndex(index: string | IndexLike): boolean; + ensureIndex(description: IndexDescription): Index; + getIndexes(): Array>; + index(index: string | IndexLike): Index | null; + + // Document + all(): Cursor>; + any(): Document; + byExample(example: Partial>): Cursor>; + document(selector: string | DocumentLike): Document; + document( + selectors: ReadonlyArray + ): Array>; + exists(name: string): boolean; + firstExample(example: Partial>): Document | null; + insert(data: DocumentData, options?: InsertOptions): InsertResult; + insert( + array: ReadonlyArray>, + options?: InsertOptions + ): Array>; + insert( + from: string, + to: string, + data: DocumentData, + options?: InsertOptions + ): InsertResult; + edges( + vertex: string | ObjectWithId | ReadonlyArray + ): Array>; + inEdges( + vertex: string | ObjectWithId | ReadonlyArray + ): Array>; + outEdges( + vertex: string | ObjectWithId | ReadonlyArray + ): Array>; + iterate(iterator: DocumentIterator, options?: IterateOptions): void; + remove( + selector: string | DocumentLike, + options?: RemoveOptions + ): RemoveResult; + remove( + selectors: ReadonlyArray, + options?: RemoveOptions + ): RemoveResult[]; + removeByExample( + example: Partial>, + waitForSync?: boolean, + limit?: number + ): number; + removeByExample( + example: Partial>, + options?: RemoveByExampleOptions + ): number; + rename(newName: string): void; + replace( + selector: string | DocumentLike, + data: DocumentData, + options?: ReplaceOptions + ): UpdateResult; + replace( + selectors: ReadonlyArray, + data: ReadonlyArray>, + options?: ReplaceOptions + ): Array>; + replaceByExample( + example: Partial>, + newValue: DocumentData, + waitForSync?: boolean, + limit?: number + ): number; + replaceByExample( + example: Partial>, + newValue: DocumentData, + options?: { waitForSync?: boolean; limit?: number } + ): number; + save(data: DocumentData, options?: InsertOptions): InsertResult; + save( + array: ReadonlyArray>, + options?: InsertOptions + ): Array>; + save( + from: string, + to: string, + data: DocumentData, + options?: InsertOptions + ): InsertResult; + update( + selector: string | DocumentLike, + data: Partial>, + options?: UpdateOptions + ): UpdateResult; + update( + selectors: ReadonlyArray, + data: ReadonlyArray>>, + options?: UpdateOptions + ): Array>; + updateByExample( + example: Partial>, + newValue: Partial>, + keepNull?: boolean, + waitForSync?: boolean, + limit?: number + ): number; + updateByExample( + example: Partial>, + newValue: Partial>, + options?: UpdateByExampleOptions + ): number; + } + + // Database + + interface DatabaseUser { + username: string; + passwd?: string; + active?: boolean; + extra?: object; + } + + // AQL + + interface Query { + query: string; + bindVars?: object; + options?: QueryOptions; + } + + interface Cursor { + toArray(): T[]; + hasNext(): boolean; + next(): T; + count(count?: boolean): number; + getExtra(): QueryExtra; + setBatchSize(size: number): void; + getBatchSize(): number; + execute(batchSize?: number): void; + dispose(): void; + } + + interface Statement { + bind(name: string, value: any): void; + setBatchSize(size: number): void; + getBatchSize(): number; + execute(): Cursor; + } + + interface QueryOptions { + memoryLimit?: number; + failOnWarning?: boolean; + cache?: boolean; + count?: boolean; + fullCount?: boolean; + profile?: boolean; + maxWarningCount?: number; + maxNumberOfPlans?: number; + stream?: boolean; + // RocksDB + maxTransactionsSize?: number; + intermediateCommitSize?: number; + intermediateCommitCount?: number; + // enterprise + skipInaccessibleCollections?: boolean; + } + + interface QueryExtra { + stats: { + writesExecuted: number; + writesIgnored: number; + scannedFull: number; + scannedIndex: number; + filtered: number; + httpRequests: number; + fullCount: number; + executionTime: number; + }; + warnings: string[]; + } + + interface QueryAstNode { + type: string; + subNodes?: QueryAstNode[]; + [key: string]: any; + } + + interface ParsedQuery { + parsed: boolean; + collections: string[]; + parameters: string[]; + bindVars: string[]; + ast: QueryAstNode[]; + } + + // Views + + interface View { + // TODO + [key: string]: any; + } + type ViewProperties = object; // TODO + + // Global + + interface TransactionCollections { + read?: string | string[]; + write?: string | string[]; + allowImplicit?: boolean; + } + interface Transaction { + collections: TransactionCollections | string[]; + action: (params: object) => void | string; + waitForSync?: boolean; + lockTimeout?: number; + params?: object; + // RocksDB + maxTransactionsSize?: number; + intermediateCommitSize?: number; + intermediateCommitCount?: number; + } + + interface Database { + // Database + _createDatabase( + name: string, + options?: never, + users?: DatabaseUser[] + ): true; + _databases(): string[]; + _dropDatabase(name: string): true; + _useDatabase(name: string): Database; + + // Indexes + _index(index: string | IndexLike): Index | null; + _dropIndex(index: string | IndexLike): boolean; + + // Properties + _id(): string; + _isSystem(): boolean; + _name(): string; + _path(): string; + _version(): string; + + // Collection + _collection(name: string): Collection; + _collections(): Collection[]; + _create(name: string, properties?: CollectionProperties): Collection; + _createDocumentCollection( + name: string, + properties?: CollectionProperties + ): Collection; + _createEdgeCollection( + name: string, + properties?: CollectionProperties + ): Collection; + _drop(name: string): void; + _truncate(name: string): void; + + // AQL + _createStatement(query: Query | string): Statement; + _query( + query: Query | string, + bindVars?: object, + options?: QueryOptions + ): Cursor; + _explain(query: Query | string): void; + _parse(query: string): ParsedQuery; + + // Document + _document(name: string): Document; + _exists(selector: string | ObjectWithId): DocumentMetadata; + _remove(selector: string | ObjectWithId): DocumentMetadata; + _replace( + selector: string | ObjectWithId, + data: object + ): DocumentMetadata; + _update( + selector: string | ObjectWithId, + data: object + ): DocumentMetadata; + + // Views + _view(name: string): View | null; + _views(): View[]; + _createView( + name: string, + type: ViewType, + properties: ViewProperties + ): View; + _dropView(name: string): void; + + // Global + _engine(): EngineType; + _engineStats(): { [key: string]: any }; + _executeTransaction(transaction: Transaction): void; + } +} + +declare namespace Foxx { + interface Session { + uid: string | null; + created: number; + data: any; + } + interface SessionStorage { + new?: () => Session; + fromClient: (sid: string) => Session | null; + forClient: (session: Session) => string | null; + } + interface SessionTransport { + get?: (req: Request) => string | null; + set?: (res: Response, sid: string) => void; + clear?: (res: Response) => void; + } + + type Middleware = (req: Request, res: Response, next: NextFunction) => void; + type Handler = ((req: Request, res: Response) => void); + type NextFunction = () => void; + + interface ValidationResult { + value: T; + error: any; + } + + interface Schema { + isJoi: boolean; + validate(value: T): ValidationResult; + } + + interface Model { + schema: Schema; + fromClient?: (value: any) => any; + forClient?: (value: any) => any; + } + + interface DocumentationRouterOptions { + mount: string; + indexFile: string; + swaggerRoot: string; + before: (req: Request, res: Response) => void | false; + } + + interface MediaType { + type: string; + subtype: string; + suffix?: string; + parameters: { + charset: string; + }; + } + + interface TypeDefinition { + fromClient?: ( + body: string | Buffer, + req: Request, + type: MediaType + ) => any; + forClient?: ( + body: any + ) => { + data: string; + headers: { [key: string]: string | undefined }; + }; + } + + type Ranges = Array<{ + start: number; + end: number; + }> & { type: string }; + + type ConfigurationType = + | "integer" + | "boolean" + | "string" + | "number" + | "json" + | "password" + | "int" + | "bool"; + interface ConfigurationDefinition { + default?: any; + type?: ConfigurationType; + description?: string; + required: boolean; + } + interface DependencyDefinition { + name: string; + version: string; + description?: string; + required: boolean; + multiple: boolean; + } + interface AssetDefinition { + path: string; + gzip?: boolean; + type?: string; + } + + interface Manifest { + name?: string; + version?: string; + keywords?: string; + license?: string; + repository?: { type: string; url: string }; + author: string; + contributors?: any[]; + description: string; + thumbnail?: string; + engines?: { [key: string]: string | undefined }; + defaultDocument?: string; + lib: string; + main?: string; + configuration?: { [key: string]: ConfigurationDefinition }; + dependencies?: { [key: string]: DependencyDefinition }; + provides?: { [key: string]: string | undefined }; + files?: { [key: string]: AssetDefinition }; + scripts?: { [key: string]: string | undefined }; + tests?: string[]; + } + + interface Context { + argv: any[]; + basePath: string; + baseUrl: string; + collectionPrefix: string; + configuration: { [key: string]: any }; + dependencies: { [key: string]: any }; + isDevelopment: boolean; + isProduction: boolean; + manifest: Manifest; + mount: string; + collection(name: string): ArangoDB.Collection | null; + collectionName(name: string): string; + createDocumentationRouter( + opts?: + | Partial + | DocumentationRouterOptions["before"] + | DocumentationRouterOptions["swaggerRoot"] + ): Router; + file(name: string): Buffer; + file(name: string, encoding: string): string; + fileName(name: string): string; + registerType(type: string, def: TypeDefinition): void; + use( + path: string, + routerOrMiddleware: Router | Middleware, + name?: string + ): Endpoint; + use(routerOrMiddleware: Router | Middleware, name?: string): Endpoint; + } + + interface Request { + arangoUser: string | null; + arangoVersion: number; + baseUrl: string; + body: any; + context: Context; + database: string; + headers: { [key: string]: string | undefined }; + hostname: string; + method: ArangoDB.HttpMethod; + originalUrl: string; + path: string; + pathParams: { [key: string]: any }; + port: number; + protocol: string; + queryParams: { [key: string]: any }; + rawBody: Buffer; + remoteAddress: string; + remoteAddresses: string[]; + remotePort: number; + secure: boolean; + session?: Session; + sessionStorage?: SessionStorage; + suffix: string; + trustProxy: boolean; + url: string; + xhr: boolean; + accepts(types: string[]): string | false; + accepts(...types: string[]): string | false; + acceptsCharsets(charsets: string[]): string | false; + acceptsCharsets(...charsets: string[]): string | false; + acceptsEncodings(encodings: string[]): string | false; + acceptsEncodings(...encodings: string[]): string | false; + acceptsLanguages(languages: string[]): string | false; + acceptsLanguages(...languages: string[]): string | false; + cookie( + name: string, + options?: { secret?: string; algorithm?: ArangoDB.HashAlgorithm } + ): string | null; + get(name: string): string | undefined; + header(name: string): string | undefined; + is(types: string[]): string; + is(...types: string[]): string; + json(): any; + makeAbsolute( + path: string, + query?: string | { [key: string]: string | undefined } + ): string; + param(name: string): any; + range(size?: number): Ranges | number; + reverse(name: string, params?: object): string; + } + + interface Response { + body: Buffer | string; + context: Context; + headers: { [key: string]: any }; + statusCode: number; + attachment(filename?: string): this; + cookie( + name: string, + value: string, + options?: { + ttl?: number; + algorithm?: ArangoDB.HashAlgorithm; + secret?: string; + path?: string; + domain?: string; + secure?: boolean; + httpOnly?: boolean; + } + ): this; + download(path: string, filename?: string): this; + getHeader(name: string): string | undefined; + json(data: any): this; + redirect(status: number | ArangoDB.HttpStatus, path: string): this; + redirect(path: string): this; + removeHeader(name: string): this; + send(data: any, type?: string): this; + sendFile(path: string, options?: { lastModified: boolean }): this; + sendStatus(status: number | ArangoDB.HttpStatus): this; + setHeader(name: string, value: string): this; + set(name: string, value: string): this; + set(headers: { [name: string]: string }): this; + status(status: number | ArangoDB.HttpStatus): this; + throw( + status: number | ArangoDB.HttpStatus, + reason: string, + error: Error + ): never; + throw( + status: number | ArangoDB.HttpStatus, + reason: string, + options?: { cause?: Error; extra?: any } + ): never; + throw(status: number | ArangoDB.HttpStatus, error: Error): never; + throw( + status: number | ArangoDB.HttpStatus, + options?: { cause?: Error; extra?: any } + ): never; + type(type?: string): string; + vary(names: string[]): this; + vary(...names: string[]): this; + write(data: string | Buffer): this; + } + + interface Endpoint { + header(name: string, schema: Schema, description?: string): this; + header(name: string, description: string): this; + pathParam(name: string, schema: Schema, description?: string): this; + pathParam(name: string, description: string): this; + queryParam(name: string, schema: Schema, description?: string): this; + queryParam(name: string, description: string): this; + body( + schema: Schema | Model | [Model], + mimes?: string[], + description?: string + ): this; + body( + schemaOrMimes: Schema | Model | [Model] | string[], + description?: string + ): this; + body(description: string): this; + response( + status: number | ArangoDB.HttpStatus, + schema: Schema | Model | [Model], + mimes?: string[], + description?: string + ): this; + response( + status: number | ArangoDB.HttpStatus, + mimes: string[], + description?: string + ): this; + response( + status: number | ArangoDB.HttpStatus, + description: string + ): this; + summary(summary: string): this; + description(description: string): this; + deprecated(deprecated: boolean): this; + error(status: number | ArangoDB.HttpStatus, description: string): this; + tag(...tags: string[]): this; + } + + function route(handler: Handler, name?: string): Endpoint; + function route( + pathOrMiddleware: string | Middleware, + handler: Handler, + name?: string + ): Endpoint; + function route( + pathOrMiddleware: string | Middleware, + middleware: Middleware, + handler: Handler, + name?: string + ): Endpoint; + function route( + pathOrMiddleware: string | Middleware, + middleware1: Middleware, + middleware2: Middleware, + handler: Handler, + name?: string + ): Endpoint; + function route( + pathOrMiddleware: string | Middleware, + middleware1: Middleware, + middleware2: Middleware, + middleware3: Middleware, + handler: Handler, + name?: string + ): Endpoint; + function route( + pathOrMiddleware: string | Middleware, + middleware1: Middleware, + middleware2: Middleware, + middleware3: Middleware, + middleware4: Middleware, + handler: Handler, + name?: string + ): Endpoint; + function route( + pathOrMiddleware: string | Middleware, + middleware1: Middleware, + middleware2: Middleware, + middleware3: Middleware, + middleware4: Middleware, + middleware5: Middleware, + handler: Handler, + name?: string + ): Endpoint; + function route( + pathOrMiddleware: string | Middleware, + middleware1: Middleware, + middleware2: Middleware, + middleware3: Middleware, + middleware4: Middleware, + middleware5: Middleware, + middleware6: Middleware, + handler: Handler, + name?: string + ): Endpoint; + function route( + pathOrMiddleware: string | Middleware, + middleware1: Middleware, + middleware2: Middleware, + middleware3: Middleware, + middleware4: Middleware, + middleware5: Middleware, + middleware6: Middleware, + middleware7: Middleware, + handler: Handler, + name?: string + ): Endpoint; + function route( + pathOrMiddleware: string | Middleware, + middleware1: Middleware, + middleware2: Middleware, + middleware3: Middleware, + middleware4: Middleware, + middleware5: Middleware, + middleware6: Middleware, + middleware7: Middleware, + middleware8: Middleware, + handler: Handler, + name?: string + ): Endpoint; + function route( + pathOrMiddleware: string | Middleware, + middleware1: Middleware, + middleware2: Middleware, + middleware3: Middleware, + middleware4: Middleware, + middleware5: Middleware, + middleware6: Middleware, + middleware7: Middleware, + middleware8: Middleware, + middleware9: Middleware, + handler: Handler, + name?: string + ): Endpoint; + + interface Router { + get: typeof route; + post: typeof route; + put: typeof route; + patch: typeof route; + delete: typeof route; + all: typeof route; + use( + path: string, + routerOrMiddleware: Router | Middleware, + name?: string + ): Endpoint; + use(routerOrMiddleware: Router | Middleware, name?: string): Endpoint; + } +} + +declare module "@arangodb" { + function aql(strings: TemplateStringsArray, ...args: any[]): ArangoDB.Query; + function time(): number; + const db: ArangoDB.Database & { + [key: string]: ArangoDB.Collection | undefined; + }; + const errors: { + [Name in ArangoDB.ErrorName]: { code: number; message: string } + }; +} + +declare module "@arangodb/foxx/router" { + function createRouter(): Foxx.Router; + export = createRouter; +} + +declare module "@arangodb/foxx/graphql" { + import { GraphQLSchema, formatError } from "graphql"; + type GraphQLModule = object; + type GraphQLFormatErrorFunction = typeof formatError; + interface GraphQLOptions { + schema: GraphQLSchema; + context?: any; + rootValue?: object; + pretty?: boolean; + formatError?: GraphQLFormatErrorFunction; + validationRules?: any[]; + graphiql?: boolean; + graphql?: GraphQLModule; + } + function createGraphQLRouter( + options: GraphQLOptions | GraphQLSchema + ): Foxx.Router; + export = createGraphQLRouter; +} + +declare module "@arangodb/foxx/sessions" { + interface SessionsMiddleware extends Foxx.Middleware { + storage: Foxx.SessionStorage; + transport: Foxx.SessionTransport[]; + } + interface SessionsOptions { + storage: Foxx.SessionStorage | string | ArangoDB.Collection; + transport: + | Foxx.SessionTransport + | Foxx.SessionTransport[] + | "cookie" + | "header"; + autoCreate?: boolean; + } + function sessionsMiddleware(options: SessionsOptions): Foxx.Middleware; + export = sessionsMiddleware; +} + +declare module "@arangodb/foxx/sessions/storages/collection" { + interface CollectionStorageOptions { + collection: string | ArangoDB.Collection; + ttl?: number; + pruneExpired?: boolean; + autoUpdate?: boolean; + } + interface CollectionStorage extends Foxx.SessionStorage { + prune: () => string[]; + } + function collectionStorage( + options: + | CollectionStorageOptions + | CollectionStorageOptions["collection"] + ): CollectionStorage; + export = collectionStorage; +} + +declare module "@arangodb/foxx/sessions/storages/jwt" { + interface SafeJwtStorageOptions { + algorithm?: ArangoDB.JwtAlgorithm; + secret: string; + ttl?: number; + verify?: boolean; + maxExp?: number; + } + interface UnsafeJwtStorageOptions { + algorithm: "none"; + ttl?: number; + verify?: boolean; + maxExp?: number; + } + function jwtStorage( + options: + | SafeJwtStorageOptions + | UnsafeJwtStorageOptions + | SafeJwtStorageOptions["secret"] + ): Foxx.SessionStorage; + export = jwtStorage; +} + +declare module "@arangodb/foxx/sessions/transports/cookie" { + interface CookieTransportOptions { + name?: string; + ttl?: number; + algorithm?: ArangoDB.HashAlgorithm; + secret?: string; + path?: string; + domain?: string; + secure?: string; + httpOnly?: string; + } + function cookieTransport( + options?: CookieTransportOptions + ): Foxx.SessionTransport; + function cookieTransport(name: string): Foxx.SessionTransport; + export = cookieTransport; +} + +declare module "@arangodb/foxx/sessions/transports/header" { + interface HeaderTransportOptions { + name?: string; + } + function headerTransport( + options?: HeaderTransportOptions + ): Foxx.SessionTransport; + function headerTransport(name: string): Foxx.SessionTransport; + export = headerTransport; +} + +declare module "@arangodb/foxx/auth" { + interface AuthData { + method: string; + salt: string; + hash: string; + } + interface Authenticator { + create(password: string): AuthData; + verify(hash?: AuthData, password?: string): boolean; + } + interface AuthOptions { + method?: ArangoDB.HashAlgorithm; + saltLength?: number; + } + function createAuth(options?: AuthOptions): Authenticator; + export = createAuth; +} + +declare module "@arangodb/foxx/oauth1" { + interface OAuth1Options { + requestTokenEndpoint: string; + authEndpoint: string; + accessTokenEndpoint: string; + activeUserEndpoint?: string; + clientId: string; + clientSecret: string; + signatureMethod?: "HMAC-SHA1" | "PLAINTEXT"; + } + interface OAuth1Client { + fetchRequestToken( + oauth_callback: string, + qs?: { [key: string]: string | undefined } + ): any; + getAuthUrl( + oauth_token: string, + qs?: { [key: string]: string | undefined } + ): string; + exchangeRequestToken( + oauth_token: string, + oauth_verifier: string, + qs?: { [key: string]: string | undefined } + ): any; + fetchActiveUser( + oauth_token: string, + oauth_token_secret: string, + qs?: { [key: string]: string | undefined } + ): any; + createSignedRequest( + method: ArangoDB.HttpMethod, + url: string, + parameters: string | { [key: string]: string | undefined } | null, + oauth_token: string, + oauth_token_secret: string + ): { + url: string; + qs: string; + headers: { accept: "application/json"; authorization: string }; + }; + } + function createOAuth1Client(options: OAuth1Options): OAuth1Client; + export = createOAuth1Client; +} + +declare module "@arangodb/foxx/oauth2" { + interface OAuth2Options { + authEndpoint: string; + tokenEndpoint: string; + refreshEndpoint?: string; + activeUserEndpoint?: string; + clientId: string; + clientSecret: string; + } + interface OAuth2Client { + getAuthUrl( + redirect_uri: string, + options?: { response_type?: string } + ): string; + exchangeGrantToken( + code: string, + redirect_uri: string, + options?: { grant_type?: string } + ): any; + fetchActiveUser(access_token: string): any; + } + function createOAuth2Client(options: OAuth2Options): OAuth2Client; + export = createOAuth2Client; +} + +declare module "@arangodb/foxx" { + function createRouter(): Foxx.Router; +} + +declare module "@arangodb/request" { + interface Response { + rawBody: Buffer; + body: string | Buffer; + json?: any; + headers: { [key: string]: string | undefined }; + status: number; + statusCode: number; + message: string; + throw(message?: string): void | never; + } + interface RequestOptions { + qs?: object; + useQuerystring?: boolean; + headers?: { [key: string]: string | undefined }; + body?: any; + json?: boolean; + form?: any; + auth?: { username: string; password?: string } | { bearer: string }; + sslProtocol?: number; + followRedirect?: boolean; + maxRedirects?: number; + encoding?: string | null; + timeout?: number; + returnBodyOnError?: boolean; + } + function method(options: { url: string } & RequestOptions): Response; + function method(url: string, options?: RequestOptions): Response; + interface Request { + ( + options: { + url: string; + method?: ArangoDB.HttpMethod; + } & RequestOptions + ): Response; + head: typeof method; + get: typeof method; + post: typeof method; + put: typeof method; + patch: typeof method; + delete: typeof method; + } + const request: Request; + export = request; +} + +declare module "@arangodb/crypto" { + function createNonce(): string; + function checkAndMarkNonce(nonce: string): void; + function rand(): number; + function genRandomAlphaNumbers(length: number): string; + function genRandomNumbers(length: number): string; + function genRandomSalt(length: number): string; + function jwtEncode( + key: string, + message: string, + algorithm: ArangoDB.JwtAlgorithm + ): string; + function jwtEncode(key: null, message: string, algorithm: "none"): string; + function jwtDecode( + key: string | null, + token: string, + noVerify?: boolean + ): string | null; + function md5(message: string): string; + function sha1(message: string): string; + function sha224(message: string): string; + function sha256(message: string): string; + function sha384(message: string): string; + function sha512(message: string): string; + function constantEquals(a: string, b: string): boolean; + function pbkdf2( + salt: string, + password: string, + iterations: number, + keyLength: number + ): string; + function hmac( + key: string, + message: string, + algorithm: ArangoDB.HashAlgorithm + ): string; +} + +declare module "@arangodb/general-graph" { + interface EdgeDefinition { + collection: string; + from: string[]; + to: string[]; + } + interface CommonNeighbors { + left: string; + right: string; + neighbors: string[]; + } + interface CountCommonNeighbors { + [key: string]: Array<{ [key: string]: number | undefined }> | undefined; + } + interface CommonProperties { + [key: string]: + | Array<{ _id: string } & { [key: string]: any }> + | undefined; + } + interface CountCommonProperties { + [key: string]: number | undefined; + } + interface Path< + A extends object = any, + B extends object = any, + E extends object = any, + V extends object = never + > { + source: ArangoDB.Document; + destination: ArangoDB.Document; + edges: Array>; + vertice: Array>; + } + interface ShortestPath { + vertices: string[]; + edges: Array>; + distance: number; + } + interface Distance { + startVertex: string; + vertex: string; + distance: number; + } + interface Eccentricity { + [key: string]: number | undefined; + } + type Closeness = Eccentricity; + type Betweenness = Eccentricity; + type Example = Array | object | string | null; + interface ConnectingEdgesOptions { + edgeExamples?: Example; + edgeCollectionRestriction?: string[] | string; + vertex1CollectionRestriction?: string[] | string; + vertex2CollectionRestriction?: string[] | string; + } + interface NeighborsOptions { + direction?: ArangoDB.EdgeDirection; + edgeExamples?: Example; + neighborExamples?: Example; + edgeCollectionRestriction?: string[] | string; + vertexCollectionRestriction?: string[] | string; + minDepth?: number; + maxDepth?: number; + } + interface CommonPropertiesOptions { + vertex1CollectionRestriction?: string[] | string; + vertex2CollectionRestriction?: string[] | string; + ignoredProperties?: string[] | string; + } + interface PathsOptions { + direction?: ArangoDB.EdgeDirection; + followCycles?: boolean; + minLength?: number; + maxLength?: number; + } + interface ShortestPathOptions { + direction?: ArangoDB.EdgeDirection; + edgeCollectionRestriction?: string[] | string; + startVertexCollectionRestriction?: string[] | string; + endVertexCollectionRestriction?: string[] | string; + weight?: string; + defaultWeight?: number; + } + type EccentricityOptions = ShortestPathOptions; + type ClosenessOptions = ShortestPathOptions; + interface BetweennessOptions { + direction?: ArangoDB.EdgeDirection; + weight?: string; + defaultWeight?: number; + } + type RadiusOptions = BetweennessOptions; + type DiameterOptions = BetweennessOptions; + interface Graph { + _extendEdgeDefinitions(edgeDefinition: EdgeDefinition): void; + _editEdgeDefinitions(edgeDefinition: EdgeDefinition): void; + _deleteEdgeDefinition( + edgeCollectionName: string, + dropCollection?: boolean + ): void; + _addVertexCollection( + orphanCollectionName: string, + createCollection?: boolean + ): void; + _orphanCollections(): string[]; + _removeVertexCollection( + orphanCollectionName: string, + dropCollection?: boolean + ): void; + _getConnectingEdges( + vertexExample1: Example, + vertexExample2: Example, + options: ConnectingEdgesOptions + ): ArangoDB.Edge; + _fromVertex(edgeId: string): ArangoDB.Document; + _toVertex(edgeId: string): ArangoDB.Document; + _neighbors( + vertexExample: Example, + options?: NeighborsOptions + ): string[]; + _commonNeighbors( + vertex1Example: Example, + vertex2Example: Example, + vertex1Options?: NeighborsOptions, + vertex2Options?: NeighborsOptions + ): CommonNeighbors[]; + _countCommonNeighbors( + vertex1Example: Example, + vertex2Example: Example, + vertex1Options?: NeighborsOptions, + vertex2Options?: NeighborsOptions + ): CountCommonNeighbors[]; + _commonProperties( + vertexExample1: Example, + vertex2Example: Example, + options?: CommonPropertiesOptions + ): CommonProperties[]; + _countCommonProperties( + vertex1Example: Example, + vertex2Example: Example, + options?: CommonPropertiesOptions + ): CountCommonProperties[]; + _paths(options?: PathsOptions): Path[]; + _shortestPath( + startVertexExample: Example, + endVertexExample: Example, + options?: ShortestPathOptions + ): ShortestPath[]; + _distanceTo( + startVertexExample: Example, + endVertexExample: Example, + options?: ShortestPathOptions + ): Distance[]; + _absoluteEccentricity( + vertexExample: Example, + options?: EccentricityOptions + ): Eccentricity; + _eccentricity( + vertexExample: Example, + options?: EccentricityOptions + ): Eccentricity; + _absoluteCloseness( + vertexExample: Example, + options?: ClosenessOptions + ): Closeness; + _closeness( + vertexExample: Example, + options?: ClosenessOptions + ): Closeness; + _absoluteBetweenness( + vertexExample: Example, + options?: BetweennessOptions + ): Betweenness; + _betweenness( + vertexExample: Example, + options?: BetweennessOptions + ): Betweenness; + _radius(vertexExample: Example, options?: RadiusOptions): number; + _diameter(vertexExample: Example, options?: DiameterOptions): number; + } + function _create( + name: string, + edgeDefinitions?: EdgeDefinition[], + orphanCollections?: string[] + ): Graph & { + [key: string]: ArangoDB.Collection | undefined; + }; + function _list(): string[]; + function _graph( + name: string + ): Graph & { + [key: string]: ArangoDB.Collection | undefined; + }; + function _drop(name: string, dropCollections?: boolean): boolean; + function _relation( + name: string, + fromVertexCollections: string[] | string, + toVertexCollections: string[] | string + ): EdgeDefinition; + function _edgeDefinitions(...relations: EdgeDefinition[]): EdgeDefinition[]; + function _extendEdgeDefinitions( + edgeDefinitions: EdgeDefinition[], + ...relations: EdgeDefinition[] + ): EdgeDefinition[]; +} + +declare module "@arangodb/locals" { + const context: Foxx.Context; +} + +interface NodeModule { + context: Foxx.Context; +} + +interface Console { + logLines(...args: any[]): void; + errorLines(...args: any[]): void; + warnLines(...args: any[]): void; + infoLines(...args: any[]): void; + debugLines(...args: any[]): void; + errorStack(err: Error, msg?: string): void; + warnStack(err: Error, msg?: string): void; + infoStack(err: Error, msg?: string): void; + debugStack(err: Error, msg?: string): void; +} diff --git a/types/arangodb/tsconfig.json b/types/arangodb/tsconfig.json new file mode 100644 index 0000000000..f778fd7c47 --- /dev/null +++ b/types/arangodb/tsconfig.json @@ -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", "arangodb-tests.ts"] +} diff --git a/types/arangodb/tslint.json b/types/arangodb/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/arangodb/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From ebad624215ea63fb6b2c0c7bbe48be205061d105 Mon Sep 17 00:00:00 2001 From: Periklis Tsirakidis Date: Wed, 25 Apr 2018 01:29:04 +0200 Subject: [PATCH 073/564] react-lazyload: Update to 2.3.0 (#25030) --- types/react-lazyload/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/react-lazyload/index.d.ts b/types/react-lazyload/index.d.ts index b739b7d8cc..bc66a10b0f 100644 --- a/types/react-lazyload/index.d.ts +++ b/types/react-lazyload/index.d.ts @@ -1,15 +1,15 @@ -// Type definitions for react-lazyload ver 2.2 +// Type definitions for react-lazyload ver 2.3 // Project: https://github.com/jasonslyvia/react-lazyload // Definitions by: m0a // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 -import { Component } from 'react'; +import { Component } from "react"; export interface LazyLoadProps { once?: boolean; height?: number | string; - offset?: number | string; + offset?: number | number[]; overflow?: boolean; scroll?: boolean; children?: JSX.Element; @@ -23,6 +23,6 @@ export default class LazyLoad extends Component { constructor(props: LazyLoad); } -export function lazyload(option: {}): LazyLoad; +export function lazyload(option: {}): LazyLoad; export function forceCheck(): void; From 93bef664052bdd80bd86a4680b8968986093ecff Mon Sep 17 00:00:00 2001 From: Daphne Date: Wed, 25 Apr 2018 01:29:34 +0200 Subject: [PATCH 074/564] Added missing prop 'resize' (#25029) --- types/react-lazyload/index.d.ts | 1 + types/react-lazyload/react-lazyload-tests.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/types/react-lazyload/index.d.ts b/types/react-lazyload/index.d.ts index bc66a10b0f..a72fdd3581 100644 --- a/types/react-lazyload/index.d.ts +++ b/types/react-lazyload/index.d.ts @@ -11,6 +11,7 @@ export interface LazyLoadProps { height?: number | string; offset?: number | number[]; overflow?: boolean; + resize?: boolean; scroll?: boolean; children?: JSX.Element; throttle?: number | boolean; diff --git a/types/react-lazyload/react-lazyload-tests.tsx b/types/react-lazyload/react-lazyload-tests.tsx index f673652ef5..3e562300b5 100644 --- a/types/react-lazyload/react-lazyload-tests.tsx +++ b/types/react-lazyload/react-lazyload-tests.tsx @@ -24,7 +24,7 @@ class Normal extends React.Component<{}, State> {
{this.state.arr.map((el, index) => { return ( - +

count={index + 1}

From cd39e74f6b91831c9827566a180fc8ec55435ef8 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 24 Apr 2018 16:30:51 -0700 Subject: [PATCH 075/564] protractor-helpers: Move 'jasmine' dependency to tests (#25034) --- types/protractor-helpers/index.d.ts | 4 +++- types/protractor-helpers/protractor-helpers-tests.ts | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/types/protractor-helpers/index.d.ts b/types/protractor-helpers/index.d.ts index 57b94dd6b9..bc52455d6e 100644 --- a/types/protractor-helpers/index.d.ts +++ b/types/protractor-helpers/index.d.ts @@ -4,7 +4,6 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -/// import * as webdriver from "selenium-webdriver"; declare global { @@ -41,6 +40,9 @@ declare global { // Matchers // TODO - Use `T` to improve types + // Note: This augments a namespace from '@types/jasmine'. + // Intentionally not referencing those types from this file as they introduce many globals, + // and users may use protractor-helpers but not jasmine, and have different definitions of those globals (e.g. through `jest`) namespace jasmine { interface Matchers { toBePresent() : boolean; diff --git a/types/protractor-helpers/protractor-helpers-tests.ts b/types/protractor-helpers/protractor-helpers-tests.ts index 39ac5f079e..36dd9eb583 100644 --- a/types/protractor-helpers/protractor-helpers-tests.ts +++ b/types/protractor-helpers/protractor-helpers-tests.ts @@ -1,3 +1,5 @@ +/// + import helpers = require('protractor-helpers'); import * as webdriver from "selenium-webdriver"; From 593a956550ba6aefbe65077d4cbba98b066c825b Mon Sep 17 00:00:00 2001 From: Mathew Rumsey Date: Tue, 24 Apr 2018 19:42:48 -0400 Subject: [PATCH 076/564] command-line-usage added (#24787) * command-line-usage types good default bad * Type adjustments export Section, raw optional * No errors - try remove tslint rule override * Linting .d.ts works great! * typings pass all given examples * Removed type-annotation causing Travis to fail * Re-added Dvorsky as contributor Even though the new definitions completely overwrite the old, it was requested that the original author be re-added. * Fixed a silly, silly mistake - missing comment slashes --- .../command-line-usage-tests.ts | 409 +++++++++++++++++- types/command-line-usage/index.d.ts | 106 +++-- 2 files changed, 461 insertions(+), 54 deletions(-) diff --git a/types/command-line-usage/command-line-usage-tests.ts b/types/command-line-usage/command-line-usage-tests.ts index 05dfadc7f3..23e2284d83 100644 --- a/types/command-line-usage/command-line-usage-tests.ts +++ b/types/command-line-usage/command-line-usage-tests.ts @@ -1,24 +1,397 @@ -import commandLineUsage = require("command-line-usage"); +import getUsage = require('command-line-usage'); -const sections = [ +let usage: string; +let sections: getUsage.Section[]; +let optionDefinitions: getUsage.OptionDefinition[] = []; + +// chalk-escaping.js +usage = getUsage([ { - header: 'A typical app', - content: 'Generates something {italic very} important.' + header: 'A typical app', + content: 'Generates something \\{very important\\}, also retaining `backticks`.' }, { - header: 'Options', - optionList: [ - { - name: 'input', - typeLabel: '{underline file}', - description: 'The input to process.' - }, - { - name: 'help', - description: 'Print this usage guide.' - } - ] + header: 'Options', + optionList: [ + { name: 'files', typeLabel: '\\{something\\}', description: 'This is not \\{red red\\}.'} + ] } -]; + ]); -const usage = commandLineUsage(sections); +// chalk-formatting.js +usage = getUsage([ + { + header: 'A typical app', + content: 'Generates something {italic.keyword("orange") very {rgb(255,231,0).bold important}}. This is a rather long, but {hex("#1ef").underline ultimately} inconsequential ' + + 'description intended {yellow.bgRed.bold solely {bgBlue to}} demonstrate description appearance. ' + }, + { + header: 'Options', + optionList: [ + { name: 'files', typeLabel: '{magenta {underline files}}', description: 'This is {red red}.'} + ] + }, + { + content: 'Project home: {underline https://github.com/me/example}' + } + ]); + +// command-list.js +sections = [ + { + header: 'Example App', + content: 'Generates something {italic very} important. This is a rather long, but ultimately inconsequential description intended solely to demonstrate description appearance. ' + }, + { + header: 'Synopsis', + content: '$ app ' + }, + { + header: 'Command List', + content: [ + { name: 'help', summary: 'Display help information about Git.' }, + { name: 'commit', summary: 'Record changes to the repository.' }, + { name: 'Version', summary: 'Print the version.' }, + { name: 'etc', summary: 'Etc.' } + ] + } + ]; +usage = getUsage(sections); + +// description-columns.js +sections = [ + { + header: 'Soviet Union', + content: { + options: { + columns: [ + { name: 'one', maxWidth: 40 }, + { name: 'two', width: 40, noWrap: true } + ] + }, + data: [ + { + one: "this was waaaay too long", + two: null + } + ] + } + }, + { + header: 'Synopsis', + content: [ + '$ example [{bold --timeout} {underline ms}] {bold --src} {underline file} ...', + '$ example {bold --help}' + ] + }, + { + header: 'Options', + optionList: optionDefinitions + } + ]; +getUsage(sections); + +// examples.js +sections = [ + { + header: 'A typical app', + content: 'Generates something {italic very} important.' + }, + { + header: 'Synopsis', + content: [ + '$ example [{bold --timeout} {underline ms}] {bold --src} {underline file} ...', + '$ example {bold --help}' + ] + }, + { + header: 'Options', + optionList: optionDefinitions + }, + { + header: 'Examples', + content: [ + { + desc: '1. A concise example. ', + example: '$ example -t 100 lib/*.js' + }, + { + desc: '2. A long example. ', + example: '$ example --timeout 100 --src lib/*.js' + }, + { + desc: '3. This example will scan space for unknown things. Take cure when scanning space, it could take some time. ', + example: '$ example --src galaxy1.facts galaxy1.facts galaxy2.facts galaxy3.facts galaxy4.facts galaxy5.facts' + } + ] + }, + { + content: 'Project home: {underline https://github.com/me/example}' + } + ]; +getUsage(sections); + +// footer.js +sections = [ + { + header: 'A typical app', + content: 'Generates something {italic very} important.' + }, + { + header: 'Synopsis', + content: [ + '$ example [{bold --timeout} {underline ms}] {bold --src} {underline file} ...', + '$ example {bold --help}' + ] + }, + { + header: 'Options', + optionList: optionDefinitions + }, + { + content: [ + '{italic This app was tested by dragons in Wales.}', + '', + null + ], + raw: true + } +]; +getUsage(sections); + +// groups.js +optionDefinitions = [ + { + name: 'help', + description: 'Display this usage guide.', + alias: 'h', + type: Boolean, + group: 'main' + }, + { + name: 'src', + description: 'The input files to process', + multiple: true, + defaultOption: true, + typeLabel: '{underline file} ...', + group: 'input' + }, + { + name: 'timeout', + description: 'Timeout value in ms', + alias: 't', + typeLabel: '{underline ms}', + group: 'main' + }, + { + name: 'plugin', + description: 'A plugin path', + type: String + } + ]; + +sections = [ + { + header: 'A typical app', + content: 'Generates something {italic very} important.' + }, + { + header: 'Main options', + optionList: optionDefinitions, + group: [ 'main', 'input' ] + }, + { + header: 'Misc', + optionList: optionDefinitions, + group: '_none' + } + ]; + +getUsage(sections); + +// header-only.js +sections = [ + { + header: 'a header only' + }, + { + content: 'content only' + } + ]; +getUsage(sections); + +// header.js +sections = [ + { + content: "", + raw: true + }, + { + header: 'Synopsis', + content: [ + '$ example [{bold --timeout} {underline ms}] {bold --src} {underline file} ...', + '$ example {bold --help}' + ] + } +]; +getUsage(sections); + +// hide.js +usage = getUsage([ + { + header: 'A typical app', + content: 'Generates something {italic very} important. This is a rather long, but ultimately inconsequential description intended solely to demonstrate description appearance. ' + }, + { + header: 'Options', + optionList: optionDefinitions, + hide: 'src' + }, + { + content: 'Project home: {underline https://github.com/me/example}' + } +]); + +// option-list-options.js +sections = [ + { + header: 'A typical app', + content: 'Generates something {italic very} important.' + }, + { + header: 'Options', + optionList: optionDefinitions, + tableOptions: { + columns: [ + { + name: 'option', + noWrap: true, + padding: { left: '🔥 ', right: '' }, + width: 30 + }, + { + name: 'description', + width: 50, + padding: { left: '', right: ' 🔥' } + } + ] + } + } +]; +getUsage(sections); + +// simple-reverse-name-order.js +usage = getUsage([ + { + header: 'A typical app', + content: 'Generates something {italic very} important. This is a rather long, but ultimately inconsequential description intended solely to demonstrate description appearance. ' + }, + { + header: 'Options', + optionList: optionDefinitions, + reverseNameOrder: true + }, + { + content: 'Project home: {underline https://github.com/me/example}' + } + ]); + +// simple-width.js +usage = getUsage([ + { + header: 'A typical app', + content: { + options: { maxWidth: 40 }, + data: [ + { col: 'Generates something {italic very} important. This is a rather long, but ultimately inconsequential description intended solely to demonstrate description appearance. ' } + ] + } + } + ]); + +// synopsis.js +sections = [ + { + header: 'A typical app', + content: 'Generates something {italic very} important.' + }, + { + header: 'Options', + optionList: [ + { + name: 'input', + typeLabel: '{underline file}', + description: 'The input to process.' + }, + { + name: 'help', + description: 'Print this usage guide.' + } + ] + } + ]; +usage = getUsage(sections); + +// whitespace.js +/* When using default options, the whitespace before the bullets is trimmed */ +sections = [ + { + header: 'Example app', + content: [ + 'Generates something {italic very} important. This description is:', + '', + ' • rather long', + ' • inconsequential', + ' • demonstrative', + '', + 'And the text continues underneath as this {cyan might} be required in cases where text is required underneath.' + ] + } + ]; +usage = getUsage(sections); +/* Solution 1: Use `raw` option and supply your own whitespace */ +sections = [ + { + header: 'Example app', + content: [ + ' Generates something {italic very} important. This description is:', + ' ', + ' • rather long', + ' • inconsequential', + ' • demonstrative', + ' ', + ' And the text continues underneath as this {cyan might} be required in cases where', + ' text is required underneath.' + ], + raw: true + } +]; +usage = getUsage(sections); + +/* Section 2: use separate sections with the `noTrim` option on the bullets */ +sections = [ + { + header: 'Example app', + content: [ + 'Generates something {italic very} important. This description is:' + ] + }, + { + content: { + options: { + noTrim: true + }, + data: [ + { col: ' • rather long' }, + { col: ' • inconsequential' }, + { col: ' • demonstrative' } + ] + } + }, + { + content: [ + 'And the text continues underneath as this {cyan might} be required in cases where text is required underneath.' + ] + } +]; +usage = getUsage(sections); diff --git a/types/command-line-usage/index.d.ts b/types/command-line-usage/index.d.ts index ac4f1d7606..0beb4ef2d8 100644 --- a/types/command-line-usage/index.d.ts +++ b/types/command-line-usage/index.d.ts @@ -1,48 +1,82 @@ // Type definitions for command-line-usage 5.0 // Project: https://github.com/75lb/command-line-usage#readme -// Definitions by: Andrija Dvorski +// Definitions by: matrumz +// Andrija Dvorski // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 +/** + * Generates a usage guide suitable for a command-line app. + * @param sections One or more Section objects + * @alias module:command-line-usage + */ +declare function commandLineUsage(sections: commandLineUsage.Section | commandLineUsage.Section[]): string; +export = commandLineUsage; + declare namespace commandLineUsage { - interface Section { - list: string[]; + /** Section object. */ + type Section = Content | OptionList; - add(content: object): void; - emptyLine(): void; - header(text: string): void; - toString(): string; - } - - interface SectionData { - optionList?: OptionListData[]; - hide?: string[]; - group?: string[]; + /** A Content section comprises a header and one or more lines of content. */ + interface Content { + /** The section header, always bold and underlined. */ header?: string; - reverseNameOrder?: boolean; - tableOptions?: any; - } - - interface OptionListData extends SectionData { - name: string; - typeLabel?: string; - description?: string; - } - - interface ContentSectionData extends SectionData { - content: string; + /** + * Overloaded property, accepting data in one of four formats. + * 1. A single string (one line of text). + * 2. An array of strings (multiple lines of text). + * 3. An array of objects (recordset-style data). In this case, the data will be rendered in table format. The property names of each object are not important, so long as they are + * consistent throughout the array. + * 4. An object with two properties - data and options. In this case, the data and options will be passed directly to the underlying table layout module for rendering. + */ + content?: string | string[] | any[] | { data: any; options: any }; + /** Set to true to avoid indentation and wrapping. Useful for banners. */ raw?: boolean; } - type CommandLineUsageInput = - SectionData - | SectionData[] - | OptionListData - | OptionListData[] - | ContentSectionData - | ContentSectionData[]; + /** Describes a command-line option. Additionally, if generating a usage guide with command-line-usage you could optionally add description and typeLabel properties to each definition. */ + interface OptionDefinition { + name: string; + /** + * The type value is a setter function (you receive the output from this), enabling you to be specific about the type and value received. + * + * The most common values used are String (the default), Number and Boolean but you can use a custom function. + */ + type?: any; + /** getopt-style short option names. Can be any single character (unicode included) except a digit or hyphen. */ + alias?: string; + /** Set this flag if the option takes a list of values. You will receive an array of values, each passed through the type function (if specified). */ + multiple?: boolean; + /** Identical to multiple but with greedy parsing disabled. */ + lazyMultiple?: boolean; + /** Any values unaccounted for by an option definition will be set on the defaultOption. This flag is typically set on the most commonly-used option to make for more concise usage. */ + defaultOption?: boolean; + /** An initial value for the option. */ + defaultValue?: any; + /** + * When your app has a large amount of options it makes sense to organise them in groups. + * + * There are two automatic groups: _all (contains all options) and _none (contains options without a group specified in their definition). + */ + group?: string | string[]; + /** A string describing the option. */ + description?: string; + /** A string to replace the default type string (e.g. ). It's often more useful to set a more descriptive type label, like , , , etc.. */ + typeLabel?: string; + } + + /** A OptionList section adds a table displaying details of the available options. */ + interface OptionList { + header?: string; + /** An array of option definition objects. */ + optionList?: OptionDefinition[]; + /** If specified, only options from this particular group will be printed. */ + group?: string | string[]; + /** The names of one of more option definitions to hide from the option list. */ + hide?: string | string[]; + /** If true, the option alias will be displayed after the name, i.e. --verbose, -v instead of -v, --verbose). */ + reverseNameOrder?: boolean; + /** An options object suitable for passing into table-layout. */ + tableOptions?: any; + } } - -declare function commandLineUsage(sections: commandLineUsage.CommandLineUsageInput): string | undefined | commandLineUsage.Section; - -export = commandLineUsage; From c5e4324520f3c3d4964387789cf144f9f70c45af Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Tue, 24 Apr 2018 16:46:15 -0700 Subject: [PATCH 077/564] [css-font-loading-module] Add missing FontFace properties (#25045) Based on full FontFace interface - https://drafts.csswg.org/css-font-loading/#fontface --- types/css-font-loading-module/css-font-loading-module-tests.ts | 2 ++ types/css-font-loading-module/index.d.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/types/css-font-loading-module/css-font-loading-module-tests.ts b/types/css-font-loading-module/css-font-loading-module-tests.ts index 52556a03a6..db894a5b57 100644 --- a/types/css-font-loading-module/css-font-loading-module-tests.ts +++ b/types/css-font-loading-module/css-font-loading-module-tests.ts @@ -6,6 +6,8 @@ font.load(); font.loaded.then((fontFace: FontFace) => { fontFace.status; fontFace.family; + fontFace.variationSettings; + fontFace.display; }, (fontFace: FontFace) => {}); const a: boolean = document.fonts.check("12px Example"); diff --git a/types/css-font-loading-module/index.d.ts b/types/css-font-loading-module/index.d.ts index 95d504f272..c710f2f653 100644 --- a/types/css-font-loading-module/index.d.ts +++ b/types/css-font-loading-module/index.d.ts @@ -49,6 +49,8 @@ declare global { unicodeRange: string; variant: string; featureSettings: string; + variationSettings: string; + display: string; readonly status: FontFaceLoadStatus; readonly loaded: Promise; } From 63f5ebe4516b14e769a03052f594838ac180f9ad Mon Sep 17 00:00:00 2001 From: restimel Date: Wed, 25 Apr 2018 01:55:20 +0200 Subject: [PATCH 078/564] ace: extend all core component with optionProvider. (#25058) The methods setOption, setOptions, getOption, and getOptions are available for all core ace components (editor, session, renderer): https://github.com/ajaxorg/ace/wiki/Configuring-Ace In commit 19fc8fa756b484511662028f48af923c24116b13, it was done only for editor. Now a dedicated OptionProvider interface is available and core components interface extends this new one. --- types/ace/index.d.ts | 49 +++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/types/ace/index.d.ts b/types/ace/index.d.ts index 1f7dd9752b..b1e013bea9 100644 --- a/types/ace/index.d.ts +++ b/types/ace/index.d.ts @@ -101,6 +101,29 @@ declare namespace AceAjax { transformAction(state: any, action: any, editor: any, session: any, param: any): any; } + export interface OptionProvider { + + /** + * Sets a Configuration Option + **/ + setOption(optionName: string, optionValue: any): void; + + /** + * Sets Configuration Options + **/ + setOptions(keyValueTuples: any): void; + + /** + * Get a Configuration Option + **/ + getOption(name: string):any; + + /** + * Get Configuration Options + **/ + getOptions():any; + } + //////////////// /// Ace //////////////// @@ -495,7 +518,7 @@ declare namespace AceAjax { * Stores all the data about [[Editor `Editor`]] state providing easy way to change editors state. * `EditSession` can be attached to only one [[Document `Document`]]. Same `Document` can be attached to several `EditSession`s. **/ - export interface IEditSession { + export interface IEditSession extends OptionProvider { selection: Selection; @@ -1074,7 +1097,7 @@ declare namespace AceAjax { * The `Editor` manages the [[EditSession]] (which manages [[Document]]s), as well as the [[VirtualRenderer]], which draws everything to the screen. * Event sessions dealing with the mouse and keyboard are bubbled up from `Document` to the `Editor`, which decides what to do with them. **/ - export interface Editor { + export interface Editor extends OptionProvider { on(ev: string, callback: (e: any) => any): void; @@ -1113,26 +1136,6 @@ declare namespace AceAjax { execCommand(command:string, args?: any): void; - /** - * Sets a Configuration Option - **/ - setOption(optionName: any, optionValue: any): void; - - /** - * Sets Configuration Options - **/ - setOptions(keyValueTuples: any): void; - - /** - * Get a Configuration Option - **/ - getOption(name: any):any; - - /** - * Get Configuration Options - **/ - getOptions():any; - /** * Get rid of console warning by setting this to Infinity **/ @@ -2692,7 +2695,7 @@ declare namespace AceAjax { /** * The class that is responsible for drawing everything you see on the screen! **/ - export interface VirtualRenderer { + export interface VirtualRenderer extends OptionProvider { scroller: any; From b273310927a9c545a893ec1cc37cf56c780641d3 Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Wed, 25 Apr 2018 02:00:51 +0200 Subject: [PATCH 079/564] react-native: small improvements (#25057) * Switch from var to const * import React instead of /// --- types/react-native/index.d.ts | 240 +++++++++++++++++----------------- 1 file changed, 120 insertions(+), 120 deletions(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 4fc6592c80..a76bdb6e4c 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -24,10 +24,10 @@ // /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -/// - /// +import * as React from 'react'; + export type MeasureOnSuccessCallback = ( x: number, y: number, @@ -190,7 +190,7 @@ interface EventEmitter extends EventEmitterListener { * @throws {Error} When called not during an eventing cycle * * @example - * var subscription = emitter.addListenerMap({ + * const subscription = emitter.addListenerMap({ * someEvent: function(data, event) { * console.log(data); * emitter.removeCurrentListener(); @@ -4844,7 +4844,7 @@ export namespace StyleSheet { * * Example: * ``` - * var styles = StyleSheet.create({ + * const styles = StyleSheet.create({ * listItem: { * flex: 1, * fontSize: 16, @@ -4892,7 +4892,7 @@ export namespace StyleSheet { * constant size, because on different platforms and screen densities its * value may be calculated differently. */ - export var hairlineWidth: number; + export const hairlineWidth: number; interface AbsoluteFillStyle { position: "absolute"; @@ -4914,14 +4914,14 @@ export namespace StyleSheet { * }, * }); */ - export var absoluteFillObject: AbsoluteFillStyle; + export const absoluteFillObject: AbsoluteFillStyle; /** * A very common pattern is to create overlays with position absolute and zero positioning, * so `absoluteFill` can be used for convenience and to reduce duplication of these repeated * styles. */ - export var absoluteFill: RegisteredStyle; + export const absoluteFill: RegisteredStyle; } export interface RelayProfiler { @@ -5331,7 +5331,7 @@ export interface ScaledSize { * than caching the value (for example, using inline styles rather than * setting a value in a `StyleSheet`). * - * Example: `var {height, width} = Dimensions.get('window');` + * Example: `const {height, width} = Dimensions.get('window');` * * @param dim Name of dimension as defined when calling `set`. * @returns Value for the dimension. @@ -5348,7 +5348,7 @@ export interface Dimensions { * function on every render, rather than caching the value (for * example, using inline styles rather than setting a value in a * StyleSheet). - * Example: var {height, width} = Dimensions.get('window'); + * Example: const {height, width} = Dimensions.get('window'); @param dim Name of dimension as defined when calling set. @returns Value for the dimension. */ @@ -5921,7 +5921,7 @@ export interface ScrollViewProperties * * ); * ... - * var styles = StyleSheet.create({ + * const styles = StyleSheet.create({ * contentContainer: { * paddingVertical: 20 * } @@ -8015,7 +8015,7 @@ export namespace Animated { * Animates a value along a timed easing curve. The `Easing` module has tons * of pre-defined curves, or you can use your own function. */ - export var timing: (value: AnimatedValue | AnimatedValueXY, config: TimingAnimationConfig) => CompositeAnimation; + export const timing: (value: AnimatedValue | AnimatedValueXY, config: TimingAnimationConfig) => CompositeAnimation; interface TimingAnimationConfig extends AnimationConfig { toValue: number | AnimatedValue | { x: number; y: number } | AnimatedValueXY; @@ -8166,10 +8166,10 @@ export namespace Animated { * Animated variants of the basic native views. Accepts Animated.Value for * props and style. */ - export var View: any; - export var Image: any; - export var Text: any; - export var ScrollView: any; + export const View: any; + export const Image: any; + export const Text: any; + export const ScrollView: any; } // tslint:disable-next-line:interface-name @@ -8435,278 +8435,278 @@ export interface KeyboardStatic extends NativeEventEmitter { // TODO: The following components need to be added // - [ ] ART -export var ART: ARTStatic; +export const ART: ARTStatic; export type ART = ARTStatic; -export var ActivityIndicator: ActivityIndicatorStatic; +export const ActivityIndicator: ActivityIndicatorStatic; export type ActivityIndicator = ActivityIndicatorStatic; -export var ActivityIndicatorIOS: ActivityIndicatorIOSStatic; +export const ActivityIndicatorIOS: ActivityIndicatorIOSStatic; export type ActivityIndicatorIOS = ActivityIndicatorIOSStatic; -export var DatePickerIOS: DatePickerIOSStatic; +export const DatePickerIOS: DatePickerIOSStatic; export type DatePickerIOS = DatePickerIOSStatic; -export var DrawerLayoutAndroid: DrawerLayoutAndroidStatic; +export const DrawerLayoutAndroid: DrawerLayoutAndroidStatic; export type DrawerLayoutAndroid = DrawerLayoutAndroidStatic; -export var Image: ImageStatic; +export const Image: ImageStatic; export type Image = ImageStatic; -export var ImageBackground: ImageBackgroundStatic; +export const ImageBackground: ImageBackgroundStatic; export type ImageBackground = ImageBackgroundStatic; -export var ImagePickerIOS: ImagePickerIOSStatic; +export const ImagePickerIOS: ImagePickerIOSStatic; export type ImagePickerIOS = ImagePickerIOSStatic; -export var InputAccessoryView: InputAccessoryViewStatic; +export const InputAccessoryView: InputAccessoryViewStatic; export type InputAccessoryView = InputAccessoryViewStatic; -export var FlatList: FlatListStatic; +export const FlatList: FlatListStatic; export type FlatList = FlatListStatic; -export var LayoutAnimation: LayoutAnimationStatic; +export const LayoutAnimation: LayoutAnimationStatic; export type LayoutAnimation = LayoutAnimationStatic; -export var ListView: ListViewStatic; +export const ListView: ListViewStatic; export type ListView = ListViewStatic; -export var MapView: MapViewStatic; +export const MapView: MapViewStatic; export type MapView = MapViewStatic; -export var MaskedViewIOS: MaskedViewStatic; +export const MaskedViewIOS: MaskedViewStatic; export type MaskedViewIOS = MaskedViewStatic; -export var Modal: ModalStatic; +export const Modal: ModalStatic; export type Modal = ModalStatic; -export var NavigatorIOS: NavigatorIOSStatic; +export const NavigatorIOS: NavigatorIOSStatic; export type NavigatorIOS = NavigatorIOSStatic; -export var Picker: PickerStatic; +export const Picker: PickerStatic; export type Picker = PickerStatic; -export var PickerIOS: PickerIOSStatic; +export const PickerIOS: PickerIOSStatic; export type PickerIOS = PickerIOSStatic; -export var ProgressBarAndroid: ProgressBarAndroidStatic; +export const ProgressBarAndroid: ProgressBarAndroidStatic; export type ProgressBarAndroid = ProgressBarAndroidStatic; -export var ProgressViewIOS: ProgressViewIOSStatic; +export const ProgressViewIOS: ProgressViewIOSStatic; export type ProgressViewIOS = ProgressViewIOSStatic; -export var RefreshControl: RefreshControlStatic; +export const RefreshControl: RefreshControlStatic; export type RefreshControl = RefreshControlStatic; -export var RecyclerViewBackedScrollView: RecyclerViewBackedScrollViewStatic; +export const RecyclerViewBackedScrollView: RecyclerViewBackedScrollViewStatic; export type RecyclerViewBackedScrollView = RecyclerViewBackedScrollViewStatic; -export var SafeAreaView: SafeAreaViewStatic; +export const SafeAreaView: SafeAreaViewStatic; export type SafeAreaView = SafeAreaViewStatic; -export var SegmentedControlIOS: SegmentedControlIOSStatic; +export const SegmentedControlIOS: SegmentedControlIOSStatic; export type SegmentedControlIOS = SegmentedControlIOSStatic; -export var Slider: SliderStatic; +export const Slider: SliderStatic; export type Slider = SliderStatic; -export var SliderIOS: SliderStatic; +export const SliderIOS: SliderStatic; export type SliderIOS = SliderStatic; -export var StatusBar: StatusBarStatic; +export const StatusBar: StatusBarStatic; export type StatusBar = StatusBarStatic; -export var ScrollView: ScrollViewStatic; +export const ScrollView: ScrollViewStatic; export type ScrollView = ScrollViewStatic; -export var SectionList: SectionListStatic; +export const SectionList: SectionListStatic; export type SectionList = SectionListStatic; -export var SnapshotViewIOS: SnapshotViewIOSStatic; +export const SnapshotViewIOS: SnapshotViewIOSStatic; export type SnapshotViewIOS = SnapshotViewIOSStatic; -export var Systrace: SystraceStatic; +export const Systrace: SystraceStatic; export type Systrace = SystraceStatic; -export var SwipeableListView: SwipeableListViewStatic; +export const SwipeableListView: SwipeableListViewStatic; export type SwipeableListView = SwipeableListViewStatic; -export var Switch: SwitchStatic; +export const Switch: SwitchStatic; export type Switch = SwitchStatic; -export var SwitchIOS: SwitchIOSStatic; +export const SwitchIOS: SwitchIOSStatic; export type SwitchIOS = SwitchIOSStatic; -export var TabBarIOS: TabBarIOSStatic; +export const TabBarIOS: TabBarIOSStatic; export type TabBarIOS = TabBarIOSStatic; -export var Text: TextStatic; +export const Text: TextStatic; export type Text = TextStatic; -export var TextInput: TextInputStatic; +export const TextInput: TextInputStatic; export type TextInput = TextInputStatic; -export var ToolbarAndroid: ToolbarAndroidStatic; +export const ToolbarAndroid: ToolbarAndroidStatic; export type ToolbarAndroid = ToolbarAndroidStatic; -export var TouchableHighlight: TouchableHighlightStatic; +export const TouchableHighlight: TouchableHighlightStatic; export type TouchableHighlight = TouchableHighlightStatic; -export var TouchableNativeFeedback: TouchableNativeFeedbackStatic; +export const TouchableNativeFeedback: TouchableNativeFeedbackStatic; export type TouchableNativeFeedback = TouchableNativeFeedbackStatic; -export var TouchableOpacity: TouchableOpacityStatic; +export const TouchableOpacity: TouchableOpacityStatic; export type TouchableOpacity = TouchableOpacityStatic; -export var TouchableWithoutFeedback: TouchableWithoutFeedbackStatic; +export const TouchableWithoutFeedback: TouchableWithoutFeedbackStatic; export type TouchableWithoutFeedback = TouchableWithoutFeedbackStatic; -export var View: ViewStatic; +export const View: ViewStatic; export type View = ViewStatic; -export var ViewPagerAndroid: ViewPagerAndroidStatic; +export const ViewPagerAndroid: ViewPagerAndroidStatic; export type ViewPagerAndroid = ViewPagerAndroidStatic; -export var WebView: WebViewStatic; +export const WebView: WebViewStatic; export type WebView = WebViewStatic; //////////// APIS ////////////// -export var ActionSheetIOS: ActionSheetIOSStatic; +export const ActionSheetIOS: ActionSheetIOSStatic; export type ActionSheetIOS = ActionSheetIOSStatic; -export var Share: ShareStatic; +export const Share: ShareStatic; export type Share = ShareStatic; -export var AdSupportIOS: AdSupportIOSStatic; +export const AdSupportIOS: AdSupportIOSStatic; export type AdSupportIOS = AdSupportIOSStatic; -export var AccessibilityInfo: AccessibilityInfoStatic; +export const AccessibilityInfo: AccessibilityInfoStatic; export type AccessibilityInfo = AccessibilityInfoStatic; -export var Alert: AlertStatic; +export const Alert: AlertStatic; export type Alert = AlertStatic; -export var AlertAndroid: AlertAndroidStatic; +export const AlertAndroid: AlertAndroidStatic; export type AlertAndroid = AlertAndroidStatic; -export var AlertIOS: AlertIOSStatic; +export const AlertIOS: AlertIOSStatic; export type AlertIOS = AlertIOSStatic; -export var AppState: AppStateStatic; +export const AppState: AppStateStatic; export type AppState = AppStateStatic; -export var AppStateIOS: AppStateStatic; +export const AppStateIOS: AppStateStatic; export type AppStateIOS = AppStateStatic; -export var AsyncStorage: AsyncStorageStatic; +export const AsyncStorage: AsyncStorageStatic; export type AsyncStorage = AsyncStorageStatic; -export var BackAndroid: BackAndroidStatic; +export const BackAndroid: BackAndroidStatic; export type BackAndroid = BackAndroidStatic; -export var BackHandler: BackHandlerStatic; +export const BackHandler: BackHandlerStatic; export type BackHandler = BackHandlerStatic; -export var Button: ButtonStatic; +export const Button: ButtonStatic; export type Button = ButtonStatic; -export var CameraRoll: CameraRollStatic; +export const CameraRoll: CameraRollStatic; export type CameraRoll = CameraRollStatic; -export var Clipboard: ClipboardStatic; +export const Clipboard: ClipboardStatic; export type Clipboard = ClipboardStatic; -export var DatePickerAndroid: DatePickerAndroidStatic; +export const DatePickerAndroid: DatePickerAndroidStatic; export type DatePickerAndroid = DatePickerAndroidStatic; -export var Geolocation: GeolocationStatic; +export const Geolocation: GeolocationStatic; export type Geolocation = GeolocationStatic; /** http://facebook.github.io/react-native/blog/2016/08/19/right-to-left-support-for-react-native-apps.html */ -export var I18nManager: I18nManagerStatic; +export const I18nManager: I18nManagerStatic; export type I18nManager = I18nManagerStatic; -export var ImageEditor: ImageEditorStatic; +export const ImageEditor: ImageEditorStatic; export type ImageEditor = ImageEditorStatic; -export var ImageStore: ImageStoreStatic; +export const ImageStore: ImageStoreStatic; export type ImageStore = ImageStoreStatic; -export var InteractionManager: InteractionManagerStatic; +export const InteractionManager: InteractionManagerStatic; -export var IntentAndroid: IntentAndroidStatic; +export const IntentAndroid: IntentAndroidStatic; export type IntentAndroid = IntentAndroidStatic; -export var Keyboard: KeyboardStatic; +export const Keyboard: KeyboardStatic; -export var KeyboardAvoidingView: KeyboardAvoidingViewStatic; +export const KeyboardAvoidingView: KeyboardAvoidingViewStatic; export type KeyboardAvoidingView = KeyboardAvoidingViewStatic; -export var Linking: LinkingStatic; +export const Linking: LinkingStatic; export type Linking = LinkingStatic; -export var LinkingIOS: LinkingIOSStatic; +export const LinkingIOS: LinkingIOSStatic; export type LinkingIOS = LinkingIOSStatic; -export var NativeMethodsMixin: NativeMethodsMixinStatic; +export const NativeMethodsMixin: NativeMethodsMixinStatic; export type NativeMethodsMixin = NativeMethodsMixinStatic; -export var NativeComponent: NativeMethodsMixinStatic; +export const NativeComponent: NativeMethodsMixinStatic; export type NativeComponent = NativeMethodsMixinStatic; -export var NetInfo: NetInfoStatic; +export const NetInfo: NetInfoStatic; export type NetInfo = NetInfoStatic; -export var PanResponder: PanResponderStatic; +export const PanResponder: PanResponderStatic; export type PanResponder = PanResponderStatic; -export var PermissionsAndroid: PermissionsAndroidStatic; +export const PermissionsAndroid: PermissionsAndroidStatic; export type PermissionsAndroid = PermissionsAndroidStatic; -export var PushNotificationIOS: PushNotificationIOSStatic; +export const PushNotificationIOS: PushNotificationIOSStatic; export type PushNotificationIOS = PushNotificationIOSStatic; -export var Settings: SettingsStatic; +export const Settings: SettingsStatic; export type Settings = SettingsStatic; -export var StatusBarIOS: StatusBarIOSStatic; +export const StatusBarIOS: StatusBarIOSStatic; export type StatusBarIOS = StatusBarIOSStatic; -export var TimePickerAndroid: TimePickerAndroidStatic; +export const TimePickerAndroid: TimePickerAndroidStatic; export type TimePickerAndroid = TimePickerAndroidStatic; -export var ToastAndroid: ToastAndroidStatic; +export const ToastAndroid: ToastAndroidStatic; export type ToastAndroid = ToastAndroidStatic; -export var UIManager: UIManagerStatic; +export const UIManager: UIManagerStatic; export type UIManager = UIManagerStatic; -export var VibrationIOS: VibrationIOSStatic; +export const VibrationIOS: VibrationIOSStatic; export type VibrationIOS = VibrationIOSStatic; -export var Vibration: VibrationStatic; +export const Vibration: VibrationStatic; export type Vibration = VibrationStatic; -export var Dimensions: Dimensions; -export var ShadowPropTypesIOS: ShadowPropTypesIOSStatic; +export const Dimensions: Dimensions; +export const ShadowPropTypesIOS: ShadowPropTypesIOSStatic; export type Easing = EasingStatic; -export var Easing: EasingStatic; +export const Easing: EasingStatic; //////////// Plugins ////////////// -export var DeviceEventEmitter: DeviceEventEmitterStatic; +export const DeviceEventEmitter: DeviceEventEmitterStatic; /** * Abstract base class for implementing event-emitting modules. This implements * a subset of the standard EventEmitter node module API. */ export interface NativeEventEmitter extends EventEmitter {} -export var NativeEventEmitter: NativeEventEmitter; +export const NativeEventEmitter: NativeEventEmitter; /** * Deprecated - subclass NativeEventEmitter to create granular event modules instead of * adding all event listeners directly to RCTNativeAppEventEmitter. */ -export var NativeAppEventEmitter: RCTNativeAppEventEmitter; +export const NativeAppEventEmitter: RCTNativeAppEventEmitter; /** * Interface for NativeModules which allows to augment NativeModules with type informations. @@ -8723,10 +8723,10 @@ interface NativeModulesStatic { * Use: * const MyModule = NativeModules.ModuleName */ -export var NativeModules: NativeModulesStatic; -export var Platform: PlatformStatic; -export var PlatformIOS: PlatformIOSStatic; -export var PixelRatio: PixelRatioStatic; +export const NativeModules: NativeModulesStatic; +export const Platform: PlatformStatic; +export const PlatformIOS: PlatformIOSStatic; +export const PixelRatio: PixelRatioStatic; export interface ComponentInterface

{ name?: string; @@ -8789,17 +8789,17 @@ export namespace addons { markTestCompleted: () => void; } - export var TestModule: TestModuleStatic; + export const TestModule: TestModuleStatic; export type TestModule = TestModuleStatic; } // // Prop Types // -export var ColorPropType: React.Requireable; -export var EdgeInsetsPropType: React.Requireable; -export var PointPropType: React.Requireable; -export var ViewPropTypes: React.Requireable; +export const ColorPropType: React.Requireable; +export const EdgeInsetsPropType: React.Requireable; +export const PointPropType: React.Requireable; +export const ViewPropTypes: React.Requireable; declare global { function require(name: string): any; @@ -8820,7 +8820,7 @@ declare global { ignoredYellowBox: string[]; } - var console: Console; + const console: Console; /** * Navigator object for accessing location API @@ -8831,7 +8831,7 @@ declare global { readonly geolocation: Geolocation; } - var navigator: Navigator; + const navigator: Navigator; /** * This contains the non-native `XMLHttpRequest` object, which you can use if you want to route network requests @@ -8841,15 +8841,15 @@ declare global { * * @see https://github.com/facebook/react-native/issues/934 */ - var originalXMLHttpRequest: any; + const originalXMLHttpRequest: any; - var __BUNDLE_START_TIME__: number; - var ErrorUtils: ErrorUtils; + const __BUNDLE_START_TIME__: number; + const ErrorUtils: ErrorUtils; /** * This variable is set to true when react-native is running in Dev mode * Typical usage: * if (__DEV__) console.log('Running in dev mode') */ - var __DEV__: boolean; + const __DEV__: boolean; } From f958ca566907eb698d829ec3c659209b089ef6a2 Mon Sep 17 00:00:00 2001 From: Fabio Berta Date: Wed, 25 Apr 2018 02:02:02 +0200 Subject: [PATCH 080/564] add proper default export (#25071) --- types/react-map-gl/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/react-map-gl/index.d.ts b/types/react-map-gl/index.d.ts index e0e78c6e75..9dd7584f5f 100644 --- a/types/react-map-gl/index.d.ts +++ b/types/react-map-gl/index.d.ts @@ -221,6 +221,8 @@ export class InteractiveMap extends React.Component { queryRenderedFeatures(geometry?: MapboxGL.PointLike | MapboxGL.PointLike[], parameters?: QueryRenderedFeaturesParams): Array>; } +export default InteractiveMap; + /** * * React Map Overlays From 48e4b600943f96b52b419af7c262117a2bbf3f04 Mon Sep 17 00:00:00 2001 From: Omar Diab Date: Tue, 24 Apr 2018 20:03:16 -0400 Subject: [PATCH 081/564] React intl JSX.Element values (#25074) * allow formatted message children to be a JSX Element * tests for JSX.Element children * lint --- types/react-intl/index.d.ts | 2 +- types/react-intl/react-intl-tests.tsx | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/types/react-intl/index.d.ts b/types/react-intl/index.d.ts index c6a06d39aa..d33b014e36 100644 --- a/types/react-intl/index.d.ts +++ b/types/react-intl/index.d.ts @@ -142,7 +142,7 @@ declare namespace ReactIntl { interface Props extends MessageDescriptor { values?: {[key: string]: MessageValue | JSX.Element}; tagName?: string; - children?: (...formattedMessage: string[]) => React.ReactNode; + children?: (...formattedMessage: Array) => React.ReactNode; } } class FormattedMessage extends React.Component { } diff --git a/types/react-intl/react-intl-tests.tsx b/types/react-intl/react-intl-tests.tsx index 51d5065fe3..2ed6eb0d98 100644 --- a/types/react-intl/react-intl-tests.tsx +++ b/types/react-intl/react-intl-tests.tsx @@ -154,7 +154,7 @@ class SomeComponent extends React.Component - {(text) => } + {(text) => }

    {text.map(t =>
  • {t}
  • )}
} + + + + ), + terms_of_service: ( + + + + ) + }} + > + {(...messages) => messages.map(message => <>{message})} + + Date: Wed, 25 Apr 2018 02:06:44 +0200 Subject: [PATCH 082/564] Added type definitions for Chai UUID (#25227) * Added types for Chai UUID * Fixed the test file * Removed the message parameter because it's not implemented in the plugin * Removed an empty namespace as it was unnecessary --- types/chai-uuid/chai-uuid-tests.ts | 15 +++++++++++++++ types/chai-uuid/index.d.ts | 27 +++++++++++++++++++++++++++ types/chai-uuid/tsconfig.json | 23 +++++++++++++++++++++++ types/chai-uuid/tslint.json | 1 + 4 files changed, 66 insertions(+) create mode 100644 types/chai-uuid/chai-uuid-tests.ts create mode 100644 types/chai-uuid/index.d.ts create mode 100644 types/chai-uuid/tsconfig.json create mode 100644 types/chai-uuid/tslint.json diff --git a/types/chai-uuid/chai-uuid-tests.ts b/types/chai-uuid/chai-uuid-tests.ts new file mode 100644 index 0000000000..0620464988 --- /dev/null +++ b/types/chai-uuid/chai-uuid-tests.ts @@ -0,0 +1,15 @@ +import { assert, expect, use, should } from 'chai'; +import chaiUuid = require('chai-uuid'); + +use(chaiUuid); +should(); + +// bdd style +expect('67cb8aa1-61bb-4b9b-8ca9-9dc0b278d5f7').to.be.uuid('v4'); +expect('67cb8aa1-61bb-4b9b-8ca9-9dc0b278d5f7').to.be.guid; +expect('invalid').to.not.be.uuid('v4'); +expect('invalid').to.not.be.guid(); + +// tdd style +assert.uuid('67cb8aa1-61bb-4b9b-8ca9-9dc0b278d5f7', 'v4'); +assert.guid('67cb8aa1-61bb-4b9b-8ca9-9dc0b278d5f7'); diff --git a/types/chai-uuid/index.d.ts b/types/chai-uuid/index.d.ts new file mode 100644 index 0000000000..23a0b6db92 --- /dev/null +++ b/types/chai-uuid/index.d.ts @@ -0,0 +1,27 @@ +// Type definitions for chai-uuid 1.0 +// Project: https://github.com/rfrench/chai-uuid +// Definitions by: Harm van der Werf +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +/// +/// + +declare global { + namespace Chai { + type UuidVersion = 'v1' | 'v2' | 'v3' | 'v4' | 'v5' | ''; + + interface Assertion extends LanguageChains, NumericComparison, TypeComparison { + uuid(uuid?: UuidVersion): void; + guid(guid?: any): void; + } + + interface Assert { + uuid(uuid: string, version?: UuidVersion): void; + guid(guid: string, version?: any): void; + } + } +} + +declare function chaiUuid(chai: any, utils: any): void; +export = chaiUuid; diff --git a/types/chai-uuid/tsconfig.json b/types/chai-uuid/tsconfig.json new file mode 100644 index 0000000000..ca2ca40071 --- /dev/null +++ b/types/chai-uuid/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "chai-uuid-tests.ts" + ] +} diff --git a/types/chai-uuid/tslint.json b/types/chai-uuid/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/chai-uuid/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 1efe02587a531ed9bc8abe07705494982f2d0b55 Mon Sep 17 00:00:00 2001 From: ryym Date: Wed, 25 Apr 2018 09:08:19 +0900 Subject: [PATCH 083/564] [react-redux] Update type definitions for redux@4.0.0 (#25109) --- types/react-redux/index.d.ts | 18 +++++----- types/react-redux/package.json | 2 +- types/react-redux/react-redux-tests.tsx | 46 ++++++++++++------------- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index 52cc28b9a5..bc16194f0c 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -26,15 +26,15 @@ type StatelessComponent

= React.StatelessComponent

; type Component

= React.ComponentType

; type ReactNode = React.ReactNode; type Store = Redux.Store; -type Dispatch = Redux.Dispatch; +type Dispatch = Redux.Dispatch; type ActionCreator = Redux.ActionCreator; // Diff / Omit taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766 type Diff = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]; type Omit = Pick>; -export interface DispatchProp { - dispatch?: Dispatch; +export interface DispatchProp { + dispatch?: Dispatch; } interface AdvancedComponentDecorator { @@ -76,11 +76,11 @@ export type InferableComponentEnhancer = * @param options */ export interface Connect { - (): InferableComponentEnhancer>; + (): InferableComponentEnhancer; ( mapStateToProps: MapStateToPropsParam - ): InferableComponentEnhancerWithProps & TOwnProps, TOwnProps>; + ): InferableComponentEnhancerWithProps; ( mapStateToProps: null | undefined, @@ -121,7 +121,7 @@ export interface Connect { mapDispatchToProps: null | undefined, mergeProps: null | undefined, options: Options - ): InferableComponentEnhancerWithProps & TStateProps, TOwnProps>; + ): InferableComponentEnhancerWithProps; ( mapStateToProps: null | undefined, @@ -161,14 +161,14 @@ interface MapStateToPropsFactory { type MapStateToPropsParam = MapStateToPropsFactory | MapStateToProps | null | undefined; interface MapDispatchToPropsFunction { - (dispatch: Dispatch, ownProps: TOwnProps): TDispatchProps; + (dispatch: Dispatch, ownProps: TOwnProps): TDispatchProps; } type MapDispatchToProps = MapDispatchToPropsFunction | TDispatchProps; interface MapDispatchToPropsFactory { - (dispatch: Dispatch, ownProps: TOwnProps): MapDispatchToProps; + (dispatch: Dispatch, ownProps: TOwnProps): MapDispatchToProps; } type MapDispatchToPropsParam = MapDispatchToPropsFactory | MapDispatchToProps; @@ -236,7 +236,7 @@ export declare function connectAdvanced { - (dispatch: Dispatch, factoryOptions: TFactoryOptions): Selector + (dispatch: Dispatch, factoryOptions: TFactoryOptions): Selector } export interface Selector { diff --git a/types/react-redux/package.json b/types/react-redux/package.json index 6d68bf2f9b..7f5b19d45b 100644 --- a/types/react-redux/package.json +++ b/types/react-redux/package.json @@ -1,6 +1,6 @@ { "private": true, "dependencies": { - "redux": "^3.6.0" + "redux": "^4.0.0" } } diff --git a/types/react-redux/react-redux-tests.tsx b/types/react-redux/react-redux-tests.tsx index 07b81ff082..367afedad6 100644 --- a/types/react-redux/react-redux-tests.tsx +++ b/types/react-redux/react-redux-tests.tsx @@ -1,7 +1,7 @@ import { Component, ReactElement } from 'react'; import * as React from 'react'; import * as ReactDOM from 'react-dom'; -import { Store, Dispatch, ActionCreator, createStore, bindActionCreators, ActionCreatorsMapObject } from 'redux'; +import { Store, Dispatch, AnyAction, ActionCreator, createStore, bindActionCreators, ActionCreatorsMapObject } from 'redux'; import { Connect, connect, createProvider, Provider, DispatchProp, MapStateToProps, Options } from 'react-redux'; import objectAssign = require('object-assign'); @@ -14,7 +14,7 @@ import objectAssign = require('object-assign'); // output of `connect` to make sure the signature is what is expected namespace Empty { - interface OwnProps { foo: string, dispatch: Dispatch } + interface OwnProps { foo: string, dispatch: Dispatch } class TestComponent extends Component {} @@ -42,7 +42,7 @@ namespace MapState { namespace MapStateWithDispatchProp { interface OwnProps { foo: string } - interface StateProps { bar: number, dispatch: Dispatch } + interface StateProps { bar: number, dispatch: Dispatch } class TestComponent extends Component {} @@ -250,7 +250,7 @@ namespace MapStateAndOptions { interface State { state: string; } interface OwnProps { foo: string } interface StateProps { bar: number } - interface DispatchProps { dispatch: Dispatch } + interface DispatchProps { dispatch: Dispatch } class TestComponent extends Component {} @@ -295,7 +295,7 @@ function mapStateToProps(state: CounterState) { } // Which action creators does it want to receive by props? -function mapDispatchToProps(dispatch: Dispatch) { +function mapDispatchToProps(dispatch: Dispatch) { return { onIncrement: () => dispatch(increment()) }; @@ -327,7 +327,7 @@ connect( // with higher order functions using parameters connect( (initialState: CounterState, ownProps) => mapStateToProps, - (dispatch: Dispatch, ownProps) => mapDispatchToProps + (dispatch: Dispatch, ownProps) => mapDispatchToProps )(Counter); // only first argument connect( @@ -415,7 +415,7 @@ ReactDOM.render( // Inject just dispatch and don't listen to store -const AppWrap = (props: DispatchProp & { children?: React.ReactNode }) =>

+const AppWrap = (props: DispatchProp & { children?: React.ReactNode }) =>
const WrappedApp = connect()(AppWrap); @@ -446,7 +446,7 @@ connect(mapStateToProps2, actionCreators)(TodoApp); // return { todos: state.todos }; //} -function mapDispatchToProps2(dispatch: Dispatch) { +function mapDispatchToProps2(dispatch: Dispatch) { return { actions: bindActionCreators(actionCreators, dispatch) }; } @@ -458,7 +458,7 @@ connect(mapStateToProps2, mapDispatchToProps2)(TodoApp); // return { todos: state.todos }; //} -function mapDispatchToProps3(dispatch: Dispatch) { +function mapDispatchToProps3(dispatch: Dispatch) { return bindActionCreators({ addTodo }, dispatch); } @@ -470,7 +470,7 @@ connect(mapStateToProps2, mapDispatchToProps3)(TodoApp); // return { todos: state.todos }; //} -function mapDispatchToProps4(dispatch: Dispatch) { +function mapDispatchToProps4(dispatch: Dispatch) { return { todoActions: bindActionCreators(todoActionCreators, dispatch), counterActions: bindActionCreators(counterActionCreators, dispatch) @@ -485,7 +485,7 @@ connect(mapStateToProps2, mapDispatchToProps4)(TodoApp); // return { todos: state.todos }; //} -function mapDispatchToProps5(dispatch: Dispatch) { +function mapDispatchToProps5(dispatch: Dispatch) { return { actions: bindActionCreators(objectAssign({}, todoActionCreators, counterActionCreators), dispatch) }; @@ -499,7 +499,7 @@ connect(mapStateToProps2, mapDispatchToProps5)(TodoApp); // return { todos: state.todos }; //} -function mapDispatchToProps6(dispatch: Dispatch) { +function mapDispatchToProps6(dispatch: Dispatch) { return bindActionCreators(objectAssign({}, todoActionCreators, counterActionCreators), dispatch); } @@ -541,7 +541,7 @@ interface TestState { isLoaded: boolean; state1: number; } -class TestComponent extends Component, TestState> { } +class TestComponent extends Component { } const WrappedTestComponent = connect()(TestComponent); // return value of the connect()(TestComponent) is of the type TestComponent @@ -559,7 +559,7 @@ class NonComponent {} // stateless functions interface HelloMessageProps { - dispatch: Dispatch + dispatch: Dispatch name: string; } const HelloMessage: React.StatelessComponent = (props) => { @@ -585,7 +585,7 @@ namespace TestStatelessFunctionWithMapArguments { }; }; - const mapDispatchToProps = (dispatch: Dispatch, ownProps: GreetingProps) => { + const mapDispatchToProps = (dispatch: Dispatch, ownProps: GreetingProps) => { return { onClick: () => { dispatch({ type: 'GREETING', name: ownProps.name }); @@ -609,7 +609,7 @@ namespace TestTOwnPropsInference { state: string; } - class OwnPropsComponent extends React.Component> { + class OwnPropsComponent extends React.Component { render() { return
; } @@ -647,7 +647,7 @@ namespace TestTOwnPropsInference { state: string } - class AllPropsComponent extends React.Component> { + class AllPropsComponent extends React.Component { render() { return
; } @@ -691,7 +691,7 @@ namespace TestMergedPropsInference { return { state: 'string' }; } - function mapDispatchToProps(dispatch: Dispatch): DispatchProps { + function mapDispatchToProps(dispatch: Dispatch): DispatchProps { return { dispatch: 'string' }; } @@ -729,7 +729,7 @@ namespace Issue16652 { comments: ({ id: string } | undefined)[]; } - class CommentList extends React.Component> {} + class CommentList extends React.Component {} const mapStateToProps = (state: any, ownProps: PassedProps): GeneratedStateProps => { return { @@ -748,7 +748,7 @@ namespace Issue15463 { interface ISpinnerProps{ showGlobalSpinner: boolean; } - class SpinnerClass extends React.Component, undefined> { + class SpinnerClass extends React.Component { render() { return (
); } @@ -766,7 +766,7 @@ namespace RemoveInjectedAndPassOnRest { showGlobalSpinner: boolean; foo: string; } - class SpinnerClass extends React.Component, {}> { + class SpinnerClass extends React.Component { render() { return (
); } @@ -877,8 +877,8 @@ namespace TestCreateProvider { }; interface State { a: number }; - const store = createStore(() => ({ a: 1 })); - const myStore = createStore(() => ({ a: 2 })); + const store = createStore(() => ({ a: 1 })); + const myStore = createStore(() => ({ a: 2 })); interface AProps { a: number }; const A = (props: AProps) => (

A is {props.a}

); From bd16c73705e98fd7f02caf223e058fae66119422 Mon Sep 17 00:00:00 2001 From: Alan Plum Date: Wed, 25 Apr 2018 02:09:25 +0200 Subject: [PATCH 084/564] [tea-merge] Remove attribution (#25223) * Remove attribution as per @mihhail-lapushkin's wishes * Update index.d.ts --- types/tea-merge/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/tea-merge/index.d.ts b/types/tea-merge/index.d.ts index 7aec947806..a799b04a8b 100644 --- a/types/tea-merge/index.d.ts +++ b/types/tea-merge/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for tea-merge // Project: https://github.com/qualiancy/tea-merge -// Definitions by: Mihhail Lapushkin +// Definitions by: No one // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 517765c944922ac5b70c5f7a5fa1b878d016e6e8 Mon Sep 17 00:00:00 2001 From: Marc Ghorayeb Date: Wed, 25 Apr 2018 02:11:08 +0200 Subject: [PATCH 085/564] feat(react-jsonschema-form): generic interfaces for better return types (#25103) --- types/react-jsonschema-form/index.d.ts | 67 +++++++++++++++++++------- 1 file changed, 49 insertions(+), 18 deletions(-) diff --git a/types/react-jsonschema-form/index.d.ts b/types/react-jsonschema-form/index.d.ts index dec2ad0509..5cce3d38c2 100644 --- a/types/react-jsonschema-form/index.d.ts +++ b/types/react-jsonschema-form/index.d.ts @@ -11,26 +11,26 @@ declare module "react-jsonschema-form" { import * as React from "react"; import { JSONSchema6 } from "json-schema"; - export interface FormProps { + export interface FormProps { schema: JSONSchema6; uiSchema?: UiSchema; - formData?: any; + formData?: T; formContext?: any; - widgets?: {[name: string]: Widget}; - fields?: {[name: string]: Field}; + widgets?: { [name: string]: Widget }; + fields?: { [name: string]: Field }; noValidate?: boolean; noHtml5Validate?: boolean; showErrorList?: boolean; - validate?: (formData: any, errors: any) => any; - onChange?: (e: IChangeEvent) => any; + validate?: (formData: T, errors: FormValidation) => FormValidation; + onChange?: (e: IChangeEvent) => any; onError?: (e: any) => any; - onSubmit?: (e: any) => any; + onSubmit?: (e: ISubmitEvent) => any; liveValidate?: boolean; FieldTemplate?: React.StatelessComponent; ArrayFieldTemplate?: React.StatelessComponent; ObjectFieldTemplate?: React.StatelessComponent; safeRenderCompletion?: boolean; - transformErrors?: (errors: any) => any; + transformErrors?: (errors: AjvError[]) => AjvError[]; // HTML Attributes id?: string; @@ -44,7 +44,7 @@ declare module "react-jsonschema-form" { acceptcharset?: string; } - export default class Form extends React.Component { } + export default class Form extends React.Component> { } export type UiSchema = { 'ui:field'?: Field | string; @@ -54,9 +54,13 @@ declare module "react-jsonschema-form" { [name: string]: any; }; - export type IdSchema = { + export type FieldId = { $id: string; - }; + } + + export type IdSchema = FieldId & { + [key: string]: FieldId; + } export interface WidgetProps extends React.HTMLAttributes { id: string; @@ -81,8 +85,8 @@ declare module "react-jsonschema-form" { errorSchema: object; onChange: (value: any) => void; registry: { - fields: {[name: string]: Field}; - widgets: {[name: string]: Widget}; + fields: { [name: string]: Field }; + widgets: { [name: string]: Widget }; definitions: object; formContext: any; }; @@ -168,12 +172,39 @@ declare module "react-jsonschema-form" { formContext: any; } - export interface IChangeEvent { + export interface IChangeEvent { edit: boolean; - formData: any; - errors: any[]; - errorSchema: any; + formData: T; + errors: { stack: string }[]; + errorSchema: FormValidation; idSchema: IdSchema; - status: string; + schema: JSONSchema6; + uiSchema: UiSchema; + status?: string; + } + + export type ISubmitEvent = IChangeEvent; + + export type AjvError = { + message: string; + name: string; + params: any; + property: string; + stack: string; + } + + export type FieldError = string + + type FieldValidation = { + __errors: FieldError[]; + addError: (message: string) => void; + } + + type FormValidation = FieldValidation & { + [fieldName: string]: FieldValidation; + } + + type FormSubmit = { + formData: T; } } From 8c831011f24da5c89650dd8a2c655f08b4bfbc3a Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Wed, 25 Apr 2018 02:12:55 +0200 Subject: [PATCH 086/564] Added type definitions for url-params (#25226) * Added type definitions for url-params * add test file * fix naming * fix naming --- types/url-params/index.d.ts | 11 +++++++++++ types/url-params/tsconfig.json | 23 +++++++++++++++++++++++ types/url-params/tslint.json | 1 + types/url-params/url-params-tests.ts | 5 +++++ 4 files changed, 40 insertions(+) create mode 100644 types/url-params/index.d.ts create mode 100644 types/url-params/tsconfig.json create mode 100644 types/url-params/tslint.json create mode 100644 types/url-params/url-params-tests.ts diff --git a/types/url-params/index.d.ts b/types/url-params/index.d.ts new file mode 100644 index 0000000000..bfe7ea6668 --- /dev/null +++ b/types/url-params/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for url-params 1.0 +// Project: https://github.com/AtenDesignGroup/url-params +// Definitions by: Daniel Sogl +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +export function add(oldUrl: string, param: string, value: any): string; + +export function createUrlObject(oldUrl: string): any; + +export function remove(oldUrl: string, param: string, value: any): string; + +export function set(oldUrl: string, param: string, value: any): string; diff --git a/types/url-params/tsconfig.json b/types/url-params/tsconfig.json new file mode 100644 index 0000000000..82f6539e78 --- /dev/null +++ b/types/url-params/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "url-params-tests.ts" + ] +} \ No newline at end of file diff --git a/types/url-params/tslint.json b/types/url-params/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/url-params/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/url-params/url-params-tests.ts b/types/url-params/url-params-tests.ts new file mode 100644 index 0000000000..ac8fe828c2 --- /dev/null +++ b/types/url-params/url-params-tests.ts @@ -0,0 +1,5 @@ +import { add, remove, set } from 'url-params'; + +const url1 = add('http://www.example.com/?foo=2+3+6&baz=6', 'foo', 4); +const url2 = remove('http://www.example.com/?foo=2+3+6&baz=6', 'foo', 3); +const url3 = set('http://www.example.com/?foo=2+3+6&baz=6', 'foo', 3); From 248e3140ec8a8f083d50e4a0871f7411ac0ba837 Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Wed, 25 Apr 2018 02:15:06 +0200 Subject: [PATCH 087/564] Added type definitions for apicache (#25225) * Added type definitions for apicache * Added type definitions for apicache * Update index.d.ts * Update index.d.ts * fix lint * refactor lint rules * fix lint * add test file --- types/apicache/apicache-tests.ts | 17 +++++++ types/apicache/index.d.ts | 77 ++++++++++++++++++++++++++++++++ types/apicache/tsconfig.json | 16 +++++++ types/apicache/tslint.json | 1 + 4 files changed, 111 insertions(+) create mode 100644 types/apicache/apicache-tests.ts create mode 100644 types/apicache/index.d.ts create mode 100644 types/apicache/tsconfig.json create mode 100644 types/apicache/tslint.json diff --git a/types/apicache/apicache-tests.ts b/types/apicache/apicache-tests.ts new file mode 100644 index 0000000000..1f9eb98dda --- /dev/null +++ b/types/apicache/apicache-tests.ts @@ -0,0 +1,17 @@ +import { middleware, newInstance, options } from 'apicache'; + +let cache = middleware; + +options({ + statusCodes: { + exclude: [404, 429, 500], + include: [200, 304] + } +}); + +cache = newInstance({ + statusCodes: { + exclude: [404, 429, 500], + include: [200, 304] + } +}); diff --git a/types/apicache/index.d.ts b/types/apicache/index.d.ts new file mode 100644 index 0000000000..b62fd7356d --- /dev/null +++ b/types/apicache/index.d.ts @@ -0,0 +1,77 @@ +// Type definitions for apicache 1.2 +// Project: https://github.com/kwhitley/apicache +// Definitions by: Daniel Sogl +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import { RedisClient } from 'redis'; + +export const id: number; + +/** + * clears cache target (key or group), or entire cache if no value passed, returns new index. + */ +export function clear(target: string | any[]): any; + +/** used to create a new ApiCache instance with the same options as the current one */ +export function clone(): any; + +export function getDuration(duration: string): any; + +/** + * returns current cache index [of keys] + */ +export function getIndex(): any; + +/** + * the actual middleware that will be used in your routes. duration is in the following format + * "[length] [unit]", as in "10 minutes" or "1 day". A second param is a middleware toggle function, + * accepting request and response params, and must return truthy to enable cache for the request. + * Third param is the options that will override global ones and affect this middleware only. + */ +export function middleware( + duration?: string, + toggleMiddleware?: any, + localOptions?: Options +): any; + +/** + * used to create a new ApiCache instance (by default, simply requiring this library shares a common instance) + */ +export function newInstance(config: Options): any; + +/** + * getter/setter for global options. If used as a setter, this function is + * chainable, allowing you to do things such as... say... return the middleware. + */ +export function options(options: Options): any; + +export function resetIndex(): void; + +export interface Options { + /** if true, enables console output */ + debug?: boolean; + /** should be either a number (in ms) or a string, defaults to 1 hour */ + defaultDuration?: string; + /** if false, turns off caching globally (useful on dev) */ + enabled?: boolean; + /** + * if provided, uses the [node-redis](https://github.com/NodeRedis/node_redis) client instead of [memory-cache](https://github.com/ptarjan/node-cache) + */ + redisClient?: RedisClient; + /** appendKey takes the req/res objects and returns a custom value to extend the cache key */ + appendKey?: any; + /** list of headers that should never be cached */ + headerBlacklist?: string[]; + statusCodes?: { + /** list status codes to specifically exclude (e.g. [404, 403] cache all responses unless they had a 404 or 403 status) */ + exclude?: number[]; + /** list status codes to require (e.g. [200] caches ONLY responses with a success/200 code) */ + include?: number[]; + }; + /** + * 'cache-control': 'no-cache' // example of header overwrite + */ + headers?: { + [key: string]: string; + }; +} diff --git a/types/apicache/tsconfig.json b/types/apicache/tsconfig.json new file mode 100644 index 0000000000..9ae5f1f827 --- /dev/null +++ b/types/apicache/tsconfig.json @@ -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", "apicache-tests.ts"] +} diff --git a/types/apicache/tslint.json b/types/apicache/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/apicache/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file From 0823873176ed91e0af883ec854a37fb98e1a1a2b Mon Sep 17 00:00:00 2001 From: Mathias Paumgarten Date: Tue, 24 Apr 2018 17:17:17 -0700 Subject: [PATCH 088/564] Adds types for gl-shader (#25200) * init gl-shader types * adds tests * fixes file name * adds additional signature * fixes definitions url --- types/gl-shader/gl-shader-tests.ts | 41 ++++++++++++++++++++++++ types/gl-shader/index.d.ts | 51 ++++++++++++++++++++++++++++++ types/gl-shader/tsconfig.json | 24 ++++++++++++++ types/gl-shader/tslint.json | 3 ++ 4 files changed, 119 insertions(+) create mode 100644 types/gl-shader/gl-shader-tests.ts create mode 100644 types/gl-shader/index.d.ts create mode 100644 types/gl-shader/tsconfig.json create mode 100644 types/gl-shader/tslint.json diff --git a/types/gl-shader/gl-shader-tests.ts b/types/gl-shader/gl-shader-tests.ts new file mode 100644 index 0000000000..ad42dd2507 --- /dev/null +++ b/types/gl-shader/gl-shader-tests.ts @@ -0,0 +1,41 @@ +import createShader = require("gl-shader"); + +const gl = new WebGLRenderingContext(); + +let shader = createShader(gl, "", ""); + +shader = createShader(gl, "", "", []); +shader = createShader(gl, "", "", [], []); +shader = createShader(gl, "", "", [{name: "foo", type: "bool"}]); +shader = createShader(gl, "", "", [{name: "foo", type: "bool"}, {name: "bar", type: "float"}]); +shader = createShader(gl, "", "", [{name: "foo", type: "bool"}], [{name: "bar", type: "float"}]); + +shader = createShader(gl, {vertex: "", fragment: ""}); +shader = createShader(gl, {vertex: "", fragment: "", uniforms: [{name: "foo", type: "bool"}]}); +shader = createShader(gl, {vertex: "", fragment: "", uniforms: [{name: "foo", type: "bool"}]}); +shader = createShader(gl, { + vertex: "", + fragment: "", + uniforms: [{name: "foo", type: "bool"}], + attributes: [{name: "bar", type: "float"}] +}); + +shader.bind(); +shader.dispose(); +shader.update("", ""); +shader.update("", "", [{name: "foo", type: "bool"}]); +shader.update("", "", [{name: "foo", type: "bool"}], [{name: "foo", type: "bool"}]); + +shader.uniforms; +shader.uniforms.color; +shader.uniforms.color = 4; +shader.uniforms.color = [ 1, 0, 0, 0 ]; + +shader.uniforms = { + model: [ 1, 2, 3, 4 ], + foo: 13 +}; + +shader.attributes; +shader.attributes.position.length; +shader.attributes.position.pointer(); diff --git a/types/gl-shader/index.d.ts b/types/gl-shader/index.d.ts new file mode 100644 index 0000000000..3049516cca --- /dev/null +++ b/types/gl-shader/index.d.ts @@ -0,0 +1,51 @@ +// Type definitions for gl-shader 4.2 +// Project: https://github.com/stackgl/gl-shader +// Definitions by: Mathias Paumgarten +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +interface Parameter { + type: string; + name: string; +} + +interface Attribute { + location: number[] | number; + pointer(type?: number, normalized?: boolean, stride?: number, offset?: number): number; +} + +declare class Shader { + readonly gl: WebGLRenderingContext; + readonly program: WebGLProgram; + readonly vertShader: WebGLShader; + readonly fragShader: WebGLShader; + readonly attributes: {[key: string]: Attribute & any[]}; + + uniforms: {[key: string]: any}; + + constructor(gl: WebGLRenderingContext); + + bind(): void; + dispose(): void; + + update(vertex: string, fragment: string, uniforms?: Parameter[], attributes?: Parameter[]): void; + update(obj: {vertex: string, fragment: string, uniforms: Parameter[], attributes: Parameter[]}): void; +} + +declare function createShader( + gl: WebGLRenderingContext, + vertex: string, + fragment: string, + uniforms?: Parameter[], + attributes?: Parameter[]): Shader; + +declare function createShader( + gl: WebGLRenderingContext, + options: { + vertex: string, + fragment: string, + uniforms?: Parameter[], + attributes?: Parameter[], + }): Shader; + +export = createShader; diff --git a/types/gl-shader/tsconfig.json b/types/gl-shader/tsconfig.json new file mode 100644 index 0000000000..fefb7e0c4c --- /dev/null +++ b/types/gl-shader/tsconfig.json @@ -0,0 +1,24 @@ +{ + "files": [ + "index.d.ts", + "gl-shader-tests.ts" + ], + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/gl-shader/tslint.json b/types/gl-shader/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/gl-shader/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From 211a5eb474e2ceadc1eadb1fc92ab4d13344a181 Mon Sep 17 00:00:00 2001 From: Jason Walton Date: Tue, 24 Apr 2018 20:18:28 -0400 Subject: [PATCH 089/564] [@types/body-parser] Fix so body-parser works with connect/vanilla node.js apps. (#25115) --- types/body-parser/body-parser-tests.ts | 16 ++++++++++++++++ types/body-parser/index.d.ts | 26 ++++++++++++++++---------- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/types/body-parser/body-parser-tests.ts b/types/body-parser/body-parser-tests.ts index 2f6a33ea72..89d905ead0 100644 --- a/types/body-parser/body-parser-tests.ts +++ b/types/body-parser/body-parser-tests.ts @@ -1,3 +1,4 @@ +import * as http from 'http'; import express = require('express'); import { json, @@ -13,6 +14,21 @@ app.use(raw()); app.use(text()); app.use(urlencoded()); +const jsonParser = app.use(json({ + inflate: true, + limit: '100kb', + type: 'application/*', + verify: ( + req: http.IncomingMessage, + res: http.ServerResponse, + buf: Buffer, + encoding: string + ) => { + return true; + } +})); +app.use(jsonParser); + // send any data, it should be parsed and printed app.all('/', (req, res, next) => { console.log(req.body); diff --git a/types/body-parser/index.d.ts b/types/body-parser/index.d.ts index b1485770a1..67774e2149 100644 --- a/types/body-parser/index.d.ts +++ b/types/body-parser/index.d.ts @@ -1,24 +1,30 @@ -// Type definitions for body-parser 1.16 +// Type definitions for body-parser 1.17 // Project: https://github.com/expressjs/body-parser -// Definitions by: Santi Albo , Vilic Vane , Jonathan Häberle , Gevik Babakhani , Tomasz Łaziuk +// Definitions by: Santi Albo +// Vilic Vane +// Jonathan Häberle +// Gevik Babakhani +// Tomasz Łaziuk +// Jason Walton // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 /// -import { Request, RequestHandler, Response } from 'express'; +import { NextHandleFunction } from 'connect'; +import * as http from 'http'; // for docs go to https://github.com/expressjs/body-parser/tree/1.16.0#body-parser // @deprecated -declare function bodyParser(options?: bodyParser.OptionsJson & bodyParser.OptionsText & bodyParser.OptionsUrlencoded): RequestHandler; +declare function bodyParser(options?: bodyParser.OptionsJson & bodyParser.OptionsText & bodyParser.OptionsUrlencoded): NextHandleFunction; declare namespace bodyParser { interface Options { inflate?: boolean; limit?: number | string; - type?: string | string[] | ((req: Request) => any); - verify?(req: Request, res: Response, buf: Buffer, encoding: string): void; + type?: string | string[] | ((req: http.IncomingMessage) => any); + verify?(req: http.IncomingMessage, res: http.ServerResponse, buf: Buffer, encoding: string): void; } interface OptionsJson extends Options { @@ -35,13 +41,13 @@ declare namespace bodyParser { parameterLimit?: number; } - function json(options?: OptionsJson): RequestHandler; + function json(options?: OptionsJson): NextHandleFunction; - function raw(options?: Options): RequestHandler; + function raw(options?: Options): NextHandleFunction; - function text(options?: OptionsText): RequestHandler; + function text(options?: OptionsText): NextHandleFunction; - function urlencoded(options?: OptionsUrlencoded): RequestHandler; + function urlencoded(options?: OptionsUrlencoded): NextHandleFunction; } export = bodyParser; From 8d87c67236a73febd08e7afa94cdcc02ae76d38b Mon Sep 17 00:00:00 2001 From: Su-Shing Chen Date: Wed, 25 Apr 2018 12:20:45 +1200 Subject: [PATCH 090/564] [@types/when] Fix when.js then() when TResult is a subtype of T (#25110) * Fix when.js then() when TResult is a subtype of T Change the order of .then overrides to deprioritize no generics. * Move the more specific overload to the top --- types/when/index.d.ts | 16 ++++++++-------- types/when/tsconfig.json | 1 + types/when/when-tests.ts | 28 +++++++++++++++++++++++++++- 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/types/when/index.d.ts b/types/when/index.d.ts index 3736cfa7dd..0b016a9ea0 100644 --- a/types/when/index.d.ts +++ b/types/when/index.d.ts @@ -285,11 +285,11 @@ declare namespace When { // be a constructor with prototype set to an instance of Error. otherwise(exceptionType: any, onRejected?: (reason: any) => U | Promise): Promise; - then( - onFulfilled?: ((value: T) => T | Thenable) | undefined | null, - onRejected?: ((reason: any) => T | Thenable) | undefined | null, + then( + onFulfilled: ((value: T) => TResult1 | Thenable), + onRejected: ((reason: any) => TResult2 | Thenable), onProgress?: (update: any) => void - ): Promise; + ): Promise; then( onFulfilled: ((value: T) => TResult | Thenable), onRejected?: ((reason: any) => TResult | Thenable) | undefined | null, @@ -300,11 +300,11 @@ declare namespace When { onRejected: ((reason: any) => TResult | Thenable), onProgress?: (update: any) => void ): Promise; - then( - onFulfilled: ((value: T) => TResult1 | Thenable), - onRejected: ((reason: any) => TResult2 | Thenable), + then( + onFulfilled?: ((value: T) => T | Thenable) | undefined | null, + onRejected?: ((reason: any) => T | Thenable) | undefined | null, onProgress?: (update: any) => void - ): Promise; + ): Promise; spread(onFulfilled: _.Fn0 | T>): Promise; spread(onFulfilled: _.Fn1 | T>): Promise; diff --git a/types/when/tsconfig.json b/types/when/tsconfig.json index 2162d713fc..84a5f78c14 100644 --- a/types/when/tsconfig.json +++ b/types/when/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { "module": "commonjs", + "target": "es5", "lib": [ "es6" ], diff --git a/types/when/when-tests.ts b/types/when/when-tests.ts index d44752b950..e1e3f0fd7c 100644 --- a/types/when/when-tests.ts +++ b/types/when/when-tests.ts @@ -14,9 +14,24 @@ class ForeignPromise { then(onFulfilled?: (value: T) => T, onRejected?: (reason: any) => T): ForeignPromise { return new ForeignPromise(onFulfilled ? onFulfilled(this.value) : this.value); } -}; +} + +interface IData { + timestamp: number; +} + +class Data implements IData { + timestamp: number; + date: Date; + + constructor({ timestamp }: IData) { + this.timestamp = timestamp; + this.date = new Date(timestamp); + } +} var promise: when.Promise; +var promise2: when.Promise; var foreign = new ForeignPromise(1); var error = new Error("boom!"); var example: () => void; @@ -222,6 +237,17 @@ promise = when(1).then(undefined, (err: any) => 2); promise = when(1).then((val: number) => val + val, (err: any) => 2); promise = when(1).then((val: number) => when(val + val), (err: any) => 2); +promise = when('1').then((val: string) => parseInt(val)); + +// Tests for when TResult is a subtype of T +const subData: IData = { timestamp: Date.now() }; +const errorData: Data = new Data({ timestamp: -1 }); + +promise2 = when(subData).then((val: IData) => new Data(val)); +promise2 = when(subData).then((val: IData) => when(new Data(val))); +promise2 = when(subData).then((val: IData) => new Data(val), (err: any) => errorData); +promise2 = when(subData).then((val: IData) => when(new Data(val)), (err: any) => errorData); + /* promise.spread(onFulfilledArray) */ promise = when([]).spread(() => 2); From 470d9ed790a243023a732880aa2b84e3e44893c0 Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Wed, 25 Apr 2018 03:22:30 +0300 Subject: [PATCH 091/564] Update index.d.ts (#25119) The done function takes an optional release (boolean) argument that tells whether the client should be released or put back in the pool. From: https://node-postgres.com/api/pool ` The releaseCallback releases an acquired client back to the pool. If you pass a truthy value in the err position to the callback, instead of releasing the client to the pool, the pool will be instructed to disconnect and destroy this client, leaving a space within itself for a new client. ` --- types/pg/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/pg/index.d.ts b/types/pg/index.d.ts index 9098f400e7..0013a9c738 100644 --- a/types/pg/index.d.ts +++ b/types/pg/index.d.ts @@ -99,7 +99,7 @@ export class Pool extends events.EventEmitter { readonly waitingCount: number; connect(): Promise; - connect(callback: (err: Error, client: PoolClient, done: () => void) => void): void; + connect(callback: (err: Error, client: PoolClient, done: (release?: any) => void) => void): void; end(): Promise; end(callback: () => void): void; From 7c9595d32e7b9b37580202d55670430aa270283c Mon Sep 17 00:00:00 2001 From: Slava Date: Wed, 25 Apr 2018 03:23:31 +0300 Subject: [PATCH 092/564] Update @types/long to latest version (#25126) Add fromBytes/LE/BE and toBytes/LE/BE. Also fix some tests. --- types/long/index.d.ts | 35 ++++++++++++++++++++++++++++++++++- types/long/long-tests.ts | 15 ++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) diff --git a/types/long/index.d.ts b/types/long/index.d.ts index 3fbc02727b..7d373ae11f 100644 --- a/types/long/index.d.ts +++ b/types/long/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for long.js 3.0.2 +// Type definitions for long.js 4.0.0 // Project: https://github.com/dcodeIO/long.js // Definitions by: Peter Kooijmans // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -90,6 +90,21 @@ declare class Long */ static fromString( str: string, unsigned?: boolean | number, radix?: number ): Long; + /** + * Creates a Long from its byte representation. + */ + static fromBytes( bytes: number[], unsigned?: boolean, le?: boolean ): Long; + + /** + * Creates a Long from its little endian byte representation. + */ + static fromBytesLE( bytes: number[], unsigned?: boolean ): Long; + + /** + * Creates a Long from its little endian byte representation. + */ + static fromBytesBE( bytes: number[], unsigned?: boolean ): Long; + /** * Tests if the specified object is a Long. */ @@ -330,6 +345,24 @@ declare class Long */ toNumber(): number; + /** + * Converts this Long to its byte representation. + */ + + toBytes( le?: boolean ): number[]; + + /** + * Converts this Long to its little endian byte representation. + */ + + toBytesLE(): number[]; + + /** + * Converts this Long to its big endian byte representation. + */ + + toBytesBE(): number[]; + /** * Converts this Long to signed. */ diff --git a/types/long/long-tests.ts b/types/long/long-tests.ts index c54c83d4d6..12f76ba570 100644 --- a/types/long/long-tests.ts +++ b/types/long/long-tests.ts @@ -6,6 +6,7 @@ var val: Long; var n: number = 42; var b: boolean = true; var s: string = "1337"; +var bytes: number[] = [0, 0, 0, 0, 0, 0, 0, 0]; val = new Long(0xFFFFFFFF, 0x7FFFFFFF, true); val = new Long(0xFFFFFFFF, 0x7FFFFFFF); @@ -27,6 +28,7 @@ n = val.compare(val); n = val.compare(n); n = val.compare(s); +val = Long.ONE; val = val.div(val); val = val.div(n); val = val.div(s); @@ -63,6 +65,7 @@ b = val.lessThanOrEqual(val); b = val.lessThanOrEqual(n); b = val.lessThanOrEqual(s); +val = Long.fromValue(10); val = val.modulo(val); val = val.modulo(n); val = val.modulo(s); @@ -100,7 +103,7 @@ n = val.toNumber(); val = val.toSigned(); s = val.toString(); -s = val.toString(n); +s = val.toString(16); val = val.toUnsigned(); @@ -115,3 +118,13 @@ val = Long.NEG_ONE; val = Long.ONE; val = Long.UZERO; val = Long.ZERO; + +val = Long.fromBytes(bytes); +val = Long.fromBytes(bytes, true); +val = Long.fromBytes(bytes, true, true); +bytes = val.toBytes(); +val = Long.fromBytes(bytes) +bytes = val.toBytesLE() +val = Long.fromBytesLE(bytes) +bytes = val.toBytesBE() +val = Long.fromBytesBE(bytes) From 56f31f9da4b3962a2e1ae7724fff9338eda25632 Mon Sep 17 00:00:00 2001 From: Eugene Kuzmin Date: Wed, 25 Apr 2018 03:25:17 +0300 Subject: [PATCH 093/564] Add merge() method to ObjectLikeSequence (#25127) --- types/lazy.js/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/lazy.js/index.d.ts b/types/lazy.js/index.d.ts index daa0451e48..3a44d2ce40 100644 --- a/types/lazy.js/index.d.ts +++ b/types/lazy.js/index.d.ts @@ -210,6 +210,7 @@ declare namespace LazyJS { get(property: string): ObjectLikeSequence; invert(): ObjectLikeSequence; keys(): Sequence; + merge(others: Object | ObjectLikeSequence, mergeFn?: Function): ObjectLikeSequence; omit(properties: string[]): ObjectLikeSequence; pairs(): Sequence; pick(properties: string[]): ObjectLikeSequence; From c02c9f00f0b98adc2abdc62f8f9fedd0c046a1eb Mon Sep 17 00:00:00 2001 From: "a.nvlkv" Date: Wed, 25 Apr 2018 02:31:59 +0200 Subject: [PATCH 094/564] Update Layer.paramNames, Add ParamName (#25135) In recent version of koa-router paramNames aren't strings but objects. Added definition --- types/koa-router/index.d.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/types/koa-router/index.d.ts b/types/koa-router/index.d.ts index ab61772835..1ade4b135b 100644 --- a/types/koa-router/index.d.ts +++ b/types/koa-router/index.d.ts @@ -87,12 +87,23 @@ declare module Router { } +declare class ParamName { + asterisk: boolean; + delimiter: string; + name: string; + optional: boolean; + partial: boolean; + pattern: string; + prefix: string; + repeat: string; +} + declare class Layer { opts: Layer.ILayerOptions; name: string; methods: string[]; - paramNames: string[]; + paramNames: ParamName[]; stack: Router.IMiddleware[]; regexp: RegExp; path: string; From 6250af69ce88189b38e5bf1bc6c43ca13de43594 Mon Sep 17 00:00:00 2001 From: Ben Saufley Date: Tue, 24 Apr 2018 20:34:23 -0400 Subject: [PATCH 095/564] [next-redux-wrapper]: Change reference to React.Component to [react-redux.]Component (#25137) * Change reference to React.Component to [react-redux].Component * Bump verison number to match latest package version? * No patch version * Don't pass MergedProps to returned type; extend tests --- types/next-redux-wrapper/index.d.ts | 8 ++--- .../next-redux-wrapper-tests.tsx | 29 +++++++++++++------ 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/types/next-redux-wrapper/index.d.ts b/types/next-redux-wrapper/index.d.ts index 38e20f608a..16dc88b1a4 100644 --- a/types/next-redux-wrapper/index.d.ts +++ b/types/next-redux-wrapper/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for next-redux-wrapper 1.3 +// Type definitions for next-redux-wrapper 1.4 // Project: https://github.com/kirill-konshin/next-redux-wrapper // Definitions by: Steve // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -25,20 +25,20 @@ export = nextReduxWrapper; declare function nextReduxWrapper( options: nextReduxWrapper.Options -): (Component: Component) => nextReduxWrapper.NextReduxWrappedComponent; +): (Component: Component) => nextReduxWrapper.NextReduxWrappedComponent; declare function nextReduxWrapper( createStore: nextReduxWrapper.NextStoreCreator, mapStateToProps?: MapStateToPropsParam, mapDispatchToProps?: MapDispatchToPropsParam, mergeProps?: MergeProps, options?: ConnectOptions -): (Component: Component) => nextReduxWrapper.NextReduxWrappedComponent; +): (Component: Component) => nextReduxWrapper.NextReduxWrappedComponent; declare namespace nextReduxWrapper { interface NextPageComponentMethods { getInitialProps(props: any): Promise; } - type NextReduxWrappedComponent = React.Component & NextPageComponentMethods; + type NextReduxWrappedComponent

= Component

& NextPageComponentMethods; type NextStoreCreator = ( initialState: TInitialState, diff --git a/types/next-redux-wrapper/next-redux-wrapper-tests.tsx b/types/next-redux-wrapper/next-redux-wrapper-tests.tsx index 40069aeb8d..89e358afb2 100644 --- a/types/next-redux-wrapper/next-redux-wrapper-tests.tsx +++ b/types/next-redux-wrapper/next-redux-wrapper-tests.tsx @@ -20,6 +20,10 @@ const makeStore = (initialState: InitialState): Store => { return createStore(reducer, initialState); }; +interface OwnProps { + bar: string; +} + interface Props { foo: string; custom: string; @@ -29,7 +33,7 @@ interface ReduxStore { foo: string; } -class Page extends React.Component { +class Page extends React.Component { static getInitialProps({store, isServer, pathname, query}: any) { store.dispatch({type: 'FOO', payload: 'foo'}); return {custom: 'custom'}; @@ -46,29 +50,28 @@ class Page extends React.Component { type ConnectStateProps = Props; type DispatchProps = Props; -type OwnProps = Props; type MergedProps = Props; // Test various typings -const com1 = withRedux(makeStore, (state: ReduxStore) => ({foo: state.foo}))(Page); +const Com1 = withRedux(makeStore, (state: ReduxStore) => ({foo: state.foo}))(Page); -const com2 = withRedux(makeStore, (state: ReduxStore) => ({foo: state.foo}))(Page); +const Com2 = withRedux(makeStore, (state: ReduxStore) => ({foo: state.foo}))(Page); -const com3 = withRedux(makeStore, (state: ReduxStore) => ({foo: state.foo}))(Page); +const Com3 = withRedux(makeStore, (state: ReduxStore) => ({foo: state.foo}))(Page); -const com4 = withRedux( +const Com4 = withRedux( makeStore, (state: ReduxStore) => ({foo: state.foo, custom: 'hi'}) )(Page); -const com5 = withRedux( +const Com5 = withRedux( makeStore, (state: ReduxStore) => ({foo: state.foo, custom: 'hi'}), undefined, (state: Props) => ({foo: state.foo, custom: 'hi'}) )(Page); -const com6 = withRedux( +const Com6 = withRedux( (initialState: InitialState, options: StoreCreatorOptions) => { if (options.isServer || options.req || options.query || options.res) { const a = 1; @@ -80,10 +83,18 @@ const com6 = withRedux ({foo: state.foo, custom: 'hi'}) )(Page); -const com7 = withRedux({ +const Com7 = withRedux({ createStore: makeStore, mapStateToProps: (state: ReduxStore) => ({foo: state.foo}) })(Page); +const com1Instance = (); +const com2Instance = (); +const com3Instance = (); +const com4Instance = (); +const com5Instance = (); +const com6Instance = (); +const com7Instance = (); + withRedux.setPromise(Promise); withRedux.setDebug(true); From a5cb7117633f46105258d1fec9fb9a7e56afde95 Mon Sep 17 00:00:00 2001 From: Bruno Lemos Date: Tue, 24 Apr 2018 21:36:43 -0300 Subject: [PATCH 096/564] [expo] Un-extend LinearGradientProps from ViewProperties to unblock #25083 (#25149) --- types/expo/index.d.ts | 6 ++++-- types/expo/v24/index.d.ts | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index 3726249cc7..8efbbd120d 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -18,7 +18,8 @@ import { NativeEventEmitter, ViewProperties, ViewStyle, - Permission + Permission, + StyleProp } from 'react-native'; export type Axis = number; @@ -1554,11 +1555,12 @@ export class KeepAwake extends Component { /** * LinearGradient */ -export interface LinearGradientProps extends ViewProperties { +export interface LinearGradientProps { colors: string[]; start?: [number, number]; end?: [number, number]; locations?: number[]; + style?: StyleProp; } export class LinearGradient extends Component { } diff --git a/types/expo/v24/index.d.ts b/types/expo/v24/index.d.ts index 829e9730a7..0647519da4 100644 --- a/types/expo/v24/index.d.ts +++ b/types/expo/v24/index.d.ts @@ -17,7 +17,8 @@ import { NativeEventEmitter, ViewProperties, ViewStyle, - Permission + Permission, + StyleProp } from 'react-native'; export type Axis = number; @@ -1534,11 +1535,12 @@ export class KeepAwake extends Component { /** * LinearGradient */ -export interface LinearGradientProps extends ViewProperties { +export interface LinearGradientProps { colors: string[]; start?: [number, number]; end?: [number, number]; locations?: number[]; + style?: StyleProp; } export class LinearGradient extends Component { } From e5c82b2910e56a0d1ffdb6609e349baa971d4922 Mon Sep 17 00:00:00 2001 From: Bruno Lemos Date: Tue, 24 Apr 2018 21:37:10 -0300 Subject: [PATCH 097/564] [react-native-linear-gradient] Remove type definitions (#25147) The project has a `index.d.ts` file since v2.4.0. --- notNeededPackages.json | 6 +++ types/react-native-linear-gradient/index.d.ts | 47 ------------------- .../react-native-linear-gradient-tests.tsx | 35 -------------- .../tsconfig.json | 25 ---------- .../react-native-linear-gradient/tslint.json | 1 - 5 files changed, 6 insertions(+), 108 deletions(-) delete mode 100644 types/react-native-linear-gradient/index.d.ts delete mode 100644 types/react-native-linear-gradient/react-native-linear-gradient-tests.tsx delete mode 100644 types/react-native-linear-gradient/tsconfig.json delete mode 100644 types/react-native-linear-gradient/tslint.json diff --git a/notNeededPackages.json b/notNeededPackages.json index 2b9e1fcde0..6f3e4fe093 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -1176,6 +1176,12 @@ "sourceRepoURL": "https://github.com/idehub/react-native-google-analytics-bridge", "asOfVersion": "5.3.3" }, + { + "libraryName": "react-native-linear-gradient", + "typingsPackageName": "react-native-linear-gradient", + "sourceRepoURL": "https://github.com/react-native-community/react-native-linear-gradient", + "asOfVersion": "2.4.0" + }, { "libraryName": "react-native-modal", "typingsPackageName": "react-native-modal", diff --git a/types/react-native-linear-gradient/index.d.ts b/types/react-native-linear-gradient/index.d.ts deleted file mode 100644 index 687bd4e432..0000000000 --- a/types/react-native-linear-gradient/index.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -// Type definitions for react-native-linear-gradient 2.3 -// Project: https://github.com/brentvatne/react-native-linear-gradient#readme -// Definitions by: Jacob Froman -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 - -import * as React from 'react'; -import { ViewProperties } from 'react-native'; - -interface LinearGradientProps extends ViewProperties { - children?: React.ReactNode; - - /** - * Colors that will be used for the gradient - */ - colors?: ReadonlyArray; - - /** - * Coordinates of the position that the gradient starts at, as a fraction - * of the overall size of the gradient, starting from the top left corner. - * { x: 0.1, y: 0.1 } means that the gradient will start 10% from the top - * and 10% from the left. - */ - start?: { x: number; y: number }; - - /** - * Coordinates of the position that the gradient ends at, as a fraction - * of the overall size of the gradient, starting from the top left corner. - * { x: 0.9, y: 0.9 } means that the gradient will end 90% from the top - * and 90% from the left. - */ - end?: { x: number; y: number }; - - /** - * An optional array of numbers defining the location of each gradient - * color stop, mapping to the color with the same index in colors prop. - * [0.1, 0.75, 1] means that first color will take 0% - 10%, second color - * will take 10% - 75% and finally third color will occupy 75% - 100%. - */ - locations?: ReadonlyArray; -} - -declare class LinearGradient extends React.Component { - constructor(props: LinearGradientProps); -} - -export default LinearGradient; diff --git a/types/react-native-linear-gradient/react-native-linear-gradient-tests.tsx b/types/react-native-linear-gradient/react-native-linear-gradient-tests.tsx deleted file mode 100644 index 00172818b1..0000000000 --- a/types/react-native-linear-gradient/react-native-linear-gradient-tests.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import * as React from 'react'; -import LinearGradient from 'react-native-linear-gradient'; -import { Text, StyleSheet } from 'react-native'; - -export default class MyLinearGradient extends React.Component { - render() { - return ( - - Sign in with Facebook - - ); - } -} - -const styles = StyleSheet.create({ - linearGradient: { - flex: 1, - paddingLeft: 15, - paddingRight: 15, - borderRadius: 5 - }, - buttonText: { - fontSize: 18, - textAlign: 'center', - margin: 10, - color: '#ffffff', - backgroundColor: 'transparent' - } -}); diff --git a/types/react-native-linear-gradient/tsconfig.json b/types/react-native-linear-gradient/tsconfig.json deleted file mode 100644 index 60d93ae024..0000000000 --- a/types/react-native-linear-gradient/tsconfig.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true, - "jsx": "react-native" - }, - "files": [ - "index.d.ts", - "react-native-linear-gradient-tests.tsx" - ] -} \ No newline at end of file diff --git a/types/react-native-linear-gradient/tslint.json b/types/react-native-linear-gradient/tslint.json deleted file mode 100644 index 3db14f85ea..0000000000 --- a/types/react-native-linear-gradient/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "dtslint/dt.json" } From 163ae93d8639e63033f6c7957ebf79f5e8f909bc Mon Sep 17 00:00:00 2001 From: Zev Spitz Date: Wed, 25 Apr 2018 03:38:01 +0300 Subject: [PATCH 098/564] MSOffice dependencies: activex-office, activex-msforms, activex-vbide, activex-stdole -- default properties; jsdoc fixes (#25256) * Fix activex-stdole * Reduce any * Default properties; fix jsDoc default values * Fix office tests * activex-office dtslint fix * activex-vbide: default properties; default values of optional parameters * activex-vbide: dtslint fixes * activex-msforms -- default properties; default parameter values in jsDoc * Reduce duplicate types * dtslint fix * activex-outlook version bump * activex-powerpoint Typescript version bump * activex-vbide Typescript version bump * post-DefinitelyTyped-build fixes * Fix Column and List setters * Fix for Excel tests --- types/activex-excel/activex-excel-tests.ts | 4 +- types/activex-msforms/index.d.ts | 2423 +----------------- types/activex-msforms/tslint.json | 3 +- types/activex-office/activex-office-tests.ts | 23 +- types/activex-office/index.d.ts | 1114 ++++---- types/activex-office/tslint.json | 3 +- types/activex-outlook/index.d.ts | 2 +- types/activex-powerpoint/index.d.ts | 2 +- types/activex-stdole/index.d.ts | 6 +- types/activex-vbide/activex-vbide-tests.ts | 22 +- types/activex-vbide/index.d.ts | 80 +- types/activex-vbide/tslint.json | 3 +- types/activex-word/index.d.ts | 2 +- 13 files changed, 787 insertions(+), 2900 deletions(-) diff --git a/types/activex-excel/activex-excel-tests.ts b/types/activex-excel/activex-excel-tests.ts index b93a924263..4e577300e5 100644 --- a/types/activex-excel/activex-excel-tests.ts +++ b/types/activex-excel/activex-excel-tests.ts @@ -279,7 +279,7 @@ const setColumnVisibility = (visible: boolean) => { const data = sheet.Range("L2", sheet.Range('L100').End(Excel.XlDirection.xlUp)).Value() as SafeArray; sheet.Range('L1', sheet.Range('L100').End(Excel.XlDirection.xlUp)).ClearContents(); - const combobox = sheet.OLEObjects('ComboBox1').Object as MSForms.ComboBox2; + const combobox = sheet.OLEObjects('ComboBox1').Object as MSForms.ComboBox; combobox.Clear(); ActiveXObject.set(combobox, 'List', [], data); combobox.ListIndex = -1; @@ -293,7 +293,7 @@ const setColumnVisibility = (visible: boolean) => { const dict = new ActiveXObject('Scripting.Dictionary'); arr.forEach(x => ActiveXObject.set(dict, 'Item', [x], true)); - const combobox = sheet.OLEObjects('ComboBox1').Object as MSForms.ComboBox2; + const combobox = sheet.OLEObjects('ComboBox1').Object as MSForms.ComboBox; combobox.Clear(); const enumerator = new Enumerator(dict.Items()); enumerator.moveFirst(); diff --git a/types/activex-msforms/index.d.ts b/types/activex-msforms/index.d.ts index 45acebbdb3..c896cc4bf5 100644 --- a/types/activex-msforms/index.d.ts +++ b/types/activex-msforms/index.d.ts @@ -2,7 +2,7 @@ // Project: https://msdn.microsoft.com/VBA/Language-Reference-VBA/articles/reference-microsoft-forms // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.6 /// @@ -361,48 +361,11 @@ declare namespace MSForms { WordWrap: boolean; } - class CheckBox2 { - private 'MSForms.CheckBox2_typekey': CheckBox2; - private constructor(); - readonly _Font_Reserved: NewFont; - Accelerator: string; - Alignment: fmAlignment; - AutoSize: boolean; - BackColor: number; - BackStyle: fmBackStyle; - BordersSuppress: boolean; - Caption: string; - readonly DisplayStyle: fmDisplayStyle; - Enabled: boolean; - Font: NewFont; - FontBold: boolean; - FontItalic: boolean; - FontName: string; - FontSize: number; - FontStrikethru: boolean; - FontUnderline: boolean; - FontWeight: number; - ForeColor: number; - GroupName: string; - Locked: boolean; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - MultiSelect: fmMultiSelect; - Picture: stdole.StdPicture; - PicturePosition: fmPicturePosition; - SpecialEffect: fmButtonEffect; - TextAlign: fmTextAlign; - TripleState: boolean; - readonly Valid: boolean; - Value: any; - WordWrap: boolean; - } - class ComboBox { private 'MSForms.ComboBox_typekey': ComboBox; private constructor(); readonly _Font_Reserved: NewFont; - AddItem(pvargItem?: any, pvargIndex?: any): void; + AddItem(pvargItem?: number, pvargIndex?: number): void; AutoSize: boolean; AutoTab: boolean; AutoWordSelect: boolean; @@ -411,10 +374,11 @@ declare namespace MSForms { BorderColor: number; BordersSuppress: boolean; BorderStyle: fmBorderStyle; - BoundColumn: any; + BoundColumn: number; readonly CanPaste: boolean; Clear(): void; - Column(pvargColumn?: any, pvargIndex?: any): any; + Column(pvargColumn: number, pvargIndex?: number): any; + Column(): SafeArray; ColumnCount: number; ColumnHeads: boolean; ColumnWidths: string; @@ -441,13 +405,14 @@ declare namespace MSForms { HideSelection: boolean; IMEMode: fmIMEMode; readonly LineCount: number; - List(pvargIndex?: any, pvargColumn?: any): any; + List(pvargIndex: number, pvargColumn?: number): any; + List(): SafeArray; readonly ListCount: number; ListCursor: any; - ListIndex: any; + ListIndex: number; ListRows: number; ListStyle: fmListStyle; - ListWidth: any; + ListWidth: number; Locked: boolean; MatchEntry: fmMatchEntry; readonly MatchFound: boolean; @@ -456,7 +421,7 @@ declare namespace MSForms { MouseIcon: stdole.StdPicture; MousePointer: fmMousePointer; Paste(): void; - RemoveItem(pvargIndex: any): void; + RemoveItem(pvargIndex: number): boolean; SelectionMargin: boolean; SelLength: number; SelStart: number; @@ -466,84 +431,9 @@ declare namespace MSForms { Style: fmStyle; Text: string; TextAlign: fmTextAlign; - TextColumn: any; + TextColumn: number; readonly TextLength: number; - TopIndex: any; - readonly Valid: boolean; - Value: any; - } - - class ComboBox2 { - private 'MSForms.ComboBox2_typekey': ComboBox2; - private constructor(); - readonly _Font_Reserved: NewFont; - AddItem(pvargItem?: any, pvargIndex?: any): void; - AutoSize: boolean; - AutoTab: boolean; - AutoWordSelect: boolean; - BackColor: number; - BackStyle: fmBackStyle; - BorderColor: number; - BordersSuppress: boolean; - BorderStyle: fmBorderStyle; - BoundColumn: any; - readonly CanPaste: boolean; - Clear(): void; - Column(pvargColumn?: any, pvargIndex?: any): any; - ColumnCount: number; - ColumnHeads: boolean; - ColumnWidths: string; - Copy(): void; - readonly CurTargetX: number; - readonly CurTargetY: number; - CurX: number; - Cut(): void; - readonly DisplayStyle: fmDisplayStyle; - DragBehavior: fmDragBehavior; - DropButtonStyle: fmDropButtonStyle; - DropDown(): void; - Enabled: boolean; - EnterFieldBehavior: fmEnterFieldBehavior; - Font: NewFont; - FontBold: boolean; - FontItalic: boolean; - FontName: string; - FontSize: number; - FontStrikethru: boolean; - FontUnderline: boolean; - FontWeight: number; - ForeColor: number; - HideSelection: boolean; - IMEMode: fmIMEMode; - readonly LineCount: number; - List(pvargIndex?: any, pvargColumn?: any): any; - readonly ListCount: number; - ListCursor: any; - ListIndex: any; - ListRows: number; - ListStyle: fmListStyle; - ListWidth: any; - Locked: boolean; - MatchEntry: fmMatchEntry; - readonly MatchFound: boolean; - MatchRequired: boolean; - MaxLength: number; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - Paste(): void; - RemoveItem(pvargIndex: any): void; - SelectionMargin: boolean; - SelLength: number; - SelStart: number; - SelText: string; - ShowDropButtonWhen: fmShowDropButtonWhen; - SpecialEffect: fmSpecialEffect; - Style: fmStyle; - Text: string; - TextAlign: fmTextAlign; - TextColumn: any; - readonly TextLength: number; - TopIndex: any; + TopIndex: number; readonly Valid: boolean; Value: any; } @@ -577,35 +467,6 @@ declare namespace MSForms { WordWrap: boolean; } - class CommandButton2 { - private 'MSForms.CommandButton2_typekey': CommandButton2; - private constructor(); - readonly _Font_Reserved: NewFont; - Accelerator: string; - AutoSize: boolean; - BackColor: number; - BackStyle: fmBackStyle; - Caption: string; - Enabled: boolean; - Font: NewFont; - FontBold: boolean; - FontItalic: boolean; - FontName: string; - FontSize: number; - FontStrikethru: boolean; - FontUnderline: boolean; - FontWeight: number; - ForeColor: number; - Locked: boolean; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - Picture: stdole.StdPicture; - PicturePosition: fmPicturePosition; - TakeFocusOnClick: boolean; - Value: boolean; - WordWrap: boolean; - } - class Control { private 'MSForms.Control_typekey': Control; private constructor(); @@ -656,9 +517,7 @@ declare namespace MSForms { ZOrder(zPosition?: any): void; } - class Controls { - private 'MSForms.Controls_typekey': Controls; - private constructor(); + interface Controls { _AddByClass(clsid: number): Control; _GetItemByID(ID: number): Control; _GetItemByIndex(lIndex: number): Control; @@ -679,6 +538,7 @@ declare namespace MSForms { SelectAll(): void; SendBackward(): void; SendToBack(): void; + (varg: any): any; } class DataObject { @@ -693,18 +553,6 @@ declare namespace MSForms { StartDrag(OKEffect?: any): fmDropEffect; } - class DataObject2 { - private 'MSForms.DataObject2_typekey': DataObject2; - private constructor(); - Clear(): void; - GetFormat(Format: any): boolean; - GetFromClipboard(): void; - GetText(Format?: any): string; - PutInClipboard(): void; - SetText(Text: string, Format?: any): void; - StartDrag(OKEffect?: any): fmDropEffect; - } - class Frame { private 'MSForms.Frame_typekey': Frame; private constructor(); @@ -770,71 +618,6 @@ declare namespace MSForms { Zoom: number; } - class Frame2 { - private 'MSForms.Frame2_typekey': Frame2; - private constructor(); - readonly _Font_Reserved: NewFont; - _GetGridX(GridX: number): void; - _GetGridY(GridY: number): void; - _GetInsideHeight(InsideHeight: number): void; - _GetInsideWidth(InsideWidth: number): void; - _GetScrollHeight(ScrollHeight: number): void; - _GetScrollLeft(ScrollLeft: number): void; - _GetScrollTop(ScrollTop: number): void; - _GetScrollWidth(ScrollWidth: number): void; - _SetGridX(GridX: number): void; - _SetGridY(GridY: number): void; - _SetScrollHeight(ScrollHeight: number): void; - _SetScrollLeft(ScrollLeft: number): void; - _SetScrollTop(ScrollTop: number): void; - _SetScrollWidth(ScrollWidth: number): void; - readonly ActiveControl: Control; - BackColor: number; - BorderColor: number; - BorderStyle: fmBorderStyle; - readonly CanPaste: boolean; - readonly CanRedo: boolean; - readonly CanUndo: boolean; - Caption: string; - readonly Controls: Controls; - Copy(): void; - Cut(): void; - Cycle: fmCycle; - DesignMode: fmMode; - Enabled: boolean; - Font: NewFont; - ForeColor: number; - GridX: number; - GridY: number; - readonly InsideHeight: number; - readonly InsideWidth: number; - KeepScrollBarsVisible: fmScrollBars; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - Paste(): void; - Picture: stdole.StdPicture; - PictureAlignment: fmPictureAlignment; - PictureSizeMode: fmPictureSizeMode; - PictureTiling: boolean; - RedoAction(): void; - Repaint(): void; - Scroll(xAction?: any, yAction?: any): void; - ScrollBars: fmScrollBars; - ScrollHeight: number; - ScrollLeft: number; - ScrollTop: number; - ScrollWidth: number; - readonly Selected: Controls; - SetDefaultTabOrder(): void; - ShowGridDots: fmMode; - ShowToolbox: fmMode; - SnapToGrid: fmMode; - SpecialEffect: fmSpecialEffect; - UndoAction(): void; - VerticalScrollBarSide: fmVerticalScrollBarSide; - Zoom: number; - } - class HTMLCheckbox { private 'MSForms.HTMLCheckbox_typekey': HTMLCheckbox; private constructor(); @@ -844,15 +627,6 @@ declare namespace MSForms { Value: string; } - class HTMLCheckbox2 { - private 'MSForms.HTMLCheckbox2_typekey': HTMLCheckbox2; - private constructor(); - Checked: boolean; - HTMLName: string; - HTMLType: string; - Value: string; - } - class HTMLHidden { private 'MSForms.HTMLHidden_typekey': HTMLHidden; private constructor(); @@ -861,14 +635,6 @@ declare namespace MSForms { Value: string; } - class HTMLHidden2 { - private 'MSForms.HTMLHidden2_typekey': HTMLHidden2; - private constructor(); - HTMLName: string; - HTMLType: string; - Value: string; - } - class HTMLImage { private 'MSForms.HTMLImage_typekey': HTMLImage; private constructor(); @@ -880,17 +646,6 @@ declare namespace MSForms { Source: string; } - class HTMLImage2 { - private 'MSForms.HTMLImage2_typekey': HTMLImage2; - private constructor(); - Action: string; - Encoding: string; - HTMLName: string; - HTMLType: string; - Method: string; - Source: string; - } - class HTMLOption { private 'MSForms.HTMLOption_typekey': HTMLOption; private constructor(); @@ -901,16 +656,6 @@ declare namespace MSForms { Value: string; } - class HTMLOption2 { - private 'MSForms.HTMLOption2_typekey': HTMLOption2; - private constructor(); - Checked: boolean; - readonly DisplayStyle: fmDisplayStyle; - HTMLName: string; - HTMLType: string; - Value: string; - } - class HTMLPassword { private 'MSForms.HTMLPassword_typekey': HTMLPassword; private constructor(); @@ -921,16 +666,6 @@ declare namespace MSForms { Width: number; } - class HTMLPassword2 { - private 'MSForms.HTMLPassword2_typekey': HTMLPassword2; - private constructor(); - HTMLName: string; - HTMLType: string; - MaxLength: number; - Value: string; - Width: number; - } - class HTMLReset { private 'MSForms.HTMLReset_typekey': HTMLReset; private constructor(); @@ -939,14 +674,6 @@ declare namespace MSForms { HTMLType: string; } - class HTMLReset2 { - private 'MSForms.HTMLReset2_typekey': HTMLReset2; - private constructor(); - Caption: string; - HTMLName: string; - HTMLType: string; - } - class HTMLSelect { private 'MSForms.HTMLSelect_typekey': HTMLSelect; private constructor(); @@ -958,17 +685,6 @@ declare namespace MSForms { Values: any; } - class HTMLSelect2 { - private 'MSForms.HTMLSelect2_typekey': HTMLSelect2; - private constructor(); - DisplayValues: any; - HTMLName: string; - MultiSelect: boolean; - Selected: string; - Size: number; - Values: any; - } - class HTMLSubmit { private 'MSForms.HTMLSubmit_typekey': HTMLSubmit; private constructor(); @@ -980,17 +696,6 @@ declare namespace MSForms { Method: string; } - class HTMLSubmit2 { - private 'MSForms.HTMLSubmit2_typekey': HTMLSubmit2; - private constructor(); - Action: string; - Caption: string; - Encoding: string; - HTMLName: string; - HTMLType: string; - Method: string; - } - class HTMLText { private 'MSForms.HTMLText_typekey': HTMLText; private constructor(); @@ -1001,16 +706,6 @@ declare namespace MSForms { Width: number; } - class HTMLText2 { - private 'MSForms.HTMLText2_typekey': HTMLText2; - private constructor(); - HTMLName: string; - HTMLType: string; - MaxLength: number; - Value: string; - Width: number; - } - class HTMLTextArea { private 'MSForms.HTMLTextArea_typekey': HTMLTextArea; private constructor(); @@ -1021,16 +716,6 @@ declare namespace MSForms { WordWrap: string; } - class HTMLTextArea2 { - private 'MSForms.HTMLTextArea2_typekey': HTMLTextArea2; - private constructor(); - Columns: number; - HTMLName: string; - Rows: number; - Value: string; - WordWrap: string; - } - class Image { private 'MSForms.Image_typekey': Image; private constructor(); @@ -1049,24 +734,6 @@ declare namespace MSForms { SpecialEffect: fmSpecialEffect; } - class Image2 { - private 'MSForms.Image2_typekey': Image2; - private constructor(); - AutoSize: boolean; - BackColor: number; - BackStyle: fmBackStyle; - BorderColor: number; - BorderStyle: fmBorderStyle; - Enabled: boolean; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - Picture: stdole.StdPicture; - PictureAlignment: fmPictureAlignment; - PictureSizeMode: fmPictureSizeMode; - PictureTiling: boolean; - SpecialEffect: fmSpecialEffect; - } - class Label { private 'MSForms.Label_typekey': Label; private constructor(); @@ -1098,37 +765,6 @@ declare namespace MSForms { WordWrap: boolean; } - class Label2 { - private 'MSForms.Label2_typekey': Label2; - private constructor(); - readonly _Font_Reserved: NewFont; - _Value: string; - Accelerator: string; - AutoSize: boolean; - BackColor: number; - BackStyle: fmBackStyle; - BorderColor: number; - BorderStyle: fmBorderStyle; - Caption: string; - Enabled: boolean; - Font: NewFont; - FontBold: boolean; - FontItalic: boolean; - FontName: string; - FontSize: number; - FontStrikethru: boolean; - FontUnderline: boolean; - FontWeight: number; - ForeColor: number; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - Picture: stdole.StdPicture; - PicturePosition: fmPicturePosition; - SpecialEffect: fmSpecialEffect; - TextAlign: fmTextAlign; - WordWrap: boolean; - } - class ListBox { private 'MSForms.ListBox_typekey': ListBox; private constructor(); @@ -1140,7 +776,8 @@ declare namespace MSForms { BorderStyle: fmBorderStyle; BoundColumn: any; Clear(): void; - Column(pvargColumn?: any, pvargIndex?: any): any; + Column(pvargColumn: number, pvargIndex?: number): any; + Column(): SafeArray; ColumnCount: number; ColumnHeads: boolean; ColumnWidths: string; @@ -1157,57 +794,8 @@ declare namespace MSForms { ForeColor: number; IMEMode: fmIMEMode; IntegralHeight: boolean; - List(pvargIndex?: any, pvargColumn?: any): any; - readonly ListCount: number; - ListCursor: any; - ListIndex: any; - ListStyle: fmListStyle; - ListWidth: any; - Locked: boolean; - MatchEntry: fmMatchEntry; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - MultiSelect: fmMultiSelect; - RemoveItem(pvargIndex: any): void; - Selected(pvargIndex: any): boolean; - SpecialEffect: fmSpecialEffect; - Text: string; - TextAlign: fmTextAlign; - TextColumn: any; - TopIndex: any; - readonly Valid: boolean; - Value: any; - } - - class ListBox2 { - private 'MSForms.ListBox2_typekey': ListBox2; - private constructor(); - readonly _Font_Reserved: NewFont; - AddItem(pvargItem?: any, pvargIndex?: any): void; - BackColor: number; - BorderColor: number; - BordersSuppress: boolean; - BorderStyle: fmBorderStyle; - BoundColumn: any; - Clear(): void; - Column(pvargColumn?: any, pvargIndex?: any): any; - ColumnCount: number; - ColumnHeads: boolean; - ColumnWidths: string; - readonly DisplayStyle: fmDisplayStyle; - Enabled: boolean; - Font: NewFont; - FontBold: boolean; - FontItalic: boolean; - FontName: string; - FontSize: number; - FontStrikethru: boolean; - FontUnderline: boolean; - FontWeight: number; - ForeColor: number; - IMEMode: fmIMEMode; - IntegralHeight: boolean; - List(pvargIndex?: any, pvargColumn?: any): any; + List(pvargIndex: number, pvargColumn?: number): any; + List(): SafeArray; readonly ListCount: number; ListCursor: any; ListIndex: any; @@ -1258,35 +846,6 @@ declare namespace MSForms { Value: number; } - class MultiPage2 { - private 'MSForms.MultiPage2_typekey': MultiPage2; - private constructor(); - readonly _Font_Reserved: NewFont; - _GetTabFixedHeight(Height: number): void; - _GetTabFixedWidth(Width: number): void; - _SetTabFixedHeight(Height: number): void; - _SetTabFixedWidth(Width: number): void; - BackColor: number; - Enabled: boolean; - Font: NewFont; - FontBold: boolean; - FontItalic: boolean; - FontName: string; - FontSize: number; - FontStrikethru: boolean; - FontUnderline: boolean; - FontWeight: number; - ForeColor: number; - MultiRow: boolean; - readonly Pages: Pages; - readonly SelectedItem: Page; - Style: fmTabStyle; - TabFixedHeight: number; - TabFixedWidth: number; - TabOrientation: fmTabOrientation; - Value: number; - } - class NewFont { private 'MSForms.NewFont_typekey': NewFont; private constructor(); @@ -1337,43 +896,6 @@ declare namespace MSForms { WordWrap: boolean; } - class OptionButton2 { - private 'MSForms.OptionButton2_typekey': OptionButton2; - private constructor(); - readonly _Font_Reserved: NewFont; - Accelerator: string; - Alignment: fmAlignment; - AutoSize: boolean; - BackColor: number; - BackStyle: fmBackStyle; - BordersSuppress: boolean; - Caption: string; - readonly DisplayStyle: fmDisplayStyle; - Enabled: boolean; - Font: NewFont; - FontBold: boolean; - FontItalic: boolean; - FontName: string; - FontSize: number; - FontStrikethru: boolean; - FontUnderline: boolean; - FontWeight: number; - ForeColor: number; - GroupName: string; - Locked: boolean; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - MultiSelect: fmMultiSelect; - Picture: stdole.StdPicture; - PicturePosition: fmPicturePosition; - SpecialEffect: fmButtonEffect; - TextAlign: fmTextAlign; - TripleState: boolean; - readonly Valid: boolean; - Value: any; - WordWrap: boolean; - } - class Page { private 'MSForms.Page_typekey': Page; private constructor(); @@ -1439,9 +961,7 @@ declare namespace MSForms { Zoom: number; } - class Pages { - private 'MSForms.Pages_typekey': Pages; - private constructor(); + interface Pages { _AddCtrl(clsid: number, bstrName: string, bstrCaption: string): Page; _GetItemByIndex(lIndex: number): Control; _GetItemByName(pstrName: string): Control; @@ -1452,6 +972,7 @@ declare namespace MSForms { Enum(): any; Item(varg: any): any; Remove(varg: any): void; + (varg: any): any; } class ReturnBoolean { @@ -1502,24 +1023,6 @@ declare namespace MSForms { Value: number; } - class ScrollBar2 { - private 'MSForms.ScrollBar2_typekey': ScrollBar2; - private constructor(); - BackColor: number; - Delay: number; - Enabled: boolean; - ForeColor: number; - LargeChange: number; - Max: number; - Min: number; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - Orientation: fmOrientation; - ProportionalThumb: boolean; - SmallChange: number; - Value: number; - } - class SpinButton { private 'MSForms.SpinButton_typekey': SpinButton; private constructor(); @@ -1536,22 +1039,6 @@ declare namespace MSForms { Value: number; } - class SpinButton2 { - private 'MSForms.SpinButton2_typekey': SpinButton2; - private constructor(); - BackColor: number; - Delay: number; - Enabled: boolean; - ForeColor: number; - Max: number; - Min: number; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - Orientation: fmOrientation; - SmallChange: number; - Value: number; - } - class Tab { private 'MSForms.Tab_typekey': Tab; private constructor(); @@ -1565,9 +1052,7 @@ declare namespace MSForms { Visible: boolean; } - class Tabs { - private 'MSForms.Tabs_typekey': Tabs; - private constructor(); + interface Tabs { _Add(bstrName: string, bstrCaption: string): Tab; _GetItemByIndex(lIndex: number): Tab; _GetItemByName(bstr: string): Tab; @@ -1578,6 +1063,7 @@ declare namespace MSForms { Enum(): any; Item(varg: any): any; Remove(varg: any): void; + (varg: any): any; } class TabStrip { @@ -1619,45 +1105,6 @@ declare namespace MSForms { Value: number; } - class TabStrip2 { - private 'MSForms.TabStrip2_typekey': TabStrip2; - private constructor(); - readonly _Font_Reserved: NewFont; - _GetClientHeight(ClientHeight: number): void; - _GetClientLeft(ClientLeft: number): void; - _GetClientTop(ClientTop: number): void; - _GetClientWidth(ClientWidth: number): void; - _GetTabFixedHeight(TabFixedHeight: number): void; - _GetTabFixedWidth(TabFixedWidth: number): void; - _SetTabFixedHeight(TabFixedHeight: number): void; - _SetTabFixedWidth(TabFixedWidth: number): void; - BackColor: number; - readonly ClientHeight: number; - readonly ClientLeft: number; - readonly ClientTop: number; - readonly ClientWidth: number; - Enabled: boolean; - Font: NewFont; - FontBold: boolean; - FontItalic: boolean; - FontName: string; - FontSize: number; - FontStrikethru: boolean; - FontUnderline: boolean; - FontWeight: number; - ForeColor: number; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - MultiRow: boolean; - readonly SelectedItem: Tab; - Style: fmTabStyle; - TabFixedHeight: number; - TabFixedWidth: number; - TabOrientation: fmTabOrientation; - readonly Tabs: Tabs; - Value: number; - } - class TextBox { private 'MSForms.TextBox_typekey': TextBox; private constructor(); @@ -1720,68 +1167,6 @@ declare namespace MSForms { WordWrap: boolean; } - class TextBox2 { - private 'MSForms.TextBox2_typekey': TextBox2; - private constructor(); - readonly _Font_Reserved: NewFont; - AutoSize: boolean; - AutoTab: boolean; - AutoWordSelect: boolean; - BackColor: number; - BackStyle: fmBackStyle; - BorderColor: number; - BordersSuppress: boolean; - BorderStyle: fmBorderStyle; - readonly CanPaste: boolean; - Copy(): void; - CurLine: number; - readonly CurTargetX: number; - readonly CurTargetY: number; - CurX: number; - CurY: number; - Cut(): void; - readonly DisplayStyle: fmDisplayStyle; - DragBehavior: fmDragBehavior; - DropButtonStyle: fmDropButtonStyle; - Enabled: boolean; - EnterFieldBehavior: fmEnterFieldBehavior; - EnterKeyBehavior: boolean; - Font: NewFont; - FontBold: boolean; - FontItalic: boolean; - FontName: string; - FontSize: number; - FontStrikethru: boolean; - FontUnderline: boolean; - FontWeight: number; - ForeColor: number; - HideSelection: boolean; - IMEMode: fmIMEMode; - IntegralHeight: boolean; - readonly LineCount: number; - Locked: boolean; - MaxLength: number; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - MultiLine: boolean; - PasswordChar: string; - Paste(): void; - ScrollBars: fmScrollBars; - SelectionMargin: boolean; - SelLength: number; - SelStart: number; - SelText: string; - ShowDropButtonWhen: fmShowDropButtonWhen; - SpecialEffect: fmSpecialEffect; - TabKeyBehavior: boolean; - Text: string; - TextAlign: fmTextAlign; - readonly TextLength: number; - readonly Valid: boolean; - Value: any; - WordWrap: boolean; - } - class ToggleButton { private 'MSForms.ToggleButton_typekey': ToggleButton; private constructor(); @@ -1819,43 +1204,6 @@ declare namespace MSForms { WordWrap: boolean; } - class ToggleButton2 { - private 'MSForms.ToggleButton2_typekey': ToggleButton2; - private constructor(); - readonly _Font_Reserved: NewFont; - Accelerator: string; - Alignment: fmAlignment; - AutoSize: boolean; - BackColor: number; - BackStyle: fmBackStyle; - BordersSuppress: boolean; - Caption: string; - readonly DisplayStyle: fmDisplayStyle; - Enabled: boolean; - Font: NewFont; - FontBold: boolean; - FontItalic: boolean; - FontName: string; - FontSize: number; - FontStrikethru: boolean; - FontUnderline: boolean; - FontWeight: number; - ForeColor: number; - GroupName: string; - Locked: boolean; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - MultiSelect: fmMultiSelect; - Picture: stdole.StdPicture; - PicturePosition: fmPicturePosition; - SpecialEffect: fmButtonEffect; - TextAlign: fmTextAlign; - TripleState: boolean; - readonly Valid: boolean; - Value: any; - WordWrap: boolean; - } - class UserForm { private 'MSForms.UserForm_typekey': UserForm; private constructor(); @@ -1922,160 +1270,18 @@ declare namespace MSForms { Zoom: number; } - class UserForm2 { - private 'MSForms.UserForm2_typekey': UserForm2; - private constructor(); - readonly _Font_Reserved: NewFont; - _GetGridX(GridX: number): void; - _GetGridY(GridY: number): void; - _GetInsideHeight(InsideHeight: number): void; - _GetInsideWidth(InsideWidth: number): void; - _GetScrollHeight(ScrollHeight: number): void; - _GetScrollLeft(ScrollLeft: number): void; - _GetScrollTop(ScrollTop: number): void; - _GetScrollWidth(ScrollWidth: number): void; - _SetGridX(GridX: number): void; - _SetGridY(GridY: number): void; - _SetScrollHeight(ScrollHeight: number): void; - _SetScrollLeft(ScrollLeft: number): void; - _SetScrollTop(ScrollTop: number): void; - _SetScrollWidth(ScrollWidth: number): void; - readonly ActiveControl: Control; - BackColor: number; - BorderColor: number; - BorderStyle: fmBorderStyle; - readonly CanPaste: boolean; - readonly CanRedo: boolean; - readonly CanUndo: boolean; - Caption: string; - readonly Controls: Controls; - Copy(): void; - Cut(): void; - Cycle: fmCycle; - DesignMode: fmMode; - DrawBuffer: number; - Enabled: boolean; - Font: NewFont; - ForeColor: number; - GridX: number; - GridY: number; - readonly InsideHeight: number; - readonly InsideWidth: number; - KeepScrollBarsVisible: fmScrollBars; - MouseIcon: stdole.StdPicture; - MousePointer: fmMousePointer; - Paste(): void; - Picture: stdole.StdPicture; - PictureAlignment: fmPictureAlignment; - PictureSizeMode: fmPictureSizeMode; - PictureTiling: boolean; - RedoAction(): void; - Repaint(): void; - Scroll(xAction?: any, yAction?: any): void; - ScrollBars: fmScrollBars; - ScrollHeight: number; - ScrollLeft: number; - ScrollTop: number; - ScrollWidth: number; - readonly Selected: Controls; - SetDefaultTabOrder(): void; - ShowGridDots: fmMode; - ShowToolbox: fmMode; - SnapToGrid: fmMode; - SpecialEffect: fmSpecialEffect; - UndoAction(): void; - VerticalScrollBarSide: fmVerticalScrollBarSide; - Zoom: number; - } - namespace EventHelperTypes { - type CheckBox_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; + type Container_BeforeDragOver_ArgNames = ['Cancel', 'Control', 'Data', 'X', 'Y', 'State', 'Effect', 'Shift']; - type CheckBox_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; + type Container_BeforeDropOrPaste_ArgNames = ['Cancel', 'Control', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - type CheckBox_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; + type Container_Scroll_ArgNames = ['ActionX', 'ActionY', 'RequestDx', 'RequestDy', 'ActualDx', 'ActualDy']; - type CheckBox2_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; + type Control_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - type CheckBox2_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; + type Control_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - type CheckBox2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type ComboBox_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type ComboBox_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type ComboBox_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type ComboBox2_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type ComboBox2_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type ComboBox2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type CommandButton_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type CommandButton_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type CommandButton_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type CommandButton2_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type CommandButton2_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type CommandButton2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type Frame_BeforeDragOver_ArgNames = ['Cancel', 'Control', 'Data', 'X', 'Y', 'State', 'Effect', 'Shift']; - - type Frame_BeforeDropOrPaste_ArgNames = ['Cancel', 'Control', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type Frame_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type Frame_Scroll_ArgNames = ['ActionX', 'ActionY', 'RequestDx', 'RequestDy', 'ActualDx', 'ActualDy']; - - type Frame2_BeforeDragOver_ArgNames = ['Cancel', 'Control', 'Data', 'X', 'Y', 'State', 'Effect', 'Shift']; - - type Frame2_BeforeDropOrPaste_ArgNames = ['Cancel', 'Control', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type Frame2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type Frame2_Scroll_ArgNames = ['ActionX', 'ActionY', 'RequestDx', 'RequestDy', 'ActualDx', 'ActualDy']; - - type Image_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type Image_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type Image_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type Image2_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type Image2_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type Image2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type Label_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type Label_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type Label_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type Label2_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type Label2_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type Label2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type ListBox_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type ListBox_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type ListBox_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type ListBox2_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type ListBox2_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type ListBox2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; + type Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; type MultiPage_BeforeDragOver_ArgNames = ['Index', 'Cancel', 'Control', 'Data', 'X', 'Y', 'State', 'Effect', 'Shift']; @@ -2085,283 +1291,11 @@ declare namespace MSForms { type MultiPage_Scroll_ArgNames = ['Index', 'ActionX', 'ActionY', 'RequestDx', 'RequestDy', 'ActualDx', 'ActualDy']; - type MultiPage2_BeforeDragOver_ArgNames = ['Index', 'Cancel', 'Control', 'Data', 'X', 'Y', 'State', 'Effect', 'Shift']; - - type MultiPage2_BeforeDropOrPaste_ArgNames = ['Index', 'Cancel', 'Control', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type MultiPage2_Error_ArgNames = ['Index', 'Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type MultiPage2_Scroll_ArgNames = ['Index', 'ActionX', 'ActionY', 'RequestDx', 'RequestDy', 'ActualDx', 'ActualDy']; - - type OptionButton_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type OptionButton_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type OptionButton_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type OptionButton2_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type OptionButton2_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type OptionButton2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type ScrollBar_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type ScrollBar_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type ScrollBar_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type ScrollBar2_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type ScrollBar2_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type ScrollBar2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type SpinButton_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type SpinButton_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type SpinButton_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type SpinButton2_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type SpinButton2_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type SpinButton2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - type TabStrip_BeforeDragOver_ArgNames = ['Index', 'Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; type TabStrip_BeforeDropOrPaste_ArgNames = ['Index', 'Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - type TabStrip_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type TabStrip2_BeforeDragOver_ArgNames = ['Index', 'Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type TabStrip2_BeforeDropOrPaste_ArgNames = ['Index', 'Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type TabStrip2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type TextBox_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type TextBox_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type TextBox_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type TextBox2_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type TextBox2_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type TextBox2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type ToggleButton_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type ToggleButton_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type ToggleButton_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type ToggleButton2_BeforeDragOver_ArgNames = ['Cancel', 'Data', 'X', 'Y', 'DragState', 'Effect', 'Shift']; - - type ToggleButton2_BeforeDropOrPaste_ArgNames = ['Cancel', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type ToggleButton2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type UserForm_BeforeDragOver_ArgNames = ['Cancel', 'Control', 'Data', 'X', 'Y', 'State', 'Effect', 'Shift']; - - type UserForm_BeforeDropOrPaste_ArgNames = ['Cancel', 'Control', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type UserForm_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type UserForm_Scroll_ArgNames = ['ActionX', 'ActionY', 'RequestDx', 'RequestDy', 'ActualDx', 'ActualDy']; - - type UserForm2_BeforeDragOver_ArgNames = ['Cancel', 'Control', 'Data', 'X', 'Y', 'State', 'Effect', 'Shift']; - - type UserForm2_BeforeDropOrPaste_ArgNames = ['Cancel', 'Control', 'Action', 'Data', 'X', 'Y', 'Effect', 'Shift']; - - type UserForm2_Error_ArgNames = ['Number', 'Description', 'SCode', 'Source', 'HelpFile', 'HelpContext', 'CancelDisplay']; - - type UserForm2_Scroll_ArgNames = ['ActionX', 'ActionY', 'RequestDx', 'RequestDy', 'ActualDx', 'ActualDy']; - - interface CheckBox_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface CheckBox_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface CheckBox_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface CheckBox2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface CheckBox2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface CheckBox2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface ComboBox_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ComboBox_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ComboBox_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface ComboBox2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ComboBox2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ComboBox2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface CommandButton_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface CommandButton_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface CommandButton_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface CommandButton2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface CommandButton2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface CommandButton2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface Frame_BeforeDragOver_Parameter { + interface Container_BeforeDragOver_Parameter { readonly Cancel: ReturnBoolean; readonly Control: Control; readonly Data: DataObject; @@ -2372,7 +1306,7 @@ declare namespace MSForms { readonly Y: number; } - interface Frame_BeforeDropOrPaste_Parameter { + interface Container_BeforeDropOrPaste_Parameter { readonly Action: fmAction; readonly Cancel: ReturnBoolean; readonly Control: Control; @@ -2383,17 +1317,7 @@ declare namespace MSForms { readonly Y: number; } - interface Frame_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface Frame_Scroll_Parameter { + interface Container_Scroll_Parameter { readonly ActionX: fmScrollAction; readonly ActionY: fmScrollAction; readonly ActualDx: ReturnSingle; @@ -2402,48 +1326,7 @@ declare namespace MSForms { readonly RequestDy: number; } - interface Frame2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Control: Control; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly State: fmDragState; - readonly X: number; - readonly Y: number; - } - - interface Frame2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Control: Control; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface Frame2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface Frame2_Scroll_Parameter { - readonly ActionX: fmScrollAction; - readonly ActionY: fmScrollAction; - readonly ActualDx: ReturnSingle; - readonly ActualDy: ReturnSingle; - readonly RequestDx: number; - readonly RequestDy: number; - } - - interface Image_BeforeDragOver_Parameter { + interface Control_BeforeDragOver_Parameter { readonly Cancel: ReturnBoolean; readonly Data: DataObject; readonly DragState: fmDragState; @@ -2453,7 +1336,7 @@ declare namespace MSForms { readonly Y: number; } - interface Image_BeforeDropOrPaste_Parameter { + interface Control_BeforeDropOrPaste_Parameter { readonly Action: fmAction; readonly Cancel: ReturnBoolean; readonly Data: DataObject; @@ -2463,157 +1346,7 @@ declare namespace MSForms { readonly Y: number; } - interface Image_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface Image2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface Image2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface Image2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface Label_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface Label_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface Label_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface Label2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface Label2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface Label2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface ListBox_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ListBox_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ListBox_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface ListBox2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ListBox2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ListBox2_Error_Parameter { + interface Error_Parameter { readonly CancelDisplay: ReturnBoolean; readonly Description: ReturnString; readonly HelpContext: number; @@ -2668,231 +1401,6 @@ declare namespace MSForms { readonly RequestDy: number; } - interface MultiPage2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Control: Control; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Index: number; - readonly Shift: number; - readonly State: fmDragState; - readonly X: number; - readonly Y: number; - } - - interface MultiPage2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Control: Control; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Index: number; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface MultiPage2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Index: number; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface MultiPage2_Scroll_Parameter { - readonly ActionX: fmScrollAction; - readonly ActionY: fmScrollAction; - readonly ActualDx: ReturnSingle; - readonly ActualDy: ReturnSingle; - readonly Index: number; - readonly RequestDx: number; - readonly RequestDy: number; - } - - interface OptionButton_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface OptionButton_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface OptionButton_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface OptionButton2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface OptionButton2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface OptionButton2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface ScrollBar_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ScrollBar_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ScrollBar_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface ScrollBar2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ScrollBar2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ScrollBar2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface SpinButton_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface SpinButton_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface SpinButton_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface SpinButton2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface SpinButton2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface SpinButton2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - interface TabStrip_BeforeDragOver_Parameter { readonly Cancel: ReturnBoolean; readonly Data: DataObject; @@ -2914,844 +1422,151 @@ declare namespace MSForms { readonly X: number; readonly Y: number; } - - interface TabStrip_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface TabStrip2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Index: number; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface TabStrip2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Index: number; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface TabStrip2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface TextBox_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface TextBox_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface TextBox_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface TextBox2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface TextBox2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface TextBox2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface ToggleButton_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ToggleButton_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ToggleButton_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface ToggleButton2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly DragState: fmDragState; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ToggleButton2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface ToggleButton2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface UserForm_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Control: Control; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly State: fmDragState; - readonly X: number; - readonly Y: number; - } - - interface UserForm_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Control: Control; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface UserForm_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface UserForm_Scroll_Parameter { - readonly ActionX: fmScrollAction; - readonly ActionY: fmScrollAction; - readonly ActualDx: ReturnSingle; - readonly ActualDy: ReturnSingle; - readonly RequestDx: number; - readonly RequestDy: number; - } - - interface UserForm2_BeforeDragOver_Parameter { - readonly Cancel: ReturnBoolean; - readonly Control: Control; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly State: fmDragState; - readonly X: number; - readonly Y: number; - } - - interface UserForm2_BeforeDropOrPaste_Parameter { - readonly Action: fmAction; - readonly Cancel: ReturnBoolean; - readonly Control: Control; - readonly Data: DataObject; - readonly Effect: ReturnEffect; - readonly Shift: number; - readonly X: number; - readonly Y: number; - } - - interface UserForm2_Error_Parameter { - readonly CancelDisplay: ReturnBoolean; - readonly Description: ReturnString; - readonly HelpContext: number; - readonly HelpFile: string; - readonly Number: number; - readonly SCode: number; - readonly Source: string; - } - - interface UserForm2_Scroll_Parameter { - readonly ActionX: fmScrollAction; - readonly ActionY: fmScrollAction; - readonly ActualDx: ReturnSingle; - readonly ActualDy: ReturnSingle; - readonly RequestDx: number; - readonly RequestDy: number; - } } } interface ActiveXObject { - on( - obj: MSForms.CheckBox, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.CheckBox_BeforeDragOver_ArgNames, handler: ( - this: MSForms.CheckBox, parameter: MSForms.EventHelperTypes.CheckBox_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.CheckBox, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.CheckBox_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.CheckBox, parameter: MSForms.EventHelperTypes.CheckBox_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.CheckBox, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Control_BeforeDragOver_ArgNames, handler: (this: MSForms.CheckBox, parameter: MSForms.EventHelperTypes.Control_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.CheckBox, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.CheckBox, parameter: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_Parameter) => void): void; on(obj: MSForms.CheckBox, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.CheckBox, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.CheckBox, event: 'Error', argNames: MSForms.EventHelperTypes.CheckBox_Error_ArgNames, handler: ( - this: MSForms.CheckBox, parameter: MSForms.EventHelperTypes.CheckBox_Error_Parameter) => void): void; - on( - obj: MSForms.CheckBox, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.CheckBox, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; + on(obj: MSForms.CheckBox, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.CheckBox, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.CheckBox, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: MSForms.CheckBox, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; on(obj: MSForms.CheckBox, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.CheckBox, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.CheckBox, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.CheckBox, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.CheckBox2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.CheckBox2_BeforeDragOver_ArgNames, handler: ( - this: MSForms.CheckBox2, parameter: MSForms.EventHelperTypes.CheckBox2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.CheckBox2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.CheckBox2_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.CheckBox2, parameter: MSForms.EventHelperTypes.CheckBox2_BeforeDropOrPaste_Parameter) => void): void; - on(obj: MSForms.CheckBox2, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.CheckBox2, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.CheckBox2, event: 'Error', argNames: MSForms.EventHelperTypes.CheckBox2_Error_ArgNames, handler: ( - this: MSForms.CheckBox2, parameter: MSForms.EventHelperTypes.CheckBox2_Error_Parameter) => void): void; - on( - obj: MSForms.CheckBox2, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.CheckBox2, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.CheckBox2, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.CheckBox2, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.CheckBox2, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.CheckBox2, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.ComboBox, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.ComboBox_BeforeDragOver_ArgNames, handler: ( - this: MSForms.ComboBox, parameter: MSForms.EventHelperTypes.ComboBox_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.ComboBox, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.ComboBox_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.ComboBox, parameter: MSForms.EventHelperTypes.ComboBox_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.CheckBox, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: MSForms.CheckBox, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; + on(obj: MSForms.ComboBox, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Control_BeforeDragOver_ArgNames, handler: (this: MSForms.ComboBox, parameter: MSForms.EventHelperTypes.Control_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.ComboBox, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.ComboBox, parameter: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_Parameter) => void): void; on(obj: MSForms.ComboBox, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.ComboBox, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.ComboBox, event: 'Error', argNames: MSForms.EventHelperTypes.ComboBox_Error_ArgNames, handler: ( - this: MSForms.ComboBox, parameter: MSForms.EventHelperTypes.ComboBox_Error_Parameter) => void): void; - on( - obj: MSForms.ComboBox, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.ComboBox, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; + on(obj: MSForms.ComboBox, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.ComboBox, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.ComboBox, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: MSForms.ComboBox, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; on(obj: MSForms.ComboBox, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.ComboBox, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.ComboBox, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.ComboBox, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.ComboBox2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.ComboBox2_BeforeDragOver_ArgNames, handler: ( - this: MSForms.ComboBox2, parameter: MSForms.EventHelperTypes.ComboBox2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.ComboBox2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.ComboBox2_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.ComboBox2, parameter: MSForms.EventHelperTypes.ComboBox2_BeforeDropOrPaste_Parameter) => void): void; - on(obj: MSForms.ComboBox2, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.ComboBox2, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.ComboBox2, event: 'Error', argNames: MSForms.EventHelperTypes.ComboBox2_Error_ArgNames, handler: ( - this: MSForms.ComboBox2, parameter: MSForms.EventHelperTypes.ComboBox2_Error_Parameter) => void): void; - on( - obj: MSForms.ComboBox2, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.ComboBox2, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.ComboBox2, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.ComboBox2, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.ComboBox2, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.ComboBox2, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.CommandButton, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.CommandButton_BeforeDragOver_ArgNames, - handler: (this: MSForms.CommandButton, parameter: MSForms.EventHelperTypes.CommandButton_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.CommandButton, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.CommandButton_BeforeDropOrPaste_ArgNames, - handler: (this: MSForms.CommandButton, parameter: MSForms.EventHelperTypes.CommandButton_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.ComboBox, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: MSForms.ComboBox, parameter: { readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number }) => void): void; + on(obj: MSForms.CommandButton, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Control_BeforeDragOver_ArgNames, handler: (this: MSForms.CommandButton, parameter: MSForms.EventHelperTypes.Control_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.CommandButton, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.CommandButton, parameter: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_Parameter) => void): void; on(obj: MSForms.CommandButton, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.CommandButton, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.CommandButton, event: 'Error', argNames: MSForms.EventHelperTypes.CommandButton_Error_ArgNames, handler: ( - this: MSForms.CommandButton, parameter: MSForms.EventHelperTypes.CommandButton_Error_Parameter) => void): void; - on( - obj: MSForms.CommandButton, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.CommandButton, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; + on(obj: MSForms.CommandButton, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.CommandButton, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.CommandButton, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: MSForms.CommandButton, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; on(obj: MSForms.CommandButton, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.CommandButton, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.CommandButton, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.CommandButton, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.CommandButton2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.CommandButton2_BeforeDragOver_ArgNames, - handler: (this: MSForms.CommandButton2, parameter: MSForms.EventHelperTypes.CommandButton2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.CommandButton2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.CommandButton2_BeforeDropOrPaste_ArgNames, - handler: (this: MSForms.CommandButton2, parameter: MSForms.EventHelperTypes.CommandButton2_BeforeDropOrPaste_Parameter) => void): void; - on(obj: MSForms.CommandButton2, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.CommandButton2, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.CommandButton2, event: 'Error', argNames: MSForms.EventHelperTypes.CommandButton2_Error_ArgNames, handler: ( - this: MSForms.CommandButton2, parameter: MSForms.EventHelperTypes.CommandButton2_Error_Parameter) => void): void; - on( - obj: MSForms.CommandButton2, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.CommandButton2, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.CommandButton2, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.CommandButton2, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.CommandButton2, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.CommandButton2, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on(obj: MSForms.Control, event: 'BeforeUpdate' | 'Exit', argNames: ['Cancel'], handler: (this: MSForms.Control, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; + on(obj: MSForms.CommandButton, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: MSForms.CommandButton, parameter: { readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number }) => void): void; + on(obj: MSForms.Control, event: 'BeforeUpdate' | 'Exit', argNames: ['Cancel'], handler: (this: MSForms.Control, parameter: { readonly Cancel: MSForms.ReturnBoolean }) => void): void; on(obj: MSForms.Frame, event: 'AddControl' | 'RemoveControl', argNames: ['Control'], handler: (this: MSForms.Frame, parameter: {readonly Control: MSForms.Control}) => void): void; - on( - obj: MSForms.Frame, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Frame_BeforeDragOver_ArgNames, handler: ( - this: MSForms.Frame, parameter: MSForms.EventHelperTypes.Frame_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.Frame, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Frame_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.Frame, parameter: MSForms.EventHelperTypes.Frame_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.Frame, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Container_BeforeDragOver_ArgNames, handler: (this: MSForms.Frame, parameter: MSForms.EventHelperTypes.Container_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.Frame, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Container_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.Frame, parameter: MSForms.EventHelperTypes.Container_BeforeDropOrPaste_Parameter) => void): void; on(obj: MSForms.Frame, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.Frame, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.Frame, event: 'Error', argNames: MSForms.EventHelperTypes.Frame_Error_ArgNames, handler: ( - this: MSForms.Frame, parameter: MSForms.EventHelperTypes.Frame_Error_Parameter) => void): void; - on( - obj: MSForms.Frame, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.Frame, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; + on(obj: MSForms.Frame, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.Frame, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.Frame, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: MSForms.Frame, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; on(obj: MSForms.Frame, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.Frame, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.Frame, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.Frame, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.Frame, event: 'Scroll', argNames: MSForms.EventHelperTypes.Frame_Scroll_ArgNames, handler: ( - this: MSForms.Frame, parameter: MSForms.EventHelperTypes.Frame_Scroll_Parameter) => void): void; - on(obj: MSForms.Frame, event: 'Zoom', argNames: ['Percent'], handler: (this: MSForms.Frame, parameter: {Percent: number}) => void): void; - on(obj: MSForms.Frame2, event: 'AddControl' | 'RemoveControl', argNames: ['Control'], handler: (this: MSForms.Frame2, parameter: {readonly Control: MSForms.Control}) => void): void; - on( - obj: MSForms.Frame2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Frame2_BeforeDragOver_ArgNames, handler: ( - this: MSForms.Frame2, parameter: MSForms.EventHelperTypes.Frame2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.Frame2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Frame2_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.Frame2, parameter: MSForms.EventHelperTypes.Frame2_BeforeDropOrPaste_Parameter) => void): void; - on(obj: MSForms.Frame2, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.Frame2, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.Frame2, event: 'Error', argNames: MSForms.EventHelperTypes.Frame2_Error_ArgNames, handler: ( - this: MSForms.Frame2, parameter: MSForms.EventHelperTypes.Frame2_Error_Parameter) => void): void; - on( - obj: MSForms.Frame2, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.Frame2, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.Frame2, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.Frame2, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.Frame2, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.Frame2, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.Frame2, event: 'Scroll', argNames: MSForms.EventHelperTypes.Frame2_Scroll_ArgNames, handler: ( - this: MSForms.Frame2, parameter: MSForms.EventHelperTypes.Frame2_Scroll_Parameter) => void): void; - on(obj: MSForms.Frame2, event: 'Zoom', argNames: ['Percent'], handler: (this: MSForms.Frame2, parameter: {Percent: number}) => void): void; - on( - obj: MSForms.Image, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Image_BeforeDragOver_ArgNames, handler: ( - this: MSForms.Image, parameter: MSForms.EventHelperTypes.Image_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.Image, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Image_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.Image, parameter: MSForms.EventHelperTypes.Image_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.Frame, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: MSForms.Frame, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; + on(obj: MSForms.Frame, event: 'Scroll', argNames: MSForms.EventHelperTypes.Container_Scroll_ArgNames, handler: (this: MSForms.Frame, parameter: MSForms.EventHelperTypes.Container_Scroll_Parameter) => void): void; + on(obj: MSForms.Frame, event: 'Zoom', argNames: ['Percent'], handler: (this: MSForms.Frame, parameter: { Percent: number }) => void): void; + on(obj: MSForms.Image, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Control_BeforeDragOver_ArgNames, handler: (this: MSForms.Image, parameter: MSForms.EventHelperTypes.Control_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.Image, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.Image, parameter: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_Parameter) => void): void; on(obj: MSForms.Image, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.Image, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.Image, event: 'Error', argNames: MSForms.EventHelperTypes.Image_Error_ArgNames, handler: ( - this: MSForms.Image, parameter: MSForms.EventHelperTypes.Image_Error_Parameter) => void): void; - on( - obj: MSForms.Image, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.Image, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.Image2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Image2_BeforeDragOver_ArgNames, handler: ( - this: MSForms.Image2, parameter: MSForms.EventHelperTypes.Image2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.Image2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Image2_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.Image2, parameter: MSForms.EventHelperTypes.Image2_BeforeDropOrPaste_Parameter) => void): void; - on(obj: MSForms.Image2, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.Image2, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.Image2, event: 'Error', argNames: MSForms.EventHelperTypes.Image2_Error_ArgNames, handler: ( - this: MSForms.Image2, parameter: MSForms.EventHelperTypes.Image2_Error_Parameter) => void): void; - on( - obj: MSForms.Image2, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.Image2, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.Label, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Label_BeforeDragOver_ArgNames, handler: ( - this: MSForms.Label, parameter: MSForms.EventHelperTypes.Label_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.Label, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Label_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.Label, parameter: MSForms.EventHelperTypes.Label_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.Image, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.Image, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.Image, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: MSForms.Image, parameter: { readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number }) => void): void; + on(obj: MSForms.Label, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Control_BeforeDragOver_ArgNames, handler: (this: MSForms.Label, parameter: MSForms.EventHelperTypes.Control_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.Label, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.Label, parameter: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_Parameter) => void): void; on(obj: MSForms.Label, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.Label, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.Label, event: 'Error', argNames: MSForms.EventHelperTypes.Label_Error_ArgNames, handler: ( - this: MSForms.Label, parameter: MSForms.EventHelperTypes.Label_Error_Parameter) => void): void; - on( - obj: MSForms.Label, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.Label, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.Label2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Label2_BeforeDragOver_ArgNames, handler: ( - this: MSForms.Label2, parameter: MSForms.EventHelperTypes.Label2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.Label2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Label2_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.Label2, parameter: MSForms.EventHelperTypes.Label2_BeforeDropOrPaste_Parameter) => void): void; - on(obj: MSForms.Label2, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.Label2, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.Label2, event: 'Error', argNames: MSForms.EventHelperTypes.Label2_Error_ArgNames, handler: ( - this: MSForms.Label2, parameter: MSForms.EventHelperTypes.Label2_Error_Parameter) => void): void; - on( - obj: MSForms.Label2, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.Label2, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.ListBox, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.ListBox_BeforeDragOver_ArgNames, handler: ( - this: MSForms.ListBox, parameter: MSForms.EventHelperTypes.ListBox_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.ListBox, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.ListBox_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.ListBox, parameter: MSForms.EventHelperTypes.ListBox_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.Label, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.Label, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.Label, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: MSForms.Label, parameter: { readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number }) => void): void; + on(obj: MSForms.ListBox, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Control_BeforeDragOver_ArgNames, handler: (this: MSForms.ListBox, parameter: MSForms.EventHelperTypes.Control_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.ListBox, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.ListBox, parameter: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_Parameter) => void): void; on(obj: MSForms.ListBox, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.ListBox, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.ListBox, event: 'Error', argNames: MSForms.EventHelperTypes.ListBox_Error_ArgNames, handler: ( - this: MSForms.ListBox, parameter: MSForms.EventHelperTypes.ListBox_Error_Parameter) => void): void; - on( - obj: MSForms.ListBox, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.ListBox, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; + on(obj: MSForms.ListBox, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.ListBox, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.ListBox, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: MSForms.ListBox, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; on(obj: MSForms.ListBox, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.ListBox, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.ListBox, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.ListBox, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.ListBox2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.ListBox2_BeforeDragOver_ArgNames, handler: ( - this: MSForms.ListBox2, parameter: MSForms.EventHelperTypes.ListBox2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.ListBox2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.ListBox2_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.ListBox2, parameter: MSForms.EventHelperTypes.ListBox2_BeforeDropOrPaste_Parameter) => void): void; - on(obj: MSForms.ListBox2, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.ListBox2, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.ListBox2, event: 'Error', argNames: MSForms.EventHelperTypes.ListBox2_Error_ArgNames, handler: ( - this: MSForms.ListBox2, parameter: MSForms.EventHelperTypes.ListBox2_Error_Parameter) => void): void; - on( - obj: MSForms.ListBox2, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.ListBox2, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.ListBox2, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.ListBox2, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.ListBox2, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.ListBox2, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.MultiPage, event: 'AddControl' | 'RemoveControl', argNames: ['Index', 'Control'], handler: ( - this: MSForms.MultiPage, parameter: {readonly Index: number, readonly Control: MSForms.Control}) => void): void; - on( - obj: MSForms.MultiPage, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.MultiPage_BeforeDragOver_ArgNames, handler: ( - this: MSForms.MultiPage, parameter: MSForms.EventHelperTypes.MultiPage_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.MultiPage, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.MultiPage_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.MultiPage, parameter: MSForms.EventHelperTypes.MultiPage_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.ListBox, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: MSForms.ListBox, parameter: { readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number }) => void): void; + on(obj: MSForms.MultiPage, event: 'AddControl' | 'RemoveControl', argNames: ['Index', 'Control'], handler: (this: MSForms.MultiPage, parameter: {readonly Index: number, readonly Control: MSForms.Control}) => void): void; + on(obj: MSForms.MultiPage, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.MultiPage_BeforeDragOver_ArgNames, handler: (this: MSForms.MultiPage, parameter: MSForms.EventHelperTypes.MultiPage_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.MultiPage, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.MultiPage_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.MultiPage, parameter: MSForms.EventHelperTypes.MultiPage_BeforeDropOrPaste_Parameter) => void): void; on(obj: MSForms.MultiPage, event: 'Click' | 'Layout', argNames: ['Index'], handler: (this: MSForms.MultiPage, parameter: {readonly Index: number}) => void): void; - on( - obj: MSForms.MultiPage, event: 'DblClick', argNames: ['Index', 'Cancel'], handler: ( - this: MSForms.MultiPage, parameter: {readonly Index: number, readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.MultiPage, event: 'Error', argNames: MSForms.EventHelperTypes.MultiPage_Error_ArgNames, handler: ( - this: MSForms.MultiPage, parameter: MSForms.EventHelperTypes.MultiPage_Error_Parameter) => void): void; - on( - obj: MSForms.MultiPage, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.MultiPage, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; + on(obj: MSForms.MultiPage, event: 'DblClick', argNames: ['Index', 'Cancel'], handler: (this: MSForms.MultiPage, parameter: {readonly Index: number, readonly Cancel: MSForms.ReturnBoolean}) => void): void; + on(obj: MSForms.MultiPage, event: 'Error', argNames: MSForms.EventHelperTypes.MultiPage_Error_ArgNames, handler: (this: MSForms.MultiPage, parameter: MSForms.EventHelperTypes.MultiPage_Error_Parameter) => void): void; + on(obj: MSForms.MultiPage, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: MSForms.MultiPage, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; on(obj: MSForms.MultiPage, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.MultiPage, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.MultiPage, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Index', 'Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.MultiPage, parameter: {readonly Index: number, readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.MultiPage, event: 'Scroll', argNames: MSForms.EventHelperTypes.MultiPage_Scroll_ArgNames, handler: ( - this: MSForms.MultiPage, parameter: MSForms.EventHelperTypes.MultiPage_Scroll_Parameter) => void): void; - on(obj: MSForms.MultiPage, event: 'Zoom', argNames: ['Index', 'Percent'], handler: (this: MSForms.MultiPage, parameter: {readonly Index: number, Percent: number}) => void): void; - on( - obj: MSForms.MultiPage2, event: 'AddControl' | 'RemoveControl', argNames: ['Index', 'Control'], handler: ( - this: MSForms.MultiPage2, parameter: {readonly Index: number, readonly Control: MSForms.Control}) => void): void; - on( - obj: MSForms.MultiPage2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.MultiPage2_BeforeDragOver_ArgNames, handler: ( - this: MSForms.MultiPage2, parameter: MSForms.EventHelperTypes.MultiPage2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.MultiPage2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.MultiPage2_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.MultiPage2, parameter: MSForms.EventHelperTypes.MultiPage2_BeforeDropOrPaste_Parameter) => void): void; - on(obj: MSForms.MultiPage2, event: 'Click' | 'Layout', argNames: ['Index'], handler: (this: MSForms.MultiPage2, parameter: {readonly Index: number}) => void): void; - on( - obj: MSForms.MultiPage2, event: 'DblClick', argNames: ['Index', 'Cancel'], handler: ( - this: MSForms.MultiPage2, parameter: {readonly Index: number, readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.MultiPage2, event: 'Error', argNames: MSForms.EventHelperTypes.MultiPage2_Error_ArgNames, handler: ( - this: MSForms.MultiPage2, parameter: MSForms.EventHelperTypes.MultiPage2_Error_Parameter) => void): void; - on( - obj: MSForms.MultiPage2, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.MultiPage2, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.MultiPage2, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.MultiPage2, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.MultiPage2, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Index', 'Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.MultiPage2, parameter: {readonly Index: number, readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.MultiPage2, event: 'Scroll', argNames: MSForms.EventHelperTypes.MultiPage2_Scroll_ArgNames, handler: ( - this: MSForms.MultiPage2, parameter: MSForms.EventHelperTypes.MultiPage2_Scroll_Parameter) => void): void; - on(obj: MSForms.MultiPage2, event: 'Zoom', argNames: ['Index', 'Percent'], handler: (this: MSForms.MultiPage2, parameter: {readonly Index: number, Percent: number}) => void): void; - on( - obj: MSForms.OptionButton, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.OptionButton_BeforeDragOver_ArgNames, handler: ( - this: MSForms.OptionButton, parameter: MSForms.EventHelperTypes.OptionButton_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.OptionButton, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.OptionButton_BeforeDropOrPaste_ArgNames, - handler: (this: MSForms.OptionButton, parameter: MSForms.EventHelperTypes.OptionButton_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.MultiPage, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Index', 'Button', 'Shift', 'X', 'Y'], handler: (this: MSForms.MultiPage, parameter: {readonly Index: number, readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; + on(obj: MSForms.MultiPage, event: 'Scroll', argNames: MSForms.EventHelperTypes.MultiPage_Scroll_ArgNames, handler: (this: MSForms.MultiPage, parameter: MSForms.EventHelperTypes.MultiPage_Scroll_Parameter) => void): void; + on(obj: MSForms.MultiPage, event: 'Zoom', argNames: ['Index', 'Percent'], handler: (this: MSForms.MultiPage, parameter: { readonly Index: number, Percent: number }) => void): void; + on(obj: MSForms.OptionButton, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Control_BeforeDragOver_ArgNames, handler: (this: MSForms.OptionButton, parameter: MSForms.EventHelperTypes.Control_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.OptionButton, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.OptionButton, parameter: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_Parameter) => void): void; on(obj: MSForms.OptionButton, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.OptionButton, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.OptionButton, event: 'Error', argNames: MSForms.EventHelperTypes.OptionButton_Error_ArgNames, handler: ( - this: MSForms.OptionButton, parameter: MSForms.EventHelperTypes.OptionButton_Error_Parameter) => void): void; - on( - obj: MSForms.OptionButton, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.OptionButton, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; + on(obj: MSForms.OptionButton, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.OptionButton, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.OptionButton, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: MSForms.OptionButton, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; on(obj: MSForms.OptionButton, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.OptionButton, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.OptionButton, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.OptionButton, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.OptionButton2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.OptionButton2_BeforeDragOver_ArgNames, - handler: (this: MSForms.OptionButton2, parameter: MSForms.EventHelperTypes.OptionButton2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.OptionButton2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.OptionButton2_BeforeDropOrPaste_ArgNames, - handler: (this: MSForms.OptionButton2, parameter: MSForms.EventHelperTypes.OptionButton2_BeforeDropOrPaste_Parameter) => void): void; - on(obj: MSForms.OptionButton2, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.OptionButton2, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.OptionButton2, event: 'Error', argNames: MSForms.EventHelperTypes.OptionButton2_Error_ArgNames, handler: ( - this: MSForms.OptionButton2, parameter: MSForms.EventHelperTypes.OptionButton2_Error_Parameter) => void): void; - on( - obj: MSForms.OptionButton2, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.OptionButton2, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.OptionButton2, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.OptionButton2, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.OptionButton2, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.OptionButton2, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.ScrollBar, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.ScrollBar_BeforeDragOver_ArgNames, handler: ( - this: MSForms.ScrollBar, parameter: MSForms.EventHelperTypes.ScrollBar_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.ScrollBar, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.ScrollBar_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.ScrollBar, parameter: MSForms.EventHelperTypes.ScrollBar_BeforeDropOrPaste_Parameter) => void): void; - on( - obj: MSForms.ScrollBar, event: 'Error', argNames: MSForms.EventHelperTypes.ScrollBar_Error_ArgNames, handler: ( - this: MSForms.ScrollBar, parameter: MSForms.EventHelperTypes.ScrollBar_Error_Parameter) => void): void; - on( - obj: MSForms.ScrollBar, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.ScrollBar, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.ScrollBar, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.ScrollBar, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.ScrollBar2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.ScrollBar2_BeforeDragOver_ArgNames, handler: ( - this: MSForms.ScrollBar2, parameter: MSForms.EventHelperTypes.ScrollBar2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.ScrollBar2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.ScrollBar2_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.ScrollBar2, parameter: MSForms.EventHelperTypes.ScrollBar2_BeforeDropOrPaste_Parameter) => void): void; - on( - obj: MSForms.ScrollBar2, event: 'Error', argNames: MSForms.EventHelperTypes.ScrollBar2_Error_ArgNames, handler: ( - this: MSForms.ScrollBar2, parameter: MSForms.EventHelperTypes.ScrollBar2_Error_Parameter) => void): void; - on( - obj: MSForms.ScrollBar2, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.ScrollBar2, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.ScrollBar2, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.ScrollBar2, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.SpinButton, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.SpinButton_BeforeDragOver_ArgNames, handler: ( - this: MSForms.SpinButton, parameter: MSForms.EventHelperTypes.SpinButton_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.SpinButton, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.SpinButton_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.SpinButton, parameter: MSForms.EventHelperTypes.SpinButton_BeforeDropOrPaste_Parameter) => void): void; - on( - obj: MSForms.SpinButton, event: 'Error', argNames: MSForms.EventHelperTypes.SpinButton_Error_ArgNames, handler: ( - this: MSForms.SpinButton, parameter: MSForms.EventHelperTypes.SpinButton_Error_Parameter) => void): void; - on( - obj: MSForms.SpinButton, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.SpinButton, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; + on(obj: MSForms.OptionButton, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: MSForms.OptionButton, parameter: { readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number }) => void): void; + on(obj: MSForms.ScrollBar, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Control_BeforeDragOver_ArgNames, handler: (this: MSForms.ScrollBar, parameter: MSForms.EventHelperTypes.Control_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.ScrollBar, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.ScrollBar, parameter: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.ScrollBar, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.ScrollBar, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.ScrollBar, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: MSForms.ScrollBar, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; + on(obj: MSForms.ScrollBar, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.ScrollBar, parameter: { readonly KeyAscii: MSForms.ReturnInteger }) => void): void; + on(obj: MSForms.SpinButton, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Control_BeforeDragOver_ArgNames, handler: (this: MSForms.SpinButton, parameter: MSForms.EventHelperTypes.Control_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.SpinButton, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.SpinButton, parameter: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.SpinButton, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.SpinButton, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.SpinButton, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: MSForms.SpinButton, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; on(obj: MSForms.SpinButton, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.SpinButton, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.SpinButton2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.SpinButton2_BeforeDragOver_ArgNames, handler: ( - this: MSForms.SpinButton2, parameter: MSForms.EventHelperTypes.SpinButton2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.SpinButton2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.SpinButton2_BeforeDropOrPaste_ArgNames, - handler: (this: MSForms.SpinButton2, parameter: MSForms.EventHelperTypes.SpinButton2_BeforeDropOrPaste_Parameter) => void): void; - on( - obj: MSForms.SpinButton2, event: 'Error', argNames: MSForms.EventHelperTypes.SpinButton2_Error_ArgNames, handler: ( - this: MSForms.SpinButton2, parameter: MSForms.EventHelperTypes.SpinButton2_Error_Parameter) => void): void; - on( - obj: MSForms.SpinButton2, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.SpinButton2, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.SpinButton2, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.SpinButton2, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.TabStrip, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.TabStrip_BeforeDragOver_ArgNames, handler: ( - this: MSForms.TabStrip, parameter: MSForms.EventHelperTypes.TabStrip_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.TabStrip, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.TabStrip_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.TabStrip, parameter: MSForms.EventHelperTypes.TabStrip_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.TabStrip, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.TabStrip_BeforeDragOver_ArgNames, handler: (this: MSForms.TabStrip, parameter: MSForms.EventHelperTypes.TabStrip_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.TabStrip, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.TabStrip_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.TabStrip, parameter: MSForms.EventHelperTypes.TabStrip_BeforeDropOrPaste_Parameter) => void): void; on(obj: MSForms.TabStrip, event: 'Click', argNames: ['Index'], handler: (this: MSForms.TabStrip, parameter: {readonly Index: number}) => void): void; - on( - obj: MSForms.TabStrip, event: 'DblClick', argNames: ['Index', 'Cancel'], handler: ( - this: MSForms.TabStrip, parameter: {readonly Index: number, readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.TabStrip, event: 'Error', argNames: MSForms.EventHelperTypes.TabStrip_Error_ArgNames, handler: ( - this: MSForms.TabStrip, parameter: MSForms.EventHelperTypes.TabStrip_Error_Parameter) => void): void; - on( - obj: MSForms.TabStrip, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.TabStrip, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; + on(obj: MSForms.TabStrip, event: 'DblClick', argNames: ['Index', 'Cancel'], handler: (this: MSForms.TabStrip, parameter: {readonly Index: number, readonly Cancel: MSForms.ReturnBoolean}) => void): void; + on(obj: MSForms.TabStrip, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.TabStrip, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.TabStrip, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: MSForms.TabStrip, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; on(obj: MSForms.TabStrip, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.TabStrip, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.TabStrip, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Index', 'Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.TabStrip, parameter: {readonly Index: number, readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.TabStrip2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.TabStrip2_BeforeDragOver_ArgNames, handler: ( - this: MSForms.TabStrip2, parameter: MSForms.EventHelperTypes.TabStrip2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.TabStrip2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.TabStrip2_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.TabStrip2, parameter: MSForms.EventHelperTypes.TabStrip2_BeforeDropOrPaste_Parameter) => void): void; - on(obj: MSForms.TabStrip2, event: 'Click', argNames: ['Index'], handler: (this: MSForms.TabStrip2, parameter: {readonly Index: number}) => void): void; - on( - obj: MSForms.TabStrip2, event: 'DblClick', argNames: ['Index', 'Cancel'], handler: ( - this: MSForms.TabStrip2, parameter: {readonly Index: number, readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.TabStrip2, event: 'Error', argNames: MSForms.EventHelperTypes.TabStrip2_Error_ArgNames, handler: ( - this: MSForms.TabStrip2, parameter: MSForms.EventHelperTypes.TabStrip2_Error_Parameter) => void): void; - on( - obj: MSForms.TabStrip2, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.TabStrip2, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.TabStrip2, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.TabStrip2, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.TabStrip2, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Index', 'Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.TabStrip2, parameter: {readonly Index: number, readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.TextBox, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.TextBox_BeforeDragOver_ArgNames, handler: ( - this: MSForms.TextBox, parameter: MSForms.EventHelperTypes.TextBox_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.TextBox, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.TextBox_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.TextBox, parameter: MSForms.EventHelperTypes.TextBox_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.TabStrip, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Index', 'Button', 'Shift', 'X', 'Y'], handler: (this: MSForms.TabStrip, parameter: { readonly Index: number, readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number }) => void): void; + on(obj: MSForms.TextBox, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Control_BeforeDragOver_ArgNames, handler: (this: MSForms.TextBox, parameter: MSForms.EventHelperTypes.Control_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.TextBox, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.TextBox, parameter: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_Parameter) => void): void; on(obj: MSForms.TextBox, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.TextBox, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.TextBox, event: 'Error', argNames: MSForms.EventHelperTypes.TextBox_Error_ArgNames, handler: ( - this: MSForms.TextBox, parameter: MSForms.EventHelperTypes.TextBox_Error_Parameter) => void): void; - on( - obj: MSForms.TextBox, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.TextBox, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; + on(obj: MSForms.TextBox, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.TextBox, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.TextBox, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: MSForms.TextBox, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; on(obj: MSForms.TextBox, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.TextBox, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.TextBox, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.TextBox, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.TextBox2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.TextBox2_BeforeDragOver_ArgNames, handler: ( - this: MSForms.TextBox2, parameter: MSForms.EventHelperTypes.TextBox2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.TextBox2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.TextBox2_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.TextBox2, parameter: MSForms.EventHelperTypes.TextBox2_BeforeDropOrPaste_Parameter) => void): void; - on(obj: MSForms.TextBox2, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.TextBox2, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.TextBox2, event: 'Error', argNames: MSForms.EventHelperTypes.TextBox2_Error_ArgNames, handler: ( - this: MSForms.TextBox2, parameter: MSForms.EventHelperTypes.TextBox2_Error_Parameter) => void): void; - on( - obj: MSForms.TextBox2, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.TextBox2, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.TextBox2, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.TextBox2, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.TextBox2, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.TextBox2, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.ToggleButton, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.ToggleButton_BeforeDragOver_ArgNames, handler: ( - this: MSForms.ToggleButton, parameter: MSForms.EventHelperTypes.ToggleButton_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.ToggleButton, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.ToggleButton_BeforeDropOrPaste_ArgNames, - handler: (this: MSForms.ToggleButton, parameter: MSForms.EventHelperTypes.ToggleButton_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.TextBox, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: MSForms.TextBox, parameter: { readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number }) => void): void; + on(obj: MSForms.ToggleButton, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Control_BeforeDragOver_ArgNames, handler: (this: MSForms.ToggleButton, parameter: MSForms.EventHelperTypes.Control_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.ToggleButton, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.ToggleButton, parameter: MSForms.EventHelperTypes.Control_BeforeDropOrPaste_Parameter) => void): void; on(obj: MSForms.ToggleButton, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.ToggleButton, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.ToggleButton, event: 'Error', argNames: MSForms.EventHelperTypes.ToggleButton_Error_ArgNames, handler: ( - this: MSForms.ToggleButton, parameter: MSForms.EventHelperTypes.ToggleButton_Error_Parameter) => void): void; - on( - obj: MSForms.ToggleButton, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.ToggleButton, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; + on(obj: MSForms.ToggleButton, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.ToggleButton, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.ToggleButton, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: MSForms.ToggleButton, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; on(obj: MSForms.ToggleButton, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.ToggleButton, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.ToggleButton, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.ToggleButton, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.ToggleButton2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.ToggleButton2_BeforeDragOver_ArgNames, - handler: (this: MSForms.ToggleButton2, parameter: MSForms.EventHelperTypes.ToggleButton2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.ToggleButton2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.ToggleButton2_BeforeDropOrPaste_ArgNames, - handler: (this: MSForms.ToggleButton2, parameter: MSForms.EventHelperTypes.ToggleButton2_BeforeDropOrPaste_Parameter) => void): void; - on(obj: MSForms.ToggleButton2, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.ToggleButton2, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.ToggleButton2, event: 'Error', argNames: MSForms.EventHelperTypes.ToggleButton2_Error_ArgNames, handler: ( - this: MSForms.ToggleButton2, parameter: MSForms.EventHelperTypes.ToggleButton2_Error_Parameter) => void): void; - on( - obj: MSForms.ToggleButton2, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.ToggleButton2, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.ToggleButton2, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.ToggleButton2, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.ToggleButton2, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.ToggleButton2, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; + on(obj: MSForms.ToggleButton, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: MSForms.ToggleButton, parameter: { readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number }) => void): void; on(obj: MSForms.UserForm, event: 'AddControl' | 'RemoveControl', argNames: ['Control'], handler: (this: MSForms.UserForm, parameter: {readonly Control: MSForms.Control}) => void): void; - on( - obj: MSForms.UserForm, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.UserForm_BeforeDragOver_ArgNames, handler: ( - this: MSForms.UserForm, parameter: MSForms.EventHelperTypes.UserForm_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.UserForm, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.UserForm_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.UserForm, parameter: MSForms.EventHelperTypes.UserForm_BeforeDropOrPaste_Parameter) => void): void; + on(obj: MSForms.UserForm, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.Container_BeforeDragOver_ArgNames, handler: (this: MSForms.UserForm, parameter: MSForms.EventHelperTypes.Container_BeforeDragOver_Parameter) => void): void; + on(obj: MSForms.UserForm, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.Container_BeforeDropOrPaste_ArgNames, handler: (this: MSForms.UserForm, parameter: MSForms.EventHelperTypes.Container_BeforeDropOrPaste_Parameter) => void): void; on(obj: MSForms.UserForm, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.UserForm, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.UserForm, event: 'Error', argNames: MSForms.EventHelperTypes.UserForm_Error_ArgNames, handler: ( - this: MSForms.UserForm, parameter: MSForms.EventHelperTypes.UserForm_Error_Parameter) => void): void; - on( - obj: MSForms.UserForm, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.UserForm, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; + on(obj: MSForms.UserForm, event: 'Error', argNames: MSForms.EventHelperTypes.Error_ArgNames, handler: (this: MSForms.UserForm, parameter: MSForms.EventHelperTypes.Error_Parameter) => void): void; + on(obj: MSForms.UserForm, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: (this: MSForms.UserForm, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; on(obj: MSForms.UserForm, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.UserForm, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.UserForm, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.UserForm, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.UserForm, event: 'Scroll', argNames: MSForms.EventHelperTypes.UserForm_Scroll_ArgNames, handler: ( - this: MSForms.UserForm, parameter: MSForms.EventHelperTypes.UserForm_Scroll_Parameter) => void): void; - on(obj: MSForms.UserForm, event: 'Zoom', argNames: ['Percent'], handler: (this: MSForms.UserForm, parameter: {Percent: number}) => void): void; - on(obj: MSForms.UserForm2, event: 'AddControl' | 'RemoveControl', argNames: ['Control'], handler: (this: MSForms.UserForm2, parameter: {readonly Control: MSForms.Control}) => void): void; - on( - obj: MSForms.UserForm2, event: 'BeforeDragOver', argNames: MSForms.EventHelperTypes.UserForm2_BeforeDragOver_ArgNames, handler: ( - this: MSForms.UserForm2, parameter: MSForms.EventHelperTypes.UserForm2_BeforeDragOver_Parameter) => void): void; - on( - obj: MSForms.UserForm2, event: 'BeforeDropOrPaste', argNames: MSForms.EventHelperTypes.UserForm2_BeforeDropOrPaste_ArgNames, handler: ( - this: MSForms.UserForm2, parameter: MSForms.EventHelperTypes.UserForm2_BeforeDropOrPaste_Parameter) => void): void; - on(obj: MSForms.UserForm2, event: 'DblClick', argNames: ['Cancel'], handler: (this: MSForms.UserForm2, parameter: {readonly Cancel: MSForms.ReturnBoolean}) => void): void; - on( - obj: MSForms.UserForm2, event: 'Error', argNames: MSForms.EventHelperTypes.UserForm2_Error_ArgNames, handler: ( - this: MSForms.UserForm2, parameter: MSForms.EventHelperTypes.UserForm2_Error_Parameter) => void): void; - on( - obj: MSForms.UserForm2, event: 'KeyDown' | 'KeyUp', argNames: ['KeyCode', 'Shift'], handler: ( - this: MSForms.UserForm2, parameter: {readonly KeyCode: MSForms.ReturnInteger, readonly Shift: number}) => void): void; - on(obj: MSForms.UserForm2, event: 'KeyPress', argNames: ['KeyAscii'], handler: (this: MSForms.UserForm2, parameter: {readonly KeyAscii: MSForms.ReturnInteger}) => void): void; - on( - obj: MSForms.UserForm2, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: ( - this: MSForms.UserForm2, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; - on( - obj: MSForms.UserForm2, event: 'Scroll', argNames: MSForms.EventHelperTypes.UserForm2_Scroll_ArgNames, handler: ( - this: MSForms.UserForm2, parameter: MSForms.EventHelperTypes.UserForm2_Scroll_Parameter) => void): void; - on(obj: MSForms.UserForm2, event: 'Zoom', argNames: ['Percent'], handler: (this: MSForms.UserForm2, parameter: {Percent: number}) => void): void; + on(obj: MSForms.UserForm, event: 'MouseDown' | 'MouseMove' | 'MouseUp', argNames: ['Button', 'Shift', 'X', 'Y'], handler: (this: MSForms.UserForm, parameter: {readonly Button: number, readonly Shift: number, readonly X: number, readonly Y: number}) => void): void; + on(obj: MSForms.UserForm, event: 'Scroll', argNames: MSForms.EventHelperTypes.Container_Scroll_ArgNames, handler: (this: MSForms.UserForm, parameter: MSForms.EventHelperTypes.Container_Scroll_Parameter) => void): void; + on(obj: MSForms.UserForm, event: 'Zoom', argNames: ['Percent'], handler: (this: MSForms.UserForm, parameter: { Percent: number }) => void): void; on(obj: MSForms.CheckBox, event: 'Change' | 'Click', handler: (this: MSForms.CheckBox, parameter: {}) => void): void; - on(obj: MSForms.CheckBox2, event: 'Change' | 'Click', handler: (this: MSForms.CheckBox2, parameter: {}) => void): void; on(obj: MSForms.ComboBox, event: 'Change' | 'Click' | 'DropButtonClick', handler: (this: MSForms.ComboBox, parameter: {}) => void): void; - on(obj: MSForms.ComboBox2, event: 'Change' | 'Click' | 'DropButtonClick', handler: (this: MSForms.ComboBox2, parameter: {}) => void): void; on(obj: MSForms.CommandButton, event: 'Click', handler: (this: MSForms.CommandButton, parameter: {}) => void): void; - on(obj: MSForms.CommandButton2, event: 'Click', handler: (this: MSForms.CommandButton2, parameter: {}) => void): void; on(obj: MSForms.Control, event: 'AfterUpdate' | 'Enter', handler: (this: MSForms.Control, parameter: {}) => void): void; on(obj: MSForms.Frame, event: 'Click' | 'Layout', handler: (this: MSForms.Frame, parameter: {}) => void): void; - on(obj: MSForms.Frame2, event: 'Click' | 'Layout', handler: (this: MSForms.Frame2, parameter: {}) => void): void; on(obj: MSForms.HTMLCheckbox, event: 'Click', handler: (this: MSForms.HTMLCheckbox, parameter: {}) => void): void; - on(obj: MSForms.HTMLCheckbox2, event: 'Click', handler: (this: MSForms.HTMLCheckbox2, parameter: {}) => void): void; on(obj: MSForms.HTMLHidden, event: 'Click', handler: (this: MSForms.HTMLHidden, parameter: {}) => void): void; - on(obj: MSForms.HTMLHidden2, event: 'Click', handler: (this: MSForms.HTMLHidden2, parameter: {}) => void): void; on(obj: MSForms.HTMLImage, event: 'Click', handler: (this: MSForms.HTMLImage, parameter: {}) => void): void; - on(obj: MSForms.HTMLImage2, event: 'Click', handler: (this: MSForms.HTMLImage2, parameter: {}) => void): void; on(obj: MSForms.HTMLOption, event: 'Click', handler: (this: MSForms.HTMLOption, parameter: {}) => void): void; - on(obj: MSForms.HTMLOption2, event: 'Click', handler: (this: MSForms.HTMLOption2, parameter: {}) => void): void; on(obj: MSForms.HTMLPassword, event: 'Click', handler: (this: MSForms.HTMLPassword, parameter: {}) => void): void; - on(obj: MSForms.HTMLPassword2, event: 'Click', handler: (this: MSForms.HTMLPassword2, parameter: {}) => void): void; on(obj: MSForms.HTMLReset, event: 'Click', handler: (this: MSForms.HTMLReset, parameter: {}) => void): void; - on(obj: MSForms.HTMLReset2, event: 'Click', handler: (this: MSForms.HTMLReset2, parameter: {}) => void): void; on(obj: MSForms.HTMLSelect, event: 'Click', handler: (this: MSForms.HTMLSelect, parameter: {}) => void): void; - on(obj: MSForms.HTMLSelect2, event: 'Click', handler: (this: MSForms.HTMLSelect2, parameter: {}) => void): void; on(obj: MSForms.HTMLSubmit, event: 'Click', handler: (this: MSForms.HTMLSubmit, parameter: {}) => void): void; - on(obj: MSForms.HTMLSubmit2, event: 'Click', handler: (this: MSForms.HTMLSubmit2, parameter: {}) => void): void; on(obj: MSForms.HTMLText, event: 'Click', handler: (this: MSForms.HTMLText, parameter: {}) => void): void; - on(obj: MSForms.HTMLText2, event: 'Click', handler: (this: MSForms.HTMLText2, parameter: {}) => void): void; on(obj: MSForms.HTMLTextArea, event: 'Click', handler: (this: MSForms.HTMLTextArea, parameter: {}) => void): void; - on(obj: MSForms.HTMLTextArea2, event: 'Click', handler: (this: MSForms.HTMLTextArea2, parameter: {}) => void): void; on(obj: MSForms.Image, event: 'Click', handler: (this: MSForms.Image, parameter: {}) => void): void; - on(obj: MSForms.Image2, event: 'Click', handler: (this: MSForms.Image2, parameter: {}) => void): void; on(obj: MSForms.Label, event: 'Click', handler: (this: MSForms.Label, parameter: {}) => void): void; - on(obj: MSForms.Label2, event: 'Click', handler: (this: MSForms.Label2, parameter: {}) => void): void; on(obj: MSForms.ListBox, event: 'Change' | 'Click', handler: (this: MSForms.ListBox, parameter: {}) => void): void; - on(obj: MSForms.ListBox2, event: 'Change' | 'Click', handler: (this: MSForms.ListBox2, parameter: {}) => void): void; on(obj: MSForms.MultiPage, event: 'Change', handler: (this: MSForms.MultiPage, parameter: {}) => void): void; - on(obj: MSForms.MultiPage2, event: 'Change', handler: (this: MSForms.MultiPage2, parameter: {}) => void): void; on(obj: MSForms.OptionButton, event: 'Change' | 'Click', handler: (this: MSForms.OptionButton, parameter: {}) => void): void; - on(obj: MSForms.OptionButton2, event: 'Change' | 'Click', handler: (this: MSForms.OptionButton2, parameter: {}) => void): void; on(obj: MSForms.ScrollBar, event: 'Change' | 'Scroll', handler: (this: MSForms.ScrollBar, parameter: {}) => void): void; - on(obj: MSForms.ScrollBar2, event: 'Change' | 'Scroll', handler: (this: MSForms.ScrollBar2, parameter: {}) => void): void; on(obj: MSForms.SpinButton, event: 'Change' | 'SpinDown' | 'SpinUp', handler: (this: MSForms.SpinButton, parameter: {}) => void): void; - on(obj: MSForms.SpinButton2, event: 'Change' | 'SpinDown' | 'SpinUp', handler: (this: MSForms.SpinButton2, parameter: {}) => void): void; on(obj: MSForms.TabStrip, event: 'Change', handler: (this: MSForms.TabStrip, parameter: {}) => void): void; - on(obj: MSForms.TabStrip2, event: 'Change', handler: (this: MSForms.TabStrip2, parameter: {}) => void): void; on(obj: MSForms.TextBox, event: 'Change' | 'DropButtonClick', handler: (this: MSForms.TextBox, parameter: {}) => void): void; - on(obj: MSForms.TextBox2, event: 'Change' | 'DropButtonClick', handler: (this: MSForms.TextBox2, parameter: {}) => void): void; on(obj: MSForms.ToggleButton, event: 'Change' | 'Click', handler: (this: MSForms.ToggleButton, parameter: {}) => void): void; - on(obj: MSForms.ToggleButton2, event: 'Change' | 'Click', handler: (this: MSForms.ToggleButton2, parameter: {}) => void): void; on(obj: MSForms.UserForm, event: 'Click' | 'Layout', handler: (this: MSForms.UserForm, parameter: {}) => void): void; - on(obj: MSForms.UserForm2, event: 'Click' | 'Layout', handler: (this: MSForms.UserForm2, parameter: {}) => void): void; - set(obj: MSForms.ComboBox | MSForms.ComboBox2 | MSForms.ListBox | MSForms.ListBox2, propertyName: 'Column' | 'List', parameterTypes: [number | undefined, number] | [number] | never[], - newValue: any): void; - set(obj: MSForms.ListBox | MSForms.ListBox2, propertyName: 'Selected', parameterTypes: [any], newValue: boolean): void; + set(obj: MSForms.ComboBox | MSForms.ListBox, propertyName: 'Column' | 'List', parameterTypes: [number, number] | [number], newValue: any): void; + set(obj: MSForms.ComboBox | MSForms.ListBox, propertyName: 'Column' | 'List', parameterTypes: number[], newValue: SafeArray): void; + set(obj: MSForms.ListBox, propertyName: 'Selected', parameterTypes: [any], newValue: boolean): void; new(progid: K): ActiveXObjectNameMap[K]; } interface ActiveXObjectNameMap { 'Forms.Image': MSForms.Image; } - -interface EnumeratorConstructor { - new(col: MSForms.Controls | MSForms.Pages | MSForms.Tabs): Enumerator; // tslint:disable-line:use-default-type-parameter -} - -interface SafeArray { - _brand: SafeArray; -} diff --git a/types/activex-msforms/tslint.json b/types/activex-msforms/tslint.json index 3224b40b8b..7b89accc6d 100644 --- a/types/activex-msforms/tslint.json +++ b/types/activex-msforms/tslint.json @@ -1,6 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - "no-const-enum": false + "no-const-enum": false, + "max-line-length": false } } diff --git a/types/activex-office/activex-office-tests.ts b/types/activex-office/activex-office-tests.ts index 69a0563640..7aab0b4521 100644 --- a/types/activex-office/activex-office-tests.ts +++ b/types/activex-office/activex-office-tests.ts @@ -1,19 +1,26 @@ /// +const collectionToArray = (col: { Item(key: any): T }): T[] => { + const results: T[] = []; + const enumerator = new Enumerator(col); + enumerator.moveFirst(); + while (!enumerator.atEnd()) { + results.push(enumerator.item()); + enumerator.moveNext(); + } + return results; +}; + let app = new ActiveXObject('Word.Application'); +app.Visible = true; let dlg = app.FileDialog(Office.MsoFileDialogType.msoFileDialogFolderPicker); dlg.AllowMultiSelect = true; dlg.Title = 'Select one or more folders'; dlg.Execute(); -let enumerator = new Enumerator(dlg.SelectedItems); -enumerator.moveFirst(); -while (!enumerator.atEnd()) { - WScript.Echo(enumerator.item); +for (const item of collectionToArray(dlg.SelectedItems)) { + WScript.Echo(item); } -let enumerator2 = new Enumerator(app.COMAddIns); -enumerator2.moveFirst(); -while (!enumerator2.atEnd()) { - const item = enumerator2.item(); +for (const item of collectionToArray(app.COMAddIns)) { WScript.Echo(`COM Addin: ${item.Description} -- ${item.ProgId}`); } diff --git a/types/activex-office/index.d.ts b/types/activex-office/index.d.ts index 20351b91f9..18a7dd285d 100644 --- a/types/activex-office/index.d.ts +++ b/types/activex-office/index.d.ts @@ -1,10 +1,11 @@ -// Type definitions for Microsoft Office 14.0 Object Library - Office 14.0 +// Type definitions for Microsoft Office 16.0 Object Library - Office 16.0 // Project: https://msdn.microsoft.com/VBA/Office-Shared-VBA/articles/office-vba-object-library-reference // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.6 /// +/// declare namespace Office { type MsoRGBType = number; @@ -524,6 +525,18 @@ declare namespace Office { msoblogImageTypePNG = 3, } + const enum MsoBroadcastCapabilities { + BroadcastCapFileSizeLimited = 1, + BroadcastCapSupportsMeetingNotes = 2, + BroadcastCapSupportsUpdateDoc = 4, + } + + const enum MsoBroadcastState { + BroadcastPaused = 2, + BroadcastStarted = 1, + NoBroadcast = 0, + } + const enum MsoBulletType { msoBulletMixed = -2, msoBulletNone = 0, @@ -622,6 +635,7 @@ declare namespace Office { msoElementChartWallShow = 1101, msoElementDataLabelBestFit = 210, msoElementDataLabelBottom = 209, + msoElementDataLabelCallout = 211, msoElementDataLabelCenter = 202, msoElementDataLabelInsideBase = 204, msoElementDataLabelInsideEnd = 203, @@ -741,6 +755,16 @@ declare namespace Office { msoElementUpDownBarsShow = 901, } + const enum MsoChartFieldType { + msoChartFieldBubbleSize = 1, + msoChartFieldCategoryName = 2, + msoChartFieldFormula = 6, + msoChartFieldPercentage = 3, + msoChartFieldRange = 7, + msoChartFieldSeriesName = 4, + msoChartFieldValue = 5, + } + const enum MsoClipboardFormat { msoClipboardFormatHTML = 2, msoClipboardFormatMixed = -2, @@ -1625,6 +1649,13 @@ declare namespace Office { msoLightRigTwoPoint = 25, } + const enum MsoLineCapStyle { + msoLineCapFlat = 3, + msoLineCapMixed = -2, + msoLineCapRound = 2, + msoLineCapSquare = 1, + } + const enum MsoLineDashStyle { msoLineDash = 4, msoLineDashDot = 5, @@ -1641,6 +1672,24 @@ declare namespace Office { msoLineSysDot = 11, } + const enum MsoLineFillType { + msoLineFillBackground = 5, + msoLineFillGradient = 3, + msoLineFillMixed = -2, + msoLineFillNone = 0, + msoLineFillPatterned = 2, + msoLineFillPicture = 6, + msoLineFillSolid = 1, + msoLineFillTextured = 4, + } + + const enum MsoLineJoinStyle { + msoLineJoinBevel = 2, + msoLineJoinMiter = 3, + msoLineJoinMixed = -2, + msoLineJoinRound = 1, + } + const enum MsoLineStyle { msoLineSingle = 1, msoLineStyleMixed = -2, @@ -1657,6 +1706,14 @@ declare namespace Office { msoMenuAnimationUnfold = 2, } + const enum MsoMergeCmd { + msoMergeCombine = 2, + msoMergeFragment = 5, + msoMergeIntersect = 3, + msoMergeSubtract = 4, + msoMergeUnion = 1, + } + const enum MsoMetaPropertyType { msoMetaPropertyTypeBoolean = 1, msoMetaPropertyTypeBusinessData = 20, @@ -1884,6 +1941,12 @@ declare namespace Office { msoPictureWatermark = 4, } + const enum MsoPictureCompress { + msoPictureCompressDocDefault = -1, + msoPictureCompressFalse = 0, + msoPictureCompressTrue = 1, + } + const enum MsoPictureEffectType { msoEffectBackgroundRemoval = 1, msoEffectBlur = 2, @@ -2086,8 +2149,28 @@ declare namespace Office { msoTextEffect29 = 28, msoTextEffect3 = 2, msoTextEffect30 = 29, + msoTextEffect31 = 30, + msoTextEffect32 = 31, + msoTextEffect33 = 32, + msoTextEffect34 = 33, + msoTextEffect35 = 34, + msoTextEffect36 = 35, + msoTextEffect37 = 36, + msoTextEffect38 = 37, + msoTextEffect39 = 38, msoTextEffect4 = 3, + msoTextEffect40 = 39, + msoTextEffect41 = 40, + msoTextEffect42 = 41, + msoTextEffect43 = 42, + msoTextEffect44 = 43, + msoTextEffect45 = 44, + msoTextEffect46 = 45, + msoTextEffect47 = 46, + msoTextEffect48 = 47, + msoTextEffect49 = 48, msoTextEffect5 = 4, + msoTextEffect50 = 49, msoTextEffect6 = 5, msoTextEffect7 = 6, msoTextEffect8 = 7, @@ -2324,8 +2407,29 @@ declare namespace Office { msoLineStylePreset2 = 10002, msoLineStylePreset20 = 10020, msoLineStylePreset21 = 10021, + msoLineStylePreset22 = 10022, + msoLineStylePreset23 = 10023, + msoLineStylePreset24 = 10024, + msoLineStylePreset25 = 10025, + msoLineStylePreset26 = 10026, + msoLineStylePreset27 = 10027, + msoLineStylePreset28 = 10028, + msoLineStylePreset29 = 10029, msoLineStylePreset3 = 10003, + msoLineStylePreset30 = 10030, + msoLineStylePreset31 = 10031, + msoLineStylePreset32 = 10032, + msoLineStylePreset33 = 10033, + msoLineStylePreset34 = 10034, + msoLineStylePreset35 = 10035, + msoLineStylePreset36 = 10036, + msoLineStylePreset37 = 10037, + msoLineStylePreset38 = 10038, + msoLineStylePreset39 = 10039, msoLineStylePreset4 = 10004, + msoLineStylePreset40 = 10040, + msoLineStylePreset41 = 10041, + msoLineStylePreset42 = 10042, msoLineStylePreset5 = 10005, msoLineStylePreset6 = 10006, msoLineStylePreset7 = 10007, @@ -2370,9 +2474,44 @@ declare namespace Office { msoShapeStylePreset40 = 40, msoShapeStylePreset41 = 41, msoShapeStylePreset42 = 42, + msoShapeStylePreset43 = 43, + msoShapeStylePreset44 = 44, + msoShapeStylePreset45 = 45, + msoShapeStylePreset46 = 46, + msoShapeStylePreset47 = 47, + msoShapeStylePreset48 = 48, + msoShapeStylePreset49 = 49, msoShapeStylePreset5 = 5, + msoShapeStylePreset50 = 50, + msoShapeStylePreset51 = 51, + msoShapeStylePreset52 = 52, + msoShapeStylePreset53 = 53, + msoShapeStylePreset54 = 54, + msoShapeStylePreset55 = 55, + msoShapeStylePreset56 = 56, + msoShapeStylePreset57 = 57, + msoShapeStylePreset58 = 58, + msoShapeStylePreset59 = 59, msoShapeStylePreset6 = 6, + msoShapeStylePreset60 = 60, + msoShapeStylePreset61 = 61, + msoShapeStylePreset62 = 62, + msoShapeStylePreset63 = 63, + msoShapeStylePreset64 = 64, + msoShapeStylePreset65 = 65, + msoShapeStylePreset66 = 66, + msoShapeStylePreset67 = 67, + msoShapeStylePreset68 = 68, + msoShapeStylePreset69 = 69, msoShapeStylePreset7 = 7, + msoShapeStylePreset70 = 70, + msoShapeStylePreset71 = 71, + msoShapeStylePreset72 = 72, + msoShapeStylePreset73 = 73, + msoShapeStylePreset74 = 74, + msoShapeStylePreset75 = 75, + msoShapeStylePreset76 = 76, + msoShapeStylePreset77 = 77, msoShapeStylePreset8 = 8, msoShapeStylePreset9 = 9, } @@ -2383,6 +2522,7 @@ declare namespace Office { msoCanvas = 20, msoChart = 3, msoComment = 4, + msoContentApp = 27, msoDiagram = 21, msoEmbeddedOLEObject = 7, msoFormControl = 8, @@ -2404,6 +2544,7 @@ declare namespace Office { msoTable = 19, msoTextBox = 17, msoTextEffect = 15, + msoWebVideo = 26, } const enum MsoSharedWorkspaceTaskPriority { @@ -2858,6 +2999,14 @@ declare namespace Office { xlPyramidToPoint = 1, } + const enum XlBinsType { + xlBinsTypeAutomatic = 0, + xlBinsTypeBinCount = 4, + xlBinsTypeBinSize = 3, + xlBinsTypeCategorical = 1, + xlBinsTypeManual = 2, + } + const enum XlBorderWeight { xlHairline = 1, xlMedium = -4138, @@ -2865,6 +3014,12 @@ declare namespace Office { xlThin = 2, } + const enum XlCategoryLabelLevel { + xlCategoryLabelLevelAll = -1, + xlCategoryLabelLevelCustom = -2, + xlCategoryLabelLevelNone = -3, + } + const enum XlCategoryType { xlAutomaticScale = -4105, xlCategoryScale = 2, @@ -2897,7 +3052,9 @@ declare namespace Office { xlMajorGridlines = 15, xlMinorGridlines = 16, xlNothing = 28, + xlPivotChartCollapseEntireFieldButton = 34, xlPivotChartDropZone = 32, + xlPivotChartExpandEntireFieldButton = 33, xlPivotChartFieldButton = 31, xlPlotArea = 19, xlRadarAxisLabels = 27, @@ -2952,11 +3109,16 @@ declare namespace Office { xlBarOfPie = 71, xlBarStacked = 58, xlBarStacked100 = 59, + xlBoxwhisker = 121, xlBubble = 15, xlBubble3DEffect = 87, xlColumnClustered = 51, xlColumnStacked = 52, xlColumnStacked100 = 53, + xlCombo = -4152, + xlComboAreaStackedColumnClustered = 115, + xlComboColumnClusteredLine = 113, + xlComboColumnClusteredLineSecondaryAxis = 114, xlConeBarClustered = 102, xlConeBarStacked = 103, xlConeBarStacked100 = 104, @@ -2973,12 +3135,15 @@ declare namespace Office { xlCylinderColStacked100 = 94, xlDoughnut = -4120, xlDoughnutExploded = 80, + xlHistogram = 118, xlLine = 4, xlLineMarkers = 65, xlLineMarkersStacked = 66, xlLineMarkersStacked100 = 67, xlLineStacked = 63, xlLineStacked100 = 64, + xlOtherCombinations = 116, + xlPareto = 122, xlPie = 5, xlPieExploded = 69, xlPieOfPie = 68, @@ -2996,10 +3161,14 @@ declare namespace Office { xlStockOHLC = 89, xlStockVHLC = 90, xlStockVOHLC = 91, + xlSuggestedChart = -2, + xlSunburst = 120, xlSurface = 83, xlSurfaceTopView = 85, xlSurfaceTopViewWireframe = 86, xlSurfaceWireframe = 84, + xlTreemap = 117, + xlWaterfall = 119, xlXYScatter = -4169, xlXYScatterLines = 74, xlXYScatterLinesNoMarkers = 75, @@ -3181,6 +3350,12 @@ declare namespace Office { xlMarkerStyleX = -4168, } + const enum XlParentDataLabelOptions { + xlParentDataLabelOptionsBanner = 1, + xlParentDataLabelOptionsNone = 0, + xlParentDataLabelOptionsOverlapping = 2, + } + const enum XlPieSliceIndex { xlCenterPoint = 5, xlInnerCenterPoint = 8, @@ -3222,6 +3397,12 @@ declare namespace Office { xlScaleLogarithmic = -4133, } + const enum XlSeriesNameLevel { + xlSeriesNameLevelAll = -1, + xlSeriesNameLevelCustom = -2, + xlSeriesNameLevelNone = -3, + } + const enum XlSizeRepresents { xlSizeIsArea = 1, xlSizeIsWidth = 2, @@ -3280,14 +3461,13 @@ declare namespace Office { xlVAlignTop = -4160, } - class Adjustments { - private 'Office.Adjustments_typekey': Adjustments; - private constructor(); + interface Adjustments { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): number; readonly Parent: any; + (Index: number): number; } class AnswerWizard { @@ -3301,9 +3481,7 @@ declare namespace Office { ResetFileList(): void; } - class AnswerWizardFiles { - private 'Office.AnswerWizardFiles_typekey': AnswerWizardFiles; - private constructor(); + interface AnswerWizardFiles { Add(FileName: string): void; readonly Application: any; readonly Count: number; @@ -3311,12 +3489,13 @@ declare namespace Office { Delete(FileName: string): void; Item(Index: number): string; readonly Parent: any; + (Index: number): string; } class Assistant { private 'Office.Assistant_typekey': Assistant; private constructor(); - ActivateWizard(WizardID: number, act: MsoWizardActType, Animation?: any): void; + ActivateWizard(WizardID: number, act: MsoWizardActType, Animation?: MsoAnimationType): void; Animation: MsoAnimationType; readonly Application: any; AssistWithAlerts: boolean; @@ -3325,7 +3504,7 @@ declare namespace Office { readonly BalloonError: MsoBalloonErrorType; readonly Creator: number; DoAlert(bstrAlertTitle: string, bstrAlertText: string, alb: MsoAlertButtonType, alc: MsoAlertIconType, ald: MsoAlertDefaultType, alq: MsoAlertCancelType, varfSysAlert: boolean): number; - EndWizard(WizardID: number, varfSuccess: boolean, Animation?: any): void; + EndWizard(WizardID: number, varfSuccess: boolean, Animation?: MsoAnimationType): void; FeatureTips: boolean; FileName: string; GuessHelp: boolean; @@ -3345,7 +3524,7 @@ declare namespace Office { ResetTips(): void; SearchWhenProgramming: boolean; Sounds: boolean; - StartWizard(On: boolean, Callback: string, PrivateX: number, Animation?: any, CustomTeaser?: any, Top?: any, Left?: any, Bottom?: any, Right?: any): number; + StartWizard(On: boolean, Callback: string, PrivateX: number, Animation?: MsoAnimationType, CustomTeaser?: any, Top?: number, Left?: number, Bottom?: number, Right?: number): number; TipOfDay: boolean; Top: number; Visible: boolean; @@ -3359,12 +3538,12 @@ declare namespace Office { BalloonType: MsoBalloonType; Button: MsoButtonSetType; Callback: string; - readonly Checkboxes: any; + readonly Checkboxes: BalloonCheckboxes; Close(): void; readonly Creator: number; Heading: string; Icon: MsoIconType; - readonly Labels: any; + readonly Labels: BalloonLabels; Mode: MsoModeType; readonly Name: string; readonly Parent: any; @@ -3374,6 +3553,49 @@ declare namespace Office { Text: string; } + class BalloonCheckbox { + private 'Office.BalloonCheckbox_typekey': BalloonCheckbox; + private constructor(); + readonly Application: any; + Checked: boolean; + readonly Creator: number; + readonly Item: string; + readonly Name: string; + readonly Parent: any; + Text: string; + } + + interface BalloonCheckboxes { + readonly Application: any; + Count: number; + readonly Creator: number; + Item(Index: number): BalloonCheckbox; + readonly Name: string; + readonly Parent: any; + (Index: number): BalloonCheckbox; + } + + class BalloonLabel { + private constructor(); + private 'Office.BalloonLabel_typekey': BalloonLabel; + readonly Application: any; + readonly Creator: number; + readonly Item: string; + readonly Name: string; + readonly Parent: any; + Text: string; + } + + interface BalloonLabels { + readonly Application: any; + Count: number; + readonly Creator: number; + Item(Index: number): BalloonLabel; + readonly Name: string; + readonly Parent: any; + (Index: number): BalloonLabel; + } + class BulletFormat2 { private 'Office.BulletFormat2_typekey': BulletFormat2; private constructor(); @@ -3415,21 +3637,19 @@ declare namespace Office { Type: MsoCalloutType; } - class CanvasShapes { - private 'Office.CanvasShapes_typekey': CanvasShapes; - private constructor(); + interface CanvasShapes { AddCallout(Type: MsoCalloutType, Left: number, Top: number, Width: number, Height: number): Shape; AddConnector(Type: MsoConnectorType, BeginX: number, BeginY: number, EndX: number, EndY: number): Shape; - AddCurve(SafeArrayOfPoints: any): Shape; + AddCurve(SafeArrayOfPoints: SafeArray): Shape; AddLabel(Orientation: MsoTextOrientation, Left: number, Top: number, Width: number, Height: number): Shape; AddLine(BeginX: number, BeginY: number, EndX: number, EndY: number): Shape; /** - * @param number [Width=-1] - * @param number [Height=-1] + * @param Width [Width=-1] + * @param Height [Height=-1] */ AddPicture(FileName: string, LinkToFile: MsoTriState, SaveWithDocument: MsoTriState, Left: number, Top: number, Width?: number, Height?: number): Shape; - AddPolyline(SafeArrayOfPoints: any): Shape; + AddPolyline(SafeArrayOfPoints: SafeArray): Shape; AddShape(Type: MsoAutoShapeType, Left: number, Top: number, Width: number, Height: number): Shape; AddTextbox(Orientation: MsoTextOrientation, Left: number, Top: number, Width: number, Height: number): Shape; AddTextEffect(PresetTextEffect: MsoPresetTextEffect, Text: string, FontName: string, FontSize: number, FontBold: MsoTriState, FontItalic: MsoTriState, Left: number, Top: number): Shape; @@ -3438,10 +3658,11 @@ declare namespace Office { BuildFreeform(EditingType: MsoEditingType, X1: number, Y1: number): FreeformBuilder; readonly Count: number; readonly Creator: number; - Item(Index: any): Shape; + Item(Index: number | string): Shape; readonly Parent: any; Range(Index: any): ShapeRange; SelectAll(): void; + (Index: number | string): Shape; } class ChartColorFormat { @@ -3480,7 +3701,7 @@ declare namespace Office { readonly TextureType: number; TwoColorGradient(Style: number, Variant: number): void; readonly Type: number; - UserPicture(PictureFile: any, PictureFormat: any, PictureStackUnit: any, PicturePlacement: any): void; + UserPicture(PictureFile: string, PictureFormat: any, PictureStackUnit: any, PicturePlacement: any): void; UserTextured(TextureFile: string): void; Visible: number; } @@ -3534,16 +3755,15 @@ declare namespace Office { readonly ProgId: string; } - class COMAddIns { - private 'Office.COMAddIns_typekey': COMAddIns; - private constructor(); + interface COMAddIns { readonly Application: any; readonly Count: number; readonly Creator: number; - Item(Index: any): COMAddIn; + Item(Index: number | string): COMAddIn; readonly Parent: any; SetAppModal(varfModal: boolean): void; Update(): void; + (Index: number | string): COMAddIn; } class CommandBar { @@ -3576,7 +3796,7 @@ declare namespace Office { readonly Creator: number; Delete(): void; Enabled: boolean; - FindControl(Type?: any, Id?: any, Tag?: any, Visible?: any, Recursive?: any): CommandBarControl; + FindControl(Type?: any, Id?: any, Tag?: any, Visible?: boolean, Recursive?: boolean): CommandBarControl; Height: number; readonly Id: number; readonly Index: number; @@ -3590,7 +3810,7 @@ declare namespace Office { Protection: MsoBarProtection; Reset(): void; RowIndex: number; - ShowPopup(x?: any, y?: any): void; + ShowPopup(x?: number, y?: number): void; Top: number; readonly Type: MsoBarType; Visible: boolean; @@ -3625,10 +3845,10 @@ declare namespace Office { BuiltInFace: boolean; Caption: string; readonly Control: any; - Copy(Bar?: any, Before?: any): CommandBarControl; + Copy(Bar?: CommandBar, Before?: number): CommandBarControl; CopyFace(): void; readonly Creator: number; - Delete(Temporary?: any): void; + Delete(Temporary?: boolean): void; DescriptionText: string; Enabled: boolean; Execute(): void; @@ -3644,7 +3864,7 @@ declare namespace Office { readonly IsPriorityDropped: boolean; readonly Left: number; Mask: stdole.IPictureDisp; - Move(Bar?: any, Before?: any): CommandBarControl; + Move(Bar?: CommandBar, Before?: number): CommandBarControl; OLEUsage: MsoControlOLEUsage; OnAction: string; Parameter: string; @@ -3701,9 +3921,9 @@ declare namespace Office { Caption: string; Clear(): void; readonly Control: any; - Copy(Bar?: any, Before?: any): CommandBarControl; + Copy(Bar?: CommandBar, Before?: number): CommandBarControl; readonly Creator: number; - Delete(Temporary?: any): void; + Delete(Temporary?: boolean): void; DescriptionText: string; DropDownLines: number; DropDownWidth: number; @@ -3722,7 +3942,7 @@ declare namespace Office { readonly ListCount: number; ListHeaderCount: number; ListIndex: number; - Move(Bar?: any, Before?: any): CommandBarControl; + Move(Bar?: CommandBar, Before?: number): CommandBarControl; OLEUsage: MsoControlOLEUsage; OnAction: string; Parameter: string; @@ -3775,9 +3995,9 @@ declare namespace Office { readonly BuiltIn: boolean; Caption: string; readonly Control: any; - Copy(Bar?: any, Before?: any): CommandBarControl; + Copy(Bar?: CommandBar, Before?: number): CommandBarControl; readonly Creator: number; - Delete(Temporary?: any): void; + Delete(Temporary?: boolean): void; DescriptionText: string; Enabled: boolean; Execute(): void; @@ -3789,7 +4009,7 @@ declare namespace Office { readonly InstanceId: number; readonly IsPriorityDropped: boolean; readonly Left: number; - Move(Bar?: any, Before?: any): CommandBarControl; + Move(Bar?: CommandBar, Before?: number): CommandBarControl; OLEUsage: MsoControlOLEUsage; OnAction: string; Parameter: string; @@ -3812,24 +4032,21 @@ declare namespace Office { Width: number; } - class CommandBarControls { - private 'Office.CommandBarControls_typekey': CommandBarControls; - private constructor(); - Add(Type?: any, Id?: any, Parameter?: any, Before?: any, Temporary?: any): CommandBarControl; + interface CommandBarControls { + Add(Type?: MsoControlType.msoControlButton | MsoControlType.msoControlEdit | MsoControlType.msoControlDropdown | MsoControlType.msoControlComboBox | MsoControlType.msoControlPopup, Id?: number, Parameter?: any, Before?: number, Temporary?: boolean): CommandBarControl; readonly Application: any; readonly Count: number; readonly Creator: number; - Item(Index: any): CommandBarControl; + Item(Index: number | string): CommandBarControl; readonly Parent: CommandBar; + (Index: number | string): CommandBarControl; } - class CommandBars { - private 'Office.CommandBars_typekey': CommandBars; - private constructor(); + interface CommandBars { readonly ActionControl: CommandBarControl; readonly ActiveMenuBar: CommandBar; AdaptiveMenus: boolean; - Add(Name?: any, Position?: any, MenuBar?: any, Temporary?: any): CommandBar; + Add(Name?: string, Position?: MsoBarPosition, MenuBar?: boolean, Temporary?: boolean): CommandBar; AddEx(TbidOrName?: any, Position?: any, MenuBar?: any, Temporary?: any, TbtrProtection?: any): CommandBar; readonly Application: any; CommitRenderingTransaction(hwnd: number): void; @@ -3841,8 +4058,8 @@ declare namespace Office { DisplayKeysInTooltips: boolean; DisplayTooltips: boolean; ExecuteMso(idMso: string): void; - FindControl(Type?: any, Id?: any, Tag?: any, Visible?: any): CommandBarControl; - FindControls(Type?: any, Id?: any, Tag?: any, Visible?: any): CommandBarControls; + FindControl(Type?: MsoControlType, Id?: any, Tag?: any, Visible?: boolean): CommandBarControl | null; + FindControls(Type?: MsoControlType, Id?: any, Tag?: any, Visible?: boolean): CommandBarControls | null; GetEnabledMso(idMso: string): boolean; GetImageMso(idMso: string, Width: number, Height: number): stdole.IPictureDisp; GetLabelMso(idMso: string): string; @@ -3851,12 +4068,13 @@ declare namespace Office { GetSupertipMso(idMso: string): string; GetVisibleMso(idMso: string): boolean; IdsString(ids: number, pbstrName: string): number; - Item(Index: any): CommandBar; + Item(Index: number | string): CommandBar; LargeButtons: boolean; MenuAnimationStyle: MsoMenuAnimation; readonly Parent: any; ReleaseFocus(): void; TmcGetName(tmc: number, pbstrName: string): number; + (Index: number | string): CommandBar; } class ConnectorFormat { @@ -3886,8 +4104,7 @@ declare namespace Office { readonly Creator: number; /** @param boolean [ShowWithDelay=false] */ - Show( - CardStyle: MsoContactCardStyle, RectangleLeft: number, RectangleRight: number, RectangleTop: number, RectangleBottom: number, HorizontalPosition: number, ShowWithDelay?: boolean): void; + Show(CardStyle: MsoContactCardStyle, RectangleLeft: number, RectangleRight: number, RectangleTop: number, RectangleBottom: number, HorizontalPosition: number, ShowWithDelay?: boolean): void; } class Crop { @@ -3925,10 +4142,10 @@ declare namespace Office { private constructor(); /** - * @param string [Name=''] - * @param string [NamespaceURI=''] - * @param Office.MsoCustomXMLNodeType [NodeType=1] - * @param string [NodeValue=''] + * @param Name [Name=''] + * @param NamespaceURI [NamespaceURI=''] + * @param NodeType [NodeType=1] + * @param NodeValue [NodeValue=''] */ AppendChildNode(Name?: string, NamespaceURI?: string, NodeType?: MsoCustomXMLNodeType, NodeValue?: string): void; AppendChildSubtree(XML: string): void; @@ -3942,15 +4159,15 @@ declare namespace Office { HasChildNodes(): boolean; /** - * @param string [Name=''] - * @param string [NamespaceURI=''] - * @param Office.MsoCustomXMLNodeType [NodeType=1] - * @param string [NodeValue=''] - * @param Office.CustomXMLNode [NextSibling=0] + * @param Name [Name=''] + * @param NamespaceURI [NamespaceURI=''] + * @param NodeType [NodeType=1] + * @param NodeValue [NodeValue=''] + * @param NextSibling [NextSibling=0] */ InsertNodeBefore(Name?: string, NamespaceURI?: string, NodeType?: MsoCustomXMLNodeType, NodeValue?: string, NextSibling?: CustomXMLNode): void; - /** @param Office.CustomXMLNode [NextSibling=0] */ + /** @param NextSibling [NextSibling=0] */ InsertSubtreeBefore(XML: string, NextSibling?: CustomXMLNode): void; readonly LastChild: CustomXMLNode; readonly NamespaceURI: string; @@ -3965,10 +4182,10 @@ declare namespace Office { RemoveChild(Child: CustomXMLNode): void; /** - * @param string [Name=''] - * @param string [NamespaceURI=''] - * @param Office.MsoCustomXMLNodeType [NodeType=1] - * @param string [NodeValue=''] + * @param Name [Name=''] + * @param NamespaceURI [NamespaceURI=''] + * @param NodeType [NodeType=1] + * @param NodeValue [NodeValue=''] */ ReplaceChildNode(OldNode: CustomXMLNode, Name?: string, NamespaceURI?: string, NodeType?: MsoCustomXMLNodeType, NodeValue?: string): void; ReplaceChildSubtree(XML: string, OldNode: CustomXMLNode): void; @@ -3979,14 +4196,13 @@ declare namespace Office { readonly XPath: string; } - class CustomXMLNodes { - private 'Office.CustomXMLNodes_typekey': CustomXMLNodes; - private constructor(); + interface CustomXMLNodes { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): CustomXMLNode; readonly Parent: any; + (Index: number): CustomXMLNode; } class CustomXMLPart { @@ -3994,11 +4210,11 @@ declare namespace Office { private constructor(); /** - * @param string [Name=''] - * @param string [NamespaceURI=''] - * @param Office.CustomXMLNode [NextSibling=0] - * @param Office.MsoCustomXMLNodeType [NodeType=1] - * @param string [NodeValue=''] + * @param Name [Name=''] + * @param NamespaceURI [NamespaceURI=''] + * @param NextSibling [NextSibling=0] + * @param NodeType [NodeType=1] + * @param NodeValue [NodeValue=''] */ AddNode(Parent: CustomXMLNode, Name?: string, NamespaceURI?: string, NextSibling?: CustomXMLNode, NodeType?: MsoCustomXMLNodeType, NodeValue?: string): void; readonly Application: any; @@ -4019,19 +4235,17 @@ declare namespace Office { readonly XML: string; } - class CustomXMLParts { - private 'Office.CustomXMLParts_typekey': CustomXMLParts; - private constructor(); - - /** @param string [XML=''] */ - Add(XML?: string, SchemaCollection?: any): CustomXMLPart; + interface CustomXMLParts { + /** @param XML [XML=''] */ + Add(XML?: string, SchemaCollection?: CustomXMLSchemaCollection): CustomXMLPart; readonly Application: any; readonly Count: number; readonly Creator: number; - Item(Index: any): CustomXMLPart; + Item(Index: number | string): CustomXMLPart; readonly Parent: any; SelectByID(Id: string): CustomXMLPart; SelectByNamespace(NamespaceURI: string): CustomXMLParts; + (Index: number | string): CustomXMLPart; } class CustomXMLPrefixMapping { @@ -4044,17 +4258,16 @@ declare namespace Office { readonly Prefix: string; } - class CustomXMLPrefixMappings { - private 'Office.CustomXMLPrefixMappings_typekey': CustomXMLPrefixMappings; - private constructor(); + interface CustomXMLPrefixMappings { AddNamespace(Prefix: string, NamespaceURI: string): void; readonly Application: any; readonly Count: number; readonly Creator: number; - Item(Index: any): CustomXMLPrefixMapping; + Item(Index: number | string): CustomXMLPrefixMapping; LookupNamespace(Prefix: string): string; LookupPrefix(NamespaceURI: string): string; readonly Parent: any; + (Index: number | string): CustomXMLPrefixMapping; } class CustomXMLSchema { @@ -4069,25 +4282,23 @@ declare namespace Office { Reload(): void; } - class CustomXMLSchemaCollection { - private 'Office.CustomXMLSchemaCollection_typekey': CustomXMLSchemaCollection; - private constructor(); - + interface CustomXMLSchemaCollection { /** - * @param string [NamespaceURI=''] - * @param string [Alias=''] - * @param string [FileName=''] - * @param boolean [InstallForAllUsers=false] + * @param NamespaceURI [NamespaceURI=''] + * @param Alias [Alias=''] + * @param FileName [FileName=''] + * @param InstallForAllUsers [InstallForAllUsers=false] */ Add(NamespaceURI?: string, Alias?: string, FileName?: string, InstallForAllUsers?: boolean): CustomXMLSchema; AddCollection(SchemaCollection: CustomXMLSchemaCollection): void; readonly Application: any; readonly Count: number; readonly Creator: number; - Item(Index: any): CustomXMLSchema; + Item(Index: number | string): CustomXMLSchema; NamespaceURI(Index: number): string; readonly Parent: any; Validate(): boolean; + (Index: number | string): CustomXMLSchema; } class CustomXMLValidationError { @@ -4104,13 +4315,10 @@ declare namespace Office { readonly Type: MsoCustomXMLValidationErrorType; } - class CustomXMLValidationErrors { - private 'Office.CustomXMLValidationErrors_typekey': CustomXMLValidationErrors; - private constructor(); - + interface CustomXMLValidationErrors { /** - * @param string [ErrorText=''] - * @param boolean [ClearedOnUpdate=true] + * @param ErrorText [ErrorText=''] + * @param ClearedOnUpdate [ClearedOnUpdate=true] */ Add(Node: CustomXMLNode, ErrorName: string, ErrorText?: string, ClearedOnUpdate?: boolean): void; readonly Application: any; @@ -4118,6 +4326,7 @@ declare namespace Office { readonly Creator: number; Item(Index: number): CustomXMLValidationError; readonly Parent: any; + (Index: number): CustomXMLValidationError; } class DiagramNode { @@ -4125,14 +4334,14 @@ declare namespace Office { private constructor(); /** - * @param Office.MsoRelativeNodePosition [Pos=2] - * @param Office.MsoDiagramNodeType [NodeType=1] + * @param Pos [Pos=2] + * @param NodeType [NodeType=1] */ AddNode(Pos?: MsoRelativeNodePosition, NodeType?: MsoDiagramNodeType): DiagramNode; readonly Application: any; readonly Children: DiagramNodeChildren; - /** @param Office.MsoRelativeNodePosition [Pos=2] */ + /** @param Pos [Pos=2] */ CloneNode(CopyChildren: boolean, TargetNode: DiagramNode, Pos?: MsoRelativeNodePosition): DiagramNode; readonly Creator: number; Delete(): void; @@ -4146,19 +4355,16 @@ declare namespace Office { readonly Root: DiagramNode; readonly Shape: Shape; - /** @param boolean [SwapChildren=true] */ + /** @param SwapChildren [SwapChildren=true] */ SwapNode(TargetNode: DiagramNode, SwapChildren?: boolean): void; readonly TextShape: Shape; TransferChildren(ReceivingNode: DiagramNode): void; } - class DiagramNodeChildren { - private 'Office.DiagramNodeChildren_typekey': DiagramNodeChildren; - private constructor(); - + interface DiagramNodeChildren { /** - * @param any [Index=-1] - * @param Office.MsoDiagramNodeType [NodeType=1] + * @param Index [Index=-1] + * @param NodeType [NodeType=1] */ AddNode(Index?: any, NodeType?: MsoDiagramNodeType): DiagramNode; readonly Application: any; @@ -4169,17 +4375,17 @@ declare namespace Office { readonly LastChild: DiagramNode; readonly Parent: any; SelectAll(): void; + (Index: any): DiagramNode; } - class DiagramNodes { - private 'Office.DiagramNodes_typekey': DiagramNodes; - private constructor(); + interface DiagramNodes { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: any): DiagramNode; readonly Parent: any; SelectAll(): void; + (Index: any): DiagramNode; } class DocumentInspector { @@ -4194,25 +4400,23 @@ declare namespace Office { readonly Parent: any; } - class DocumentInspectors { - private 'Office.DocumentInspectors_typekey': DocumentInspectors; - private constructor(); + interface DocumentInspectors { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): DocumentInspector; readonly Parent: any; + (Index: number): DocumentInspector; } - class DocumentProperties { - private 'Office.DocumentProperties_typekey': DocumentProperties; - private constructor(); + interface DocumentProperties { Add(Name: string, LinkToContent: boolean, Type?: MsoDocProperties, Value?: any, LinkSource?: string): DocumentProperty; Application: TApplication; Count: number; Creator: number; Item(index: string | number): DocumentProperty; Parent: any; + (index: string | number): DocumentProperty; } class DocumentProperty { @@ -4237,22 +4441,21 @@ declare namespace Office { readonly Creator: number; Delete(): void; readonly Index: number; - readonly Modified: any; + readonly Modified: VarDate; readonly ModifiedBy: string; Open(): any; readonly Parent: any; Restore(): any; } - class DocumentLibraryVersions { - private 'Office.DocumentLibraryVersions_typekey': DocumentLibraryVersions; - private constructor(); + interface DocumentLibraryVersions { readonly Application: any; readonly Count: number; readonly Creator: number; readonly IsVersioningEnabled: boolean; Item(lIndex: number): DocumentLibraryVersion; readonly Parent: any; + (lIndex: number): DocumentLibraryVersion; } class EffectParameter { @@ -4264,13 +4467,12 @@ declare namespace Office { Value: any; } - class EffectParameters { - private 'Office.EffectParameters_typekey': EffectParameters; - private constructor(); + interface EffectParameters { readonly Application: any; readonly Count: number; readonly Creator: number; - Item(Index: any): EffectParameter; + Item(Index: string | number): EffectParameter; + (Index: string | number): EffectParameter; } class FileDialog { @@ -4303,10 +4505,8 @@ declare namespace Office { readonly Parent: any; } - class FileDialogFilters { - private 'Office.FileDialogFilters_typekey': FileDialogFilters; - private constructor(); - Add(Description: string, Extensions: string, Position?: any): FileDialogFilter; + interface FileDialogFilters { + Add(Description: string, Extensions: string, Position?: number): FileDialogFilter; readonly Application: any; Clear(): void; readonly Count: number; @@ -4314,16 +4514,16 @@ declare namespace Office { Delete(filter?: any): void; Item(Index: number): FileDialogFilter; readonly Parent: any; + (Index: number): FileDialogFilter; } - class FileDialogSelectedItems { - private 'Office.FileDialogSelectedItems_typekey': FileDialogSelectedItems; - private constructor(); + interface FileDialogSelectedItems { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): string; readonly Parent: any; + (Index: number): string; } class FileSearch { @@ -4333,9 +4533,9 @@ declare namespace Office { readonly Creator: number; /** - * @param Office.MsoSortBy [SortBy=1] - * @param Office.MsoSortOrder [SortOrder=1] - * @param boolean [AlwaysAccurate=true] + * @param SortBy [SortBy=1] + * @param SortOrder [SortOrder=1] + * @param AlwaysAccurate [AlwaysAccurate=true] */ Execute(SortBy?: MsoSortBy, SortOrder?: MsoSortOrder, AlwaysAccurate?: boolean): number; FileName: string; @@ -4355,15 +4555,14 @@ declare namespace Office { TextOrProperty: string; } - class FileTypes { - private 'Office.FileTypes_typekey': FileTypes; - private constructor(); + interface FileTypes { Add(FileType: MsoFileType): void; readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): MsoFileType; Remove(Index: number): void; + (Index: number): MsoFileType; } class FillFormat { @@ -4448,13 +4647,12 @@ declare namespace Office { WordArtformat: MsoPresetTextEffect; } - class FoundFiles { - private 'Office.FoundFiles_typekey': FoundFiles; - private constructor(); + interface FoundFiles { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): string; + (Index: number): string; } class FreeformBuilder { @@ -4462,10 +4660,10 @@ declare namespace Office { private constructor(); /** - * @param number [X2=0] - * @param number [Y2=0] - * @param number [X3=0] - * @param number [Y3=0] + * @param X2 [X2=0] + * @param Y2 [Y2=0] + * @param X3 [X3=0] + * @param Y3 [Y3=0] */ AddNodes(SegmentType: MsoSegmentType, EditingType: MsoEditingType, X1: number, Y1: number, X2?: number, Y2?: number, X3?: number, Y3?: number): void; readonly Application: any; @@ -4494,40 +4692,38 @@ declare namespace Office { Transparency: number; } - class GradientStops { - private 'Office.GradientStops_typekey': GradientStops; - private constructor(); + interface GradientStops { readonly Application: any; readonly Count: number; readonly Creator: number; - /** @param number [Index=-1] */ + /** @param Index [Index=-1] */ Delete(Index?: number): void; /** - * @param number [Transparency=0] - * @param number [Index=-1] + * @param Transparency [Transparency=0] + * @param Index [Index=-1] */ Insert(RGB: number, Position: number, Transparency?: number, Index?: number): void; /** - * @param number [Transparency=0] - * @param number [Index=-1] - * @param number [Brightness=0] + * @param Transparency [Transparency=0] + * @param Index [Index=-1] + * @param Brightness [Brightness=0] */ Insert2(RGB: number, Position: number, Transparency?: number, Index?: number, Brightness?: number): void; Item(Index: number): GradientStop; + (Index: number): GradientStop; } - class GroupShapes { - private 'Office.GroupShapes_typekey': GroupShapes; - private constructor(); + interface GroupShapes { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: any): Shape; readonly Parent: any; Range(Index: any): ShapeRange; + (Index: any): Shape; } class HTMLProject { @@ -4537,14 +4733,14 @@ declare namespace Office { readonly Creator: number; readonly HTMLProjectItems: HTMLProjectItems; - /** @param Office.MsoHTMLProjectOpen [OpenKind=0] */ + /** @param OpenKind [OpenKind=0] */ Open(OpenKind?: MsoHTMLProjectOpen): void; readonly Parent: any; - /** @param boolean [Refresh=true] */ + /** @param Refresh [Refresh=true] */ RefreshDocument(Refresh?: boolean): void; - /** @param boolean [Refresh=true] */ + /** @param Refresh [Refresh=true] */ RefreshProject(Refresh?: boolean): void; readonly State: MsoHTMLProjectState; } @@ -4558,21 +4754,20 @@ declare namespace Office { LoadFromFile(FileName: string): void; readonly Name: string; - /** @param Office.MsoHTMLProjectOpen [OpenKind=0] */ + /** @param OpenKind [OpenKind=0] */ Open(OpenKind?: MsoHTMLProjectOpen): void; readonly Parent: any; SaveCopyAs(FileName: string): void; Text: string; } - class HTMLProjectItems { - private 'Office.HTMLProjectItems_typekey': HTMLProjectItems; - private constructor(); + interface HTMLProjectItems { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: any): HTMLProjectItem; readonly Parent: any; + (Index: any): HTMLProjectItem; } class IAssistance { @@ -4584,7 +4779,7 @@ declare namespace Office { /** * SearchHelp Method - * @param string [Scope=''] + * @param Scope [Scope=''] */ SearchHelp(Query: string, Scope?: string): void; @@ -4593,12 +4788,14 @@ declare namespace Office { /** * ShowHelp Method - * @param string [HelpId=''] - * @param string [Scope=''] + * @param HelpId [HelpId=''] + * @param Scope [Scope=''] */ ShowHelp(HelpId?: string, Scope?: string): void; } + /** For Macintosh only */ + // tslint:disable-next-line:interface-name class IFind { private 'Office.IFind_typekey': IFind; private constructor(); @@ -4631,11 +4828,12 @@ declare namespace Office { View: MsoFileFindView; } - class IFoundFiles { - private 'Office.IFoundFiles_typekey': IFoundFiles; - private constructor(); + /** For Macintosh only */ + // tslint:disable-next-line:interface-name + interface IFoundFiles { readonly Count: number; Item(Index: number): string; + (Index: number): string; } class IMsoBorder { @@ -4669,52 +4867,52 @@ declare namespace Office { private 'Office.IMsoChart_typekey': IMsoChart; private constructor(); - /** @param Office.XlDataLabelsType [Type=2] */ + /** @param Type [Type=2] */ _ApplyDataLabels(Type?: XlDataLabelsType, IMsoLegendKey?: any, AutoText?: any, HasLeaderLines?: any): void; readonly Application: any; ApplyChartTemplate(bstrFileName: string): void; ApplyCustomType(ChartType: XlChartType, TypeName?: any): void; - /** @param Office.XlDataLabelsType [Type=2] */ - ApplyDataLabels( - Type?: XlDataLabelsType, IMsoLegendKey?: any, AutoText?: any, HasLeaderLines?: any, ShowSeriesName?: any, ShowCategoryName?: any, ShowValue?: any, - ShowPercentage?: any, ShowBubbleSize?: any, Separator?: any): void; + /** @param Type [Type=2] */ + ApplyDataLabels(Type?: XlDataLabelsType, IMsoLegendKey?: any, AutoText?: any, HasLeaderLines?: any, ShowSeriesName?: any, ShowCategoryName?: any, ShowValue?: any, ShowPercentage?: any, ShowBubbleSize?: any, Separator?: any): void; ApplyLayout(Layout: number, varChartType?: any): void; readonly Area3DGroup: IMsoChartGroup; AreaGroups(Index?: any): any; AutoFormat(rGallery: number, varFormat?: any): void; AutoScaling: boolean; - /** @param Office.XlAxisGroup [AxisGroup=1] */ + /** @param AxisGroup [AxisGroup=1] */ Axes(Type: any, AxisGroup?: XlAxisGroup): any; readonly BackWall: IMsoWalls; readonly Bar3DGroup: IMsoChartGroup; BarGroups(Index?: any): any; BarShape: XlBarShape; + CategoryLabelLevel: XlCategoryLabelLevel; readonly ChartArea: IMsoChartArea; + ChartColor: any; readonly ChartData: IMsoChartData; ChartGroups(pvarIndex?: any, varIgallery?: any): any; ChartStyle: any; readonly ChartTitle: IMsoChartTitle; ChartType: XlChartType; - ChartWizard( - varSource?: any, varGallery?: any, varFormat?: any, varPlotBy?: any, varCategoryLabels?: any, varSeriesLabels?: any, varHasLegend?: any, varTitle?: any, - varCategoryTitle?: any, varValueTitle?: any, varExtraTitle?: any): void; + ChartWizard(varSource?: any, varGallery?: any, varFormat?: any, varPlotBy?: any, varCategoryLabels?: any, varSeriesLabels?: any, varHasLegend?: any, varTitle?: any, varCategoryTitle?: any, varValueTitle?: any, varExtraTitle?: any): void; + ClearToMatchColorStyle(): void; ClearToMatchStyle(): void; readonly Column3DGroup: IMsoChartGroup; ColumnGroups(Index?: any): any; Copy(): any; /** - * @param number [Appearance=1] - * @param number [Format=-4147] - * @param number [Size=2] + * @param Appearance [Appearance=1] + * @param Format [Format=-4147] + * @param Size [Size=2] */ CopyPicture(Appearance?: number, Format?: number, Size?: number): void; readonly Corners: IMsoCorners; readonly Creator: number; readonly DataTable: IMsoDataTable; Delete(): any; + DeleteHiddenContent(): void; DepthPercent: number; DisplayBlanksAs: XlDisplayBlanksAs; DoughnutGroups(Index?: any): any; @@ -4722,10 +4920,12 @@ declare namespace Office { Export(bstr: string, varFilterName?: any, varInteractive?: any): boolean; readonly Floor: IMsoFloor; readonly Format: IMsoChartFormat; + FullSeriesCollection(Index?: any): any; GapDepth: number; GetChartElement(x: number, y: number, ElementID: number, Arg1: number, Arg2: number): void; HasAxis(axisType?: any, AxisGroup?: any): any; HasDataTable: boolean; + readonly HasHiddenContent: boolean; HasLegend: boolean; HasPivotFields: boolean; HasTitle: boolean; @@ -4749,6 +4949,7 @@ declare namespace Office { SaveChartTemplate(bstrFileName: string): void; Select(Replace?: any): any; SeriesCollection(Index?: any): any; + SeriesNameLevel: XlSeriesNameLevel; SetDefaultChart(varName: any): void; SetElement(RHS: MsoChartElementType): void; SetSourceData(Source: string, PlotBy?: any): void; @@ -4756,6 +4957,7 @@ declare namespace Office { ShowAllFieldButtons: boolean; ShowAxisFieldButtons: boolean; ShowDataLabelsOverMaximum: boolean; + ShowExpandCollapseEntireFieldButtons: boolean; ShowLegendFieldButtons: boolean; ShowReportFilterFieldButtons: boolean; ShowValueFieldButtons: boolean; @@ -4764,7 +4966,7 @@ declare namespace Office { readonly SurfaceGroup: IMsoChartGroup; Type: number; - /** @param boolean [fBackWall=true] */ + /** @param fBackWall [fBackWall=true] */ Walls(fBackWall?: boolean): IMsoWalls; XYGroups(Index?: any): any; } @@ -4799,6 +5001,7 @@ declare namespace Office { private 'Office.IMsoChartData_typekey': IMsoChartData; private constructor(); Activate(): void; + ActivateChartDataWindow(): void; BreakLink(): void; readonly IsLinked: boolean; readonly Workbook: any; @@ -4807,7 +5010,9 @@ declare namespace Office { class IMsoChartFormat { private 'Office.IMsoChartFormat_typekey': IMsoChartFormat; private constructor(); + readonly Adjustments: Adjustments; readonly Application: any; + AutoShapeType: MsoAutoShapeType; readonly Creator: number; readonly Fill: FillFormat; readonly Glow: GlowFormat; @@ -4825,12 +5030,21 @@ declare namespace Office { private constructor(); readonly Application: any; AxisGroup: number; + BinsCountValue: number; + BinsOverflowEnabled: boolean; + BinsOverflowValue: number; + BinsType: XlBinsType; + BinsUnderflowEnabled: boolean; + BinsUnderflowValue: number; + BinWidthValue: number; BubbleScale: number; + CategoryCollection(Index?: any): any; readonly Creator: number; DoughnutHoleSize: number; readonly DownBars: IMsoDownBars; readonly DropLines: IMsoDropLines; FirstSliceAngle: number; + FullCategoryCollection(Index?: any): any; GapWidth: number; Has3DShading: boolean; HasDropLines: boolean; @@ -5137,18 +5351,17 @@ declare namespace Office { Weight: number; } - class MetaProperties { - private 'Office.MetaProperties_typekey': MetaProperties; - private constructor(); + interface MetaProperties { readonly Application: any; readonly Count: number; readonly Creator: number; GetItemByInternalName(InternalName: string): MetaProperty; - Item(Index: any): MetaProperty; + Item(Index: number | string): MetaProperty; readonly Parent: any; readonly SchemaXml: string; Validate(): string; readonly ValidationError: string; + (Index: number | string): MetaProperty; } class MetaProperty { @@ -5170,31 +5383,33 @@ declare namespace Office { class MsoDebugOptions { private 'Office.MsoDebugOptions_typekey': MsoDebugOptions; private constructor(); + AddIgnoredAssertTag(bstrTagToIgnore: string): void; readonly Application: any; readonly Creator: number; FeatureReports: number; OutputToDebugger: boolean; OutputToFile: boolean; OutputToMessageBox: boolean; + RemoveIgnoredAssertTag(bstrTagToIgnore: string): void; readonly UnitTestManager: any; } class MsoEnvelope { private 'Office.MsoEnvelope_typekey': MsoEnvelope; private constructor(); - readonly CommandBars: any; + readonly CommandBars: CommandBars; Introduction: string; - readonly Item: any; + readonly Item: Outlook.MailItem; readonly Parent: any; } class NewFile { private 'Office.NewFile_typekey': NewFile; private constructor(); - Add(FileName: string, Section?: any, DisplayName?: any, Action?: any): boolean; + Add(FileName: string, Section?: MsoFileNewSection, DisplayName?: string, Action?: MsoFileNewAction): boolean; readonly Application: any; readonly Creator: number; - Remove(FileName: string, Section?: any, DisplayName?: any, Action?: any): boolean; + Remove(FileName: string, Section?: MsoFileNewSection, DisplayName?: string, Action?: MsoFileNewAction): boolean; } class OfficeTheme { @@ -5234,10 +5449,8 @@ declare namespace Office { WordWrap: MsoTriState; } - class Permission { - private 'Office.Permission_typekey': Permission; - private constructor(); - Add(UserId: string, Permission?: any, ExpirationDate?: any): UserPermission; + interface Permission { + Add(UserId: string, Permission?: MsoPermission, ExpirationDate?: VarDate): UserPermission; readonly Application: any; ApplyPolicy(FileName: string): void; readonly Count: number; @@ -5253,6 +5466,7 @@ declare namespace Office { RemoveAll(): void; RequestPermissionURL: string; StoreLicenses: boolean; + (Index: any): UserPermission; } class PickerDialog { @@ -5266,8 +5480,8 @@ declare namespace Office { Resolve(TokenText: string, duplicateDlgMode: number): PickerResults; /** - * @param boolean [IsMultiSelect=true] - * @param Office.PickerResults [ExistingResults=0] + * @param IsMultiSelect [IsMultiSelect=true] + * @param ExistingResults [ExistingResults=0] */ Show(IsMultiSelect?: boolean, ExistingResults?: PickerResults): PickerResults; Title: string; @@ -5283,24 +5497,22 @@ declare namespace Office { readonly Type: MsoPickerField; } - class PickerFields { - private 'Office.PickerFields_typekey': PickerFields; - private constructor(); + interface PickerFields { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): PickerField; + (Index: number): PickerField; } - class PickerProperties { - private 'Office.PickerProperties_typekey': PickerProperties; - private constructor(); + interface PickerProperties { Add(Id: string, Value: string, Type: MsoPickerField): PickerProperty; readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): PickerProperty; Remove(Id: string): void; + (Index: number): PickerProperty; } class PickerProperty { @@ -5328,16 +5540,14 @@ declare namespace Office { Type: string; } - class PickerResults { - private 'Office.PickerResults_typekey': PickerResults; - private constructor(); - - /** @param string [SIPId=''] */ + interface PickerResults { + /** @param SIPId [SIPId=''] */ Add(Id: string, DisplayName: string, Type: string, SIPId?: string, ItemData?: any, SubItems?: any): PickerResult; readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): PickerResult; + (Index: number): PickerResult; } class PictureEffect { @@ -5352,19 +5562,18 @@ declare namespace Office { Visible: MsoTriState; } - class PictureEffects { - private 'Office.PictureEffects_typekey': PictureEffects; - private constructor(); + interface PictureEffects { readonly Application: any; readonly Count: number; readonly Creator: number; - /** @param number [Index=-1] */ + /** @param Index [Index=-1] */ Delete(Index?: number): void; - /** @param number [Position=-1] */ + /** @param Position [Position=-1] */ Insert(EffectType: MsoPictureEffectType, Position?: number): PictureEffect; Item(Index: number): PictureEffect; + (Index: number): PictureEffect; } class PictureFormat { @@ -5411,17 +5620,15 @@ declare namespace Office { readonly Value: any; } - class PropertyTests { - private 'Office.PropertyTests_typekey': PropertyTests; - private constructor(); - - /** @param Office.MsoConnector [Connector=1] */ + interface PropertyTests { + /** @param Connector [Connector=1] */ Add(Name: string, Condition: MsoCondition, Value: any, SecondValue: any, Connector?: MsoConnector): void; readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): PropertyTest; Remove(Index: number): void; + (Index: number): PropertyTest; } class ReflectionFormat { @@ -5456,14 +5663,13 @@ declare namespace Office { readonly Parent: any; } - class RulerLevels2 { - private 'Office.RulerLevels2_typekey': RulerLevels2; - private constructor(); + interface RulerLevels2 { readonly Application: any; readonly Count: number; readonly Creator: number; - Item(Index: any): RulerLevel2; + Item(Index: 1 | 2 | 3 | 4 | 5): RulerLevel2; readonly Parent: any; + (Index: 1 | 2 | 3 | 4 | 5): RulerLevel2; } class ScopeFolder { @@ -5477,13 +5683,12 @@ declare namespace Office { readonly ScopeFolders: ScopeFolders; } - class ScopeFolders { - private 'Office.ScopeFolders_typekey': ScopeFolders; - private constructor(); + interface ScopeFolders { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): ScopeFolder; + (Index: number): ScopeFolder; } class Script { @@ -5501,16 +5706,13 @@ declare namespace Office { readonly Shape: any; } - class Scripts { - private 'Office.Scripts_typekey': Scripts; - private constructor(); - + interface Scripts { /** - * @param Office.MsoScriptLocation [Location=2] - * @param Office.MsoScriptLanguage [Language=2] - * @param string [Id=''] - * @param string [Extended=''] - * @param string [ScriptText=''] + * @param Location [Location=2] + * @param Language [Language=2] + * @param Id [Id=''] + * @param Extended [Extended=''] + * @param ScriptText [ScriptText=''] */ Add(Anchor?: any, Location?: MsoScriptLocation, Language?: MsoScriptLanguage, Id?: string, Extended?: string, ScriptText?: string): Script; readonly Application: any; @@ -5519,17 +5721,17 @@ declare namespace Office { Delete(): void; Item(Index: any): Script; readonly Parent: any; + (Index: any): Script; } - class SearchFolders { - private 'Office.SearchFolders_typekey': SearchFolders; - private constructor(); + interface SearchFolders { Add(ScopeFolder: ScopeFolder): void; readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): ScopeFolder; Remove(Index: number): void; + (Index: number): ScopeFolder; } class SearchScope { @@ -5541,28 +5743,26 @@ declare namespace Office { readonly Type: MsoSearchIn; } - class SearchScopes { - private 'Office.SearchScopes_typekey': SearchScopes; - private constructor(); + interface SearchScopes { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): SearchScope; + (Index: number): SearchScope; } - class ServerPolicy { - private 'Office.ServerPolicy_typekey': ServerPolicy; - private constructor(); + interface ServerPolicy { readonly Application: any; readonly BlockPreview: boolean; readonly Count: number; readonly Creator: number; readonly Description: string; readonly Id: string; - Item(Index: any): PolicyItem; + Item(Index: number | string): PolicyItem; readonly Name: string; readonly Parent: any; readonly Statement: string; + (Index: number | string): PolicyItem; } class ShadowFormat { @@ -5643,10 +5843,10 @@ declare namespace Office { Rotation: number; readonly RTF: string; - /** @param Office.MsoScaleFrom [fScale=0] */ + /** @param fScale [fScale=0] */ ScaleHeight(Factor: number, RelativeToOriginalSize: MsoTriState, fScale?: MsoScaleFrom): void; - /** @param Office.MsoScaleFrom [fScale=0] */ + /** @param fScale [fScale=0] */ ScaleWidth(Factor: number, RelativeToOriginalSize: MsoTriState, fScale?: MsoScaleFrom): void; readonly Script: Script; Select(Replace?: any): void; @@ -5682,19 +5882,17 @@ declare namespace Office { readonly SegmentType: MsoSegmentType; } - class ShapeNodes { - private 'Office.ShapeNodes_typekey': ShapeNodes; - private constructor(); + interface ShapeNodes { readonly Application: any; readonly Count: number; readonly Creator: number; Delete(Index: number): void; /** - * @param number [X2=0] - * @param number [Y2=0] - * @param number [X3=0] - * @param number [Y3=0] + * @param X2 [X2=0] + * @param Y2 [Y2=0] + * @param X3 [X3=0] + * @param Y3 [Y3=0] */ Insert(Index: number, SegmentType: MsoSegmentType, EditingType: MsoEditingType, X1: number, Y1: number, X2?: number, Y2?: number, X3?: number, Y3?: number): void; Item(Index: any): ShapeNode; @@ -5702,11 +5900,10 @@ declare namespace Office { SetEditingType(Index: number, EditingType: MsoEditingType): void; SetPosition(Index: number, X1: number, Y1: number): void; SetSegmentType(Index: number, SegmentType: MsoSegmentType): void; + (Index: any): ShapeNode; } - class ShapeRange { - private 'Office.ShapeRange_typekey': ShapeRange; - private constructor(); + interface ShapeRange { readonly Adjustments: Adjustments; Align(AlignCmd: MsoAlignCmd, RelativeTo: MsoTriState): void; AlternativeText: string; @@ -5753,6 +5950,9 @@ declare namespace Office { Left: number; readonly Line: LineFormat; LockAspectRatio: MsoTriState; + + /** @param PrimaryShape [PrimaryShape=0] */ + MergeShapes(MergeCmd: MsoMergeCmd, PrimaryShape?: Shape): void; Name: string; readonly Nodes: ShapeNodes; readonly Parent: any; @@ -5765,10 +5965,10 @@ declare namespace Office { Rotation: number; readonly RTF: string; - /** @param Office.MsoScaleFrom [fScale=0] */ + /** @param fScale [fScale=0] */ ScaleHeight(Factor: number, RelativeToOriginalSize: MsoTriState, fScale?: MsoScaleFrom): void; - /** @param Office.MsoScaleFrom [fScale=0] */ + /** @param fScale [fScale=0] */ ScaleWidth(Factor: number, RelativeToOriginalSize: MsoTriState, fScale?: MsoScaleFrom): void; readonly Script: Script; Select(Replace?: any): void; @@ -5790,22 +5990,32 @@ declare namespace Office { Width: number; ZOrder(ZOrderCmd: MsoZOrderCmd): void; readonly ZOrderPosition: number; + (Index: any): Shape; } - class Shapes { - private 'Office.Shapes_typekey': Shapes; - private constructor(); + interface Shapes { AddCallout(Type: MsoCalloutType, Left: number, Top: number, Width: number, Height: number): Shape; AddCanvas(Left: number, Top: number, Width: number, Height: number): Shape; /** - * @param Office.XlChartType [Type=-1] - * @param number [Left=-1] - * @param number [Top=-1] - * @param number [Width=-1] - * @param number [Height=-1] + * @param Type [Type=-1] + * @param Left [Left=-1] + * @param Top [Top=-1] + * @param Width [Width=-1] + * @param Height [Height=-1] */ AddChart(Type?: XlChartType, Left?: number, Top?: number, Width?: number, Height?: number): Shape; + + /** + * @param Style [Style=-1] + * @param Type [Type=-1] + * @param Left [Left=-1] + * @param Top [Top=-1] + * @param Width [Width=-1] + * @param Height [Height=-1] + * @param NewLayout [NewLayout=true] + */ + AddChart2(Style?: number, Type?: XlChartType, Left?: number, Top?: number, Width?: number, Height?: number, NewLayout?: boolean): Shape; AddConnector(Type: MsoConnectorType, BeginX: number, BeginY: number, EndX: number, EndY: number): Shape; AddCurve(SafeArrayOfPoints: any): Shape; AddDiagram(Type: MsoDiagramType, Left: number, Top: number, Width: number, Height: number): Shape; @@ -5813,18 +6023,18 @@ declare namespace Office { AddLine(BeginX: number, BeginY: number, EndX: number, EndY: number): Shape; /** - * @param number [Width=-1] - * @param number [Height=-1] + * @param Width [Width=-1] + * @param Height [Height=-1] */ AddPicture(FileName: string, LinkToFile: MsoTriState, SaveWithDocument: MsoTriState, Left: number, Top: number, Width?: number, Height?: number): Shape; AddPolyline(SafeArrayOfPoints: any): Shape; AddShape(Type: MsoAutoShapeType, Left: number, Top: number, Width: number, Height: number): Shape; /** - * @param number [Left=-1] - * @param number [Top=-1] - * @param number [Width=-1] - * @param number [Height=-1] + * @param Left [Left=-1] + * @param Top [Top=-1] + * @param Width [Width=-1] + * @param Height [Height=-1] */ AddSmartArt(Layout: SmartArtLayout, Left?: number, Top?: number, Width?: number, Height?: number): Shape; AddTable(NumRows: number, NumColumns: number, Left: number, Top: number, Width: number, Height: number): Shape; @@ -5840,6 +6050,7 @@ declare namespace Office { readonly Parent: any; Range(Index: any): ShapeRange; SelectAll(): void; + (Index: any): Shape; } class SharedWorkspace { @@ -5847,13 +6058,13 @@ declare namespace Office { private constructor(); readonly Application: any; readonly Connected: boolean; - CreateNew(URL?: any, Name?: any): void; + CreateNew(URL?: string, Name?: string): void; readonly Creator: number; Delete(): void; Disconnect(): void; readonly Files: SharedWorkspaceFiles; readonly Folders: SharedWorkspaceFolders; - readonly LastRefreshed: any; + readonly LastRefreshed: VarDate; readonly Links: SharedWorkspaceLinks; readonly Members: SharedWorkspaceMembers; Name: string; @@ -5870,25 +6081,24 @@ declare namespace Office { private constructor(); readonly Application: any; readonly CreatedBy: string; - readonly CreatedDate: any; + readonly CreatedDate: VarDate; readonly Creator: number; Delete(): void; readonly ModifiedBy: string; - readonly ModifiedDate: any; + readonly ModifiedDate: VarDate; readonly Parent: any; readonly URL: string; } - class SharedWorkspaceFiles { - private 'Office.SharedWorkspaceFiles_typekey': SharedWorkspaceFiles; - private constructor(); - Add(FileName: string, ParentFolder?: any, OverwriteIfFileAlreadyExists?: any, KeepInSync?: any): SharedWorkspaceFile; + interface SharedWorkspaceFiles { + Add(FileName: string, ParentFolder?: SharedWorkspaceFolder, OverwriteIfFileAlreadyExists?: boolean, KeepInSync?: boolean): SharedWorkspaceFile; readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): SharedWorkspaceFile; readonly ItemCountExceeded: boolean; readonly Parent: any; + (Index: number): SharedWorkspaceFile; } class SharedWorkspaceFolder { @@ -5896,21 +6106,20 @@ declare namespace Office { private constructor(); readonly Application: any; readonly Creator: number; - Delete(DeleteEventIfFolderContainsFiles?: any): void; + Delete(DeleteEventIfFolderContainsFiles?: boolean): void; readonly FolderName: string; readonly Parent: any; } - class SharedWorkspaceFolders { - private 'Office.SharedWorkspaceFolders_typekey': SharedWorkspaceFolders; - private constructor(); - Add(FolderName: string, ParentFolder?: any): SharedWorkspaceFolder; + interface SharedWorkspaceFolders { + Add(FolderName: string, ParentFolder?: SharedWorkspaceFolder): SharedWorkspaceFolder; readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): SharedWorkspaceFolder; readonly ItemCountExceeded: boolean; readonly Parent: any; + (Index: number): SharedWorkspaceFolder; } class SharedWorkspaceLink { @@ -5918,28 +6127,27 @@ declare namespace Office { private constructor(); readonly Application: any; readonly CreatedBy: string; - readonly CreatedDate: any; + readonly CreatedDate: VarDate; readonly Creator: number; Delete(): void; Description: string; readonly ModifiedBy: string; - readonly ModifiedDate: any; + readonly ModifiedDate: VarDate; Notes: string; readonly Parent: any; Save(): void; URL: string; } - class SharedWorkspaceLinks { - private 'Office.SharedWorkspaceLinks_typekey': SharedWorkspaceLinks; - private constructor(); - Add(URL: string, Description?: any, Notes?: any): SharedWorkspaceLink; + interface SharedWorkspaceLinks { + Add(URL: string, Description?: string, Notes?: string): SharedWorkspaceLink; readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): SharedWorkspaceLink; readonly ItemCountExceeded: boolean; readonly Parent: any; + (Index: number): SharedWorkspaceLink; } class SharedWorkspaceMember { @@ -5955,16 +6163,15 @@ declare namespace Office { readonly Parent: any; } - class SharedWorkspaceMembers { - private 'Office.SharedWorkspaceMembers_typekey': SharedWorkspaceMembers; - private constructor(); - Add(Email: string, DomainName: string, DisplayName: string, Role?: any): SharedWorkspaceMember; + interface SharedWorkspaceMembers { + Add(Email: string, DomainName: string, DisplayName: string, Role?: string): SharedWorkspaceMember; readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): SharedWorkspaceMember; readonly ItemCountExceeded: boolean; readonly Parent: any; + (Index: number): SharedWorkspaceMember; } class SharedWorkspaceTask { @@ -5973,13 +6180,13 @@ declare namespace Office { readonly Application: any; AssignedTo: string; readonly CreatedBy: string; - readonly CreatedDate: any; + readonly CreatedDate: VarDate; readonly Creator: number; Delete(): void; Description: string; - DueDate: any; + DueDate: VarDate; readonly ModifiedBy: string; - readonly ModifiedDate: any; + readonly ModifiedDate: VarDate; readonly Parent: any; Priority: MsoSharedWorkspaceTaskPriority; Save(): void; @@ -5987,16 +6194,15 @@ declare namespace Office { Title: string; } - class SharedWorkspaceTasks { - private 'Office.SharedWorkspaceTasks_typekey': SharedWorkspaceTasks; - private constructor(); - Add(Title: string, Status?: any, Priority?: any, Assignee?: any, Description?: any, DueDate?: any): SharedWorkspaceTask; + interface SharedWorkspaceTasks { + Add(Title: string, Status?: MsoSharedWorkspaceTaskStatus, Priority?: MsoSharedWorkspaceTaskPriority, Assignee?: SharedWorkspaceMember, Description?: string, DueDate?: VarDate): SharedWorkspaceTask; readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): SharedWorkspaceTask; readonly ItemCountExceeded: boolean; readonly Parent: any; + (Index: number): SharedWorkspaceTask; } class Signature { @@ -6008,7 +6214,7 @@ declare namespace Office { readonly Creator: number; Delete(): void; readonly Details: SignatureInfo; - readonly ExpireDate: any; + readonly ExpireDate: VarDate; readonly IsCertificateExpired: boolean; readonly IsCertificateRevoked: boolean; readonly IsSignatureLine: boolean; @@ -6019,8 +6225,8 @@ declare namespace Office { readonly Setup: SignatureSetup; ShowDetails(): void; Sign(varSigImg?: any, varDelSuggSigner?: any, varDelSuggSignerLine2?: any, varDelSuggSignerEmail?: any): void; - readonly SignatureLineShape: any; - readonly SignDate: any; + readonly SignatureLineShape: Shape; + readonly SignDate: VarDate; readonly Signer: string; readonly SortHint: number; } @@ -6048,9 +6254,7 @@ declare namespace Office { SignatureText: string; } - class SignatureSet { - private 'Office.SignatureSet_typekey': SignatureSet; - private constructor(); + interface SignatureSet { Add(): Signature; AddNonVisibleSignature(varSigProv?: any): Signature; AddSignatureLine(varSigProv?: any): Signature; @@ -6063,6 +6267,7 @@ declare namespace Office { readonly Parent: any; readonly ShowSignaturesPane: boolean; Subset: MsoSignatureSubset; + (iSig: number): Signature; } class SignatureSetup { @@ -6109,14 +6314,13 @@ declare namespace Office { readonly Parent: any; } - class SmartArtColors { - private 'Office.SmartArtColors_typekey': SmartArtColors; - private constructor(); + interface SmartArtColors { readonly Application: any; readonly Count: number; readonly Creator: number; - Item(Index: any): SmartArtColor; + Item(Index: number | string): SmartArtColor; readonly Parent: any; + (Index: number | string): SmartArtColor; } class SmartArtLayout { @@ -6131,14 +6335,13 @@ declare namespace Office { readonly Parent: any; } - class SmartArtLayouts { - private 'Office.SmartArtLayouts_typekey': SmartArtLayouts; - private constructor(); + interface SmartArtLayouts { readonly Application: any; readonly Count: number; readonly Creator: number; - Item(Index: any): SmartArtLayout; + Item(Index: number | string): SmartArtLayout; readonly Parent: any; + (Index: number | string): SmartArtLayout; } class SmartArtNode { @@ -6146,8 +6349,8 @@ declare namespace Office { private constructor(); /** - * @param Office.MsoSmartArtNodePosition [Position=1] - * @param Office.MsoSmartArtNodeType [Type=1] + * @param Position [Position=1] + * @param Type [Type=1] */ AddNode(Position?: MsoSmartArtNodePosition, Type?: MsoSmartArtNodeType): SmartArtNode; readonly Application: any; @@ -6170,15 +6373,14 @@ declare namespace Office { readonly Type: MsoSmartArtNodeType; } - class SmartArtNodes { - private 'Office.SmartArtNodes_typekey': SmartArtNodes; - private constructor(); + interface SmartArtNodes { Add(): SmartArtNode; readonly Application: any; readonly Count: number; readonly Creator: number; - Item(Index: any): SmartArtNode; + Item(Index: number | string): SmartArtNode; readonly Parent: any; + (Index: number | string): SmartArtNode; } class SmartArtQuickStyle { @@ -6193,14 +6395,13 @@ declare namespace Office { readonly Parent: any; } - class SmartArtQuickStyles { - private 'Office.SmartArtQuickStyles_typekey': SmartArtQuickStyles; - private constructor(); + interface SmartArtQuickStyles { readonly Application: any; readonly Count: number; readonly Creator: number; - Item(Index: any): SmartArtQuickStyle; + Item(Index: number | string): SmartArtQuickStyle; readonly Parent: any; + (Index: number | string): SmartArtQuickStyle; } class SmartDocument { @@ -6209,7 +6410,7 @@ declare namespace Office { readonly Application: any; readonly Creator: number; - /** @param boolean [ConsiderAllSchemas=false] */ + /** @param ConsiderAllSchemas [ConsiderAllSchemas=false] */ PickSolution(ConsiderAllSchemas?: boolean): void; RefreshPane(): void; SolutionID: string; @@ -6232,7 +6433,7 @@ declare namespace Office { readonly Creator: number; readonly ErrorType: MsoSyncErrorType; GetUpdate(): void; - readonly LastSyncTime: any; + readonly LastSyncTime: VarDate; OpenVersion(SyncVersionType: MsoSyncVersionType): void; readonly Parent: any; PutUpdate(): void; @@ -6253,16 +6454,15 @@ declare namespace Office { Type: MsoTabStopType; } - class TabStops2 { - private 'Office.TabStops2_typekey': TabStops2; - private constructor(); + interface TabStops2 { Add(Type: MsoTabStopType, Position: number): TabStop2; readonly Application: any; readonly Count: number; readonly Creator: number; DefaultSpacing: number; - Item(Index: any): TabStop2; + Item(Index: number): TabStop2; readonly Parent: any; + (Index: number): TabStop2; } class TextColumn2 { @@ -6348,8 +6548,8 @@ declare namespace Office { ChangeCase(Type: MsoTextChangeCase): void; /** - * @param number [Start=-1] - * @param number [Length=-1] + * @param Start [Start=-1] + * @param Length [Length=-1] */ Characters(Start?: number, Length?: number): TextRange2; Copy(): void; @@ -6359,42 +6559,48 @@ declare namespace Office { Delete(): void; /** - * @param number [After=0] - * @param Office.MsoTriState [MatchCase=0] - * @param Office.MsoTriState [WholeWords=0] + * @param After [After=0] + * @param MatchCase [MatchCase=0] + * @param WholeWords [WholeWords=0] */ Find(FindWhat: string, After?: number, MatchCase?: MsoTriState, WholeWords?: MsoTriState): TextRange2; readonly Font: Font2; - /** @param string [NewText=''] */ + /** @param NewText [NewText=''] */ InsertAfter(NewText?: string): TextRange2; - /** @param string [NewText=''] */ + /** @param NewText [NewText=''] */ InsertBefore(NewText?: string): TextRange2; - /** @param Office.MsoTriState [Unicode=0] */ + /** + * @param Formula [Formula=''] + * @param Position [Position=-1] + */ + InsertChartField(ChartFieldType: MsoChartFieldType, Formula?: string, Position?: number): TextRange2; + + /** @param Unicode [Unicode=0] */ InsertSymbol(FontName: string, CharNumber: number, Unicode?: MsoTriState): TextRange2; - Item(Index: any): TextRange2; + Item(Index: number): TextRange2; LanguageID: MsoLanguageID; readonly Length: number; /** - * @param number [Start=-1] - * @param number [Length=-1] + * @param Start [Start=-1] + * @param Length [Length=-1] */ Lines(Start?: number, Length?: number): TextRange2; LtrRun(): void; /** - * @param number [Start=-1] - * @param number [Length=-1] + * @param Start [Start=-1] + * @param Length [Length=-1] */ MathZones(Start?: number, Length?: number): TextRange2; readonly ParagraphFormat: ParagraphFormat2; /** - * @param number [Start=-1] - * @param number [Length=-1] + * @param Start [Start=-1] + * @param Length [Length=-1] */ Paragraphs(Start?: number, Length?: number): TextRange2; readonly Parent: any; @@ -6403,24 +6609,24 @@ declare namespace Office { RemovePeriods(): void; /** - * @param number [After=0] - * @param Office.MsoTriState [MatchCase=0] - * @param Office.MsoTriState [WholeWords=0] + * @param After [After=0] + * @param MatchCase [MatchCase=0] + * @param WholeWords [WholeWords=0] */ Replace(FindWhat: string, ReplaceWhat: string, After?: number, MatchCase?: MsoTriState, WholeWords?: MsoTriState): TextRange2; RotatedBounds(X1: number, Y1: number, X2: number, Y2: number, X3: number, Y3: number, x4: number, y4: number): void; RtlRun(): void; /** - * @param number [Start=-1] - * @param number [Length=-1] + * @param Start [Start=-1] + * @param Length [Length=-1] */ Runs(Start?: number, Length?: number): TextRange2; Select(): void; /** - * @param number [Start=-1] - * @param number [Length=-1] + * @param Start [Start=-1] + * @param Length [Length=-1] */ Sentences(Start?: number, Length?: number): TextRange2; readonly Start: number; @@ -6428,8 +6634,8 @@ declare namespace Office { TrimText(): TextRange2; /** - * @param number [Start=-1] - * @param number [Length=-1] + * @param Start [Start=-1] + * @param Length [Length=-1] */ Words(Start?: number, Length?: number): TextRange2; } @@ -6444,9 +6650,7 @@ declare namespace Office { readonly ThemeColorSchemeIndex: MsoThemeColorSchemeIndex; } - class ThemeColorScheme { - private 'Office.ThemeColorScheme_typekey': ThemeColorScheme; - private constructor(); + interface ThemeColorScheme { readonly Application: any; Colors(Index: MsoThemeColorSchemeIndex): ThemeColor; readonly Count: number; @@ -6455,6 +6659,7 @@ declare namespace Office { Load(FileName: string): void; readonly Parent: any; Save(FileName: string): void; + (Index: MsoThemeColorSchemeIndex): ThemeColor; } class ThemeEffectScheme { @@ -6475,14 +6680,13 @@ declare namespace Office { readonly Parent: any; } - class ThemeFonts { - private 'Office.ThemeFonts_typekey': ThemeFonts; - private constructor(); + interface ThemeFonts { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: MsoFontLanguageIndex): ThemeFont; readonly Parent: any; + (Index: MsoFontLanguageIndex): ThemeFont; } class ThemeFontScheme { @@ -6546,7 +6750,7 @@ declare namespace Office { private constructor(); readonly Application: any; readonly Creator: number; - ExpirationDate: any; + ExpirationDate: VarDate; readonly Parent: any; Permission: number; Remove(): void; @@ -6564,13 +6768,12 @@ declare namespace Office { ProportionalFontSize: number; } - class WebPageFonts { - private 'Office.WebPageFonts_typekey': WebPageFonts; - private constructor(); + interface WebPageFonts { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: MsoCharacterSet): WebPageFont; + (Index: MsoCharacterSet): WebPageFont; } class WorkflowTask { @@ -6590,13 +6793,12 @@ declare namespace Office { readonly WorkflowID: string; } - class WorkflowTasks { - private 'Office.WorkflowTasks_typekey': WorkflowTasks; - private constructor(); + interface WorkflowTasks { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): WorkflowTask; + (Index: number): WorkflowTask; } class WorkflowTemplate { @@ -6612,13 +6814,12 @@ declare namespace Office { Show(): number; } - class WorkflowTemplates { - private 'Office.WorkflowTemplates_typekey': WorkflowTemplates; - private constructor(); + interface WorkflowTemplates { readonly Application: any; readonly Count: number; readonly Creator: number; Item(Index: number): WorkflowTemplate; + (Index: number): WorkflowTemplate; } namespace EventHelperTypes { @@ -6703,103 +6904,45 @@ declare namespace Office { } interface ActiveXObject { - on( - obj: Office.CommandBarButton, event: 'Click', argNames: ['Ctrl', 'CancelDefault'], handler: ( - this: Office.CommandBarButton, parameter: {readonly Ctrl: Office.CommandBarButton, CancelDefault: boolean}) => void): void; - on( - obj: Office.CommandBarButton, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Office.CommandBarButton, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; - on( - obj: Office.CommandBarButton, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Office.CommandBarButton, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; + on(obj: Office.CommandBarButton, event: 'Click', argNames: ['Ctrl', 'CancelDefault'], handler: (this: Office.CommandBarButton, parameter: {readonly Ctrl: Office.CommandBarButton, CancelDefault: boolean}) => void): void; + on(obj: Office.CommandBarButton, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Office.CommandBarButton, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; + on(obj: Office.CommandBarButton, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Office.CommandBarButton, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; on(obj: Office.CommandBarButton, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Office.CommandBarButton, parameter: {pctinfo: number}) => void): void; - on( - obj: Office.CommandBarButton, event: 'Invoke', argNames: Office.EventHelperTypes.CommandBarButton_Invoke_ArgNames, handler: ( - this: Office.CommandBarButton, parameter: Office.EventHelperTypes.CommandBarButton_Invoke_Parameter) => void): void; - on( - obj: Office.CommandBarButton, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: ( - this: Office.CommandBarButton, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; + on(obj: Office.CommandBarButton, event: 'Invoke', argNames: Office.EventHelperTypes.CommandBarButton_Invoke_ArgNames, handler: (this: Office.CommandBarButton, parameter: Office.EventHelperTypes.CommandBarButton_Invoke_Parameter) => void): void; + on(obj: Office.CommandBarButton, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Office.CommandBarButton, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; on(obj: Office.CommandBarComboBox, event: 'Change', argNames: ['Ctrl'], handler: (this: Office.CommandBarComboBox, parameter: {readonly Ctrl: Office.CommandBarComboBox}) => void): void; - on( - obj: Office.CommandBarComboBox, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Office.CommandBarComboBox, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; - on( - obj: Office.CommandBarComboBox, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Office.CommandBarComboBox, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; + on(obj: Office.CommandBarComboBox, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Office.CommandBarComboBox, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; + on(obj: Office.CommandBarComboBox, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Office.CommandBarComboBox, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; on(obj: Office.CommandBarComboBox, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Office.CommandBarComboBox, parameter: {pctinfo: number}) => void): void; - on( - obj: Office.CommandBarComboBox, event: 'Invoke', argNames: Office.EventHelperTypes.CommandBarComboBox_Invoke_ArgNames, handler: ( - this: Office.CommandBarComboBox, parameter: Office.EventHelperTypes.CommandBarComboBox_Invoke_Parameter) => void): void; - on( - obj: Office.CommandBarComboBox, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: ( - this: Office.CommandBarComboBox, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; - on( - obj: Office.CommandBars, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Office.CommandBars, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; - on( - obj: Office.CommandBars, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Office.CommandBars, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; + on(obj: Office.CommandBarComboBox, event: 'Invoke', argNames: Office.EventHelperTypes.CommandBarComboBox_Invoke_ArgNames, handler: (this: Office.CommandBarComboBox, parameter: Office.EventHelperTypes.CommandBarComboBox_Invoke_Parameter) => void): void; + on(obj: Office.CommandBarComboBox, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Office.CommandBarComboBox, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; + on(obj: Office.CommandBars, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Office.CommandBars, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; + on(obj: Office.CommandBars, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Office.CommandBars, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; on(obj: Office.CommandBars, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Office.CommandBars, parameter: {pctinfo: number}) => void): void; - on( - obj: Office.CommandBars, event: 'Invoke', argNames: Office.EventHelperTypes.CommandBars_Invoke_ArgNames, handler: ( - this: Office.CommandBars, parameter: Office.EventHelperTypes.CommandBars_Invoke_Parameter) => void): void; + on(obj: Office.CommandBars, event: 'Invoke', argNames: Office.EventHelperTypes.CommandBars_Invoke_ArgNames, handler: (this: Office.CommandBars, parameter: Office.EventHelperTypes.CommandBars_Invoke_Parameter) => void): void; on(obj: Office.CommandBars, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Office.CommandBars, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; - on( - obj: Office.CustomTaskPane, event: 'DockPositionStateChange' | 'VisibleStateChange', argNames: ['CustomTaskPaneInst'], handler: ( - this: Office.CustomTaskPane, parameter: {readonly CustomTaskPaneInst: Office.CustomTaskPane}) => void): void; - on( - obj: Office.CustomTaskPane, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Office.CustomTaskPane, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; - on( - obj: Office.CustomTaskPane, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Office.CustomTaskPane, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; + on(obj: Office.CustomTaskPane, event: 'DockPositionStateChange' | 'VisibleStateChange', argNames: ['CustomTaskPaneInst'], handler: (this: Office.CustomTaskPane, parameter: {readonly CustomTaskPaneInst: Office.CustomTaskPane}) => void): void; + on(obj: Office.CustomTaskPane, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Office.CustomTaskPane, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; + on(obj: Office.CustomTaskPane, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Office.CustomTaskPane, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; on(obj: Office.CustomTaskPane, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Office.CustomTaskPane, parameter: {pctinfo: number}) => void): void; - on( - obj: Office.CustomTaskPane, event: 'Invoke', argNames: Office.EventHelperTypes.CustomTaskPane_Invoke_ArgNames, handler: ( - this: Office.CustomTaskPane, parameter: Office.EventHelperTypes.CustomTaskPane_Invoke_Parameter) => void): void; - on( - obj: Office.CustomTaskPane, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: ( - this: Office.CustomTaskPane, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; - on( - obj: Office.CustomXMLPart, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Office.CustomXMLPart, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; - on( - obj: Office.CustomXMLPart, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Office.CustomXMLPart, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; + on(obj: Office.CustomTaskPane, event: 'Invoke', argNames: Office.EventHelperTypes.CustomTaskPane_Invoke_ArgNames, handler: (this: Office.CustomTaskPane, parameter: Office.EventHelperTypes.CustomTaskPane_Invoke_Parameter) => void): void; + on(obj: Office.CustomTaskPane, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Office.CustomTaskPane, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; + on(obj: Office.CustomXMLPart, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Office.CustomXMLPart, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; + on(obj: Office.CustomXMLPart, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Office.CustomXMLPart, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; on(obj: Office.CustomXMLPart, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Office.CustomXMLPart, parameter: {pctinfo: number}) => void): void; - on( - obj: Office.CustomXMLPart, event: 'Invoke', argNames: Office.EventHelperTypes.CustomXMLPart_Invoke_ArgNames, handler: ( - this: Office.CustomXMLPart, parameter: Office.EventHelperTypes.CustomXMLPart_Invoke_Parameter) => void): void; - on( - obj: Office.CustomXMLPart, event: 'NodeAfterDelete', argNames: ['OldNode', 'OldParentNode', 'OldNextSibling', 'InUndoRedo'], handler: ( - this: Office.CustomXMLPart, - parameter: { - readonly OldNode: Office.CustomXMLNode, readonly OldParentNode: Office.CustomXMLNode, readonly OldNextSibling: Office.CustomXMLNode, readonly InUndoRedo: boolean}) => void): void; - on( - obj: Office.CustomXMLPart, event: 'NodeAfterInsert', argNames: ['NewNode', 'InUndoRedo'], handler: ( - this: Office.CustomXMLPart, parameter: {readonly NewNode: Office.CustomXMLNode, readonly InUndoRedo: boolean}) => void): void; - on( - obj: Office.CustomXMLPart, event: 'NodeAfterReplace', argNames: ['OldNode', 'NewNode', 'InUndoRedo'], handler: ( - this: Office.CustomXMLPart, parameter: {readonly OldNode: Office.CustomXMLNode, readonly NewNode: Office.CustomXMLNode, readonly InUndoRedo: boolean}) => void): void; - on( - obj: Office.CustomXMLPart, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: ( - this: Office.CustomXMLPart, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; - on( - obj: Office.CustomXMLParts, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: ( - this: Office.CustomXMLParts, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; - on( - obj: Office.CustomXMLParts, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: ( - this: Office.CustomXMLParts, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; + on(obj: Office.CustomXMLPart, event: 'Invoke', argNames: Office.EventHelperTypes.CustomXMLPart_Invoke_ArgNames, handler: (this: Office.CustomXMLPart, parameter: Office.EventHelperTypes.CustomXMLPart_Invoke_Parameter) => void): void; + on(obj: Office.CustomXMLPart, event: 'NodeAfterDelete', argNames: ['OldNode', 'OldParentNode', 'OldNextSibling', 'InUndoRedo'], handler: (this: Office.CustomXMLPart, parameter: {readonly OldNode: Office.CustomXMLNode, readonly OldParentNode: Office.CustomXMLNode, readonly OldNextSibling: Office.CustomXMLNode, readonly InUndoRedo: boolean}) => void): void; + on(obj: Office.CustomXMLPart, event: 'NodeAfterInsert', argNames: ['NewNode', 'InUndoRedo'], handler: (this: Office.CustomXMLPart, parameter: {readonly NewNode: Office.CustomXMLNode, readonly InUndoRedo: boolean}) => void): void; + on(obj: Office.CustomXMLPart, event: 'NodeAfterReplace', argNames: ['OldNode', 'NewNode', 'InUndoRedo'], handler: (this: Office.CustomXMLPart, parameter: {readonly OldNode: Office.CustomXMLNode, readonly NewNode: Office.CustomXMLNode, readonly InUndoRedo: boolean}) => void): void; + on(obj: Office.CustomXMLPart, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Office.CustomXMLPart, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; + on(obj: Office.CustomXMLParts, event: 'GetIDsOfNames', argNames: ['riid', 'rgszNames', 'cNames', 'lcid', 'rgdispid'], handler: (this: Office.CustomXMLParts, parameter: {readonly riid: stdole.GUID, readonly rgszNames: number, readonly cNames: number, readonly lcid: number, rgdispid: number}) => void): void; + on(obj: Office.CustomXMLParts, event: 'GetTypeInfo', argNames: ['itinfo', 'lcid', 'pptinfo'], handler: (this: Office.CustomXMLParts, parameter: {readonly itinfo: number, readonly lcid: number, pptinfo: undefined}) => void): void; on(obj: Office.CustomXMLParts, event: 'GetTypeInfoCount', argNames: ['pctinfo'], handler: (this: Office.CustomXMLParts, parameter: {pctinfo: number}) => void): void; - on( - obj: Office.CustomXMLParts, event: 'Invoke', argNames: Office.EventHelperTypes.CustomXMLParts_Invoke_ArgNames, handler: ( - this: Office.CustomXMLParts, parameter: Office.EventHelperTypes.CustomXMLParts_Invoke_Parameter) => void): void; + on(obj: Office.CustomXMLParts, event: 'Invoke', argNames: Office.EventHelperTypes.CustomXMLParts_Invoke_ArgNames, handler: (this: Office.CustomXMLParts, parameter: Office.EventHelperTypes.CustomXMLParts_Invoke_Parameter) => void): void; on(obj: Office.CustomXMLParts, event: 'PartAfterAdd', argNames: ['NewPart'], handler: (this: Office.CustomXMLParts, parameter: {readonly NewPart: Office.CustomXMLPart}) => void): void; on(obj: Office.CustomXMLParts, event: 'PartAfterLoad', argNames: ['Part'], handler: (this: Office.CustomXMLParts, parameter: {readonly Part: Office.CustomXMLPart}) => void): void; on(obj: Office.CustomXMLParts, event: 'PartBeforeDelete', argNames: ['OldPart'], handler: (this: Office.CustomXMLParts, parameter: {readonly OldPart: Office.CustomXMLPart}) => void): void; - on( - obj: Office.CustomXMLParts, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: ( - this: Office.CustomXMLParts, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; + on(obj: Office.CustomXMLParts, event: 'QueryInterface', argNames: ['riid', 'ppvObj'], handler: (this: Office.CustomXMLParts, parameter: {readonly riid: stdole.GUID, ppvObj: undefined}) => void): void; on(obj: Office.CommandBarButton, event: 'AddRef' | 'Release', handler: (this: Office.CommandBarButton, parameter: {}) => void): void; on(obj: Office.CommandBarComboBox, event: 'AddRef' | 'Release', handler: (this: Office.CommandBarComboBox, parameter: {}) => void): void; on(obj: Office.CommandBars, event: 'AddRef' | 'OnUpdate' | 'Release', handler: (this: Office.CommandBars, parameter: {}) => void): void; @@ -6810,56 +6953,3 @@ interface ActiveXObject { set(obj: Office.CommandBarButton | Office.CommandBarComboBox, propertyName: 'accName' | 'accValue', parameterTypes: [any], newValue: string): void; set(obj: Office.CommandBarComboBox, propertyName: 'List', parameterTypes: [number], newValue: string): void; } - -interface EnumeratorConstructor { - new(col: Office.CanvasShapes | Office.GroupShapes | Office.ShapeRange | Office.Shapes): Enumerator; - new(col: Office.COMAddIns): Enumerator; - new(col: Office.CommandBarControls): Enumerator; - new(col: Office.CommandBars): Enumerator; - new(col: Office.CustomXMLNodes): Enumerator; - new(col: Office.CustomXMLParts): Enumerator; - new(col: Office.CustomXMLPrefixMappings): Enumerator; - new(col: Office.CustomXMLSchemaCollection): Enumerator; - new(col: Office.CustomXMLValidationErrors): Enumerator; - new(col: Office.DiagramNodeChildren | Office.DiagramNodes): Enumerator; - new(col: Office.DocumentInspectors): Enumerator; - new(col: Office.DocumentLibraryVersions): Enumerator; - new(col: Office.EffectParameters): Enumerator; - new(col: Office.FileDialogFilters): Enumerator; - new(col: Office.FileDialogSelectedItems | Office.FoundFiles | Office.IFoundFiles): Enumerator; - new(col: Office.FileTypes): Enumerator; - new(col: Office.GradientStops): Enumerator; - new(col: Office.HTMLProjectItems): Enumerator; - new(col: Office.MetaProperties): Enumerator; - new(col: Office.Permission): Enumerator; - new(col: Office.PickerFields): Enumerator; - new(col: Office.PickerProperties): Enumerator; - new(col: Office.PickerResults): Enumerator; - new(col: Office.PictureEffects): Enumerator; - new(col: Office.PropertyTests): Enumerator; - new(col: Office.RulerLevels2): Enumerator; - new(col: Office.ScopeFolders | Office.SearchFolders): Enumerator; - new(col: Office.Scripts): Enumerator; - new(col: Office.SearchScopes): Enumerator; - new(col: Office.ShapeNodes): Enumerator; - new(col: Office.SharedWorkspaceFiles): Enumerator; - new(col: Office.SharedWorkspaceFolders): Enumerator; - new(col: Office.SharedWorkspaceLinks): Enumerator; - new(col: Office.SharedWorkspaceMembers): Enumerator; - new(col: Office.SharedWorkspaceTasks): Enumerator; - new(col: Office.SignatureSet): Enumerator; - new(col: Office.SmartArtColors): Enumerator; - new(col: Office.SmartArtLayouts): Enumerator; - new(col: Office.SmartArtNodes): Enumerator; - new(col: Office.SmartArtQuickStyles): Enumerator; - new(col: Office.TabStops2): Enumerator; - new(col: Office.TextRange2): Enumerator; - new(col: Office.ThemeFonts): Enumerator; - new(col: Office.WebPageFonts): Enumerator; - new(col: Office.WorkflowTasks): Enumerator; - new(col: Office.WorkflowTemplates): Enumerator; -} - -interface SafeArray { - _brand: SafeArray; -} diff --git a/types/activex-office/tslint.json b/types/activex-office/tslint.json index 3224b40b8b..7b89accc6d 100644 --- a/types/activex-office/tslint.json +++ b/types/activex-office/tslint.json @@ -1,6 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - "no-const-enum": false + "no-const-enum": false, + "max-line-length": false } } diff --git a/types/activex-outlook/index.d.ts b/types/activex-outlook/index.d.ts index b7a709fe45..37628722b5 100644 --- a/types/activex-outlook/index.d.ts +++ b/types/activex-outlook/index.d.ts @@ -2,7 +2,7 @@ // Project: https://msdn.microsoft.com/en-us/vba/vba-outlook // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.6 /// /// diff --git a/types/activex-powerpoint/index.d.ts b/types/activex-powerpoint/index.d.ts index 6de089010d..ee59fd0be4 100644 --- a/types/activex-powerpoint/index.d.ts +++ b/types/activex-powerpoint/index.d.ts @@ -2,7 +2,7 @@ // Project: https://msdn.microsoft.com/en-us/library/fp161225.aspx // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.6 /// /// diff --git a/types/activex-stdole/index.d.ts b/types/activex-stdole/index.d.ts index 9d0c8f3a3c..e738e4f03d 100644 --- a/types/activex-stdole/index.d.ts +++ b/types/activex-stdole/index.d.ts @@ -2,7 +2,7 @@ // Project: https://msdn.microsoft.com/en-us/library/hh272953.aspx // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.6 declare namespace stdole { type IPictureDisp = StdPicture; @@ -86,7 +86,3 @@ interface ActiveXObjectNameMap { StdFont: stdole.StdFont; StdPicture: stdole.StdPicture; } - -interface SafeArray { - _brand: SafeArray; -} diff --git a/types/activex-vbide/activex-vbide-tests.ts b/types/activex-vbide/activex-vbide-tests.ts index c3d92e51cf..02209ec9bd 100644 --- a/types/activex-vbide/activex-vbide-tests.ts +++ b/types/activex-vbide/activex-vbide-tests.ts @@ -1,21 +1,25 @@ -// tslint:disable-next-line no-unnecessary-generics -const collectionToArray = (col: any): T[] => { +/// + +const collectionToArray = (col: { Item(key: any): T }): T[] => { const results: T[] = []; const enumerator = new Enumerator(col); enumerator.moveFirst(); while (!enumerator.atEnd()) { results.push(enumerator.item()); + enumerator.moveNext(); } return results; }; const app = new ActiveXObject('Word.Application'); -const projects = collectionToArray(app.VBE.VBProjects); -projects.forEach(project => { +app.Visible = true; + +for (const project of collectionToArray(app.VBE.VBProjects)) { WScript.Echo(`Name: ${project.Name}`); - collectionToArray(project.References) - .forEach(reference => { - WScript.Echo(` ${reference.Name} ${reference.Major}.${reference.Minor} -- ${reference.FullPath}`); - }); -}); + for (const reference of collectionToArray(project.References)) { + WScript.Echo(` ${reference.Name} ${reference.Major}.${reference.Minor} -- ${reference.FullPath}`); + } +} + +app.Quit(); diff --git a/types/activex-vbide/index.d.ts b/types/activex-vbide/index.d.ts index 83049260c2..88594969e6 100644 --- a/types/activex-vbide/index.d.ts +++ b/types/activex-vbide/index.d.ts @@ -2,7 +2,7 @@ // Project: https://msdn.microsoft.com/en-us/vba/language-reference-vba/articles/collections-visual-basic-add-in-model // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.6 /// @@ -99,14 +99,13 @@ declare namespace VBIDE { readonly VBE: VBE; } - class Addins { - private 'VBIDE.Addins_typekey': Addins; - private constructor(); + interface Addins { readonly Count: number; Item(index: any): AddIn; readonly Parent: any; Update(): void; readonly VBE: VBE; + (index: any): AddIn; } class Application { @@ -125,13 +124,13 @@ declare namespace VBIDE { readonly CountOfLines: number; CreateEventProc(EventName: string, ObjectName: string): number; - /** @param number [Count=1] */ + /** @param Count [Count=1] */ DeleteLines(StartLine: number, Count?: number): void; /** - * @param boolean [WholeWord=false] - * @param boolean [MatchCase=false] - * @param boolean [PatternSearch=false] + * @param WholeWord [WholeWord=false] + * @param MatchCase [MatchCase=false] + * @param PatternSearch [PatternSearch=false] */ Find(Target: string, StartLine: number, StartColumn: number, EndLine: number, EndColumn: number, WholeWord?: boolean, MatchCase?: boolean, PatternSearch?: boolean): boolean; InsertLines(Line: number, String: string): void; @@ -161,14 +160,13 @@ declare namespace VBIDE { readonly Window: Window; } - class CodePanes { - private 'VBIDE.CodePanes_typekey': CodePanes; - private constructor(); + interface CodePanes { readonly Count: number; Current: CodePane; Item(index: any): CodePane; readonly Parent: VBE; readonly VBE: VBE; + (index: any): CodePane; } class CommandBarEvents { @@ -185,9 +183,7 @@ declare namespace VBIDE { readonly Parent: Components; } - class Components { - private 'VBIDE.Components_typekey': Components; - private constructor(); + interface Components { Add(ComponentType: vbext_ComponentType): Component; readonly Application: Application; readonly Count: number; @@ -196,6 +192,7 @@ declare namespace VBIDE { readonly Parent: VBProject; Remove(Component: Component): void; readonly VBE: VBE; + (index: any): Component; } class Events { @@ -205,15 +202,14 @@ declare namespace VBIDE { ReferencesEvents(VBProject: VBProject): ReferencesEvents; } - class LinkedWindows { - private 'VBIDE.LinkedWindows_typekey': LinkedWindows; - private constructor(); + interface LinkedWindows { Add(Window: Window): void; readonly Count: number; Item(index: any): Window; readonly Parent: Window; Remove(Window: Window): void; readonly VBE: VBE; + (index: any): Window; } class ProjectTemplate { @@ -223,14 +219,13 @@ declare namespace VBIDE { readonly Parent: Application; } - class Properties { - private 'VBIDE.Properties_typekey': Properties; - private constructor(); + interface Properties { readonly Application: Application; readonly Count: number; Item(index: any): Property; readonly Parent: any; readonly VBE: VBE; + (index: any): Property; } class Property { @@ -263,9 +258,7 @@ declare namespace VBIDE { readonly VBE: VBE; } - class References { - private 'VBIDE.References_typekey': References; - private constructor(); + interface References { AddFromFile(FileName: string): Reference; AddFromGuid(Guid: string, Major: number, Minor: number): Reference; readonly Count: number; @@ -273,6 +266,7 @@ declare namespace VBIDE { readonly Parent: VBProject; Remove(Reference: Reference): void; readonly VBE: VBE; + (index: any): Reference; } class ReferencesEvents { @@ -298,13 +292,11 @@ declare namespace VBIDE { readonly VBE: VBE; } - class VBComponents { - private 'VBIDE.VBComponents_typekey': VBComponents; - private constructor(); + interface VBComponents { Add(ComponentType: vbext_ComponentType): VBComponent; AddCustom(ProgId: string): VBComponent; - /** @param number [index=0] */ + /** @param index [index=0] */ AddMTDesigner(index?: number): VBComponent; readonly Count: number; Import(FileName: string): VBComponent; @@ -312,6 +304,7 @@ declare namespace VBIDE { readonly Parent: VBProject; Remove(VBComponent: VBComponent): void; readonly VBE: VBE; + (index: any): VBComponent; } class VBE { @@ -354,9 +347,7 @@ declare namespace VBIDE { readonly VBE: VBE; } - class VBProjects { - private 'VBIDE.VBProjects_typekey': VBProjects; - private constructor(); + interface VBProjects { Add(Type: vbext_ProjectType): VBProject; readonly Count: number; Item(index: any): VBProject; @@ -364,6 +355,7 @@ declare namespace VBIDE { readonly Parent: VBE; Remove(lpc: VBProject): void; readonly VBE: VBE; + (index: any): VBProject; } class Window { @@ -386,38 +378,18 @@ declare namespace VBIDE { WindowState: vbext_WindowState; } - class Windows { - private 'VBIDE.Windows_typekey': Windows; - private constructor(); + interface Windows { readonly Count: number; CreateToolWindow(AddInInst: AddIn, ProgId: string, Caption: string, GuidPosition: string, DocObj: any): Window; Item(index: any): Window; readonly Parent: Application; readonly VBE: VBE; + (index: any): Window; } } interface ActiveXObject { - on( - obj: VBIDE.CommandBarEvents, event: 'Click', argNames: ['CommandBarControl', 'handled', 'CancelDefault'], handler: ( - this: VBIDE.CommandBarEvents, parameter: {readonly CommandBarControl: any, readonly handled: boolean, readonly CancelDefault: boolean}) => void): void; + on(obj: VBIDE.CommandBarEvents, event: 'Click', argNames: ['CommandBarControl', 'handled', 'CancelDefault'], handler: (this: VBIDE.CommandBarEvents, parameter: {readonly CommandBarControl: any, readonly handled: boolean, readonly CancelDefault: boolean}) => void): void; on(obj: VBIDE.References, event: 'ItemAdded' | 'ItemRemoved', argNames: ['Reference'], handler: (this: VBIDE.References, parameter: {readonly Reference: VBIDE.Reference}) => void): void; - on( - obj: VBIDE.ReferencesEvents, event: 'ItemAdded' | 'ItemRemoved', argNames: ['Reference'], handler: ( - this: VBIDE.ReferencesEvents, parameter: {readonly Reference: VBIDE.Reference}) => void): void; -} - -interface EnumeratorConstructor { - new(col: VBIDE.Addins): Enumerator; - new(col: VBIDE.CodePanes): Enumerator; - new(col: VBIDE.Components): Enumerator; - new(col: VBIDE.LinkedWindows | VBIDE.Windows): Enumerator; - new(col: VBIDE.Properties): Enumerator; - new(col: VBIDE.References): Enumerator; - new(col: VBIDE.VBComponents): Enumerator; - new(col: VBIDE.VBProjects): Enumerator; -} - -interface SafeArray { - _brand: SafeArray; + on(obj: VBIDE.ReferencesEvents, event: 'ItemAdded' | 'ItemRemoved', argNames: ['Reference'], handler: (this: VBIDE.ReferencesEvents, parameter: {readonly Reference: VBIDE.Reference}) => void): void; } diff --git a/types/activex-vbide/tslint.json b/types/activex-vbide/tslint.json index 3224b40b8b..7b89accc6d 100644 --- a/types/activex-vbide/tslint.json +++ b/types/activex-vbide/tslint.json @@ -1,6 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - "no-const-enum": false + "no-const-enum": false, + "max-line-length": false } } diff --git a/types/activex-word/index.d.ts b/types/activex-word/index.d.ts index 7fe194552a..879af9021d 100644 --- a/types/activex-word/index.d.ts +++ b/types/activex-word/index.d.ts @@ -2,7 +2,7 @@ // Project: https://msdn.microsoft.com/en-us/library/fp179696.aspx // Definitions by: Zev Spitz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.6 /// /// From fdb2c25846c0ea21a4e07569008d6d32dd9b8d6f Mon Sep 17 00:00:00 2001 From: Bruno Lemos Date: Tue, 24 Apr 2018 22:34:33 -0300 Subject: [PATCH 099/564] [react-native] Support Layout Props (#25083) Support some styles as View and Image props, e.g. --- types/react-native/index.d.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index a76bdb6e4c..fe73c7abae 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -536,6 +536,7 @@ type FlexAlignType = "flex-start" | "flex-end" | "center" | "stretch" | "baselin /** * Flex Prop Types * @see https://facebook.github.io/react-native/docs/flexbox.html#proptypes + * @see https://facebook.github.io/react-native/docs/layout-props.html * @see LayoutPropTypes.js */ export interface FlexStyle { @@ -598,6 +599,14 @@ export interface FlexStyle { direction?: "inherit" | "ltr" | "rtl"; } + +/** + * Layout Prop Types + * @see https://facebook.github.io/react-native/docs/layout-props.html + * @see LayoutPropTypes.js + */ +export interface LayoutProperties extends FlexStyle {} + /** * @see ShadowPropTypesIOS.js */ @@ -1752,7 +1761,7 @@ type AccessibilityTraits = * @see https://facebook.github.io/react-native/docs/view.html#props */ export interface ViewProperties - extends ViewPropertiesAndroid, ViewPropertiesIOS, GestureResponderHandlers, Touchable, AccessibilityProperties { + extends ViewPropertiesAndroid, ViewPropertiesIOS, GestureResponderHandlers, Touchable, AccessibilityProperties, LayoutProperties { /** * This defines how far a touch event can start away from the view. * Typical interface guidelines recommend touch targets that are at least @@ -3344,7 +3353,7 @@ interface ImagePropertiesAndroid { * @see https://facebook.github.io/react-native/docs/image.html */ export type ImagePropertiesSourceOptions = ImageURISource | ImageURISource[] | ImageRequireSource; -export interface ImageProperties extends ImagePropertiesIOS, ImagePropertiesAndroid, AccessibilityProperties { +export interface ImageProperties extends ImagePropertiesIOS, ImagePropertiesAndroid, AccessibilityProperties, LayoutProperties { /** * onLayout function * From b73b4426dd1cd78b7ddf4f4d1cc5b6316fd6956f Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Tue, 24 Apr 2018 17:44:50 -0700 Subject: [PATCH 100/564] compatibility fix for keyof T in ts 2.9 --- types/aphrodite/index.d.ts | 8 +------- types/dispatchr/addons/createStore.d.ts | 3 +-- .../google-cloud__datastore-tests.ts | 3 +-- types/google-cloud__datastore/index.d.ts | 10 ++++++---- types/grid-styled/index.d.ts | 5 +---- types/mirrorx/index.d.ts | 3 +-- types/react-autosuggest/index.d.ts | 6 +----- types/react-bootstrap-table/index.d.ts | 2 +- types/react-bootstrap/index.d.ts | 3 +-- types/react-dynamic-number/index.d.ts | 6 +----- types/react-geosuggest/index.d.ts | 7 +------ types/react-i18next/src/translate.d.ts | 7 +++---- types/react-redux/index.d.ts | 3 +-- types/react-relay/index.d.ts | 4 +--- types/react-router/index.d.ts | 3 +-- types/recompose/index.d.ts | 3 +-- types/redux-form/index.d.ts | 3 +-- 17 files changed, 24 insertions(+), 55 deletions(-) diff --git a/types/aphrodite/index.d.ts b/types/aphrodite/index.d.ts index 583e84e996..a82ec2f36b 100644 --- a/types/aphrodite/index.d.ts +++ b/types/aphrodite/index.d.ts @@ -12,13 +12,7 @@ type FontFamily = | BaseCSSProperties['fontFamily'] | CSS.FontFace; -// Replace with Exclude once on 2.8+ -type Diff = ( - & { [P in T]: P } - & { [P in U]: never } - & { [x: string]: never } -)[T]; -type Omit = Pick>; +type Omit = Pick; type CSSProperties = Omit & { fontFamily?: FontFamily | FontFamily[]; diff --git a/types/dispatchr/addons/createStore.d.ts b/types/dispatchr/addons/createStore.d.ts index 86a1f24fbb..bf576156fc 100644 --- a/types/dispatchr/addons/createStore.d.ts +++ b/types/dispatchr/addons/createStore.d.ts @@ -1,7 +1,6 @@ import { StoreClass, Store } from '../index'; -type Diff = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]; -type Omit = Pick>; +type Omit = Pick; interface StoreOptions { storeName: string; diff --git a/types/google-cloud__datastore/google-cloud__datastore-tests.ts b/types/google-cloud__datastore/google-cloud__datastore-tests.ts index 3093a8256a..cb723d0d5b 100644 --- a/types/google-cloud__datastore/google-cloud__datastore-tests.ts +++ b/types/google-cloud__datastore/google-cloud__datastore-tests.ts @@ -14,8 +14,7 @@ interface TestEntity { name?: string; location?: string; symbol?: string; - - [keySymbol: string]: any; + [Datastore.KEY]?: any; } const kind = 'Company'; diff --git a/types/google-cloud__datastore/index.d.ts b/types/google-cloud__datastore/index.d.ts index 8c9cdd23c3..f864f965c9 100644 --- a/types/google-cloud__datastore/index.d.ts +++ b/types/google-cloud__datastore/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/googleapis/nodejs-datastore // Definitions by: Antoine Beauvais-Lacasse // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.4 +// TypeScript Version: 2.7 /// @@ -36,7 +36,7 @@ declare module '@google-cloud/datastore' { class Datastore extends DatastoreRequest_ { constructor(options: InitOptions); - readonly KEY: KEY_SYMBOL; + readonly KEY: typeof Datastore.KEY; readonly MORE_RESULTS_AFTER_CURSOR: MoreResultsAfterCursor; readonly MORE_RESULTS_AFTER_LIMIT: MoreResultsAfterLimit; readonly NO_MORE_RESULTS: NoMoreResults; @@ -81,7 +81,7 @@ declare module '@google-cloud/datastore' { } namespace Datastore { - const KEY: KEY_SYMBOL; + const KEY: unique symbol; const MORE_RESULTS_AFTER_CURSOR: MoreResultsAfterCursor; const MORE_RESULTS_AFTER_LIMIT: MoreResultsAfterLimit; const NO_MORE_RESULTS: NoMoreResults; @@ -93,6 +93,8 @@ declare module '@google-cloud/datastore' { } declare module '@google-cloud/datastore/entity' { + import Datastore = require("@google-cloud/datastore"); + interface DatastoreInt { value: string; } @@ -133,7 +135,7 @@ declare module '@google-cloud/datastore/entity' { parent?: DatastoreKey; } - type KEY_SYMBOL = symbol; + type KEY_SYMBOL = typeof Datastore.KEY; interface DatastorePayload { key: DatastoreKey; diff --git a/types/grid-styled/index.d.ts b/types/grid-styled/index.d.ts index 8cce111478..0006be1db8 100644 --- a/types/grid-styled/index.d.ts +++ b/types/grid-styled/index.d.ts @@ -5,10 +5,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 -export type Diff = ({ [P in T]: P } & - { [P in U]: never } & { [x: string]: never })[T]; - -export type Omit = Pick>; +export type Omit = Pick; import { ComponentClass } from "react"; import { StyledComponentClass } from "styled-components"; diff --git a/types/mirrorx/index.d.ts b/types/mirrorx/index.d.ts index b4bebc9cea..3e7090eab2 100644 --- a/types/mirrorx/index.d.ts +++ b/types/mirrorx/index.d.ts @@ -11,8 +11,7 @@ import * as React from 'react'; import { Connect } from 'react-redux'; import { match } from "react-router"; -export type Diff = ({[P in T]: P } & {[P in U]: never } & { [x: string]: never })[T]; -export type Omit = Pick>; +export type Omit = Pick; export interface model { name: string; diff --git a/types/react-autosuggest/index.d.ts b/types/react-autosuggest/index.d.ts index b78ee34ab8..ab91481925 100644 --- a/types/react-autosuggest/index.d.ts +++ b/types/react-autosuggest/index.d.ts @@ -22,11 +22,7 @@ declare namespace Autosuggest { */ /** @internal */ - type Diff = ({ [P in T]: P } & - { [P in U]: never } & { [x: string]: never })[T]; - - /** @internal */ - type Omit = Pick>; + type Omit = Pick; interface SuggestionsFetchRequestedParams { value: string; diff --git a/types/react-bootstrap-table/index.d.ts b/types/react-bootstrap-table/index.d.ts index 6e9fd1dea8..d98dac1c44 100644 --- a/types/react-bootstrap-table/index.d.ts +++ b/types/react-bootstrap-table/index.d.ts @@ -1022,7 +1022,7 @@ export interface Options { * The function allows you to make further modifications to the cell value prior to it being saved. You need to * return the final cell value to use. */ - onCellEdit?(row: TRow, fieldName: K, value: TRow[K]): TRow[K]; + onCellEdit?(row: TRow, fieldName: K, value: TRow[K]): TRow[K]; /** * Custom message to show when the InsertModal save fails validation. * Default message is 'Form validate errors, please checking!' diff --git a/types/react-bootstrap/index.d.ts b/types/react-bootstrap/index.d.ts index 45a645fc32..6a78dcbb1a 100644 --- a/types/react-bootstrap/index.d.ts +++ b/types/react-bootstrap/index.d.ts @@ -17,8 +17,7 @@ import * as React from 'react'; -export type Diff = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]; -export type Omit = Pick>; +export type Omit = Pick; export type Sizes = 'xs' | 'xsmall' | 'sm' | 'small' | 'medium' | 'lg' | 'large'; diff --git a/types/react-dynamic-number/index.d.ts b/types/react-dynamic-number/index.d.ts index c1ffdc229d..559d0c9d01 100644 --- a/types/react-dynamic-number/index.d.ts +++ b/types/react-dynamic-number/index.d.ts @@ -6,11 +6,7 @@ import * as React from 'react'; -/** - * remove Diff & Omit when in will be placed in TS from scratch - */ -export type Diff = ({[P in T]: P} & {[P in U]: never} & {[x: string]: never})[T]; -export type Omit = {[P in Diff]: T[P]}; +export type Omit = Pick; export type BaseInputProps = Partial< Omit< diff --git a/types/react-geosuggest/index.d.ts b/types/react-geosuggest/index.d.ts index 344e768b08..2d31ba4d6d 100644 --- a/types/react-geosuggest/index.d.ts +++ b/types/react-geosuggest/index.d.ts @@ -17,12 +17,7 @@ export default class Geosuggest extends Component { } // Replace with Exclude once on 2.8+ -export type Diff = ( - & { [P in T]: P } - & { [P in U]: never } - & { [x: string]: never } -)[T]; -export type Omit = Pick>; +export type Omit = Pick; export interface GeosuggestProps extends Omit, 'style'> { placeholder?: string; diff --git a/types/react-i18next/src/translate.d.ts b/types/react-i18next/src/translate.d.ts index 0711d3895d..0383ee1ead 100644 --- a/types/react-i18next/src/translate.d.ts +++ b/types/react-i18next/src/translate.d.ts @@ -20,8 +20,7 @@ export interface TranslateHocProps { } // Diff / Omit taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766 -type Diff = ({[P in T]: P } & {[P in U]: never } & { [x: string]: never })[T]; -type Omit = Pick>; +type Omit = Pick; type InjectedProps = InjectedI18nProps & InjectedTranslateProps; @@ -32,11 +31,11 @@ export interface WrapperComponentClass

extends React.Comp // Injects props and removes them from the prop requirements. // Adds the new properties t (or whatever the translation function is called) and i18n if needed. export type InferableComponentEnhancerWithProps = -

(component: React.ComponentClass

| React.StatelessComponent

) => +

(component: React.ComponentClass

| React.StatelessComponent

) => React.ComponentClass & TranslateHocProps>; export type InferableComponentEnhancerWithPropsAndRef = -

(component: React.ComponentClass

| React.StatelessComponent

) => +

(component: React.ComponentClass

| React.StatelessComponent

= Omit

; diff --git a/types/react-router/index.d.ts b/types/react-router/index.d.ts index 01654c8304..23f2f4f78a 100644 --- a/types/react-router/index.d.ts +++ b/types/react-router/index.d.ts @@ -102,8 +102,7 @@ export interface match

{ } // Diff / Omit taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766 -export type Diff = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]; -export type Omit = Pick>; +export type Omit = Pick; export function matchPath

(pathname: string, props: RouteProps): match

| null; diff --git a/types/recompose/index.d.ts b/types/recompose/index.d.ts index 222f0ed539..0c7b9089c6 100644 --- a/types/recompose/index.d.ts +++ b/types/recompose/index.d.ts @@ -20,8 +20,7 @@ declare module 'recompose' { type predicateDiff = (current: T, next: T) => boolean // Diff / Omit taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766 - type Diff = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]; - type Omit = Pick>; + type Omit = Pick; interface Observer{ next(props: T): void; diff --git a/types/redux-form/index.d.ts b/types/redux-form/index.d.ts index 3ecfe65cd4..8ee5fa9698 100644 --- a/types/redux-form/index.d.ts +++ b/types/redux-form/index.d.ts @@ -39,8 +39,7 @@ export interface RegisteredFieldState { type: FieldType; } -export type Diff = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]; -export type Omit = Pick>; +export type Omit = Pick; export * from "./lib/reduxForm"; export * from "./lib/Field"; From e6c708ae1a6d86fd0459ce89ad2a0d05c09d222f Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Wed, 25 Apr 2018 17:31:02 +0530 Subject: [PATCH 101/564] 16.1.37 added --- types/ej.web.all/ej.web.all-tests.ts | 1354 +++++++++++++------------- types/ej.web.all/index.d.ts | 225 +++-- 2 files changed, 837 insertions(+), 742 deletions(-) diff --git a/types/ej.web.all/ej.web.all-tests.ts b/types/ej.web.all/ej.web.all-tests.ts index 83ed128742..62ad67ce7b 100644 --- a/types/ej.web.all/ej.web.all-tests.ts +++ b/types/ej.web.all/ej.web.all-tests.ts @@ -1,3 +1,7 @@ +/* tslint:disable */ + + + module AccordionComponent { $(function () { var sample = new ej.Accordion($("#basicAccordion"), { @@ -18,39 +22,39 @@ module AccordionComponent { }); } + - -module AutocompleteComponent { +module AutocompleteComponent{ var carList = [ - "Audi S6", "Austin-Healey", "Alfa Romeo", "Aston Martin", - "BMW 7", "Bentley Mulsanne", "Bugatti Veyron", - "Chevrolet Camaro", "Cadillac", - "Duesenberg J", "Dodge Sprinter", - "Elantra", "Excavator", - "Ford Boss 302", "Ferrari 360", "Ford Thunderbird", - "GAZ Siber", - "Honda S2000", "Hyundai Santro", - "Isuzu Swift", "Infiniti Skyline", - "Jaguar XJS", - "Kia Sedona EX", "Koenigsegg Agera", - "Lotus Esprit", "Lamborghini Diablo", - "Mercedes-Benz", "Mercury Coupe", "Maruti Alto 800", - "Nissan Qashqai", - "Oldsmobile S98", "Opel Superboss", - "Porsche 356", "Pontiac Sunbird", - "Scion SRS/SC/SD", "Saab Sportcombi", "Subaru Sambar", "Suzuki Swift", - "Triumph Spitfire", "Toyota 2000GT", - "Volvo P1800", "Volkswagen Shirako" - ]; - $(function () { - var autocompleteInstance = new ej.Autocomplete($("#selectCar"), { + "Audi S6", "Austin-Healey", "Alfa Romeo", "Aston Martin", + "BMW 7", "Bentley Mulsanne", "Bugatti Veyron", + "Chevrolet Camaro", "Cadillac", + "Duesenberg J", "Dodge Sprinter", + "Elantra", "Excavator", + "Ford Boss 302", "Ferrari 360", "Ford Thunderbird", + "GAZ Siber", + "Honda S2000", "Hyundai Santro", + "Isuzu Swift", "Infiniti Skyline", + "Jaguar XJS", + "Kia Sedona EX", "Koenigsegg Agera", + "Lotus Esprit", "Lamborghini Diablo", + "Mercedes-Benz", "Mercury Coupe", "Maruti Alto 800", + "Nissan Qashqai", + "Oldsmobile S98", "Opel Superboss", + "Porsche 356", "Pontiac Sunbird", + "Scion SRS/SC/SD", "Saab Sportcombi", "Subaru Sambar", "Suzuki Swift", + "Triumph Spitfire", "Toyota 2000GT", + "Volvo P1800", "Volkswagen Shirako" + ]; + $(function () { + var autocompleteInstance =new ej.Autocomplete($("#selectCar"), { width: "100%", watermarkText: "Select a car", dataSource: carList, enableAutoFill: true, showPopupButton: true, multiSelectMode: "delimiter" - }); + }); }); } @@ -193,12 +197,12 @@ module ChartComponent { range: { min: 25, max: 50, interval: 5 }, labelFormat: "{value}%", title: { text: "Efficiency" }, - + }, commonSeriesOptions: - { + { type: 'line', enableAnimation: true, - tooltip: { visible: true, template: 'Tooltip' }, + tooltip:{ visible :true, template:'Tooltip'}, marker: { shape: 'circle', @@ -208,30 +212,30 @@ module ChartComponent { }, visible: true }, - border: { width: 2 } - }, - series: - [ + border : {width: 2} + }, + series: + [ + { + points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 },{ x: 2007, y: 26 }, { x: 2008, y: 27 }, + { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], + name: 'India' + }, { - points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 }, { x: 2007, y: 26 }, { x: 2008, y: 27 }, - { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], - name: 'India' + points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 },{ x: 2007, y: 30 }, { x: 2008, y: 36 }, + { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], + name: 'Germany' }, + { + points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 },{ x: 2007, y: 34 }, { x: 2008, y: 41 }, + { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], + name: 'England' + }, { - points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 }, { x: 2007, y: 30 }, { x: 2008, y: 36 }, - { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], - name: 'Germany' - }, - { - points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 }, { x: 2007, y: 34 }, { x: 2008, y: 41 }, - { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], - name: 'England' - }, - { - points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 }, { x: 2007, y: 40 }, { x: 2008, y: 44 }, - { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], - name: 'France' - } + points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 },{ x: 2007, y: 40 }, { x: 2008, y: 44 }, + { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], + name: 'France' + } ], isResponsive: true, load: function () { @@ -296,14 +300,13 @@ module ChartComponent { theme = "flatlight"; break; } - sender.model.theme = theme; + sender.model.theme = theme; } }, title: { text: 'Efficiency of oil-fired power production' }, size: { height: "600" }, - legend: { visible: true }, + legend: { visible: true}, }); - // chartsample.model.load="loadTheme"; }); } @@ -357,7 +360,7 @@ module circulargaugecomponent { backgroundColor: "#f5b43f", border: { color: "#f5b43f" } }] - }] + }] }); }); } @@ -376,21 +379,21 @@ module ColorPickerComponent { -module ComboBoxComponent { +module ComboBoxComponent{ var BikeList = [ { empid: "bk1", text: "Apache RTR" }, { empid: "bk2", text: "CBR 150-R" }, { empid: "bk3", text: "CBZ Xtreme" }, { empid: "bk4", text: "Discover" }, { empid: "bk5", text: "Dazzler" }, { empid: "bk6", text: "Flame" }, { empid: "bk7", text: "Fazzer" }, { empid: "bk8", text: "FZ-S" }, { empid: "bk9", text: "Pulsar" }, { empid: "bk10", text: "Shine" }, { empid: "bk11", text: "R15" }, { empid: "bk12", text: "Unicorn" } ]; - $(function () { - var comboboxInstance = new ej.ComboBox($("#selectCar"), { + $(function () { + var comboboxInstance =new ej.ComboBox($("#selectCar"), { width: "100%", placeholder: "Select a Bike", - fields: { text: "text", value: "empid" }, + fields: { text: "text", value: "empid" }, dataSource: BikeList, autofill: true - }); + }); }); } @@ -462,8 +465,7 @@ $(function () { }), createNode({ name: "Project", width: 150, height: 100, offsetX: 300, offsetY: 430, labels: [createLabel({ "text": "Find Project \nmanager" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Decision }), createNode({ - name: "End", width: 150, height: 60, offsetX: 300, offsetY: 555, labels: [createLabel({ "text": "Implement and Deliver" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process - }), + name: "End", width: 150, height: 60, offsetX: 300, offsetY: 555, labels: [createLabel({ "text": "Implement and Deliver" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), createNode({ name: "Decision", width: 250, height: 60, offsetX: 550, offsetY: 60, labels: [createLabel({ "text": "Decision Process for new software ideas" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Card, fillColor: "#858585", borderColor: "#858585" }), createNode({ name: "Reject", width: 150, height: 60, offsetX: 550, offsetY: 285, labels: [createLabel({ "text": "Reject and write report" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), createNode({ name: "Resources", width: 150, height: 60, offsetX: 550, offsetY: 430, labels: [createLabel({ "text": "Hire new resources" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }) @@ -477,7 +479,7 @@ $(function () { createConnector({ name: "connector6", sourceNode: "Project", targetNode: "Resources", labels: [createLabel({ "text": "No" })] }) ] }); - + }); function createNode(option: ej.datavisualization.Diagram.Node) { @@ -498,11 +500,11 @@ function createConnector(option: ej.datavisualization.Diagram.Connector) { return option; } -function createLabel(options: any) { +function createLabel(options : any) { return options; } - + module DialogComponent { $(function () { @@ -510,17 +512,15 @@ module DialogComponent { width: 550, minWidth: 310, minHeight: 215, - target: ".control", - close: () => { - $("#btnOpen").show(); - } + target:".control", + close:()=>{ + $("#btnOpen").show();} }); var btnInstance = new ej.Button($("#btnOpen"), { size: "medium", - click: () => { - $("#btnOpen").hide(); - $("#basicDialog").ejDialog("open"); - }, + click: ()=>{ + $("#btnOpen").hide(); + $("#basicDialog").ejDialog("open");}, type: "button", height: 30, width: 150 @@ -554,7 +554,7 @@ module digitalgaugecomponent { } - + @@ -566,7 +566,7 @@ module DropDownListComponent { { empid: "bk10", text: "Shine" }, { empid: "bk11", text: "R15" }, { empid: "bk12", text: "Unicorn" } ]; $(function () { - var sample = new ej.DropDownList($("#bikeList"), { + var sample = new ej.DropDownList($("#bikeList"),{ dataSource: BikeList, width: "100%", watermarkText: "Select a bike", @@ -574,12 +574,12 @@ module DropDownListComponent { enableFilterSearch: true, caseSensitiveSearch: true, enableIncrementalSearch: true, - enablePopupResize: true, + enablePopupResize: true, delimiterChar: ";", multiSelectMode: ej.MultiSelectMode.Delimiter, maxPopupHeight: "300px", - minPopupHeight: "150px", - maxPopupWidth: "500px", + minPopupHeight: "150px", + maxPopupWidth: "500px", minPopupWidth: "350px", showCheckbox: true, showRoundedCorner: true @@ -610,53 +610,53 @@ module ExplorerComponent { module GanttComponent { - $(function () { - var ganttInstance = new ej.Gantt($("#GanttContainer"), { - dataSource: (window).projectData, - allowColumnResize: true, - allowSorting: true, - allowSelection: true, - enableContextMenu: true, - taskIdMapping: "taskID", - allowDragAndDrop: true, - taskNameMapping: "taskName", - startDateMapping: "startDate", - showColumnChooser: true, - showColumnOptions: true, - progressMapping: "progress", - durationMapping: "duration", - endDateMapping: "endDate", - childMapping: "subtasks", - scheduleStartDate: "02/01/2017", - scheduleEndDate: "04/09/2017", - //Resources mapping - resourceInfoMapping: "resourceId", - resourceNameMapping: "resourceName", - resourceIdMapping: "resourceId", - resources: (window).projectResources, - predecessorMapping: "predecessor", - showResourceNames: true, - toolbarSettings: { - showToolbar: true, - toolbarItems: ["add", "edit", "delete", "update", "cancel", "indent", "outdent", "expandAll", "collapseAll", "search"] - }, - editSettings: { - allowEditing: true, - allowAdding: true, - allowDeleting: true, - allowIndent: true, - editMode: "cellEditing" - }, - sizeSettings: { - width: "100%", - height: "100%" - }, - dragTooltip: { showTooltip: true }, - showGridCellTooltip: true, - treeColumnIndex: 1, - isResponsive: true, - }); + $(function () { + var ganttInstance = new ej.Gantt($("#GanttContainer"), { + dataSource: (window).projectData, + allowColumnResize: true, + allowSorting: true, + allowSelection: true, + enableContextMenu: true, + taskIdMapping: "taskID", + allowDragAndDrop: true, + taskNameMapping: "taskName", + startDateMapping: "startDate", + showColumnChooser: true, + showColumnOptions: true, + progressMapping: "progress", + durationMapping: "duration", + endDateMapping: "endDate", + childMapping: "subtasks", + scheduleStartDate: "02/01/2017", + scheduleEndDate: "04/09/2017", + //Resources mapping + resourceInfoMapping: "resourceId", + resourceNameMapping: "resourceName", + resourceIdMapping: "resourceId", + resources: (window).projectResources, + predecessorMapping: "predecessor", + showResourceNames: true, + toolbarSettings: { + showToolbar: true, + toolbarItems: ["add","edit","delete","update","cancel","indent","outdent","expandAll","collapseAll","search"] + }, + editSettings: { + allowEditing: true, + allowAdding: true, + allowDeleting: true, + allowIndent: true, + editMode: "cellEditing" + }, + sizeSettings: { + width: "100%", + height: "100%" + }, + dragTooltip: { showTooltip: true }, + showGridCellTooltip: true, + treeColumnIndex: 1, + isResponsive: true, }); +}); } @@ -749,7 +749,7 @@ $(function () { module KanbanComponent { $(function () { var sample = new ej.Kanban($("#Kanban"), { - dataSource: new ej.DataManager((window).kanbanData).executeLocal(new ej.Query().take(20)), + dataSource: new ej.DataManager((window).kanbanData).executeLocal(new ej.Query().take(20)), columns: [ { headerText: "Backlog", key: "Open" }, { headerText: "In Progress", key: "InProgress" }, @@ -768,7 +768,7 @@ module KanbanComponent { }); } - + module lineargaugecomponent { @@ -794,14 +794,14 @@ module lineargaugecomponent { backgroundColor: "#E94649", border: { color: "#E94649" }, startWidth: 4, endWidth: 4 }] - }] + }] }); }); } + - - + module ListBoxComponent { $(function () { @@ -811,13 +811,13 @@ module ListBoxComponent { }); } - + module ListviewComponent { $(function () { var listviewInstance = new ej.ListView($("#defaultlistview"), { - enableCheckMark: true, - width: 400 + enableCheckMark: true, + width: 400 }); }); } @@ -1056,7 +1056,7 @@ module mapcomponenet { module MenuComponent { $(function () { - var sample = new ej.Menu($("#syncfusionProducts"), { + var sample = new ej.Menu($("#syncfusionProducts"),{ width: "100%", animationType: ej.AnimationType.Default, cssClass: 'gradient-lime ', @@ -1081,12 +1081,12 @@ module MenuComponent { - + module NavigationDrawerComponent { $(function () { var navigationdrawerInstance = new ej.NavigationDrawer($("#navpane"), { - targetId: "butdrawer", + targetId: "butdrawer", contentId: "content_container", type: "overlay", direction: "left", @@ -1097,8 +1097,8 @@ module NavigationDrawerComponent { }, position: "normal" }); - $("#navpane_listview").click(function (e: any) { - var text = e.target["text"] || $(e.target).closest("li.e-list").text(); + $("#navpane_listview").click(function(e: any) { + var text=e.target["text"]||$(e.target).closest("li.e-list").text(); $("#butdrawer").parent().children("h2").text(text); }); }); @@ -1109,7 +1109,7 @@ module NavigationDrawerComponent { module PDFViewerComponent { $(function () { var pdfviewerControl = new ej.PdfViewer($("#pdfviewer"), { - serviceUrl: (window).baseurl + "api/PdfViewer", + serviceUrl:(window).baseurl+ "api/PdfViewer", isResponsive: true }); }); @@ -1119,42 +1119,50 @@ module PDFViewerComponent { module PivotChartOlap { $(function () { - var sample = new ej.PivotChart($("#PivotChart"), { + var sample = new ej.PivotChart($("#PivotChart"),{ dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]" - } - ], - axis: "columns" - } - ], - filters: [] + data: "//bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]" + } + ], + axis: "columns" + } + ], + filters:[] + }, + isResponsive: true,zooming:{enableScrollbar: true}, + commonSeriesOptions: { + type: "column" + }, + size: { height: "460px", width: "100%" }, + primaryXAxis: { title: { text: "Date - Fiscal" }, labelRotation: 0 }, + primaryYAxis: { title: { text: "Internet Sales Amount" } }, + legend: { visible: true, rowCount: 2 }, + load: function () { + var PivotChart = (window).themeStyle + (window).themeColor + (window).themeVarient; + PivotChart = PivotChart.toString(); + if (PivotChart.indexOf("dark") > -1 || PivotChart.indexOf("contrast") > -1) + PivotChart = "flatdark"; + else + PivotChart = "flatlight"; + this.model.theme = PivotChart; }, - isResponsive: true, zooming: { enableScrollbar: true }, - commonSeriesOptions: { - type: "column" - }, - size: { height: "460px", width: "100%" }, - primaryXAxis: { title: { text: "Date - Fiscal" }, labelRotation: 0 }, - primaryYAxis: { title: { text: "Internet Sales Amount" } }, - legend: { visible: true, rowCount: 2 } - // load:"loadTheme" }); }); } @@ -1191,45 +1199,53 @@ var pivot_dataset = [ module PivotChartRelational { $(function () { - var sample = new ej.PivotChart($("#PivotChart"), { + var sample = new ej.PivotChart($("#PivotChart"),{ dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - fieldCaption: "Country" - }, - { - fieldName: "State", - fieldCaption: "State" - }, - { - fieldName: "Date", - fieldCaption: "Date" - } - ], - columns: [ - { - fieldName: "Product", - fieldCaption: "Product" - } - ], - values: [ - { - fieldName: "Amount", - fieldCaption: "Amount" - } - ], - filters: [] + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + fieldCaption: "Country" + }, + { + fieldName: "State", + fieldCaption: "State" + }, + { + fieldName: "Date", + fieldCaption: "Date" + } + ], + columns: [ + { + fieldName: "Product", + fieldCaption: "Product" + } + ], + values: [ + { + fieldName: "Amount", + fieldCaption: "Amount" + } + ], + filters:[] + }, + isResponsive: true,zooming:{enableScrollbar: true}, + commonSeriesOptions: { + type: "column" + }, + size: { height: "460px", width: "100%" }, + primaryYAxis: { title: { text: "Amount" } }, + legend: { visible: true }, + load: function () { + var PivotChart = (window).themeStyle + (window).themeColor + (window).themeVarient; + PivotChart = PivotChart.toString(); + if (PivotChart.indexOf("dark") > -1 || PivotChart.indexOf("contrast") > -1) + PivotChart = "flatdark"; + else + PivotChart = "flatlight"; + this.model.theme = PivotChart; }, - isResponsive: true, zooming: { enableScrollbar: true }, - commonSeriesOptions: { - type: "column" - }, - size: { height: "460px", width: "100%" }, - primaryYAxis: { title: { text: "Amount" } }, - legend: { visible: true } - // load:"loadTheme" }); }); } @@ -1239,106 +1255,106 @@ module PivotChartRelational { module PivotGaugeOlap { $(function () { - var sample = new ej.PivotGauge($("#PivotGauge"), { + var sample = new ej.PivotGauge($("#PivotGauge"),{ dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]", - filterItems: { filterType: "include", values: ["[Date].[Fiscal].[Fiscal Year].&[2004]"] } - }, - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]" - }, - { - fieldName: "[Measures].[Internet Revenue Status]" - }, - { - fieldName: "[Measures].[Internet Revenue Trend]" - }, - { - fieldName: "[Measures].[Internet Revenue Goal]" - }, - ], - axis: "columns" - } - ], - filters: [] - }, + data: "//bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]", + filterItems: { filterType: "include", values: ["[Date].[Fiscal].[Fiscal Year].&[2004]"] } + }, + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]" + }, + { + fieldName: "[Measures].[Internet Revenue Status]" + }, + { + fieldName: "[Measures].[Internet Revenue Trend]" + }, + { + fieldName: "[Measures].[Internet Revenue Goal]" + }, + ], + axis: "columns" + } + ], + filters:[] + }, enableTooltip: true, isResponsive: true, labelFormatSettings: { decimalPlaces: 2 }, - scales: [{ - showRanges: true, - radius: 150, showScaleBar: true, size: 1, + scales: [{ + showRanges: true, + radius: 150, showScaleBar: true, size: 1, border: { - width: 0.5 - }, - showIndicators: true, showLabels: true, + width: 0.5 + }, + showIndicators: true, showLabels: true, pointers: [{ - showBackNeedle: true, - backNeedleLength: 20, - length: 120, - width: 7 + showBackNeedle: true, + backNeedleLength: 20, + length: 120, + width: 7 }, - { - type: "marker", - markerType: "diamond", - distanceFromScale: 5, - placement: "center", - backgroundColor: "#29A4D9", - length: 25, - width: 15 - }], + { + type: "marker", + markerType: "diamond", + distanceFromScale: 5, + placement: "center", + backgroundColor: "#29A4D9", + length: 25, + width: 15 + }], ticks: [{ - type: "major", + type: "major", distanceFromScale: 2, - height: 16, - width: 1, color: "#8c8c8c" - }, - { - type: "minor", - height: 6, - width: 1, - distanceFromScale: 2, - color: "#8c8c8c" - }], - labels: [{ + height: 16, + width: 1, color: "#8c8c8c" + }, + { + type: "minor", + height: 6, + width: 1, + distanceFromScale: 2, color: "#8c8c8c" }], + labels: [{ + color: "#8c8c8c" + }], ranges: [{ - distanceFromScale: -5, + distanceFromScale: -5, backgroundColor: "#fc0606", - border: { color: "#fc0606" } + border: { color: "#fc0606" } + }, + { + distanceFromScale: -5 + }], + customLabels: [{ + position: { x: 180, y: 290 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" }, - { - distanceFromScale: -5 - }], - customLabels: [{ - position: { x: 180, y: 290 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + { + position: { x: 180, y: 320 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" }, - { - position: { x: 180, y: 320 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }, - { - position: { x: 180, y: 150 }, - font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }] + { + position: { x: 180, y: 150 }, + font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }] }] }); - }); + }); } @@ -1372,94 +1388,94 @@ var pivot_dataset = [ module PivotGaugeRelational { $(function () { - var sample = new ej.PivotGauge($("#PivotGauge"), { + var sample = new ej.PivotGauge($("#PivotGauge"),{ dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - }, - { - fieldName: "State", - } - ], - columns: [ - { - fieldName: "Product", - } - ], + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + }, + { + fieldName: "State", + } + ], + columns: [ + { + fieldName: "Product", + } + ], values: [ - { - fieldName: "Amount", - }, - { - fieldName: "Quantity", - } - ] - }, + { + fieldName: "Amount", + }, + { + fieldName: "Quantity", + } + ] + }, enableTooltip: true, isResponsive: true, labelFormatSettings: { decimalPlaces: 2 }, - scales: [{ - showRanges: true, - radius: 150, showScaleBar: true, size: 1, + scales: [{ + showRanges: true, + radius: 150, showScaleBar: true, size: 1, border: { - width: 0.5 - }, - showIndicators: true, showLabels: true, + width: 0.5 + }, + showIndicators: true, showLabels: true, pointers: [{ - showBackNeedle: true, - backNeedleLength: 20, - length: 120, - width: 7 + showBackNeedle: true, + backNeedleLength: 20, + length: 120, + width: 7 }, - { - type: "marker", - markerType: "diamond", - distanceFromScale: 5, - placement: "center", - backgroundColor: "#29A4D9", - length: 25, - width: 15 - }], + { + type: "marker", + markerType: "diamond", + distanceFromScale: 5, + placement: "center", + backgroundColor: "#29A4D9", + length: 25, + width: 15 + }], ticks: [{ - type: "major", + type: "major", distanceFromScale: 2, - height: 16, - width: 1, color: "#8c8c8c" - }, - { - type: "minor", - height: 6, - width: 1, - distanceFromScale: 2, - color: "#8c8c8c" - }], - labels: [{ + height: 16, + width: 1, color: "#8c8c8c" + }, + { + type: "minor", + height: 6, + width: 1, + distanceFromScale: 2, color: "#8c8c8c" }], + labels: [{ + color: "#8c8c8c" + }], ranges: [{ - distanceFromScale: -5, + distanceFromScale: -5, backgroundColor: "#fc0606", - border: { color: "#fc0606" } + border: { color: "#fc0606" } + }, + { + distanceFromScale: -5 + }], + customLabels: [{ + position: { x: 180, y: 290 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" }, - { - distanceFromScale: -5 - }], - customLabels: [{ - position: { x: 180, y: 290 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + { + position: { x: 180, y: 320 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" }, - { - position: { x: 180, y: 320 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }, - { - position: { x: 180, y: 150 }, - font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }] + { + position: { x: 180, y: 150 }, + font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }] }] }); - }); + }); } @@ -1467,35 +1483,35 @@ module PivotGaugeRelational { module PivotGridOlap { $(function () { - var sample = new ej.PivotGrid($("#PivotGrid"), { + var sample = new ej.PivotGrid($("#PivotGrid"),{ dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]", - } - ], - axis: "columns" - } - ], - filters: [] - }, - enableGroupingBar: true, - pivotTableFieldListID: "PivotSchemaDesigner" + data: "//bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]", + } + ], + axis: "columns" + } + ], + filters:[] + }, + enableGroupingBar: true, + pivotTableFieldListID:"PivotSchemaDesigner" }); $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); }); @@ -1532,41 +1548,41 @@ var pivot_dataset = [ module PivotGridRelational { $(function () { - var sample = new ej.PivotGrid($("#PivotGrid"), { + var sample = new ej.PivotGrid($("#PivotGrid"),{ dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - fieldCaption: "Country" - }, - { - fieldName: "State", - fieldCaption: "State" - } - ], - columns: - [{ - fieldName: "Product", - fieldCaption: "Product" - } - ], - values: [ - { - fieldName: "Amount", - fieldCaption: "Amount" - }, - { - fieldName: "Quantity", - fieldCaption: "Quantity" - } - ], - filters: [] - }, - enableGroupingBar: true, - pivotTableFieldListID: "PivotSchemaDesigner" + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + fieldCaption: "Country" + }, + { + fieldName: "State", + fieldCaption: "State" + } + ], + columns: + [{ + fieldName: "Product", + fieldCaption: "Product" + } + ], + values: [ + { + fieldName: "Amount", + fieldCaption: "Amount" + }, + { + fieldName: "Quantity", + fieldCaption: "Quantity" + } + ], + filters:[] + }, + enableGroupingBar: true, + pivotTableFieldListID:"PivotSchemaDesigner" }); - $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); + $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); }); } @@ -1575,33 +1591,33 @@ module PivotGridRelational { module PivotTreeMap { $(function () { - var sample = new ej.PivotTreeMap($("#PivotTreeMap"), { + var sample = new ej.PivotTreeMap($("#PivotTreeMap"),{ dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll;Locale Identifier=1033;", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - columns: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Customer Count]", - } - ], - axis: "columns" - } - ], - filters: [] - } + data: "//bi.syncfusion.com/olap/msmdpump.dll;Locale Identifier=1033;", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + columns: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Customer Count]", + } + ], + axis: "columns" + } + ], + filters:[] + } }); }); } @@ -1610,7 +1626,7 @@ module PivotTreeMap { module ProgressBarComponent { $(function () { - var sample = new ej.ProgressBar($("#progressBar"), { + var sample = new ej.ProgressBar($("#progressBar"),{ width: 200, value: 45, height: 20, @@ -1640,7 +1656,7 @@ module RadialMenuComponent { backImageClass: "backimageclass", targetElementId: "radialtarget1" }); - $("#radialtarget1").parent().css("position", "relative"); + $("#radialtarget1").parent().css("position", "relative"); } else { $("#contentDiv").html("Radial Menu is only supported from Internet Explorer Versioned 9 and above.").css({ "font-size": "20px", "color": "red" }); @@ -1707,12 +1723,12 @@ function redo(e: any) { } - + module RadialSliderComponent { $(function () { var radialsliderInstance = new ej.RadialSlider($("#radialSlider"), { - innerCircleImageUrl: "images/radialslider/chevron-right.png" + innerCircleImageUrl: "images/radialslider/chevron-right.png" }); }); } @@ -1809,8 +1825,8 @@ var data; data = GetData(); function GetData() { - var series1: any[] = []; - var series2: any[] = []; + var series1:any[]=[]; + var series2:any[]= []; var value = 100; var value1 = 120; for (var i = 1; i < 730; i++) { @@ -1837,7 +1853,7 @@ function GetData() { module RatingComponent { $(function () { - var sample1 = new ej.Rating($("#fullRating"), { + var sample1 = new ej.Rating($("#fullRating"),{ value: 4, precision: ej.Rating.Precision.Full, allowReset: true, @@ -1852,8 +1868,8 @@ module RatingComponent { shapeWidth: 25, showTooltip: true }); - - var sample2 = new ej.Rating($("#halfRating"), { + + var sample2 = new ej.Rating($("#halfRating"),{ precision: ej.Rating.Precision.Half, value: 3.5, allowReset: true, @@ -1869,7 +1885,7 @@ module RatingComponent { showTooltip: true }); - var sample3 = new ej.Rating($("#exactRating"), { + var sample3 = new ej.Rating($("#exactRating"),{ precision: ej.Rating.Precision.Exact, value: 3.7, allowReset: true, @@ -1883,7 +1899,7 @@ module RatingComponent { shapeHeight: 25, shapeWidth: 25, showTooltip: true - }); + }); }); } @@ -1891,15 +1907,15 @@ module RatingComponent { module ReportViewerComponent { - $(function () { - var report = new ej.ReportViewer($("#territoryReportViewer"), { - reportServiceUrl: (window).baseurl + 'api/ReportViewer', - reportServerUrl: 'http://104.207.134.201/reportserver', - processingMode: ej.ReportViewer.ProcessingMode.Remote, - reportPath: "/SSRSSamples2/Territory Sales new", - isResponsive: true - }); - }); + $(function () { + var report = new ej.ReportViewer($("#territoryReportViewer"), { + reportServiceUrl: (window).baseurl + 'api/ReportViewer', + reportServerUrl: 'http://104.207.134.201/reportserver', + processingMode: ej.ReportViewer.ProcessingMode.Remote, + reportPath: "/SSRSSamples2/Territory Sales new", + isResponsive: true + }); + }); } @@ -1916,7 +1932,7 @@ module RibbonComponent { toolTip: "Pin the Ribbon" }, applicationTab: { - type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } + type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } }, tabs: [{ id: "home", text: "HOME", groups: [{ @@ -1940,7 +1956,7 @@ module RibbonComponent { } }] }, - { + { text: "Clipboard", alignType: ej.Ribbon.AlignType.Columns, content: [{ groups: [{ id: "paste", @@ -1962,8 +1978,8 @@ module RibbonComponent { height: 70 } }, - { - groups: [{ + { + groups: [{ id: "cut", text: "Cut", toolTip: "Cut", @@ -1993,14 +2009,14 @@ module RibbonComponent { prefixIcon: "e-icon e-ribbon clearAll" } }], - defaults: { + defaults: { type: "button", width: 60, isBig: false } - }] - }, - { + }] + }, + { text: "Font", alignType: "rows", content: [{ groups: [{ id: "fontfamily", @@ -2299,7 +2315,7 @@ module RibbonComponent { groups: [{ id: "zoomin", text: "Zoom In", - toolTip: "Zoom In", + toolTip: "Zoom In", buttonSettings: { width: 58, click: "onClick", @@ -2311,7 +2327,7 @@ module RibbonComponent { { id: "zoomout", text: "Zoom Out", - toolTip: "Zoom Out", + toolTip: "Zoom Out", buttonSettings: { width: 70, click: "onClick", @@ -2323,7 +2339,7 @@ module RibbonComponent { { id: "fullscreen", text: "Full Screen", - toolTip: "Full Screen", + toolTip: "Full Screen", buttonSettings: { width: 73, click: "onClick", @@ -2339,7 +2355,7 @@ module RibbonComponent { } }] }] - }, { + },{ id: "insert", text: "INSERT", groups: [{ text: "Tables", alignType: ej.Ribbon.AlignType.Columns, content: [{ groups: [{ @@ -2484,7 +2500,7 @@ module RibbonComponent { } ], defaults: { - type: "button", + type: "button", width: 70, height: 70 } @@ -2566,7 +2582,7 @@ module RibbonComponent { } ] } - ], + ], create: function createControl(args) { var ribbon = $("#defaultRibbon").data("ejRibbon"); $("#fontcolor").ejColorPicker({ value: "#FFFF00", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fontcoloricon", select: colorHandler }); @@ -2578,7 +2594,7 @@ module RibbonComponent { function colorHandler(args:any) { (this._id.indexOf("fillcolor") != -1) ? $("#contenteditor").css('background-color', args.value) : document.execCommand('forecolor', false, args.value); } -function onClick(args: any) { +function onClick(args:any) { var val, prop = args.text; val = (ej.isNullOrUndefined(args.model.text)) ? args.model.activeText : args.model.text; if (action1.indexOf(val) != -1) @@ -2596,7 +2612,7 @@ function onClick(args: any) { - + module RotatorComponent { $(function () { @@ -2606,14 +2622,14 @@ module RotatorComponent { slideHeight: "auto", displayItemsCount: "1", navigateSteps: "1", - pagerPosition: "outside", + pagerPosition:"outside", orientation: "horizontal", showPager: true, enabled: true, showCaption: true, allowKeyboardNavigation: true, showPlayButton: true, - isResponsive: true, + isResponsive:true, animationType: "slide", }); }); @@ -2623,7 +2639,7 @@ module RotatorComponent { module RTEComponent { $(function () { - var sample = new ej.RTE($("#rteSample"), { + var sample = new ej.RTE($("#rteSample"),{ width: "100%", minWidth: "150px", showFooter: true, @@ -2759,7 +2775,7 @@ module ScheduleComponent { } }); }); -} +} @@ -2819,10 +2835,10 @@ module linesparkline { dataSource: [12, 14, 11, 12, 11, 15, 12, 10, 11, 12, 15, 13, 12, 11, 10, 13, 15, 12, 14, 16, 14, 12, 11], tooltip: { visible: true, - font: { size: "12px" } + font: { size:"12px" } }, type: "line", - size: { height: "40", width: "170" }, + size: { height: "40", width:"170" }, }); }); } @@ -2830,7 +2846,7 @@ module linesparkline { module columnsparkline { $(function () { var sparkcolumnsample = new ej.Sparkline($("#column"), { - dataSource: [2, 6, -1, 1, 12, 5, -2, 7, -3, 5, 8, 10, ], + dataSource: [2, 6, -1, 1, 12, 5, -2, 7, -3, 5, 8, 10,], negativePointColor: "red", highPointColor: "blue", tooltip: { @@ -2848,7 +2864,7 @@ module columnsparkline { module areasparkline { $(function () { var sparkareasample = new ej.Sparkline($("#area"), { - dataSource: [12, -10, 11, 8, 17, 6, 2, -17, 13, -6, 8, 10, ], + dataSource: [12, -10, 11, 8, 17, 6, 2, -17, 13, -6, 8, 10,], markerSettings: { visible: true }, highPointColor: "blue", lowPointColor: "orange", @@ -2868,7 +2884,7 @@ module areasparkline { module windlosssparkline { $(function () { var sparkwinlosssample = new ej.Sparkline($("#winloss"), { - dataSource: [12, 15, -11, 13, 17, 0, -12, 17, 13, -15, 8, 10, ], + dataSource: [12, 15, -11, 13, 17, 0, -12, 17, 13, -15, 8, 10,], type: "winloss", size: { height: "100", width: "150" }, }); @@ -2894,7 +2910,7 @@ module piesparkline1 { module piesparkline2 { $(function () { var sparkpiesample2 = new ej.Sparkline($("#pie2"), { - dataSource: [8, 9, 1, ], + dataSource: [8, 9, 1,], type: "pie", tooltip: { visible: true, @@ -2939,9 +2955,9 @@ module piesparkline4 { }); } + - - + module SplitterComponent { @@ -2951,10 +2967,10 @@ module SplitterComponent { width: "50%", orientation: ej.Orientation.Vertical, properties: [{}, { paneSize: 80 }], - isResponsive: true + isResponsive:true }); var splitterInstance1 = new ej.Splitter($("#innerSpliter"), { - isResponsive: true, + isResponsive:true, }); }); } @@ -2962,7 +2978,7 @@ module SplitterComponent { module SpreadsheetComponent { - $(function () { +$(function () { var sample = new ej.Spreadsheet($("#basicSpreadsheet"), { scrollSettings: { height: 550, @@ -2976,15 +2992,14 @@ module SpreadsheetComponent { pdfUrl: (window).baseurl + "api/Spreadsheet/PdfExport" }, sheets: [{ rangeSettings: [{ dataSource: (window).defaultData, startCell: "A1" }] }], - loadComplete: () => { - var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; - if (!(spreadsheet).isImport) { - spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); - xlFormat.format({ "style": { "font-weight": "bold" } }, "A1:H1"); - xlFormat.format({ "type": "currency" }, "E2:H11"); - spreadsheet.XLRibbon.updateRibbonIcons(); - } - } + loadComplete: () => { + var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; + if (!(spreadsheet).isImport) { + spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); + xlFormat.format({ "style": { "font-weight": "bold" } }, "A1:H1"); + xlFormat.format({ "type": "currency" }, "E2:H11"); + spreadsheet.XLRibbon.updateRibbonIcons(); + }} }); }); } @@ -2993,58 +3008,58 @@ module SpreadsheetComponent { var default_data: Array = [ - { Category: "Employees", Country: "USA", JobDescription: "Sales", JobGroup: "Executive", EmployeesCount: 50 }, - { Category: "Employees", Country: "USA", JobDescription: "Sales", JobGroup: "Analyst", EmployeesCount: 40 }, - { Category: "Employees", Country: "USA", JobDescription: "Marketing", EmployeesCount: 40 }, - { Category: "Employees", Country: "USA", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 55 }, - { Category: "Employees", Country: "USA", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 175 }, - { Category: "Employees", Country: "USA", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 70 }, - { Category: "Employees", Country: "USA", JobDescription: "Management", EmployeesCount: 40 }, - { Category: "Employees", Country: "USA", JobDescription: "Accounts", EmployeesCount: 60 }, - - { Category: "Employees", Country: "India", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 43 }, - { Category: "Employees", Country: "India", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 125 }, - { Category: "Employees", Country: "India", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 60 }, - { Category: "Employees", Country: "India", JobDescription: "HR Executives", EmployeesCount: 70 }, - { Category: "Employees", Country: "India", JobDescription: "Accounts", EmployeesCount: 45 }, - - { Category: "Employees", Country: "Germany", JobDescription: "Sales", JobGroup: "Executive", EmployeesCount: 30 }, - { Category: "Employees", Country: "Germany", JobDescription: "Sales", JobGroup: "Analyst", EmployeesCount: 40 }, - { Category: "Employees", Country: "Germany", JobDescription: "Marketing", EmployeesCount: 50 }, - { Category: "Employees", Country: "Germany", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 40 }, - { Category: "Employees", Country: "Germany", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 65 }, - { Category: "Employees", Country: "Germany", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 27 }, - { Category: "Employees", Country: "Germany", JobDescription: "Management", EmployeesCount: 33 }, - { Category: "Employees", Country: "Germany", JobDescription: "Accounts", EmployeesCount: 55 }, - - { Category: "Employees", Country: "UK", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 45 }, - { Category: "Employees", Country: "UK", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 96 }, - { Category: "Employees", Country: "UK", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 55 }, - { Category: "Employees", Country: "UK", JobDescription: "HR Executives", EmployeesCount: 60 }, - { Category: "Employees", Country: "UK", JobDescription: "Accounts", EmployeesCount: 30 }, - - { Category: "Employees", Country: "France", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 40 }, - { Category: "Employees", Country: "France", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 65 }, - { Category: "Employees", Country: "France", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 27 }, - { Category: "Employees", Country: "France", JobDescription: "Marketing", EmployeesCount: 50 } + { Category : "Employees", Country : "USA", JobDescription : "Sales", JobGroup:"Executive", EmployeesCount : 50 }, + { Category : "Employees", Country : "USA", JobDescription : "Sales", JobGroup : "Analyst", EmployeesCount : 40 }, + { Category : "Employees", Country : "USA", JobDescription : "Marketing", EmployeesCount : 40 }, + { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 55 }, + { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 175}, + { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 70 }, + { Category : "Employees", Country : "USA", JobDescription : "Management", EmployeesCount : 40 }, + { Category : "Employees", Country : "USA", JobDescription : "Accounts", EmployeesCount : 60 }, + + { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 43 }, + { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 125}, + { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 60 }, + { Category : "Employees", Country : "India", JobDescription : "HR Executives", EmployeesCount : 70 }, + { Category : "Employees", Country : "India", JobDescription : "Accounts", EmployeesCount : 45 }, + + { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Executive", EmployeesCount : 30 }, + { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Analyst", EmployeesCount : 40 }, + { Category : "Employees", Country : "Germany", JobDescription : "Marketing", EmployeesCount : 50 }, + { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 40 }, + { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 65 }, + { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, + { Category : "Employees", Country : "Germany", JobDescription : "Management", EmployeesCount : 33 }, + { Category : "Employees", Country : "Germany", JobDescription : "Accounts", EmployeesCount : 55 }, + + { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 45 }, + { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 96 }, + { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 55 }, + { Category : "Employees", Country : "UK", JobDescription : "HR Executives", EmployeesCount : 60 }, + { Category : "Employees", Country : "UK", JobDescription: "Accounts", EmployeesCount: 30 }, + + { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 40 }, + { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 65 }, + { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, + { Category : "Employees", Country : "France", JobDescription: "Marketing", EmployeesCount: 50 } ]; module sunburstcomponent { $(function () { var sunburstsample = new ej.SunburstChart($("#Sunburst"), { - valueMemberPath: "EmployeesCount", + valueMemberPath: "EmployeesCount", levels: [ - { groupMemberPath: "Country" }, - { groupMemberPath: "JobDescription" }, - { groupMemberPath: "JobGroup" }, - { groupMemberPath: "JobRole" } + {groupMemberPath: "Country"}, + {groupMemberPath: "JobDescription"}, + {groupMemberPath: "JobGroup"}, + {groupMemberPath: "JobRole"} ], dataSource: default_data, - dataLabelSettings: { visible: true }, - tooltip: { visible: false }, - enableAnimation: false, - size: { height: "600" }, - innerRadius: 0.2, + dataLabelSettings:{visible:true}, + tooltip:{visible:false}, + enableAnimation:false, + size:{height:"600"}, + innerRadius:0.2, load: function () { var sender = $("#Sunburst").data("ejSunburstChart"); var SunBurstTheme = (window).themeStyle + (window).themeColor + (window).themeVarient; @@ -3055,10 +3070,9 @@ module sunburstcomponent { SunBurstTheme = "flatlight"; sender.model.theme = SunBurstTheme; }, - title: { text: "Employees Count" }, - zoomSettings: { enable: false }, - legend: { visible: true, position: 'top' } - // load:"loadTheme" + title:{text:"Employees Count"}, + zoomSettings:{enable:false}, + legend:{visible:true,position:'top'}, }); }); } @@ -3068,7 +3082,7 @@ module sunburstcomponent { module TabComponent { $(function () { - var sample = new ej.Tab($("#defaultTab"), { + var sample = new ej.Tab($("#defaultTab"),{ width: "500px", collapsible: true, events: "click", @@ -3082,8 +3096,8 @@ module TabComponent { module TagCloudComponent { - - + + var websiteCollection = [ { text: "Google", url: "http://www.google.com", frequency: 12 }, { text: "All Things Digital", url: "http://allthingsd.com/", frequency: 3 }, @@ -3114,7 +3128,7 @@ module TagCloudComponent { text: "text", url: "url", frequency: "frequency" } }); - + }); } @@ -3154,82 +3168,82 @@ module EditorComponent { - + module TileViewComponent { $(function () { var tile1 = new ej.Tile($("#tile1"), { - imagePosition: "fill", - caption: { text: "People" }, - tileSize: "medium", - imageUrl: 'content/images/tile/windows/people_1.png' + imagePosition:"fill", + caption:{text:"People"}, + tileSize:"medium", + imageUrl:'content/images/tile/windows/people_1.png' }); - var tile2 = new ej.Tile($("#tile2"), { - imagePosition: "center", - tileSize: "small", - imageUrl: 'content/images/tile/windows/alerts.png', - + var tile2 = new ej.Tile($("#tile2"), { + imagePosition:"center", + tileSize:"small", + imageUrl:'content/images/tile/windows/alerts.png', + }); - var tile3 = new ej.Tile($("#tile3"), { - imagePosition: "center", - tileSize: "small", - imageUrl: 'content/images/tile/windows/bing.png', + var tile3 = new ej.Tile($("#tile3"), { + imagePosition:"center", + tileSize:"small", + imageUrl:'content/images/tile/windows/bing.png', }); - var tile4 = new ej.Tile($("#tile4"), { - tileSize: "small", - imageUrl: 'content/images/tile/windows/camera.png', + var tile4 = new ej.Tile($("#tile4"), { + tileSize:"small", + imageUrl:'content/images/tile/windows/camera.png', }); - var tile5 = new ej.Tile($("#tile5"), { - imagePosition: "center", - tileSize: "small", - imageUrl: 'content/images/tile/windows/messages.png', + var tile5 = new ej.Tile($("#tile5"), { + imagePosition:"center", + tileSize:"small", + imageUrl:'content/images/tile/windows/messages.png', }); - var tile6 = new ej.Tile($("#tile6"), { - imagePosition: "center", - tileSize: "medium", - imageUrl: 'content/images/tile/windows/games.png', - caption: { text: "Play" } + var tile6 = new ej.Tile($("#tile6"), { + imagePosition:"center", + tileSize:"medium", + imageUrl:'content/images/tile/windows/games.png', + caption:{text:"Play"} }); - var tile7 = new ej.Tile($("#tile7"), { - tileSize: "medium", - imageUrl: 'content/images/tile/windows/map.png', - caption: { text: "Maps" } + var tile7 = new ej.Tile($("#tile7"), { + tileSize:"medium", + imageUrl:'content/images/tile/windows/map.png', + caption:{text:"Maps"} }); - var tile8 = new ej.Tile($("#tile8"), { - imagePosition: "fill", - tileSize: "wide", - imageUrl: 'content/images/tile/windows/sports.png', - caption: { text: "Sports" } + var tile8 = new ej.Tile($("#tile8"), { + imagePosition:"fill", + tileSize:"wide", + imageUrl:'content/images/tile/windows/sports.png', + caption:{text:"Sports"} }); - var tile9 = new ej.Tile($("#tile9"), { - imagePosition: "fill", - tileSize: "medium", - imageUrl: 'content/images/tile/windows/people_2.png', - caption: { text: "People" } + var tile9 = new ej.Tile($("#tile9"), { + imagePosition:"fill", + tileSize:"medium", + imageUrl:'content/images/tile/windows/people_2.png', + caption:{text:"People"} }); - var tile10 = new ej.Tile($("#tile10"), { - imagePosition: "center", - tileSize: "medium", - imageUrl: 'content/images/tile/windows/pictures.png', - caption: { text: "Photo" } + var tile10 = new ej.Tile($("#tile10"), { + imagePosition:"center", + tileSize:"medium", + imageUrl:'content/images/tile/windows/pictures.png', + caption:{text:"Photo"} }); - var tile11 = new ej.Tile($("#tile11"), { - imagePosition: "center", - tileSize: "wide", - imageUrl: 'content/images/tile/windows/weather.png', - caption: { text: "Weather" } + var tile11 = new ej.Tile($("#tile11"), { + imagePosition:"center", + tileSize:"wide", + imageUrl:'content/images/tile/windows/weather.png', + caption:{text:"Weather"} }); - var tile12 = new ej.Tile($("#tile12"), { - imagePosition: "center", - tileSize: "medium", - imageUrl: 'content/images/tile/windows/music.png', - caption: { text: "Music" } + var tile12 = new ej.Tile($("#tile12"), { + imagePosition:"center", + tileSize:"medium", + imageUrl:'content/images/tile/windows/music.png', + caption:{text:"Music"} }); - var tile13 = new ej.Tile($("#tile13"), { - imagePosition: "center", - tileSize: "medium", - imageUrl: 'content/images/tile/windows/favs.png', - caption: { text: "Favorites" } + var tile13 = new ej.Tile($("#tile13"), { + imagePosition:"center", + tileSize:"medium", + imageUrl:'content/images/tile/windows/favs.png', + caption:{text:"Favorites"} }); }); } @@ -3248,13 +3262,13 @@ module TimePickerComponent { module ToolbarComponent { - + $(function () { - var sample = new ej.Toolbar($("#editingToolbar"), { + var sample = new ej.Toolbar($("#editingToolbar"),{ width: "100%", cssClass: "gradient-lime", enableSeparator: true, - + isResponsive: true, orientation: ej.Orientation.Horizontal, showRoundedCorner: true @@ -3267,10 +3281,10 @@ module ToolbarComponent { module TooltipComponent { - + $(function () { - var sample1 = new ej.Tooltip($("#link1"), { + var sample1 = new ej.Tooltip($("#link1"),{ content: "ECMAScript (or ES) is a trademarked scripting-language specification standardized by Ecma International in ECMA-262 and ISO/IEC 16262.", associate: "mousefollow", autoCloseTimeout: 5000, @@ -3280,7 +3294,7 @@ module TooltipComponent { showShadow: true }); - var sample2 = new ej.Tooltip($("#link2"), { + var sample2 = new ej.Tooltip($("#link2"),{ content: "The World Wide Web (WWW) is an information space where documents and other web resources are identified by URLs, interlinked by hypertext links, and can be accessed via the Internet.", position: { stem: { @@ -3299,7 +3313,7 @@ module TooltipComponent { showShadow: true }); - var sample3 = new ej.Tooltip($("#link3"), { + var sample3 = new ej.Tooltip($("#link3"),{ content: 'Object-oriented programming (OOP) is a programming language model organized around objects rather than "actions" and data rather than logic.', position: { stem: { @@ -3326,43 +3340,43 @@ module TooltipComponent { module TreeGridComponent { $(function () { var treegridInstance = new ej.TreeGrid($("#TreeGridContainer"), { - dataSource: (window).treeGridData, - childMapping: "subtasks", - allowSorting: true, - allowMultiSorting: true, - enableAltRow: true, - allowFiltering: true, - treeColumnIndex: 1, - allowKeyboardNavigation: true, - showColumnChooser: true, - showColumnOptions: true, - contextMenuSettings: { - showContextMenu: true, - contextMenuItems: ["add", "edit", "delete"] - }, - columnDialogFields: ["field", "headerText", "editType", "width", "visible", "allowSorting", "textAlign", "headerTextAlign"], - editSettings: { - allowAdding: true, - allowEditing: true, - allowDeleting: true, - editMode: "cellEditing", - rowPosition: "belowSelectedRow" - }, - toolbarSettings: { - showToolbar: true, - toolbarItems: ["add", "edit", "delete", "update", "cancel", "expandAll", "collapseAll"] - }, - columns: [ - { field: "taskID", headerText: "Task Id", allowFiltering: false, editType: "numericedit", filterEditType: "numericedit" }, - { field: "taskName", headerText: "Task Name", editType: "stringedit", filterEditType: "stringedit" }, - { field: "startDate", headerText: "Start Date", editType: "datepicker", filterEditType: "datepicker", format: "{0:MM/dd/yyyy}" }, - { field: "endDate", headerText: "End Date", editType: "datepicker", filterEditType: "datepicker", format: "{0:MM/dd/yyyy}" }, - { field: "progress", headerText: "Progress", editType: "numericedit", filterEditType: "numericedit" } - ], - isResponsive: true, - }); + dataSource: (window).treeGridData, + childMapping: "subtasks", + allowSorting: true, + allowMultiSorting: true, + enableAltRow: true, + allowFiltering: true, + treeColumnIndex: 1, + allowKeyboardNavigation: true, + showColumnChooser: true, + showColumnOptions: true, + contextMenuSettings: { + showContextMenu: true, + contextMenuItems: ["add", "edit", "delete"] + }, + columnDialogFields: ["field", "headerText", "editType", "width", "visible", "allowSorting", "textAlign", "headerTextAlign"], + editSettings: { + allowAdding: true, + allowEditing: true, + allowDeleting: true, + editMode: "cellEditing", + rowPosition: "belowSelectedRow" + }, + toolbarSettings: { + showToolbar: true, + toolbarItems: ["add","edit","delete","update","cancel","expandAll","collapseAll"] + }, + columns: [ + { field: "taskID", headerText: "Task Id", allowFiltering: false, editType: "numericedit", filterEditType: "numericedit" }, + { field: "taskName", headerText: "Task Name", editType: "stringedit", filterEditType: "stringedit" }, + { field: "startDate", headerText: "Start Date", editType: "datepicker", filterEditType: "datepicker", format:"{0:MM/dd/yyyy}" }, + { field: "endDate", headerText: "End Date", editType: "datepicker", filterEditType: "datepicker", format:"{0:MM/dd/yyyy}" }, + { field: "progress", headerText: "Progress", editType: "numericedit", filterEditType: "numericedit" } + ], + isResponsive: true, }); -} +}); +} @@ -3407,7 +3421,7 @@ module treemapcomponent { - + module TreeViewComponent { $(function () { @@ -3424,9 +3438,9 @@ module TreeViewComponent { module UploadboxComponent { - + $(function () { - var sample = new ej.Uploadbox($("#UploadDefault"), { + var sample = new ej.Uploadbox($("#UploadDefault"),{ saveUrl: (window).baseurl + "api/uploadbox/Save", removeUrl: (window).baseurl + "api/uploadbox/Remove", buttonText: { @@ -3449,12 +3463,12 @@ module UploadboxComponent { module WaitingPopupComponent { $(function () { - var sample = new ej.WaitingPopup($("#target"), { + var sample = new ej.WaitingPopup($("#target"),{ showOnInit: true, showImage: true, text: 'waiting…', - target: "#target", - appendTo: "#waiting" + target: "#target", + appendTo: "#waiting" }); }); diff --git a/types/ej.web.all/index.d.ts b/types/ej.web.all/index.d.ts index e95fb94b2b..77332f6a6d 100644 --- a/types/ej.web.all/index.d.ts +++ b/types/ej.web.all/index.d.ts @@ -8,7 +8,7 @@ /*! * filename: ej.web.all.d.ts -* version : 16.1.0.32 +* version : 16.1.0.37 * Copyright Syncfusion Inc. 2001 - 2018. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing @@ -7995,9 +7995,9 @@ declare namespace ej { */ footerTemplateId?: string; - /** This event is triggered before the dialog widgets gets open. + /** Triggered when the custom action button clicked. */ - beforeOpen?(e: BeforeOpenEventArgs): void; + actionButtonClick?(e: ActionButtonClickEventArgs): void; /** This event is triggered whenever the AJAX request fails to retrieve the dialog content. */ @@ -8007,6 +8007,10 @@ declare namespace ej { */ ajaxSuccess?(e: AjaxSuccessEventArgs): void; + /** This event is triggered before the dialog widgets gets open. + */ + beforeOpen?(e: BeforeOpenEventArgs): void; + /** This event is triggered before the dialog widgets get closed. */ beforeClose?(e: BeforeCloseEventArgs): void; @@ -8015,6 +8019,10 @@ declare namespace ej { */ close?(e: CloseEventArgs): void; + /** Triggered when the dialog content is collapsed. + */ + collapse?(e: CollapseEventArgs): void; + /** Triggered after the dialog content is loaded in DOM. */ contentLoad?(e: ContentLoadEventArgs): void; @@ -8039,6 +8047,10 @@ declare namespace ej { */ dragStop?(e: DragStopEventArgs): void; + /** Triggered when the dialog content is expanded. + */ + expand?(e: ExpandEventArgs): void; + /** Triggered after the dialog is opened. */ open?(e: OpenEventArgs): void; @@ -8054,33 +8066,33 @@ declare namespace ej { /** Triggered when the user stops resizing the dialog. */ resizeStop?(e: ResizeStopEventArgs): void; - - /** Triggered when the dialog content is expanded. - */ - expand?(e: ExpandEventArgs): void; - - /** Triggered when the dialog content is collapsed. - */ - collapse?(e: CollapseEventArgs): void; - - /** Triggered when the custom action button clicked. - */ - actionButtonClick?(e: ActionButtonClickEventArgs): void; } - export interface BeforeOpenEventArgs { + export interface ActionButtonClickEventArgs { /** Set this option to true to cancel the event. */ cancel?: boolean; + /** Name of the event target attribute. + */ + buttonID?: string; + + /** Name of the event. + */ + type?: string; + /** Instance of the dialog model object. */ model?: ej.Dialog.Model; - /** Name of the event + /** Name of the event current target title. */ - type?: string; + currentTarget?: string; + + /** Name of the event. + */ + event?: string; } export interface AjaxErrorEventArgs { @@ -8137,6 +8149,21 @@ declare namespace ej { data?: string; } + export interface BeforeOpenEventArgs { + + /** Set this option to true to cancel the event. + */ + cancel?: boolean; + + /** Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /** Name of the event + */ + type?: string; + } + export interface BeforeCloseEventArgs { /** Current event object. @@ -8154,6 +8181,10 @@ declare namespace ej { /** Name of the event. */ type?: string; + + /** returns true when the dialog activated by user interaction otherwise returns false + */ + isInteraction?: boolean; } export interface CloseEventArgs { @@ -8173,6 +8204,29 @@ declare namespace ej { /** Name of the event */ type?: string; + + /** returns true when the Dialog activated by user interaction otherwise returns false + */ + isInteraction?: boolean; + } + + export interface CollapseEventArgs { + + /** Set this option to true to cancel the event. + */ + cancel?: boolean; + + /** Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /** Name of the event. + */ + type?: string; + + /** returns true when the Dialog activated by user interaction otherwise returns false + */ + isInteraction?: boolean; } export interface ContentLoadEventArgs { @@ -8285,6 +8339,25 @@ declare namespace ej { event?: any; } + export interface ExpandEventArgs { + + /** Set this option to true to cancel the event. + */ + cancel?: boolean; + + /** Instance of the dialog model object. + */ + model?: ej.Dialog.Model; + + /** Name of the event. + */ + type?: string; + + /** returns true when the Dialog activated by user interaction otherwise returns false + */ + isInteraction?: boolean; + } + export interface OpenEventArgs { /** Set this option to true to cancel the event. @@ -8357,59 +8430,6 @@ declare namespace ej { event?: any; } - export interface ExpandEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the dialog model object. - */ - model?: ej.Dialog.Model; - - /** Name of the event. - */ - type?: string; - } - - export interface CollapseEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Instance of the dialog model object. - */ - model?: ej.Dialog.Model; - - /** Name of the event. - */ - type?: string; - } - - export interface ActionButtonClickEventArgs { - - /** Set this option to true to cancel the event. - */ - cancel?: boolean; - - /** Name of the event target attribute. - */ - buttonID?: string; - - /** Name of the event. - */ - type?: string; - - /** Instance of the dialog model object. - */ - model?: ej.Dialog.Model; - - /** Name of the event current target title. - */ - currentTarget?: string; - } - export interface AjaxSettings { /** It specifies, whether to enable or disable asynchronous request. @@ -23206,9 +23226,10 @@ declare namespace ej { getCurrentViewData(): any[]; /** Get the data of given row index in grid. + * @param {number} Pass the index of the row to get the corresponding data * @returns {any} */ - getDataByIndex(): any; + getDataByIndex(rowIndex: number): any; /** Get the column field name from the given header text in grid. * @param {string} Pass header text of the column to get its corresponding field name @@ -35422,6 +35443,13 @@ declare namespace ej { */ filterColumn(fieldName: string, filterOperator: string, filterValue: string, predicate?: string, matchCase?: boolean): void; + /** To filter multiple columns with multiple conditions dynamically in Gantt. + * @param {Gantt.EjPredicate} Pass the filtering column details and conditions as ejPredicate instance. The ejPredicate object is defined as fieldName,filterOperator, filterValue and + * ignoreCase properties. + * @returns {void} + */ + filterContent(ejPredicate: Gantt.EjPredicate): void; + /** To hide the column by using header text * @param {string} you can pass a header text of a column to hide * @returns {void} @@ -35534,6 +35562,25 @@ declare namespace ej { } export namespace Gantt { + export interface EjPredicate { + + /** Pass the field name of the column. + */ + fieldName?: string; + + /** string/integer/date operator. + */ + filterOperator?: string; + + /** Pass the value to be filtered in a column. + */ + filterValue?: string; + + /** Optional - pass the ignore case value as true/false. + */ + ignoreCase?: boolean; + } + export interface Model { /** Specifies the fields to be included in the add dialog in Gantt @@ -38232,6 +38279,13 @@ declare namespace ej { */ filterColumn(fieldName: string, filterOperator: string, filterValue: string, predicate: string, matchcase: boolean, actualFilterValue: any): void; + /** To filter multiple columns with multiple conditions dynamically in TreeGrid. + * @param {TreeGrid.EjPredicate} Pass the filtering column details and conditions as ejPredicate instance. ejPredicate object is defined as fieldName,filterOperator, filterValue and + * ignoreCase properties + * @returns {void} + */ + filterContent(ejPredicate: TreeGrid.EjPredicate): void; + /** To change the index of the tree column in TreeGrid. * @param {number} Pass the column index to make the column as treeColumnIndex. * @returns {void} @@ -38275,6 +38329,25 @@ declare namespace ej { } export namespace TreeGrid { + export interface EjPredicate { + + /** Pass the field name of the column. + */ + fieldName?: string; + + /** string/integer/date operator. + */ + filterOperator?: string; + + /** Pass the value to be filtered in a column. + */ + filterValue?: string; + + /** Optional - pass the ignore case value as true/false. + */ + ignoreCase?: boolean; + } + export interface Model { /** Enables or disables the ability to resize the column width interactively. @@ -43129,6 +43202,14 @@ declare namespace ej { export interface XLFormat { + /** This method is used to add the custom Date & Time format and recognize it as a preferred pattern in spreadsheet. + * @param {string} Pass the name for custom format. + * @param {string} Pass the custom format string. + * @param {string} Pass the type for custom format. + * @returns {void} + */ + addCustomFormatSpecifier(name: string, formatSpecifier: string, type: string): void; + /** This method is used to add the font to the Ribbon font family dropdown. * @param {string} Font name which needs to add into the font family option. * @returns {void} From 8f488f0f4e6d8d158838e0e0398b4d7914209ca4 Mon Sep 17 00:00:00 2001 From: Syncfusion-JavaScript Date: Wed, 25 Apr 2018 18:14:51 +0530 Subject: [PATCH 102/564] updated file committed --- types/ej.web.all/ej.web.all-tests.ts | 1362 +++++++++++++------------- 1 file changed, 674 insertions(+), 688 deletions(-) diff --git a/types/ej.web.all/ej.web.all-tests.ts b/types/ej.web.all/ej.web.all-tests.ts index 62ad67ce7b..83ed128742 100644 --- a/types/ej.web.all/ej.web.all-tests.ts +++ b/types/ej.web.all/ej.web.all-tests.ts @@ -1,7 +1,3 @@ -/* tslint:disable */ - - - module AccordionComponent { $(function () { var sample = new ej.Accordion($("#basicAccordion"), { @@ -22,39 +18,39 @@ module AccordionComponent { }); } - -module AutocompleteComponent{ + +module AutocompleteComponent { var carList = [ - "Audi S6", "Austin-Healey", "Alfa Romeo", "Aston Martin", - "BMW 7", "Bentley Mulsanne", "Bugatti Veyron", - "Chevrolet Camaro", "Cadillac", - "Duesenberg J", "Dodge Sprinter", - "Elantra", "Excavator", - "Ford Boss 302", "Ferrari 360", "Ford Thunderbird", - "GAZ Siber", - "Honda S2000", "Hyundai Santro", - "Isuzu Swift", "Infiniti Skyline", - "Jaguar XJS", - "Kia Sedona EX", "Koenigsegg Agera", - "Lotus Esprit", "Lamborghini Diablo", - "Mercedes-Benz", "Mercury Coupe", "Maruti Alto 800", - "Nissan Qashqai", - "Oldsmobile S98", "Opel Superboss", - "Porsche 356", "Pontiac Sunbird", - "Scion SRS/SC/SD", "Saab Sportcombi", "Subaru Sambar", "Suzuki Swift", - "Triumph Spitfire", "Toyota 2000GT", - "Volvo P1800", "Volkswagen Shirako" - ]; - $(function () { - var autocompleteInstance =new ej.Autocomplete($("#selectCar"), { + "Audi S6", "Austin-Healey", "Alfa Romeo", "Aston Martin", + "BMW 7", "Bentley Mulsanne", "Bugatti Veyron", + "Chevrolet Camaro", "Cadillac", + "Duesenberg J", "Dodge Sprinter", + "Elantra", "Excavator", + "Ford Boss 302", "Ferrari 360", "Ford Thunderbird", + "GAZ Siber", + "Honda S2000", "Hyundai Santro", + "Isuzu Swift", "Infiniti Skyline", + "Jaguar XJS", + "Kia Sedona EX", "Koenigsegg Agera", + "Lotus Esprit", "Lamborghini Diablo", + "Mercedes-Benz", "Mercury Coupe", "Maruti Alto 800", + "Nissan Qashqai", + "Oldsmobile S98", "Opel Superboss", + "Porsche 356", "Pontiac Sunbird", + "Scion SRS/SC/SD", "Saab Sportcombi", "Subaru Sambar", "Suzuki Swift", + "Triumph Spitfire", "Toyota 2000GT", + "Volvo P1800", "Volkswagen Shirako" + ]; + $(function () { + var autocompleteInstance = new ej.Autocomplete($("#selectCar"), { width: "100%", watermarkText: "Select a car", dataSource: carList, enableAutoFill: true, showPopupButton: true, multiSelectMode: "delimiter" - }); + }); }); } @@ -197,12 +193,12 @@ module ChartComponent { range: { min: 25, max: 50, interval: 5 }, labelFormat: "{value}%", title: { text: "Efficiency" }, - + }, commonSeriesOptions: - { + { type: 'line', enableAnimation: true, - tooltip:{ visible :true, template:'Tooltip'}, + tooltip: { visible: true, template: 'Tooltip' }, marker: { shape: 'circle', @@ -212,30 +208,30 @@ module ChartComponent { }, visible: true }, - border : {width: 2} - }, - series: - [ - { - points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 },{ x: 2007, y: 26 }, { x: 2008, y: 27 }, - { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], - name: 'India' - }, + border: { width: 2 } + }, + series: + [ { - points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 },{ x: 2007, y: 30 }, { x: 2008, y: 36 }, - { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], - name: 'Germany' + points: [{ x: 2005, y: 28 }, { x: 2006, y: 25 }, { x: 2007, y: 26 }, { x: 2008, y: 27 }, + { x: 2009, y: 32 }, { x: 2010, y: 35 }, { x: 2011, y: 30 }], + name: 'India' }, - { - points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 },{ x: 2007, y: 34 }, { x: 2008, y: 41 }, - { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], - name: 'England' - }, { - points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 },{ x: 2007, y: 40 }, { x: 2008, y: 44 }, - { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], - name: 'France' - } + points: [{ x: 2005, y: 31 }, { x: 2006, y: 28 }, { x: 2007, y: 30 }, { x: 2008, y: 36 }, + { x: 2009, y: 36 }, { x: 2010, y: 39 }, { x: 2011, y: 37 }], + name: 'Germany' + }, + { + points: [{ x: 2005, y: 36 }, { x: 2006, y: 32 }, { x: 2007, y: 34 }, { x: 2008, y: 41 }, + { x: 2009, y: 42 }, { x: 2010, y: 42 }, { x: 2011, y: 43 }], + name: 'England' + }, + { + points: [{ x: 2005, y: 39 }, { x: 2006, y: 36 }, { x: 2007, y: 40 }, { x: 2008, y: 44 }, + { x: 2009, y: 45 }, { x: 2010, y: 48 }, { x: 2011, y: 46 }], + name: 'France' + } ], isResponsive: true, load: function () { @@ -300,13 +296,14 @@ module ChartComponent { theme = "flatlight"; break; } - sender.model.theme = theme; + sender.model.theme = theme; } }, title: { text: 'Efficiency of oil-fired power production' }, size: { height: "600" }, - legend: { visible: true}, + legend: { visible: true }, }); + // chartsample.model.load="loadTheme"; }); } @@ -360,7 +357,7 @@ module circulargaugecomponent { backgroundColor: "#f5b43f", border: { color: "#f5b43f" } }] - }] + }] }); }); } @@ -379,21 +376,21 @@ module ColorPickerComponent { -module ComboBoxComponent{ +module ComboBoxComponent { var BikeList = [ { empid: "bk1", text: "Apache RTR" }, { empid: "bk2", text: "CBR 150-R" }, { empid: "bk3", text: "CBZ Xtreme" }, { empid: "bk4", text: "Discover" }, { empid: "bk5", text: "Dazzler" }, { empid: "bk6", text: "Flame" }, { empid: "bk7", text: "Fazzer" }, { empid: "bk8", text: "FZ-S" }, { empid: "bk9", text: "Pulsar" }, { empid: "bk10", text: "Shine" }, { empid: "bk11", text: "R15" }, { empid: "bk12", text: "Unicorn" } ]; - $(function () { - var comboboxInstance =new ej.ComboBox($("#selectCar"), { + $(function () { + var comboboxInstance = new ej.ComboBox($("#selectCar"), { width: "100%", placeholder: "Select a Bike", - fields: { text: "text", value: "empid" }, + fields: { text: "text", value: "empid" }, dataSource: BikeList, autofill: true - }); + }); }); } @@ -465,7 +462,8 @@ $(function () { }), createNode({ name: "Project", width: 150, height: 100, offsetX: 300, offsetY: 430, labels: [createLabel({ "text": "Find Project \nmanager" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Decision }), createNode({ - name: "End", width: 150, height: 60, offsetX: 300, offsetY: 555, labels: [createLabel({ "text": "Implement and Deliver" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), + name: "End", width: 150, height: 60, offsetX: 300, offsetY: 555, labels: [createLabel({ "text": "Implement and Deliver" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process + }), createNode({ name: "Decision", width: 250, height: 60, offsetX: 550, offsetY: 60, labels: [createLabel({ "text": "Decision Process for new software ideas" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Card, fillColor: "#858585", borderColor: "#858585" }), createNode({ name: "Reject", width: 150, height: 60, offsetX: 550, offsetY: 285, labels: [createLabel({ "text": "Reject and write report" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }), createNode({ name: "Resources", width: 150, height: 60, offsetX: 550, offsetY: 430, labels: [createLabel({ "text": "Hire new resources" })], type: "flow", shape: ej.datavisualization.Diagram.FlowShapes.Process }) @@ -479,7 +477,7 @@ $(function () { createConnector({ name: "connector6", sourceNode: "Project", targetNode: "Resources", labels: [createLabel({ "text": "No" })] }) ] }); - + }); function createNode(option: ej.datavisualization.Diagram.Node) { @@ -500,11 +498,11 @@ function createConnector(option: ej.datavisualization.Diagram.Connector) { return option; } -function createLabel(options : any) { +function createLabel(options: any) { return options; } - + module DialogComponent { $(function () { @@ -512,15 +510,17 @@ module DialogComponent { width: 550, minWidth: 310, minHeight: 215, - target:".control", - close:()=>{ - $("#btnOpen").show();} + target: ".control", + close: () => { + $("#btnOpen").show(); + } }); var btnInstance = new ej.Button($("#btnOpen"), { size: "medium", - click: ()=>{ - $("#btnOpen").hide(); - $("#basicDialog").ejDialog("open");}, + click: () => { + $("#btnOpen").hide(); + $("#basicDialog").ejDialog("open"); + }, type: "button", height: 30, width: 150 @@ -554,7 +554,7 @@ module digitalgaugecomponent { } - + @@ -566,7 +566,7 @@ module DropDownListComponent { { empid: "bk10", text: "Shine" }, { empid: "bk11", text: "R15" }, { empid: "bk12", text: "Unicorn" } ]; $(function () { - var sample = new ej.DropDownList($("#bikeList"),{ + var sample = new ej.DropDownList($("#bikeList"), { dataSource: BikeList, width: "100%", watermarkText: "Select a bike", @@ -574,12 +574,12 @@ module DropDownListComponent { enableFilterSearch: true, caseSensitiveSearch: true, enableIncrementalSearch: true, - enablePopupResize: true, + enablePopupResize: true, delimiterChar: ";", multiSelectMode: ej.MultiSelectMode.Delimiter, maxPopupHeight: "300px", - minPopupHeight: "150px", - maxPopupWidth: "500px", + minPopupHeight: "150px", + maxPopupWidth: "500px", minPopupWidth: "350px", showCheckbox: true, showRoundedCorner: true @@ -610,53 +610,53 @@ module ExplorerComponent { module GanttComponent { - $(function () { - var ganttInstance = new ej.Gantt($("#GanttContainer"), { - dataSource: (window).projectData, - allowColumnResize: true, - allowSorting: true, - allowSelection: true, - enableContextMenu: true, - taskIdMapping: "taskID", - allowDragAndDrop: true, - taskNameMapping: "taskName", - startDateMapping: "startDate", - showColumnChooser: true, - showColumnOptions: true, - progressMapping: "progress", - durationMapping: "duration", - endDateMapping: "endDate", - childMapping: "subtasks", - scheduleStartDate: "02/01/2017", - scheduleEndDate: "04/09/2017", - //Resources mapping - resourceInfoMapping: "resourceId", - resourceNameMapping: "resourceName", - resourceIdMapping: "resourceId", - resources: (window).projectResources, - predecessorMapping: "predecessor", - showResourceNames: true, - toolbarSettings: { - showToolbar: true, - toolbarItems: ["add","edit","delete","update","cancel","indent","outdent","expandAll","collapseAll","search"] - }, - editSettings: { - allowEditing: true, - allowAdding: true, - allowDeleting: true, - allowIndent: true, - editMode: "cellEditing" - }, - sizeSettings: { - width: "100%", - height: "100%" - }, - dragTooltip: { showTooltip: true }, - showGridCellTooltip: true, - treeColumnIndex: 1, - isResponsive: true, + $(function () { + var ganttInstance = new ej.Gantt($("#GanttContainer"), { + dataSource: (window).projectData, + allowColumnResize: true, + allowSorting: true, + allowSelection: true, + enableContextMenu: true, + taskIdMapping: "taskID", + allowDragAndDrop: true, + taskNameMapping: "taskName", + startDateMapping: "startDate", + showColumnChooser: true, + showColumnOptions: true, + progressMapping: "progress", + durationMapping: "duration", + endDateMapping: "endDate", + childMapping: "subtasks", + scheduleStartDate: "02/01/2017", + scheduleEndDate: "04/09/2017", + //Resources mapping + resourceInfoMapping: "resourceId", + resourceNameMapping: "resourceName", + resourceIdMapping: "resourceId", + resources: (window).projectResources, + predecessorMapping: "predecessor", + showResourceNames: true, + toolbarSettings: { + showToolbar: true, + toolbarItems: ["add", "edit", "delete", "update", "cancel", "indent", "outdent", "expandAll", "collapseAll", "search"] + }, + editSettings: { + allowEditing: true, + allowAdding: true, + allowDeleting: true, + allowIndent: true, + editMode: "cellEditing" + }, + sizeSettings: { + width: "100%", + height: "100%" + }, + dragTooltip: { showTooltip: true }, + showGridCellTooltip: true, + treeColumnIndex: 1, + isResponsive: true, + }); }); -}); } @@ -749,7 +749,7 @@ $(function () { module KanbanComponent { $(function () { var sample = new ej.Kanban($("#Kanban"), { - dataSource: new ej.DataManager((window).kanbanData).executeLocal(new ej.Query().take(20)), + dataSource: new ej.DataManager((window).kanbanData).executeLocal(new ej.Query().take(20)), columns: [ { headerText: "Backlog", key: "Open" }, { headerText: "In Progress", key: "InProgress" }, @@ -768,7 +768,7 @@ module KanbanComponent { }); } - + module lineargaugecomponent { @@ -794,14 +794,14 @@ module lineargaugecomponent { backgroundColor: "#E94649", border: { color: "#E94649" }, startWidth: 4, endWidth: 4 }] - }] + }] }); }); } - - + + module ListBoxComponent { $(function () { @@ -811,13 +811,13 @@ module ListBoxComponent { }); } - + module ListviewComponent { $(function () { var listviewInstance = new ej.ListView($("#defaultlistview"), { - enableCheckMark: true, - width: 400 + enableCheckMark: true, + width: 400 }); }); } @@ -1056,7 +1056,7 @@ module mapcomponenet { module MenuComponent { $(function () { - var sample = new ej.Menu($("#syncfusionProducts"),{ + var sample = new ej.Menu($("#syncfusionProducts"), { width: "100%", animationType: ej.AnimationType.Default, cssClass: 'gradient-lime ', @@ -1081,12 +1081,12 @@ module MenuComponent { - + module NavigationDrawerComponent { $(function () { var navigationdrawerInstance = new ej.NavigationDrawer($("#navpane"), { - targetId: "butdrawer", + targetId: "butdrawer", contentId: "content_container", type: "overlay", direction: "left", @@ -1097,8 +1097,8 @@ module NavigationDrawerComponent { }, position: "normal" }); - $("#navpane_listview").click(function(e: any) { - var text=e.target["text"]||$(e.target).closest("li.e-list").text(); + $("#navpane_listview").click(function (e: any) { + var text = e.target["text"] || $(e.target).closest("li.e-list").text(); $("#butdrawer").parent().children("h2").text(text); }); }); @@ -1109,7 +1109,7 @@ module NavigationDrawerComponent { module PDFViewerComponent { $(function () { var pdfviewerControl = new ej.PdfViewer($("#pdfviewer"), { - serviceUrl:(window).baseurl+ "api/PdfViewer", + serviceUrl: (window).baseurl + "api/PdfViewer", isResponsive: true }); }); @@ -1119,50 +1119,42 @@ module PDFViewerComponent { module PivotChartOlap { $(function () { - var sample = new ej.PivotChart($("#PivotChart"),{ + var sample = new ej.PivotChart($("#PivotChart"), { dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]" - } - ], - axis: "columns" - } - ], - filters:[] - }, - isResponsive: true,zooming:{enableScrollbar: true}, - commonSeriesOptions: { - type: "column" - }, - size: { height: "460px", width: "100%" }, - primaryXAxis: { title: { text: "Date - Fiscal" }, labelRotation: 0 }, - primaryYAxis: { title: { text: "Internet Sales Amount" } }, - legend: { visible: true, rowCount: 2 }, - load: function () { - var PivotChart = (window).themeStyle + (window).themeColor + (window).themeVarient; - PivotChart = PivotChart.toString(); - if (PivotChart.indexOf("dark") > -1 || PivotChart.indexOf("contrast") > -1) - PivotChart = "flatdark"; - else - PivotChart = "flatlight"; - this.model.theme = PivotChart; + data: "//bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]" + } + ], + axis: "columns" + } + ], + filters: [] }, + isResponsive: true, zooming: { enableScrollbar: true }, + commonSeriesOptions: { + type: "column" + }, + size: { height: "460px", width: "100%" }, + primaryXAxis: { title: { text: "Date - Fiscal" }, labelRotation: 0 }, + primaryYAxis: { title: { text: "Internet Sales Amount" } }, + legend: { visible: true, rowCount: 2 } + // load:"loadTheme" }); }); } @@ -1199,53 +1191,45 @@ var pivot_dataset = [ module PivotChartRelational { $(function () { - var sample = new ej.PivotChart($("#PivotChart"),{ + var sample = new ej.PivotChart($("#PivotChart"), { dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - fieldCaption: "Country" - }, - { - fieldName: "State", - fieldCaption: "State" - }, - { - fieldName: "Date", - fieldCaption: "Date" - } - ], - columns: [ - { - fieldName: "Product", - fieldCaption: "Product" - } - ], - values: [ - { - fieldName: "Amount", - fieldCaption: "Amount" - } - ], - filters:[] - }, - isResponsive: true,zooming:{enableScrollbar: true}, - commonSeriesOptions: { - type: "column" - }, - size: { height: "460px", width: "100%" }, - primaryYAxis: { title: { text: "Amount" } }, - legend: { visible: true }, - load: function () { - var PivotChart = (window).themeStyle + (window).themeColor + (window).themeVarient; - PivotChart = PivotChart.toString(); - if (PivotChart.indexOf("dark") > -1 || PivotChart.indexOf("contrast") > -1) - PivotChart = "flatdark"; - else - PivotChart = "flatlight"; - this.model.theme = PivotChart; + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + fieldCaption: "Country" + }, + { + fieldName: "State", + fieldCaption: "State" + }, + { + fieldName: "Date", + fieldCaption: "Date" + } + ], + columns: [ + { + fieldName: "Product", + fieldCaption: "Product" + } + ], + values: [ + { + fieldName: "Amount", + fieldCaption: "Amount" + } + ], + filters: [] }, + isResponsive: true, zooming: { enableScrollbar: true }, + commonSeriesOptions: { + type: "column" + }, + size: { height: "460px", width: "100%" }, + primaryYAxis: { title: { text: "Amount" } }, + legend: { visible: true } + // load:"loadTheme" }); }); } @@ -1255,106 +1239,106 @@ module PivotChartRelational { module PivotGaugeOlap { $(function () { - var sample = new ej.PivotGauge($("#PivotGauge"),{ + var sample = new ej.PivotGauge($("#PivotGauge"), { dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]", - filterItems: { filterType: "include", values: ["[Date].[Fiscal].[Fiscal Year].&[2004]"] } - }, - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]" - }, - { - fieldName: "[Measures].[Internet Revenue Status]" - }, - { - fieldName: "[Measures].[Internet Revenue Trend]" - }, - { - fieldName: "[Measures].[Internet Revenue Goal]" - }, - ], - axis: "columns" - } - ], - filters:[] - }, + data: "//bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]", + filterItems: { filterType: "include", values: ["[Date].[Fiscal].[Fiscal Year].&[2004]"] } + }, + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]" + }, + { + fieldName: "[Measures].[Internet Revenue Status]" + }, + { + fieldName: "[Measures].[Internet Revenue Trend]" + }, + { + fieldName: "[Measures].[Internet Revenue Goal]" + }, + ], + axis: "columns" + } + ], + filters: [] + }, enableTooltip: true, isResponsive: true, labelFormatSettings: { decimalPlaces: 2 }, - scales: [{ - showRanges: true, - radius: 150, showScaleBar: true, size: 1, + scales: [{ + showRanges: true, + radius: 150, showScaleBar: true, size: 1, border: { - width: 0.5 - }, - showIndicators: true, showLabels: true, - pointers: [{ - showBackNeedle: true, - backNeedleLength: 20, - length: 120, - width: 7 + width: 0.5 }, - { - type: "marker", - markerType: "diamond", - distanceFromScale: 5, - placement: "center", - backgroundColor: "#29A4D9", - length: 25, - width: 15 - }], + showIndicators: true, showLabels: true, + pointers: [{ + showBackNeedle: true, + backNeedleLength: 20, + length: 120, + width: 7 + }, + { + type: "marker", + markerType: "diamond", + distanceFromScale: 5, + placement: "center", + backgroundColor: "#29A4D9", + length: 25, + width: 15 + }], ticks: [{ - type: "major", + type: "major", distanceFromScale: 2, - height: 16, - width: 1, color: "#8c8c8c" - }, - { - type: "minor", - height: 6, - width: 1, - distanceFromScale: 2, - color: "#8c8c8c" - }], + height: 16, + width: 1, color: "#8c8c8c" + }, + { + type: "minor", + height: 6, + width: 1, + distanceFromScale: 2, + color: "#8c8c8c" + }], labels: [{ color: "#8c8c8c" - }], - ranges: [{ - distanceFromScale: -5, - backgroundColor: "#fc0606", - border: { color: "#fc0606" } - }, - { - distanceFromScale: -5 }], - customLabels: [{ - position: { x: 180, y: 290 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + ranges: [{ + distanceFromScale: -5, + backgroundColor: "#fc0606", + border: { color: "#fc0606" } }, - { - position: { x: 180, y: 320 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + { + distanceFromScale: -5 + }], + customLabels: [{ + position: { x: 180, y: 290 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" }, - { - position: { x: 180, y: 150 }, - font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }] + { + position: { x: 180, y: 320 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }, + { + position: { x: 180, y: 150 }, + font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }] }] }); - }); + }); } @@ -1388,94 +1372,94 @@ var pivot_dataset = [ module PivotGaugeRelational { $(function () { - var sample = new ej.PivotGauge($("#PivotGauge"),{ + var sample = new ej.PivotGauge($("#PivotGauge"), { dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - }, - { - fieldName: "State", - } - ], - columns: [ - { - fieldName: "Product", - } - ], + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + }, + { + fieldName: "State", + } + ], + columns: [ + { + fieldName: "Product", + } + ], values: [ - { - fieldName: "Amount", - }, - { - fieldName: "Quantity", - } - ] - }, + { + fieldName: "Amount", + }, + { + fieldName: "Quantity", + } + ] + }, enableTooltip: true, isResponsive: true, labelFormatSettings: { decimalPlaces: 2 }, - scales: [{ - showRanges: true, - radius: 150, showScaleBar: true, size: 1, + scales: [{ + showRanges: true, + radius: 150, showScaleBar: true, size: 1, border: { - width: 0.5 - }, - showIndicators: true, showLabels: true, - pointers: [{ - showBackNeedle: true, - backNeedleLength: 20, - length: 120, - width: 7 + width: 0.5 }, - { - type: "marker", - markerType: "diamond", - distanceFromScale: 5, - placement: "center", - backgroundColor: "#29A4D9", - length: 25, - width: 15 - }], + showIndicators: true, showLabels: true, + pointers: [{ + showBackNeedle: true, + backNeedleLength: 20, + length: 120, + width: 7 + }, + { + type: "marker", + markerType: "diamond", + distanceFromScale: 5, + placement: "center", + backgroundColor: "#29A4D9", + length: 25, + width: 15 + }], ticks: [{ - type: "major", + type: "major", distanceFromScale: 2, - height: 16, - width: 1, color: "#8c8c8c" - }, - { - type: "minor", - height: 6, - width: 1, - distanceFromScale: 2, - color: "#8c8c8c" - }], + height: 16, + width: 1, color: "#8c8c8c" + }, + { + type: "minor", + height: 6, + width: 1, + distanceFromScale: 2, + color: "#8c8c8c" + }], labels: [{ color: "#8c8c8c" - }], - ranges: [{ - distanceFromScale: -5, - backgroundColor: "#fc0606", - border: { color: "#fc0606" } - }, - { - distanceFromScale: -5 }], - customLabels: [{ - position: { x: 180, y: 290 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + ranges: [{ + distanceFromScale: -5, + backgroundColor: "#fc0606", + border: { color: "#fc0606" } }, - { - position: { x: 180, y: 320 }, - font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + { + distanceFromScale: -5 + }], + customLabels: [{ + position: { x: 180, y: 290 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" }, - { - position: { x: 180, y: 150 }, - font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" - }] + { + position: { x: 180, y: 320 }, + font: { size: "10px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }, + { + position: { x: 180, y: 150 }, + font: { size: "12px", fontFamily: "Segoe UI", fontStyle: "Normal" }, color: "#666666" + }] }] }); - }); + }); } @@ -1483,35 +1467,35 @@ module PivotGaugeRelational { module PivotGridOlap { $(function () { - var sample = new ej.PivotGrid($("#PivotGrid"),{ + var sample = new ej.PivotGrid($("#PivotGrid"), { dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - columns: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Internet Sales Amount]", - } - ], - axis: "columns" - } - ], - filters:[] - }, - enableGroupingBar: true, - pivotTableFieldListID:"PivotSchemaDesigner" + data: "//bi.syncfusion.com/olap/msmdpump.dll", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + columns: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Internet Sales Amount]", + } + ], + axis: "columns" + } + ], + filters: [] + }, + enableGroupingBar: true, + pivotTableFieldListID: "PivotSchemaDesigner" }); $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); }); @@ -1548,41 +1532,41 @@ var pivot_dataset = [ module PivotGridRelational { $(function () { - var sample = new ej.PivotGrid($("#PivotGrid"),{ + var sample = new ej.PivotGrid($("#PivotGrid"), { dataSource: { - data: pivot_dataset, - rows: [ - { - fieldName: "Country", - fieldCaption: "Country" - }, - { - fieldName: "State", - fieldCaption: "State" - } - ], - columns: - [{ - fieldName: "Product", - fieldCaption: "Product" - } - ], - values: [ - { - fieldName: "Amount", - fieldCaption: "Amount" - }, - { - fieldName: "Quantity", - fieldCaption: "Quantity" - } - ], - filters:[] - }, - enableGroupingBar: true, - pivotTableFieldListID:"PivotSchemaDesigner" + data: pivot_dataset, + rows: [ + { + fieldName: "Country", + fieldCaption: "Country" + }, + { + fieldName: "State", + fieldCaption: "State" + } + ], + columns: + [{ + fieldName: "Product", + fieldCaption: "Product" + } + ], + values: [ + { + fieldName: "Amount", + fieldCaption: "Amount" + }, + { + fieldName: "Quantity", + fieldCaption: "Quantity" + } + ], + filters: [] + }, + enableGroupingBar: true, + pivotTableFieldListID: "PivotSchemaDesigner" }); - $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); + $("#PivotSchemaDesigner").ejPivotSchemaDesigner(); }); } @@ -1591,33 +1575,33 @@ module PivotGridRelational { module PivotTreeMap { $(function () { - var sample = new ej.PivotTreeMap($("#PivotTreeMap"),{ + var sample = new ej.PivotTreeMap($("#PivotTreeMap"), { dataSource: { - data: "//bi.syncfusion.com/olap/msmdpump.dll;Locale Identifier=1033;", - catalog: "Adventure Works DW 2008 SE", - cube: "Adventure Works", - rows: [ - { - fieldName: "[Customer].[Customer Geography]" - } - ], - columns: [ - { - fieldName: "[Date].[Fiscal]" - } - ], - values: [ - { - measures: [ - { - fieldName: "[Measures].[Customer Count]", - } - ], - axis: "columns" - } - ], - filters:[] - } + data: "//bi.syncfusion.com/olap/msmdpump.dll;Locale Identifier=1033;", + catalog: "Adventure Works DW 2008 SE", + cube: "Adventure Works", + rows: [ + { + fieldName: "[Customer].[Customer Geography]" + } + ], + columns: [ + { + fieldName: "[Date].[Fiscal]" + } + ], + values: [ + { + measures: [ + { + fieldName: "[Measures].[Customer Count]", + } + ], + axis: "columns" + } + ], + filters: [] + } }); }); } @@ -1626,7 +1610,7 @@ module PivotTreeMap { module ProgressBarComponent { $(function () { - var sample = new ej.ProgressBar($("#progressBar"),{ + var sample = new ej.ProgressBar($("#progressBar"), { width: 200, value: 45, height: 20, @@ -1656,7 +1640,7 @@ module RadialMenuComponent { backImageClass: "backimageclass", targetElementId: "radialtarget1" }); - $("#radialtarget1").parent().css("position", "relative"); + $("#radialtarget1").parent().css("position", "relative"); } else { $("#contentDiv").html("Radial Menu is only supported from Internet Explorer Versioned 9 and above.").css({ "font-size": "20px", "color": "red" }); @@ -1723,12 +1707,12 @@ function redo(e: any) { } - + module RadialSliderComponent { $(function () { var radialsliderInstance = new ej.RadialSlider($("#radialSlider"), { - innerCircleImageUrl: "images/radialslider/chevron-right.png" + innerCircleImageUrl: "images/radialslider/chevron-right.png" }); }); } @@ -1825,8 +1809,8 @@ var data; data = GetData(); function GetData() { - var series1:any[]=[]; - var series2:any[]= []; + var series1: any[] = []; + var series2: any[] = []; var value = 100; var value1 = 120; for (var i = 1; i < 730; i++) { @@ -1853,7 +1837,7 @@ function GetData() { module RatingComponent { $(function () { - var sample1 = new ej.Rating($("#fullRating"),{ + var sample1 = new ej.Rating($("#fullRating"), { value: 4, precision: ej.Rating.Precision.Full, allowReset: true, @@ -1868,8 +1852,8 @@ module RatingComponent { shapeWidth: 25, showTooltip: true }); - - var sample2 = new ej.Rating($("#halfRating"),{ + + var sample2 = new ej.Rating($("#halfRating"), { precision: ej.Rating.Precision.Half, value: 3.5, allowReset: true, @@ -1885,7 +1869,7 @@ module RatingComponent { showTooltip: true }); - var sample3 = new ej.Rating($("#exactRating"),{ + var sample3 = new ej.Rating($("#exactRating"), { precision: ej.Rating.Precision.Exact, value: 3.7, allowReset: true, @@ -1899,7 +1883,7 @@ module RatingComponent { shapeHeight: 25, shapeWidth: 25, showTooltip: true - }); + }); }); } @@ -1907,15 +1891,15 @@ module RatingComponent { module ReportViewerComponent { - $(function () { - var report = new ej.ReportViewer($("#territoryReportViewer"), { - reportServiceUrl: (window).baseurl + 'api/ReportViewer', - reportServerUrl: 'http://104.207.134.201/reportserver', - processingMode: ej.ReportViewer.ProcessingMode.Remote, - reportPath: "/SSRSSamples2/Territory Sales new", - isResponsive: true - }); - }); + $(function () { + var report = new ej.ReportViewer($("#territoryReportViewer"), { + reportServiceUrl: (window).baseurl + 'api/ReportViewer', + reportServerUrl: 'http://104.207.134.201/reportserver', + processingMode: ej.ReportViewer.ProcessingMode.Remote, + reportPath: "/SSRSSamples2/Territory Sales new", + isResponsive: true + }); + }); } @@ -1932,7 +1916,7 @@ module RibbonComponent { toolTip: "Pin the Ribbon" }, applicationTab: { - type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } + type: ej.Ribbon.ApplicationTabType.Menu, menuItemID: "ribbonmenu", menuSettings: { openOnClick: false } }, tabs: [{ id: "home", text: "HOME", groups: [{ @@ -1956,7 +1940,7 @@ module RibbonComponent { } }] }, - { + { text: "Clipboard", alignType: ej.Ribbon.AlignType.Columns, content: [{ groups: [{ id: "paste", @@ -1978,8 +1962,8 @@ module RibbonComponent { height: 70 } }, - { - groups: [{ + { + groups: [{ id: "cut", text: "Cut", toolTip: "Cut", @@ -2009,14 +1993,14 @@ module RibbonComponent { prefixIcon: "e-icon e-ribbon clearAll" } }], - defaults: { + defaults: { type: "button", width: 60, isBig: false } - }] - }, - { + }] + }, + { text: "Font", alignType: "rows", content: [{ groups: [{ id: "fontfamily", @@ -2315,7 +2299,7 @@ module RibbonComponent { groups: [{ id: "zoomin", text: "Zoom In", - toolTip: "Zoom In", + toolTip: "Zoom In", buttonSettings: { width: 58, click: "onClick", @@ -2327,7 +2311,7 @@ module RibbonComponent { { id: "zoomout", text: "Zoom Out", - toolTip: "Zoom Out", + toolTip: "Zoom Out", buttonSettings: { width: 70, click: "onClick", @@ -2339,7 +2323,7 @@ module RibbonComponent { { id: "fullscreen", text: "Full Screen", - toolTip: "Full Screen", + toolTip: "Full Screen", buttonSettings: { width: 73, click: "onClick", @@ -2355,7 +2339,7 @@ module RibbonComponent { } }] }] - },{ + }, { id: "insert", text: "INSERT", groups: [{ text: "Tables", alignType: ej.Ribbon.AlignType.Columns, content: [{ groups: [{ @@ -2500,7 +2484,7 @@ module RibbonComponent { } ], defaults: { - type: "button", + type: "button", width: 70, height: 70 } @@ -2582,7 +2566,7 @@ module RibbonComponent { } ] } - ], + ], create: function createControl(args) { var ribbon = $("#defaultRibbon").data("ejRibbon"); $("#fontcolor").ejColorPicker({ value: "#FFFF00", modelType: "palette", cssClass: "e-ribbon", toolIcon: "e-fontcoloricon", select: colorHandler }); @@ -2594,7 +2578,7 @@ module RibbonComponent { function colorHandler(args:any) { (this._id.indexOf("fillcolor") != -1) ? $("#contenteditor").css('background-color', args.value) : document.execCommand('forecolor', false, args.value); } -function onClick(args:any) { +function onClick(args: any) { var val, prop = args.text; val = (ej.isNullOrUndefined(args.model.text)) ? args.model.activeText : args.model.text; if (action1.indexOf(val) != -1) @@ -2612,7 +2596,7 @@ function onClick(args:any) { - + module RotatorComponent { $(function () { @@ -2622,14 +2606,14 @@ module RotatorComponent { slideHeight: "auto", displayItemsCount: "1", navigateSteps: "1", - pagerPosition:"outside", + pagerPosition: "outside", orientation: "horizontal", showPager: true, enabled: true, showCaption: true, allowKeyboardNavigation: true, showPlayButton: true, - isResponsive:true, + isResponsive: true, animationType: "slide", }); }); @@ -2639,7 +2623,7 @@ module RotatorComponent { module RTEComponent { $(function () { - var sample = new ej.RTE($("#rteSample"),{ + var sample = new ej.RTE($("#rteSample"), { width: "100%", minWidth: "150px", showFooter: true, @@ -2775,7 +2759,7 @@ module ScheduleComponent { } }); }); -} +} @@ -2835,10 +2819,10 @@ module linesparkline { dataSource: [12, 14, 11, 12, 11, 15, 12, 10, 11, 12, 15, 13, 12, 11, 10, 13, 15, 12, 14, 16, 14, 12, 11], tooltip: { visible: true, - font: { size:"12px" } + font: { size: "12px" } }, type: "line", - size: { height: "40", width:"170" }, + size: { height: "40", width: "170" }, }); }); } @@ -2846,7 +2830,7 @@ module linesparkline { module columnsparkline { $(function () { var sparkcolumnsample = new ej.Sparkline($("#column"), { - dataSource: [2, 6, -1, 1, 12, 5, -2, 7, -3, 5, 8, 10,], + dataSource: [2, 6, -1, 1, 12, 5, -2, 7, -3, 5, 8, 10, ], negativePointColor: "red", highPointColor: "blue", tooltip: { @@ -2864,7 +2848,7 @@ module columnsparkline { module areasparkline { $(function () { var sparkareasample = new ej.Sparkline($("#area"), { - dataSource: [12, -10, 11, 8, 17, 6, 2, -17, 13, -6, 8, 10,], + dataSource: [12, -10, 11, 8, 17, 6, 2, -17, 13, -6, 8, 10, ], markerSettings: { visible: true }, highPointColor: "blue", lowPointColor: "orange", @@ -2884,7 +2868,7 @@ module areasparkline { module windlosssparkline { $(function () { var sparkwinlosssample = new ej.Sparkline($("#winloss"), { - dataSource: [12, 15, -11, 13, 17, 0, -12, 17, 13, -15, 8, 10,], + dataSource: [12, 15, -11, 13, 17, 0, -12, 17, 13, -15, 8, 10, ], type: "winloss", size: { height: "100", width: "150" }, }); @@ -2910,7 +2894,7 @@ module piesparkline1 { module piesparkline2 { $(function () { var sparkpiesample2 = new ej.Sparkline($("#pie2"), { - dataSource: [8, 9, 1,], + dataSource: [8, 9, 1, ], type: "pie", tooltip: { visible: true, @@ -2955,9 +2939,9 @@ module piesparkline4 { }); } - - + + module SplitterComponent { @@ -2967,10 +2951,10 @@ module SplitterComponent { width: "50%", orientation: ej.Orientation.Vertical, properties: [{}, { paneSize: 80 }], - isResponsive:true + isResponsive: true }); var splitterInstance1 = new ej.Splitter($("#innerSpliter"), { - isResponsive:true, + isResponsive: true, }); }); } @@ -2978,7 +2962,7 @@ module SplitterComponent { module SpreadsheetComponent { -$(function () { + $(function () { var sample = new ej.Spreadsheet($("#basicSpreadsheet"), { scrollSettings: { height: 550, @@ -2992,14 +2976,15 @@ $(function () { pdfUrl: (window).baseurl + "api/Spreadsheet/PdfExport" }, sheets: [{ rangeSettings: [{ dataSource: (window).defaultData, startCell: "A1" }] }], - loadComplete: () => { - var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; - if (!(spreadsheet).isImport) { - spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); - xlFormat.format({ "style": { "font-weight": "bold" } }, "A1:H1"); - xlFormat.format({ "type": "currency" }, "E2:H11"); - spreadsheet.XLRibbon.updateRibbonIcons(); - }} + loadComplete: () => { + var spreadsheet = $("#basicSpreadsheet").data("ejSpreadsheet"), xlFormat = spreadsheet.XLFormat; + if (!(spreadsheet).isImport) { + spreadsheet.setWidthToColumns([140, 128, 105, 100, 100, 110, 120, 120, 100]); + xlFormat.format({ "style": { "font-weight": "bold" } }, "A1:H1"); + xlFormat.format({ "type": "currency" }, "E2:H11"); + spreadsheet.XLRibbon.updateRibbonIcons(); + } + } }); }); } @@ -3008,58 +2993,58 @@ $(function () { var default_data: Array = [ - { Category : "Employees", Country : "USA", JobDescription : "Sales", JobGroup:"Executive", EmployeesCount : 50 }, - { Category : "Employees", Country : "USA", JobDescription : "Sales", JobGroup : "Analyst", EmployeesCount : 40 }, - { Category : "Employees", Country : "USA", JobDescription : "Marketing", EmployeesCount : 40 }, - { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 55 }, - { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 175}, - { Category : "Employees", Country : "USA", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 70 }, - { Category : "Employees", Country : "USA", JobDescription : "Management", EmployeesCount : 40 }, - { Category : "Employees", Country : "USA", JobDescription : "Accounts", EmployeesCount : 60 }, - - { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 43 }, - { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 125}, - { Category : "Employees", Country : "India", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 60 }, - { Category : "Employees", Country : "India", JobDescription : "HR Executives", EmployeesCount : 70 }, - { Category : "Employees", Country : "India", JobDescription : "Accounts", EmployeesCount : 45 }, - - { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Executive", EmployeesCount : 30 }, - { Category : "Employees", Country : "Germany", JobDescription : "Sales", JobGroup : "Analyst", EmployeesCount : 40 }, - { Category : "Employees", Country : "Germany", JobDescription : "Marketing", EmployeesCount : 50 }, - { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 40 }, - { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 65 }, - { Category : "Employees", Country : "Germany", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, - { Category : "Employees", Country : "Germany", JobDescription : "Management", EmployeesCount : 33 }, - { Category : "Employees", Country : "Germany", JobDescription : "Accounts", EmployeesCount : 55 }, - - { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 45 }, - { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 96 }, - { Category : "Employees", Country : "UK", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 55 }, - { Category : "Employees", Country : "UK", JobDescription : "HR Executives", EmployeesCount : 60 }, - { Category : "Employees", Country : "UK", JobDescription: "Accounts", EmployeesCount: 30 }, - - { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Testers", EmployeesCount : 40 }, - { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Windows", EmployeesCount : 65 }, - { Category : "Employees", Country : "France", JobDescription : "Technical", JobGroup : "Developers", JobRole : "Web", EmployeesCount : 27 }, - { Category : "Employees", Country : "France", JobDescription: "Marketing", EmployeesCount: 50 } + { Category: "Employees", Country: "USA", JobDescription: "Sales", JobGroup: "Executive", EmployeesCount: 50 }, + { Category: "Employees", Country: "USA", JobDescription: "Sales", JobGroup: "Analyst", EmployeesCount: 40 }, + { Category: "Employees", Country: "USA", JobDescription: "Marketing", EmployeesCount: 40 }, + { Category: "Employees", Country: "USA", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 55 }, + { Category: "Employees", Country: "USA", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 175 }, + { Category: "Employees", Country: "USA", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 70 }, + { Category: "Employees", Country: "USA", JobDescription: "Management", EmployeesCount: 40 }, + { Category: "Employees", Country: "USA", JobDescription: "Accounts", EmployeesCount: 60 }, + + { Category: "Employees", Country: "India", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 43 }, + { Category: "Employees", Country: "India", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 125 }, + { Category: "Employees", Country: "India", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 60 }, + { Category: "Employees", Country: "India", JobDescription: "HR Executives", EmployeesCount: 70 }, + { Category: "Employees", Country: "India", JobDescription: "Accounts", EmployeesCount: 45 }, + + { Category: "Employees", Country: "Germany", JobDescription: "Sales", JobGroup: "Executive", EmployeesCount: 30 }, + { Category: "Employees", Country: "Germany", JobDescription: "Sales", JobGroup: "Analyst", EmployeesCount: 40 }, + { Category: "Employees", Country: "Germany", JobDescription: "Marketing", EmployeesCount: 50 }, + { Category: "Employees", Country: "Germany", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 40 }, + { Category: "Employees", Country: "Germany", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 65 }, + { Category: "Employees", Country: "Germany", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 27 }, + { Category: "Employees", Country: "Germany", JobDescription: "Management", EmployeesCount: 33 }, + { Category: "Employees", Country: "Germany", JobDescription: "Accounts", EmployeesCount: 55 }, + + { Category: "Employees", Country: "UK", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 45 }, + { Category: "Employees", Country: "UK", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 96 }, + { Category: "Employees", Country: "UK", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 55 }, + { Category: "Employees", Country: "UK", JobDescription: "HR Executives", EmployeesCount: 60 }, + { Category: "Employees", Country: "UK", JobDescription: "Accounts", EmployeesCount: 30 }, + + { Category: "Employees", Country: "France", JobDescription: "Technical", JobGroup: "Testers", EmployeesCount: 40 }, + { Category: "Employees", Country: "France", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Windows", EmployeesCount: 65 }, + { Category: "Employees", Country: "France", JobDescription: "Technical", JobGroup: "Developers", JobRole: "Web", EmployeesCount: 27 }, + { Category: "Employees", Country: "France", JobDescription: "Marketing", EmployeesCount: 50 } ]; module sunburstcomponent { $(function () { var sunburstsample = new ej.SunburstChart($("#Sunburst"), { - valueMemberPath: "EmployeesCount", + valueMemberPath: "EmployeesCount", levels: [ - {groupMemberPath: "Country"}, - {groupMemberPath: "JobDescription"}, - {groupMemberPath: "JobGroup"}, - {groupMemberPath: "JobRole"} + { groupMemberPath: "Country" }, + { groupMemberPath: "JobDescription" }, + { groupMemberPath: "JobGroup" }, + { groupMemberPath: "JobRole" } ], dataSource: default_data, - dataLabelSettings:{visible:true}, - tooltip:{visible:false}, - enableAnimation:false, - size:{height:"600"}, - innerRadius:0.2, + dataLabelSettings: { visible: true }, + tooltip: { visible: false }, + enableAnimation: false, + size: { height: "600" }, + innerRadius: 0.2, load: function () { var sender = $("#Sunburst").data("ejSunburstChart"); var SunBurstTheme = (window).themeStyle + (window).themeColor + (window).themeVarient; @@ -3070,9 +3055,10 @@ module sunburstcomponent { SunBurstTheme = "flatlight"; sender.model.theme = SunBurstTheme; }, - title:{text:"Employees Count"}, - zoomSettings:{enable:false}, - legend:{visible:true,position:'top'}, + title: { text: "Employees Count" }, + zoomSettings: { enable: false }, + legend: { visible: true, position: 'top' } + // load:"loadTheme" }); }); } @@ -3082,7 +3068,7 @@ module sunburstcomponent { module TabComponent { $(function () { - var sample = new ej.Tab($("#defaultTab"),{ + var sample = new ej.Tab($("#defaultTab"), { width: "500px", collapsible: true, events: "click", @@ -3096,8 +3082,8 @@ module TabComponent { module TagCloudComponent { - - + + var websiteCollection = [ { text: "Google", url: "http://www.google.com", frequency: 12 }, { text: "All Things Digital", url: "http://allthingsd.com/", frequency: 3 }, @@ -3128,7 +3114,7 @@ module TagCloudComponent { text: "text", url: "url", frequency: "frequency" } }); - + }); } @@ -3168,82 +3154,82 @@ module EditorComponent { - + module TileViewComponent { $(function () { var tile1 = new ej.Tile($("#tile1"), { - imagePosition:"fill", - caption:{text:"People"}, - tileSize:"medium", - imageUrl:'content/images/tile/windows/people_1.png' + imagePosition: "fill", + caption: { text: "People" }, + tileSize: "medium", + imageUrl: 'content/images/tile/windows/people_1.png' }); - var tile2 = new ej.Tile($("#tile2"), { - imagePosition:"center", - tileSize:"small", - imageUrl:'content/images/tile/windows/alerts.png', - + var tile2 = new ej.Tile($("#tile2"), { + imagePosition: "center", + tileSize: "small", + imageUrl: 'content/images/tile/windows/alerts.png', + }); - var tile3 = new ej.Tile($("#tile3"), { - imagePosition:"center", - tileSize:"small", - imageUrl:'content/images/tile/windows/bing.png', + var tile3 = new ej.Tile($("#tile3"), { + imagePosition: "center", + tileSize: "small", + imageUrl: 'content/images/tile/windows/bing.png', }); - var tile4 = new ej.Tile($("#tile4"), { - tileSize:"small", - imageUrl:'content/images/tile/windows/camera.png', + var tile4 = new ej.Tile($("#tile4"), { + tileSize: "small", + imageUrl: 'content/images/tile/windows/camera.png', }); - var tile5 = new ej.Tile($("#tile5"), { - imagePosition:"center", - tileSize:"small", - imageUrl:'content/images/tile/windows/messages.png', + var tile5 = new ej.Tile($("#tile5"), { + imagePosition: "center", + tileSize: "small", + imageUrl: 'content/images/tile/windows/messages.png', }); - var tile6 = new ej.Tile($("#tile6"), { - imagePosition:"center", - tileSize:"medium", - imageUrl:'content/images/tile/windows/games.png', - caption:{text:"Play"} + var tile6 = new ej.Tile($("#tile6"), { + imagePosition: "center", + tileSize: "medium", + imageUrl: 'content/images/tile/windows/games.png', + caption: { text: "Play" } }); - var tile7 = new ej.Tile($("#tile7"), { - tileSize:"medium", - imageUrl:'content/images/tile/windows/map.png', - caption:{text:"Maps"} + var tile7 = new ej.Tile($("#tile7"), { + tileSize: "medium", + imageUrl: 'content/images/tile/windows/map.png', + caption: { text: "Maps" } }); - var tile8 = new ej.Tile($("#tile8"), { - imagePosition:"fill", - tileSize:"wide", - imageUrl:'content/images/tile/windows/sports.png', - caption:{text:"Sports"} + var tile8 = new ej.Tile($("#tile8"), { + imagePosition: "fill", + tileSize: "wide", + imageUrl: 'content/images/tile/windows/sports.png', + caption: { text: "Sports" } }); - var tile9 = new ej.Tile($("#tile9"), { - imagePosition:"fill", - tileSize:"medium", - imageUrl:'content/images/tile/windows/people_2.png', - caption:{text:"People"} + var tile9 = new ej.Tile($("#tile9"), { + imagePosition: "fill", + tileSize: "medium", + imageUrl: 'content/images/tile/windows/people_2.png', + caption: { text: "People" } }); - var tile10 = new ej.Tile($("#tile10"), { - imagePosition:"center", - tileSize:"medium", - imageUrl:'content/images/tile/windows/pictures.png', - caption:{text:"Photo"} + var tile10 = new ej.Tile($("#tile10"), { + imagePosition: "center", + tileSize: "medium", + imageUrl: 'content/images/tile/windows/pictures.png', + caption: { text: "Photo" } }); - var tile11 = new ej.Tile($("#tile11"), { - imagePosition:"center", - tileSize:"wide", - imageUrl:'content/images/tile/windows/weather.png', - caption:{text:"Weather"} + var tile11 = new ej.Tile($("#tile11"), { + imagePosition: "center", + tileSize: "wide", + imageUrl: 'content/images/tile/windows/weather.png', + caption: { text: "Weather" } }); - var tile12 = new ej.Tile($("#tile12"), { - imagePosition:"center", - tileSize:"medium", - imageUrl:'content/images/tile/windows/music.png', - caption:{text:"Music"} + var tile12 = new ej.Tile($("#tile12"), { + imagePosition: "center", + tileSize: "medium", + imageUrl: 'content/images/tile/windows/music.png', + caption: { text: "Music" } }); - var tile13 = new ej.Tile($("#tile13"), { - imagePosition:"center", - tileSize:"medium", - imageUrl:'content/images/tile/windows/favs.png', - caption:{text:"Favorites"} + var tile13 = new ej.Tile($("#tile13"), { + imagePosition: "center", + tileSize: "medium", + imageUrl: 'content/images/tile/windows/favs.png', + caption: { text: "Favorites" } }); }); } @@ -3262,13 +3248,13 @@ module TimePickerComponent { module ToolbarComponent { - + $(function () { - var sample = new ej.Toolbar($("#editingToolbar"),{ + var sample = new ej.Toolbar($("#editingToolbar"), { width: "100%", cssClass: "gradient-lime", enableSeparator: true, - + isResponsive: true, orientation: ej.Orientation.Horizontal, showRoundedCorner: true @@ -3281,10 +3267,10 @@ module ToolbarComponent { module TooltipComponent { - + $(function () { - var sample1 = new ej.Tooltip($("#link1"),{ + var sample1 = new ej.Tooltip($("#link1"), { content: "ECMAScript (or ES) is a trademarked scripting-language specification standardized by Ecma International in ECMA-262 and ISO/IEC 16262.", associate: "mousefollow", autoCloseTimeout: 5000, @@ -3294,7 +3280,7 @@ module TooltipComponent { showShadow: true }); - var sample2 = new ej.Tooltip($("#link2"),{ + var sample2 = new ej.Tooltip($("#link2"), { content: "The World Wide Web (WWW) is an information space where documents and other web resources are identified by URLs, interlinked by hypertext links, and can be accessed via the Internet.", position: { stem: { @@ -3313,7 +3299,7 @@ module TooltipComponent { showShadow: true }); - var sample3 = new ej.Tooltip($("#link3"),{ + var sample3 = new ej.Tooltip($("#link3"), { content: 'Object-oriented programming (OOP) is a programming language model organized around objects rather than "actions" and data rather than logic.', position: { stem: { @@ -3340,43 +3326,43 @@ module TooltipComponent { module TreeGridComponent { $(function () { var treegridInstance = new ej.TreeGrid($("#TreeGridContainer"), { - dataSource: (window).treeGridData, - childMapping: "subtasks", - allowSorting: true, - allowMultiSorting: true, - enableAltRow: true, - allowFiltering: true, - treeColumnIndex: 1, - allowKeyboardNavigation: true, - showColumnChooser: true, - showColumnOptions: true, - contextMenuSettings: { - showContextMenu: true, - contextMenuItems: ["add", "edit", "delete"] - }, - columnDialogFields: ["field", "headerText", "editType", "width", "visible", "allowSorting", "textAlign", "headerTextAlign"], - editSettings: { - allowAdding: true, - allowEditing: true, - allowDeleting: true, - editMode: "cellEditing", - rowPosition: "belowSelectedRow" - }, - toolbarSettings: { - showToolbar: true, - toolbarItems: ["add","edit","delete","update","cancel","expandAll","collapseAll"] - }, - columns: [ - { field: "taskID", headerText: "Task Id", allowFiltering: false, editType: "numericedit", filterEditType: "numericedit" }, - { field: "taskName", headerText: "Task Name", editType: "stringedit", filterEditType: "stringedit" }, - { field: "startDate", headerText: "Start Date", editType: "datepicker", filterEditType: "datepicker", format:"{0:MM/dd/yyyy}" }, - { field: "endDate", headerText: "End Date", editType: "datepicker", filterEditType: "datepicker", format:"{0:MM/dd/yyyy}" }, - { field: "progress", headerText: "Progress", editType: "numericedit", filterEditType: "numericedit" } - ], - isResponsive: true, + dataSource: (window).treeGridData, + childMapping: "subtasks", + allowSorting: true, + allowMultiSorting: true, + enableAltRow: true, + allowFiltering: true, + treeColumnIndex: 1, + allowKeyboardNavigation: true, + showColumnChooser: true, + showColumnOptions: true, + contextMenuSettings: { + showContextMenu: true, + contextMenuItems: ["add", "edit", "delete"] + }, + columnDialogFields: ["field", "headerText", "editType", "width", "visible", "allowSorting", "textAlign", "headerTextAlign"], + editSettings: { + allowAdding: true, + allowEditing: true, + allowDeleting: true, + editMode: "cellEditing", + rowPosition: "belowSelectedRow" + }, + toolbarSettings: { + showToolbar: true, + toolbarItems: ["add", "edit", "delete", "update", "cancel", "expandAll", "collapseAll"] + }, + columns: [ + { field: "taskID", headerText: "Task Id", allowFiltering: false, editType: "numericedit", filterEditType: "numericedit" }, + { field: "taskName", headerText: "Task Name", editType: "stringedit", filterEditType: "stringedit" }, + { field: "startDate", headerText: "Start Date", editType: "datepicker", filterEditType: "datepicker", format: "{0:MM/dd/yyyy}" }, + { field: "endDate", headerText: "End Date", editType: "datepicker", filterEditType: "datepicker", format: "{0:MM/dd/yyyy}" }, + { field: "progress", headerText: "Progress", editType: "numericedit", filterEditType: "numericedit" } + ], + isResponsive: true, + }); }); -}); -} +} @@ -3421,7 +3407,7 @@ module treemapcomponent { - + module TreeViewComponent { $(function () { @@ -3438,9 +3424,9 @@ module TreeViewComponent { module UploadboxComponent { - + $(function () { - var sample = new ej.Uploadbox($("#UploadDefault"),{ + var sample = new ej.Uploadbox($("#UploadDefault"), { saveUrl: (window).baseurl + "api/uploadbox/Save", removeUrl: (window).baseurl + "api/uploadbox/Remove", buttonText: { @@ -3463,12 +3449,12 @@ module UploadboxComponent { module WaitingPopupComponent { $(function () { - var sample = new ej.WaitingPopup($("#target"),{ + var sample = new ej.WaitingPopup($("#target"), { showOnInit: true, showImage: true, text: 'waiting…', - target: "#target", - appendTo: "#waiting" + target: "#target", + appendTo: "#waiting" }); }); From f58ed1701bf1744dd82eabb616bb5813c23d8e3d Mon Sep 17 00:00:00 2001 From: Louis Hache Date: Wed, 25 Apr 2018 20:52:41 +0200 Subject: [PATCH 103/564] [@types/grid-styled] Support AlignSelf property on Box (#25261) --- types/grid-styled/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/grid-styled/index.d.ts b/types/grid-styled/index.d.ts index 0006be1db8..af969b0cec 100644 --- a/types/grid-styled/index.d.ts +++ b/types/grid-styled/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for grid-styled 3.2 +// Type definitions for grid-styled 4.1 // Project: https://github.com/jxnblk/grid-styled // Definitions by: Anton Vasin // Victor Orlov +// Louis Hache // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -39,6 +40,7 @@ export interface BoxProps flex?: ResponsiveProp; order?: ResponsiveProp; is?: string | ComponentClass; + alignSelf?: ResponsiveProp; } export interface FlexProps extends BoxProps { From bfefeaadb9fe70b6010c0299fcc24cc87d5b3b48 Mon Sep 17 00:00:00 2001 From: Zev Spitz Date: Wed, 25 Apr 2018 21:53:53 +0300 Subject: [PATCH 104/564] activex-mshtml: default properties; fix for default argument values in jsdoc (#25293) * Fix activex-stdole * Reduce any * Default properties; fix jsDoc default values * Fix office tests * activex-office dtslint fix * activex-vbide: default properties; default values of optional parameters * activex-vbide: dtslint fixes * activex-msforms -- default properties; default parameter values in jsDoc * Reduce duplicate types * dtslint fix * activex-outlook version bump * activex-powerpoint Typescript version bump * activex-vbide Typescript version bump * post-DefinitelyTyped-build fixes * Fix Column and List setters * Fix for Excel tests * Default properties; fix default parameter values in jsDoc * Remove max-line-length --- types/activex-mshtml/index.d.ts | 2586 ++++++++++-------------------- types/activex-mshtml/tslint.json | 3 +- 2 files changed, 835 insertions(+), 1754 deletions(-) diff --git a/types/activex-mshtml/index.d.ts b/types/activex-mshtml/index.d.ts index 01c6007620..94466927d7 100644 --- a/types/activex-mshtml/index.d.ts +++ b/types/activex-mshtml/index.d.ts @@ -2885,11 +2885,10 @@ declare namespace MSHTML { update(): void; } - class BlockFormats { - private 'MSHTML.BlockFormats_typekey': BlockFormats; - private constructor(); + interface BlockFormats { readonly Count: number; item(pvarIndex: any): string; + (pvarIndex: any): string; } class CanvasGradient { @@ -2975,7 +2974,7 @@ declare namespace MSHTML { private 'MSHTML.CClientCaps_typekey': CClientCaps; private constructor(); - /** @param string [bStrVer=''] */ + /** @param bStrVer [bStrVer=''] */ addComponentRequest(bstrName: string, bstrURL: string, bStrVer?: string): void; readonly availHeight: number; readonly availWidth: number; @@ -2991,7 +2990,7 @@ declare namespace MSHTML { getComponentVersion(bstrName: string, bstrURL: string): string; readonly height: number; - /** @param string [bStrVer=''] */ + /** @param bStrVer [bStrVer=''] */ isComponentInstalled(bstrName: string, bstrURL: string, bStrVer?: string): boolean; readonly javaEnabled: boolean; readonly onLine: boolean; @@ -3025,7 +3024,7 @@ declare namespace MSHTML { readonly dataTransfer: IHTMLDataTransfer; fromElement: IHTMLElement; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; keyCode: number; readonly nextPage: string; @@ -3037,14 +3036,14 @@ declare namespace MSHTML { reason: number; recordset: any; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; repeat: boolean; returnValue: any; screenX: number; screenY: number; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; shiftKey: boolean; shiftLeft: boolean; @@ -3086,7 +3085,7 @@ declare namespace MSHTML { readonly 'constructor': any; readonly length: number; - /** @param boolean [reload=false] */ + /** @param reload [reload=false] */ refresh(reload?: boolean): void; } @@ -3230,13 +3229,12 @@ declare namespace MSHTML { readonly type: string; } - class DOMChildrenCollection { - private 'MSHTML.DOMChildrenCollection_typekey': DOMChildrenCollection; - private constructor(); + interface DOMChildrenCollection { readonly 'constructor': any; ie9_item(index: number): any; item(index: number): any; readonly length: number; + (index: number): any; } class DOMCloseEvent { @@ -3348,7 +3346,7 @@ declare namespace MSHTML { readonly publicId: any; removeChild(oldChild: IHTMLDOMNode): IHTMLDOMNode; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; replaceNode(replacement: IHTMLDOMNode): IHTMLDOMNode; @@ -3376,14 +3374,9 @@ declare namespace MSHTML { readonly eventPhase: number; readonly fromElement: IHTMLElement; getModifierState(keyArg: string): boolean; - initDragEvent( - eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, - clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, - relatedTargetArg: IEventTarget, dataTransferArg: IHTMLDataTransfer): void; + initDragEvent(eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: IEventTarget, dataTransferArg: IHTMLDataTransfer): void; initEvent(eventType: string, canBubble: boolean, cancelable: boolean): void; - initMouseEvent( - eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, - clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: IEventTarget): void; + initMouseEvent(eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: IEventTarget): void; initUIEvent(eventType: string, canBubble: boolean, cancelable: boolean, view: IHTMLWindow2, detail: number): void; readonly isTrusted: boolean; readonly layerX: number; @@ -3479,8 +3472,7 @@ declare namespace MSHTML { getModifierState(keyArg: string): boolean; readonly ie9_char: any; initEvent(eventType: string, canBubble: boolean, cancelable: boolean): void; - initKeyboardEvent( - eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; + initKeyboardEvent(eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void; initUIEvent(eventType: string, canBubble: boolean, cancelable: boolean, view: IHTMLWindow2, detail: number): void; readonly isTrusted: boolean; readonly key: string; @@ -3544,9 +3536,7 @@ declare namespace MSHTML { readonly fromElement: IHTMLElement; getModifierState(keyArg: string): boolean; initEvent(eventType: string, canBubble: boolean, cancelable: boolean): void; - initMouseEvent( - eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, - clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: IEventTarget): void; + initMouseEvent(eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: IEventTarget): void; initUIEvent(eventType: string, canBubble: boolean, cancelable: boolean, view: IHTMLWindow2, detail: number): void; readonly isTrusted: boolean; readonly layerX: number; @@ -3593,12 +3583,8 @@ declare namespace MSHTML { readonly fromElement: IHTMLElement; getModifierState(keyArg: string): boolean; initEvent(eventType: string, canBubble: boolean, cancelable: boolean): void; - initMouseEvent( - eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, - clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: IEventTarget): void; - initMouseWheelEvent( - eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, - clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: IEventTarget, modifiersListArg: string, wheelDeltaArg: number): void; + initMouseEvent(eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: IEventTarget): void; + initMouseWheelEvent(eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: IEventTarget, modifiersListArg: string, wheelDeltaArg: number): void; initUIEvent(eventType: string, canBubble: boolean, cancelable: boolean, view: IHTMLWindow2, detail: number): void; readonly isTrusted: boolean; readonly layerX: number; @@ -3711,8 +3697,7 @@ declare namespace MSHTML { readonly defaultPrevented: boolean; readonly eventPhase: number; initEvent(eventType: string, canBubble: boolean, cancelable: boolean): void; - initMutationEvent( - eventType: string, canBubble: boolean, cancelable: boolean, relatedNodeArg: any, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; + initMutationEvent(eventType: string, canBubble: boolean, cancelable: boolean, relatedNodeArg: any, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void; readonly isTrusted: boolean; readonly newValue: string; preventDefault(): void; @@ -3732,10 +3717,9 @@ declare namespace MSHTML { parseFromString(xmlSource: string, mimeType: string): IHTMLDocument2; } - class DOMParserFactory { - private 'MSHTML.DOMParserFactory_typekey': DOMParserFactory; - private constructor(); + interface DOMParserFactory { create(): IDOMParser; + (): IDOMParser; } class DOMProcessingInstruction { @@ -3773,7 +3757,7 @@ declare namespace MSHTML { readonly previousSibling: IHTMLDOMNode; removeChild(oldChild: IHTMLDOMNode): IHTMLDOMNode; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; replaceNode(replacement: IHTMLDOMNode): IHTMLDOMNode; @@ -3838,8 +3822,7 @@ declare namespace MSHTML { readonly defaultPrevented: boolean; readonly eventPhase: number; initEvent(eventType: string, canBubble: boolean, cancelable: boolean): void; - initStorageEvent( - eventType: string, canBubble: boolean, cancelable: boolean, keyArg: string, oldValueArg: string, newValueArg: string, urlArg: string, storageAreaArg: IHTMLStorage): void; + initStorageEvent(eventType: string, canBubble: boolean, cancelable: boolean, keyArg: string, oldValueArg: string, newValueArg: string, urlArg: string, storageAreaArg: IHTMLStorage): void; readonly isTrusted: boolean; readonly key: string; readonly newValue: string; @@ -3928,14 +3911,9 @@ declare namespace MSHTML { readonly fromElement: IHTMLElement; getModifierState(keyArg: string): boolean; initEvent(eventType: string, canBubble: boolean, cancelable: boolean): void; - initMouseEvent( - eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, - clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: IEventTarget): void; + initMouseEvent(eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: IEventTarget): void; initUIEvent(eventType: string, canBubble: boolean, cancelable: boolean, view: IHTMLWindow2, detail: number): void; - initWheelEvent( - eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, - clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: IEventTarget, modifiersListArg: string, deltaX: number, deltaY: number, - deltaZ: number, deltaMode: number): void; + initWheelEvent(eventType: string, canBubble: boolean, cancelable: boolean, viewArg: IHTMLWindow2, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: IEventTarget, modifiersListArg: string, deltaX: number, deltaY: number, deltaZ: number, deltaMode: number): void; readonly isTrusted: boolean; readonly layerX: number; readonly layerY: number; @@ -3967,25 +3945,22 @@ declare namespace MSHTML { private constructor(); } - class FontNames { - private 'MSHTML.FontNames_typekey': FontNames; - private constructor(); + interface FontNames { readonly Count: number; item(pvarIndex: any): string; + (pvarIndex: any): string; } - class FramesCollection { - private 'MSHTML.FramesCollection_typekey': FramesCollection; - private constructor(); + interface FramesCollection { item(pvarIndex: any): any; readonly length: number; + (pvarIndex: any): any; } - class HTCAttachBehavior { - private 'MSHTML.HTCAttachBehavior_typekey': HTCAttachBehavior; - private constructor(); + interface HTCAttachBehavior { detachEvent(): void; FireEvent(evt: any): void; + (evt: any): void; } class HTCDefaultDispatch { @@ -4098,7 +4073,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -4317,7 +4292,7 @@ declare namespace MSHTML { rel: string; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -4326,7 +4301,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -4343,16 +4318,16 @@ declare namespace MSHTML { search: string; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; shape: string; readonly sourceIndex: number; @@ -4468,7 +4443,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -4666,7 +4641,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -4675,7 +4650,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -4691,16 +4666,16 @@ declare namespace MSHTML { search: string; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; shape: string; readonly sourceIndex: number; @@ -4718,9 +4693,7 @@ declare namespace MSHTML { xmsAcceleratorKey: string; } - class HTMLAreasCollection { - private 'MSHTML.HTMLAreasCollection_typekey': HTMLAreasCollection; - private constructor(); + interface HTMLAreasCollection { add(element: IHTMLElement, before?: any): void; readonly 'constructor': any; ie8_item(index: number): IHTMLElement2; @@ -4730,15 +4703,14 @@ declare namespace MSHTML { length: number; namedItem(name: string): any; - /** @param number [index=-1] */ + /** @param index [index=-1] */ remove(index?: number): void; tags(tagName: any): any; urns(urn: any): any; + (name?: any, index?: any): any; } - class HTMLAttributeCollection { - private 'MSHTML.HTMLAttributeCollection_typekey': HTMLAttributeCollection; - private constructor(); + interface HTMLAttributeCollection { readonly 'constructor': any; getNamedItem(bstrName: string): IHTMLDOMAttribute; getNamedItemNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -4758,6 +4730,7 @@ declare namespace MSHTML { removeNamedItemNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; setNamedItem(ppNode: IHTMLDOMAttribute): IHTMLDOMAttribute; setNamedItemNS(pNodeIn: IHTMLDOMAttribute2): IHTMLDOMAttribute2; + (name?: any): any; } class HTMLAudioElement { @@ -4848,7 +4821,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -5065,7 +5038,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -5074,7 +5047,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -5091,16 +5064,16 @@ declare namespace MSHTML { readonly seeking: boolean; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -5120,10 +5093,9 @@ declare namespace MSHTML { xmsAcceleratorKey: string; } - class HTMLAudioElementFactory { - private 'MSHTML.HTMLAudioElementFactory_typekey': HTMLAudioElementFactory; - private constructor(); + interface HTMLAudioElementFactory { create(src?: any): IHTMLAudioElement; + (src?: any): IHTMLAudioElement; } class HTMLBaseElement { @@ -5196,7 +5168,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -5385,7 +5357,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -5394,7 +5366,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -5409,16 +5381,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -5507,7 +5479,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -5694,7 +5666,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -5703,7 +5675,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -5718,16 +5690,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; size: number; readonly sourceIndex: number; @@ -5815,7 +5787,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -6003,7 +5975,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -6012,7 +5984,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -6027,16 +5999,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -6126,7 +6098,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -6314,7 +6286,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -6323,7 +6295,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -6338,16 +6310,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -6440,7 +6412,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -6641,7 +6613,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -6650,7 +6622,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -6667,16 +6639,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -6766,7 +6738,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -6953,7 +6925,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -6962,7 +6934,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -6977,16 +6949,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -7078,7 +7050,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -7282,7 +7254,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -7291,7 +7263,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -7306,16 +7278,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -7405,7 +7377,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -7594,7 +7566,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -7603,7 +7575,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -7618,16 +7590,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -7719,7 +7691,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -7912,7 +7884,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -7921,7 +7893,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -7937,16 +7909,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -7992,10 +7964,10 @@ declare namespace MSHTML { readonly cssRules: IHTMLStyleSheetRulesCollection; cssText: string; - /** @param number [lIndex=-1] */ + /** @param lIndex [lIndex=-1] */ deleteRule(lIndex?: number): void; - /** @param number [lIndex=-1] */ + /** @param lIndex [lIndex=-1] */ insertRule(bstrRule: string, lIndex?: number): number; media: any; readonly parentRule: IHTMLCSSRule; @@ -8023,9 +7995,7 @@ declare namespace MSHTML { readonly type: number; } - class HTMLCSSStyleDeclaration { - private 'MSHTML.HTMLCSSStyleDeclaration_typekey': HTMLCSSStyleDeclaration; - private constructor(); + interface HTMLCSSStyleDeclaration { accelerator: string; alignContent: string; alignItems: string; @@ -8306,7 +8276,7 @@ declare namespace MSHTML { scrollbarShadowColor: any; scrollbarTrackColor: any; - /** @param any [pvarPropertyPriority=''] */ + /** @param pvarPropertyPriority [pvarPropertyPriority=''] */ setProperty(bstrPropertyName: string, pvarPropertyValue: any, pvarPropertyPriority?: any): void; stopColor: any; stopOpacity: any; @@ -8400,11 +8370,10 @@ declare namespace MSHTML { writingMode: string; zIndex: any; zoom: any; + (index: number): string; } - class HTMLCurrentStyle { - private 'MSHTML.HTMLCurrentStyle_typekey': HTMLCurrentStyle; - private constructor(); + interface HTMLCurrentStyle { readonly accelerator: string; alignContent: string; alignItems: string; @@ -8496,7 +8465,7 @@ declare namespace MSHTML { readonly fontVariant: string; readonly fontWeight: any; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getPropertyPriority(bstrPropertyName: string): string; getPropertyValue(bstrPropertyName: string): string; @@ -8642,7 +8611,7 @@ declare namespace MSHTML { readonly scrollbarShadowColor: any; readonly scrollbarTrackColor: any; - /** @param any [pvarPropertyPriority=''] */ + /** @param pvarPropertyPriority [pvarPropertyPriority=''] */ setProperty(bstrPropertyName: string, pvarPropertyValue: any, pvarPropertyPriority?: any): void; readonly styleFloat: string; readonly tableLayout: string; @@ -8725,6 +8694,7 @@ declare namespace MSHTML { readonly writingMode: string; readonly zIndex: any; readonly zoom: any; + (index: number): string; } class HTMLDDElement { @@ -8797,7 +8767,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -8985,7 +8955,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -8994,7 +8964,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -9009,16 +8979,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -9140,7 +9110,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -9343,7 +9313,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -9352,7 +9322,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -9367,16 +9337,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -9468,7 +9438,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -9670,7 +9640,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -9679,7 +9649,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -9694,16 +9664,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -9800,7 +9770,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -9987,7 +9957,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -9996,7 +9966,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -10011,16 +9981,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -10078,8 +10048,8 @@ declare namespace MSHTML { createRenderStyle(v: string): IHTMLRenderStyle; /** - * @param string [bstrHref=''] - * @param number [lIndex=-1] + * @param bstrHref [bstrHref=''] + * @param lIndex [lIndex=-1] */ createStyleSheet(bstrHref?: string, lIndex?: number): IHTMLStyleSheet; createTextNode(text: string): IHTMLDOMNode; @@ -10099,7 +10069,7 @@ declare namespace MSHTML { elementsFromRect(left: number, top: number, width: number, height: number): IHTMLDOMChildrenCollection; readonly embeds: IHTMLElementCollection; - /** @param boolean [showUI=false] */ + /** @param showUI [showUI=false] */ execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; execCommandShowHelp(cmdID: string): boolean; expando: boolean; @@ -10257,7 +10227,7 @@ declare namespace MSHTML { onvolumechange: any; onwaiting: any; - /** @param string [url='text/html'] */ + /** @param url [url='text/html'] */ open(url?: string, name?: any, features?: any, replace?: any): any; readonly ownerDocument: any; readonly parentNode: IHTMLDOMNode; @@ -10276,14 +10246,14 @@ declare namespace MSHTML { querySelectorAll(v: string): IHTMLDOMChildrenCollection; readonly readyState: string; - /** @param boolean [fForce=false] */ + /** @param fForce [fForce=false] */ recalc(fForce?: boolean): void; readonly referrer: string; releaseCapture(): void; removeChild(oldChild: IHTMLDOMNode): IHTMLDOMNode; removeEventListener(type: string, listener: any, useCapture: boolean): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; replaceNode(replacement: IHTMLDOMNode): IHTMLDOMNode; @@ -10470,7 +10440,7 @@ declare namespace MSHTML { removeChild(oldChild: IHTMLDOMNode): IHTMLDOMNode; removeEventListener(type: string, listener: any, useCapture: boolean): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; replaceData(offset: number, Count: number, bstrstring: string): void; @@ -10484,10 +10454,9 @@ declare namespace MSHTML { readonly wholeText: string; } - class HTMLDOMXmlSerializerFactory { - private 'MSHTML.HTMLDOMXmlSerializerFactory_typekey': HTMLDOMXmlSerializerFactory; - private constructor(); + interface HTMLDOMXmlSerializerFactory { create(): IDOMXmlSerializer; + (): IDOMXmlSerializer; } class HTMLDTElement { @@ -10560,7 +10529,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -10748,7 +10717,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -10757,7 +10726,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -10772,16 +10741,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -10797,9 +10766,7 @@ declare namespace MSHTML { xmsAcceleratorKey: string; } - class HTMLElementCollection { - private 'MSHTML.HTMLElementCollection_typekey': HTMLElementCollection; - private constructor(); + interface HTMLElementCollection { readonly 'constructor': any; ie8_item(index: number): IHTMLElement2; readonly ie8_length: number; @@ -10810,6 +10777,7 @@ declare namespace MSHTML { tags(tagName: any): any; toString(): string; urns(urn: any): any; + (name?: any, index?: any): any; } class HTMLEmbed { @@ -10882,7 +10850,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -11077,7 +11045,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -11086,7 +11054,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -11101,16 +11069,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -11201,7 +11169,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -11388,7 +11356,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -11397,7 +11365,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -11412,16 +11380,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -11509,7 +11477,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -11696,7 +11664,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -11705,7 +11673,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -11720,16 +11688,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; size: any; readonly sourceIndex: number; @@ -11746,9 +11714,7 @@ declare namespace MSHTML { xmsAcceleratorKey: string; } - class HTMLFormElement { - private 'MSHTML.HTMLFormElement_typekey': HTMLFormElement; - private constructor(); + interface HTMLFormElement { acceptCharset: string; accessKey: string; action: string; @@ -11759,14 +11725,14 @@ declare namespace MSHTML { appendItemSeparator(): void; /** - * @param string [name=''] - * @param string [filename=''] + * @param name [name=''] + * @param filename [filename=''] */ appendNameFilePair(name?: string, filename?: string): void; /** - * @param string [name=''] - * @param string [value=''] + * @param name [name=''] + * @param value [value=''] */ appendNameValuePair(name?: string, value?: string): void; applyElement(apply: IHTMLElement, where: string): IHTMLElement; @@ -11833,7 +11799,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -12026,7 +11992,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -12035,7 +12001,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -12051,16 +12017,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -12078,6 +12044,7 @@ declare namespace MSHTML { readonly uniqueNumber: number; urns(urn: any): any; xmsAcceleratorKey: string; + (name?: any, index?: any): any; } class HTMLFrameBase { @@ -12155,7 +12122,7 @@ declare namespace MSHTML { frameSpacing: any; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -12347,7 +12314,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -12356,7 +12323,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -12372,16 +12339,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -12479,7 +12446,7 @@ declare namespace MSHTML { frameSpacing: any; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -12691,7 +12658,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -12700,7 +12667,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -12716,16 +12683,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -12819,7 +12786,7 @@ declare namespace MSHTML { frameSpacing: any; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -13016,7 +12983,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -13025,7 +12992,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -13041,16 +13008,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -13136,7 +13103,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -13325,7 +13292,7 @@ declare namespace MSHTML { readonly recordset: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -13334,7 +13301,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -13349,16 +13316,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -13444,7 +13411,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -13633,7 +13600,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -13642,7 +13609,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -13657,16 +13624,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -13754,7 +13721,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -13941,7 +13908,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -13950,7 +13917,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -13965,16 +13932,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -14072,7 +14039,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -14260,7 +14227,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -14269,7 +14236,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -14284,16 +14251,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; size: any; readonly sourceIndex: number; @@ -14381,7 +14348,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -14568,7 +14535,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -14577,7 +14544,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -14592,16 +14559,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -14699,7 +14666,7 @@ declare namespace MSHTML { frameSpacing: any; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -14912,7 +14879,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -14921,7 +14888,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -14937,16 +14904,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -14966,10 +14933,9 @@ declare namespace MSHTML { xmsAcceleratorKey: string; } - class HTMLImageElementFactory { - private 'MSHTML.HTMLImageElementFactory_typekey': HTMLImageElementFactory; - private constructor(); + interface HTMLImageElementFactory { create(width?: any, height?: any): IHTMLImgElement; + (width?: any, height?: any): IHTMLImgElement; } class HTMLImg { @@ -15055,7 +15021,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -15276,7 +15242,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -15285,7 +15251,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -15300,16 +15266,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -15354,7 +15320,7 @@ declare namespace MSHTML { focus(): void; readonly form: IHTMLFormElement; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; id: string; innerHTML: string; @@ -15401,12 +15367,12 @@ declare namespace MSHTML { readonly parentTextEdit: IHTMLElement; readonly recordNumber: any; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeFilter(pUnk: any): void; scrollIntoView(varargStart?: any): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; readonly sourceIndex: number; status: any; @@ -15504,7 +15470,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -15720,7 +15686,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -15729,7 +15695,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -15747,16 +15713,16 @@ declare namespace MSHTML { selectionStart: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; setSelectionRange(start: number, end: number): void; size: number; @@ -15767,10 +15733,10 @@ declare namespace MSHTML { status: boolean; step: string; - /** @param number [n=1] */ + /** @param n [n=1] */ stepDown(n?: number): void; - /** @param number [n=1] */ + /** @param n [n=1] */ stepUp(n?: number): void; readonly style: IHTMLStyle; swapNode(otherNode: IHTMLDOMNode): IHTMLDOMNode; @@ -15813,7 +15779,7 @@ declare namespace MSHTML { focus(): void; readonly form: IHTMLFormElement; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; id: string; innerHTML: string; @@ -15863,13 +15829,13 @@ declare namespace MSHTML { readonly parentTextEdit: IHTMLElement; readonly recordNumber: any; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeFilter(pUnk: any): void; scrollIntoView(varargStart?: any): void; select(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; size: number; readonly sourceIndex: number; @@ -15908,7 +15874,7 @@ declare namespace MSHTML { readonly filters: IHTMLFiltersCollection; focus(): void; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; height: number; hspace: number; @@ -15963,12 +15929,12 @@ declare namespace MSHTML { readonly readyState: string; readonly recordNumber: any; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeFilter(pUnk: any): void; scrollIntoView(varargStart?: any): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; readonly sourceIndex: number; src: string; @@ -16010,7 +15976,7 @@ declare namespace MSHTML { focus(): void; readonly form: IHTMLFormElement; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; id: string; innerHTML: string; @@ -16061,13 +16027,13 @@ declare namespace MSHTML { readOnly: boolean; readonly recordNumber: any; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeFilter(pUnk: any): void; scrollIntoView(varargStart?: any): void; select(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; size: number; readonly sourceIndex: number; @@ -16153,7 +16119,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -16341,7 +16307,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -16350,7 +16316,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -16365,16 +16331,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -16465,7 +16431,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -16668,7 +16634,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -16677,7 +16643,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -16692,16 +16658,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -16794,7 +16760,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -16996,7 +16962,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -17005,7 +16971,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -17020,16 +16986,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -17116,7 +17082,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -17303,7 +17269,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -17312,7 +17278,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -17327,16 +17293,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -17425,7 +17391,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -17617,7 +17583,7 @@ declare namespace MSHTML { rel: string; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -17626,7 +17592,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -17642,16 +17608,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sheet: IHTMLStyleSheet; readonly sourceIndex: number; @@ -17742,7 +17708,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -17929,7 +17895,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -17938,7 +17904,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -17953,16 +17919,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -17991,7 +17957,7 @@ declare namespace MSHTML { port: string; protocol: string; - /** @param boolean [flag=false] */ + /** @param flag [flag=false] */ reload(flag?: boolean): void; replace(bstr: string): void; search: string; @@ -18069,7 +18035,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -18257,7 +18223,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -18266,7 +18232,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -18281,16 +18247,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -18383,7 +18349,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -18591,7 +18557,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -18600,7 +18566,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -18617,16 +18583,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -18736,7 +18702,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -18953,7 +18919,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -18962,7 +18928,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -18979,16 +18945,16 @@ declare namespace MSHTML { readonly seeking: boolean; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -19086,7 +19052,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -19276,7 +19242,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -19285,7 +19251,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -19301,16 +19267,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -19366,13 +19332,12 @@ declare namespace MSHTML { readonly urn: string; } - class HTMLNamespaceCollection { - private 'MSHTML.HTMLNamespaceCollection_typekey': HTMLNamespaceCollection; - private constructor(); + interface HTMLNamespaceCollection { add(bstrNamespace: string, bstrUrn: string, implementationUrl?: any): any; readonly 'constructor': any; item(index: any): any; readonly length: number; + (index: any): any; } class HTMLNavigator { @@ -19473,7 +19438,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -19661,7 +19626,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -19670,7 +19635,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -19685,16 +19650,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -19780,7 +19745,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -19967,7 +19932,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -19976,7 +19941,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -19991,16 +19956,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -20104,7 +20069,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -20316,7 +20281,7 @@ declare namespace MSHTML { recordset: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -20325,7 +20290,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -20340,16 +20305,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -20442,7 +20407,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -20629,7 +20594,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -20638,7 +20603,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -20653,16 +20618,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -20706,7 +20671,7 @@ declare namespace MSHTML { focus(): void; readonly form: IHTMLFormElement; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; id: string; indeterminate: boolean; @@ -20755,12 +20720,12 @@ declare namespace MSHTML { readonly parentTextEdit: IHTMLElement; readonly recordNumber: any; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeFilter(pUnk: any): void; scrollIntoView(varargStart?: any): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; readonly sourceIndex: number; status: boolean; @@ -20849,7 +20814,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -21054,7 +21019,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -21063,7 +21028,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -21079,16 +21044,16 @@ declare namespace MSHTML { selected: boolean; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -21107,10 +21072,9 @@ declare namespace MSHTML { xmsAcceleratorKey: string; } - class HTMLOptionElementFactory { - private 'MSHTML.HTMLOptionElementFactory_typekey': HTMLOptionElementFactory; - private constructor(); + interface HTMLOptionElementFactory { create(text?: any, value?: any, defaultSelected?: any, selected?: any): IHTMLOptionElement; + (text?: any, value?: any, defaultSelected?: any, selected?: any): IHTMLOptionElement; } class HTMLParaElement { @@ -21185,7 +21149,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -21372,7 +21336,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -21381,7 +21345,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -21396,16 +21360,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -21491,7 +21455,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -21680,7 +21644,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -21689,7 +21653,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -21704,16 +21668,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -21850,7 +21814,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -22038,7 +22002,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -22047,7 +22011,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -22062,16 +22026,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -22172,7 +22136,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -22376,7 +22340,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -22385,7 +22349,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -22400,16 +22364,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -22519,7 +22483,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -22723,7 +22687,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -22732,7 +22696,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -22749,16 +22713,16 @@ declare namespace MSHTML { select(): void; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -22779,9 +22743,7 @@ declare namespace MSHTML { xmsAcceleratorKey: string; } - class HTMLRuleStyle { - private 'MSHTML.HTMLRuleStyle_typekey': HTMLRuleStyle; - private constructor(); + interface HTMLRuleStyle { accelerator: string; alignContent: string; alignItems: string; @@ -22881,7 +22843,7 @@ declare namespace MSHTML { fontVariant: string; fontWeight: string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getPropertyPriority(bstrPropertyName: string): string; getPropertyValue(bstrPropertyName: string): string; @@ -23021,7 +22983,7 @@ declare namespace MSHTML { posRight: number; quotes: string; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeProperty(bstrPropertyName: string): string; right: any; @@ -23037,10 +22999,10 @@ declare namespace MSHTML { scrollbarShadowColor: any; scrollbarTrackColor: any; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; - /** @param any [pvarPropertyPriority=''] */ + /** @param pvarPropertyPriority [pvarPropertyPriority=''] */ setProperty(bstrPropertyName: string, pvarPropertyValue: any, pvarPropertyPriority?: any): void; styleFloat: string; tableLayout: string; @@ -23128,6 +23090,7 @@ declare namespace MSHTML { writingMode: string; zIndex: any; zoom: any; + (index: number): string; } class HTMLScreen { @@ -23224,7 +23187,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -23413,7 +23376,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -23422,7 +23385,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -23437,16 +23400,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -23466,9 +23429,7 @@ declare namespace MSHTML { xmsAcceleratorKey: string; } - class HTMLSelectElement { - private 'MSHTML.HTMLSelectElement_typekey': HTMLSelectElement; - private constructor(); + interface HTMLSelectElement { accessKey: string; add(element: IHTMLElement, before?: any): void; addBehavior(bstrURL: string, pvarFactory?: any): number; @@ -23542,7 +23503,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -23753,10 +23714,10 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [index=-1] */ + /** @param index [index=-1] */ remove(index?: number): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -23765,7 +23726,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -23781,16 +23742,16 @@ declare namespace MSHTML { selectedIndex: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; size: number; readonly sourceIndex: number; @@ -23810,6 +23771,7 @@ declare namespace MSHTML { urns(urn: any): any; value: string; xmsAcceleratorKey: string; + (name?: any, index?: any): any; } class HTMLSemanticElement { @@ -23882,7 +23844,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -24069,7 +24031,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -24078,7 +24040,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -24093,16 +24055,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -24192,7 +24154,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -24395,7 +24357,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -24404,7 +24366,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -24419,16 +24381,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -24521,7 +24483,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -24723,7 +24685,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -24732,7 +24694,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -24747,16 +24709,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -24848,7 +24810,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -25050,7 +25012,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -25059,7 +25021,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -25074,16 +25036,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -25114,9 +25076,7 @@ declare namespace MSHTML { setItem(bstrKey: string, bstrValue: string): void; } - class HTMLStyle { - private 'MSHTML.HTMLStyle_typekey': HTMLStyle; - private constructor(); + interface HTMLStyle { accelerator: string; alignContent: string; alignItems: string; @@ -25216,7 +25176,7 @@ declare namespace MSHTML { fontVariant: string; fontWeight: string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getExpression(propname: string): any; getPropertyPriority(bstrPropertyName: string): string; @@ -25365,7 +25325,7 @@ declare namespace MSHTML { posWidth: number; quotes: string; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeExpression(propname: string): boolean; removeProperty(bstrPropertyName: string): string; @@ -25382,13 +25342,13 @@ declare namespace MSHTML { scrollbarShadowColor: any; scrollbarTrackColor: any; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; - /** @param any [pvarPropertyPriority=''] */ + /** @param pvarPropertyPriority [pvarPropertyPriority=''] */ setProperty(bstrPropertyName: string, pvarPropertyValue: any, pvarPropertyPriority?: any): void; styleFloat: string; tableLayout: string; @@ -25477,6 +25437,7 @@ declare namespace MSHTML { writingMode: string; zIndex: any; zoom: any; + (index: number): string; } class HTMLStyleElement { @@ -25549,7 +25510,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -25737,7 +25698,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -25746,7 +25707,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -25761,16 +25722,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sheet: IHTMLStyleSheet; readonly sourceIndex: number; @@ -25811,19 +25772,19 @@ declare namespace MSHTML { private 'MSHTML.HTMLStyleSheet_typekey': HTMLStyleSheet; private constructor(); - /** @param number [lIndex=-1] */ + /** @param lIndex [lIndex=-1] */ addImport(bstrURL: string, lIndex?: number): number; - /** @param number [lIndex=-1] */ + /** @param lIndex [lIndex=-1] */ addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; - /** @param number [lIndex=-1] */ + /** @param lIndex [lIndex=-1] */ addRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; readonly 'constructor': any; readonly cssRules: IHTMLStyleSheetRulesCollection; cssText: string; - /** @param number [lIndex=-1] */ + /** @param lIndex [lIndex=-1] */ deleteRule(lIndex?: number): void; disabled: boolean; href: string; @@ -25835,7 +25796,7 @@ declare namespace MSHTML { readonly ie9_type: string; readonly imports: IHTMLStyleSheetsCollection; - /** @param number [lIndex=-1] */ + /** @param lIndex [lIndex=-1] */ insertRule(bstrRule: string, lIndex?: number): number; readonly isAlternate: boolean; readonly isPrefAlternate: boolean; @@ -25867,12 +25828,11 @@ declare namespace MSHTML { readonly type: number; } - class HTMLStyleSheetPagesCollection { - private 'MSHTML.HTMLStyleSheetPagesCollection_typekey': HTMLStyleSheetPagesCollection; - private constructor(); + interface HTMLStyleSheetPagesCollection { readonly 'constructor': any; item(index: number): IHTMLStyleSheetPage; readonly length: number; + (index: number): IHTMLStyleSheetPage; } class HTMLStyleSheetRule { @@ -25890,33 +25850,30 @@ declare namespace MSHTML { readonly type: number; } - class HTMLStyleSheetRulesAppliedCollection { - private 'MSHTML.HTMLStyleSheetRulesAppliedCollection_typekey': HTMLStyleSheetRulesAppliedCollection; - private constructor(); + interface HTMLStyleSheetRulesAppliedCollection { item(index: number): IHTMLStyleSheetRule; readonly length: number; propertyAppliedBy(name: string): IHTMLStyleSheetRule; propertyAppliedTrace(name: string, index: number): IHTMLStyleSheetRule; propertyAppliedTraceLength(name: string): number; + (index: number): IHTMLStyleSheetRule; } - class HTMLStyleSheetRulesCollection { - private 'MSHTML.HTMLStyleSheetRulesCollection_typekey': HTMLStyleSheetRulesCollection; - private constructor(); + interface HTMLStyleSheetRulesCollection { readonly 'constructor': any; ie9_item(index: number): IHTMLCSSRule; readonly ie9_length: number; item(index: number): IHTMLStyleSheetRule; readonly length: number; + (index: number): IHTMLStyleSheetRule; } - class HTMLStyleSheetsCollection { - private 'MSHTML.HTMLStyleSheetsCollection_typekey': HTMLStyleSheetsCollection; - private constructor(); + interface HTMLStyleSheetsCollection { readonly 'constructor': any; ie9_item(index: number): any; item(pvarIndex: any): any; readonly length: number; + (pvarIndex: any): any; } class HTMLTable { @@ -26000,7 +25957,7 @@ declare namespace MSHTML { dataSrc: string; deleteCaption(): void; - /** @param number [index=-1] */ + /** @param index [index=-1] */ deleteRow(index?: number): void; deleteTFoot(): void; deleteTHead(): void; @@ -26018,7 +25975,7 @@ declare namespace MSHTML { frame: string; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -26046,7 +26003,7 @@ declare namespace MSHTML { ie9_appendChild(newChild: IHTMLDOMNode): IHTMLDOMNode; ie9_caption: IHTMLTableCaption; - /** @param number [index=-1] */ + /** @param index [index=-1] */ ie9_deleteRow(index?: number): void; ie9_getAttribute(strAttributeName: string): any; ie9_getAttributeNode(strAttributeName: string): IHTMLDOMAttribute2; @@ -26054,7 +26011,7 @@ declare namespace MSHTML { ie9_hasAttributes(): boolean; ie9_insertBefore(newChild: IHTMLDOMNode, refChild?: any): IHTMLDOMNode; - /** @param number [index=-1] */ + /** @param index [index=-1] */ ie9_insertRow(index?: number): any; readonly ie9_nodeName: string; ie9_removeAttribute(strAttributeName: string): void; @@ -26073,7 +26030,7 @@ declare namespace MSHTML { insertAdjacentText(where: string, text: string): void; insertBefore(newChild: IHTMLDOMNode, refChild?: any): IHTMLDOMNode; - /** @param number [index=-1] */ + /** @param index [index=-1] */ insertRow(index?: number): any; readonly isContentEditable: boolean; isDefaultNamespace(pvarNamespace: any): boolean; @@ -26093,8 +26050,8 @@ declare namespace MSHTML { mergeAttributes(mergeThis: IHTMLElement, pvarFlags?: any): void; /** - * @param number [indexFrom=-1] - * @param number [indexTo=-1] + * @param indexFrom [indexFrom=-1] + * @param indexTo [indexTo=-1] */ moveRow(indexFrom?: number, indexTo?: number): any; msMatchesSelector(v: string): boolean; @@ -26243,7 +26200,7 @@ declare namespace MSHTML { refresh(): void; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -26252,7 +26209,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -26269,16 +26226,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -26371,7 +26328,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -26558,7 +26515,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -26567,7 +26524,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -26582,16 +26539,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -26690,7 +26647,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -26882,7 +26839,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -26891,7 +26848,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -26908,16 +26865,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -27008,7 +26965,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -27197,7 +27154,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -27206,7 +27163,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -27221,16 +27178,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; span: number; @@ -27316,7 +27273,7 @@ declare namespace MSHTML { createControlRange(): any; readonly currentStyle: IHTMLCurrentStyle; - /** @param number [index=-1] */ + /** @param index [index=-1] */ deleteCell(index?: number): void; detachEvent(event: string, pdisp: any): void; dir: string; @@ -27330,7 +27287,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -27358,14 +27315,14 @@ declare namespace MSHTML { ie9_ch: string; ie9_chOff: string; - /** @param number [index=-1] */ + /** @param index [index=-1] */ ie9_deleteCell(index?: number): void; ie9_getAttribute(strAttributeName: string): any; ie9_getAttributeNode(strAttributeName: string): IHTMLDOMAttribute2; ie9_hasAttribute(name: string): boolean; ie9_hasAttributes(): boolean; - /** @param number [index=-1] */ + /** @param index [index=-1] */ ie9_insertCell(index?: number): any; readonly ie9_nodeName: string; ie9_removeAttribute(strAttributeName: string): void; @@ -27380,7 +27337,7 @@ declare namespace MSHTML { insertAdjacentText(where: string, text: string): void; insertBefore(newChild: IHTMLDOMNode, refChild?: any): IHTMLDOMNode; - /** @param number [index=-1] */ + /** @param index [index=-1] */ insertCell(index?: number): any; readonly isContentEditable: boolean; readonly isDisabled: boolean; @@ -27529,7 +27486,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -27538,7 +27495,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -27555,16 +27512,16 @@ declare namespace MSHTML { readonly sectionRowIndex: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -27644,7 +27601,7 @@ declare namespace MSHTML { createControlRange(): any; readonly currentStyle: IHTMLCurrentStyle; - /** @param number [index=-1] */ + /** @param index [index=-1] */ deleteRow(index?: number): void; detachEvent(event: string, pdisp: any): void; dir: string; @@ -27658,7 +27615,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -27685,14 +27642,14 @@ declare namespace MSHTML { ie9_ch: string; ie9_chOff: string; - /** @param number [index=-1] */ + /** @param index [index=-1] */ ie9_deleteRow(index?: number): void; ie9_getAttribute(strAttributeName: string): any; ie9_getAttributeNode(strAttributeName: string): IHTMLDOMAttribute2; ie9_hasAttribute(name: string): boolean; ie9_hasAttributes(): boolean; - /** @param number [index=-1] */ + /** @param index [index=-1] */ ie9_insertRow(index?: number): any; readonly ie9_nodeName: string; ie9_removeAttribute(strAttributeName: string): void; @@ -27707,7 +27664,7 @@ declare namespace MSHTML { insertAdjacentText(where: string, text: string): void; insertBefore(newChild: IHTMLDOMNode, refChild?: any): IHTMLDOMNode; - /** @param number [index=-1] */ + /** @param index [index=-1] */ insertRow(index?: number): any; readonly isContentEditable: boolean; readonly isDisabled: boolean; @@ -27719,8 +27676,8 @@ declare namespace MSHTML { mergeAttributes(mergeThis: IHTMLElement, pvarFlags?: any): void; /** - * @param number [indexFrom=-1] - * @param number [indexTo=-1] + * @param indexFrom [indexFrom=-1] + * @param indexTo [indexTo=-1] */ moveRow(indexFrom?: number, indexTo?: number): any; msMatchesSelector(v: string): boolean; @@ -27862,7 +27819,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -27871,7 +27828,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -27887,16 +27844,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -27991,7 +27948,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -28195,7 +28152,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -28204,7 +28161,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -28223,16 +28180,16 @@ declare namespace MSHTML { selectionStart: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; setSelectionRange(start: number, end: number): void; readonly sourceIndex: number; @@ -28324,7 +28281,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -28511,7 +28468,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -28520,7 +28477,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -28535,16 +28492,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -28640,7 +28597,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -28827,7 +28784,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -28836,7 +28793,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -28851,16 +28808,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -28948,7 +28905,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -29135,7 +29092,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -29144,7 +29101,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -29159,16 +29116,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -29255,7 +29212,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -29442,7 +29399,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -29451,7 +29408,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -29466,16 +29423,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -29491,12 +29448,11 @@ declare namespace MSHTML { xmsAcceleratorKey: string; } - class HTMLUrnCollection { - private 'MSHTML.HTMLUrnCollection_typekey': HTMLUrnCollection; - private constructor(); + interface HTMLUrnCollection { readonly 'constructor': any; item(index: number): string; readonly length: number; + (index: number): string; } class HTMLVideoElement { @@ -29587,7 +29543,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -29806,7 +29762,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -29815,7 +29771,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -29832,16 +29788,16 @@ declare namespace MSHTML { readonly seeking: boolean; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -29864,9 +29820,7 @@ declare namespace MSHTML { xmsAcceleratorKey: string; } - class HTMLW3CComputedStyle { - private 'MSHTML.HTMLW3CComputedStyle_typekey': HTMLW3CComputedStyle; - private constructor(); + interface HTMLW3CComputedStyle { accelerator: string; alignContent: string; alignItems: string; @@ -30145,7 +30099,7 @@ declare namespace MSHTML { scrollbarShadowColor: any; scrollbarTrackColor: any; - /** @param any [pvarPropertyPriority=''] */ + /** @param pvarPropertyPriority [pvarPropertyPriority=''] */ setProperty(bstrPropertyName: string, pvarPropertyValue: any, pvarPropertyPriority?: any): void; stopColor: any; stopOpacity: any; @@ -30239,14 +30193,13 @@ declare namespace MSHTML { writingMode: string; zIndex: any; zoom: any; + (index: number): string; } - class HTMLWindow2 { - private 'MSHTML.HTMLWindow2_typekey': HTMLWindow2; - private constructor(); + interface HTMLWindow2 { addEventListener(type: string, listener: any, useCapture: boolean): void; - /** @param string [message=''] */ + /** @param message [message=''] */ alert(message?: string): void; readonly applicationCache: applicationCache; attachEvent(event: string, pdisp: any): boolean; @@ -30258,7 +30211,7 @@ declare namespace MSHTML { close(): void; readonly closed: boolean; - /** @param string [message=''] */ + /** @param message [message=''] */ confirm(message?: string): boolean; readonly 'constructor': any; createPopup(varArgIn?: any): any; @@ -30268,14 +30221,14 @@ declare namespace MSHTML { readonly document: IHTMLDocument2; readonly event: IHTMLEventObj; - /** @param string [language='JScript'] */ + /** @param language [language='JScript'] */ execScript(code: string, language?: string): any; readonly external: any; focus(): void; readonly frameElement: IHTMLFrameBase; readonly frames: FramesCollection; - /** @param string [bstrPseudoElt=''] */ + /** @param bstrPseudoElt [bstrPseudoElt=''] */ getComputedStyle(varArgIn: IHTMLDOMNode, bstrPseudoElt?: string): IHTMLCSSStyleDeclaration; getSelection(): IHTMLSelection; readonly history: IOmHistory; @@ -30376,10 +30329,10 @@ declare namespace MSHTML { onwaiting: any; /** - * @param string [url=''] - * @param string [name=''] - * @param string [features=''] - * @param boolean [replace=false] + * @param url [url=''] + * @param name [name=''] + * @param features [features=''] + * @param replace [replace=false] */ open(url?: string, name?: string, features?: string, replace?: boolean): IHTMLWindow2; opener: any; @@ -30393,8 +30346,8 @@ declare namespace MSHTML { print(): void; /** - * @param string [message=''] - * @param string [defstr='undefined'] + * @param message [message=''] + * @param defstr [defstr='undefined'] */ prompt(message?: string, defstr?: string): any; removeEventListener(type: string, listener: any, useCapture: boolean): void; @@ -30413,11 +30366,11 @@ declare namespace MSHTML { setInterval(expression: any, msec: number, language?: any): number; setTimeout(expression: any, msec: number, language?: any): number; - /** @param string [features=''] */ + /** @param features [features=''] */ showHelp(helpURL: string, helpArg: any, features?: string): void; showModalDialog(dialog: string, varArgIn?: any, varOptions?: any): any; - /** @param string [url=''] */ + /** @param url [url=''] */ showModelessDialog(url?: string, varArgIn?: any, options?: any): IHTMLWindow2; status: string; readonly styleMedia: IHTMLStyleMedia; @@ -30425,14 +30378,13 @@ declare namespace MSHTML { toStaticHTML(bstrHTML: string): string; toString(): string; readonly window: IHTMLWindow2; + (pvarIndex: any): any; } - class HTMLWindowProxy { - private 'MSHTML.HTMLWindowProxy_typekey': HTMLWindowProxy; - private constructor(); + interface HTMLWindowProxy { addEventListener(type: string, listener: any, useCapture: boolean): void; - /** @param string [message=''] */ + /** @param message [message=''] */ alert(message?: string): void; readonly applicationCache: applicationCache; attachEvent(event: string, pdisp: any): boolean; @@ -30444,7 +30396,7 @@ declare namespace MSHTML { close(): void; readonly closed: boolean; - /** @param string [message=''] */ + /** @param message [message=''] */ confirm(message?: string): boolean; readonly 'constructor': any; createPopup(varArgIn?: any): any; @@ -30454,14 +30406,14 @@ declare namespace MSHTML { readonly document: IHTMLDocument2; readonly event: IHTMLEventObj; - /** @param string [language='JScript'] */ + /** @param language [language='JScript'] */ execScript(code: string, language?: string): any; readonly external: any; focus(): void; readonly frameElement: IHTMLFrameBase; readonly frames: FramesCollection; - /** @param string [bstrPseudoElt=''] */ + /** @param bstrPseudoElt [bstrPseudoElt=''] */ getComputedStyle(varArgIn: IHTMLDOMNode, bstrPseudoElt?: string): IHTMLCSSStyleDeclaration; getSelection(): IHTMLSelection; readonly history: IOmHistory; @@ -30562,10 +30514,10 @@ declare namespace MSHTML { onwaiting: any; /** - * @param string [url=''] - * @param string [name=''] - * @param string [features=''] - * @param boolean [replace=false] + * @param url [url=''] + * @param name [name=''] + * @param features [features=''] + * @param replace [replace=false] */ open(url?: string, name?: string, features?: string, replace?: boolean): IHTMLWindow2; opener: any; @@ -30579,8 +30531,8 @@ declare namespace MSHTML { print(): void; /** - * @param string [message=''] - * @param string [defstr='undefined'] + * @param message [message=''] + * @param defstr [defstr='undefined'] */ prompt(message?: string, defstr?: string): any; removeEventListener(type: string, listener: any, useCapture: boolean): void; @@ -30599,11 +30551,11 @@ declare namespace MSHTML { setInterval(expression: any, msec: number, language?: any): number; setTimeout(expression: any, msec: number, language?: any): number; - /** @param string [features=''] */ + /** @param features [features=''] */ showHelp(helpURL: string, helpArg: any, features?: string): void; showModalDialog(dialog: string, varArgIn?: any, varOptions?: any): any; - /** @param string [url=''] */ + /** @param url [url=''] */ showModelessDialog(url?: string, varArgIn?: any, options?: any): IHTMLWindow2; status: string; readonly styleMedia: IHTMLStyleMedia; @@ -30611,6 +30563,7 @@ declare namespace MSHTML { toStaticHTML(bstrHTML: string): string; toString(): string; readonly window: IHTMLWindow2; + (pvarIndex: any): any; } class HTMLWndOptionElement { @@ -30689,7 +30642,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -30893,7 +30846,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -30902,7 +30855,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -30918,16 +30871,16 @@ declare namespace MSHTML { selected: boolean; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -30946,9 +30899,7 @@ declare namespace MSHTML { xmsAcceleratorKey: string; } - class HTMLWndSelectElement { - private 'MSHTML.HTMLWndSelectElement_typekey': HTMLWndSelectElement; - private constructor(); + interface HTMLWndSelectElement { accessKey: string; add(element: IHTMLElement, before?: any): void; addBehavior(bstrURL: string, pvarFactory?: any): number; @@ -31022,7 +30973,7 @@ declare namespace MSHTML { readonly form: IHTMLFormElement; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -31230,10 +31181,10 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [index=-1] */ + /** @param index [index=-1] */ remove(index?: number): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -31242,7 +31193,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -31258,16 +31209,16 @@ declare namespace MSHTML { selectedIndex: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; size: number; readonly sourceIndex: number; @@ -31287,6 +31238,7 @@ declare namespace MSHTML { urns(urn: any): any; value: string; xmsAcceleratorKey: string; + (name?: any, index?: any): any; } class HTMLXMLHttpRequest { @@ -31313,10 +31265,9 @@ declare namespace MSHTML { timeout: number; } - class HTMLXMLHttpRequestFactory { - private 'MSHTML.HTMLXMLHttpRequestFactory_typekey': HTMLXMLHttpRequestFactory; - private constructor(); + interface HTMLXMLHttpRequestFactory { create(): IHTMLXMLHttpRequest; + (): IHTMLXMLHttpRequest; } class ICanvasGradient { @@ -31485,16 +31436,16 @@ declare namespace MSHTML { removeEventListener(type: string, listener: any, useCapture: boolean): void; } - class IHTMLAreasCollection { - private 'MSHTML.IHTMLAreasCollection_typekey': IHTMLAreasCollection; - private constructor(); + // tslint:disable-next-line:interface-name + interface IHTMLAreasCollection { add(element: IHTMLElement, before?: any): void; item(name?: any, index?: any): any; length: number; - /** @param number [index=-1] */ + /** @param index [index=-1] */ remove(index?: number): void; tags(tagName: any): any; + (name?: any, index?: any): any; } class IHTMLAttributeCollection3 { @@ -31512,11 +31463,11 @@ declare namespace MSHTML { private constructor(); } - class IHTMLBookmarkCollection { - private 'MSHTML.IHTMLBookmarkCollection_typekey': IHTMLBookmarkCollection; - private constructor(); + // tslint:disable-next-line:interface-name + interface IHTMLBookmarkCollection { item(index: number): any; readonly length: number; + (index: number): any; } class IHTMLCanvasElement { @@ -31537,9 +31488,8 @@ declare namespace MSHTML { readonly type: number; } - class IHTMLCSSStyleDeclaration { - private 'MSHTML.IHTMLCSSStyleDeclaration_typekey': IHTMLCSSStyleDeclaration; - private constructor(); + // tslint:disable-next-line:interface-name + interface IHTMLCSSStyleDeclaration { accelerator: string; alignmentBaseline: string; background: string; @@ -31693,7 +31643,7 @@ declare namespace MSHTML { scrollbarShadowColor: any; scrollbarTrackColor: any; - /** @param any [pvarPropertyPriority=''] */ + /** @param pvarPropertyPriority [pvarPropertyPriority=''] */ setProperty(bstrPropertyName: string, pvarPropertyValue: any, pvarPropertyPriority?: any): void; stopColor: any; stopOpacity: any; @@ -31733,6 +31683,7 @@ declare namespace MSHTML { writingMode: string; zIndex: any; zoom: any; + (index: number): string; } class IHTMLCurrentStyle { @@ -31779,7 +31730,7 @@ declare namespace MSHTML { readonly fontVariant: string; readonly fontWeight: any; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; readonly height: any; readonly imeMode: string; @@ -31866,8 +31817,8 @@ declare namespace MSHTML { createElement(eTag: string): IHTMLElement; /** - * @param string [bstrHref=''] - * @param number [lIndex=-1] + * @param bstrHref [bstrHref=''] + * @param lIndex [lIndex=-1] */ createStyleSheet(bstrHref?: string, lIndex?: number): IHTMLStyleSheet; defaultCharset: string; @@ -31876,7 +31827,7 @@ declare namespace MSHTML { elementFromPoint(x: number, y: number): IHTMLElement; readonly embeds: IHTMLElementCollection; - /** @param boolean [showUI=false] */ + /** @param showUI [showUI=false] */ execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; execCommandShowHelp(cmdID: string): boolean; expando: boolean; @@ -31914,7 +31865,7 @@ declare namespace MSHTML { onrowexit: any; onselectstart: any; - /** @param string [url='text/html'] */ + /** @param url [url='text/html'] */ open(url?: string, name?: any, features?: any, replace?: any): any; readonly parentWindow: IHTMLWindow2; readonly plugins: IHTMLElementCollection; @@ -32014,11 +31965,11 @@ declare namespace MSHTML { readonly version: string; } - class IHTMLDocumentCompatibleInfoCollection { - private 'MSHTML.IHTMLDocumentCompatibleInfoCollection_typekey': IHTMLDocumentCompatibleInfoCollection; - private constructor(); + // tslint:disable-next-line:interface-name + interface IHTMLDocumentCompatibleInfoCollection { item(index: number): IHTMLDocumentCompatibleInfo; readonly length: number; + (index: number): IHTMLDocumentCompatibleInfo; } class IHTMLDOMAttribute { @@ -32052,11 +32003,11 @@ declare namespace MSHTML { value: string; } - class IHTMLDOMChildrenCollection { - private 'MSHTML.IHTMLDOMChildrenCollection_typekey': IHTMLDOMChildrenCollection; - private constructor(); + // tslint:disable-next-line:interface-name + interface IHTMLDOMChildrenCollection { item(index: number): any; readonly length: number; + (index: number): any; } class IHTMLDOMImplementation { @@ -32084,7 +32035,7 @@ declare namespace MSHTML { readonly previousSibling: IHTMLDOMNode; removeChild(oldChild: IHTMLDOMNode): IHTMLDOMNode; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; replaceNode(replacement: IHTMLDOMNode): IHTMLDOMNode; @@ -32153,7 +32104,7 @@ declare namespace MSHTML { readonly document: any; readonly filters: IHTMLFiltersCollection; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; id: string; innerHTML: string; @@ -32196,11 +32147,11 @@ declare namespace MSHTML { readonly parentTextEdit: IHTMLElement; readonly recordNumber: any; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; scrollIntoView(varargStart?: any): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; readonly sourceIndex: number; readonly style: IHTMLStyle; @@ -32276,22 +32227,22 @@ declare namespace MSHTML { scrollTop: number; readonly scrollWidth: number; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; tabIndex: number; tagUrn: string; } - class IHTMLElementCollection { - private 'MSHTML.IHTMLElementCollection_typekey': IHTMLElementCollection; - private constructor(); - item(name?: string | number, index?: number): any; + // tslint:disable-next-line:interface-name + interface IHTMLElementCollection { + item(name?: any, index?: any): any; length: number; tags(tagName: any): any; toString(): string; + (name?: any, index?: any): any; } class IHTMLEventObj { @@ -32321,16 +32272,15 @@ declare namespace MSHTML { readonly y: number; } - class IHTMLFiltersCollection { - private 'MSHTML.IHTMLFiltersCollection_typekey': IHTMLFiltersCollection; - private constructor(); + // tslint:disable-next-line:interface-name + interface IHTMLFiltersCollection { item(pvarIndex: any): any; readonly length: number; + (pvarIndex: any): any; } - class IHTMLFormElement { - private 'MSHTML.IHTMLFormElement_typekey': IHTMLFormElement; - private constructor(); + // tslint:disable-next-line:interface-name + interface IHTMLFormElement { action: string; dir: string; readonly elements: any; @@ -32345,6 +32295,7 @@ declare namespace MSHTML { submit(): void; tags(tagName: any): any; target: string; + (name?: any, index?: any): any; } class IHTMLFrameBase { @@ -32407,7 +32358,7 @@ declare namespace MSHTML { port: string; protocol: string; - /** @param boolean [flag=false] */ + /** @param flag [flag=false] */ reload(flag?: boolean): void; replace(bstr: string): void; search: string; @@ -32480,7 +32431,7 @@ declare namespace MSHTML { private constructor(); readonly length: number; - /** @param boolean [reload=false] */ + /** @param reload [reload=false] */ refresh(reload?: boolean): void; } @@ -32493,11 +32444,11 @@ declare namespace MSHTML { top: number; } - class IHTMLRectCollection { - private 'MSHTML.IHTMLRectCollection_typekey': IHTMLRectCollection; - private constructor(); + // tslint:disable-next-line:interface-name + interface IHTMLRectCollection { item(pvarIndex: any): any; readonly length: number; + (pvarIndex: any): any; } class IHTMLRenderStyle { @@ -32559,7 +32510,7 @@ declare namespace MSHTML { fontVariant: string; fontWeight: string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; height: any; left: any; @@ -32584,10 +32535,10 @@ declare namespace MSHTML { pageBreakBefore: string; readonly position: string; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; styleFloat: string; textAlign: string; @@ -32708,7 +32659,7 @@ declare namespace MSHTML { fontVariant: string; fontWeight: string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; height: any; left: any; @@ -32741,10 +32692,10 @@ declare namespace MSHTML { posTop: number; posWidth: number; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; styleFloat: string; textAlign: string; @@ -32777,10 +32728,10 @@ declare namespace MSHTML { private 'MSHTML.IHTMLStyleSheet_typekey': IHTMLStyleSheet; private constructor(); - /** @param number [lIndex=-1] */ + /** @param lIndex [lIndex=-1] */ addImport(bstrURL: string, lIndex?: number): number; - /** @param number [lIndex=-1] */ + /** @param lIndex [lIndex=-1] */ addRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number; cssText: string; disabled: boolean; @@ -32805,11 +32756,11 @@ declare namespace MSHTML { readonly selector: string; } - class IHTMLStyleSheetPagesCollection { - private 'MSHTML.IHTMLStyleSheetPagesCollection_typekey': IHTMLStyleSheetPagesCollection; - private constructor(); + // tslint:disable-next-line:interface-name + interface IHTMLStyleSheetPagesCollection { item(index: number): IHTMLStyleSheetPage; readonly length: number; + (index: number): IHTMLStyleSheetPage; } class IHTMLStyleSheetRule { @@ -32820,28 +32771,28 @@ declare namespace MSHTML { readonly style: IHTMLRuleStyle; } - class IHTMLStyleSheetRulesAppliedCollection { - private 'MSHTML.IHTMLStyleSheetRulesAppliedCollection_typekey': IHTMLStyleSheetRulesAppliedCollection; - private constructor(); + // tslint:disable-next-line:interface-name + interface IHTMLStyleSheetRulesAppliedCollection { item(index: number): IHTMLStyleSheetRule; readonly length: number; propertyAppliedBy(name: string): IHTMLStyleSheetRule; propertyAppliedTrace(name: string, index: number): IHTMLStyleSheetRule; propertyAppliedTraceLength(name: string): number; + (index: number): IHTMLStyleSheetRule; } - class IHTMLStyleSheetRulesCollection { - private 'MSHTML.IHTMLStyleSheetRulesCollection_typekey': IHTMLStyleSheetRulesCollection; - private constructor(); + // tslint:disable-next-line:interface-name + interface IHTMLStyleSheetRulesCollection { item(index: number): IHTMLStyleSheetRule; readonly length: number; + (index: number): IHTMLStyleSheetRule; } - class IHTMLStyleSheetsCollection { - private 'MSHTML.IHTMLStyleSheetsCollection_typekey': IHTMLStyleSheetsCollection; - private constructor(); + // tslint:disable-next-line:interface-name + interface IHTMLStyleSheetsCollection { item(pvarIndex: any): any; readonly length: number; + (pvarIndex: any): any; } class IHTMLTableCaption { @@ -32857,10 +32808,10 @@ declare namespace MSHTML { align: string; bgColor: any; - /** @param number [index=-1] */ + /** @param index [index=-1] */ deleteRow(index?: number): void; - /** @param number [index=-1] */ + /** @param index [index=-1] */ insertRow(index?: number): any; readonly rows: IHTMLElementCollection; vAlign: string; @@ -32878,19 +32829,19 @@ declare namespace MSHTML { private 'MSHTML.IHTMLTxtRange_typekey': IHTMLTxtRange; private constructor(); - /** @param boolean [start=true] */ + /** @param start [start=true] */ collapse(start?: boolean): void; compareEndPoints(how: string, sourceRange: IHTMLTxtRange): number; duplicate(): IHTMLTxtRange; - /** @param boolean [showUI=false] */ + /** @param showUI [showUI=false] */ execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; execCommandShowHelp(cmdID: string): boolean; expand(Unit: string): boolean; /** - * @param number [Count=1073741823] - * @param number [flags=0] + * @param Count [Count=1073741823] + * @param flags [flags=0] */ findText(String: string, Count?: number, flags?: number): boolean; getBookmark(): string; @@ -32898,13 +32849,13 @@ declare namespace MSHTML { inRange(range: IHTMLTxtRange): boolean; isEqual(range: IHTMLTxtRange): boolean; - /** @param number [Count=1] */ + /** @param Count [Count=1] */ move(Unit: string, Count?: number): number; - /** @param number [Count=1] */ + /** @param Count [Count=1] */ moveEnd(Unit: string, Count?: number): number; - /** @param number [Count=1] */ + /** @param Count [Count=1] */ moveStart(Unit: string, Count?: number): number; moveToBookmark(Bookmark: string): boolean; moveToElementText(element: IHTMLElement): void; @@ -32918,18 +32869,16 @@ declare namespace MSHTML { queryCommandText(cmdID: string): string; queryCommandValue(cmdID: string): any; - /** @param boolean [fStart=true] */ + /** @param fStart [fStart=true] */ scrollIntoView(fStart?: boolean): void; select(): void; setEndPoint(how: string, sourceRange: IHTMLTxtRange): void; text: string; } - class IHTMLWindow2 { - private 'MSHTML.IHTMLWindow2_typekey': IHTMLWindow2; - private constructor(); - - /** @param string [message=''] */ + // tslint:disable-next-line:interface-name + interface IHTMLWindow2 { + /** @param message [message=''] */ alert(message?: string): void; blur(): void; clearInterval(timerID: number): void; @@ -32938,13 +32887,13 @@ declare namespace MSHTML { close(): void; readonly closed: boolean; - /** @param string [message=''] */ + /** @param message [message=''] */ confirm(message?: string): boolean; defaultStatus: string; readonly document: IHTMLDocument2; readonly event: IHTMLEventObj; - /** @param string [language='JScript'] */ + /** @param language [language='JScript'] */ execScript(code: string, language?: string): any; readonly external: any; focus(): void; @@ -32971,10 +32920,10 @@ declare namespace MSHTML { onunload: any; /** - * @param string [url=''] - * @param string [name=''] - * @param string [features=''] - * @param boolean [replace=false] + * @param url [url=''] + * @param name [name=''] + * @param features [features=''] + * @param replace [replace=false] */ open(url?: string, name?: string, features?: string, replace?: boolean): IHTMLWindow2; opener: any; @@ -32982,8 +32931,8 @@ declare namespace MSHTML { readonly parent: IHTMLWindow2; /** - * @param string [message=''] - * @param string [defstr='undefined'] + * @param message [message=''] + * @param defstr [defstr='undefined'] */ prompt(message?: string, defstr?: string): any; resizeBy(x: number, y: number): void; @@ -32996,13 +32945,14 @@ declare namespace MSHTML { setInterval(expression: string, msec: number, language?: any): number; setTimeout(expression: string, msec: number, language?: any): number; - /** @param string [features=''] */ + /** @param features [features=''] */ showHelp(helpURL: string, helpArg: any, features?: string): void; showModalDialog(dialog: string, varArgIn?: any, varOptions?: any): any; status: string; readonly top: IHTMLWindow2; toString(): string; readonly window: IHTMLWindow2; + (pvarIndex: any): any; } class IHTMLXDomainRequest { @@ -33398,8 +33348,8 @@ declare namespace MSHTML { createRenderStyle(v: string): IHTMLRenderStyle; /** - * @param string [bstrHref=''] - * @param number [lIndex=-1] + * @param bstrHref [bstrHref=''] + * @param lIndex [lIndex=-1] */ createStyleSheet(bstrHref?: string, lIndex?: number): IHTMLStyleSheet; createTextNode(text: string): IHTMLDOMNode; @@ -33419,7 +33369,7 @@ declare namespace MSHTML { elementsFromRect(left: number, top: number, width: number, height: number): IHTMLDOMChildrenCollection; readonly embeds: IHTMLElementCollection; - /** @param boolean [showUI=false] */ + /** @param showUI [showUI=false] */ execCommand(cmdID: string, showUI?: boolean, value?: any): boolean; execCommandShowHelp(cmdID: string): boolean; expando: boolean; @@ -33577,7 +33527,7 @@ declare namespace MSHTML { onvolumechange: any; onwaiting: any; - /** @param string [url='text/html'] */ + /** @param url [url='text/html'] */ open(url?: string, name?: any, features?: any, replace?: any): any; readonly ownerDocument: any; readonly parentNode: IHTMLDOMNode; @@ -33596,14 +33546,14 @@ declare namespace MSHTML { querySelectorAll(v: string): IHTMLDOMChildrenCollection; readonly readyState: string; - /** @param boolean [fForce=false] */ + /** @param fForce [fForce=false] */ recalc(fForce?: boolean): void; readonly referrer: string; releaseCapture(): void; removeChild(oldChild: IHTMLDOMNode): IHTMLDOMNode; removeEventListener(type: string, listener: any, useCapture: boolean): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; replaceNode(replacement: IHTMLDOMNode): IHTMLDOMNode; @@ -33629,9 +33579,7 @@ declare namespace MSHTML { xmlVersion: string; } - class OldHTMLFormElement { - private 'MSHTML.OldHTMLFormElement_typekey': OldHTMLFormElement; - private constructor(); + interface OldHTMLFormElement { acceptCharset: string; accessKey: string; action: string; @@ -33642,14 +33590,14 @@ declare namespace MSHTML { appendItemSeparator(): void; /** - * @param string [name=''] - * @param string [filename=''] + * @param name [name=''] + * @param filename [filename=''] */ appendNameFilePair(name?: string, filename?: string): void; /** - * @param string [name=''] - * @param string [value=''] + * @param name [name=''] + * @param value [value=''] */ appendNameValuePair(name?: string, value?: string): void; applyElement(apply: IHTMLElement, where: string): IHTMLElement; @@ -33716,7 +33664,7 @@ declare namespace MSHTML { focus(): void; getAdjacentText(where: string): string; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; getAttributeNode(bstrName: string): IHTMLDOMAttribute; getAttributeNodeNS(pvarNS: any, bstrName: string): IHTMLDOMAttribute2; @@ -33909,7 +33857,7 @@ declare namespace MSHTML { readonly recordNumber: any; releaseCapture(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; removeAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; removeAttributeNS(pvarNS: any, strAttributeName: string): void; @@ -33918,7 +33866,7 @@ declare namespace MSHTML { removeExpression(propname: string): boolean; removeFilter(pUnk: any): void; - /** @param boolean [fDeep=false] */ + /** @param fDeep [fDeep=false] */ removeNode(fDeep?: boolean): IHTMLDOMNode; replaceAdjacentText(where: string, newText: string): string; replaceChild(newChild: IHTMLDOMNode, oldChild: IHTMLDOMNode): IHTMLDOMNode; @@ -33934,16 +33882,16 @@ declare namespace MSHTML { readonly scrollWidth: number; setActive(): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; setAttributeNode(pattr: IHTMLDOMAttribute): IHTMLDOMAttribute; setAttributeNodeNS(pattr: IHTMLDOMAttribute2): IHTMLDOMAttribute2; setAttributeNS(pvarNS: any, strAttributeName: string, pvarAttributeValue: any): void; - /** @param boolean [containerCapture=true] */ + /** @param containerCapture [containerCapture=true] */ setCapture(containerCapture?: boolean): void; - /** @param string [language=''] */ + /** @param language [language=''] */ setExpression(propname: string, expression: string, language?: string): void; readonly sourceIndex: number; spellcheck: any; @@ -33961,6 +33909,7 @@ declare namespace MSHTML { readonly uniqueNumber: number; urns(urn: any): any; xmsAcceleratorKey: string; + (name?: any, index?: any): any; } class RangeException { @@ -33981,9 +33930,7 @@ declare namespace MSHTML { propertyIsInline(name: string): boolean; } - class RulesAppliedCollection { - private 'MSHTML.RulesAppliedCollection_typekey': RulesAppliedCollection; - private constructor(); + interface RulesAppliedCollection { readonly element: IHTMLElement; item(index: number): IRulesApplied; readonly length: number; @@ -33992,6 +33939,7 @@ declare namespace MSHTML { propertyInheritedFrom(name: string): IRulesApplied; propertyInheritedTrace(name: string, index: number): IRulesApplied; propertyInheritedTraceLength(name: string): number; + (index: number): IRulesApplied; } class Scriptlet { @@ -34005,12 +33953,11 @@ declare namespace MSHTML { url: string; } - class StaticNodeList { - private 'MSHTML.StaticNodeList_typekey': StaticNodeList; - private constructor(); + interface StaticNodeList { readonly 'constructor': any; item(index: number): any; readonly length: number; + (index: number): any; } class SVGAElement { @@ -34230,7 +34177,7 @@ declare namespace MSHTML { readonly filters: IHTMLFiltersCollection; focusable: SVGAnimatedEnumeration; - /** @param number [lFlags=0] */ + /** @param lFlags [lFlags=0] */ getAttribute(strAttributeName: string, lFlags?: number): any; id: string; innerHTML: string; @@ -34274,11 +34221,11 @@ declare namespace MSHTML { readonly parentTextEdit: IHTMLElement; readonly recordNumber: any; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ removeAttribute(strAttributeName: string, lFlags?: number): boolean; scrollIntoView(varargStart?: any): void; - /** @param number [lFlags=1] */ + /** @param lFlags [lFlags=1] */ setAttribute(strAttributeName: string, AttributeValue: any, lFlags?: number): void; readonly sourceIndex: number; readonly style: IHTMLStyle; @@ -35487,10 +35434,9 @@ declare namespace MSHTML { readonly 'constructor': any; } - class XDomainRequestFactory { - private 'MSHTML.XDomainRequestFactory_typekey': XDomainRequestFactory; - private constructor(); + interface XDomainRequestFactory { create(): IHTMLXDomainRequest; + (): IHTMLXDomainRequest; } class XMLHttpRequestEventTarget { @@ -35510,982 +35456,120 @@ declare namespace MSHTML { interface ActiveXObject { on(obj: MSHTML.HTMLNamespace, event: 'onreadystatechange', argNames: ['pEvtObj'], handler: (this: MSHTML.HTMLNamespace, parameter: {readonly pEvtObj: MSHTML.IHTMLEventObj}) => void): void; - on( - obj: MSHTML.HTMLWindow2, event: 'onerror', argNames: ['description', 'url', 'line'], handler: ( - this: MSHTML.HTMLWindow2, parameter: {readonly description: string, readonly url: string, readonly line: number}) => void): void; - on( - obj: MSHTML.HTMLWindowProxy, event: 'onerror', argNames: ['description', 'url', 'line'], handler: ( - this: MSHTML.HTMLWindowProxy, parameter: {readonly description: string, readonly url: string, readonly line: number}) => void): void; + on(obj: MSHTML.HTMLWindow2, event: 'onerror', argNames: ['description', 'url', 'line'], handler: (this: MSHTML.HTMLWindow2, parameter: {readonly description: string, readonly url: string, readonly line: number}) => void): void; + on(obj: MSHTML.HTMLWindowProxy, event: 'onerror', argNames: ['description', 'url', 'line'], handler: (this: MSHTML.HTMLWindowProxy, parameter: {readonly description: string, readonly url: string, readonly line: number}) => void): void; on(obj: MSHTML.Scriptlet, event: 'onscriptletevent', argNames: ['name', 'eventData'], handler: (this: MSHTML.Scriptlet, parameter: {readonly name: string, readonly eventData: any}) => void): void; - on( - obj: MSHTML.HTMLAnchorElement, 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.HTMLAnchorElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLAreaElement, 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.HTMLAreaElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLAudioElement, 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.HTMLAudioElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLBaseElement, 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.HTMLBaseElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLBaseFontElement, 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.HTMLBaseFontElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLBGsound, 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.HTMLBGsound, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLBlockElement, 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.HTMLBlockElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLBody, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | - 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | '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' | 'onselect' | 'onselectstart', - handler: (this: MSHTML.HTMLBody, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLBRElement, 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.HTMLBRElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLButtonElement, 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.HTMLButtonElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLCanvasElement, 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.HTMLCanvasElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLCommentElement, 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.HTMLCommentElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLDDElement, 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.HTMLDDElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLDivElement, 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.HTMLDivElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLDivPosition, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | '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' | 'onselect' | 'onselectstart', - handler: (this: MSHTML.HTMLDivPosition, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLDListElement, 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.HTMLDListElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLDocument, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforeupdate' | - 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | - 'ondragstart' | 'onerrorupdate' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onmousedown' | 'onmousemove' | 'onmouseout' | - 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onpropertychange' | 'onreadystatechange' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | - 'onselectionchange' | 'onselectstart' | 'onstop', - handler: (this: MSHTML.HTMLDocument, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLDTElement, 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.HTMLDTElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLEmbed, 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.HTMLEmbed, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLFieldSetElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | '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' | 'onselect' | 'onselectstart', - handler: (this: MSHTML.HTMLFieldSetElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLFontElement, 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.HTMLFontElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLFormElement, 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' | 'onreset' | 'onresize' | - 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart' | 'onsubmit', - handler: (this: MSHTML.HTMLFormElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLFrameBase, 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.HTMLFrameBase, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLFrameElement, 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.HTMLFrameElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLFrameSetSite, 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.HTMLFrameSetSite, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLGenericElement, 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.HTMLGenericElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLHeadElement, 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.HTMLHeadElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLHeaderElement, 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.HTMLHeaderElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLHRElement, 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.HTMLHRElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLHtmlElement, 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.HTMLHtmlElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLIFrame, 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.HTMLIFrame, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLImg, event: 'onabort' | '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' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | - 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | '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.HTMLImg, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLInputButtonElement, 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.HTMLInputButtonElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLInputElement, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | - 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | - 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | - 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | - 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', - handler: (this: MSHTML.HTMLInputElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLInputFileElement, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | - 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | - 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | - 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | - 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', - handler: (this: MSHTML.HTMLInputFileElement, parameter: {}) => void): void; - on( - obj: MSHTML.htmlInputImage, event: 'onabort' | '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' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | - 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | '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.htmlInputImage, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLInputTextElement, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | - 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | - 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | - 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | - 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', - handler: (this: MSHTML.HTMLInputTextElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLIsIndexElement, 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.HTMLIsIndexElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLLabelElement, 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.HTMLLabelElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLLegendElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | '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' | 'onselect' | 'onselectstart', - handler: (this: MSHTML.HTMLLegendElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLLIElement, 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.HTMLLIElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLLinkElement, 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' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | - 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | '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.HTMLLinkElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLListElement, 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.HTMLListElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLMapElement, 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.HTMLMapElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLMarqueeElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'onbounce' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | - 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | - 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfinish' | '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' | 'onselect' | 'onselectstart' | - 'onstart', - handler: (this: MSHTML.HTMLMarqueeElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLMediaElement, 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.HTMLMediaElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLMetaElement, 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.HTMLMetaElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLNextIdElement, 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.HTMLNextIdElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLNoShowElement, 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.HTMLNoShowElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLObjectElement, event: 'onafterupdate' | 'onbeforeupdate' | 'oncellchange' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | - 'onerror' | 'onerrorupdate' | 'onreadystatechange' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted', - handler: (this: MSHTML.HTMLObjectElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLOListElement, 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.HTMLOListElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLOptionButtonElement, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | - 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | - 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | - 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | - 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | - 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | - 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | - 'onselectstart', - handler: (this: MSHTML.HTMLOptionButtonElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLOptionElement, 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.HTMLOptionElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLParaElement, 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.HTMLParaElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLParamElement, 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.HTMLParamElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLPhraseElement, 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.HTMLPhraseElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLProgressElement, 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.HTMLProgressElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLRichtextElement, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | - 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | - 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | - 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | - 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', - handler: (this: MSHTML.HTMLRichtextElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLScriptElement, 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' | 'onerror' | '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.HTMLScriptElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLSelectElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | '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.HTMLSelectElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLSemanticElement, 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.HTMLSemanticElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLSourceElement, 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.HTMLSourceElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLSpanElement, 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.HTMLSpanElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLSpanFlow, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | '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' | 'onselect' | 'onselectstart', handler: ( - this: MSHTML.HTMLSpanFlow, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLStyleElement, 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' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | - 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | '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.HTMLStyleElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLTable, 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.HTMLTable, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLTableCaption, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | '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' | 'onselect' | 'onselectstart', - handler: (this: MSHTML.HTMLTableCaption, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLTableCell, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | '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' | 'onselect' | 'onselectstart', handler: ( - this: MSHTML.HTMLTableCell, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLTableCol, 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.HTMLTableCol, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLTableRow, 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.HTMLTableRow, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLTableSection, 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.HTMLTableSection, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLTextAreaElement, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | - 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | - 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | - 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | - 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | - 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', - handler: (this: MSHTML.HTMLTextAreaElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLTextElement, 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.HTMLTextElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLTitleElement, 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.HTMLTitleElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLUListElement, 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.HTMLUListElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLUnknownElement, 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.HTMLUnknownElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLVideoElement, 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.HTMLVideoElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLWindow2, event: 'onafterprint' | 'onbeforeprint' | 'onbeforeunload' | 'onblur' | 'onfocus' | 'onhelp' | 'onload' | 'onresize' | 'onscroll' | - 'onunload', - handler: (this: MSHTML.HTMLWindow2, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLWindowProxy, event: 'onafterprint' | 'onbeforeprint' | 'onbeforeunload' | 'onblur' | 'onfocus' | 'onhelp' | 'onload' | 'onresize' | 'onscroll' | - 'onunload', - handler: (this: MSHTML.HTMLWindowProxy, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLWndOptionElement, 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.HTMLWndOptionElement, parameter: {}) => void): void; - on( - obj: MSHTML.HTMLWndSelectElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | - 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | '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.HTMLWndSelectElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLAnchorElement, 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.HTMLAnchorElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLAreaElement, 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.HTMLAreaElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLAudioElement, 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.HTMLAudioElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLBaseElement, 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.HTMLBaseElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLBaseFontElement, 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.HTMLBaseFontElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLBGsound, 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.HTMLBGsound, parameter: {}) => void): void; + on(obj: MSHTML.HTMLBlockElement, 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.HTMLBlockElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLBody, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | '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' | 'onselect' | 'onselectstart', handler: (this: MSHTML.HTMLBody, parameter: {}) => void): void; + on(obj: MSHTML.HTMLBRElement, 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.HTMLBRElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLButtonElement, 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.HTMLButtonElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLCanvasElement, 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.HTMLCanvasElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLCommentElement, 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.HTMLCommentElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLDDElement, 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.HTMLDDElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLDivElement, 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.HTMLDivElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLDivPosition, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | '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' | 'onselect' | 'onselectstart', handler: (this: MSHTML.HTMLDivPosition, parameter: {}) => void): void; + on(obj: MSHTML.HTMLDListElement, 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.HTMLDListElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLDocument, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforeupdate' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondragstart' | 'onerrorupdate' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onmousedown' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onpropertychange' | 'onreadystatechange' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onselectionchange' | 'onselectstart' | 'onstop', handler: (this: MSHTML.HTMLDocument, parameter: {}) => void): void; + on(obj: MSHTML.HTMLDTElement, 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.HTMLDTElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLEmbed, 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.HTMLEmbed, parameter: {}) => void): void; + on(obj: MSHTML.HTMLFieldSetElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | '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' | 'onselect' | 'onselectstart', handler: (this: MSHTML.HTMLFieldSetElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLFontElement, 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.HTMLFontElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLFormElement, 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' | 'onreset' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart' | 'onsubmit', handler: (this: MSHTML.HTMLFormElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLFrameBase, 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.HTMLFrameBase, parameter: {}) => void): void; + on(obj: MSHTML.HTMLFrameElement, 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.HTMLFrameElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLFrameSetSite, 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.HTMLFrameSetSite, parameter: {}) => void): void; + on(obj: MSHTML.HTMLGenericElement, 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.HTMLGenericElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLHeadElement, 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.HTMLHeadElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLHeaderElement, 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.HTMLHeaderElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLHRElement, 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.HTMLHRElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLHtmlElement, 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.HTMLHtmlElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLIFrame, 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.HTMLIFrame, parameter: {}) => void): void; + on(obj: MSHTML.HTMLImg, event: 'onabort' | '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' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | '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.HTMLImg, parameter: {}) => void): void; + on(obj: MSHTML.HTMLInputButtonElement, 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.HTMLInputButtonElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLInputElement, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', handler: (this: MSHTML.HTMLInputElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLInputFileElement, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', handler: (this: MSHTML.HTMLInputFileElement, parameter: {}) => void): void; + on(obj: MSHTML.htmlInputImage, event: 'onabort' | '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' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | '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.htmlInputImage, parameter: {}) => void): void; + on(obj: MSHTML.HTMLInputTextElement, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', handler: (this: MSHTML.HTMLInputTextElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLIsIndexElement, 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.HTMLIsIndexElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLLabelElement, 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.HTMLLabelElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLLegendElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | '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' | 'onselect' | 'onselectstart', handler: (this: MSHTML.HTMLLegendElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLLIElement, 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.HTMLLIElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLLinkElement, 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' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | '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.HTMLLinkElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLListElement, 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.HTMLListElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLMapElement, 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.HTMLMapElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLMarqueeElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'onbounce' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfinish' | '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' | 'onselect' | 'onselectstart' | 'onstart', handler: (this: MSHTML.HTMLMarqueeElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLMediaElement, 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.HTMLMediaElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLMetaElement, 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.HTMLMetaElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLNextIdElement, 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.HTMLNextIdElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLNoShowElement, 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.HTMLNoShowElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLObjectElement, event: 'onafterupdate' | 'onbeforeupdate' | 'oncellchange' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'onerror' | 'onerrorupdate' | 'onreadystatechange' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted', handler: (this: MSHTML.HTMLObjectElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLOListElement, 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.HTMLOListElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLOptionButtonElement, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', handler: (this: MSHTML.HTMLOptionButtonElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLOptionElement, 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.HTMLOptionElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLParaElement, 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.HTMLParaElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLParamElement, 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.HTMLParamElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLPhraseElement, 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.HTMLPhraseElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLProgressElement, 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.HTMLProgressElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLRichtextElement, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', handler: (this: MSHTML.HTMLRichtextElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLScriptElement, 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' | 'onerror' | '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.HTMLScriptElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLSelectElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | '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.HTMLSelectElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLSemanticElement, 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.HTMLSemanticElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLSourceElement, 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.HTMLSourceElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLSpanElement, 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.HTMLSpanElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLSpanFlow, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | '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' | 'onselect' | 'onselectstart', handler: (this: MSHTML.HTMLSpanFlow, parameter: {}) => void): void; + on(obj: MSHTML.HTMLStyleElement, 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' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | '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.HTMLStyleElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLTable, 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.HTMLTable, parameter: {}) => void): void; + on(obj: MSHTML.HTMLTableCaption, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | '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' | 'onselect' | 'onselectstart', handler: (this: MSHTML.HTMLTableCaption, parameter: {}) => void): void; + on(obj: MSHTML.HTMLTableCell, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | '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' | 'onselect' | 'onselectstart', handler: (this: MSHTML.HTMLTableCell, parameter: {}) => void): void; + on(obj: MSHTML.HTMLTableCol, 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.HTMLTableCol, parameter: {}) => void): void; + on(obj: MSHTML.HTMLTableRow, 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.HTMLTableRow, parameter: {}) => void): void; + on(obj: MSHTML.HTMLTableSection, 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.HTMLTableSection, parameter: {}) => void): void; + on(obj: MSHTML.HTMLTextAreaElement, event: 'onabort' | 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerror' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onload' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselect' | 'onselectstart', handler: (this: MSHTML.HTMLTextAreaElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLTextElement, 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.HTMLTextElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLTitleElement, 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.HTMLTitleElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLUListElement, 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.HTMLUListElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLUnknownElement, 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.HTMLUnknownElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLVideoElement, 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.HTMLVideoElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLWindow2, event: 'onafterprint' | 'onbeforeprint' | 'onbeforeunload' | 'onblur' | 'onfocus' | 'onhelp' | 'onload' | 'onresize' | 'onscroll' | 'onunload', handler: (this: MSHTML.HTMLWindow2, parameter: {}) => void): void; + on(obj: MSHTML.HTMLWindowProxy, event: 'onafterprint' | 'onbeforeprint' | 'onbeforeunload' | 'onblur' | 'onfocus' | 'onhelp' | 'onload' | 'onresize' | 'onscroll' | 'onunload', handler: (this: MSHTML.HTMLWindowProxy, parameter: {}) => void): void; + on(obj: MSHTML.HTMLWndOptionElement, 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.HTMLWndOptionElement, parameter: {}) => void): void; + on(obj: MSHTML.HTMLWndSelectElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onchange' | '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.HTMLWndSelectElement, parameter: {}) => void): void; on(obj: MSHTML.HTMLXMLHttpRequest, event: 'onreadystatechange' | 'ontimeout', handler: (this: MSHTML.HTMLXMLHttpRequest, parameter: {}) => void): void; - on( - obj: MSHTML.OldHTMLDocument, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforeupdate' | - 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | - 'ondragstart' | 'onerrorupdate' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onmousedown' | 'onmousemove' | 'onmouseout' | - 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onpropertychange' | 'onreadystatechange' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | - 'onselectionchange' | 'onselectstart' | 'onstop', - handler: (this: MSHTML.OldHTMLDocument, parameter: {}) => void): void; - on( - obj: MSHTML.OldHTMLFormElement, 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' | 'onreset' | 'onresize' | - 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart' | 'onsubmit', - handler: (this: MSHTML.OldHTMLFormElement, parameter: {}) => void): void; - on( - obj: MSHTML.Scriptlet, event: 'onclick' | 'ondblclick' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onmousedown' | 'onmousemove' | 'onmouseup' | - 'onreadystatechange', - handler: (this: MSHTML.Scriptlet, parameter: {}) => void): void; - on( - obj: MSHTML.SVGAElement, 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.SVGAElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGCircleElement, 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.SVGCircleElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGClipPathElement, 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.SVGClipPathElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGDefsElement, 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.SVGDefsElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGElement, 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.SVGElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGEllipseElement, 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.SVGEllipseElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGGElement, 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.SVGGElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGGradientElement, 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.SVGGradientElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGImageElement, 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.SVGImageElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGLineElement, 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.SVGLineElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGMarkerElement, 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.SVGMarkerElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGMaskElement, 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.SVGMaskElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGPathElement, 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.SVGPathElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGPatternElement, 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.SVGPatternElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGPolygonElement, 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.SVGPolygonElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGPolylineElement, 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.SVGPolylineElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGRectElement, 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.SVGRectElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGScriptElement, 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.SVGScriptElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGStopElement, 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.SVGStopElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGSVGElement, 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.SVGSVGElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGSymbolElement, 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.SVGSymbolElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGTextElement, 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.SVGTextElement, parameter: {}) => void): void; - on( - obj: MSHTML.SVGTextPathElement, 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.SVGTextPathElement, parameter: {}) => void): void; - 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; + on(obj: MSHTML.OldHTMLDocument, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforeupdate' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondragstart' | 'onerrorupdate' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onmousedown' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onpropertychange' | 'onreadystatechange' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onselectionchange' | 'onselectstart' | 'onstop', handler: (this: MSHTML.OldHTMLDocument, parameter: {}) => void): void; + on(obj: MSHTML.OldHTMLFormElement, 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' | 'onreset' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart' | 'onsubmit', handler: (this: MSHTML.OldHTMLFormElement, parameter: {}) => void): void; + on(obj: MSHTML.Scriptlet, event: 'onclick' | 'ondblclick' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onmousedown' | 'onmousemove' | 'onmouseup' | 'onreadystatechange', handler: (this: MSHTML.Scriptlet, parameter: {}) => void): void; + on(obj: MSHTML.SVGAElement, 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.SVGAElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGCircleElement, 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.SVGCircleElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGClipPathElement, 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.SVGClipPathElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGDefsElement, 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.SVGDefsElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGElement, 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.SVGElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGEllipseElement, 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.SVGEllipseElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGGElement, 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.SVGGElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGGradientElement, 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.SVGGradientElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGImageElement, 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.SVGImageElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGLineElement, 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.SVGLineElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGMarkerElement, 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.SVGMarkerElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGMaskElement, 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.SVGMaskElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGPathElement, 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.SVGPathElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGPatternElement, 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.SVGPatternElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGPolygonElement, 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.SVGPolygonElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGPolylineElement, 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.SVGPolylineElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGRectElement, 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.SVGRectElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGScriptElement, 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.SVGScriptElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGStopElement, 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.SVGStopElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGSVGElement, 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.SVGSVGElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGSymbolElement, 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.SVGSymbolElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGTextElement, 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.SVGTextElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGTextPathElement, 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.SVGTextPathElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGTSpanElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGTSpanElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGUseElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGUseElement, parameter: {}) => void): void; + on(obj: MSHTML.SVGViewElement, event: 'onactivate' | 'onafterupdate' | 'onbeforeactivate' | 'onbeforecopy' | 'onbeforecut' | 'onbeforedeactivate' | 'onbeforeeditfocus' | 'onbeforepaste' | 'onbeforeupdate' | 'onblur' | 'oncellchange' | 'onclick' | 'oncontextmenu' | 'oncontrolselect' | 'oncopy' | 'oncut' | 'ondataavailable' | 'ondatasetchanged' | 'ondatasetcomplete' | 'ondblclick' | 'ondeactivate' | 'ondrag' | 'ondragend' | 'ondragenter' | 'ondragleave' | 'ondragover' | 'ondragstart' | 'ondrop' | 'onerrorupdate' | 'onfilterchange' | 'onfocus' | 'onfocusin' | 'onfocusout' | 'onhelp' | 'onkeydown' | 'onkeypress' | 'onkeyup' | 'onlayoutcomplete' | 'onlosecapture' | 'onmousedown' | 'onmouseenter' | 'onmouseleave' | 'onmousemove' | 'onmouseout' | 'onmouseover' | 'onmouseup' | 'onmousewheel' | 'onmove' | 'onmoveend' | 'onmovestart' | 'onpage' | 'onpaste' | 'onpropertychange' | 'onreadystatechange' | 'onresize' | 'onresizeend' | 'onresizestart' | 'onrowenter' | 'onrowexit' | 'onrowsdelete' | 'onrowsinserted' | 'onscroll' | 'onselectstart', handler: (this: MSHTML.SVGViewElement, parameter: {}) => void): void; new(progid: K): ActiveXObjectNameMap[K]; } @@ -36494,7 +35578,3 @@ interface ActiveXObjectNameMap { 'ScriptBridge.ScriptBridge': MSHTML.Scriptlet; 'TemplatePrinter.TemplatePrinter': MSHTML.CTemplatePrinter; } - -interface SafeArray { - _brand: SafeArray; -} diff --git a/types/activex-mshtml/tslint.json b/types/activex-mshtml/tslint.json index 3224b40b8b..916af93888 100644 --- a/types/activex-mshtml/tslint.json +++ b/types/activex-mshtml/tslint.json @@ -1,6 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - "no-const-enum": false + "no-const-enum": false, + "max-line-length": false } } From 08f61aa8131bdd2e888121671228f28aa764be41 Mon Sep 17 00:00:00 2001 From: Niklas Wulf Date: Wed, 25 Apr 2018 20:54:06 +0200 Subject: [PATCH 105/564] [accept-language-parser] add PickOptions (#25289) --- .../accept-language-parser-tests.ts | 8 +++++++- types/accept-language-parser/index.d.ts | 12 ++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/types/accept-language-parser/accept-language-parser-tests.ts b/types/accept-language-parser/accept-language-parser-tests.ts index b137df02e4..586a31cb93 100644 --- a/types/accept-language-parser/accept-language-parser-tests.ts +++ b/types/accept-language-parser/accept-language-parser-tests.ts @@ -1,4 +1,4 @@ -// https://github.com/opentable/accept-language-parser/blob/v1.4.1/index.js +// https://github.com/opentable/accept-language-parser/blob/v1.5.0/index.js import * as AcceptLanguageParser from 'accept-language-parser'; @@ -23,3 +23,9 @@ const l3: AcceptLanguageParser.Language = { const parsed1: AcceptLanguageParser.Language[] = AcceptLanguageParser.parse(''); const pick1: string | null = AcceptLanguageParser.pick([''], ''); const pick2: string | null = AcceptLanguageParser.pick([''], [l1, l2, l3]); +const pick3: string | null = AcceptLanguageParser.pick([''], '', {}); +const pick4: string | null = AcceptLanguageParser.pick([''], '', { loose: true }); + +const pickOptions: AcceptLanguageParser.PickOptions = { + loose: true +}; diff --git a/types/accept-language-parser/index.d.ts b/types/accept-language-parser/index.d.ts index 16d003648c..c47969c940 100644 --- a/types/accept-language-parser/index.d.ts +++ b/types/accept-language-parser/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for accept-language-parser 1.4 +// Type definitions for accept-language-parser 1.5 // Project: https://github.com/opentable/accept-language-parser // Definitions by: Niklas Wulf // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -7,7 +7,11 @@ // https://github.com/opentable/accept-language-parser/blob/v1.4.1/index.js export function parse(acceptLanguage: string): Language[]; -export function pick(supportedLanguages: string[], acceptLanguage: string | Language[]): string | null; +export function pick( + supportedLanguages: string[], + acceptLanguage: string | Language[], + options?: PickOptions +): string | null; export interface Language { code: string; @@ -15,3 +19,7 @@ export interface Language { region?: string; quality: number; } + +export interface PickOptions { + loose?: boolean; +} From b3ce091e34e0a9330908b46d2583317e9858db02 Mon Sep 17 00:00:00 2001 From: Jan Lohage Date: Wed, 25 Apr 2018 20:54:53 +0200 Subject: [PATCH 106/564] Update index.d.ts (#25283) --- types/feathersjs__feathers/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/feathersjs__feathers/index.d.ts b/types/feathersjs__feathers/index.d.ts index c0fa3d9946..b3a0f60667 100644 --- a/types/feathersjs__feathers/index.d.ts +++ b/types/feathersjs__feathers/index.d.ts @@ -45,9 +45,9 @@ export interface Paginated { } // tslint:disable-next-line void-return -export type Hook = (hook: HookContext) => (Promise> | void); +export type Hook = (hook: HookContext) => (Promise | void); -export interface HookContext { +export interface HookContext { app?: Application; data?: T; error?: any; From e81f217c018e6132d099cbd189431250124aa7d8 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Wed, 25 Apr 2018 20:55:08 +0200 Subject: [PATCH 107/564] Add NavigationContainerComponent (#25270) --- types/react-navigation/index.d.ts | 10 ++++++++- .../react-navigation-tests.tsx | 22 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index d3f288c217..a054ecf4d0 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -600,9 +600,17 @@ export interface NavigationContainerProps { style?: StyleProp; } +export interface NavigationContainerComponent extends React.Component< + NavigationContainerProps & NavigationNavigatorProps + > { + dispatch: NavigationDispatch; +} + export interface NavigationContainer extends React.ComponentClass< NavigationContainerProps & NavigationNavigatorProps -> { + > { + new(props: NavigationContainerProps & NavigationNavigatorProps, context?: any): NavigationContainerComponent; + router: NavigationRouter; screenProps: { [key: string]: any }; navigationOptions: any; diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 15ad2a62f5..fb6e72a623 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -33,10 +33,12 @@ import { addNavigationHelpers, HeaderBackButton, Header, + NavigationContainer, NavigationParams, NavigationPopAction, NavigationPopToTopAction, NavigationScreenComponent, + NavigationContainerComponent, } from 'react-navigation'; // Constants @@ -422,3 +424,23 @@ const popToTopAction: NavigationPopToTopAction = NavigationActions.popToTop({ key: "foo", immediate: true }); + +class Page1 extends React.Component { } + +const RootNavigator: NavigationContainer = SwitchNavigator({ + default: { getScreen: () => Page1 }, +}); + +class Page2 extends React.Component { + navigatorRef: NavigationContainerComponent | null; + + componentDidMount() { + if (this.navigatorRef) { + this.navigatorRef.dispatch(NavigationActions.navigate({ routeName: 'default' })); + } + } + + render() { + return { this.navigatorRef = instance; }} />; + } +} From 69fb65bf61c8431d89febe21b7eb3f8f6cba6d05 Mon Sep 17 00:00:00 2001 From: Matt Terski Date: Wed, 25 Apr 2018 13:55:21 -0500 Subject: [PATCH 108/564] Add S3's serverSideEncryption option (#25262) --- types/multer-s3/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/multer-s3/index.d.ts b/types/multer-s3/index.d.ts index a03e6ae36e..570dc3c85e 100644 --- a/types/multer-s3/index.d.ts +++ b/types/multer-s3/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/badunk/multer-s3 // Definitions by: KIM Jaesuck a.k.a. gim tcaesvk // Gal Talmor +// Matt Terski // Definitions: https://github.com/DefinitelyType/DefinitelyTyped // TypeScript Version: 2.2 @@ -16,6 +17,7 @@ interface Options { contentType?(req: Express.Request, file: Express.Multer.File, callback: (error: any, mime?: string, stream?: NodeJS.ReadableStream) => void): void; metadata?(req: Express.Request, file: Express.Multer.File, callback: (error: any, metadata?: any) => void): void; cacheControl?: ((req: Express.Request, file: Express.Multer.File, callback: (error: any, cacheControl?: string) => void) => void) | string; + serverSideEncryption?: ((req: Express.Request, file: Express.Multer.File, callback: (error: any, serverSideEncryption?: string) => void) => void) | string; } declare global { From e9b73ce6db31e159ea0782ad1d2af530d24c51c9 Mon Sep 17 00:00:00 2001 From: JB Nizet Date: Wed, 25 Apr 2018 20:55:37 +0200 Subject: [PATCH 109/564] luxon: add changes introduced in versions 1.1.0 (#25237) --- types/luxon/index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/luxon/index.d.ts b/types/luxon/index.d.ts index c3b9d2a029..d90ba90b13 100644 --- a/types/luxon/index.d.ts +++ b/types/luxon/index.d.ts @@ -175,6 +175,7 @@ declare module 'luxon' { weekday: number; weekdayLong: string; weekdayShort: string; + weeksInWeekYear: number; year: number; zoneName: string; diff( From 9c7cdc97e576393b2f6ab4a62362dd8cb047c320 Mon Sep 17 00:00:00 2001 From: Armin Pfurtscheller Date: Wed, 25 Apr 2018 20:56:00 +0200 Subject: [PATCH 110/564] Added types/wampy v6.x.x (#25265) --- types/wampy/index.d.ts | 298 +++++++++++++++++++++++-------------- types/wampy/wampy-tests.ts | 63 +++++--- 2 files changed, 232 insertions(+), 129 deletions(-) diff --git a/types/wampy/index.d.ts b/types/wampy/index.d.ts index 276a1a2f00..71ca538eac 100644 --- a/types/wampy/index.d.ts +++ b/types/wampy/index.d.ts @@ -1,115 +1,195 @@ -// Type definitions for wampy.js v3.0.x +// Type definitions for wampy.js v6.x.x // Project: https://github.com/KSDaemon/wampy.js // Definitions by: Konstantin Burkalev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 -interface WampyOptions -{ - autoReconnect?: boolean; - reconnectInterval?: number; - maxRetries?: number; - realm?: string; - helloCustomDetails?: any; - onChallenge?: (auth_method: string, challenge_details: string) => string; - authid?: string; - onConnect?: () => void; - onClose?: () => void; - onError?: () => void; - onReconnect?: () => void; - onReconnectSuccess?: () => void; - ws?: any; - serializer?: any; +declare namespace wampy { + + type Dict = {[key: string]: any}; + + type Callback = () => void; + + type ErrorCallback = (args: ErrorArgs) => void; + + type EventCallback = (args: DataArgs) => void; + + type SuccessCallback = (args: DataArgs) => void; + + type RPCCallback = (args: DataArgs) => RPCResult | void; + + type ChallengeCallback = (auth_method: string, extra: Dict) => string; + + type Payload = Args | Dict | string | number | boolean | any[] | null; + + interface Args + { + argsList: any[]; + argsDict: Dict; + } + + interface ErrorArgs + { + error: string; + details: Dict; + } + + interface DataArgs extends Args + { + details: Dict; + } + + interface RPCOptions + { + process?: boolean; + } + + interface RPCResult extends Args + { + options: RPCOptions; + } + + interface SubscribeCallbacksHash + { + onSuccess?: Callback; + onError?: ErrorCallback; + onEvent?: EventCallback; + } + + interface UnsubscibeCallbacksHash extends SubscribeCallbacksHash + { + + } + + interface PublishCallbacksHash + { + onSuccess?: Callback; + onError?: ErrorCallback; + } + + interface CallCallbacksHash + { + onSuccess?: SuccessCallback; + onError?: ErrorCallback; + } + + interface CancelCallbacksHash + { + onSuccess?: Callback; + onError?: Callback; + } + + interface RegisterCallbacksHash + { + rpc: RPCCallback; + onSuccess?: Callback; + onError?: ErrorCallback; + } + + interface UnregisterCallbacksHash + { + onSuccess?: Callback; + onError?: ErrorCallback; + } + + interface AdvancedOptions + { + exclude?: number | number[]; + eligible?: number | number[]; + exclude_me?: boolean; + disclose_me?: boolean; + } + + interface PublishAdvancedOptions extends AdvancedOptions + { + exclude_authid?: string | string[]; + exclude_authrole?: string | string[]; + eligible_authid?: string | string[]; + eligible_authrole?: string | string[]; + } + + interface CallAdvancedOptions + { + disclose_me?: boolean; + receive_progress?: boolean; + timeout?: number; + } + + interface CancelAdvancedOptions + { + mode?: "skip" | "kill" | "killnowait"; + } + + interface RegisterAdvancedOptions + { + match?: "prefix" | "wildcard" + invoke?: "single" | "roundrobin" | "random" | "first" | "last" + } + + interface WampyOptions + { + autoReconnect?: boolean; + reconnectInterval?: number; + maxRetries?: number; + realm?: string; + helloCustomDetails?: any; + authid?: string; + authmethods?: string[]; + onChallenge?: ChallengeCallback; + onConnect?: Callback; + onClose?: Callback; + onError?: Callback; + onReconnect?: Callback; + onReconnectSuccess?: Callback; + ws?: any; + serializer?: any; + } + + interface WampyOpStatus + { + code: number; + description: string; + reqId?: number; + } + + interface WampyStatic + { + new (options?: WampyOptions): Wampy; + new (url: string, options?: WampyOptions): Wampy; + } + + interface Wampy + { + constructor: WampyStatic; + options(opts?: WampyOptions): WampyOptions | Wampy; + getOpStatus(): WampyOpStatus; + getSessionId(): number; + connect(url?: string): Wampy; + disconnect(): Wampy; + abort(): Wampy; + subscribe(topicURI: string, + callbacks: EventCallback | SubscribeCallbacksHash): Wampy; + unsubscribe(topicURI: string, + callbacks?: EventCallback | UnsubscibeCallbacksHash): Wampy; + publish(topicURI: string, + payload?: Payload, + callbacks?: PublishCallbacksHash, + advancedOptions?: PublishAdvancedOptions): Wampy; + call(topicURI: string, + payload?: Payload, + callbacks?: SuccessCallback | CallCallbacksHash, + advancedOptions?: CallAdvancedOptions): Wampy; + cancel(reqId: number, + callbacks?: Callback | CancelCallbacksHash, + advancedOptions?: CancelAdvancedOptions): Wampy; + register(topicURI: string, + callbacks: RPCCallback | RegisterCallbacksHash, + avdancedOptions?: RegisterAdvancedOptions): Wampy; + unregister(topicURI: string, + callbacks?: Callback | UnregisterCallbacksHash): Wampy; + } } -interface WampyOpStatus -{ - code: number; - description: string; - reqId?: number; -} - -interface SuccessErrorCallbacksHash -{ - onSuccess?: (args: any[], kwargs: any) => void; - onError?: (err: string, details: any) => void; -} - -interface SubscribeCallbacksHash extends SuccessErrorCallbacksHash -{ - onEvent: (args: any[], kwargs: any) => void; -} - -interface RegisterCallbacksHash extends SuccessErrorCallbacksHash -{ - rpc: (args: any[], kwargs: any, options: any) => any[]; -} - -interface CallSuccessErrorCallbacksHash -{ - onSuccess: (args: any[], kwargs: any) => any; - onError?: (err: string, details: any, args: any[], kwargs: any) => void; -} - -interface AdvancedOptions -{ - exclude?: number | number[]; - eligible?: number | number[]; - exclude_me?: boolean; - disclose_me?: boolean; -} - -interface PublishAdvancedOptions extends AdvancedOptions -{ - exclude_authid?: string | string[]; - exclude_authrole?: string | string[]; - eligible_authid?: string | string[]; - eligible_authrole?: string | string[]; -} - -interface CallAdvancedOptions -{ - disclose_me?: boolean; - receive_progress?: boolean; - timeout?: number; -} - -interface CancelAdvancedOptions -{ - mode?: "skip" | "kill" | "killnowait"; -} - -interface Wampy -{ - new (url?: string, options?: WampyOptions): Wampy; - options(opts?: WampyOptions): WampyOptions | Wampy; - getOpStatus(): WampyOpStatus; - getSessionId(): number; - connect(url?: string): Wampy; - disconnect(): Wampy; - abort(): Wampy; - subscribe(topicURI: string, callbacks: (((args: any[], kwargs: any) => void) | SubscribeCallbacksHash)): Wampy; - unsubscribe(topicURI: string, callbacks?: (((args: any[], kwargs: any) => void) | SubscribeCallbacksHash)): Wampy; - publish(topicURI: string, - payload?: any, - callbacks?: SuccessErrorCallbacksHash, - advancedOptions?: PublishAdvancedOptions): Wampy; - call(topicURI: string, - payload?: any, - callbacks?: (((args: any[], kwargs: any) => void) | CallSuccessErrorCallbacksHash), - advancedOptions?: CallAdvancedOptions): Wampy; - cancel(reqId: number, - callbacks?: ((() => void) | SuccessErrorCallbacksHash), - advancedOptions?: CancelAdvancedOptions): Wampy; - register(topicURI: string, callbacks: (((args: any[], kwargs: any, options: any) => any[]) | RegisterCallbacksHash)): Wampy; - unregister(topicURI: string, callbacks?: ((() => void) | SuccessErrorCallbacksHash)): Wampy; -} - -declare var wampy: Wampy; - -declare module 'wampy' -{ - export = wampy; -} - - - +declare const wampy: wampy.WampyStatic; +export as namespace wampy; +export = wampy; diff --git a/types/wampy/wampy-tests.ts b/types/wampy/wampy-tests.ts index 1d999fc7c6..cf06c98aef 100644 --- a/types/wampy/wampy-tests.ts +++ b/types/wampy/wampy-tests.ts @@ -1,4 +1,12 @@ import Wampy = require('wampy'); +import { + DataArgs, + ErrorArgs, + RPCResult, + RPCOptions, + RPCCallback, + WampyOpStatus +} from 'wampy'; declare var console: { log(...args: any[]): void }; let ws = new Wampy('http://wamp.router.url', {realm: 'WAMPRealm'}); @@ -24,11 +32,11 @@ let id: number = ws.getSessionId(); ws.disconnect(); ws.abort(); -ws.subscribe('system.monitor.update', (args: any[], kwargs: any) => +ws.subscribe('system.monitor.update', (args: DataArgs) => { console.log('Received system.monitor.update event!'); }) - .subscribe('client.message', function (args: any[], kwargs: any) + .subscribe('client.message', function (args: DataArgs) { console.log('Received client.message event!'); }); @@ -40,14 +48,14 @@ ws.unsubscribe('subscribed.topic', f1); ws.unsubscribe('chat.message.received'); ws.call('get.server.time', null, { - onSuccess: (args: any[], kwargs: any) => + onSuccess: (args: DataArgs) => { console.log('RPC successfully called'); - console.log('Server time is ' + kwargs); + console.log('Server time is ' + args.argsDict); }, - onError: (err: string, details: any, args: any[], kwargs: any) => + onError: (args: ErrorArgs) => { - console.log('RPC call failed with error ' + err); + console.log('RPC call failed with error ' + args.error); } }); @@ -63,44 +71,59 @@ ws.publish('user.modified', {field1: 'field1', field2: true, field3: 123}, { }); ws.publish('user.modified', {field1: 'field1', field2: true, field3: 123}, { onSuccess: () => console.log('User successfully modified'), - onError: (err: string, details: any) => console.log('User modification failed', err) + onError: (args: ErrorArgs) => console.log('User modification failed', args.error) }); ws.publish('chat.message.received', ['Private message'], null, {eligible: 123456789}); +ws.publish('user.logged.in', { argsList: [1,2,3], argsDict: {first: 1, second:2, third: 3}}); -ws.call('server.time', null, (args: any[], kwargs: any) => console.log('Server time is ' + args[0])); +ws.call('server.time', null, (args: DataArgs) => console.log('Server time is ' + args.argsList[0])); +ws.call('server.time', null, (args: DataArgs) => console.log('Server time is ' + args.argsDict.serverTime)); ws.call('start.migration', null, { - onSuccess: (args: any[], kwargs: any) => console.log('RPC successfully called'), - onError: (err: string, details: any, args: any[], kwargs: any) => console.log('RPC call failed!', err) + onSuccess: (args: DataArgs) => console.log('RPC successfully called'), + onError: (args: ErrorArgs) => console.log('RPC call failed!', args.error) }); ws.call('restore.backup', {backupFile: 'backup.zip'}, { - onSuccess: (args: any[], kwargs: any) => console.log('Backup successfully restored'), - onError: (err: string, details: any, args: any[], kwargs: any) => console.log('Restore failed!', err) + onSuccess: (args: DataArgs) => console.log('Backup successfully restored'), + onError: (args: ErrorArgs) => console.log('Restore failed!', args.error) }); ws.call('start.migration', null, { - onSuccess: (args: any[], kwargs: any) => console.log('RPC successfully called'), - onError: (err: string, details: any, args: any[], kwargs: any) => console.log('RPC call failed!', err) + onSuccess: (args: DataArgs) => console.log('RPC successfully called'), + onError: (args: ErrorArgs) => console.log('RPC call failed!', args.error) }); -let status = ws.getOpStatus(); +let status: WampyOpStatus = ws.getOpStatus(); ws.cancel(status.reqId); -let sqrt_f = (args: any[], kwargs: any, options: any) => [{}, kwargs * kwargs]; +let options: RPCOptions = { process: true }; + +let sqrt_f: RPCCallback = (args: DataArgs): RPCResult => { + let result = args.argsList[0] * args.argsList[0]; + if (result === 0) { + return; + } + + return { + options, + argsList: [result], + argsDict: { result } + } +}; ws.register('sqrt.value', sqrt_f); ws.register('sqrt.value', { rpc: sqrt_f, - onSuccess: (args: any[], kwargs: any) => console.log('RPC successfully registered'), - onError: (err: string, details: any) => console.log('RPC registration failed!', err) + onSuccess: () => console.log('RPC successfully registered'), + onError: (args: ErrorArgs) => console.log('RPC registration failed!', args.error) }); ws.unregister('sqrt.value'); ws.unregister('sqrt.value', { - onSuccess: (data: any) => console.log('RPC successfully unregistered'), - onError: (err: string, details: any) => console.log('RPC unregistration failed!', err) + onSuccess: () => console.log('RPC successfully unregistered'), + onError: (args: ErrorArgs) => console.log('RPC unregistration failed!', args.error) }); From f659a6fb160cc3aa8ea6457c27b279b802e78a6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Simon=20Maria=20M=C3=B6llers?= Date: Wed, 25 Apr 2018 20:57:10 +0200 Subject: [PATCH 111/564] [whatwg-streams] Make classes generic, add transform streams (#25292) * [whatwg-streams] Make stream classes generic * [whatwg-streams] Add transform streams * [whatwg-streams] Add ksm2 to authors --- types/whatwg-streams/index.d.ts | 132 +++++++++++-------- types/whatwg-streams/whatwg-streams-tests.ts | 65 ++++++++- 2 files changed, 141 insertions(+), 56 deletions(-) diff --git a/types/whatwg-streams/index.d.ts b/types/whatwg-streams/index.d.ts index 02ad2c5152..accc08276c 100644 --- a/types/whatwg-streams/index.d.ts +++ b/types/whatwg-streams/index.d.ts @@ -1,25 +1,27 @@ // Type definitions for Streams API // Project: https://github.com/whatwg/streams // Definitions by: Kagami Sascha Rosylight +// Konstantin Simon Maria Möllers // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 -export interface ReadableStreamSource { - start?(controller: ReadableStreamDefaultController): void | Promise; - pull?(controller: ReadableStreamDefaultController): void | Promise; +export interface ReadableStreamSource { + start?(controller: ReadableStreamDefaultController): void | Promise; + pull?(controller: ReadableStreamDefaultController): void | Promise; cancel?(reason: string): void | Promise; } -export interface ReadableByteStreamSource { - start?(controller: ReadableByteStreamController): void | Promise; - pull?(controller: ReadableByteStreamController): void | Promise; +export interface ReadableByteStreamSource { + start?(controller: ReadableByteStreamController): void | Promise; + pull?(controller: ReadableByteStreamController): void | Promise; cancel?(reason: string): void | Promise; type: "bytes"; autoAllocateChunkSize?: number; } -export interface QueuingStrategy { - size?(chunk: ArrayBufferView): number; +export interface QueuingStrategy { + size?(chunk: T): number; highWaterMark?: number; } @@ -29,88 +31,93 @@ export interface PipeOptions { preventCancel?: boolean; } -declare class ReadableStream { - constructor(underlyingSource?: ReadableStreamSource, strategy?: QueuingStrategy); - constructor(underlyingSource?: ReadableByteStreamSource, strategy?: QueuingStrategy); +export interface WritableReadablePair, U extends ReadableStream> { + writable: T; + readable: U; +} + +declare class ReadableStream { + constructor(underlyingSource?: ReadableStreamSource, strategy?: QueuingStrategy); + constructor(underlyingSource?: ReadableByteStreamSource, strategy?: QueuingStrategy); locked: boolean; cancel(reason: string): Promise; - getReader(): ReadableStreamDefaultReader; - getReader({ mode }: { mode: "byob" }): ReadableStreamBYOBReader; - pipeThrough({ writable, readable }: { writable: WritableStream, readable: T }, options?: PipeOptions): T; + getReader(): ReadableStreamDefaultReader; + getReader({ mode }: { mode: "byob" }): ReadableStreamBYOBReader; + pipeThrough>({ writable, readable }: WritableReadablePair, T>, options?: PipeOptions): T; pipeTo(dest: WritableStream, options?: PipeOptions): Promise; - tee(): [ReadableStream, ReadableStream]; + tee(): [ReadableStream, ReadableStream]; } -declare class ReadableStreamDefaultReader { +declare class ReadableStreamDefaultReader { + constructor(stream: ReadableStream); + + closed: Promise; + + cancel(reason: string): Promise; + read(): Promise>; + releaseLock(): void; +} + +declare class ReadableStreamBYOBReader { constructor(stream: ReadableStream); closed: Promise; cancel(reason: string): Promise; - read(): Promise>; + read(view: R): Promise>; releaseLock(): void; } -declare class ReadableStreamBYOBReader { - constructor(stream: ReadableStream); - - closed: Promise; - - cancel(reason: string): Promise; - read(view: ArrayBufferView): Promise>; - releaseLock(): void; -} - -declare class ReadableStreamDefaultController { - constructor(stream: ReadableStream, underlyingSource: ReadableStreamSource, size: number, highWaterMark: number); +declare class ReadableStreamDefaultController { + constructor(stream: ReadableStream, underlyingSource: ReadableStreamSource, size: number, highWaterMark: number); desiredSize: number; close(): void; - enqueue(chunk: ArrayBufferView): number; + enqueue(chunk: R): number; error(e: any): void; } -declare class ReadableByteStreamController { - constructor(stream: ReadableStream, underlyingSource: ReadableStreamSource, highWaterMark: number); +declare class ReadableByteStreamController { + constructor(stream: ReadableStream, underlyingSource: ReadableStreamSource, highWaterMark: number); - byobRequest: ReadableStreamBYOBRequest; + byobRequest: ReadableStreamBYOBRequest; desiredSize: number; close(): void; - enqueue(chunk: ArrayBufferView): number; + enqueue(chunk: R): number; error(e: any): void; } -declare class ReadableStreamBYOBRequest { - constructor(controller: ReadableByteStreamController, view: ArrayBufferView); +declare class ReadableStreamBYOBRequest { + constructor(controller: ReadableByteStreamController, view: R); - view: ArrayBufferView; + view: R; respond(bytesWritten: number): void; - respondWithNewView(view: ArrayBufferView): void; + respondWithNewView(view: R): void; } -interface WritableStreamSink { - start?(controller: WritableStreamDefaultController): void | Promise; - write?(chunk: any, controller?: WritableStreamDefaultController): any; - close?(controller: WritableStreamDefaultController): void | Promise; +interface WritableStreamSink { + start?(controller: WritableStreamDefaultController): void | Promise; + write?(chunk: W, controller?: WritableStreamDefaultController): any; + close?(controller: WritableStreamDefaultController): void | Promise; abort?(reason: string): void | Promise; } -declare class WritableStream { - constructor(underlyingSink?: WritableStreamSink, strategy?: QueuingStrategy); +declare class WritableStream { + constructor(underlyingSink?: WritableStreamSink, strategy?: QueuingStrategy); locked: boolean; abort(reason: string): Promise; - getWriter(): WritableStreamDefaultWriter; + getWriter(): WritableStreamDefaultWriter; } -declare class WritableStreamDefaultWriter { - constructor(stream: WritableStream); +declare class WritableStreamDefaultWriter { + constructor(stream: WritableStream); closed: Promise; desiredSize: number | null; @@ -119,19 +126,19 @@ declare class WritableStreamDefaultWriter { abort(reason: string): Promise; close(): Promise; releaseLock(): void; - write(chunk: any): Promise; + write(chunk: W): Promise; } -declare class WritableStreamDefaultController { - constructor(stream: WritableStream, underlyingSink: WritableStreamSink, size: number, highWaterMark: number); +declare class WritableStreamDefaultController { + constructor(stream: WritableStream, underlyingSink: WritableStreamSink, size: number, highWaterMark: number); error(e: any): void; } -declare class ByteLengthQueuingStrategy { +declare class ByteLengthQueuingStrategy { constructor({ highWaterMark }: { highWaterMark: number }); - size(chunk: ArrayBufferView): number | undefined; + size(chunk: T): number | undefined; } declare class CountQueuingStrategy { @@ -139,3 +146,24 @@ declare class CountQueuingStrategy { size(): 1; } + +declare interface TransformStreamTransformer { + start?(controller: TransformStreamDefaultController): void | Promise; + transform?(chunk: R, controller: TransformStreamDefaultController): void | Promise; + flush?(controller: TransformStreamDefaultController): void | Promise; +} + +declare class TransformStream implements WritableReadablePair, ReadableStream> { + constructor(transformer?: TransformStreamTransformer, writableStrategy?: QueuingStrategy, readableStrategy?: QueuingStrategy); + + readonly readable: ReadableStream; + readonly writable: WritableStream; +} + +declare class TransformStreamDefaultController { + enqueue(chunk: W): void; + error(reason: any): void; + terminate(): void; + + readonly desiredSize: number; +} diff --git a/types/whatwg-streams/whatwg-streams-tests.ts b/types/whatwg-streams/whatwg-streams-tests.ts index 9456ff2983..141f47c820 100644 --- a/types/whatwg-streams/whatwg-streams-tests.ts +++ b/types/whatwg-streams/whatwg-streams-tests.ts @@ -2,7 +2,8 @@ import { ReadableStream, ReadableStreamSource, WritableStream, - ReadableStreamDefaultController, WritableStreamSink, WritableStreamDefaultController, ReadableByteStreamController + ReadableStreamDefaultController, WritableStreamSink, WritableStreamDefaultController, ReadableByteStreamController, + TransformStream, TransformStreamDefaultController, TransformStreamTransformer } from "whatwg-streams"; // Examples taken from https://streams.spec.whatwg.org/#creating-examples @@ -127,7 +128,7 @@ function makeUDPSocketStream(host: string, port: number) { interface fs { open(path: string | Buffer, flags: string | number): Promise; read(fd: number, buffer: Buffer, offset: number, length: number, position: number): Promise; - write(fd: number, buffer: Buffer, offset: number, length: number): Promise; + write(fd: number, buffer: Buffer | string, offset: number, length: number): Promise; close(fd: number): Promise; } let fs: fs; @@ -251,7 +252,7 @@ function makeWritableWebSocketStream(url: string, protocols: string | string[]) function makeWritableFileStream(filename: string) { let fd: number; - return new WritableStream({ + return new WritableStream({ start() { return fs.open(filename, "w").then(result => { fd = result; @@ -290,7 +291,7 @@ function streamifyWebSocket(url: string, protocol: string) { return { readable: new ReadableStream(new WebSocketSource(ws)), - writable: new WritableStream(new WebSocketSink(ws)) + writable: new WritableStream(new WebSocketSink(ws)) }; } @@ -354,3 +355,59 @@ class WebSocketSink implements WritableStreamSink { console.log("The web socket says: ", value); }); } + + +// 8.9. A transform stream that replaces template tags + + +type Dictionary = { [key: string]: T } + +declare interface FetchEvent { + respondWith(promise: Promise): void; +} + +class LipFuzzTransformer implements TransformStreamTransformer { + substitutions: Dictionary; + partialChunk: string; + lastIndex: number | undefined; + + constructor(substitutions: Dictionary) { + this.substitutions = substitutions; + this.partialChunk = ""; + this.lastIndex = undefined; + } + + transform(chunk: string, controller: TransformStreamDefaultController) { + chunk = this.partialChunk + chunk; + this.partialChunk = ""; + // lastIndex is the index of the first character after the last substitution. + this.lastIndex = 0; + chunk = chunk.replace(/\{\{([a-zA-Z0-9_-]+)\}\}/g, this.replaceTag.bind(this)); + // Regular expression for an incomplete template at the end of a string. + const partialAtEndRegexp = /\{(\{([a-zA-Z0-9_-]+(\})?)?)?$/g; + // Avoid looking at any characters that have already been substituted. + partialAtEndRegexp.lastIndex = this.lastIndex; + this.lastIndex = undefined; + const match = partialAtEndRegexp.exec(chunk); + if (match) { + this.partialChunk = chunk.substring(match.index); + chunk = chunk.substring(0, match.index); + } + controller.enqueue(chunk); + } + + flush(controller: TransformStreamDefaultController) { + if (this.partialChunk.length > 0) { + controller.enqueue(this.partialChunk); + } + } + + replaceTag(match: string, p1: string, offset: number) { + let replacement = this.substitutions[p1]; + if (replacement === undefined) { + replacement = ""; + } + this.lastIndex = offset + replacement.length; + return replacement; + } +} From d54d8943e3e9165161f5a07f17fe3b59579d0071 Mon Sep 17 00:00:00 2001 From: Don Denton Date: Wed, 25 Apr 2018 13:59:01 -0500 Subject: [PATCH 112/564] (new definition) [qunit-dom] Add types (#25299) --- types/qunit-dom/index.d.ts | 281 +++++++++++++++++++++++++++++ types/qunit-dom/qunit-dom-tests.ts | 26 +++ types/qunit-dom/tsconfig.json | 23 +++ types/qunit-dom/tslint.json | 1 + 4 files changed, 331 insertions(+) create mode 100644 types/qunit-dom/index.d.ts create mode 100644 types/qunit-dom/qunit-dom-tests.ts create mode 100644 types/qunit-dom/tsconfig.json create mode 100644 types/qunit-dom/tslint.json diff --git a/types/qunit-dom/index.d.ts b/types/qunit-dom/index.d.ts new file mode 100644 index 0000000000..720634088d --- /dev/null +++ b/types/qunit-dom/index.d.ts @@ -0,0 +1,281 @@ +// Type definitions for qunit-dom 0.6 +// Project: https://github.com/simplabs/qunit-dom#readme +// Definitions by: Don Denton +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +/// + +declare namespace QUnitDom { + interface Options { + count?: number; + } + + interface Matchers { + /** + * Assert an `HTMLElement` (or multiple) matching the `selector` exists. + * + * + * @param options Documentation on options is sparse. It at least takes a `count` param, which confirms the number of elements that match your selector in the DOM. + * @param message + */ + exists(options?: Options, message?: string): void; + + /** + * Assert an `HTMLElement` matching the `selector` does not exists. + * + * + * @param message + */ + doesNotExist(message?: string): void; + + /** + * Assert that the `HTMLElement` or an `HTMLElement` matching the + * `selector` is currently checked. + * + * + * @param message + */ + isChecked(message?: string): void; + + /** + * Assert that the `HTMLElement` or an `HTMLElement` matching the + * `selector` is currently unchecked. + * + * + * @param message + */ + isNotChecked(message?: string): void; + + /** + * Assert that the `HTMLElement` or an `HTMLElement` matching the + * `selector` is currently focused. + * + * + * @param message + */ + isFocused(message?: string): void; + + /** + * Assert that the `HTMLElement` or an `HTMLElement` matching the + * `selector` is not currently focused. + * + * + * @param message + */ + isNotFocused(message?: string): void; + + /** + * Assert that the `HTMLElement` or an `HTMLElement` matching the + * `selector` is currently required. + * + * + * @param message + */ + isRequired(message?: string): void; + + /** + * Assert that the `HTMLElement` or an `HTMLElement` matching the + * `selector` is currently not required. + * + * + * @param message + */ + isNotRequired(message?: string): void; + + /** + * Assert that the `HTMLElement` or an `HTMLElement` matching the + * `selector` is visible.Visibility is determined with the hueristic + * used in [jQuery's :visible pseudo-selector](https://github.com/jquery/jquery/blob/2d4f53416e5f74fa98e0c1d66b6f3c285a12f0ce/src/css/hiddenVisibleSelectors.js#L12), + * specifically: + * + * - is the element's offsetWidth non-zero + * - is the element's offsetHeight non-zero + * - is the length of an element's DOMRect objects found via getClientRects() non-zero + * + * Additionally, visibility in this case means that the element is visible on the page, + * but not necessarily in the viewport. + * + * + * @param message + */ + isVisible(message?: string): void; + + /** + * Assert that the `HTMLElement` or an `HTMLElement` matching the + * `selector` is not visible.Visibility is determined with the hueristic + * used in [jQuery's :visible pseudo-selector](https://github.com/jquery/jquery/blob/2d4f53416e5f74fa98e0c1d66b6f3c285a12f0ce/src/css/hiddenVisibleSelectors.js#L12), + * specifically: + * + * - is the element's offsetWidth non-zero + * - is the element's offsetHeight non-zero + * - is the length of an element's DOMRect objects found via getClientRects() non-zero + * + * Additionally, visibility in this case means that the element is visible on the page, + * but not necessarily in the viewport. + * + * + * @param message + */ + isNotVisible(message?: string): void; + + /** + * Assert that the `HTMLElement` has an attribute with the provided `name` + * and optionally checks if the attribute `value` matches the provided text + * or regular expression. + * + * + * @param name + * @param value + * @param message + */ + hasAttribute(name: string, value: string | RegExp | object, message?: string): void; + + /** + * Assert that the `HTMLElement` or an `HTMLElement` matching the + * `selector` is disabled. + * + * + * @param message + */ + isDisabled(message?: string): void; + + /** + * Assert that the `HTMLElement` or an `HTMLElement` matching the + * `selector` is not disabled. + * + * + * @param message + */ + isNotDisabled(message?: string): void; + + /** + * Assert that the `HTMLElement` has no attribute with the provided `name`. + * + * @alias hasNoAttribute + * @alias lacksAttribute + * + * @param name + * @param message + */ + doesNotHaveAttribute(name: string, message?: string): void; + hasNoAttribute: Matchers['doesNotHaveAttribute']; + lacksAttribute: Matchers['doesNotHaveAttribute']; + + /** + * Assert that the `HTMLElement` has the `expected` CSS class using + * [`classList`](https://developer.mozilla.org/en-US/docs/Web/API/Element/classList). + * + * + * @param expected + * @param message + */ + hasClass(expected: string, message?: string): void; + + /** + * Assert that the `HTMLElement` does not have the `expected` CSS class using + * [`classList`](https://developer.mozilla.org/en-US/docs/Web/API/Element/classList). + * + * @alias hasNoClass + * @alias lacksClass + * + * @param expected + * @param message + */ + doesNotHaveClass(expected: string, message?: string): void; + hasNoClass: Matchers['doesNotHaveClass']; + lacksClass: Matchers['doesNotHaveClass']; + + /** + * Assert that the text of the `HTMLElement` or an `HTMLElement` + * matching the `selector` matches the `expected` text, using the + * [`textContent`](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent) + * attribute and stripping / collapsing whitespace. + * + * `expected` can also be a regular expression. + * + * @alias matchesText + * + * @param expected + * @param message + */ + hasText(expected: string | RegExp, message?: string): void; + matchesText: Matchers['hasText']; + + /** + * Assert that the `textContent` property of an `HTMLElement` is not empty. + * + * + * @param message + */ + hasAnyText(message?: string): void; + + /** + * Assert that the text of the `HTMLElement` or an `HTMLElement` + * matching the `selector` contains the given `text`, using the + * [`textContent`](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent) + * attribute. + * + * @alias containsText + * @alias hasTextContaining + * + * @param text + * @param message + */ + includesText(text: string, message?: string): void; + containsText: Matchers['includesText']; + hasTextContaining: Matchers['includesText']; + + /** + * Assert that the text of the `HTMLElement` or an `HTMLElement` + * matching the `selector` does not include the given `text`, using the + * [`textContent`](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent) + * attribute. + * + * @alias doesNotContainText + * @alias doesNotHaveTextContaining + * + * @param text + * @param message + */ + doesNotIncludeText(text: string, message?: string): void; + doesNotContainText: Matchers['doesNotIncludeText']; + doesNotHaveTextContaining: Matchers['doesNotIncludeText']; + + /** + * Assert that the `value` property of an `HTMLInputElement` matches + * the `expected` text or regular expression. + * + * If no `expected` value is provided, the assertion will fail if the + * `value` is an empty string. + * + * + * @param expected + * @param message + */ + hasValue(expected: string | RegExp | object, message?: string): void; + + /** + * Assert that the `value` property of an `HTMLInputElement` is not empty. + * + * + * @param message + */ + hasAnyValue(message?: string): void; + + /** + * Assert that the `value` property of an `HTMLInputElement` is empty. + * + * @alias lacksValue + * + * @param message + */ + hasNoValue(message?: string): void; + lacksValue: Matchers['hasNoValue']; + } +} + +// Extend QUnit's interface for Assert +interface Assert { + dom(selector?: string): QUnitDom.Matchers; +} diff --git a/types/qunit-dom/qunit-dom-tests.ts b/types/qunit-dom/qunit-dom-tests.ts new file mode 100644 index 0000000000..7604f385e1 --- /dev/null +++ b/types/qunit-dom/qunit-dom-tests.ts @@ -0,0 +1,26 @@ +QUnit.assert.dom('#title').exists(); +QUnit.assert.dom('#title').exists(); +QUnit.assert.dom('.choice').exists({ count: 4 }); +QUnit.assert.dom('.should-not-exist').doesNotExist(); +QUnit.assert.dom('input.active').isChecked(); +QUnit.assert.dom('input.active').isNotChecked(); +QUnit.assert.dom('input.email').isFocused(); +QUnit.assert.dom('input[type="password"]').isNotFocused(); +QUnit.assert.dom('input[type="text"]').isRequired(); +QUnit.assert.dom('input[type="text"]').isNotRequired(); +QUnit.assert.dom('.foo').isVisible(); +QUnit.assert.dom('.foo').isNotVisible(); +QUnit.assert.dom('input.password-input').hasAttribute('type', 'password'); +QUnit.assert.dom('.foo').isDisabled(); +QUnit.assert.dom('.foo').isNotDisabled(); +QUnit.assert.dom('input.username').hasNoAttribute('disabled'); +QUnit.assert.dom('input[type="password"]').hasClass('secret-password-input'); +QUnit.assert.dom('input[type="password"]').doesNotHaveClass('username-input'); +QUnit.assert.dom('#title').hasText('Welcome to QUnit'); +QUnit.assert.dom('.foo').hasText(/[12]\d{3}/); +QUnit.assert.dom('button.share').hasAnyText(); +QUnit.assert.dom('#title').includesText('Welcome'); +QUnit.assert.dom('#title').doesNotIncludeText('Welcome'); +QUnit.assert.dom('input.username').hasValue('HSimpson'); +QUnit.assert.dom('input.username').hasAnyValue(); +QUnit.assert.dom('input.username').hasNoValue(); diff --git a/types/qunit-dom/tsconfig.json b/types/qunit-dom/tsconfig.json new file mode 100644 index 0000000000..ec79244abc --- /dev/null +++ b/types/qunit-dom/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "qunit-dom-tests.ts" + ] +} diff --git a/types/qunit-dom/tslint.json b/types/qunit-dom/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/qunit-dom/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 2d8ed8e3db3968ab45d3ff57e823084ed008994f Mon Sep 17 00:00:00 2001 From: Ethan Frey Date: Wed, 25 Apr 2018 20:59:22 +0200 Subject: [PATCH 113/564] Add defintions for github.com/tonyg/js-nacl (#25296) --- types/js-nacl/index.d.ts | 123 +++++++++++++++++++++++++++++++++ types/js-nacl/js-nacl-tests.ts | 73 +++++++++++++++++++ types/js-nacl/tsconfig.json | 23 ++++++ types/js-nacl/tslint.json | 1 + 4 files changed, 220 insertions(+) create mode 100644 types/js-nacl/index.d.ts create mode 100644 types/js-nacl/js-nacl-tests.ts create mode 100644 types/js-nacl/tsconfig.json create mode 100644 types/js-nacl/tslint.json diff --git a/types/js-nacl/index.d.ts b/types/js-nacl/index.d.ts new file mode 100644 index 0000000000..94a7cecedf --- /dev/null +++ b/types/js-nacl/index.d.ts @@ -0,0 +1,123 @@ +// Type definitions for js-nacl 1.2 +// Project: https://github.com/tonyg/js-nacl#readme +// Definitions by: Ethan Frey +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// instantiate is the main entry point to generate a Nacl instance, +// which contains all functionality +export function instantiate(cb: NaclCallback, opts?: NaclOpts): void; + +export type NaclCallback = (nacl: Nacl) => void; +export interface NaclOpts { + readonly [key: string]: any; +} + +// types for signing +export type SignerSecretKey = Uint8Array; +export type SignerPublicKey = Uint8Array; +export interface SignKeyPair { + signPk: SignerPublicKey; + signSk: SignerSecretKey; +} +export type Message = Uint8Array; +export type Signature = Uint8Array; +export type MessageWithSignature = Uint8Array; + +// types for secrets +export type BoxSecretKey = Uint8Array; +export type BoxPublicKey = Uint8Array; +export interface BoxKeyPair { + boxPk: BoxPublicKey; + boxSk: BoxSecretKey; +} +export type Nonce = Uint8Array; +export type CipherText = Uint8Array; +export interface BoxSharedSecret { + boxK: Uint8Array; +} + +// types for streams +export type Stream = Uint8Array; +export type StreamKey = Uint8Array; + +// Nacl functions taken from js-nacl api spec +export interface Nacl { + // strings vs. binary + to_hex: (arr: Uint8Array) => string; + from_hex: (hex: string) => Uint8Array; + encode_utf8: (utf8: string) => Uint8Array; + encode_latin1: (latin1: string) => Uint8Array; + decode_utf8: (arr: Uint8Array) => string; + decode_latin1: (arr: Uint8Array) => string; + + // hash + crypto_hash: (raw: Uint8Array) => Uint8Array; + crypto_hash_sha256: (raw: Uint8Array) => Uint8Array; + + // crypto_sign + crypto_sign_keypair: () => SignKeyPair; + crypto_sign: (msg: Message, sk: SignerSecretKey) => MessageWithSignature; + crypto_sign_open: ( + packet: MessageWithSignature, + pk: SignerPublicKey + ) => Message | null; + crypto_sign_detached: (msg: Message, sk: SignerSecretKey) => Signature; + crypto_sign_verify_detached: ( + sig: Signature, + msg: Message, + pk: SignerPublicKey + ) => boolean; + + // crypto_box + crypto_box_keypair: () => BoxKeyPair; + crypto_box_random_nonce: () => Nonce; + crypto_box: ( + msg: Message, + nonce: Nonce, + rcpt: BoxPublicKey, + sender: BoxSecretKey + ) => CipherText; + crypto_box_open: ( + cipher: CipherText, + nonce: Nonce, + sender: BoxPublicKey, + rcpt: BoxSecretKey + ) => Message; + crypto_box_precompute: ( + sender: BoxPublicKey, + rcpt: BoxSecretKey + ) => BoxSharedSecret; + crypto_box_precomputed: ( + msg: Message, + nonce: Nonce, + shared: BoxSharedSecret + ) => CipherText; + crypto_box_open_precomputed: ( + cipher: CipherText, + nonce: Nonce, + shared: BoxSharedSecret + ) => Message; + + // crypto_secretbox + crypto_secretbox_random_nonce: () => Nonce; + crypto_secretbox: ( + msg: Message, + nonce: Nonce, + key: BoxSecretKey + ) => CipherText; + crypto_secretbox_open: ( + cipher: CipherText, + nonce: Nonce, + key: BoxSecretKey + ) => Message; + + // derived keys + crypto_sign_seed_keypair: (seed: Uint8Array) => SignKeyPair; + crypto_box_seed_keypair: (seed: Uint8Array) => BoxKeyPair; + crypto_box_keypair_from_raw_sk: (seed: Uint8Array) => BoxKeyPair; + + // TODO: crypto_stream + // crypto_stream_random_nonce: () => Nonce; + // crypto_stream: (len: number, nonce: Nonce, key: StreamKey) => Stream; + // crypto_stream_xor: (msg: Message, nonce: Nonce, key: StreamKey) => Stream; +} diff --git a/types/js-nacl/js-nacl-tests.ts b/types/js-nacl/js-nacl-tests.ts new file mode 100644 index 0000000000..b3336b11f7 --- /dev/null +++ b/types/js-nacl/js-nacl-tests.ts @@ -0,0 +1,73 @@ +/* This is test code for the js-nacl type defintions, to make sure it compiles */ + +import * as nacl from "js-nacl"; + +nacl.instantiate((inst: nacl.Nacl) => { + demo_hex(inst); + demo_hash(inst); + demo_sign(inst); + demo_box(inst); + demo_secret_box(inst); + demo_derived(inst); +}); + +function demo_hex(inst: nacl.Nacl): void { + const hex = "1234567890ABCDEF"; + const bin = inst.from_hex(hex); + inst.to_hex(bin); // $ExpectType string + + const text = "\uD800\uDC01"; + const utf8 = inst.encode_utf8(text); + inst.decode_utf8(utf8); // $ExpectType string + + const latinText = "Bl\xf6\xdf"; + const latin = inst.encode_latin1(latinText); + inst.decode_latin1(latin); // $ExpectType string +} + +function demo_hash(inst: nacl.Nacl): void { + const msg: nacl.Message = inst.encode_utf8("some text to hash"); + inst.crypto_hash(msg); // $ExpectType Uint8Array + inst.crypto_hash_sha256(msg); // $ExpectType Uint8Array +} + +function demo_sign(inst: nacl.Nacl): void { + const keypair = inst.crypto_sign_keypair(); + const msg: nacl.Message = inst.encode_utf8("very important message"); + const packet = inst.crypto_sign(msg, keypair.signSk); + inst.crypto_sign_open(packet, keypair.signPk); // $ExpectType Uint8Array | null + + const sig = inst.crypto_sign_detached(msg, keypair.signSk); + inst.crypto_sign_verify_detached(sig, msg, keypair.signPk); // $ExpectType boolean +} + +function demo_box(inst: nacl.Nacl): void { + const msg: nacl.Message = inst.encode_utf8("signed, sealed, and delivered"); + const sender = inst.crypto_box_keypair(); + const rcpt = inst.crypto_box_keypair(); + const nonce = inst.crypto_box_random_nonce(); + + const cipher = inst.crypto_box(msg, nonce, rcpt.boxPk, sender.boxSk); + inst.crypto_box_open(cipher, nonce, sender.boxPk, rcpt.boxSk); // $ExpectType Uint8Array + + const senderPrecompute = inst.crypto_box_precompute(rcpt.boxPk, sender.boxSk); + const rcptPrecompute = inst.crypto_box_precompute(sender.boxPk, rcpt.boxSk); + const cipher2 = inst.crypto_box_precomputed(msg, nonce, senderPrecompute); + inst.crypto_box_open_precomputed(cipher2, nonce, rcptPrecompute); // $ExpectType Uint8Array +} + +function demo_secret_box(inst: nacl.Nacl): void { + const msg: nacl.Message = inst.encode_utf8("for your eyes only"); + const keypair = inst.crypto_box_keypair(); + const nonce = inst.crypto_secretbox_random_nonce(); + + const cipher = inst.crypto_secretbox(msg, nonce, keypair.boxSk); + inst.crypto_secretbox(cipher, nonce, keypair.boxSk); // $ExpectType Uint8Array +} + +function demo_derived(inst: nacl.Nacl): void { + const seed = inst.encode_utf8("123456789012345678901234567890qq"); // 32 byte secret + inst.crypto_sign_seed_keypair(seed); // $ExpectType SignKeyPair + inst.crypto_box_seed_keypair(seed); // $ExpectType BoxKeyPair + inst.crypto_box_keypair_from_raw_sk(seed); // $ExpectType BoxKeyPair +} diff --git a/types/js-nacl/tsconfig.json b/types/js-nacl/tsconfig.json new file mode 100644 index 0000000000..c576fe48b7 --- /dev/null +++ b/types/js-nacl/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "js-nacl-tests.ts" + ] +} diff --git a/types/js-nacl/tslint.json b/types/js-nacl/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/js-nacl/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 41187d887529ffe677287ec4febc770b7c00a9b3 Mon Sep 17 00:00:00 2001 From: Daniel Schmidt Date: Wed, 25 Apr 2018 21:02:33 +0200 Subject: [PATCH 114/564] add types for npmlog (#25291) --- types/npmlog/index.d.ts | 70 ++++++++++++++++++++++++++++++++++++ types/npmlog/npmlog-tests.ts | 43 ++++++++++++++++++++++ types/npmlog/tsconfig.json | 23 ++++++++++++ types/npmlog/tslint.json | 1 + 4 files changed, 137 insertions(+) create mode 100644 types/npmlog/index.d.ts create mode 100644 types/npmlog/npmlog-tests.ts create mode 100644 types/npmlog/tsconfig.json create mode 100644 types/npmlog/tslint.json diff --git a/types/npmlog/index.d.ts b/types/npmlog/index.d.ts new file mode 100644 index 0000000000..5487c76dc7 --- /dev/null +++ b/types/npmlog/index.d.ts @@ -0,0 +1,70 @@ +// Type definitions for npmlog 4.1 +// Project: https://github.com/npm/npmlog#readme +// Definitions by: Daniel Schmidt +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +export enum LogLevels { + silly = "silly", + verbose = "verbose", + info = "info", + http = "http", + warn = "warn", + error = "error", +} + +export interface StyleObject { + fg?: string; + bg?: string; + bold?: boolean; + inverse?: boolean; + underline?: boolean; + + bell?: boolean; +} + +export interface MessageObject { + id: number; + level: string; + prefix: string; + message: string; + messageRaw: string; +} + +// TODO: newStream, newGroup, setGaugeTemplate and setGaugeTemplateSet need to be added +interface npmlog { + log(level: LogLevels | string, prefix: string, message: string, ...args: any[]): void; + + silly(prefix: string, message: string, ...args: any[]): void; + verbose(prefix: string, message: string, ...args: any[]): void; + info(prefix: string, message: string, ...args: any[]): void; + http(prefix: string, message: string, ...args: any[]): void; + warn(prefix: string, message: string, ...args: any[]): void; + error(prefix: string, message: string, ...args: any[]): void; + + level: string; + record: MessageObject[]; + maxRecordSize: number; + prefixStyle: StyleObject; + headingStyle: StyleObject; + heading: string; + stream: any; // Defaults to process.stderr + + enableColor(): void; + disableColor(): void; + + enableProgress(): void; + disableProgress(): void; + + enableUnicode(): void; + disableUnicode(): void; + + pause(): void; + resume(): void; + + addLevel(level: string, n: number, style?: StyleObject, disp?: string): void; +} + +declare const logger: npmlog; + +export default logger; diff --git a/types/npmlog/npmlog-tests.ts b/types/npmlog/npmlog-tests.ts new file mode 100644 index 0000000000..8f90bea7ce --- /dev/null +++ b/types/npmlog/npmlog-tests.ts @@ -0,0 +1,43 @@ +import npmlog from "npmlog"; + +const prefix = "str"; +const message = "otherStr"; + +['silly', 'verbose', 'info', 'http', 'warn', 'error'].forEach(lvl => npmlog.log(lvl, prefix, message)); + +npmlog.silly(prefix, message); +npmlog.verbose(prefix, message); +npmlog.info(prefix, message); +npmlog.http(prefix, message); +npmlog.warn(prefix, message); +npmlog.error(prefix, message); + +npmlog.level = "silly"; + +npmlog.enableColor(); +npmlog.disableColor(); + +npmlog.enableProgress(); +npmlog.disableProgress(); + +npmlog.enableUnicode(); +npmlog.disableUnicode(); + +npmlog.pause(); +npmlog.resume(); + +npmlog.addLevel("new-level", 42); +npmlog.addLevel("styled-level", 42, { + fg: 'red', + bg: 'blue', + bold: false, + inverse: true, + underline: true, + bell: false +}); + +npmlog.addLevel("styled-level", 42, { + fg: 'red', + bold: false, + underline: true, +}, 'display name'); diff --git a/types/npmlog/tsconfig.json b/types/npmlog/tsconfig.json new file mode 100644 index 0000000000..8ef05dd055 --- /dev/null +++ b/types/npmlog/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "npmlog-tests.ts" + ] +} diff --git a/types/npmlog/tslint.json b/types/npmlog/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/npmlog/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 8d8bf061a9cd15a1e6c5d81d9db58a1eb2f70aac Mon Sep 17 00:00:00 2001 From: Saad Quadri Date: Wed, 25 Apr 2018 15:02:45 -0400 Subject: [PATCH 115/564] add types for deglob (#25277) --- types/deglob/deglob-tests.ts | 21 +++++++++++++++++++++ types/deglob/index.d.ts | 22 ++++++++++++++++++++++ types/deglob/tsconfig.json | 23 +++++++++++++++++++++++ types/deglob/tslint.json | 3 +++ 4 files changed, 69 insertions(+) create mode 100644 types/deglob/deglob-tests.ts create mode 100644 types/deglob/index.d.ts create mode 100644 types/deglob/tsconfig.json create mode 100644 types/deglob/tslint.json diff --git a/types/deglob/deglob-tests.ts b/types/deglob/deglob-tests.ts new file mode 100644 index 0000000000..1f9990d345 --- /dev/null +++ b/types/deglob/deglob-tests.ts @@ -0,0 +1,21 @@ +/// + +import deglob = require('deglob'); + +deglob(['**/*.js'], (err, files) => { + files.forEach(file => { + console.log('found file ' + file); + }); +}); + +const opts = { + cwd: 'foo', + useGitIgnore: false, + usePackageJson: false +}; + +deglob(['**/*.js'], opts, (err, files) => { + files.forEach(file => { + console.log('found file ' + file); + }); +}); diff --git a/types/deglob/index.d.ts b/types/deglob/index.d.ts new file mode 100644 index 0000000000..6310201c11 --- /dev/null +++ b/types/deglob/index.d.ts @@ -0,0 +1,22 @@ +// Type definitions for deglob v 2.1 +// Project: https://github.com/standard/deglob +// Definitions by: Saad Quadri +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +type Callback = (err: Error | null, files: string[]) => void; + +declare function deglob(patterns: string[], cb: Callback): void; +declare function deglob(patterns: string[], opts: deglob.Options, cb: Callback): void; + +declare namespace deglob { + interface Options { + useGitIgnore?: boolean; + usePackageJson?: boolean; + configKey?: string; + gitIgnoreFile?: string; + ignore?: string[]; + cwd?: string; + } +} + +export = deglob; diff --git a/types/deglob/tsconfig.json b/types/deglob/tsconfig.json new file mode 100644 index 0000000000..1d3064583a --- /dev/null +++ b/types/deglob/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "deglob-tests.ts" + ] +} diff --git a/types/deglob/tslint.json b/types/deglob/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/deglob/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From 030ab23ed3d5adf8019e4e62f95f71affa95305a Mon Sep 17 00:00:00 2001 From: Luis Fernando Alvarez D Date: Wed, 25 Apr 2018 14:03:52 -0500 Subject: [PATCH 116/564] Added types for graphql-deduplicator (#25272) --- .../graphql-deduplicator-tests.ts | 4 ++++ types/graphql-deduplicator/index.d.ts | 13 +++++++++++ types/graphql-deduplicator/tsconfig.json | 23 +++++++++++++++++++ types/graphql-deduplicator/tslint.json | 1 + 4 files changed, 41 insertions(+) create mode 100644 types/graphql-deduplicator/graphql-deduplicator-tests.ts create mode 100644 types/graphql-deduplicator/index.d.ts create mode 100644 types/graphql-deduplicator/tsconfig.json create mode 100644 types/graphql-deduplicator/tslint.json diff --git a/types/graphql-deduplicator/graphql-deduplicator-tests.ts b/types/graphql-deduplicator/graphql-deduplicator-tests.ts new file mode 100644 index 0000000000..7da4764de2 --- /dev/null +++ b/types/graphql-deduplicator/graphql-deduplicator-tests.ts @@ -0,0 +1,4 @@ +import { deflate, inflate } from 'graphql-deduplicator'; + +deflate({}); +inflate({}); diff --git a/types/graphql-deduplicator/index.d.ts b/types/graphql-deduplicator/index.d.ts new file mode 100644 index 0000000000..079b7c31be --- /dev/null +++ b/types/graphql-deduplicator/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for graphql-deduplicator 2.0 +// Project: https://github.com/gajus/graphql-deduplicator#readme +// Definitions by: Luis Fernando Alvarez D. +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 + +export function deflate(response: object): { + [key: string]: any; +}; + +export function inflate(response: object): { + [key: string]: any; +}; diff --git a/types/graphql-deduplicator/tsconfig.json b/types/graphql-deduplicator/tsconfig.json new file mode 100644 index 0000000000..2254638503 --- /dev/null +++ b/types/graphql-deduplicator/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "graphql-deduplicator-tests.ts" + ] +} diff --git a/types/graphql-deduplicator/tslint.json b/types/graphql-deduplicator/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/graphql-deduplicator/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 9c7b8df170f7258e1556aeeef7a4cf0a2e8695c1 Mon Sep 17 00:00:00 2001 From: uwinkelvos Date: Wed, 25 Apr 2018 21:06:10 +0200 Subject: [PATCH 117/564] Added type definitions for koa-xml-body (#25273) --- types/koa-xml-body/index.d.ts | 45 ++++++++++++++++++++++++ types/koa-xml-body/koa-xml-body-tests.ts | 15 ++++++++ types/koa-xml-body/tsconfig.json | 23 ++++++++++++ types/koa-xml-body/tslint.json | 1 + 4 files changed, 84 insertions(+) create mode 100644 types/koa-xml-body/index.d.ts create mode 100644 types/koa-xml-body/koa-xml-body-tests.ts create mode 100644 types/koa-xml-body/tsconfig.json create mode 100644 types/koa-xml-body/tslint.json diff --git a/types/koa-xml-body/index.d.ts b/types/koa-xml-body/index.d.ts new file mode 100644 index 0000000000..334998df5a --- /dev/null +++ b/types/koa-xml-body/index.d.ts @@ -0,0 +1,45 @@ +// Type definitions for koa-xml-body 2.0 +// Project: https://github.com/creeperyang/koa-xml-body +// Definitions by: Ulf Winkelvos +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +/* =================== USAGE =================== + + import Koa = require('koa'); + import KoaXmlBody = require('koa-xml-body'); + + const app = new Koa(); + app.use(KoaXmlBody({ + onerror: (err, ctx) => { + ctx.throw(err.message); + } + })); + + =============================================== */ + +import * as Koa from "koa"; + +import { Options as Xml2jsOptions } from "xml2js"; + +declare module "koa" { + interface Request { + body: any; + } +} + +declare function bodyParser(opts?: { + // requested encoding. Default is utf8. If not set, the lib will retrive it from content-type(such as content-type:application/xml;charset=gb2312). + encoding?: string + // limit of the body. If the body ends up being larger than this limit, a 413 error code is returned. Default is 1mb. + limit?: number + // length of the body. When content-length is found, it will be overwritten automatically. + length?: number + // error handler. Default is a noop function. It means it will eat the error silently. You can config it to customize the response. + onerror?: (err: Error, ctx: Koa.Context) => void; + // options which will be used to parse xml. Default is {}. See xml2js Options for details. + xmlOptions?: Xml2jsOptions +}): Koa.Middleware; + +declare namespace bodyParser { } +export = bodyParser; diff --git a/types/koa-xml-body/koa-xml-body-tests.ts b/types/koa-xml-body/koa-xml-body-tests.ts new file mode 100644 index 0000000000..1eca30f62a --- /dev/null +++ b/types/koa-xml-body/koa-xml-body-tests.ts @@ -0,0 +1,15 @@ +import Koa = require('koa'); +import KoaXmlBody = require('koa-xml-body'); + +const app = new Koa(); +app.use(KoaXmlBody({ + onerror: (err, ctx) => { + ctx.throw(err.message); + } +})); + +app.use((ctx) => { + console.log(ctx.request.body); +}); + +app.listen(80); diff --git a/types/koa-xml-body/tsconfig.json b/types/koa-xml-body/tsconfig.json new file mode 100644 index 0000000000..0b0da1408f --- /dev/null +++ b/types/koa-xml-body/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "koa-xml-body-tests.ts" + ] +} \ No newline at end of file diff --git a/types/koa-xml-body/tslint.json b/types/koa-xml-body/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/koa-xml-body/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 65a9fe8ac0b956007075ab46f014a7ba6f457c7c Mon Sep 17 00:00:00 2001 From: Mathias Paumgarten Date: Wed, 25 Apr 2018 12:06:32 -0700 Subject: [PATCH 118/564] adds types for a-big-triangle (#25275) --- types/a-big-triangle/a-big-triangle-tests.ts | 5 ++++ types/a-big-triangle/index.d.ts | 8 +++++++ types/a-big-triangle/tsconfig.json | 24 ++++++++++++++++++++ types/a-big-triangle/tslint.json | 3 +++ 4 files changed, 40 insertions(+) create mode 100644 types/a-big-triangle/a-big-triangle-tests.ts create mode 100644 types/a-big-triangle/index.d.ts create mode 100644 types/a-big-triangle/tsconfig.json create mode 100644 types/a-big-triangle/tslint.json diff --git a/types/a-big-triangle/a-big-triangle-tests.ts b/types/a-big-triangle/a-big-triangle-tests.ts new file mode 100644 index 0000000000..75198e8690 --- /dev/null +++ b/types/a-big-triangle/a-big-triangle-tests.ts @@ -0,0 +1,5 @@ +import drawTriangle = require("a-big-triangle"); + +const gl = new WebGLRenderingContext(); + +drawTriangle(gl); // $ExpectType void diff --git a/types/a-big-triangle/index.d.ts b/types/a-big-triangle/index.d.ts new file mode 100644 index 0000000000..6e397cfa7e --- /dev/null +++ b/types/a-big-triangle/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for a-big-triangle 1.0 +// Project: https://github.com/mikolalysenko/a-big-triangle +// Definitions by: Mathias Paumgarten +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare function createABigTriangle(gl: WebGLRenderingContext): void; + +export = createABigTriangle; diff --git a/types/a-big-triangle/tsconfig.json b/types/a-big-triangle/tsconfig.json new file mode 100644 index 0000000000..c85f12fe20 --- /dev/null +++ b/types/a-big-triangle/tsconfig.json @@ -0,0 +1,24 @@ +{ + "files": [ + "index.d.ts", + "a-big-triangle-tests.ts" + ], + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} diff --git a/types/a-big-triangle/tslint.json b/types/a-big-triangle/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/a-big-triangle/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From e178d12a21639c084f1a5031592c893befcb0b28 Mon Sep 17 00:00:00 2001 From: BehindTheMath Date: Wed, 25 Apr 2018 15:08:10 -0400 Subject: [PATCH 119/564] [proxy-verifier] Add types for proxy-verifier (#25268) * [proxy-verifier] Add types for proxy-verifier * Add minimum TS version These definitions depends on request, which has a minimum TS version of 2.3 * Refactor static class and namespace to plain ES6 exports --- types/proxy-verifier/index.d.ts | 93 ++++++++++++++++++++ types/proxy-verifier/proxy-verifier-tests.ts | 42 +++++++++ types/proxy-verifier/tsconfig.json | 23 +++++ types/proxy-verifier/tslint.json | 1 + 4 files changed, 159 insertions(+) create mode 100644 types/proxy-verifier/index.d.ts create mode 100644 types/proxy-verifier/proxy-verifier-tests.ts create mode 100644 types/proxy-verifier/tsconfig.json create mode 100644 types/proxy-verifier/tslint.json diff --git a/types/proxy-verifier/index.d.ts b/types/proxy-verifier/index.d.ts new file mode 100644 index 0000000000..45fde96038 --- /dev/null +++ b/types/proxy-verifier/index.d.ts @@ -0,0 +1,93 @@ +// Type definitions for proxy-verifier 0.4 +// Project: https://github.com/chill117/proxy-verifier#readme +// Definitions by: BehindTheMath +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { CoreOptions as RequestOptions } from "request"; + +export function testAll(proxy: Proxy, options: RequestOptions, cb: (error: any, result: AllResults) => void): void; +export function testAll(proxy: Proxy, cb: (error: any, result: AllResults) => void): void; + +export function testProtocol(proxy: Proxy, options: RequestOptions, cb: (error: any, result: Result) => void): void; +export function testProtocol(proxy: Proxy, cb: (error: any, result: Result) => void): void; + +export function testProtocols(proxy: Proxy, options: RequestOptions, cb: (error: any, result: ProtocolResult) => void): void; +export function testProtocols(proxy: Proxy, cb: (error: any, result: ProtocolResult) => void): void; + +export function testAnonymityLevel(proxy: Proxy, options: RequestOptions, cb: (error: any, result: string) => void): void; +export function testAnonymityLevel(proxy: Proxy, cb: (error: any, result: string) => void): void; + +export function testTunnel(proxy: Proxy, options: RequestOptions, cb: (error: any, result: Result) => void): void; +export function testTunnel(proxy: Proxy, cb: (error: any, result: Result) => void): void; + +export function test(proxy: Proxy, options: TestOptions, cb: (error: any, result: CustomTestResult) => void): void; +export function test(proxy: Proxy, cb: (error: any, result: CustomTestResult) => void): void; + +export interface Proxy { + ipAddress: string; + port: number; + /** + * Proxy-Authorization header + */ + auth?: string; + protocol?: Protocol; + protocols?: Protocol[]; +} + +export type Protocol = "http" | "https" | "socks5" | "socks4"; + +export type AnonymityLevel = "transparent" | "anonymous" | "elite"; + +export interface AllResults { + anonymityLevel?: AnonymityLevel; + protocols?: ProtocolResult; + tunnel?: Result; +} + +export type Result = WorkingResult | NotWorkingResult; + +export interface WorkingResult { + ok: true; +} + +export interface NotWorkingResult { + ok: false; + error: { + message: string; + code: string; + }; +} + +export interface ProtocolResult { + [key: string]: Result; +} + +export interface TestOptions { + testUrl: string; + testFn(data: string, status: number, headers: Headers): void; +} + +export interface Headers { + [key: string]: string; +} + +export interface CustomTestBaseResult { + data: string; + status: number; + headers: Headers; +} + +export type CustomTestResult = CustomTestWorkingResult | CustomTestNotWorkingResult; + +export interface CustomTestWorkingResult extends CustomTestBaseResult { + ok: true; +} + +export interface CustomTestNotWorkingResult extends CustomTestBaseResult { + ok: false; + error: { + message: string; + code: string; + }; +} diff --git a/types/proxy-verifier/proxy-verifier-tests.ts b/types/proxy-verifier/proxy-verifier-tests.ts new file mode 100644 index 0000000000..4c019ffc4c --- /dev/null +++ b/types/proxy-verifier/proxy-verifier-tests.ts @@ -0,0 +1,42 @@ +import * as ProxyVerifier from "proxy-verifier"; + +const proxy: ProxyVerifier.Proxy = { + ipAddress: "123.123.123.123", + port: 8080, + auth: "test", + protocol: "socks5", + protocols: [ "socks5", "https" ] +}; + +const requestOptions = { + method: "GET" +}; + +const testOptions = { + testUrl: "www.example.com", + testFn: (data: string, status: number, headers: ProxyVerifier.Headers) => {} +}; + +function cb(error: any, result: string | ProxyVerifier.Result | ProxyVerifier.ProtocolResult | ProxyVerifier.CustomTestResult | ProxyVerifier.AllResults) { + if (error) console.error(error); + + console.log(result); +} + +ProxyVerifier.testAll(proxy, requestOptions, cb); +ProxyVerifier.testAll(proxy, requestOptions, cb); + +ProxyVerifier.testProtocol(proxy, requestOptions, cb); +ProxyVerifier.testProtocol(proxy, requestOptions, cb); + +ProxyVerifier.testProtocols(proxy, requestOptions, cb); +ProxyVerifier.testProtocols(proxy, requestOptions, cb); + +ProxyVerifier.testAnonymityLevel(proxy, requestOptions, cb); +ProxyVerifier.testAnonymityLevel(proxy, requestOptions, cb); + +ProxyVerifier.testTunnel(proxy, requestOptions, cb); +ProxyVerifier.testTunnel(proxy, requestOptions, cb); + +ProxyVerifier.test(proxy, testOptions, cb); +ProxyVerifier.test(proxy, testOptions, cb); diff --git a/types/proxy-verifier/tsconfig.json b/types/proxy-verifier/tsconfig.json new file mode 100644 index 0000000000..3ba1a15b15 --- /dev/null +++ b/types/proxy-verifier/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "proxy-verifier-tests.ts" + ] +} diff --git a/types/proxy-verifier/tslint.json b/types/proxy-verifier/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/proxy-verifier/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 39d211b878ebf98de648da1f301c49dcf656dd25 Mon Sep 17 00:00:00 2001 From: BehindTheMath Date: Wed, 25 Apr 2018 15:08:37 -0400 Subject: [PATCH 120/564] [proxy-lists] Add types for proxy-lists (#25267) * [proxy-lists] Add types for proxy-lists * Change minimum TS version These definitions depends on request, which has a minimum TS version of 2.3. * Refactor static class and namespace to plain ES6 exports --- types/proxy-lists/index.d.ts | 70 ++++++++++++++++++++++++++ types/proxy-lists/proxy-lists-tests.ts | 55 ++++++++++++++++++++ types/proxy-lists/tsconfig.json | 23 +++++++++ types/proxy-lists/tslint.json | 1 + 4 files changed, 149 insertions(+) create mode 100644 types/proxy-lists/index.d.ts create mode 100644 types/proxy-lists/proxy-lists-tests.ts create mode 100644 types/proxy-lists/tsconfig.json create mode 100644 types/proxy-lists/tslint.json diff --git a/types/proxy-lists/index.d.ts b/types/proxy-lists/index.d.ts new file mode 100644 index 0000000000..c0b223bb60 --- /dev/null +++ b/types/proxy-lists/index.d.ts @@ -0,0 +1,70 @@ +// Type definitions for proxy-lists 1.14 +// Project: https://github.com/chill117/proxy-lists#readme +// Definitions by: BehindTheMath +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { CoreOptions as RequestOptions } from "request"; +import { EventEmitter } from "events"; + +export function getProxies(options?: Partial): GetProxiesEventEmitter; + +export function getProxiesFromSource(name: string, options?: Options): GetProxiesEventEmitter; + +export function addSource(name: string, source: AddSource): void; + +export function listSources(options?: ListSourcesOptions): Source[]; + +export class GetProxiesEventEmitter extends EventEmitter { + on(event: "data", listener: (proxies: Proxy[]) => void): this; + on(event: "error", listener: (error: any) => void): this; + on(event: "end", listener: () => void): this; +} + +export interface Options { + filterMode?: "strict" | "loose"; + countries?: string[]; + countriesBlackList?: string[]; + protocols?: Protocol[]; + anonymityLevels?: AnonymityLevel[]; + sourcesWhiteList?: string[]; + sourcesBlackList?: string[]; + series?: boolean; + ipTypes?: IPType[]; + defaultRequestOptions?: RequestOptions; +} + +export type Protocol = "http" | "https" | "socks5" | "socks4"; + +export type AnonymityLevel = "transparent" | "anonymous" | "elite"; + +export type IPType = "ipv4" | "ipv6"; + +export interface Proxy { + ipAddress: string; + port: number; + country: string; + anonymityLevel?: AnonymityLevel; + protocols?: Protocol[]; + source: string; + tunnel?: boolean; +} + +export interface InternalOptions extends Options { + sample?: boolean; +} + +export interface AddSource { + homeUrl: string; + getProxies(options: InternalOptions): GetProxiesEventEmitter; +} + +export interface ListSourcesOptions { + sourcesWhiteList?: string[]; + sourcesBlackList?: string[]; +} + +export interface Source { + name: string; + homeUrl: string; +} diff --git a/types/proxy-lists/proxy-lists-tests.ts b/types/proxy-lists/proxy-lists-tests.ts new file mode 100644 index 0000000000..132aa431e4 --- /dev/null +++ b/types/proxy-lists/proxy-lists-tests.ts @@ -0,0 +1,55 @@ +import * as ProxyLists from "proxy-lists"; +import { EventEmitter } from "events"; + +const options: ProxyLists.Options = { + filterMode: 'strict', + countries: ['us', 'ca'], + countriesBlackList: ['de', 'gb'], + protocols: ['http', 'https'], + anonymityLevels: ['anonymous', 'elite'], + sourcesWhiteList: ['freeproxylists'], + sourcesBlackList: ['freeproxylists'], + series: false, + ipTypes: ['ipv4'], + defaultRequestOptions: { + method: "GET" + } +}; + +// `gettingProxies` is an event emitter object. +let gettingProxies: ProxyLists.GetProxiesEventEmitter = ProxyLists.getProxies(options); + +gettingProxies.on('data', proxies => { + // Received some proxies. +}); + +gettingProxies.on('error', error => { + // Some error has occurred. + console.error(error); +}); + +gettingProxies.once('end', () => { + // Done getting proxies. +}); + +gettingProxies = ProxyLists.getProxiesFromSource('freeproxylists', options); + +gettingProxies.on('data', proxies => { + // Received some proxies. +}); + +const source: ProxyLists.AddSource = { + homeUrl: 'www.example.com', + getProxies: (options: ProxyLists.InternalOptions) => { + return new EventEmitter(); + } +}; + +ProxyLists.addSource('testSource', source); + +const listSourcesOptions: ProxyLists.ListSourcesOptions = { + sourcesWhiteList: ['freeproxylists'], + sourcesBlackList: ['freeproxylists'] +}; + +ProxyLists.listSources(listSourcesOptions).forEach(source => console.log(source.name, source.homeUrl)); diff --git a/types/proxy-lists/tsconfig.json b/types/proxy-lists/tsconfig.json new file mode 100644 index 0000000000..b632be67c9 --- /dev/null +++ b/types/proxy-lists/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "strictFunctionTypes": true + }, + "files": [ + "index.d.ts", + "proxy-lists-tests.ts" + ] +} diff --git a/types/proxy-lists/tslint.json b/types/proxy-lists/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/proxy-lists/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 10014f262547903fda7ef72ba72359c77f78df99 Mon Sep 17 00:00:00 2001 From: chanakadrathnayaka Date: Thu, 26 Apr 2018 00:45:52 +0530 Subject: [PATCH 121/564] Typescript definition for leaflet-routing-machine (#25249) * Leaflet routing machine typing definition implementation :: Tested * strictFunctionTypes set true * Added typescript version * Issue fixes * Issue fixes * Issue fixes * Issue fixes * Issue fixes * Issue fixes --- types/leaflet-routing-machine/index.d.ts | 270 ++++++++++++++++++ .../leaflet-routing-machine-tests.ts | 15 + types/leaflet-routing-machine/tsconfig.json | 24 ++ types/leaflet-routing-machine/tslint.json | 3 + 4 files changed, 312 insertions(+) create mode 100644 types/leaflet-routing-machine/index.d.ts create mode 100644 types/leaflet-routing-machine/leaflet-routing-machine-tests.ts create mode 100644 types/leaflet-routing-machine/tsconfig.json create mode 100644 types/leaflet-routing-machine/tslint.json diff --git a/types/leaflet-routing-machine/index.d.ts b/types/leaflet-routing-machine/index.d.ts new file mode 100644 index 0000000000..16da37f7c5 --- /dev/null +++ b/types/leaflet-routing-machine/index.d.ts @@ -0,0 +1,270 @@ +// Type definitions for leaflet-routing-machine 3.2 +// Project: https://github.com/perliedman/leaflet-routing-machine#readme +// Definitions by: Chanaka Rathnayaka +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.4 + +import * as L from 'leaflet'; + +declare module 'leaflet' { + namespace Routing { + class Control extends Itinerary { + constructor(options?: RoutingControlOptions); + getWaypoints(): Waypoint[]; + setWaypoints(waypoints: Waypoint[] | LatLng[]): this; + spliceWaypoints(index: number, waypointsToRemove: number, ...wayPoints: Waypoint[]): Waypoint[]; + getPlan(): Plan; + getRouter(): IRouter; + route(): void; + on(type: string, fn: (event: any) => void, context?: any): this; + } + + interface RoutingControlOptions extends ItineraryOptions { + waypoints?: Waypoint[] | LatLng[]; + router?: IRouter; + plan?: Plan; + geocoder?: any; // IGeocorder is from other library; + fitSelectedRoutes?: 'smart' | boolean; + lineOptions?: LineOptions; + routeLine?: (route: IRoute, options: LineOptions) => Line; + autoRoute?: boolean; + routeWhileDragging?: boolean; + routeDragInterval?: number; + waypointMode?: string; + useZoomParameter?: boolean; + showAlternatives?: boolean; + altLineOptions?: LineOptions; + } + + class Itinerary extends L.Control { + constructor(options: ItineraryOptions); + setAlternatives(routes: IRoute[]): any; + show(): void; + hide(): void; + } + + interface ItineraryOptions { + pointMarkerStyle?: PathOptions; + summaryTemplate?: string; + distanceTemplate?: string; + timeTemplate?: string; + containerClassName?: string; + alternativeClassName?: string; + minimizedClassName?: string; + itineraryClassName?: string; + show?: boolean; + formatter?: Formatter; + itineraryFormatter?: ItineraryBuilder; + collapsible?: boolean; + collapseBtn?: (itinerary: Itinerary) => void; + collapseBtnClass?: string; + totalDistanceRoundingSensitivity?: number; + } + + class Plan extends Layer { + constructor(waypoints: Waypoint[] | LatLng[], options?: PlanOptions); + isReady(): boolean; + getWaypoints(): Waypoint[]; + setWaypoints(waypoints: Waypoint[] | LatLng[]): any; + spliceWaypoints(index: number, waypointsToRemove: number, ...wayPoints: Waypoint[]): Waypoint[]; + createGeocoders(): any; + } + + interface PlanOptions { + geocoder?: any; // IGeocoder + addWaypoints?: boolean; + draggableWaypoints?: boolean; + dragStyles?: PathOptions[]; + maxGeocoderTolerance?: number; + geocoderPlaceholder?: (waypointIndex: number, numberWaypoints: number) => string; + geocodersClassName?: string; + geocoderClass?: (waypointIndex: number, numberWaypoints: number) => void; + waypointNameFallback?: (latLng: LatLng) => string; + createGeocoder?: (waypointIndex: number, numberWaypoints: number, plan: Plan) => {}; + addButtonClassName?: string; + createMarker?: (waypointIndex: number, waypoint: Waypoint, numberWaypoints: number) => Marker; + routeWhileDragging?: boolean; + reverseWaypoints?: boolean; + } + + class Line extends LayerGroup { + constructor(route: IRoute, options?: LineOptions); + getBounds(): LatLngBounds; + } + + interface LineOptions { + styles?: PathOptions[]; + missingRouteStyles?: PathOptions[]; + addWaypoints?: boolean; + } + + class OSRMv1 implements IRouter { + constructor(options?: OSRMOptions); + + route(waypoints: Waypoint[], callback: (args?: any) => void, context?: {}, options?: RoutingOptions): void ; + buildRouteUrl(waypoints: Waypoint[], options: RoutingOptions): string; + } + + interface OSRMOptions { + serviceUrl?: string; + timeout?: number; + profile?: string; + polylinePrecision?: number; + useHints?: boolean; + } + + class Formatter { + constructor(options?: FormatterOptions); + formatDistance(d: number, precision?: number): string; + formatTime(t: number): string; + formatInstruction(instruction: IInstruction): string; + } + + interface FormatterOptions { + language?: string; + units?: string; + roundingSensitivity?: number; + unitNames?: {}; + } + + class ItineraryBuilder { + constructor(); + createContainer(className: string): HTMLElement; + createStepsContainer(container: HTMLElement): void; + createStep(text: string, distance: string, steps: HTMLElement): void; + } + + class Localization { + constructor(lang: string); + localize(text: string): string; + } + + interface Waypoint { + latLng: LatLng; + name?: string; + options?: WaypointOptions; + } + + interface WaypointOptions { + allowUTurn?: boolean; + } + + // Event Objects + + interface RoutingEvent { + waypoints: Waypoint[]; + } + + interface RoutingResultEvent { + waypoints: Waypoint[]; + routes: IRoute[]; + } + + interface RoutingErrorEvent { + error: IError; + } + + interface RouteSelectedEvent { + route: IRoute; + } + + interface WaypointsSplicedEvent { + index: number; + nRemoved: number; + added: Waypoint[]; + } + + interface LineTouchedEvent { + afterIndex: number; + latlng: number; + } + + interface GeocodingEvent { + waypointIndex: number; + waypoint: Waypoint; + } + + // Interfaces + interface RoutingOptions { + z: number; + allowUTurns: boolean; + geometryOnly: boolean; + fileFormat: string; + } + + // tslint:disable-next-line interface-name + interface IRouter { + route(waypoints: Waypoint[], callback: (error?: IError, routes?: IRoute[]) => any, context?: {}, options?: RoutingOptions): void; + } + + // tslint:disable-next-line interface-name + interface IRoute { + name?: string; + summary?: IRouteSummary; + coordinates?: LatLng[]; + waypoints?: LatLng[]; + instructions?: IInstruction[]; + } + + // tslint:disable-next-line interface-name + interface IRouteSummary { + totalTime: number; + totalDistance: number; + } + + // tslint:disable-next-line interface-name + interface IInstruction { + distance: number; + time: number; + text?: number; + type?: 'Straight' | 'SlightRight' | 'Right' | 'SharpRight' | 'TurnAround' | 'SharpLeft' | 'Left' | 'SlightLeft' | 'WaypointReached' | + 'Roundabout' | 'StartAt' | 'DestinationReached' | 'EnterAgainstAllowedDirection' | 'LeaveAgainstAllowedDirection'; + road?: string; + direction?: string; + exit?: number; + } + + // tslint:disable-next-line interface-name + interface IGeocoderElement { + container: HTMLElement; + input: HTMLElement; + closeButton: HTMLElement; + } + + // tslint:disable-next-line interface-name + interface IError { + status: string | number; + message: string; + } + + function control(options?: RoutingControlOptions): Control; + + function itinerary(options?: ItineraryOptions): Itinerary; + + function line(route: IRoute, options?: LineOptions): Line; + + function plan(waypoints: Waypoint[] | LatLng[], options?: PlanOptions): Plan; + + function osrmv1(options?: OSRMOptions): OSRMv1; + + function formatter(options?: FormatterOptions): Formatter; + + function waypoint(latLng: LatLng, name?: string, options?: WaypointOptions): Waypoint; + } + + namespace routing { + function control(options?: Routing.RoutingControlOptions): Routing.Control; + + function itinerary(options?: Routing.ItineraryOptions): Routing.Itinerary; + + function line(route: Routing.IRoute, options?: Routing.LineOptions): Routing.Line; + + function plan(waypoints: Routing.Waypoint[] | LatLng[], options?: Routing.PlanOptions): Routing.Plan; + + function osrmv1(options?: Routing.OSRMOptions): Routing.OSRMv1; + + function formatter(options?: Routing.FormatterOptions): Routing.Formatter; + + function waypoint(latLng: LatLng, name?: string, options?: Routing.WaypointOptions): Routing.Waypoint; + } +} diff --git a/types/leaflet-routing-machine/leaflet-routing-machine-tests.ts b/types/leaflet-routing-machine/leaflet-routing-machine-tests.ts new file mode 100644 index 0000000000..ae159c2e3d --- /dev/null +++ b/types/leaflet-routing-machine/leaflet-routing-machine-tests.ts @@ -0,0 +1,15 @@ +import * as L from 'leaflet'; +import 'leaflet-routing-machine'; + +const map: L.Map = L.map('map-container'); + +L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', { + attribution: '© OpenStreetMap contributors' +}).addTo(map); + +L.Routing.control({ + waypoints: [ + L.latLng(57.74, 11.94), + L.latLng(57.6792, 11.949) + ] +}).addTo(map); diff --git a/types/leaflet-routing-machine/tsconfig.json b/types/leaflet-routing-machine/tsconfig.json new file mode 100644 index 0000000000..424253020a --- /dev/null +++ b/types/leaflet-routing-machine/tsconfig.json @@ -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", + "leaflet-routing-machine-tests.ts" + ] +} diff --git a/types/leaflet-routing-machine/tslint.json b/types/leaflet-routing-machine/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/leaflet-routing-machine/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +} From 29f14089b27cfc0546af3c6191b73b46efe7184e Mon Sep 17 00:00:00 2001 From: Ben Wildeman Date: Wed, 25 Apr 2018 20:16:57 +0100 Subject: [PATCH 122/564] Expo: Added missing props to Svg (#25162) * Added missing props to Svg * Added space --- types/expo/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index 8efbbd120d..c5beebd7f0 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -1876,6 +1876,7 @@ export interface SvgCommonProps { fill?: string; fillOpacity?: number | string; fillRule?: 'nonzero' | 'evenodd'; + opacity?: number | string; stroke?: string; strokeWidth?: number | string; strokeOpacity?: number | string; @@ -1986,7 +1987,7 @@ export interface SvgStopProps extends SvgCommonProps { stopOpacity?: string; } -export class Svg extends Component<{ width: number, height: number }> { +export class Svg extends Component<{ width: number, height: number, viewBox?: string }> { static Circle: ComponentClass; static ClipPath: ComponentClass; static Defs: ComponentClass; From 9bb37f03273d0a1c10b8b9b9e11622f52243192e Mon Sep 17 00:00:00 2001 From: Conan Date: Wed, 25 Apr 2018 15:18:31 -0400 Subject: [PATCH 123/564] [Joi] - add schema option to .when in v13.0.1 (#25175) * add schema option to .when * move changes to v13 * fix * add name --- types/joi/index.d.ts | 15 +++++++++++++++ types/joi/joi-tests.ts | 18 ++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/types/joi/index.d.ts b/types/joi/index.d.ts index 2b6d264b3e..48e2a0327c 100644 --- a/types/joi/index.d.ts +++ b/types/joi/index.d.ts @@ -11,6 +11,7 @@ // Dan Kraus // Anjun Wang // Rafael Kallis +// Conan Lai // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -152,6 +153,17 @@ export interface WhenOptions { otherwise?: SchemaLike; } +export interface WhenSchemaOptions { + /** + * the alternative schema type if the condition is true. Required if otherwise is missing. + */ + then?: SchemaLike; + /** + * the alternative schema type if the condition is false. Required if then is missing + */ + otherwise?: SchemaLike; +} + export interface ReferenceOptions { separator?: string; contextPrefix?: string; @@ -347,6 +359,7 @@ export interface AnySchema extends JoiObject { */ when(ref: string, options: WhenOptions): AlternativesSchema; when(ref: Reference, options: WhenOptions): AlternativesSchema; + when(ref: Schema, options: WhenSchemaOptions): AlternativesSchema; /** * Overrides the key name in error messages. @@ -922,6 +935,7 @@ export interface AlternativesSchema extends AnySchema { try(...types: SchemaLike[]): this; when(ref: string, options: WhenOptions): this; when(ref: Reference, options: WhenOptions): this; + when(ref: Schema, options: WhenSchemaOptions): this; } export interface LazySchema extends AnySchema { @@ -1218,6 +1232,7 @@ export function concat(schema: T): T; */ export function when(ref: string, options: WhenOptions): AlternativesSchema; export function when(ref: Reference, options: WhenOptions): AlternativesSchema; +export function when(ref: Schema, options: WhenSchemaOptions): AlternativesSchema; /** * Overrides the key name in error messages. diff --git a/types/joi/joi-tests.ts b/types/joi/joi-tests.ts index 1ab3316eb8..5ea9088a74 100644 --- a/types/joi/joi-tests.ts +++ b/types/joi/joi-tests.ts @@ -128,6 +128,14 @@ whenOpts = { is: schemaLike, then: schemaLike, otherwise: schemaLike }; // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- +let whenSchemaOpts: Joi.WhenSchemaOptions = null; + +whenSchemaOpts = { then: schema }; +whenSchemaOpts = { otherwise: schema }; +whenSchemaOpts = { then: schemaLike, otherwise: schemaLike }; + +// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- + let refOpts: Joi.ReferenceOptions = null; refOpts = { separator: str }; @@ -276,6 +284,7 @@ namespace common { altSchema = anySchema.when(str, whenOpts); altSchema = anySchema.when(ref, whenOpts); + altSchema = anySchema.when(schema, whenSchemaOpts); anySchema = anySchema.label(str); anySchema = anySchema.raw(); @@ -363,6 +372,7 @@ namespace common_copy_paste { altSchema = arrSchema.when(str, whenOpts); altSchema = arrSchema.when(ref, whenOpts); + altSchema = arrSchema.when(schema, whenSchemaOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -433,6 +443,7 @@ namespace common_copy_paste { altSchema = boolSchema.when(str, whenOpts); altSchema = boolSchema.when(ref, whenOpts); + altSchema = boolSchema.when(schema, whenSchemaOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -489,6 +500,7 @@ namespace common { altSchema = binSchema.when(str, whenOpts); altSchema = binSchema.when(ref, whenOpts); + altSchema = binSchema.when(schema, whenSchemaOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -561,6 +573,7 @@ namespace common { altSchema = dateSchema.when(str, whenOpts); altSchema = dateSchema.when(ref, whenOpts); + altSchema = dateSchema.when(schema, whenSchemaOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -635,6 +648,7 @@ namespace common { altSchema = numSchema.when(str, whenOpts); altSchema = numSchema.when(ref, whenOpts); + altSchema = numSchema.when(schema, whenSchemaOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -749,6 +763,7 @@ namespace common { altSchema = objSchema.when(str, whenOpts); altSchema = objSchema.when(ref, whenOpts); + altSchema = objSchema.when(schema, whenSchemaOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -843,6 +858,7 @@ namespace common { altSchema = strSchema.when(str, whenOpts); altSchema = strSchema.when(ref, whenOpts); + altSchema = strSchema.when(schema, whenSchemaOpts); } // --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- @@ -1049,6 +1065,7 @@ schema = Joi.concat(x); schema = Joi.when(str, whenOpts); schema = Joi.when(ref, whenOpts); +schema = Joi.when(schema, whenSchemaOpts); schema = Joi.label(str); schema = Joi.raw(); @@ -1102,6 +1119,7 @@ schema = Joi.concat(x); schema = Joi.when(str, whenOpts); schema = Joi.when(ref, whenOpts); +schema = Joi.when(schema, whenSchemaOpts); schema = Joi.label(str); schema = Joi.raw(); From e7c97142be9ca8e8af1a014a367a44430ade7ee6 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 25 Apr 2018 15:30:16 -0700 Subject: [PATCH 124/564] Add 'travis-fold' (#25305) --- types/travis-fold/index.d.ts | 11 +++++++++++ types/travis-fold/travis-fold-tests.ts | 12 ++++++++++++ types/travis-fold/tsconfig.json | 23 +++++++++++++++++++++++ types/travis-fold/tslint.json | 1 + 4 files changed, 47 insertions(+) create mode 100644 types/travis-fold/index.d.ts create mode 100644 types/travis-fold/travis-fold-tests.ts create mode 100644 types/travis-fold/tsconfig.json create mode 100644 types/travis-fold/tslint.json diff --git a/types/travis-fold/index.d.ts b/types/travis-fold/index.d.ts new file mode 100644 index 0000000000..710024ab97 --- /dev/null +++ b/types/travis-fold/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for travis-fold 0.1 +// Project: https://github.com/macbre/travis-fold +// Definitions by: Andy Hanson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export function start(group: string): string; +export function end(group: string): string; +export function wrap(group: string, content: string): string; +export function pushStart(ret: string[], group: string): void; +export function pushEnd(ret: string[], group: string): void; +export function isTravis(): boolean; diff --git a/types/travis-fold/travis-fold-tests.ts b/types/travis-fold/travis-fold-tests.ts new file mode 100644 index 0000000000..a9d499c3fc --- /dev/null +++ b/types/travis-fold/travis-fold-tests.ts @@ -0,0 +1,12 @@ +import { end, isTravis, pushEnd, pushStart, start } from "travis-fold"; + +const out: string[] = []; +pushStart(out, 'fold'); +pushEnd(out, 'fold'); + +out.join('\n').trim(); // $ExpectType string + +if (isTravis()) { + start("s"); // $ExpectType string + end("e"); // $ExpectType string +} diff --git a/types/travis-fold/tsconfig.json b/types/travis-fold/tsconfig.json new file mode 100644 index 0000000000..9d50a3f5ac --- /dev/null +++ b/types/travis-fold/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "travis-fold-tests.ts" + ] +} \ No newline at end of file diff --git a/types/travis-fold/tslint.json b/types/travis-fold/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/travis-fold/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From bffb03282272b37ccb12429026f4504a39a3cd83 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Tue, 24 Apr 2018 14:14:30 -0700 Subject: [PATCH 125/564] Add new types for node v10.0.0 --- types/node/index.d.ts | 648 ++- types/node/v9/index.d.ts | 7215 ++++++++++++++++++++++++++++++++++ types/node/v9/inspector.d.ts | 2488 ++++++++++++ types/node/v9/node-tests.ts | 4010 +++++++++++++++++++ types/node/v9/tsconfig.json | 29 + types/node/v9/tslint.json | 26 + 6 files changed, 14377 insertions(+), 39 deletions(-) create mode 100644 types/node/v9/index.d.ts create mode 100644 types/node/v9/inspector.d.ts create mode 100644 types/node/v9/node-tests.ts create mode 100644 types/node/v9/tsconfig.json create mode 100644 types/node/v9/tslint.json diff --git a/types/node/index.d.ts b/types/node/index.d.ts index 50a17ddb76..0eeb696a4e 100644 --- a/types/node/index.d.ts +++ b/types/node/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Node.js 9.6.x +// Type definitions for Node.js 10.0.x // Project: http://nodejs.org/ // Definitions by: Microsoft TypeScript // DefinitelyTyped @@ -42,6 +42,7 @@ interface Console { timeEnd(label: string): void; trace(message?: any, ...optionalParams: any[]): void; warn(message?: any, ...optionalParams: any[]): void; + table(tabularData: any, properties?: string[]): void; } interface Error { @@ -77,8 +78,10 @@ interface Iterator { next(value?: any): IteratorResult; } interface IteratorResult { } +interface AsyncIterableIterator {} interface SymbolConstructor { readonly iterator: symbol; + readonly asyncIterator: symbol; } declare var Symbol: SymbolConstructor; @@ -185,18 +188,21 @@ declare var Buffer: { * * @param str String to store in buffer. * @param encoding encoding to use, optional. Default is 'utf8' + * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead. */ new(str: string, encoding?: string): Buffer; /** * Allocates a new buffer of {size} octets. * * @param size count of octets to allocate. + * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`). */ new(size: number): Buffer; /** * Allocates a new buffer containing the given {array} of octets. * * @param array The octets to store. + * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. */ new(array: Uint8Array): Buffer; /** @@ -205,18 +211,21 @@ declare var Buffer: { * * * @param arrayBuffer The ArrayBuffer with which to share memory. + * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead. */ new(arrayBuffer: ArrayBuffer): Buffer; /** * Allocates a new buffer containing the given {array} of octets. * * @param array The octets to store. + * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead. */ new(array: any[]): Buffer; /** * Copies the passed {buffer} data onto a new {Buffer} instance. * * @param buffer The buffer to copy. + * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead. */ new(buffer: Buffer): Buffer; prototype: Buffer; @@ -252,7 +261,7 @@ declare var Buffer: { * * @param encoding string to test. */ - isEncoding(encoding: string): boolean; + isEncoding(encoding: string): boolean | undefined; /** * Gives the actual byte length of a string. encoding defaults to 'utf8'. * This is not the same as String.prototype.length since that returns the number of characters in a string. @@ -439,6 +448,7 @@ declare namespace NodeJS { unshift(chunk: string): void; unshift(chunk: Buffer): void; wrap(oldStream: ReadableStream): this; + [Symbol.asyncIterator](): AsyncIterableIterator; } export interface WritableStream extends EventEmitter { @@ -2367,40 +2377,44 @@ declare module "url" { unicode?: boolean; } - export class URLSearchParams implements Iterable<[string, string]> { - constructor(init?: URLSearchParams | string | { [key: string]: string | string[] | undefined } | Iterable<[string, string]> | Array<[string, string]>); - append(name: string, value: string): void; - delete(name: string): void; - entries(): IterableIterator<[string, string]>; - forEach(callback: (value: string, name: string) => void): void; - get(name: string): string | null; - getAll(name: string): string[]; - has(name: string): boolean; - keys(): IterableIterator; - set(name: string, value: string): void; - sort(): void; - toString(): string; - values(): IterableIterator; - [Symbol.iterator](): IterableIterator<[string, string]>; + global { + class URL { + constructor(input: string, base?: string | URL); + hash: string; + host: string; + hostname: string; + href: string; + readonly origin: string; + password: string; + pathname: string; + port: string; + protocol: string; + search: string; + readonly searchParams: URLSearchParams; + username: string; + toString(): string; + toJSON(): string; + } + + class URLSearchParams implements Iterable<[string, string]> { + constructor(init?: URLSearchParams | string | { [key: string]: string | string[] | undefined } | Iterable<[string, string]> | Array<[string, string]>); + append(name: string, value: string): void; + delete(name: string): void; + entries(): IterableIterator<[string, string]>; + forEach(callback: (value: string, name: string) => void): void; + get(name: string): string | null; + getAll(name: string): string[]; + has(name: string): boolean; + keys(): IterableIterator; + set(name: string, value: string): void; + sort(): void; + toString(): string; + values(): IterableIterator; + [Symbol.iterator](): IterableIterator<[string, string]>; + } } - export class URL { - constructor(input: string, base?: string | URL); - hash: string; - host: string; - hostname: string; - href: string; - readonly origin: string; - password: string; - pathname: string; - port: string; - protocol: string; - search: string; - readonly searchParams: URLSearchParams; - username: string; - toString(): string; - toJSON(): string; - } + export { URL, URLSearchParams }; } declare module "dns" { @@ -4571,6 +4585,482 @@ declare module "fs" { export function copyFileSync(src: PathLike, dest: PathLike, flags?: number): void; } +declare module "fs/promises" { + import { PathLike, Stats } from "fs"; + interface FileHandle { + /** + * Gets the file descriptor for this file handle. + */ + readonly fd: number; + + /** + * Asynchronously append data to a file, creating the file if it does not exist. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for appending. + * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + appendFile(data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string | number } | string | null): Promise; + + /** + * Asynchronous fchown(2) - Change ownership of a file. + */ + chown(uid: number, gid: number): Promise; + + /** + * Asynchronous fchmod(2) - Change permissions of a file. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + chmod(mode: string | number): Promise; + + /** + * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. + */ + datasync(): Promise; + + /** + * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + */ + sync(): Promise; + + /** + * Asynchronously reads data from the file. + * The `FileHandle` must have been opened for reading. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. + */ + read(buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesRead: number, buffer: TBuffer }>; + + /** + * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for reading. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + readFile(options?: { encoding?: null, flag?: string | number } | null): Promise; + + /** + * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for reading. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + readFile(options: { encoding: BufferEncoding, flag?: string | number } | BufferEncoding): Promise; + + /** + * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for reading. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + readFile(options?: { encoding?: string | null, flag?: string | number } | string | null): Promise; + + /** + * Asynchronous fstat(2) - Get file status. + */ + stat(): Promise; + + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param len If not specified, defaults to `0`. + */ + truncate(len?: number): Promise; + + /** + * Asynchronously change file timestamps of the file. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + utimes(atime: string | number | Date, mtime: string | number | Date): Promise; + + /** + * Asynchronously writes `buffer` to the file. + * The `FileHandle` must have been opened for writing. + * @param buffer The buffer that the data will be written to. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + write(buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesWritten: number, buffer: TBuffer }>; + + /** + * Asynchronously writes `string` to the file. + * The `FileHandle` must have been opened for writing. + * It is unsafe to call `write()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected). For this scenario, `fs.createWriteStream` is strongly recommended. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + write(data: any, position?: number | null, encoding?: string | null): Promise<{ bytesWritten: number, buffer: string }>; + + /** + * Asynchronously writes data to a file, replacing the file if it already exists. The underlying file will _not_ be closed automatically. + * The `FileHandle` must have been opened for writing. + * It is unsafe to call `writeFile()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected). + * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + writeFile(data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string | number } | string | null): Promise; + + /** + * Asynchronous close(2) - close a `FileHandle`. + */ + close(): Promise; + } + + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function access(path: PathLike, mode?: number): Promise; + + /** + * Asynchronously copies `src` to `dest`. By default, `dest` is overwritten if it already exists. + * Node.js makes no guarantees about the atomicity of the copy operation. + * If an error occurs after the destination file has been opened for writing, Node.js will attempt + * to remove the destination. + * @param src A path to the source file. + * @param dest A path to the destination file. + * @param flags An optional integer that specifies the behavior of the copy operation. The only + * supported flag is `fs.constants.COPYFILE_EXCL`, which causes the copy operation to fail if + * `dest` already exists. + */ + function copyFile(src: PathLike, dest: PathLike, flags?: number): Promise; + + /** + * Asynchronous open(2) - open and possibly create a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not + * supplied, defaults to `0o666`. + */ + function open(path: PathLike, flags: string | number, mode?: string | number): Promise; + + /** + * Asynchronously reads data from the file referenced by the supplied `FileHandle`. + * @param handle A `FileHandle`. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If + * `null`, data will be read from the current position. + */ + function read(handle: FileHandle, buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesRead: number, buffer: TBuffer }>; + + /** + * Asynchronously writes `buffer` to the file referenced by the supplied `FileHandle`. + * It is unsafe to call `fsPromises.write()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected). For this scenario, `fs.createWriteStream` is strongly recommended. + * @param handle A `FileHandle`. + * @param buffer The buffer that the data will be written to. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + function write(handle: FileHandle, buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesWritten: number, buffer: TBuffer }>; + + /** + * Asynchronously writes `string` to the file referenced by the supplied `FileHandle`. + * It is unsafe to call `fsPromises.write()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected). For this scenario, `fs.createWriteStream` is strongly recommended. + * @param handle A `FileHandle`. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + function write(handle: FileHandle, string: any, position?: number | null, encoding?: string | null): Promise<{ bytesWritten: number, buffer: string }>; + + /** + * Asynchronous rename(2) - Change the name or location of a file or directory. + * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function rename(oldPath: PathLike, newPath: PathLike): Promise; + + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param len If not specified, defaults to `0`. + */ + function truncate(path: PathLike, len?: number): Promise; + + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param handle A `FileHandle`. + * @param len If not specified, defaults to `0`. + */ + function ftruncate(handle: FileHandle, len?: number): Promise; + + /** + * Asynchronous rmdir(2) - delete a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function rmdir(path: PathLike): Promise; + + /** + * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. + * @param handle A `FileHandle`. + */ + function fdatasync(handle: FileHandle): Promise; + + /** + * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + * @param handle A `FileHandle`. + */ + function fsync(handle: FileHandle): Promise; + + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + function mkdir(path: PathLike, mode?: string | number): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readdir(path: PathLike, options?: { encoding?: string | null } | string | null): Promise; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function readlink(path: PathLike, options?: { encoding?: string | null } | string | null): Promise; + + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). + * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. + */ + function symlink(target: PathLike, path: PathLike, type?: string | null): Promise; + + /** + * Asynchronous fstat(2) - Get file status. + * @param handle A `FileHandle`. + */ + function fstat(handle: FileHandle): Promise; + + /** + * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function lstat(path: PathLike): Promise; + + /** + * Asynchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function stat(path: PathLike): Promise; + + /** + * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. + * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function link(existingPath: PathLike, newPath: PathLike): Promise; + + /** + * Asynchronous unlink(2) - delete a name and possibly the file it refers to. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function unlink(path: PathLike): Promise; + + /** + * Asynchronous fchmod(2) - Change permissions of a file. + * @param handle A `FileHandle`. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function fchmod(handle: FileHandle, mode: string | number): Promise; + + /** + * Asynchronous chmod(2) - Change permissions of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function chmod(path: PathLike, mode: string | number): Promise; + + /** + * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + function lchmod(path: PathLike, mode: string | number): Promise; + + /** + * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function lchown(path: PathLike, uid: number, gid: number): Promise; + + /** + * Asynchronous fchown(2) - Change ownership of a file. + * @param handle A `FileHandle`. + */ + function fchown(handle: FileHandle, uid: number, gid: number): Promise; + + /** + * Asynchronous chown(2) - Change ownership of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + function chown(path: PathLike, uid: number, gid: number): Promise; + + /** + * Asynchronously change file timestamps of the file referenced by the supplied path. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise; + + /** + * Asynchronously change file timestamps of the file referenced by the supplied `FileHandle`. + * @param handle A `FileHandle`. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + function futimes(handle: FileHandle, atime: string | number | Date, mtime: string | number | Date): Promise; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function realpath(path: PathLike, options?: { encoding?: string | null } | string | null): Promise; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required `prefix` to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + function mkdtemp(prefix: string, options?: { encoding?: string | null } | string | null): Promise; + + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * It is unsafe to call `fsPromises.writeFile()` multiple times on the same file without waiting for the `Promise` to be resolved (or rejected). + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + function writeFile(path: PathLike | FileHandle, data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string | number } | string | null): Promise; + + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a `Buffer` or `Uint8Array` is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + function appendFile(path: PathLike | FileHandle, data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string | number } | string | null): Promise; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile(path: PathLike | FileHandle, options?: { encoding?: null, flag?: string | number } | null): Promise; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile(path: PathLike | FileHandle, options: { encoding: BufferEncoding, flag?: string | number } | BufferEncoding): Promise; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a `FileHandle` is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + function readFile(path: PathLike | FileHandle, options?: { encoding?: string | null, flag?: string | number } | string | null): Promise; +} + declare module "path" { /** * A parsed path object generated by path.parse() or consumed by path.format(). @@ -5131,6 +5621,7 @@ declare module "crypto" { (): Certificate; }; + /** @deprecated since v10.0.0 */ export var fips: boolean; export interface CredentialDetails { @@ -5279,6 +5770,7 @@ declare module "crypto" { } export function createECDH(curve_name: string): ECDH; export function timingSafeEqual(a: Buffer, b: Buffer): boolean; + /** @deprecated since v10.0.0 */ export var DEFAULT_ENCODING: string; } @@ -5375,6 +5867,8 @@ declare module "stream" { removeListener(event: "end", listener: () => void): this; removeListener(event: "readable", listener: () => void): this; removeListener(event: "error", listener: (err: Error) => void): this; + + [Symbol.asyncIterator](): AsyncIterableIterator; } export interface WritableOptions { @@ -5511,6 +6005,21 @@ declare module "stream" { } export class PassThrough extends Transform { } + + export function pipeline(stream1: NodeJS.ReadableStream, stream2: T, callback?: (err: NodeJS.ErrnoException) => void): T; + export function pipeline(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: T, callback?: (err: NodeJS.ErrnoException) => void): T; + export function pipeline(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: NodeJS.ReadWriteStream, stream4: T, callback?: (err: NodeJS.ErrnoException) => void): T; + export function pipeline(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: NodeJS.ReadWriteStream, stream4: NodeJS.ReadWriteStream, stream5: T, callback?: (err: NodeJS.ErrnoException) => void): T; + export function pipeline(streams: Array, callback?: (err: NodeJS.ErrnoException) => void): NodeJS.WritableStream; + export function pipeline(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, ...streams: Array void)>): NodeJS.WritableStream; + export namespace pipeline { + export function __promisify__(stream1: NodeJS.ReadableStream, stream2: T): Promise; + export function __promisify__(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: T): Promise; + export function __promisify__(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: NodeJS.ReadWriteStream, stream4: T): Promise; + export function __promisify__(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream, stream3: NodeJS.ReadWriteStream, stream4: NodeJS.ReadWriteStream, stream5: T): Promise; + export function __promisify__(streams: Array): Promise; + export function __promisify__(stream1: NodeJS.ReadableStream, stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream, ...streams: Array): Promise; + } } export = internal; @@ -5519,10 +6028,15 @@ declare module "stream" { declare module "util" { export interface InspectOptions extends NodeJS.InspectOptions { } export function format(format: any, ...param: any[]): string; + /** @deprecated since v0.11.3 - use `console.error()` instead. */ export function debug(string: string): void; + /** @deprecated since v0.11.3 - use `console.error()` instead. */ export function error(...param: any[]): void; + /** @deprecated since v0.11.3 - use `console.log()` instead. */ export function puts(...param: any[]): void; + /** @deprecated since v0.11.3 - use `console.log()` instead. */ export function print(...param: any[]): void; + /** @deprecated since v0.11.3 - use a third party module instead. */ export function log(string: string): void; export var inspect: { (object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string; @@ -5536,22 +6050,37 @@ declare module "util" { defaultOptions: InspectOptions; custom: symbol; }; + /** @deprecated since v4.0.0 - use `Array.isArray()` instead. */ export function isArray(object: any): object is any[]; + /** @deprecated since v4.0.0 - use `util.types.isRegExp()` instead. */ export function isRegExp(object: any): object is RegExp; + /** @deprecated since v4.0.0 - use `util.types.isDate()` instead. */ export function isDate(object: any): object is Date; + /** @deprecated since v4.0.0 - use `util.types.isNativeError()` instead. */ export function isError(object: any): object is Error; export function inherits(constructor: any, superConstructor: any): void; export function debuglog(key: string): (msg: string, ...param: any[]) => void; + /** @deprecated since v4.0.0 - use `typeof value === 'boolean'` instead. */ export function isBoolean(object: any): object is boolean; + /** @deprecated since v4.0.0 - use `Buffer.isBuffer()` instead. */ export function isBuffer(object: any): object is Buffer; + /** @deprecated since v4.0.0 - use `typeof value === 'function'` instead. */ export function isFunction(object: any): boolean; + /** @deprecated since v4.0.0 - use `value === null` instead. */ export function isNull(object: any): object is null; + /** @deprecated since v4.0.0 - use `value === null || value === undefined` instead. */ export function isNullOrUndefined(object: any): object is null | undefined; + /** @deprecated since v4.0.0 - use `typeof value === 'number'` instead. */ export function isNumber(object: any): object is number; + /** @deprecated since v4.0.0 - use `value !== null && typeof value === 'object'` instead. */ export function isObject(object: any): boolean; + /** @deprecated since v4.0.0 - use `(typeof value !== 'object' && typeof value !== 'function') || value === null` instead. */ export function isPrimitive(object: any): boolean; + /** @deprecated since v4.0.0 - use `typeof value === 'string'` instead. */ export function isString(object: any): object is string; + /** @deprecated since v4.0.0 - use `typeof value === 'symbol'` instead. */ export function isSymbol(object: any): object is symbol; + /** @deprecated since v4.0.0 - use `value === undefined` instead. */ export function isUndefined(object: any): object is undefined; export function deprecate(fn: T, message: string): T; @@ -5591,6 +6120,44 @@ declare module "util" { export namespace promisify { const custom: symbol; } + + export namespace types { + export function isAnyArrayBuffer(object: any): boolean; + export function isArgumentsObject(object: any): object is IArguments; + export function isArrayBuffer(object: any): object is ArrayBuffer; + export function isAsyncFunction(object: any): boolean; + export function isBooleanObject(object: any): object is Boolean; + export function isDataView(object: any): object is DataView; + export function isDate(object: any): object is Date; + export function isExternal(object: any): boolean; + export function isFloat32Array(object: any): object is Float32Array; + export function isFloat64Array(object: any): object is Float64Array; + export function isGeneratorFunction(object: any): boolean; + export function isGeneratorObject(object: any): boolean; + export function isInt8Array(object: any): object is Int8Array; + export function isInt16Array(object: any): object is Int16Array; + export function isInt32Array(object: any): object is Int32Array; + export function isMap(object: any): object is Map; + export function isMapIterator(object: any): boolean; + export function isNativeError(object: any): object is Error; + export function isNumberObject(object: any): object is Number; + export function isPromise(object: any): object is Promise; + export function isProxy(object: any): boolean; + export function isRegExp(object: any): object is RegExp; + export function isSet(object: any): object is Set; + export function isSetIterator(object: any): boolean; + export function isSharedArrayBuffer(object: any): boolean; + export function isStringObject(object: any): object is String; + export function isSymbolObject(object: any): object is Symbol; + export function isTypedArray(object: any): object is Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array; + export function isUint8Array(object: any): object is Uint8Array; + export function isUint8ClampedArray(object: any): object is Uint8ClampedArray; + export function isUint16Array(object: any): object is Uint16Array; + export function isUint32Array(object: any): object is Uint32Array; + export function isWeakMap(object: any): object is WeakMap; + export function isWeakSet(object: any): object is WeakSet; + export function isWebAssemblyCompiledModule(object: any): boolean; + } } declare module "assert" { @@ -5633,6 +6200,11 @@ declare module "assert" { export function doesNotThrow(block: Function, error: (err: any) => boolean, message?: string): void; export function ifError(value: any): void; + + export function rejects(block: Function | Promise, message?: string): Promise; + export function rejects(block: Function | Promise, error: Function | RegExp | Object | Error, message?: string): Promise; + export function doesNotReject(block: Function | Promise, message?: string): Promise; + export function doesNotReject(block: Function | Promise, error: Function | RegExp | Object | Error, message?: string): Promise; } export = internal; @@ -6014,15 +6586,11 @@ declare module "async_hooks" { * Returns the asyncId of the current execution context. */ export function executionAsyncId(): number; - /// @deprecated - replaced by executionAsyncId() - export function currentId(): number; /** * Returns the ID of the resource responsible for calling the callback that is currently being executed. */ export function triggerAsyncId(): number; - /// @deprecated - replaced by triggerAsyncId() - export function triggerId(): number; export interface HookCallbacks { /** @@ -6975,6 +7543,8 @@ declare module "http2" { } declare module "perf_hooks" { + import { AsyncResource } from "async_hooks"; + export interface PerformanceEntry { /** * The total number of milliseconds elapsed for this entry. @@ -7187,7 +7757,7 @@ declare module "perf_hooks" { export type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void; - export class PerformanceObserver { + export class PerformanceObserver extends AsyncResource { constructor(callback: PerformanceObserverCallback); /** diff --git a/types/node/v9/index.d.ts b/types/node/v9/index.d.ts new file mode 100644 index 0000000000..50a17ddb76 --- /dev/null +++ b/types/node/v9/index.d.ts @@ -0,0 +1,7215 @@ +// Type definitions for Node.js 9.6.x +// Project: http://nodejs.org/ +// Definitions by: Microsoft TypeScript +// DefinitelyTyped +// Parambir Singh +// Christian Vaagland Tellnes +// Wilco Bakker +// Nicolas Voigt +// Chigozirim C. +// Flarna +// Mariusz Wiktorczyk +// wwwy3y3 +// Deividas Bakanas +// Kelvin Jin +// Alvis HT Tang +// Oliver Joseph Ash +// Sebastian Silbermann +// Hannes Magnusson +// Alberto Schiabel +// Klaus Meinhardt +// Huw +// Nicolas Even +// Bruno Scheufler +// Mohsen Azimi +// Hoàng Văn Khải +// Alexander T. +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/** inspector module types */ +/// + +// This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build +interface Console { + Console: NodeJS.ConsoleConstructor; + assert(value: any, message?: string, ...optionalParams: any[]): void; + dir(obj: any, options?: NodeJS.InspectOptions): void; + debug(message?: any, ...optionalParams: any[]): void; + error(message?: any, ...optionalParams: any[]): void; + info(message?: any, ...optionalParams: any[]): void; + log(message?: any, ...optionalParams: any[]): void; + time(label: string): void; + timeEnd(label: string): void; + trace(message?: any, ...optionalParams: any[]): void; + warn(message?: any, ...optionalParams: any[]): void; +} + +interface Error { + stack?: string; +} + +// Declare "static" methods in Error +interface ErrorConstructor { + /** Create .stack property on a target object */ + captureStackTrace(targetObject: Object, constructorOpt?: Function): void; + + /** + * Optional override for formatting stack traces + * + * @see https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces + */ + prepareStackTrace?: (err: Error, stackTraces: NodeJS.CallSite[]) => any; + + stackTraceLimit: number; +} + +// compat for TypeScript 1.8 +// if you use with --target es3 or --target es5 and use below definitions, +// use the lib.es6.d.ts that is bundled with TypeScript 1.8. +interface MapConstructor { } +interface WeakMapConstructor { } +interface SetConstructor { } +interface WeakSetConstructor { } + +// Forward-declare needed types from lib.es2015.d.ts (in case users are using `--lib es5`) +interface Iterable { } +interface Iterator { + next(value?: any): IteratorResult; +} +interface IteratorResult { } +interface SymbolConstructor { + readonly iterator: symbol; +} +declare var Symbol: SymbolConstructor; + +// Node.js ESNEXT support +interface String { + /** Removes whitespace from the left end of a string. */ + trimLeft(): string; + /** Removes whitespace from the right end of a string. */ + trimRight(): string; +} + +/************************************************ +* * +* GLOBAL * +* * +************************************************/ +declare var process: NodeJS.Process; +declare var global: NodeJS.Global; +declare var console: Console; + +declare var __filename: string; +declare var __dirname: string; + +declare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; +declare namespace setTimeout { + export function __promisify__(ms: number): Promise; + export function __promisify__(ms: number, value: T): Promise; +} +declare function clearTimeout(timeoutId: NodeJS.Timer): void; +declare function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; +declare function clearInterval(intervalId: NodeJS.Timer): void; +declare function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any; +declare namespace setImmediate { + export function __promisify__(): Promise; + export function __promisify__(value: T): Promise; +} +declare function clearImmediate(immediateId: any): void; + +// TODO: change to `type NodeRequireFunction = (id: string) => any;` in next mayor version. +interface NodeRequireFunction { + /* tslint:disable-next-line:callable-types */ + (id: string): any; +} + +interface NodeRequire extends NodeRequireFunction { + resolve: RequireResolve; + cache: any; + extensions: NodeExtensions; + main: NodeModule | undefined; +} + +interface RequireResolve { + (id: string, options?: { paths?: string[]; }): string; + paths(request: string): string[] | null; +} + +interface NodeExtensions { + '.js': (m: NodeModule, filename: string) => any; + '.json': (m: NodeModule, filename: string) => any; + '.node': (m: NodeModule, filename: string) => any; + [ext: string]: (m: NodeModule, filename: string) => any; +} + +declare var require: NodeRequire; + +interface NodeModule { + exports: any; + require: NodeRequireFunction; + id: string; + filename: string; + loaded: boolean; + parent: NodeModule | null; + children: NodeModule[]; + paths: string[]; +} + +declare var module: NodeModule; + +// Same as module.exports +declare var exports: any; +declare var SlowBuffer: { + new(str: string, encoding?: string): Buffer; + new(size: number): Buffer; + new(size: Uint8Array): Buffer; + new(array: any[]): Buffer; + prototype: Buffer; + isBuffer(obj: any): boolean; + byteLength(string: string, encoding?: string): number; + concat(list: Buffer[], totalLength?: number): Buffer; +}; + +// Buffer class +type BufferEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "base64" | "latin1" | "binary" | "hex"; +interface Buffer extends NodeBuffer { } + +/** + * Raw data is stored in instances of the Buffer class. + * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized. + * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + */ +declare var Buffer: { + /** + * Allocates a new buffer containing the given {str}. + * + * @param str String to store in buffer. + * @param encoding encoding to use, optional. Default is 'utf8' + */ + new(str: string, encoding?: string): Buffer; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + */ + new(size: number): Buffer; + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + new(array: Uint8Array): Buffer; + /** + * Produces a Buffer backed by the same allocated memory as + * the given {ArrayBuffer}. + * + * + * @param arrayBuffer The ArrayBuffer with which to share memory. + */ + new(arrayBuffer: ArrayBuffer): Buffer; + /** + * Allocates a new buffer containing the given {array} of octets. + * + * @param array The octets to store. + */ + new(array: any[]): Buffer; + /** + * Copies the passed {buffer} data onto a new {Buffer} instance. + * + * @param buffer The buffer to copy. + */ + new(buffer: Buffer): Buffer; + prototype: Buffer; + /** + * When passed a reference to the .buffer property of a TypedArray instance, + * the newly created Buffer will share the same allocated memory as the TypedArray. + * The optional {byteOffset} and {length} arguments specify a memory range + * within the {arrayBuffer} that will be shared by the Buffer. + * + * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer() + */ + from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer; + /** + * Creates a new Buffer using the passed {data} + * @param data data to create a new Buffer + */ + from(data: any[] | string | Buffer | ArrayBuffer /*| TypedArray*/): Buffer; + /** + * Creates a new Buffer containing the given JavaScript string {str}. + * If provided, the {encoding} parameter identifies the character encoding. + * If not provided, {encoding} defaults to 'utf8'. + */ + from(str: string, encoding?: string): Buffer; + /** + * Returns true if {obj} is a Buffer + * + * @param obj object to test. + */ + isBuffer(obj: any): obj is Buffer; + /** + * Returns true if {encoding} is a valid encoding argument. + * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex' + * + * @param encoding string to test. + */ + isEncoding(encoding: string): boolean; + /** + * Gives the actual byte length of a string. encoding defaults to 'utf8'. + * This is not the same as String.prototype.length since that returns the number of characters in a string. + * + * @param string string to test. (TypedArray is also allowed, but it is only available starting ES2017) + * @param encoding encoding used to evaluate (defaults to 'utf8') + */ + byteLength(string: string | Buffer | DataView | ArrayBuffer, encoding?: string): number; + /** + * Returns a buffer which is the result of concatenating all the buffers in the list together. + * + * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer. + * If the list has exactly one item, then the first item of the list is returned. + * If the list has more than one item, then a new Buffer is created. + * + * @param list An array of Buffer objects to concatenate + * @param totalLength Total length of the buffers when concatenated. + * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly. + */ + concat(list: Buffer[], totalLength?: number): Buffer; + /** + * The same as buf1.compare(buf2). + */ + compare(buf1: Buffer, buf2: Buffer): number; + /** + * Allocates a new buffer of {size} octets. + * + * @param size count of octets to allocate. + * @param fill if specified, buffer will be initialized by calling buf.fill(fill). + * If parameter is omitted, buffer will be filled with zeros. + * @param encoding encoding used for call to buf.fill while initalizing + */ + alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer; + /** + * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + allocUnsafe(size: number): Buffer; + /** + * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents + * of the newly created Buffer are unknown and may contain sensitive data. + * + * @param size count of octets to allocate + */ + allocUnsafeSlow(size: number): Buffer; + /** + * This is the number of bytes used to determine the size of pre-allocated, internal Buffer instances used for pooling. This value may be modified. + */ + poolSize: number; +}; + +/************************************************ +* * +* GLOBAL INTERFACES * +* * +************************************************/ +declare namespace NodeJS { + export interface InspectOptions { + showHidden?: boolean; + depth?: number | null; + colors?: boolean; + customInspect?: boolean; + showProxy?: boolean; + maxArrayLength?: number | null; + breakLength?: number; + } + + export interface ConsoleConstructor { + prototype: Console; + new(stdout: WritableStream, stderr?: WritableStream): Console; + } + + export interface CallSite { + /** + * Value of "this" + */ + getThis(): any; + + /** + * Type of "this" as a string. + * This is the name of the function stored in the constructor field of + * "this", if available. Otherwise the object's [[Class]] internal + * property. + */ + getTypeName(): string | null; + + /** + * Current function + */ + getFunction(): Function | undefined; + + /** + * Name of the current function, typically its name property. + * If a name property is not available an attempt will be made to try + * to infer a name from the function's context. + */ + getFunctionName(): string | null; + + /** + * Name of the property [of "this" or one of its prototypes] that holds + * the current function + */ + getMethodName(): string | null; + + /** + * Name of the script [if this function was defined in a script] + */ + getFileName(): string | null; + + /** + * Current line number [if this function was defined in a script] + */ + getLineNumber(): number | null; + + /** + * Current column number [if this function was defined in a script] + */ + getColumnNumber(): number | null; + + /** + * A call site object representing the location where eval was called + * [if this function was created using a call to eval] + */ + getEvalOrigin(): string | undefined; + + /** + * Is this a toplevel invocation, that is, is "this" the global object? + */ + isToplevel(): boolean; + + /** + * Does this call take place in code defined by a call to eval? + */ + isEval(): boolean; + + /** + * Is this call in native V8 code? + */ + isNative(): boolean; + + /** + * Is this a constructor call? + */ + isConstructor(): boolean; + } + + export interface ErrnoException extends Error { + errno?: number; + code?: string; + path?: string; + syscall?: string; + stack?: string; + } + + export class EventEmitter { + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeAllListeners(event?: string | symbol): this; + setMaxListeners(n: number): this; + getMaxListeners(): number; + listeners(event: string | symbol): Function[]; + rawListeners(event: string | symbol): Function[]; + emit(event: string | symbol, ...args: any[]): boolean; + listenerCount(type: string | symbol): number; + // Added in Node 6... + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + eventNames(): Array; + } + + export interface ReadableStream extends EventEmitter { + readable: boolean; + read(size?: number): string | Buffer; + setEncoding(encoding: string): this; + pause(): this; + resume(): this; + isPaused(): boolean; + pipe(destination: T, options?: { end?: boolean; }): T; + unpipe(destination?: T): this; + unshift(chunk: string): void; + unshift(chunk: Buffer): void; + wrap(oldStream: ReadableStream): this; + } + + export interface WritableStream extends EventEmitter { + writable: boolean; + write(buffer: Buffer | string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; + end(cb?: Function): void; + end(buffer: Buffer, cb?: Function): void; + end(str: string, cb?: Function): void; + end(str: string, encoding?: string, cb?: Function): void; + } + + export interface ReadWriteStream extends ReadableStream, WritableStream { } + + export interface Events extends EventEmitter { } + + export interface Domain extends Events { + run(fn: Function): void; + add(emitter: Events): void; + remove(emitter: Events): void; + bind(cb: (err: Error, data: any) => any): any; + intercept(cb: (data: any) => any): any; + + addListener(event: string, listener: (...args: any[]) => void): this; + on(event: string, listener: (...args: any[]) => void): this; + once(event: string, listener: (...args: any[]) => void): this; + removeListener(event: string, listener: (...args: any[]) => void): this; + removeAllListeners(event?: string): this; + } + + export interface MemoryUsage { + rss: number; + heapTotal: number; + heapUsed: number; + } + + export interface CpuUsage { + user: number; + system: number; + } + + export interface ProcessVersions { + http_parser: string; + node: string; + v8: string; + ares: string; + uv: string; + zlib: string; + modules: string; + openssl: string; + } + + type Platform = 'aix' + | 'android' + | 'darwin' + | 'freebsd' + | 'linux' + | 'openbsd' + | 'sunos' + | 'win32' + | 'cygwin'; + + type Signals = + "SIGABRT" | "SIGALRM" | "SIGBUS" | "SIGCHLD" | "SIGCONT" | "SIGFPE" | "SIGHUP" | "SIGILL" | "SIGINT" | "SIGIO" | + "SIGIOT" | "SIGKILL" | "SIGPIPE" | "SIGPOLL" | "SIGPROF" | "SIGPWR" | "SIGQUIT" | "SIGSEGV" | "SIGSTKFLT" | + "SIGSTOP" | "SIGSYS" | "SIGTERM" | "SIGTRAP" | "SIGTSTP" | "SIGTTIN" | "SIGTTOU" | "SIGUNUSED" | "SIGURG" | + "SIGUSR1" | "SIGUSR2" | "SIGVTALRM" | "SIGWINCH" | "SIGXCPU" | "SIGXFSZ" | "SIGBREAK" | "SIGLOST" | "SIGINFO"; + + type BeforeExitListener = (code: number) => void; + type DisconnectListener = () => void; + type ExitListener = (code: number) => void; + type RejectionHandledListener = (promise: Promise) => void; + type UncaughtExceptionListener = (error: Error) => void; + type UnhandledRejectionListener = (reason: any, promise: Promise) => void; + type WarningListener = (warning: Error) => void; + type MessageListener = (message: any, sendHandle: any) => void; + type SignalsListener = (signal: Signals) => void; + type NewListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void; + type RemoveListenerListener = (type: string | symbol, listener: (...args: any[]) => void) => void; + + export interface Socket extends ReadWriteStream { + isTTY?: true; + } + + export interface ProcessEnv { + [key: string]: string | undefined; + } + + export interface WriteStream extends Socket { + readonly writableHighWaterMark: number; + readonly writableLength: number; + columns?: number; + rows?: number; + _write(chunk: any, encoding: string, callback: Function): void; + _destroy(err: Error, callback: Function): void; + _final(callback: Function): void; + setDefaultEncoding(encoding: string): this; + cork(): void; + uncork(): void; + destroy(error?: Error): void; + } + export interface ReadStream extends Socket { + readonly readableHighWaterMark: number; + readonly readableLength: number; + isRaw?: boolean; + setRawMode?(mode: boolean): void; + _read(size: number): void; + _destroy(err: Error, callback: Function): void; + push(chunk: any, encoding?: string): boolean; + destroy(error?: Error): void; + } + + export interface Process extends EventEmitter { + stdout: WriteStream; + stderr: WriteStream; + stdin: ReadStream; + openStdin(): Socket; + argv: string[]; + argv0: string; + execArgv: string[]; + execPath: string; + abort(): void; + chdir(directory: string): void; + cwd(): string; + emitWarning(warning: string | Error, name?: string, ctor?: Function): void; + env: ProcessEnv; + exit(code?: number): never; + exitCode: number; + getgid(): number; + setgid(id: number | string): void; + getuid(): number; + setuid(id: number | string): void; + geteuid(): number; + seteuid(id: number | string): void; + getegid(): number; + setegid(id: number | string): void; + getgroups(): number[]; + setgroups(groups: Array): void; + setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void; + hasUncaughtExceptionCaptureCallback(): boolean; + version: string; + versions: ProcessVersions; + config: { + target_defaults: { + cflags: any[]; + default_configuration: string; + defines: string[]; + include_dirs: string[]; + libraries: string[]; + }; + variables: { + clang: number; + host_arch: string; + node_install_npm: boolean; + node_install_waf: boolean; + node_prefix: string; + node_shared_openssl: boolean; + node_shared_v8: boolean; + node_shared_zlib: boolean; + node_use_dtrace: boolean; + node_use_etw: boolean; + node_use_openssl: boolean; + target_arch: string; + v8_no_strict_aliasing: number; + v8_use_snapshot: boolean; + visibility: string; + }; + }; + kill(pid: number, signal?: string | number): void; + pid: number; + ppid: number; + title: string; + arch: string; + platform: Platform; + mainModule?: NodeModule; + memoryUsage(): MemoryUsage; + cpuUsage(previousValue?: CpuUsage): CpuUsage; + nextTick(callback: Function, ...args: any[]): void; + umask(mask?: number): number; + uptime(): number; + hrtime(time?: [number, number]): [number, number]; + domain: Domain; + + // Worker + send?(message: any, sendHandle?: any): void; + disconnect(): void; + connected: boolean; + + /** + * EventEmitter + * 1. beforeExit + * 2. disconnect + * 3. exit + * 4. message + * 5. rejectionHandled + * 6. uncaughtException + * 7. unhandledRejection + * 8. warning + * 9. message + * 10. + * 11. newListener/removeListener inherited from EventEmitter + */ + addListener(event: "beforeExit", listener: BeforeExitListener): this; + addListener(event: "disconnect", listener: DisconnectListener): this; + addListener(event: "exit", listener: ExitListener): this; + addListener(event: "rejectionHandled", listener: RejectionHandledListener): this; + addListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; + addListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; + addListener(event: "warning", listener: WarningListener): this; + addListener(event: "message", listener: MessageListener): this; + addListener(event: Signals, listener: SignalsListener): this; + addListener(event: "newListener", listener: NewListenerListener): this; + addListener(event: "removeListener", listener: RemoveListenerListener): this; + + emit(event: "beforeExit", code: number): boolean; + emit(event: "disconnect"): boolean; + emit(event: "exit", code: number): boolean; + emit(event: "rejectionHandled", promise: Promise): boolean; + emit(event: "uncaughtException", error: Error): boolean; + emit(event: "unhandledRejection", reason: any, promise: Promise): boolean; + emit(event: "warning", warning: Error): boolean; + emit(event: "message", message: any, sendHandle: any): this; + emit(event: Signals): boolean; + emit(event: "newListener", eventName: string | symbol, listener: (...args: any[]) => void): this; + emit(event: "removeListener", eventName: string, listener: (...args: any[]) => void): this; + + on(event: "beforeExit", listener: BeforeExitListener): this; + on(event: "disconnect", listener: DisconnectListener): this; + on(event: "exit", listener: ExitListener): this; + on(event: "rejectionHandled", listener: RejectionHandledListener): this; + on(event: "uncaughtException", listener: UncaughtExceptionListener): this; + on(event: "unhandledRejection", listener: UnhandledRejectionListener): this; + on(event: "warning", listener: WarningListener): this; + on(event: "message", listener: MessageListener): this; + on(event: Signals, listener: SignalsListener): this; + on(event: "newListener", listener: NewListenerListener): this; + on(event: "removeListener", listener: RemoveListenerListener): this; + + once(event: "beforeExit", listener: BeforeExitListener): this; + once(event: "disconnect", listener: DisconnectListener): this; + once(event: "exit", listener: ExitListener): this; + once(event: "rejectionHandled", listener: RejectionHandledListener): this; + once(event: "uncaughtException", listener: UncaughtExceptionListener): this; + once(event: "unhandledRejection", listener: UnhandledRejectionListener): this; + once(event: "warning", listener: WarningListener): this; + once(event: "message", listener: MessageListener): this; + once(event: Signals, listener: SignalsListener): this; + once(event: "newListener", listener: NewListenerListener): this; + once(event: "removeListener", listener: RemoveListenerListener): this; + + prependListener(event: "beforeExit", listener: BeforeExitListener): this; + prependListener(event: "disconnect", listener: DisconnectListener): this; + prependListener(event: "exit", listener: ExitListener): this; + prependListener(event: "rejectionHandled", listener: RejectionHandledListener): this; + prependListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; + prependListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; + prependListener(event: "warning", listener: WarningListener): this; + prependListener(event: "message", listener: MessageListener): this; + prependListener(event: Signals, listener: SignalsListener): this; + prependListener(event: "newListener", listener: NewListenerListener): this; + prependListener(event: "removeListener", listener: RemoveListenerListener): this; + + prependOnceListener(event: "beforeExit", listener: BeforeExitListener): this; + prependOnceListener(event: "disconnect", listener: DisconnectListener): this; + prependOnceListener(event: "exit", listener: ExitListener): this; + prependOnceListener(event: "rejectionHandled", listener: RejectionHandledListener): this; + prependOnceListener(event: "uncaughtException", listener: UncaughtExceptionListener): this; + prependOnceListener(event: "unhandledRejection", listener: UnhandledRejectionListener): this; + prependOnceListener(event: "warning", listener: WarningListener): this; + prependOnceListener(event: "message", listener: MessageListener): this; + prependOnceListener(event: Signals, listener: SignalsListener): this; + prependOnceListener(event: "newListener", listener: NewListenerListener): this; + prependOnceListener(event: "removeListener", listener: RemoveListenerListener): this; + + listeners(event: "beforeExit"): BeforeExitListener[]; + listeners(event: "disconnect"): DisconnectListener[]; + listeners(event: "exit"): ExitListener[]; + listeners(event: "rejectionHandled"): RejectionHandledListener[]; + listeners(event: "uncaughtException"): UncaughtExceptionListener[]; + listeners(event: "unhandledRejection"): UnhandledRejectionListener[]; + listeners(event: "warning"): WarningListener[]; + listeners(event: "message"): MessageListener[]; + listeners(event: Signals): SignalsListener[]; + listeners(event: "newListener"): NewListenerListener[]; + listeners(event: "removeListener"): RemoveListenerListener[]; + } + + export interface Global { + Array: typeof Array; + ArrayBuffer: typeof ArrayBuffer; + Boolean: typeof Boolean; + Buffer: typeof Buffer; + DataView: typeof DataView; + Date: typeof Date; + Error: typeof Error; + EvalError: typeof EvalError; + Float32Array: typeof Float32Array; + Float64Array: typeof Float64Array; + Function: typeof Function; + GLOBAL: Global; + Infinity: typeof Infinity; + Int16Array: typeof Int16Array; + Int32Array: typeof Int32Array; + Int8Array: typeof Int8Array; + Intl: typeof Intl; + JSON: typeof JSON; + Map: MapConstructor; + Math: typeof Math; + NaN: typeof NaN; + Number: typeof Number; + Object: typeof Object; + Promise: Function; + RangeError: typeof RangeError; + ReferenceError: typeof ReferenceError; + RegExp: typeof RegExp; + Set: SetConstructor; + String: typeof String; + Symbol: Function; + SyntaxError: typeof SyntaxError; + TypeError: typeof TypeError; + URIError: typeof URIError; + Uint16Array: typeof Uint16Array; + Uint32Array: typeof Uint32Array; + Uint8Array: typeof Uint8Array; + Uint8ClampedArray: Function; + WeakMap: WeakMapConstructor; + WeakSet: WeakSetConstructor; + clearImmediate: (immediateId: any) => void; + clearInterval: (intervalId: NodeJS.Timer) => void; + clearTimeout: (timeoutId: NodeJS.Timer) => void; + console: typeof console; + decodeURI: typeof decodeURI; + decodeURIComponent: typeof decodeURIComponent; + encodeURI: typeof encodeURI; + encodeURIComponent: typeof encodeURIComponent; + escape: (str: string) => string; + eval: typeof eval; + global: Global; + isFinite: typeof isFinite; + isNaN: typeof isNaN; + parseFloat: typeof parseFloat; + parseInt: typeof parseInt; + process: Process; + root: Global; + setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => any; + setInterval: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer; + setTimeout: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer; + undefined: typeof undefined; + unescape: (str: string) => string; + gc: () => void; + v8debug?: any; + } + + export interface Timer { + ref(): void; + unref(): void; + } + + class Module { + static runMain(): void; + static wrap(code: string): string; + static builtinModules: string[]; + + static Module: typeof Module; + + exports: any; + require: NodeRequireFunction; + id: string; + filename: string; + loaded: boolean; + parent: Module | null; + children: Module[]; + paths: string[]; + + constructor(id: string, parent?: Module); + } +} + +interface IterableIterator { } + +/** + * @deprecated + */ +interface NodeBuffer extends Uint8Array { + write(string: string, offset?: number, length?: number, encoding?: string): number; + toString(encoding?: string, start?: number, end?: number): string; + toJSON(): { type: 'Buffer', data: any[] }; + equals(otherBuffer: Buffer): boolean; + compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number; + copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; + slice(start?: number, end?: number): Buffer; + writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number; + readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntLE(offset: number, byteLength: number, noAssert?: boolean): number; + readIntBE(offset: number, byteLength: number, noAssert?: boolean): number; + readUInt8(offset: number, noAssert?: boolean): number; + readUInt16LE(offset: number, noAssert?: boolean): number; + readUInt16BE(offset: number, noAssert?: boolean): number; + readUInt32LE(offset: number, noAssert?: boolean): number; + readUInt32BE(offset: number, noAssert?: boolean): number; + readInt8(offset: number, noAssert?: boolean): number; + readInt16LE(offset: number, noAssert?: boolean): number; + readInt16BE(offset: number, noAssert?: boolean): number; + readInt32LE(offset: number, noAssert?: boolean): number; + readInt32BE(offset: number, noAssert?: boolean): number; + readFloatLE(offset: number, noAssert?: boolean): number; + readFloatBE(offset: number, noAssert?: boolean): number; + readDoubleLE(offset: number, noAssert?: boolean): number; + readDoubleBE(offset: number, noAssert?: boolean): number; + swap16(): Buffer; + swap32(): Buffer; + swap64(): Buffer; + writeUInt8(value: number, offset: number, noAssert?: boolean): number; + writeUInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeUInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeInt8(value: number, offset: number, noAssert?: boolean): number; + writeInt16LE(value: number, offset: number, noAssert?: boolean): number; + writeInt16BE(value: number, offset: number, noAssert?: boolean): number; + writeInt32LE(value: number, offset: number, noAssert?: boolean): number; + writeInt32BE(value: number, offset: number, noAssert?: boolean): number; + writeFloatLE(value: number, offset: number, noAssert?: boolean): number; + writeFloatBE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleLE(value: number, offset: number, noAssert?: boolean): number; + writeDoubleBE(value: number, offset: number, noAssert?: boolean): number; + fill(value: any, offset?: number, end?: number): this; + indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number; + entries(): IterableIterator<[number, number]>; + includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean; + keys(): IterableIterator; + values(): IterableIterator; +} + +/************************************************ +* * +* MODULES * +* * +************************************************/ +declare module "buffer" { + export var INSPECT_MAX_BYTES: number; + var BuffType: typeof Buffer; + var SlowBuffType: typeof SlowBuffer; + export { BuffType as Buffer, SlowBuffType as SlowBuffer }; +} + +declare module "querystring" { + export interface StringifyOptions { + encodeURIComponent?: Function; + } + + export interface ParseOptions { + maxKeys?: number; + decodeURIComponent?: Function; + } + + interface ParsedUrlQuery { [key: string]: string | string[]; } + + export function stringify(obj: T, sep?: string, eq?: string, options?: StringifyOptions): string; + export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery; + export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): T; + export function escape(str: string): string; + export function unescape(str: string): string; +} + +declare module "events" { + class internal extends NodeJS.EventEmitter { } + + namespace internal { + export class EventEmitter extends internal { + static listenerCount(emitter: EventEmitter, event: string | symbol): number; // deprecated + static defaultMaxListeners: number; + + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + on(event: string | symbol, listener: (...args: any[]) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + prependListener(event: string | symbol, listener: (...args: any[]) => void): this; + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + removeAllListeners(event?: string | symbol): this; + setMaxListeners(n: number): this; + getMaxListeners(): number; + listeners(event: string | symbol): Function[]; + rawListeners(event: string | symbol): Function[]; + emit(event: string | symbol, ...args: any[]): boolean; + eventNames(): Array; + listenerCount(type: string | symbol): number; + } + } + + export = internal; +} + +declare module "http" { + import * as events from "events"; + import * as net from "net"; + import * as stream from "stream"; + import { URL } from "url"; + + // incoming headers will never contain number + export interface IncomingHttpHeaders { + 'accept'?: string; + 'access-control-allow-origin'?: string; + 'access-control-allow-credentials'?: string; + 'access-control-expose-headers'?: string; + 'access-control-max-age'?: string; + 'access-control-allow-methods'?: string; + 'access-control-allow-headers'?: string; + 'accept-patch'?: string; + 'accept-ranges'?: string; + 'authorization'?: string; + 'age'?: string; + 'allow'?: string; + 'alt-svc'?: string; + 'cache-control'?: string; + 'connection'?: string; + 'content-disposition'?: string; + 'content-encoding'?: string; + 'content-language'?: string; + 'content-length'?: string; + 'content-location'?: string; + 'content-range'?: string; + 'content-type'?: string; + 'date'?: string; + 'expires'?: string; + 'host'?: string; + 'last-modified'?: string; + 'location'?: string; + 'pragma'?: string; + 'proxy-authenticate'?: string; + 'public-key-pins'?: string; + 'retry-after'?: string; + 'set-cookie'?: string[]; + 'strict-transport-security'?: string; + 'trailer'?: string; + 'transfer-encoding'?: string; + 'tk'?: string; + 'upgrade'?: string; + 'vary'?: string; + 'via'?: string; + 'warning'?: string; + 'www-authenticate'?: string; + [header: string]: string | string[] | undefined; + } + + // outgoing headers allows numbers (as they are converted internally to strings) + export interface OutgoingHttpHeaders { + [header: string]: number | string | string[] | undefined; + } + + export interface ClientRequestArgs { + protocol?: string; + host?: string; + hostname?: string; + family?: number; + port?: number | string; + defaultPort?: number | string; + localAddress?: string; + socketPath?: string; + method?: string; + path?: string; + headers?: OutgoingHttpHeaders; + auth?: string; + agent?: Agent | boolean; + _defaultAgent?: Agent; + timeout?: number; + // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L278 + createConnection?: (options: ClientRequestArgs, oncreate: (err: Error, socket: net.Socket) => void) => net.Socket; + } + + export class Server extends net.Server { + constructor(requestListener?: (req: IncomingMessage, res: ServerResponse) => void); + + setTimeout(msecs?: number, callback?: () => void): this; + setTimeout(callback: () => void): this; + maxHeadersCount: number; + timeout: number; + keepAliveTimeout: number; + } + /** + * @deprecated Use IncomingMessage + */ + export class ServerRequest extends IncomingMessage { + connection: net.Socket; + } + + // https://github.com/nodejs/node/blob/master/lib/_http_outgoing.js + export class OutgoingMessage extends stream.Writable { + upgrading: boolean; + chunkedEncoding: boolean; + shouldKeepAlive: boolean; + useChunkedEncodingByDefault: boolean; + sendDate: boolean; + finished: boolean; + headersSent: boolean; + connection: net.Socket; + + constructor(); + + setTimeout(msecs: number, callback?: () => void): this; + destroy(error: Error): void; + setHeader(name: string, value: number | string | string[]): void; + getHeader(name: string): number | string | string[] | undefined; + getHeaders(): OutgoingHttpHeaders; + getHeaderNames(): string[]; + hasHeader(name: string): boolean; + removeHeader(name: string): void; + addTrailers(headers: OutgoingHttpHeaders | Array<[string, string]>): void; + flushHeaders(): void; + } + + // https://github.com/nodejs/node/blob/master/lib/_http_server.js#L108-L256 + export class ServerResponse extends OutgoingMessage { + statusCode: number; + statusMessage: string; + + constructor(req: IncomingMessage); + + assignSocket(socket: net.Socket): void; + detachSocket(socket: net.Socket): void; + // https://github.com/nodejs/node/blob/master/test/parallel/test-http-write-callbacks.js#L53 + // no args in writeContinue callback + writeContinue(callback?: () => void): void; + writeHead(statusCode: number, reasonPhrase?: string, headers?: OutgoingHttpHeaders): void; + writeHead(statusCode: number, headers?: OutgoingHttpHeaders): void; + } + + // https://github.com/nodejs/node/blob/master/lib/_http_client.js#L77 + export class ClientRequest extends OutgoingMessage { + connection: net.Socket; + socket: net.Socket; + aborted: number; + + constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void); + + abort(): void; + onSocket(socket: net.Socket): void; + setTimeout(timeout: number, callback?: () => void): this; + setNoDelay(noDelay?: boolean): void; + setSocketKeepAlive(enable?: boolean, initialDelay?: number): void; + } + + export class IncomingMessage extends stream.Readable { + constructor(socket: net.Socket); + + httpVersion: string; + httpVersionMajor: number; + httpVersionMinor: number; + connection: net.Socket; + headers: IncomingHttpHeaders; + rawHeaders: string[]; + trailers: { [key: string]: string | undefined }; + rawTrailers: string[]; + setTimeout(msecs: number, callback: () => void): this; + /** + * Only valid for request obtained from http.Server. + */ + method?: string; + /** + * Only valid for request obtained from http.Server. + */ + url?: string; + /** + * Only valid for response obtained from http.ClientRequest. + */ + statusCode?: number; + /** + * Only valid for response obtained from http.ClientRequest. + */ + statusMessage?: string; + socket: net.Socket; + destroy(error?: Error): void; + } + + /** + * @deprecated Use IncomingMessage + */ + export class ClientResponse extends IncomingMessage { } + + export interface AgentOptions { + /** + * Keep sockets around in a pool to be used by other requests in the future. Default = false + */ + keepAlive?: boolean; + /** + * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. + * Only relevant if keepAlive is set to true. + */ + keepAliveMsecs?: number; + /** + * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity + */ + maxSockets?: number; + /** + * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256. + */ + maxFreeSockets?: number; + } + + export class Agent { + maxSockets: number; + sockets: any; + requests: any; + + constructor(opts?: AgentOptions); + + /** + * Destroy any sockets that are currently in use by the agent. + * It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled, + * then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise, + * sockets may hang open for quite a long time before the server terminates them. + */ + destroy(): void; + } + + export var METHODS: string[]; + + export var STATUS_CODES: { + [errorCode: number]: string | undefined; + [errorCode: string]: string | undefined; + }; + + export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) => void): Server; + export function createClient(port?: number, host?: string): any; + + // although RequestOptions are passed as ClientRequestArgs to ClientRequest directly, + // create interface RequestOptions would make the naming more clear to developers + export interface RequestOptions extends ClientRequestArgs { } + export function request(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; + export function get(options: RequestOptions | string | URL, callback?: (res: IncomingMessage) => void): ClientRequest; + export var globalAgent: Agent; +} + +declare module "cluster" { + import * as child from "child_process"; + import * as events from "events"; + import * as net from "net"; + + // interfaces + export interface ClusterSettings { + execArgv?: string[]; // default: process.execArgv + exec?: string; + args?: string[]; + silent?: boolean; + stdio?: any[]; + uid?: number; + gid?: number; + inspectPort?: number | (() => number); + } + + export interface Address { + address: string; + port: number; + addressType: number | "udp4" | "udp6"; // 4, 6, -1, "udp4", "udp6" + } + + export class Worker extends events.EventEmitter { + id: number; + process: child.ChildProcess; + suicide: boolean; + send(message: any, sendHandle?: any, callback?: (error: Error) => void): boolean; + kill(signal?: string): void; + destroy(signal?: string): void; + disconnect(): void; + isConnected(): boolean; + isDead(): boolean; + exitedAfterDisconnect: boolean; + + /** + * events.EventEmitter + * 1. disconnect + * 2. error + * 3. exit + * 4. listening + * 5. message + * 6. online + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "disconnect", listener: () => void): this; + addListener(event: "error", listener: (error: Error) => void): this; + addListener(event: "exit", listener: (code: number, signal: string) => void): this; + addListener(event: "listening", listener: (address: Address) => void): this; + addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + addListener(event: "online", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "disconnect"): boolean; + emit(event: "error", error: Error): boolean; + emit(event: "exit", code: number, signal: string): boolean; + emit(event: "listening", address: Address): boolean; + emit(event: "message", message: any, handle: net.Socket | net.Server): boolean; + emit(event: "online"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "disconnect", listener: () => void): this; + on(event: "error", listener: (error: Error) => void): this; + on(event: "exit", listener: (code: number, signal: string) => void): this; + on(event: "listening", listener: (address: Address) => void): this; + on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + on(event: "online", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "disconnect", listener: () => void): this; + once(event: "error", listener: (error: Error) => void): this; + once(event: "exit", listener: (code: number, signal: string) => void): this; + once(event: "listening", listener: (address: Address) => void): this; + once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + once(event: "online", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "disconnect", listener: () => void): this; + prependListener(event: "error", listener: (error: Error) => void): this; + prependListener(event: "exit", listener: (code: number, signal: string) => void): this; + prependListener(event: "listening", listener: (address: Address) => void): this; + prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependListener(event: "online", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "disconnect", listener: () => void): this; + prependOnceListener(event: "error", listener: (error: Error) => void): this; + prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this; + prependOnceListener(event: "listening", listener: (address: Address) => void): this; + prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependOnceListener(event: "online", listener: () => void): this; + } + + export interface Cluster extends events.EventEmitter { + Worker: Worker; + disconnect(callback?: Function): void; + fork(env?: any): Worker; + isMaster: boolean; + isWorker: boolean; + // TODO: cluster.schedulingPolicy + settings: ClusterSettings; + setupMaster(settings?: ClusterSettings): void; + worker?: Worker; + workers?: { + [index: string]: Worker | undefined + }; + + /** + * events.EventEmitter + * 1. disconnect + * 2. exit + * 3. fork + * 4. listening + * 5. message + * 6. online + * 7. setup + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "disconnect", listener: (worker: Worker) => void): this; + addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + addListener(event: "fork", listener: (worker: Worker) => void): this; + addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; + addListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + addListener(event: "online", listener: (worker: Worker) => void): this; + addListener(event: "setup", listener: (settings: any) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "disconnect", worker: Worker): boolean; + emit(event: "exit", worker: Worker, code: number, signal: string): boolean; + emit(event: "fork", worker: Worker): boolean; + emit(event: "listening", worker: Worker, address: Address): boolean; + emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean; + emit(event: "online", worker: Worker): boolean; + emit(event: "setup", settings: any): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "disconnect", listener: (worker: Worker) => void): this; + on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + on(event: "fork", listener: (worker: Worker) => void): this; + on(event: "listening", listener: (worker: Worker, address: Address) => void): this; + on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + on(event: "online", listener: (worker: Worker) => void): this; + on(event: "setup", listener: (settings: any) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "disconnect", listener: (worker: Worker) => void): this; + once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + once(event: "fork", listener: (worker: Worker) => void): this; + once(event: "listening", listener: (worker: Worker, address: Address) => void): this; + once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + once(event: "online", listener: (worker: Worker) => void): this; + once(event: "setup", listener: (settings: any) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "disconnect", listener: (worker: Worker) => void): this; + prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + prependListener(event: "fork", listener: (worker: Worker) => void): this; + prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; + prependListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependListener(event: "online", listener: (worker: Worker) => void): this; + prependListener(event: "setup", listener: (settings: any) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this; + prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this; + prependOnceListener(event: "fork", listener: (worker: Worker) => void): this; + prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this; + prependOnceListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined. + prependOnceListener(event: "online", listener: (worker: Worker) => void): this; + prependOnceListener(event: "setup", listener: (settings: any) => void): this; + } + + export function disconnect(callback?: Function): void; + export function fork(env?: any): Worker; + export var isMaster: boolean; + export var isWorker: boolean; + // TODO: cluster.schedulingPolicy + export var settings: ClusterSettings; + export function setupMaster(settings?: ClusterSettings): void; + export var worker: Worker; + export var workers: { + [index: string]: Worker | undefined + }; + + /** + * events.EventEmitter + * 1. disconnect + * 2. exit + * 3. fork + * 4. listening + * 5. message + * 6. online + * 7. setup + */ + export function addListener(event: string, listener: (...args: any[]) => void): Cluster; + export function addListener(event: "disconnect", listener: (worker: Worker) => void): Cluster; + export function addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + export function addListener(event: "fork", listener: (worker: Worker) => void): Cluster; + export function addListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + export function addListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined. + export function addListener(event: "online", listener: (worker: Worker) => void): Cluster; + export function addListener(event: "setup", listener: (settings: any) => void): Cluster; + + export function emit(event: string | symbol, ...args: any[]): boolean; + export function emit(event: "disconnect", worker: Worker): boolean; + export function emit(event: "exit", worker: Worker, code: number, signal: string): boolean; + export function emit(event: "fork", worker: Worker): boolean; + export function emit(event: "listening", worker: Worker, address: Address): boolean; + export function emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean; + export function emit(event: "online", worker: Worker): boolean; + export function emit(event: "setup", settings: any): boolean; + + export function on(event: string, listener: (...args: any[]) => void): Cluster; + export function on(event: "disconnect", listener: (worker: Worker) => void): Cluster; + export function on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + export function on(event: "fork", listener: (worker: Worker) => void): Cluster; + export function on(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + export function on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined. + export function on(event: "online", listener: (worker: Worker) => void): Cluster; + export function on(event: "setup", listener: (settings: any) => void): Cluster; + + export function once(event: string, listener: (...args: any[]) => void): Cluster; + export function once(event: "disconnect", listener: (worker: Worker) => void): Cluster; + export function once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + export function once(event: "fork", listener: (worker: Worker) => void): Cluster; + export function once(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + export function once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined. + export function once(event: "online", listener: (worker: Worker) => void): Cluster; + export function once(event: "setup", listener: (settings: any) => void): Cluster; + + export function removeListener(event: string, listener: (...args: any[]) => void): Cluster; + export function removeAllListeners(event?: string): Cluster; + export function setMaxListeners(n: number): Cluster; + export function getMaxListeners(): number; + export function listeners(event: string): Function[]; + export function listenerCount(type: string): number; + + export function prependListener(event: string, listener: (...args: any[]) => void): Cluster; + export function prependListener(event: "disconnect", listener: (worker: Worker) => void): Cluster; + export function prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + export function prependListener(event: "fork", listener: (worker: Worker) => void): Cluster; + export function prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + export function prependListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined. + export function prependListener(event: "online", listener: (worker: Worker) => void): Cluster; + export function prependListener(event: "setup", listener: (settings: any) => void): Cluster; + + export function prependOnceListener(event: string, listener: (...args: any[]) => void): Cluster; + export function prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): Cluster; + export function prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): Cluster; + export function prependOnceListener(event: "fork", listener: (worker: Worker) => void): Cluster; + export function prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): Cluster; + export function prependOnceListener(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster; // the handle is a net.Socket or net.Server object, or undefined. + export function prependOnceListener(event: "online", listener: (worker: Worker) => void): Cluster; + export function prependOnceListener(event: "setup", listener: (settings: any) => void): Cluster; + + export function eventNames(): string[]; +} + +declare module "zlib" { + import * as stream from "stream"; + + export interface ZlibOptions { + flush?: number; // default: zlib.constants.Z_NO_FLUSH + finishFlush?: number; // default: zlib.constants.Z_FINISH + chunkSize?: number; // default: 16*1024 + windowBits?: number; + level?: number; // compression only + memLevel?: number; // compression only + strategy?: number; // compression only + dictionary?: any; // deflate/inflate only, empty dictionary by default + } + + export interface Zlib { + readonly bytesRead: number; + close(callback?: () => void): void; + flush(kind?: number | (() => void), callback?: () => void): void; + } + + export interface ZlibParams { + params(level: number, strategy: number, callback: () => void): void; + } + + export interface ZlibReset { + reset(): void; + } + + export interface Gzip extends stream.Transform, Zlib { } + export interface Gunzip extends stream.Transform, Zlib { } + export interface Deflate extends stream.Transform, Zlib, ZlibReset, ZlibParams { } + export interface Inflate extends stream.Transform, Zlib, ZlibReset { } + export interface DeflateRaw extends stream.Transform, Zlib, ZlibReset, ZlibParams { } + export interface InflateRaw extends stream.Transform, Zlib, ZlibReset { } + export interface Unzip extends stream.Transform, Zlib { } + + export function createGzip(options?: ZlibOptions): Gzip; + export function createGunzip(options?: ZlibOptions): Gunzip; + export function createDeflate(options?: ZlibOptions): Deflate; + export function createInflate(options?: ZlibOptions): Inflate; + export function createDeflateRaw(options?: ZlibOptions): DeflateRaw; + export function createInflateRaw(options?: ZlibOptions): InflateRaw; + export function createUnzip(options?: ZlibOptions): Unzip; + + type InputType = string | Buffer | DataView | ArrayBuffer /* | TypedArray */; + export function deflate(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function deflate(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function deflateSync(buf: InputType, options?: ZlibOptions): Buffer; + export function deflateRaw(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function deflateRaw(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function deflateRawSync(buf: InputType, options?: ZlibOptions): Buffer; + export function gzip(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function gzip(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function gzipSync(buf: InputType, options?: ZlibOptions): Buffer; + export function gunzip(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function gunzip(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function gunzipSync(buf: InputType, options?: ZlibOptions): Buffer; + export function inflate(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function inflate(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function inflateSync(buf: InputType, options?: ZlibOptions): Buffer; + export function inflateRaw(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function inflateRaw(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function inflateRawSync(buf: InputType, options?: ZlibOptions): Buffer; + export function unzip(buf: InputType, callback: (error: Error | null, result: Buffer) => void): void; + export function unzip(buf: InputType, options: ZlibOptions, callback: (error: Error | null, result: Buffer) => void): void; + export function unzipSync(buf: InputType, options?: ZlibOptions): Buffer; + + export namespace constants { + // Allowed flush values. + + export const Z_NO_FLUSH: number; + export const Z_PARTIAL_FLUSH: number; + export const Z_SYNC_FLUSH: number; + export const Z_FULL_FLUSH: number; + export const Z_FINISH: number; + export const Z_BLOCK: number; + export const Z_TREES: number; + + // Return codes for the compression/decompression functions. Negative values are errors, positive values are used for special but normal events. + + export const Z_OK: number; + export const Z_STREAM_END: number; + export const Z_NEED_DICT: number; + export const Z_ERRNO: number; + export const Z_STREAM_ERROR: number; + export const Z_DATA_ERROR: number; + export const Z_MEM_ERROR: number; + export const Z_BUF_ERROR: number; + export const Z_VERSION_ERROR: number; + + // Compression levels. + + export const Z_NO_COMPRESSION: number; + export const Z_BEST_SPEED: number; + export const Z_BEST_COMPRESSION: number; + export const Z_DEFAULT_COMPRESSION: number; + + // Compression strategy. + + export const Z_FILTERED: number; + export const Z_HUFFMAN_ONLY: number; + export const Z_RLE: number; + export const Z_FIXED: number; + export const Z_DEFAULT_STRATEGY: number; + } + + // Constants + export var Z_NO_FLUSH: number; + export var Z_PARTIAL_FLUSH: number; + export var Z_SYNC_FLUSH: number; + export var Z_FULL_FLUSH: number; + export var Z_FINISH: number; + export var Z_BLOCK: number; + export var Z_TREES: number; + export var Z_OK: number; + export var Z_STREAM_END: number; + export var Z_NEED_DICT: number; + export var Z_ERRNO: number; + export var Z_STREAM_ERROR: number; + export var Z_DATA_ERROR: number; + export var Z_MEM_ERROR: number; + export var Z_BUF_ERROR: number; + export var Z_VERSION_ERROR: number; + export var Z_NO_COMPRESSION: number; + export var Z_BEST_SPEED: number; + export var Z_BEST_COMPRESSION: number; + export var Z_DEFAULT_COMPRESSION: number; + export var Z_FILTERED: number; + export var Z_HUFFMAN_ONLY: number; + export var Z_RLE: number; + export var Z_FIXED: number; + export var Z_DEFAULT_STRATEGY: number; + export var Z_BINARY: number; + export var Z_TEXT: number; + export var Z_ASCII: number; + export var Z_UNKNOWN: number; + export var Z_DEFLATED: number; +} + +declare module "os" { + export interface CpuInfo { + model: string; + speed: number; + times: { + user: number; + nice: number; + sys: number; + idle: number; + irq: number; + }; + } + + export interface NetworkInterfaceBase { + address: string; + netmask: string; + mac: string; + internal: boolean; + } + + export interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase { + family: "IPv4"; + } + + export interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase { + family: "IPv6"; + scopeid: number; + } + + export type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6; + + export function hostname(): string; + export function loadavg(): number[]; + export function uptime(): number; + export function freemem(): number; + export function totalmem(): number; + export function cpus(): CpuInfo[]; + export function type(): string; + export function release(): string; + export function networkInterfaces(): { [index: string]: NetworkInterfaceInfo[] }; + export function homedir(): string; + export function userInfo(options?: { encoding: string }): { username: string, uid: number, gid: number, shell: any, homedir: string }; + export var constants: { + UV_UDP_REUSEADDR: number, + signals: { + SIGHUP: number; + SIGINT: number; + SIGQUIT: number; + SIGILL: number; + SIGTRAP: number; + SIGABRT: number; + SIGIOT: number; + SIGBUS: number; + SIGFPE: number; + SIGKILL: number; + SIGUSR1: number; + SIGSEGV: number; + SIGUSR2: number; + SIGPIPE: number; + SIGALRM: number; + SIGTERM: number; + SIGCHLD: number; + SIGSTKFLT: number; + SIGCONT: number; + SIGSTOP: number; + SIGTSTP: number; + SIGTTIN: number; + SIGTTOU: number; + SIGURG: number; + SIGXCPU: number; + SIGXFSZ: number; + SIGVTALRM: number; + SIGPROF: number; + SIGWINCH: number; + SIGIO: number; + SIGPOLL: number; + SIGPWR: number; + SIGSYS: number; + SIGUNUSED: number; + }, + errno: { + E2BIG: number; + EACCES: number; + EADDRINUSE: number; + EADDRNOTAVAIL: number; + EAFNOSUPPORT: number; + EAGAIN: number; + EALREADY: number; + EBADF: number; + EBADMSG: number; + EBUSY: number; + ECANCELED: number; + ECHILD: number; + ECONNABORTED: number; + ECONNREFUSED: number; + ECONNRESET: number; + EDEADLK: number; + EDESTADDRREQ: number; + EDOM: number; + EDQUOT: number; + EEXIST: number; + EFAULT: number; + EFBIG: number; + EHOSTUNREACH: number; + EIDRM: number; + EILSEQ: number; + EINPROGRESS: number; + EINTR: number; + EINVAL: number; + EIO: number; + EISCONN: number; + EISDIR: number; + ELOOP: number; + EMFILE: number; + EMLINK: number; + EMSGSIZE: number; + EMULTIHOP: number; + ENAMETOOLONG: number; + ENETDOWN: number; + ENETRESET: number; + ENETUNREACH: number; + ENFILE: number; + ENOBUFS: number; + ENODATA: number; + ENODEV: number; + ENOENT: number; + ENOEXEC: number; + ENOLCK: number; + ENOLINK: number; + ENOMEM: number; + ENOMSG: number; + ENOPROTOOPT: number; + ENOSPC: number; + ENOSR: number; + ENOSTR: number; + ENOSYS: number; + ENOTCONN: number; + ENOTDIR: number; + ENOTEMPTY: number; + ENOTSOCK: number; + ENOTSUP: number; + ENOTTY: number; + ENXIO: number; + EOPNOTSUPP: number; + EOVERFLOW: number; + EPERM: number; + EPIPE: number; + EPROTO: number; + EPROTONOSUPPORT: number; + EPROTOTYPE: number; + ERANGE: number; + EROFS: number; + ESPIPE: number; + ESRCH: number; + ESTALE: number; + ETIME: number; + ETIMEDOUT: number; + ETXTBSY: number; + EWOULDBLOCK: number; + EXDEV: number; + }, + }; + export function arch(): string; + export function platform(): NodeJS.Platform; + export function tmpdir(): string; + export const EOL: string; + export function endianness(): "BE" | "LE"; +} + +declare module "https" { + import * as tls from "tls"; + import * as events from "events"; + import * as http from "http"; + import { URL } from "url"; + + export type ServerOptions = tls.SecureContextOptions & tls.TlsOptions; + + export type RequestOptions = http.RequestOptions & tls.SecureContextOptions & { + rejectUnauthorized?: boolean; // Defaults to true + servername?: string; // SNI TLS Extension + }; + + export interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions { + rejectUnauthorized?: boolean; + maxCachedSessions?: number; + } + + export class Agent extends http.Agent { + constructor(options?: AgentOptions); + options: AgentOptions; + } + + export class Server extends tls.Server { + setTimeout(callback: () => void): this; + setTimeout(msecs?: number, callback?: () => void): this; + timeout: number; + keepAliveTimeout: number; + } + + export function createServer(options: ServerOptions, requestListener?: (req: http.IncomingMessage, res: http.ServerResponse) => void): Server; + export function request(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + export function get(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest; + export var globalAgent: Agent; +} + +declare module "punycode" { + export function decode(string: string): string; + export function encode(string: string): string; + export function toUnicode(domain: string): string; + export function toASCII(domain: string): string; + export var ucs2: ucs2; + interface ucs2 { + decode(string: string): number[]; + encode(codePoints: number[]): string; + } + export var version: any; +} + +declare module "repl" { + import * as stream from "stream"; + import * as readline from "readline"; + + export interface ReplOptions { + prompt?: string; + input?: NodeJS.ReadableStream; + output?: NodeJS.WritableStream; + terminal?: boolean; + eval?: Function; + useColors?: boolean; + useGlobal?: boolean; + ignoreUndefined?: boolean; + writer?: Function; + completer?: Function; + replMode?: any; + breakEvalOnSigint?: any; + } + + export interface REPLServer extends readline.ReadLine { + context: any; + inputStream: NodeJS.ReadableStream; + outputStream: NodeJS.WritableStream; + + defineCommand(keyword: string, cmd: Function | { help: string, action: Function }): void; + displayPrompt(preserveCursor?: boolean): void; + + /** + * events.EventEmitter + * 1. exit + * 2. reset + */ + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "exit", listener: () => void): this; + addListener(event: "reset", listener: (...args: any[]) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "exit"): boolean; + emit(event: "reset", context: any): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "exit", listener: () => void): this; + on(event: "reset", listener: (...args: any[]) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "exit", listener: () => void): this; + once(event: "reset", listener: (...args: any[]) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "exit", listener: () => void): this; + prependListener(event: "reset", listener: (...args: any[]) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "exit", listener: () => void): this; + prependOnceListener(event: "reset", listener: (...args: any[]) => void): this; + } + + export function start(options?: string | ReplOptions): REPLServer; + + export class Recoverable extends SyntaxError { + err: Error; + + constructor(err: Error); + } +} + +declare module "readline" { + import * as events from "events"; + import * as stream from "stream"; + + export interface Key { + sequence?: string; + name?: string; + ctrl?: boolean; + meta?: boolean; + shift?: boolean; + } + + export interface ReadLine extends events.EventEmitter { + setPrompt(prompt: string): void; + prompt(preserveCursor?: boolean): void; + question(query: string, callback: (answer: string) => void): void; + pause(): ReadLine; + resume(): ReadLine; + close(): void; + write(data: string | Buffer, key?: Key): void; + + /** + * events.EventEmitter + * 1. close + * 2. line + * 3. pause + * 4. resume + * 5. SIGCONT + * 6. SIGINT + * 7. SIGTSTP + */ + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "line", listener: (input: any) => void): this; + addListener(event: "pause", listener: () => void): this; + addListener(event: "resume", listener: () => void): this; + addListener(event: "SIGCONT", listener: () => void): this; + addListener(event: "SIGINT", listener: () => void): this; + addListener(event: "SIGTSTP", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "line", input: any): boolean; + emit(event: "pause"): boolean; + emit(event: "resume"): boolean; + emit(event: "SIGCONT"): boolean; + emit(event: "SIGINT"): boolean; + emit(event: "SIGTSTP"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: () => void): this; + on(event: "line", listener: (input: any) => void): this; + on(event: "pause", listener: () => void): this; + on(event: "resume", listener: () => void): this; + on(event: "SIGCONT", listener: () => void): this; + on(event: "SIGINT", listener: () => void): this; + on(event: "SIGTSTP", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: () => void): this; + once(event: "line", listener: (input: any) => void): this; + once(event: "pause", listener: () => void): this; + once(event: "resume", listener: () => void): this; + once(event: "SIGCONT", listener: () => void): this; + once(event: "SIGINT", listener: () => void): this; + once(event: "SIGTSTP", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "line", listener: (input: any) => void): this; + prependListener(event: "pause", listener: () => void): this; + prependListener(event: "resume", listener: () => void): this; + prependListener(event: "SIGCONT", listener: () => void): this; + prependListener(event: "SIGINT", listener: () => void): this; + prependListener(event: "SIGTSTP", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "line", listener: (input: any) => void): this; + prependOnceListener(event: "pause", listener: () => void): this; + prependOnceListener(event: "resume", listener: () => void): this; + prependOnceListener(event: "SIGCONT", listener: () => void): this; + prependOnceListener(event: "SIGINT", listener: () => void): this; + prependOnceListener(event: "SIGTSTP", listener: () => void): this; + } + + type Completer = (line: string) => CompleterResult; + type AsyncCompleter = (line: string, callback: (err: any, result: CompleterResult) => void) => any; + + export type CompleterResult = [string[], string]; + + export interface ReadLineOptions { + input: NodeJS.ReadableStream; + output?: NodeJS.WritableStream; + completer?: Completer | AsyncCompleter; + terminal?: boolean; + historySize?: number; + } + + export function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): ReadLine; + export function createInterface(options: ReadLineOptions): ReadLine; + + export function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number): void; + export function emitKeypressEvents(stream: NodeJS.ReadableStream, interface?: ReadLine): void; + export function moveCursor(stream: NodeJS.WritableStream, dx: number | string, dy: number | string): void; + export function clearLine(stream: NodeJS.WritableStream, dir: number): void; + export function clearScreenDown(stream: NodeJS.WritableStream): void; +} + +declare module "vm" { + export interface Context { } + export interface ScriptOptions { + filename?: string; + lineOffset?: number; + columnOffset?: number; + displayErrors?: boolean; + timeout?: number; + cachedData?: Buffer; + produceCachedData?: boolean; + } + export interface RunningScriptOptions { + filename?: string; + lineOffset?: number; + columnOffset?: number; + displayErrors?: boolean; + timeout?: number; + } + export class Script { + constructor(code: string, options?: ScriptOptions); + runInContext(contextifiedSandbox: Context, options?: RunningScriptOptions): any; + runInNewContext(sandbox?: Context, options?: RunningScriptOptions): any; + runInThisContext(options?: RunningScriptOptions): any; + } + export function createContext(sandbox?: Context): Context; + export function isContext(sandbox: Context): boolean; + export function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions | string): any; + /** @deprecated */ + export function runInDebugContext(code: string): any; + export function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions | string): any; + export function runInThisContext(code: string, options?: RunningScriptOptions | string): any; +} + +declare module "child_process" { + import * as events from "events"; + import * as stream from "stream"; + import * as net from "net"; + + export interface ChildProcess extends events.EventEmitter { + stdin: stream.Writable; + stdout: stream.Readable; + stderr: stream.Readable; + stdio: [stream.Writable, stream.Readable, stream.Readable]; + killed: boolean; + pid: number; + kill(signal?: string): void; + send(message: any, callback?: (error: Error) => void): boolean; + send(message: any, sendHandle?: net.Socket | net.Server, callback?: (error: Error) => void): boolean; + send(message: any, sendHandle?: net.Socket | net.Server, options?: MessageOptions, callback?: (error: Error) => void): boolean; + connected: boolean; + disconnect(): void; + unref(): void; + ref(): void; + + /** + * events.EventEmitter + * 1. close + * 2. disconnect + * 3. error + * 4. exit + * 5. message + */ + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: (code: number, signal: string) => void): this; + addListener(event: "disconnect", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "exit", listener: (code: number, signal: string) => void): this; + addListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close", code: number, signal: string): boolean; + emit(event: "disconnect"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "exit", code: number, signal: string): boolean; + emit(event: "message", message: any, sendHandle: net.Socket | net.Server): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: (code: number, signal: string) => void): this; + on(event: "disconnect", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "exit", listener: (code: number, signal: string) => void): this; + on(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: (code: number, signal: string) => void): this; + once(event: "disconnect", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "exit", listener: (code: number, signal: string) => void): this; + once(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: (code: number, signal: string) => void): this; + prependListener(event: "disconnect", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "exit", listener: (code: number, signal: string) => void): this; + prependListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: (code: number, signal: string) => void): this; + prependOnceListener(event: "disconnect", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this; + prependOnceListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this; + } + + export interface MessageOptions { + keepOpen?: boolean; + } + + export interface SpawnOptions { + cwd?: string; + env?: any; + stdio?: any; + detached?: boolean; + uid?: number; + gid?: number; + shell?: boolean | string; + windowsVerbatimArguments?: boolean; + windowsHide?: boolean; + } + + export function spawn(command: string, args?: string[], options?: SpawnOptions): ChildProcess; + + export interface ExecOptions { + cwd?: string; + env?: any; + shell?: string; + timeout?: number; + maxBuffer?: number; + killSignal?: string; + uid?: number; + gid?: number; + windowsHide?: boolean; + } + + export interface ExecOptionsWithStringEncoding extends ExecOptions { + encoding: BufferEncoding; + } + + export interface ExecOptionsWithBufferEncoding extends ExecOptions { + encoding: string | null; // specify `null`. + } + + // no `options` definitely means stdout/stderr are `string`. + export function exec(command: string, callback?: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + + // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. + export function exec(command: string, options: { encoding: "buffer" | null } & ExecOptions, callback?: (error: Error | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess; + + // `options` with well known `encoding` means stdout/stderr are definitely `string`. + export function exec(command: string, options: { encoding: BufferEncoding } & ExecOptions, callback?: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + + // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. + // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. + export function exec(command: string, options: { encoding: string } & ExecOptions, callback?: (error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess; + + // `options` without an `encoding` means stdout/stderr are definitely `string`. + export function exec(command: string, options: ExecOptions, callback?: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + + // fallback if nothing else matches. Worst case is always `string | Buffer`. + export function exec(command: string, options: ({ encoding?: string | null } & ExecOptions) | undefined | null, callback?: (error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace exec { + export function __promisify__(command: string): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(command: string, options: { encoding: "buffer" | null } & ExecOptions): Promise<{ stdout: Buffer, stderr: Buffer }>; + export function __promisify__(command: string, options: { encoding: BufferEncoding } & ExecOptions): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(command: string, options: ExecOptions): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(command: string, options?: ({ encoding?: string | null } & ExecOptions) | null): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>; + } + + export interface ExecFileOptions { + cwd?: string; + env?: any; + timeout?: number; + maxBuffer?: number; + killSignal?: string; + uid?: number; + gid?: number; + windowsHide?: boolean; + windowsVerbatimArguments?: boolean; + } + export interface ExecFileOptionsWithStringEncoding extends ExecFileOptions { + encoding: BufferEncoding; + } + export interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions { + encoding: 'buffer' | null; + } + export interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions { + encoding: string; + } + + export function execFile(file: string): ChildProcess; + export function execFile(file: string, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): ChildProcess; + export function execFile(file: string, args: string[] | undefined | null): ChildProcess; + export function execFile(file: string, args: string[] | undefined | null, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): ChildProcess; + + // no `options` definitely means stdout/stderr are `string`. + export function execFile(file: string, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + export function execFile(file: string, args: string[] | undefined | null, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + + // `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`. + export function execFile(file: string, options: ExecFileOptionsWithBufferEncoding, callback: (error: Error | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess; + export function execFile(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithBufferEncoding, callback: (error: Error | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess; + + // `options` with well known `encoding` means stdout/stderr are definitely `string`. + export function execFile(file: string, options: ExecFileOptionsWithStringEncoding, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + export function execFile(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithStringEncoding, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + + // `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`. + // There is no guarantee the `encoding` is unknown as `string` is a superset of `BufferEncoding`. + export function execFile(file: string, options: ExecFileOptionsWithOtherEncoding, callback: (error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess; + export function execFile(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithOtherEncoding, callback: (error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void): ChildProcess; + + // `options` without an `encoding` means stdout/stderr are definitely `string`. + export function execFile(file: string, options: ExecFileOptions, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + export function execFile(file: string, args: string[] | undefined | null, options: ExecFileOptions, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess; + + // fallback if nothing else matches. Worst case is always `string | Buffer`. + export function execFile(file: string, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null, callback: ((error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null): ChildProcess; + export function execFile(file: string, args: string[] | undefined | null, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null, callback: ((error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null): ChildProcess; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace execFile { + export function __promisify__(file: string): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(file: string, args: string[] | undefined | null): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(file: string, options: ExecFileOptionsWithBufferEncoding): Promise<{ stdout: Buffer, stderr: Buffer }>; + export function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithBufferEncoding): Promise<{ stdout: Buffer, stderr: Buffer }>; + export function __promisify__(file: string, options: ExecFileOptionsWithStringEncoding): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithStringEncoding): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(file: string, options: ExecFileOptionsWithOtherEncoding): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>; + export function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithOtherEncoding): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>; + export function __promisify__(file: string, options: ExecFileOptions): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptions): Promise<{ stdout: string, stderr: string }>; + export function __promisify__(file: string, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>; + export function __promisify__(file: string, args: string[] | undefined | null, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): Promise<{ stdout: string | Buffer, stderr: string | Buffer }>; + } + + export interface ForkOptions { + cwd?: string; + env?: any; + execPath?: string; + execArgv?: string[]; + silent?: boolean; + stdio?: any[]; + uid?: number; + gid?: number; + windowsVerbatimArguments?: boolean; + } + export function fork(modulePath: string, args?: string[], options?: ForkOptions): ChildProcess; + + export interface SpawnSyncOptions { + cwd?: string; + input?: string | Buffer; + stdio?: any; + env?: any; + uid?: number; + gid?: number; + timeout?: number; + killSignal?: string; + maxBuffer?: number; + encoding?: string; + shell?: boolean | string; + windowsHide?: boolean; + windowsVerbatimArguments?: boolean; + } + export interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions { + encoding: BufferEncoding; + } + export interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions { + encoding: string; // specify `null`. + } + export interface SpawnSyncReturns { + pid: number; + output: string[]; + stdout: T; + stderr: T; + status: number; + signal: string; + error: Error; + } + export function spawnSync(command: string): SpawnSyncReturns; + export function spawnSync(command: string, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; + export function spawnSync(command: string, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; + export function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns; + export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns; + export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns; + export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptions): SpawnSyncReturns; + + export interface ExecSyncOptions { + cwd?: string; + input?: string | Buffer; + stdio?: any; + env?: any; + shell?: string; + uid?: number; + gid?: number; + timeout?: number; + killSignal?: string; + maxBuffer?: number; + encoding?: string; + windowsHide?: boolean; + } + export interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions { + encoding: BufferEncoding; + } + export interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions { + encoding: string; // specify `null`. + } + export function execSync(command: string): Buffer; + export function execSync(command: string, options?: ExecSyncOptionsWithStringEncoding): string; + export function execSync(command: string, options?: ExecSyncOptionsWithBufferEncoding): Buffer; + export function execSync(command: string, options?: ExecSyncOptions): Buffer; + + export interface ExecFileSyncOptions { + cwd?: string; + input?: string | Buffer; + stdio?: any; + env?: any; + uid?: number; + gid?: number; + timeout?: number; + killSignal?: string; + maxBuffer?: number; + encoding?: string; + windowsHide?: boolean; + } + export interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions { + encoding: BufferEncoding; + } + export interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions { + encoding: string; // specify `null`. + } + export function execFileSync(command: string): Buffer; + export function execFileSync(command: string, options?: ExecFileSyncOptionsWithStringEncoding): string; + export function execFileSync(command: string, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer; + export function execFileSync(command: string, options?: ExecFileSyncOptions): Buffer; + export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptionsWithStringEncoding): string; + export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptionsWithBufferEncoding): Buffer; + export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptions): Buffer; +} + +declare module "url" { + import { ParsedUrlQuery } from 'querystring'; + + export interface UrlObjectCommon { + auth?: string; + hash?: string; + host?: string; + hostname?: string; + href?: string; + path?: string; + pathname?: string; + protocol?: string; + search?: string; + slashes?: boolean; + } + + // Input to `url.format` + export interface UrlObject extends UrlObjectCommon { + port?: string | number; + query?: string | null | { [key: string]: any }; + } + + // Output of `url.parse` + export interface Url extends UrlObjectCommon { + port?: string; + query?: string | null | ParsedUrlQuery; + } + + export interface UrlWithParsedQuery extends Url { + query: ParsedUrlQuery; + } + + export interface UrlWithStringQuery extends Url { + query: string | null; + } + + export function parse(urlStr: string): UrlWithStringQuery; + export function parse(urlStr: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery; + export function parse(urlStr: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery; + export function parse(urlStr: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url; + + export function format(URL: URL, options?: URLFormatOptions): string; + export function format(urlObject: UrlObject | string): string; + export function resolve(from: string, to: string): string; + + export function domainToASCII(domain: string): string; + export function domainToUnicode(domain: string): string; + + export interface URLFormatOptions { + auth?: boolean; + fragment?: boolean; + search?: boolean; + unicode?: boolean; + } + + export class URLSearchParams implements Iterable<[string, string]> { + constructor(init?: URLSearchParams | string | { [key: string]: string | string[] | undefined } | Iterable<[string, string]> | Array<[string, string]>); + append(name: string, value: string): void; + delete(name: string): void; + entries(): IterableIterator<[string, string]>; + forEach(callback: (value: string, name: string) => void): void; + get(name: string): string | null; + getAll(name: string): string[]; + has(name: string): boolean; + keys(): IterableIterator; + set(name: string, value: string): void; + sort(): void; + toString(): string; + values(): IterableIterator; + [Symbol.iterator](): IterableIterator<[string, string]>; + } + + export class URL { + constructor(input: string, base?: string | URL); + hash: string; + host: string; + hostname: string; + href: string; + readonly origin: string; + password: string; + pathname: string; + port: string; + protocol: string; + search: string; + readonly searchParams: URLSearchParams; + username: string; + toString(): string; + toJSON(): string; + } +} + +declare module "dns" { + // Supported getaddrinfo flags. + export const ADDRCONFIG: number; + export const V4MAPPED: number; + + export interface LookupOptions { + family?: number; + hints?: number; + all?: boolean; + } + + export interface LookupOneOptions extends LookupOptions { + all?: false; + } + + export interface LookupAllOptions extends LookupOptions { + all: true; + } + + export interface LookupAddress { + address: string; + family: number; + } + + export function lookup(hostname: string, family: number, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void; + export function lookup(hostname: string, options: LookupOneOptions, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void; + export function lookup(hostname: string, options: LookupAllOptions, callback: (err: NodeJS.ErrnoException, addresses: LookupAddress[]) => void): void; + export function lookup(hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException, address: string | LookupAddress[], family: number) => void): void; + export function lookup(hostname: string, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace lookup { + export function __promisify__(hostname: string, options: LookupAllOptions): Promise<{ address: LookupAddress[] }>; + export function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise<{ address: string, family: number }>; + export function __promisify__(hostname: string, options?: LookupOptions | number): Promise<{ address: string | LookupAddress[], family?: number }>; + } + + export interface ResolveOptions { + ttl: boolean; + } + + export interface ResolveWithTtlOptions extends ResolveOptions { + ttl: true; + } + + export interface RecordWithTtl { + address: string; + ttl: number; + } + + export interface MxRecord { + priority: number; + exchange: string; + } + + export interface NaptrRecord { + flags: string; + service: string; + regexp: string; + replacement: string; + order: number; + preference: number; + } + + export interface SoaRecord { + nsname: string; + hostmaster: string; + serial: number; + refresh: number; + retry: number; + expire: number; + minttl: number; + } + + export interface SrvRecord { + priority: number; + weight: number; + port: number; + name: string; + } + + export function resolve(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "A", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "AAAA", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "CNAME", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "MX", callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void; + export function resolve(hostname: string, rrtype: "NAPTR", callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void; + export function resolve(hostname: string, rrtype: "NS", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "PTR", callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve(hostname: string, rrtype: "SOA", callback: (err: NodeJS.ErrnoException, addresses: SoaRecord) => void): void; + export function resolve(hostname: string, rrtype: "SRV", callback: (err: NodeJS.ErrnoException, addresses: SrvRecord[]) => void): void; + export function resolve(hostname: string, rrtype: "TXT", callback: (err: NodeJS.ErrnoException, addresses: string[][]) => void): void; + export function resolve(hostname: string, rrtype: string, callback: (err: NodeJS.ErrnoException, addresses: string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][]) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace resolve { + export function __promisify__(hostname: string, rrtype?: "A" | "AAAA" | "CNAME" | "NS" | "PTR"): Promise; + export function __promisify__(hostname: string, rrtype: "MX"): Promise; + export function __promisify__(hostname: string, rrtype: "NAPTR"): Promise; + export function __promisify__(hostname: string, rrtype: "SOA"): Promise; + export function __promisify__(hostname: string, rrtype: "SRV"): Promise; + export function __promisify__(hostname: string, rrtype: "TXT"): Promise; + export function __promisify__(hostname: string, rrtype?: string): Promise; + } + + export function resolve4(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve4(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException, addresses: RecordWithTtl[]) => void): void; + export function resolve4(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException, addresses: string[] | RecordWithTtl[]) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace resolve4 { + export function __promisify__(hostname: string): Promise; + export function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; + export function __promisify__(hostname: string, options?: ResolveOptions): Promise; + } + + export function resolve6(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolve6(hostname: string, options: ResolveWithTtlOptions, callback: (err: NodeJS.ErrnoException, addresses: RecordWithTtl[]) => void): void; + export function resolve6(hostname: string, options: ResolveOptions, callback: (err: NodeJS.ErrnoException, addresses: string[] | RecordWithTtl[]) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace resolve6 { + export function __promisify__(hostname: string): Promise; + export function __promisify__(hostname: string, options: ResolveWithTtlOptions): Promise; + export function __promisify__(hostname: string, options?: ResolveOptions): Promise; + } + + export function resolveCname(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolveMx(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: MxRecord[]) => void): void; + export function resolveNaptr(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: NaptrRecord[]) => void): void; + export function resolveNs(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolvePtr(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[]) => void): void; + export function resolveSoa(hostname: string, callback: (err: NodeJS.ErrnoException, address: SoaRecord) => void): void; + export function resolveSrv(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: SrvRecord[]) => void): void; + export function resolveTxt(hostname: string, callback: (err: NodeJS.ErrnoException, addresses: string[][]) => void): void; + + export function reverse(ip: string, callback: (err: NodeJS.ErrnoException, hostnames: string[]) => void): void; + export function setServers(servers: string[]): void; + + // Error codes + export var NODATA: string; + export var FORMERR: string; + export var SERVFAIL: string; + export var NOTFOUND: string; + export var NOTIMP: string; + export var REFUSED: string; + export var BADQUERY: string; + export var BADNAME: string; + export var BADFAMILY: string; + export var BADRESP: string; + export var CONNREFUSED: string; + export var TIMEOUT: string; + export var EOF: string; + export var FILE: string; + export var NOMEM: string; + export var DESTRUCTION: string; + export var BADSTR: string; + export var BADFLAGS: string; + export var NONAME: string; + export var BADHINTS: string; + export var NOTINITIALIZED: string; + export var LOADIPHLPAPI: string; + export var ADDRGETNETWORKPARAMS: string; + export var CANCELLED: string; +} + +declare module "net" { + import * as stream from "stream"; + import * as events from "events"; + import * as dns from "dns"; + + type LookupFunction = (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void; + + export interface SocketConstructorOpts { + fd?: number; + allowHalfOpen?: boolean; + readable?: boolean; + writable?: boolean; + } + + export interface TcpSocketConnectOpts { + port: number; + host?: string; + localAddress?: string; + localPort?: number; + hints?: number; + family?: number; + lookup?: LookupFunction; + } + + export interface IpcSocketConnectOpts { + path: string; + } + + export type SocketConnectOpts = TcpSocketConnectOpts | IpcSocketConnectOpts; + + export class Socket extends stream.Duplex { + constructor(options?: SocketConstructorOpts); + + // Extended base methods + write(buffer: Buffer): boolean; + write(buffer: Buffer, cb?: Function): boolean; + write(str: string, cb?: Function): boolean; + write(str: string, encoding?: string, cb?: Function): boolean; + write(str: string, encoding?: string, fd?: string): boolean; + write(data: any, encoding?: string, callback?: Function): void; + + connect(options: SocketConnectOpts, connectionListener?: Function): this; + connect(port: number, host: string, connectionListener?: Function): this; + connect(port: number, connectionListener?: Function): this; + connect(path: string, connectionListener?: Function): this; + + bufferSize: number; + setEncoding(encoding?: string): this; + destroy(err?: any): void; + pause(): this; + resume(): this; + setTimeout(timeout: number, callback?: Function): this; + setNoDelay(noDelay?: boolean): this; + setKeepAlive(enable?: boolean, initialDelay?: number): this; + address(): { port: number; family: string; address: string; }; + unref(): void; + ref(): void; + + remoteAddress?: string; + remoteFamily?: string; + remotePort?: number; + localAddress: string; + localPort: number; + bytesRead: number; + bytesWritten: number; + connecting: boolean; + destroyed: boolean; + + // Extended base methods + end(): void; + end(buffer: Buffer, cb?: Function): void; + end(str: string, cb?: Function): void; + end(str: string, encoding?: string, cb?: Function): void; + end(data?: any, encoding?: string): void; + + /** + * events.EventEmitter + * 1. close + * 2. connect + * 3. data + * 4. drain + * 5. end + * 6. error + * 7. lookup + * 8. timeout + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: (had_error: boolean) => void): this; + addListener(event: "connect", listener: () => void): this; + addListener(event: "data", listener: (data: Buffer) => void): this; + addListener(event: "drain", listener: () => void): this; + addListener(event: "end", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + addListener(event: "timeout", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close", had_error: boolean): boolean; + emit(event: "connect"): boolean; + emit(event: "data", data: Buffer): boolean; + emit(event: "drain"): boolean; + emit(event: "end"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean; + emit(event: "timeout"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: (had_error: boolean) => void): this; + on(event: "connect", listener: () => void): this; + on(event: "data", listener: (data: Buffer) => void): this; + on(event: "drain", listener: () => void): this; + on(event: "end", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + on(event: "timeout", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: (had_error: boolean) => void): this; + once(event: "connect", listener: () => void): this; + once(event: "data", listener: (data: Buffer) => void): this; + once(event: "drain", listener: () => void): this; + once(event: "end", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + once(event: "timeout", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: (had_error: boolean) => void): this; + prependListener(event: "connect", listener: () => void): this; + prependListener(event: "data", listener: (data: Buffer) => void): this; + prependListener(event: "drain", listener: () => void): this; + prependListener(event: "end", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + prependListener(event: "timeout", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: (had_error: boolean) => void): this; + prependOnceListener(event: "connect", listener: () => void): this; + prependOnceListener(event: "data", listener: (data: Buffer) => void): this; + prependOnceListener(event: "drain", listener: () => void): this; + prependOnceListener(event: "end", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this; + prependOnceListener(event: "timeout", listener: () => void): this; + } + + export interface ListenOptions { + port?: number; + host?: string; + backlog?: number; + path?: string; + exclusive?: boolean; + } + + // https://github.com/nodejs/node/blob/master/lib/net.js + export class Server extends events.EventEmitter { + constructor(connectionListener?: (socket: Socket) => void); + constructor(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }, connectionListener?: (socket: Socket) => void); + + listen(port?: number, hostname?: string, backlog?: number, listeningListener?: Function): this; + listen(port?: number, hostname?: string, listeningListener?: Function): this; + listen(port?: number, backlog?: number, listeningListener?: Function): this; + listen(port?: number, listeningListener?: Function): this; + listen(path: string, backlog?: number, listeningListener?: Function): this; + listen(path: string, listeningListener?: Function): this; + listen(options: ListenOptions, listeningListener?: Function): this; + listen(handle: any, backlog?: number, listeningListener?: Function): this; + listen(handle: any, listeningListener?: Function): this; + close(callback?: Function): this; + address(): { port: number; family: string; address: string; }; + getConnections(cb: (error: Error | null, count: number) => void): void; + ref(): this; + unref(): this; + maxConnections: number; + connections: number; + listening: boolean; + + /** + * events.EventEmitter + * 1. close + * 2. connection + * 3. error + * 4. listening + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "connection", listener: (socket: Socket) => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "listening", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "connection", socket: Socket): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "listening"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: () => void): this; + on(event: "connection", listener: (socket: Socket) => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "listening", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: () => void): this; + once(event: "connection", listener: (socket: Socket) => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "listening", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "connection", listener: (socket: Socket) => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "listening", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "connection", listener: (socket: Socket) => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "listening", listener: () => void): this; + } + + export interface TcpNetConnectOpts extends TcpSocketConnectOpts, SocketConstructorOpts { + timeout?: number; + } + + export interface IpcNetConnectOpts extends IpcSocketConnectOpts, SocketConstructorOpts { + timeout?: number; + } + + export type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts; + + export function createServer(connectionListener?: (socket: Socket) => void): Server; + export function createServer(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }, connectionListener?: (socket: Socket) => void): Server; + export function connect(options: NetConnectOpts, connectionListener?: Function): Socket; + export function connect(port: number, host?: string, connectionListener?: Function): Socket; + export function connect(path: string, connectionListener?: Function): Socket; + export function createConnection(options: NetConnectOpts, connectionListener?: Function): Socket; + export function createConnection(port: number, host?: string, connectionListener?: Function): Socket; + export function createConnection(path: string, connectionListener?: Function): Socket; + export function isIP(input: string): number; + export function isIPv4(input: string): boolean; + export function isIPv6(input: string): boolean; +} + +declare module "dgram" { + import * as events from "events"; + import * as dns from "dns"; + + interface RemoteInfo { + address: string; + family: string; + port: number; + } + + interface AddressInfo { + address: string; + family: string; + port: number; + } + + interface BindOptions { + port: number; + address?: string; + exclusive?: boolean; + } + + type SocketType = "udp4" | "udp6"; + + interface SocketOptions { + type: SocketType; + reuseAddr?: boolean; + recvBufferSize?: number; + sendBufferSize?: number; + lookup?: (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException, address: string, family: number) => void) => void; + } + + export function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; + export function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket; + + export class Socket extends events.EventEmitter { + send(msg: Buffer | String | any[], port: number, address: string, callback?: (error: Error | null, bytes: number) => void): void; + send(msg: Buffer | String | any[], offset: number, length: number, port: number, address: string, callback?: (error: Error | null, bytes: number) => void): void; + bind(port?: number, address?: string, callback?: () => void): void; + bind(port?: number, callback?: () => void): void; + bind(callback?: () => void): void; + bind(options: BindOptions, callback?: Function): void; + close(callback?: () => void): void; + address(): AddressInfo; + setBroadcast(flag: boolean): void; + setTTL(ttl: number): void; + setMulticastTTL(ttl: number): void; + setMulticastInterface(multicastInterface: string): void; + setMulticastLoopback(flag: boolean): void; + addMembership(multicastAddress: string, multicastInterface?: string): void; + dropMembership(multicastAddress: string, multicastInterface?: string): void; + ref(): this; + unref(): this; + setRecvBufferSize(size: number): void; + setSendBufferSize(size: number): void; + getRecvBufferSize(): number; + getSendBufferSize(): number; + + /** + * events.EventEmitter + * 1. close + * 2. error + * 3. listening + * 4. message + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "listening", listener: () => void): this; + addListener(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "listening"): boolean; + emit(event: "message", msg: Buffer, rinfo: AddressInfo): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "listening", listener: () => void): this; + on(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "listening", listener: () => void): this; + once(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "listening", listener: () => void): this; + prependListener(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "listening", listener: () => void): this; + prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: AddressInfo) => void): this; + } +} + +declare module "fs" { + import * as stream from "stream"; + import * as events from "events"; + import { URL } from "url"; + + /** + * Valid types for path values in "fs". + */ + export type PathLike = string | Buffer | URL; + + export class Stats { + isFile(): boolean; + isDirectory(): boolean; + isBlockDevice(): boolean; + isCharacterDevice(): boolean; + isSymbolicLink(): boolean; + isFIFO(): boolean; + isSocket(): boolean; + dev: number; + ino: number; + mode: number; + nlink: number; + uid: number; + gid: number; + rdev: number; + size: number; + blksize: number; + blocks: number; + atimeMs: number; + mtimeMs: number; + ctimeMs: number; + birthtimeMs: number; + atime: Date; + mtime: Date; + ctime: Date; + birthtime: Date; + } + + export interface FSWatcher extends events.EventEmitter { + close(): void; + + /** + * events.EventEmitter + * 1. change + * 2. error + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + addListener(event: "error", listener: (error: Error) => void): this; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + on(event: "error", listener: (error: Error) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + once(event: "error", listener: (error: Error) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + prependListener(event: "error", listener: (error: Error) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this; + prependOnceListener(event: "error", listener: (error: Error) => void): this; + } + + export class ReadStream extends stream.Readable { + close(): void; + destroy(): void; + bytesRead: number; + path: string | Buffer; + + /** + * events.EventEmitter + * 1. open + * 2. close + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "open", listener: (fd: number) => void): this; + addListener(event: "close", listener: () => void): this; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "open", listener: (fd: number) => void): this; + on(event: "close", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "open", listener: (fd: number) => void): this; + once(event: "close", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "open", listener: (fd: number) => void): this; + prependListener(event: "close", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "open", listener: (fd: number) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + } + + export class WriteStream extends stream.Writable { + close(): void; + bytesWritten: number; + path: string | Buffer; + + /** + * events.EventEmitter + * 1. open + * 2. close + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "open", listener: (fd: number) => void): this; + addListener(event: "close", listener: () => void): this; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "open", listener: (fd: number) => void): this; + on(event: "close", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "open", listener: (fd: number) => void): this; + once(event: "close", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "open", listener: (fd: number) => void): this; + prependListener(event: "close", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "open", listener: (fd: number) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + } + + /** + * Asynchronous rename(2) - Change the name or location of a file or directory. + * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function rename(oldPath: PathLike, newPath: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace rename { + /** + * Asynchronous rename(2) - Change the name or location of a file or directory. + * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function __promisify__(oldPath: PathLike, newPath: PathLike): Promise; + } + + /** + * Synchronous rename(2) - Change the name or location of a file or directory. + * @param oldPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function renameSync(oldPath: PathLike, newPath: PathLike): void; + + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param len If not specified, defaults to `0`. + */ + export function truncate(path: PathLike, len: number | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void; + + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function truncate(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace truncate { + /** + * Asynchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param len If not specified, defaults to `0`. + */ + export function __promisify__(path: PathLike, len?: number | null): Promise; + } + + /** + * Synchronous truncate(2) - Truncate a file to a specified length. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param len If not specified, defaults to `0`. + */ + export function truncateSync(path: PathLike, len?: number | null): void; + + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + * @param len If not specified, defaults to `0`. + */ + export function ftruncate(fd: number, len: number | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void; + + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + */ + export function ftruncate(fd: number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace ftruncate { + /** + * Asynchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + * @param len If not specified, defaults to `0`. + */ + export function __promisify__(fd: number, len?: number | null): Promise; + } + + /** + * Synchronous ftruncate(2) - Truncate a file to a specified length. + * @param fd A file descriptor. + * @param len If not specified, defaults to `0`. + */ + export function ftruncateSync(fd: number, len?: number | null): void; + + /** + * Asynchronous chown(2) - Change ownership of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function chown(path: PathLike, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace chown { + /** + * Asynchronous chown(2) - Change ownership of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function __promisify__(path: PathLike, uid: number, gid: number): Promise; + } + + /** + * Synchronous chown(2) - Change ownership of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function chownSync(path: PathLike, uid: number, gid: number): void; + + /** + * Asynchronous fchown(2) - Change ownership of a file. + * @param fd A file descriptor. + */ + export function fchown(fd: number, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace fchown { + /** + * Asynchronous fchown(2) - Change ownership of a file. + * @param fd A file descriptor. + */ + export function __promisify__(fd: number, uid: number, gid: number): Promise; + } + + /** + * Synchronous fchown(2) - Change ownership of a file. + * @param fd A file descriptor. + */ + export function fchownSync(fd: number, uid: number, gid: number): void; + + /** + * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function lchown(path: PathLike, uid: number, gid: number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace lchown { + /** + * Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function __promisify__(path: PathLike, uid: number, gid: number): Promise; + } + + /** + * Synchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function lchownSync(path: PathLike, uid: number, gid: number): void; + + /** + * Asynchronous chmod(2) - Change permissions of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function chmod(path: PathLike, mode: string | number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace chmod { + /** + * Asynchronous chmod(2) - Change permissions of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function __promisify__(path: PathLike, mode: string | number): Promise; + } + + /** + * Synchronous chmod(2) - Change permissions of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function chmodSync(path: PathLike, mode: string | number): void; + + /** + * Asynchronous fchmod(2) - Change permissions of a file. + * @param fd A file descriptor. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function fchmod(fd: number, mode: string | number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace fchmod { + /** + * Asynchronous fchmod(2) - Change permissions of a file. + * @param fd A file descriptor. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function __promisify__(fd: number, mode: string | number): Promise; + } + + /** + * Synchronous fchmod(2) - Change permissions of a file. + * @param fd A file descriptor. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function fchmodSync(fd: number, mode: string | number): void; + + /** + * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function lchmod(path: PathLike, mode: string | number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace lchmod { + /** + * Asynchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function __promisify__(path: PathLike, mode: string | number): Promise; + } + + /** + * Synchronous lchmod(2) - Change permissions of a file. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. + */ + export function lchmodSync(path: PathLike, mode: string | number): void; + + /** + * Asynchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException, stats: Stats) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace stat { + /** + * Asynchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function __promisify__(path: PathLike): Promise; + } + + /** + * Synchronous stat(2) - Get file status. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function statSync(path: PathLike): Stats; + + /** + * Asynchronous fstat(2) - Get file status. + * @param fd A file descriptor. + */ + export function fstat(fd: number, callback: (err: NodeJS.ErrnoException, stats: Stats) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace fstat { + /** + * Asynchronous fstat(2) - Get file status. + * @param fd A file descriptor. + */ + export function __promisify__(fd: number): Promise; + } + + /** + * Synchronous fstat(2) - Get file status. + * @param fd A file descriptor. + */ + export function fstatSync(fd: number): Stats; + + /** + * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException, stats: Stats) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace lstat { + /** + * Asynchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function __promisify__(path: PathLike): Promise; + } + + /** + * Synchronous lstat(2) - Get file status. Does not dereference symbolic links. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function lstatSync(path: PathLike): Stats; + + /** + * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. + * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function link(existingPath: PathLike, newPath: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace link { + /** + * Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file. + * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function link(existingPath: PathLike, newPath: PathLike): Promise; + } + + /** + * Synchronous link(2) - Create a new link (also known as a hard link) to an existing file. + * @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function linkSync(existingPath: PathLike, newPath: PathLike): void; + + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). + * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. + */ + export function symlink(target: PathLike, path: PathLike, type: string | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void; + + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + */ + export function symlink(target: PathLike, path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace symlink { + /** + * Asynchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). + * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. + */ + export function __promisify__(target: PathLike, path: PathLike, type?: string | null): Promise; + } + + /** + * Synchronous symlink(2) - Create a new symbolic link to an existing file. + * @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol. + * @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol. + * @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms). + * When using `'junction'`, the `target` argument will automatically be normalized to an absolute path. + */ + export function symlinkSync(target: PathLike, path: PathLike, type?: string | null): void; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlink(path: PathLike, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, linkString: string) => void): void; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlink(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException, linkString: Buffer) => void): void; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlink(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, linkString: string | Buffer) => void): void; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function readlink(path: PathLike, callback: (err: NodeJS.ErrnoException, linkString: string) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace readlink { + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options?: { encoding?: string | null } | string | null): Promise; + } + + /** + * Synchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlinkSync(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): string; + + /** + * Synchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlinkSync(path: PathLike, options: { encoding: "buffer" } | "buffer"): Buffer; + + /** + * Synchronous readlink(2) - read value of a symbolic link. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readlinkSync(path: PathLike, options?: { encoding?: string | null } | string | null): string | Buffer; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpath(path: PathLike, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => void): void; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpath(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException, resolvedPath: Buffer) => void): void; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpath(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, resolvedPath: string | Buffer) => void): void; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function realpath(path: PathLike, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace realpath { + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options?: { encoding?: string | null } | string | null): Promise; + + export function native(path: PathLike, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => void): void; + export function native(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException, resolvedPath: Buffer) => void): void; + export function native(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, resolvedPath: string | Buffer) => void): void; + export function native(path: PathLike, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => void): void; + } + + /** + * Synchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpathSync(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): string; + + /** + * Synchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpathSync(path: PathLike, options: { encoding: "buffer" } | "buffer"): Buffer; + + /** + * Synchronous realpath(3) - return the canonicalized absolute pathname. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function realpathSync(path: PathLike, options?: { encoding?: string | null } | string | null): string | Buffer; + + export namespace realpathSync { + export function native(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): string; + export function native(path: PathLike, options: { encoding: "buffer" } | "buffer"): Buffer; + export function native(path: PathLike, options?: { encoding?: string | null } | string | null): string | Buffer; + } + + /** + * Asynchronous unlink(2) - delete a name and possibly the file it refers to. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function unlink(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace unlink { + /** + * Asynchronous unlink(2) - delete a name and possibly the file it refers to. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function __promisify__(path: PathLike): Promise; + } + + /** + * Synchronous unlink(2) - delete a name and possibly the file it refers to. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function unlinkSync(path: PathLike): void; + + /** + * Asynchronous rmdir(2) - delete a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function rmdir(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace rmdir { + /** + * Asynchronous rmdir(2) - delete a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function __promisify__(path: PathLike): Promise; + } + + /** + * Synchronous rmdir(2) - delete a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function rmdirSync(path: PathLike): void; + + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdir(path: PathLike, mode: number | string | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void; + + /** + * Asynchronous mkdir(2) - create a directory with a mode of `0o777`. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function mkdir(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace mkdir { + /** + * Asynchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function __promisify__(path: PathLike, mode?: number | string | null): Promise; + } + + /** + * Synchronous mkdir(2) - create a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`. + */ + export function mkdirSync(path: PathLike, mode?: number | string | null): void; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtemp(prefix: string, options: { encoding?: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, folder: string) => void): void; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtemp(prefix: string, options: "buffer" | { encoding: "buffer" }, callback: (err: NodeJS.ErrnoException, folder: Buffer) => void): void; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtemp(prefix: string, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, folder: string | Buffer) => void): void; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + */ + export function mkdtemp(prefix: string, callback: (err: NodeJS.ErrnoException, folder: string) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace mkdtemp { + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(prefix: string, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(prefix: string, options: { encoding: "buffer" } | "buffer"): Promise; + + /** + * Asynchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(prefix: string, options?: { encoding?: string | null } | string | null): Promise; + } + + /** + * Synchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtempSync(prefix: string, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): string; + + /** + * Synchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtempSync(prefix: string, options: { encoding: "buffer" } | "buffer"): Buffer; + + /** + * Synchronously creates a unique temporary directory. + * Generates six random characters to be appended behind a required prefix to create a unique temporary directory. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function mkdtempSync(prefix: string, options?: { encoding?: string | null } | string | null): string | Buffer; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdir(path: PathLike, options: { encoding: BufferEncoding | null } | BufferEncoding | undefined | null, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdir(path: PathLike, options: { encoding: "buffer" } | "buffer", callback: (err: NodeJS.ErrnoException, files: Buffer[]) => void): void; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdir(path: PathLike, options: { encoding?: string | null } | string | undefined | null, callback: (err: NodeJS.ErrnoException, files: string[] | Buffer[]) => void): void; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function readdir(path: PathLike, callback: (err: NodeJS.ErrnoException, files: string[]) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace readdir { + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options?: { encoding: BufferEncoding | null } | BufferEncoding | null): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options: "buffer" | { encoding: "buffer" }): Promise; + + /** + * Asynchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function __promisify__(path: PathLike, options?: { encoding?: string | null } | string | null): Promise; + } + + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdirSync(path: PathLike, options?: { encoding: BufferEncoding | null } | BufferEncoding | null): string[]; + + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdirSync(path: PathLike, options: { encoding: "buffer" } | "buffer"): Buffer[]; + + /** + * Synchronous readdir(3) - read a directory. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used. + */ + export function readdirSync(path: PathLike, options?: { encoding?: string | null } | string | null): string[] | Buffer[]; + + /** + * Asynchronous close(2) - close a file descriptor. + * @param fd A file descriptor. + */ + export function close(fd: number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace close { + /** + * Asynchronous close(2) - close a file descriptor. + * @param fd A file descriptor. + */ + export function __promisify__(fd: number): Promise; + } + + /** + * Synchronous close(2) - close a file descriptor. + * @param fd A file descriptor. + */ + export function closeSync(fd: number): void; + + /** + * Asynchronous open(2) - open and possibly create a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. + */ + export function open(path: PathLike, flags: string | number, mode: string | number | undefined | null, callback: (err: NodeJS.ErrnoException, fd: number) => void): void; + + /** + * Asynchronous open(2) - open and possibly create a file. If the file is created, its mode will be `0o666`. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + */ + export function open(path: PathLike, flags: string | number, callback: (err: NodeJS.ErrnoException, fd: number) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace open { + /** + * Asynchronous open(2) - open and possibly create a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. + */ + export function __promisify__(path: PathLike, flags: string | number, mode?: string | number | null): Promise; + } + + /** + * Synchronous open(2) - open and possibly create a file, returning a file descriptor.. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param mode A file mode. If a string is passed, it is parsed as an octal integer. If not supplied, defaults to `0o666`. + */ + export function openSync(path: PathLike, flags: string | number, mode?: string | number | null): number; + + /** + * Asynchronously change file timestamps of the file referenced by the supplied path. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + export function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace utimes { + /** + * Asynchronously change file timestamps of the file referenced by the supplied path. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + export function __promisify__(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise; + } + + /** + * Synchronously change file timestamps of the file referenced by the supplied path. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + export function utimesSync(path: PathLike, atime: string | number | Date, mtime: string | number | Date): void; + + /** + * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + export function futimes(fd: number, atime: string | number | Date, mtime: string | number | Date, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace futimes { + /** + * Asynchronously change file timestamps of the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + export function __promisify__(fd: number, atime: string | number | Date, mtime: string | number | Date): Promise; + } + + /** + * Synchronously change file timestamps of the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param atime The last access time. If a string is provided, it will be coerced to number. + * @param mtime The last modified time. If a string is provided, it will be coerced to number. + */ + export function futimesSync(fd: number, atime: string | number | Date, mtime: string | number | Date): void; + + /** + * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + * @param fd A file descriptor. + */ + export function fsync(fd: number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace fsync { + /** + * Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + * @param fd A file descriptor. + */ + export function __promisify__(fd: number): Promise; + } + + /** + * Synchronous fsync(2) - synchronize a file's in-core state with the underlying storage device. + * @param fd A file descriptor. + */ + export function fsyncSync(fd: number): void; + + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + export function write(fd: number, buffer: TBuffer, offset: number | undefined | null, length: number | undefined | null, position: number | undefined | null, callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void): void; + + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + */ + export function write(fd: number, buffer: TBuffer, offset: number | undefined | null, length: number | undefined | null, callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void): void; + + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + */ + export function write(fd: number, buffer: TBuffer, offset: number | undefined | null, callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void): void; + + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + */ + export function write(fd: number, buffer: TBuffer, callback: (err: NodeJS.ErrnoException, written: number, buffer: TBuffer) => void): void; + + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + export function write(fd: number, string: any, position: number | undefined | null, encoding: string | undefined | null, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; + + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + export function write(fd: number, string: any, position: number | undefined | null, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; + + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + */ + export function write(fd: number, string: any, callback: (err: NodeJS.ErrnoException, written: number, str: string) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace write { + /** + * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + export function __promisify__(fd: number, buffer?: TBuffer, offset?: number, length?: number, position?: number | null): Promise<{ bytesWritten: number, buffer: TBuffer }>; + + /** + * Asynchronously writes `string` to the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + export function __promisify__(fd: number, string: any, position?: number | null, encoding?: string | null): Promise<{ bytesWritten: number, buffer: string }>; + } + + /** + * Synchronously writes `buffer` to the file referenced by the supplied file descriptor, returning the number of bytes written. + * @param fd A file descriptor. + * @param offset The part of the buffer to be written. If not supplied, defaults to `0`. + * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + */ + export function writeSync(fd: number, buffer: Buffer | Uint8Array, offset?: number | null, length?: number | null, position?: number | null): number; + + /** + * Synchronously writes `string` to the file referenced by the supplied file descriptor, returning the number of bytes written. + * @param fd A file descriptor. + * @param string A string to write. If something other than a string is supplied it will be coerced to a string. + * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position. + * @param encoding The expected string encoding. + */ + export function writeSync(fd: number, string: any, position?: number | null, encoding?: string | null): number; + + /** + * Asynchronously reads data from the file referenced by the supplied file descriptor. + * @param fd A file descriptor. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. + */ + export function read(fd: number, buffer: TBuffer, offset: number, length: number, position: number | null, callback?: (err: NodeJS.ErrnoException, bytesRead: number, buffer: TBuffer) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace read { + /** + * @param fd A file descriptor. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. + */ + export function __promisify__(fd: number, buffer: TBuffer, offset: number, length: number, position: number | null): Promise<{ bytesRead: number, buffer: TBuffer }>; + } + + /** + * Synchronously reads data from the file referenced by the supplied file descriptor, returning the number of bytes read. + * @param fd A file descriptor. + * @param buffer The buffer that the data will be written to. + * @param offset The offset in the buffer at which to start writing. + * @param length The number of bytes to read. + * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position. + */ + export function readSync(fd: number, buffer: Buffer | Uint8Array, offset: number, length: number, position: number | null): number; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFile(path: PathLike | number, options: { encoding?: null; flag?: string; } | undefined | null, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFile(path: PathLike | number, options: { encoding: string; flag?: string; } | string, callback: (err: NodeJS.ErrnoException, data: string) => void): void; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFile(path: PathLike | number, options: { encoding?: string | null; flag?: string; } | string | undefined | null, callback: (err: NodeJS.ErrnoException, data: string | Buffer) => void): void; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + */ + export function readFile(path: PathLike | number, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace readFile { + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function __promisify__(path: PathLike | number, options?: { encoding?: null; flag?: string; } | null): Promise; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function __promisify__(path: PathLike | number, options: { encoding: string; flag?: string; } | string): Promise; + + /** + * Asynchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function __promisify__(path: PathLike | number, options?: { encoding?: string | null; flag?: string; } | string | null): Promise; + } + + /** + * Synchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options An object that may contain an optional flag. If a flag is not provided, it defaults to `'r'`. + */ + export function readFileSync(path: PathLike | number, options?: { encoding?: null; flag?: string; } | null): Buffer; + + /** + * Synchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFileSync(path: PathLike | number, options: { encoding: string; flag?: string; } | string): string; + + /** + * Synchronously reads the entire contents of a file. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param options Either the encoding for the result, or an object that contains the encoding and an optional flag. + * If a flag is not provided, it defaults to `'r'`. + */ + export function readFileSync(path: PathLike | number, options?: { encoding?: string | null; flag?: string; } | string | null): string | Buffer; + + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + export function writeFile(path: PathLike | number, data: any, options: { encoding?: string | null; mode?: number | string; flag?: string; } | string | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void; + + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + */ + export function writeFile(path: PathLike | number, data: any, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace writeFile { + /** + * Asynchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + export function __promisify__(path: PathLike | number, data: any, options?: { encoding?: string | null; mode?: number | string; flag?: string; } | string | null): Promise; + } + + /** + * Synchronously writes data to a file, replacing the file if it already exists. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'w'` is used. + */ + export function writeFileSync(path: PathLike | number, data: any, options?: { encoding?: string | null; mode?: number | string; flag?: string; } | string | null): void; + + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + export function appendFile(file: PathLike | number, data: any, options: { encoding?: string | null, mode?: string | number, flag?: string } | string | undefined | null, callback: (err: NodeJS.ErrnoException) => void): void; + + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + */ + export function appendFile(file: PathLike | number, data: any, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace appendFile { + /** + * Asynchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + export function __promisify__(file: PathLike | number, data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string } | string | null): Promise; + } + + /** + * Synchronously append data to a file, creating the file if it does not exist. + * @param file A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * If a file descriptor is provided, the underlying file will _not_ be closed automatically. + * @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string. + * @param options Either the encoding for the file, or an object optionally specifying the encoding, file mode, and flag. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `mode` is not supplied, the default of `0o666` is used. + * If `mode` is a string, it is parsed as an octal integer. + * If `flag` is not supplied, the default of `'a'` is used. + */ + export function appendFileSync(file: PathLike | number, data: any, options?: { encoding?: string | null; mode?: number | string; flag?: string; } | string | null): void; + + /** + * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. + */ + export function watchFile(filename: PathLike, options: { persistent?: boolean; interval?: number; } | undefined, listener: (curr: Stats, prev: Stats) => void): void; + + /** + * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function watchFile(filename: PathLike, listener: (curr: Stats, prev: Stats) => void): void; + + /** + * Stop watching for changes on `filename`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function unwatchFile(filename: PathLike, listener?: (curr: Stats, prev: Stats) => void): void; + + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + export function watch(filename: PathLike, options: { encoding?: BufferEncoding | null, persistent?: boolean, recursive?: boolean } | BufferEncoding | undefined | null, listener?: (event: string, filename: string) => void): FSWatcher; + + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + export function watch(filename: PathLike, options: { encoding: "buffer", persistent?: boolean, recursive?: boolean } | "buffer", listener?: (event: string, filename: Buffer) => void): FSWatcher; + + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + * @param options Either the encoding for the filename provided to the listener, or an object optionally specifying encoding, persistent, and recursive options. + * If `encoding` is not supplied, the default of `'utf8'` is used. + * If `persistent` is not supplied, the default of `true` is used. + * If `recursive` is not supplied, the default of `false` is used. + */ + export function watch(filename: PathLike, options: { encoding?: string | null, persistent?: boolean, recursive?: boolean } | string | null, listener?: (event: string, filename: string | Buffer) => void): FSWatcher; + + /** + * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`. + * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function watch(filename: PathLike, listener?: (event: string, filename: string) => any): FSWatcher; + + /** + * Asynchronously tests whether or not the given path exists by checking with the file system. + * @deprecated + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function exists(path: PathLike, callback: (exists: boolean) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace exists { + /** + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + function __promisify__(path: PathLike): Promise; + } + + /** + * Synchronously tests whether or not the given path exists by checking with the file system. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function existsSync(path: PathLike): boolean; + + export namespace constants { + // File Access Constants + + /** Constant for fs.access(). File is visible to the calling process. */ + export const F_OK: number; + + /** Constant for fs.access(). File can be read by the calling process. */ + export const R_OK: number; + + /** Constant for fs.access(). File can be written by the calling process. */ + export const W_OK: number; + + /** Constant for fs.access(). File can be executed by the calling process. */ + export const X_OK: number; + + // File Open Constants + + /** Constant for fs.open(). Flag indicating to open a file for read-only access. */ + export const O_RDONLY: number; + + /** Constant for fs.open(). Flag indicating to open a file for write-only access. */ + export const O_WRONLY: number; + + /** Constant for fs.open(). Flag indicating to open a file for read-write access. */ + export const O_RDWR: number; + + /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */ + export const O_CREAT: number; + + /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */ + export const O_EXCL: number; + + /** Constant for fs.open(). Flag indicating that if path identifies a terminal device, opening the path shall not cause that terminal to become the controlling terminal for the process (if the process does not already have one). */ + export const O_NOCTTY: number; + + /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */ + export const O_TRUNC: number; + + /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */ + export const O_APPEND: number; + + /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */ + export const O_DIRECTORY: number; + + /** Constant for fs.open(). Flag indicating reading accesses to the file system will no longer result in an update to the atime information associated with the file. This flag is available on Linux operating systems only. */ + export const O_NOATIME: number; + + /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */ + export const O_NOFOLLOW: number; + + /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */ + export const O_SYNC: number; + + /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O with write operations waiting for data integrity. */ + export const O_DSYNC: number; + + /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */ + export const O_SYMLINK: number; + + /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */ + export const O_DIRECT: number; + + /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */ + export const O_NONBLOCK: number; + + // File Type Constants + + /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */ + export const S_IFMT: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */ + export const S_IFREG: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */ + export const S_IFDIR: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */ + export const S_IFCHR: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */ + export const S_IFBLK: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */ + export const S_IFIFO: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */ + export const S_IFLNK: number; + + /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */ + export const S_IFSOCK: number; + + // File Mode Constants + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */ + export const S_IRWXU: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */ + export const S_IRUSR: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */ + export const S_IWUSR: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */ + export const S_IXUSR: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */ + export const S_IRWXG: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */ + export const S_IRGRP: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */ + export const S_IWGRP: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */ + export const S_IXGRP: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */ + export const S_IRWXO: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */ + export const S_IROTH: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */ + export const S_IWOTH: number; + + /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */ + export const S_IXOTH: number; + + /** Constant for fs.copyFile. Flag indicating the destination file should not be overwritten if it already exists. */ + export const COPYFILE_EXCL: number; + } + + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function access(path: PathLike, mode: number | undefined, callback: (err: NodeJS.ErrnoException) => void): void; + + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function access(path: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace access { + /** + * Asynchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function __promisify__(path: PathLike, mode?: number): Promise; + } + + /** + * Synchronously tests a user's permissions for the file specified by path. + * @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function accessSync(path: PathLike, mode?: number): void; + + /** + * Returns a new `ReadStream` object. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function createReadStream(path: PathLike, options?: string | { + flags?: string; + encoding?: string; + fd?: number; + mode?: number; + autoClose?: boolean; + start?: number; + end?: number; + highWaterMark?: number; + }): ReadStream; + + /** + * Returns a new `WriteStream` object. + * @param path A path to a file. If a URL is provided, it must use the `file:` protocol. + * URL support is _experimental_. + */ + export function createWriteStream(path: PathLike, options?: string | { + flags?: string; + encoding?: string; + fd?: number; + mode?: number; + autoClose?: boolean; + start?: number; + }): WriteStream; + + /** + * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. + * @param fd A file descriptor. + */ + export function fdatasync(fd: number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace fdatasync { + /** + * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device. + * @param fd A file descriptor. + */ + export function __promisify__(fd: number): Promise; + } + + /** + * Synchronous fdatasync(2) - synchronize a file's in-core state with storage device. + * @param fd A file descriptor. + */ + export function fdatasyncSync(fd: number): void; + + /** + * Asynchronously copies src to dest. By default, dest is overwritten if it already exists. + * No arguments other than a possible exception are given to the callback function. + * Node.js makes no guarantees about the atomicity of the copy operation. + * If an error occurs after the destination file has been opened for writing, Node.js will attempt + * to remove the destination. + * @param src A path to the source file. + * @param dest A path to the destination file. + */ + export function copyFile(src: PathLike, dest: PathLike, callback: (err: NodeJS.ErrnoException) => void): void; + /** + * Asynchronously copies src to dest. By default, dest is overwritten if it already exists. + * No arguments other than a possible exception are given to the callback function. + * Node.js makes no guarantees about the atomicity of the copy operation. + * If an error occurs after the destination file has been opened for writing, Node.js will attempt + * to remove the destination. + * @param src A path to the source file. + * @param dest A path to the destination file. + * @param flags An integer that specifies the behavior of the copy operation. The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists. + */ + export function copyFile(src: PathLike, dest: PathLike, flags: number, callback: (err: NodeJS.ErrnoException) => void): void; + + // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime. + export namespace copyFile { + /** + * Asynchronously copies src to dest. By default, dest is overwritten if it already exists. + * No arguments other than a possible exception are given to the callback function. + * Node.js makes no guarantees about the atomicity of the copy operation. + * If an error occurs after the destination file has been opened for writing, Node.js will attempt + * to remove the destination. + * @param src A path to the source file. + * @param dest A path to the destination file. + * @param flags An optional integer that specifies the behavior of the copy operation. The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists. + */ + export function __promisify__(src: PathLike, dst: PathLike, flags?: number): Promise; + } + + /** + * Synchronously copies src to dest. By default, dest is overwritten if it already exists. + * Node.js makes no guarantees about the atomicity of the copy operation. + * If an error occurs after the destination file has been opened for writing, Node.js will attempt + * to remove the destination. + * @param src A path to the source file. + * @param dest A path to the destination file. + * @param flags An optional integer that specifies the behavior of the copy operation. The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists. + */ + export function copyFileSync(src: PathLike, dest: PathLike, flags?: number): void; +} + +declare module "path" { + /** + * A parsed path object generated by path.parse() or consumed by path.format(). + */ + export interface ParsedPath { + /** + * The root of the path such as '/' or 'c:\' + */ + root: string; + /** + * The full directory path such as '/home/user/dir' or 'c:\path\dir' + */ + dir: string; + /** + * The file name including extension (if any) such as 'index.html' + */ + base: string; + /** + * The file extension (if any) such as '.html' + */ + ext: string; + /** + * The file name without extension (if any) such as 'index' + */ + name: string; + } + export interface FormatInputPathObject { + /** + * The root of the path such as '/' or 'c:\' + */ + root?: string; + /** + * The full directory path such as '/home/user/dir' or 'c:\path\dir' + */ + dir?: string; + /** + * The file name including extension (if any) such as 'index.html' + */ + base?: string; + /** + * The file extension (if any) such as '.html' + */ + ext?: string; + /** + * The file name without extension (if any) such as 'index' + */ + name?: string; + } + + /** + * Normalize a string path, reducing '..' and '.' parts. + * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. + * + * @param p string path to normalize. + */ + export function normalize(p: string): string; + /** + * Join all arguments together and normalize the resulting path. + * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown. + * + * @param paths paths to join. + */ + export function join(...paths: string[]): string; + /** + * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. + * + * Starting from leftmost {from} paramter, resolves {to} to an absolute path. + * + * If {to} isn't already absolute, {from} arguments are prepended in right to left order, until an absolute path is found. If after using all {from} paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root directory. + * + * @param pathSegments string paths to join. Non-string arguments are ignored. + */ + export function resolve(...pathSegments: string[]): string; + /** + * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. + * + * @param path path to test. + */ + export function isAbsolute(path: string): boolean; + /** + * Solve the relative path from {from} to {to}. + * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. + */ + export function relative(from: string, to: string): string; + /** + * Return the directory name of a path. Similar to the Unix dirname command. + * + * @param p the path to evaluate. + */ + export function dirname(p: string): string; + /** + * Return the last portion of a path. Similar to the Unix basename command. + * Often used to extract the file name from a fully qualified path. + * + * @param p the path to evaluate. + * @param ext optionally, an extension to remove from the result. + */ + export function basename(p: string, ext?: string): string; + /** + * Return the extension of the path, from the last '.' to end of string in the last portion of the path. + * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string + * + * @param p the path to evaluate. + */ + export function extname(p: string): string; + /** + * The platform-specific file separator. '\\' or '/'. + */ + export var sep: '\\' | '/'; + /** + * The platform-specific file delimiter. ';' or ':'. + */ + export var delimiter: ';' | ':'; + /** + * Returns an object from a path string - the opposite of format(). + * + * @param pathString path to evaluate. + */ + export function parse(pathString: string): ParsedPath; + /** + * Returns a path string from an object - the opposite of parse(). + * + * @param pathString path to evaluate. + */ + export function format(pathObject: FormatInputPathObject): string; + + export module posix { + export function normalize(p: string): string; + export function join(...paths: any[]): string; + export function resolve(...pathSegments: any[]): string; + export function isAbsolute(p: string): boolean; + export function relative(from: string, to: string): string; + export function dirname(p: string): string; + export function basename(p: string, ext?: string): string; + export function extname(p: string): string; + export var sep: string; + export var delimiter: string; + export function parse(p: string): ParsedPath; + export function format(pP: FormatInputPathObject): string; + } + + export module win32 { + export function normalize(p: string): string; + export function join(...paths: any[]): string; + export function resolve(...pathSegments: any[]): string; + export function isAbsolute(p: string): boolean; + export function relative(from: string, to: string): string; + export function dirname(p: string): string; + export function basename(p: string, ext?: string): string; + export function extname(p: string): string; + export var sep: string; + export var delimiter: string; + export function parse(p: string): ParsedPath; + export function format(pP: FormatInputPathObject): string; + } +} + +declare module "string_decoder" { + export interface NodeStringDecoder { + write(buffer: Buffer): string; + end(buffer?: Buffer): string; + } + export var StringDecoder: { + new(encoding?: string): NodeStringDecoder; + }; +} + +declare module "tls" { + import * as crypto from "crypto"; + import * as dns from "dns"; + import * as net from "net"; + import * as stream from "stream"; + + var CLIENT_RENEG_LIMIT: number; + var CLIENT_RENEG_WINDOW: number; + + export interface Certificate { + /** + * Country code. + */ + C: string; + /** + * Street. + */ + ST: string; + /** + * Locality. + */ + L: string; + /** + * Organization. + */ + O: string; + /** + * Organizational unit. + */ + OU: string; + /** + * Common name. + */ + CN: string; + } + + export interface PeerCertificate { + subject: Certificate; + issuer: Certificate; + subjectaltname: string; + infoAccess: { [index: string]: string[] | undefined }; + modulus: string; + exponent: string; + valid_from: string; + valid_to: string; + fingerprint: string; + ext_key_usage: string[]; + serialNumber: string; + raw: Buffer; + } + + export interface DetailedPeerCertificate extends PeerCertificate { + issuerCertificate: DetailedPeerCertificate; + } + + export interface CipherNameAndProtocol { + /** + * The cipher name. + */ + name: string; + /** + * SSL/TLS protocol version. + */ + version: string; + } + + export class TLSSocket extends net.Socket { + /** + * Construct a new tls.TLSSocket object from an existing TCP socket. + */ + constructor(socket: net.Socket, options?: { + /** + * An optional TLS context object from tls.createSecureContext() + */ + secureContext?: SecureContext, + /** + * If true the TLS socket will be instantiated in server-mode. + * Defaults to false. + */ + isServer?: boolean, + /** + * An optional net.Server instance. + */ + server?: net.Server, + /** + * If true the server will request a certificate from clients that + * connect and attempt to verify that certificate. Defaults to + * false. + */ + requestCert?: boolean, + /** + * If true the server will reject any connection which is not + * authorized with the list of supplied CAs. This option only has an + * effect if requestCert is true. Defaults to false. + */ + rejectUnauthorized?: boolean, + /** + * An array of strings or a Buffer naming possible NPN protocols. + * (Protocols should be ordered by their priority.) + */ + NPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array, + /** + * An array of strings or a Buffer naming possible ALPN protocols. + * (Protocols should be ordered by their priority.) When the server + * receives both NPN and ALPN extensions from the client, ALPN takes + * precedence over NPN and the server does not send an NPN extension + * to the client. + */ + ALPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array, + /** + * SNICallback(servername, cb) A function that will be + * called if the client supports SNI TLS extension. Two arguments + * will be passed when called: servername and cb. SNICallback should + * invoke cb(null, ctx), where ctx is a SecureContext instance. + * (tls.createSecureContext(...) can be used to get a proper + * SecureContext.) If SNICallback wasn't provided the default callback + * with high-level API will be used (see below). + */ + SNICallback?: (servername: string, cb: (err: Error | null, ctx: SecureContext) => void) => void, + /** + * An optional Buffer instance containing a TLS session. + */ + session?: Buffer, + /** + * If true, specifies that the OCSP status request extension will be + * added to the client hello and an 'OCSPResponse' event will be + * emitted on the socket before establishing a secure communication + */ + requestOCSP?: boolean + }); + + /** + * A boolean that is true if the peer certificate was signed by one of the specified CAs, otherwise false. + */ + authorized: boolean; + /** + * The reason why the peer's certificate has not been verified. + * This property becomes available only when tlsSocket.authorized === false. + */ + authorizationError: Error; + /** + * Static boolean value, always true. + * May be used to distinguish TLS sockets from regular ones. + */ + encrypted: boolean; + /** + * Returns an object representing the cipher name and the SSL/TLS protocol version of the current connection. + * @returns Returns an object representing the cipher name + * and the SSL/TLS protocol version of the current connection. + */ + getCipher(): CipherNameAndProtocol; + /** + * Returns an object representing the peer's certificate. + * The returned object has some properties corresponding to the field of the certificate. + * If detailed argument is true the full chain with issuer property will be returned, + * if false only the top certificate without issuer property. + * If the peer does not provide a certificate, it returns null or an empty object. + * @param detailed - If true; the full chain with issuer property will be returned. + * @returns An object representing the peer's certificate. + */ + getPeerCertificate(detailed: true): DetailedPeerCertificate; + getPeerCertificate(detailed?: false): PeerCertificate; + getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate; + /** + * Returns a string containing the negotiated SSL/TLS protocol version of the current connection. + * The value `'unknown'` will be returned for connected sockets that have not completed the handshaking process. + * The value `null` will be returned for server sockets or disconnected client sockets. + * See https://www.openssl.org/docs/man1.0.2/ssl/SSL_get_version.html for more information. + * @returns negotiated SSL/TLS protocol version of the current connection + */ + getProtocol(): string | null; + /** + * Could be used to speed up handshake establishment when reconnecting to the server. + * @returns ASN.1 encoded TLS session or undefined if none was negotiated. + */ + getSession(): any; + /** + * NOTE: Works only with client TLS sockets. + * Useful only for debugging, for session reuse provide session option to tls.connect(). + * @returns TLS session ticket or undefined if none was negotiated. + */ + getTLSTicket(): any; + /** + * Initiate TLS renegotiation process. + * + * NOTE: Can be used to request peer's certificate after the secure connection has been established. + * ANOTHER NOTE: When running as the server, socket will be destroyed with an error after handshakeTimeout timeout. + * @param options - The options may contain the following fields: rejectUnauthorized, + * requestCert (See tls.createServer() for details). + * @param callback - callback(err) will be executed with null as err, once the renegotiation + * is successfully completed. + */ + renegotiate(options: { rejectUnauthorized?: boolean, requestCert?: boolean }, callback: (err: Error | null) => void): any; + /** + * Set maximum TLS fragment size (default and maximum value is: 16384, minimum is: 512). + * Smaller fragment size decreases buffering latency on the client: large fragments are buffered by + * the TLS layer until the entire fragment is received and its integrity is verified; + * large fragments can span multiple roundtrips, and their processing can be delayed due to packet + * loss or reordering. However, smaller fragments add extra TLS framing bytes and CPU overhead, + * which may decrease overall server throughput. + * @param size - TLS fragment size (default and maximum value is: 16384, minimum is: 512). + * @returns Returns true on success, false otherwise. + */ + setMaxSendFragment(size: number): boolean; + + /** + * events.EventEmitter + * 1. OCSPResponse + * 2. secureConnect + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; + addListener(event: "secureConnect", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "OCSPResponse", response: Buffer): boolean; + emit(event: "secureConnect"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "OCSPResponse", listener: (response: Buffer) => void): this; + on(event: "secureConnect", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "OCSPResponse", listener: (response: Buffer) => void): this; + once(event: "secureConnect", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; + prependListener(event: "secureConnect", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "OCSPResponse", listener: (response: Buffer) => void): this; + prependOnceListener(event: "secureConnect", listener: () => void): this; + } + + export interface TlsOptions extends SecureContextOptions { + handshakeTimeout?: number; + requestCert?: boolean; + rejectUnauthorized?: boolean; + NPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array; + ALPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array; + SNICallback?: (servername: string, cb: (err: Error | null, ctx: SecureContext) => void) => void; + sessionTimeout?: number; + ticketKeys?: Buffer; + } + + export interface ConnectionOptions extends SecureContextOptions { + host?: string; + port?: number; + path?: string; // Creates unix socket connection to path. If this option is specified, `host` and `port` are ignored. + socket?: net.Socket; // Establish secure connection on a given socket rather than creating a new socket + rejectUnauthorized?: boolean; // Defaults to true + NPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array; + ALPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array; + checkServerIdentity?: typeof checkServerIdentity; + servername?: string; // SNI TLS Extension + session?: Buffer; + minDHSize?: number; + secureContext?: SecureContext; // If not provided, the entire ConnectionOptions object will be passed to tls.createSecureContext() + lookup?: net.LookupFunction; + } + + export class Server extends net.Server { + addContext(hostName: string, credentials: { + key: string; + cert: string; + ca: string; + }): void; + + /** + * events.EventEmitter + * 1. tlsClientError + * 2. newSession + * 3. OCSPRequest + * 4. resumeSession + * 5. secureConnection + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + addListener(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this; + addListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this; + addListener(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this; + addListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "tlsClientError", err: Error, tlsSocket: TLSSocket): boolean; + emit(event: "newSession", sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void): boolean; + emit(event: "OCSPRequest", certificate: Buffer, issuer: Buffer, callback: Function): boolean; + emit(event: "resumeSession", sessionId: any, callback: (err: Error, sessionData: any) => void): boolean; + emit(event: "secureConnection", tlsSocket: TLSSocket): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + on(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this; + on(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this; + on(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this; + on(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + once(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this; + once(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this; + once(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this; + once(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + prependListener(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this; + prependListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this; + prependListener(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this; + prependListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this; + prependOnceListener(event: "newSession", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this; + prependOnceListener(event: "OCSPRequest", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this; + prependOnceListener(event: "resumeSession", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this; + prependOnceListener(event: "secureConnection", listener: (tlsSocket: TLSSocket) => void): this; + } + + export interface ClearTextStream extends stream.Duplex { + authorized: boolean; + authorizationError: Error; + getPeerCertificate(): any; + getCipher: { + name: string; + version: string; + }; + address: { + port: number; + family: string; + address: string; + }; + remoteAddress: string; + remotePort: number; + } + + export interface SecurePair { + encrypted: any; + cleartext: any; + } + + export interface SecureContextOptions { + pfx?: string | Buffer | Array; + key?: string | Buffer | Array; + passphrase?: string; + cert?: string | Buffer | Array; + ca?: string | Buffer | Array; + ciphers?: string; + honorCipherOrder?: boolean; + ecdhCurve?: string; + clientCertEngine?: string; + crl?: string | Buffer | Array; + dhparam?: string | Buffer; + secureOptions?: number; // Value is a numeric bitmask of the `SSL_OP_*` options + secureProtocol?: string; // SSL Method, e.g. SSLv23_method + sessionIdContext?: string; + } + + export interface SecureContext { + context: any; + } + + /* + * Verifies the certificate `cert` is issued to host `host`. + * @host The hostname to verify the certificate against + * @cert PeerCertificate representing the peer's certificate + * + * Returns Error object, populating it with the reason, host and cert on failure. On success, returns undefined. + */ + export function checkServerIdentity(host: string, cert: PeerCertificate): Error | undefined; + export function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server; + export function connect(options: ConnectionOptions, secureConnectionListener?: () => void): TLSSocket; + export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket; + export function createSecurePair(credentials?: crypto.Credentials, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair; + export function createSecureContext(details: SecureContextOptions): SecureContext; + export function getCiphers(): string[]; + + export var DEFAULT_ECDH_CURVE: string; +} + +declare module "crypto" { + export interface Certificate { + exportChallenge(spkac: string | Buffer): Buffer; + exportPublicKey(spkac: string | Buffer): Buffer; + verifySpkac(spkac: Buffer): boolean; + } + export var Certificate: { + new(): Certificate; + (): Certificate; + }; + + export var fips: boolean; + + export interface CredentialDetails { + pfx: string; + key: string; + passphrase: string; + cert: string; + ca: string | string[]; + crl: string | string[]; + ciphers: string; + } + export interface Credentials { context?: any; } + export function createCredentials(details: CredentialDetails): Credentials; + export function createHash(algorithm: string): Hash; + export function createHmac(algorithm: string, key: string | Buffer): Hmac; + + type Utf8AsciiLatin1Encoding = "utf8" | "ascii" | "latin1"; + type HexBase64Latin1Encoding = "latin1" | "hex" | "base64"; + type Utf8AsciiBinaryEncoding = "utf8" | "ascii" | "binary"; + type HexBase64BinaryEncoding = "binary" | "base64" | "hex"; + type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid"; + + export interface Hash extends NodeJS.ReadWriteStream { + update(data: string | Buffer | DataView): Hash; + update(data: string | Buffer | DataView, input_encoding: Utf8AsciiLatin1Encoding): Hash; + digest(): Buffer; + digest(encoding: HexBase64Latin1Encoding): string; + } + export interface Hmac extends NodeJS.ReadWriteStream { + update(data: string | Buffer | DataView): Hmac; + update(data: string | Buffer | DataView, input_encoding: Utf8AsciiLatin1Encoding): Hmac; + digest(): Buffer; + digest(encoding: HexBase64Latin1Encoding): string; + } + export function createCipher(algorithm: string, password: any): Cipher; + export function createCipheriv(algorithm: string, key: any, iv: any): Cipher; + export interface Cipher extends NodeJS.ReadWriteStream { + update(data: Buffer | DataView): Buffer; + update(data: string, input_encoding: Utf8AsciiBinaryEncoding): Buffer; + update(data: Buffer | DataView, input_encoding: any, output_encoding: HexBase64BinaryEncoding): string; + update(data: string, input_encoding: Utf8AsciiBinaryEncoding, output_encoding: HexBase64BinaryEncoding): string; + final(): Buffer; + final(output_encoding: string): string; + setAutoPadding(auto_padding?: boolean): this; + getAuthTag(): Buffer; + setAAD(buffer: Buffer): this; + } + export function createDecipher(algorithm: string, password: any): Decipher; + export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher; + export interface Decipher extends NodeJS.ReadWriteStream { + update(data: Buffer | DataView): Buffer; + update(data: string, input_encoding: HexBase64BinaryEncoding): Buffer; + update(data: Buffer | DataView, input_encoding: any, output_encoding: Utf8AsciiBinaryEncoding): string; + update(data: string, input_encoding: HexBase64BinaryEncoding, output_encoding: Utf8AsciiBinaryEncoding): string; + final(): Buffer; + final(output_encoding: string): string; + setAutoPadding(auto_padding?: boolean): this; + setAuthTag(tag: Buffer): this; + setAAD(buffer: Buffer): this; + } + export function createSign(algorithm: string): Signer; + export interface Signer extends NodeJS.WritableStream { + update(data: string | Buffer | DataView): Signer; + update(data: string | Buffer | DataView, input_encoding: Utf8AsciiLatin1Encoding): Signer; + sign(private_key: string | { key: string; passphrase: string }): Buffer; + sign(private_key: string | { key: string; passphrase: string }, output_format: HexBase64Latin1Encoding): string; + } + export function createVerify(algorith: string): Verify; + export interface Verify extends NodeJS.WritableStream { + update(data: string | Buffer | DataView): Verify; + update(data: string | Buffer | DataView, input_encoding: Utf8AsciiLatin1Encoding): Verify; + verify(object: string | Object, signature: Buffer | DataView): boolean; + verify(object: string | Object, signature: string, signature_format: HexBase64Latin1Encoding): boolean; + // https://nodejs.org/api/crypto.html#crypto_verifier_verify_object_signature_signature_format + // The signature field accepts a TypedArray type, but it is only available starting ES2017 + } + export function createDiffieHellman(prime_length: number, generator?: number): DiffieHellman; + export function createDiffieHellman(prime: Buffer): DiffieHellman; + export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding): DiffieHellman; + export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: number | Buffer): DiffieHellman; + export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: string, generator_encoding: HexBase64Latin1Encoding): DiffieHellman; + export interface DiffieHellman { + generateKeys(): Buffer; + generateKeys(encoding: HexBase64Latin1Encoding): string; + computeSecret(other_public_key: Buffer): Buffer; + computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer; + computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string; + getPrime(): Buffer; + getPrime(encoding: HexBase64Latin1Encoding): string; + getGenerator(): Buffer; + getGenerator(encoding: HexBase64Latin1Encoding): string; + getPublicKey(): Buffer; + getPublicKey(encoding: HexBase64Latin1Encoding): string; + getPrivateKey(): Buffer; + getPrivateKey(encoding: HexBase64Latin1Encoding): string; + setPublicKey(public_key: Buffer): void; + setPublicKey(public_key: string, encoding: string): void; + setPrivateKey(private_key: Buffer): void; + setPrivateKey(private_key: string, encoding: string): void; + verifyError: number; + } + export function getDiffieHellman(group_name: string): DiffieHellman; + export function pbkdf2(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest: string, callback: (err: Error, derivedKey: Buffer) => any): void; + export function pbkdf2Sync(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest: string): Buffer; + export function randomBytes(size: number): Buffer; + export function randomBytes(size: number, callback: (err: Error, buf: Buffer) => void): void; + export function pseudoRandomBytes(size: number): Buffer; + export function pseudoRandomBytes(size: number, callback: (err: Error, buf: Buffer) => void): void; + export function randomFillSync(buffer: Buffer | Uint8Array, offset?: number, size?: number): Buffer; + export function randomFill(buffer: Buffer, callback: (err: Error, buf: Buffer) => void): void; + export function randomFill(buffer: Uint8Array, callback: (err: Error, buf: Uint8Array) => void): void; + export function randomFill(buffer: Buffer, offset: number, callback: (err: Error, buf: Buffer) => void): void; + export function randomFill(buffer: Uint8Array, offset: number, callback: (err: Error, buf: Uint8Array) => void): void; + export function randomFill(buffer: Buffer, offset: number, size: number, callback: (err: Error, buf: Buffer) => void): void; + export function randomFill(buffer: Uint8Array, offset: number, size: number, callback: (err: Error, buf: Uint8Array) => void): void; + export interface RsaPublicKey { + key: string; + padding?: number; + } + export interface RsaPrivateKey { + key: string; + passphrase?: string; + padding?: number; + } + export function publicEncrypt(public_key: string | RsaPublicKey, buffer: Buffer): Buffer; + export function privateDecrypt(private_key: string | RsaPrivateKey, buffer: Buffer): Buffer; + export function privateEncrypt(private_key: string | RsaPrivateKey, buffer: Buffer): Buffer; + export function publicDecrypt(public_key: string | RsaPublicKey, buffer: Buffer): Buffer; + export function getCiphers(): string[]; + export function getCurves(): string[]; + export function getHashes(): string[]; + export interface ECDH { + generateKeys(): Buffer; + generateKeys(encoding: HexBase64Latin1Encoding): string; + generateKeys(encoding: HexBase64Latin1Encoding, format: ECDHKeyFormat): string; + computeSecret(other_public_key: Buffer): Buffer; + computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer; + computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string; + getPrivateKey(): Buffer; + getPrivateKey(encoding: HexBase64Latin1Encoding): string; + getPublicKey(): Buffer; + getPublicKey(encoding: HexBase64Latin1Encoding): string; + getPublicKey(encoding: HexBase64Latin1Encoding, format: ECDHKeyFormat): string; + setPrivateKey(private_key: Buffer): void; + setPrivateKey(private_key: string, encoding: HexBase64Latin1Encoding): void; + } + export function createECDH(curve_name: string): ECDH; + export function timingSafeEqual(a: Buffer, b: Buffer): boolean; + export var DEFAULT_ENCODING: string; +} + +declare module "stream" { + import * as events from "events"; + + class internal extends events.EventEmitter { + pipe(destination: T, options?: { end?: boolean; }): T; + } + + namespace internal { + export class Stream extends internal { } + + export interface ReadableOptions { + highWaterMark?: number; + encoding?: string; + objectMode?: boolean; + read?: (this: Readable, size?: number) => any; + destroy?: (error?: Error) => any; + } + + export class Readable extends Stream implements NodeJS.ReadableStream { + readable: boolean; + readonly readableHighWaterMark: number; + readonly readableLength: number; + constructor(opts?: ReadableOptions); + _read(size: number): void; + read(size?: number): any; + setEncoding(encoding: string): this; + pause(): this; + resume(): this; + isPaused(): boolean; + unpipe(destination?: T): this; + unshift(chunk: any): void; + wrap(oldStream: NodeJS.ReadableStream): this; + push(chunk: any, encoding?: string): boolean; + _destroy(err: Error, callback: Function): void; + destroy(error?: Error): void; + + /** + * Event emitter + * The defined events on documents including: + * 1. close + * 2. data + * 3. end + * 4. readable + * 5. error + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "data", listener: (chunk: Buffer | string) => void): this; + addListener(event: "end", listener: () => void): this; + addListener(event: "readable", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "data", chunk: Buffer | string): boolean; + emit(event: "end"): boolean; + emit(event: "readable"): boolean; + emit(event: "error", err: Error): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: () => void): this; + on(event: "data", listener: (chunk: Buffer | string) => void): this; + on(event: "end", listener: () => void): this; + on(event: "readable", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: () => void): this; + once(event: "data", listener: (chunk: Buffer | string) => void): this; + once(event: "end", listener: () => void): this; + once(event: "readable", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; + prependListener(event: "end", listener: () => void): this; + prependListener(event: "readable", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; + prependOnceListener(event: "end", listener: () => void): this; + prependOnceListener(event: "readable", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + + removeListener(event: string, listener: (...args: any[]) => void): this; + removeListener(event: "close", listener: () => void): this; + removeListener(event: "data", listener: (chunk: Buffer | string) => void): this; + removeListener(event: "end", listener: () => void): this; + removeListener(event: "readable", listener: () => void): this; + removeListener(event: "error", listener: (err: Error) => void): this; + } + + export interface WritableOptions { + highWaterMark?: number; + decodeStrings?: boolean; + objectMode?: boolean; + write?: (chunk: string | Buffer, encoding: string, callback: Function) => any; + writev?: (chunks: Array<{ chunk: string | Buffer, encoding: string }>, callback: Function) => any; + destroy?: (error?: Error) => any; + final?: (callback: (error?: Error) => void) => void; + } + + export class Writable extends Stream implements NodeJS.WritableStream { + writable: boolean; + readonly writableHighWaterMark: number; + readonly writableLength: number; + constructor(opts?: WritableOptions); + _write(chunk: any, encoding: string, callback: (err?: Error) => void): void; + _writev?(chunks: Array<{ chunk: any, encoding: string }>, callback: (err?: Error) => void): void; + _destroy(err: Error, callback: Function): void; + _final(callback: Function): void; + write(chunk: any, cb?: Function): boolean; + write(chunk: any, encoding?: string, cb?: Function): boolean; + setDefaultEncoding(encoding: string): this; + end(cb?: Function): void; + end(chunk: any, cb?: Function): void; + end(chunk: any, encoding?: string, cb?: Function): void; + cork(): void; + uncork(): void; + destroy(error?: Error): void; + + /** + * Event emitter + * The defined events on documents including: + * 1. close + * 2. drain + * 3. error + * 4. finish + * 5. pipe + * 6. unpipe + */ + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "drain", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "finish", listener: () => void): this; + addListener(event: "pipe", listener: (src: Readable) => void): this; + addListener(event: "unpipe", listener: (src: Readable) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "drain", chunk: Buffer | string): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "finish"): boolean; + emit(event: "pipe", src: Readable): boolean; + emit(event: "unpipe", src: Readable): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: () => void): this; + on(event: "drain", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "finish", listener: () => void): this; + on(event: "pipe", listener: (src: Readable) => void): this; + on(event: "unpipe", listener: (src: Readable) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: () => void): this; + once(event: "drain", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "finish", listener: () => void): this; + once(event: "pipe", listener: (src: Readable) => void): this; + once(event: "unpipe", listener: (src: Readable) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "drain", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "finish", listener: () => void): this; + prependListener(event: "pipe", listener: (src: Readable) => void): this; + prependListener(event: "unpipe", listener: (src: Readable) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "drain", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "finish", listener: () => void): this; + prependOnceListener(event: "pipe", listener: (src: Readable) => void): this; + prependOnceListener(event: "unpipe", listener: (src: Readable) => void): this; + + removeListener(event: string, listener: (...args: any[]) => void): this; + removeListener(event: "close", listener: () => void): this; + removeListener(event: "drain", listener: () => void): this; + removeListener(event: "error", listener: (err: Error) => void): this; + removeListener(event: "finish", listener: () => void): this; + removeListener(event: "pipe", listener: (src: Readable) => void): this; + removeListener(event: "unpipe", listener: (src: Readable) => void): this; + } + + export interface DuplexOptions extends ReadableOptions, WritableOptions { + allowHalfOpen?: boolean; + readableObjectMode?: boolean; + writableObjectMode?: boolean; + } + + // Note: Duplex extends both Readable and Writable. + export class Duplex extends Readable implements Writable { + writable: boolean; + readonly writableHighWaterMark: number; + readonly writableLength: number; + constructor(opts?: DuplexOptions); + _write(chunk: any, encoding: string, callback: (err?: Error) => void): void; + _writev?(chunks: Array<{ chunk: any, encoding: string }>, callback: (err?: Error) => void): void; + _destroy(err: Error, callback: Function): void; + _final(callback: Function): void; + write(chunk: any, cb?: Function): boolean; + write(chunk: any, encoding?: string, cb?: Function): boolean; + setDefaultEncoding(encoding: string): this; + end(cb?: Function): void; + end(chunk: any, cb?: Function): void; + end(chunk: any, encoding?: string, cb?: Function): void; + cork(): void; + uncork(): void; + } + + export interface TransformOptions extends DuplexOptions { + transform?: (chunk: string | Buffer, encoding: string, callback: Function) => any; + flush?: (callback: Function) => any; + } + + export class Transform extends Duplex { + constructor(opts?: TransformOptions); + _transform(chunk: any, encoding: string, callback: Function): void; + destroy(error?: Error): void; + } + + export class PassThrough extends Transform { } + } + + export = internal; +} + +declare module "util" { + export interface InspectOptions extends NodeJS.InspectOptions { } + export function format(format: any, ...param: any[]): string; + export function debug(string: string): void; + export function error(...param: any[]): void; + export function puts(...param: any[]): void; + export function print(...param: any[]): void; + export function log(string: string): void; + export var inspect: { + (object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string; + (object: any, options: InspectOptions): string; + colors: { + [color: string]: [number, number] | undefined + } + styles: { + [style: string]: string | undefined + } + defaultOptions: InspectOptions; + custom: symbol; + }; + export function isArray(object: any): object is any[]; + export function isRegExp(object: any): object is RegExp; + export function isDate(object: any): object is Date; + export function isError(object: any): object is Error; + export function inherits(constructor: any, superConstructor: any): void; + export function debuglog(key: string): (msg: string, ...param: any[]) => void; + export function isBoolean(object: any): object is boolean; + export function isBuffer(object: any): object is Buffer; + export function isFunction(object: any): boolean; + export function isNull(object: any): object is null; + export function isNullOrUndefined(object: any): object is null | undefined; + export function isNumber(object: any): object is number; + export function isObject(object: any): boolean; + export function isPrimitive(object: any): boolean; + export function isString(object: any): object is string; + export function isSymbol(object: any): object is symbol; + export function isUndefined(object: any): object is undefined; + export function deprecate(fn: T, message: string): T; + + export interface CustomPromisify extends Function { + __promisify__: TCustom; + } + + export function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: () => Promise): (callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1) => Promise): (arg1: T1, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: (arg1: T1) => Promise): (arg1: T1, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2) => Promise): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2) => Promise): (arg1: T1, arg2: T2, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3) => Promise): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3) => Promise): (arg1: T1, arg2: T2, arg3: T3, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException) => void) => void; + export function callbackify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6) => Promise): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException, result: TResult) => void) => void; + + export function promisify(fn: CustomPromisify): TCustom; + export function promisify(fn: (callback: (err: Error | null, result: TResult) => void) => void): () => Promise; + export function promisify(fn: (callback: (err: Error | null) => void) => void): () => Promise; + export function promisify(fn: (arg1: T1, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1) => Promise; + export function promisify(fn: (arg1: T1, callback: (err: Error | null) => void) => void): (arg1: T1) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; + export function promisify(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise; + export function promisify(fn: Function): Function; + export namespace promisify { + const custom: symbol; + } +} + +declare module "assert" { + function internal(value: any, message?: string): void; + namespace internal { + export class AssertionError implements Error { + name: string; + message: string; + actual: any; + expected: any; + operator: string; + generatedMessage: boolean; + + constructor(options?: { + message?: string; actual?: any; expected?: any; + operator?: string; stackStartFunction?: Function + }); + } + + export function fail(message: string): never; + export function fail(actual: any, expected: any, message?: string, operator?: string): never; + export function ok(value: any, message?: string): void; + export function equal(actual: any, expected: any, message?: string): void; + export function notEqual(actual: any, expected: any, message?: string): void; + export function deepEqual(actual: any, expected: any, message?: string): void; + export function notDeepEqual(acutal: any, expected: any, message?: string): void; + export function strictEqual(actual: any, expected: any, message?: string): void; + export function notStrictEqual(actual: any, expected: any, message?: string): void; + export function deepStrictEqual(actual: any, expected: any, message?: string): void; + export function notDeepStrictEqual(actual: any, expected: any, message?: string): void; + + export function throws(block: Function, message?: string): void; + export function throws(block: Function, error: Function, message?: string): void; + export function throws(block: Function, error: RegExp, message?: string): void; + export function throws(block: Function, error: (err: any) => boolean, message?: string): void; + + export function doesNotThrow(block: Function, message?: string): void; + export function doesNotThrow(block: Function, error: Function, message?: string): void; + export function doesNotThrow(block: Function, error: RegExp, message?: string): void; + export function doesNotThrow(block: Function, error: (err: any) => boolean, message?: string): void; + + export function ifError(value: any): void; + } + + export = internal; +} + +declare module "tty" { + import * as net from "net"; + + export function isatty(fd: number): boolean; + export class ReadStream extends net.Socket { + isRaw: boolean; + setRawMode(mode: boolean): void; + isTTY: boolean; + } + export class WriteStream extends net.Socket { + columns: number; + rows: number; + isTTY: boolean; + } +} + +declare module "domain" { + import * as events from "events"; + + export class Domain extends events.EventEmitter implements NodeJS.Domain { + run(fn: Function): void; + add(emitter: events.EventEmitter): void; + remove(emitter: events.EventEmitter): void; + bind(cb: (err: Error, data: any) => any): any; + intercept(cb: (data: any) => any): any; + members: any[]; + enter(): void; + exit(): void; + } + + export function create(): Domain; +} + +declare module "constants" { + export var E2BIG: number; + export var EACCES: number; + export var EADDRINUSE: number; + export var EADDRNOTAVAIL: number; + export var EAFNOSUPPORT: number; + export var EAGAIN: number; + export var EALREADY: number; + export var EBADF: number; + export var EBADMSG: number; + export var EBUSY: number; + export var ECANCELED: number; + export var ECHILD: number; + export var ECONNABORTED: number; + export var ECONNREFUSED: number; + export var ECONNRESET: number; + export var EDEADLK: number; + export var EDESTADDRREQ: number; + export var EDOM: number; + export var EEXIST: number; + export var EFAULT: number; + export var EFBIG: number; + export var EHOSTUNREACH: number; + export var EIDRM: number; + export var EILSEQ: number; + export var EINPROGRESS: number; + export var EINTR: number; + export var EINVAL: number; + export var EIO: number; + export var EISCONN: number; + export var EISDIR: number; + export var ELOOP: number; + export var EMFILE: number; + export var EMLINK: number; + export var EMSGSIZE: number; + export var ENAMETOOLONG: number; + export var ENETDOWN: number; + export var ENETRESET: number; + export var ENETUNREACH: number; + export var ENFILE: number; + export var ENOBUFS: number; + export var ENODATA: number; + export var ENODEV: number; + export var ENOENT: number; + export var ENOEXEC: number; + export var ENOLCK: number; + export var ENOLINK: number; + export var ENOMEM: number; + export var ENOMSG: number; + export var ENOPROTOOPT: number; + export var ENOSPC: number; + export var ENOSR: number; + export var ENOSTR: number; + export var ENOSYS: number; + export var ENOTCONN: number; + export var ENOTDIR: number; + export var ENOTEMPTY: number; + export var ENOTSOCK: number; + export var ENOTSUP: number; + export var ENOTTY: number; + export var ENXIO: number; + export var EOPNOTSUPP: number; + export var EOVERFLOW: number; + export var EPERM: number; + export var EPIPE: number; + export var EPROTO: number; + export var EPROTONOSUPPORT: number; + export var EPROTOTYPE: number; + export var ERANGE: number; + export var EROFS: number; + export var ESPIPE: number; + export var ESRCH: number; + export var ETIME: number; + export var ETIMEDOUT: number; + export var ETXTBSY: number; + export var EWOULDBLOCK: number; + export var EXDEV: number; + export var WSAEINTR: number; + export var WSAEBADF: number; + export var WSAEACCES: number; + export var WSAEFAULT: number; + export var WSAEINVAL: number; + export var WSAEMFILE: number; + export var WSAEWOULDBLOCK: number; + export var WSAEINPROGRESS: number; + export var WSAEALREADY: number; + export var WSAENOTSOCK: number; + export var WSAEDESTADDRREQ: number; + export var WSAEMSGSIZE: number; + export var WSAEPROTOTYPE: number; + export var WSAENOPROTOOPT: number; + export var WSAEPROTONOSUPPORT: number; + export var WSAESOCKTNOSUPPORT: number; + export var WSAEOPNOTSUPP: number; + export var WSAEPFNOSUPPORT: number; + export var WSAEAFNOSUPPORT: number; + export var WSAEADDRINUSE: number; + export var WSAEADDRNOTAVAIL: number; + export var WSAENETDOWN: number; + export var WSAENETUNREACH: number; + export var WSAENETRESET: number; + export var WSAECONNABORTED: number; + export var WSAECONNRESET: number; + export var WSAENOBUFS: number; + export var WSAEISCONN: number; + export var WSAENOTCONN: number; + export var WSAESHUTDOWN: number; + export var WSAETOOMANYREFS: number; + export var WSAETIMEDOUT: number; + export var WSAECONNREFUSED: number; + export var WSAELOOP: number; + export var WSAENAMETOOLONG: number; + export var WSAEHOSTDOWN: number; + export var WSAEHOSTUNREACH: number; + export var WSAENOTEMPTY: number; + export var WSAEPROCLIM: number; + export var WSAEUSERS: number; + export var WSAEDQUOT: number; + export var WSAESTALE: number; + export var WSAEREMOTE: number; + export var WSASYSNOTREADY: number; + export var WSAVERNOTSUPPORTED: number; + export var WSANOTINITIALISED: number; + export var WSAEDISCON: number; + export var WSAENOMORE: number; + export var WSAECANCELLED: number; + export var WSAEINVALIDPROCTABLE: number; + export var WSAEINVALIDPROVIDER: number; + export var WSAEPROVIDERFAILEDINIT: number; + export var WSASYSCALLFAILURE: number; + export var WSASERVICE_NOT_FOUND: number; + export var WSATYPE_NOT_FOUND: number; + export var WSA_E_NO_MORE: number; + export var WSA_E_CANCELLED: number; + export var WSAEREFUSED: number; + export var SIGHUP: number; + export var SIGINT: number; + export var SIGILL: number; + export var SIGABRT: number; + export var SIGFPE: number; + export var SIGKILL: number; + export var SIGSEGV: number; + export var SIGTERM: number; + export var SIGBREAK: number; + export var SIGWINCH: number; + export var SSL_OP_ALL: number; + export var SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number; + export var SSL_OP_CIPHER_SERVER_PREFERENCE: number; + export var SSL_OP_CISCO_ANYCONNECT: number; + export var SSL_OP_COOKIE_EXCHANGE: number; + export var SSL_OP_CRYPTOPRO_TLSEXT_BUG: number; + export var SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number; + export var SSL_OP_EPHEMERAL_RSA: number; + export var SSL_OP_LEGACY_SERVER_CONNECT: number; + export var SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number; + export var SSL_OP_MICROSOFT_SESS_ID_BUG: number; + export var SSL_OP_MSIE_SSLV2_RSA_PADDING: number; + export var SSL_OP_NETSCAPE_CA_DN_BUG: number; + export var SSL_OP_NETSCAPE_CHALLENGE_BUG: number; + export var SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number; + export var SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number; + export var SSL_OP_NO_COMPRESSION: number; + export var SSL_OP_NO_QUERY_MTU: number; + export var SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number; + export var SSL_OP_NO_SSLv2: number; + export var SSL_OP_NO_SSLv3: number; + export var SSL_OP_NO_TICKET: number; + export var SSL_OP_NO_TLSv1: number; + export var SSL_OP_NO_TLSv1_1: number; + export var SSL_OP_NO_TLSv1_2: number; + export var SSL_OP_PKCS1_CHECK_1: number; + export var SSL_OP_PKCS1_CHECK_2: number; + export var SSL_OP_SINGLE_DH_USE: number; + export var SSL_OP_SINGLE_ECDH_USE: number; + export var SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number; + export var SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number; + export var SSL_OP_TLS_BLOCK_PADDING_BUG: number; + export var SSL_OP_TLS_D5_BUG: number; + export var SSL_OP_TLS_ROLLBACK_BUG: number; + export var ENGINE_METHOD_DSA: number; + export var ENGINE_METHOD_DH: number; + export var ENGINE_METHOD_RAND: number; + export var ENGINE_METHOD_ECDH: number; + export var ENGINE_METHOD_ECDSA: number; + export var ENGINE_METHOD_CIPHERS: number; + export var ENGINE_METHOD_DIGESTS: number; + export var ENGINE_METHOD_STORE: number; + export var ENGINE_METHOD_PKEY_METHS: number; + export var ENGINE_METHOD_PKEY_ASN1_METHS: number; + export var ENGINE_METHOD_ALL: number; + export var ENGINE_METHOD_NONE: number; + export var DH_CHECK_P_NOT_SAFE_PRIME: number; + export var DH_CHECK_P_NOT_PRIME: number; + export var DH_UNABLE_TO_CHECK_GENERATOR: number; + export var DH_NOT_SUITABLE_GENERATOR: number; + export var NPN_ENABLED: number; + export var RSA_PKCS1_PADDING: number; + export var RSA_SSLV23_PADDING: number; + export var RSA_NO_PADDING: number; + export var RSA_PKCS1_OAEP_PADDING: number; + export var RSA_X931_PADDING: number; + export var RSA_PKCS1_PSS_PADDING: number; + export var POINT_CONVERSION_COMPRESSED: number; + export var POINT_CONVERSION_UNCOMPRESSED: number; + export var POINT_CONVERSION_HYBRID: number; + export var O_RDONLY: number; + export var O_WRONLY: number; + export var O_RDWR: number; + export var S_IFMT: number; + export var S_IFREG: number; + export var S_IFDIR: number; + export var S_IFCHR: number; + export var S_IFBLK: number; + export var S_IFIFO: number; + export var S_IFSOCK: number; + export var S_IRWXU: number; + export var S_IRUSR: number; + export var S_IWUSR: number; + export var S_IXUSR: number; + export var S_IRWXG: number; + export var S_IRGRP: number; + export var S_IWGRP: number; + export var S_IXGRP: number; + export var S_IRWXO: number; + export var S_IROTH: number; + export var S_IWOTH: number; + export var S_IXOTH: number; + export var S_IFLNK: number; + export var O_CREAT: number; + export var O_EXCL: number; + export var O_NOCTTY: number; + export var O_DIRECTORY: number; + export var O_NOATIME: number; + export var O_NOFOLLOW: number; + export var O_SYNC: number; + export var O_DSYNC: number; + export var O_SYMLINK: number; + export var O_DIRECT: number; + export var O_NONBLOCK: number; + export var O_TRUNC: number; + export var O_APPEND: number; + export var F_OK: number; + export var R_OK: number; + export var W_OK: number; + export var X_OK: number; + export var UV_UDP_REUSEADDR: number; + export var SIGQUIT: number; + export var SIGTRAP: number; + export var SIGIOT: number; + export var SIGBUS: number; + export var SIGUSR1: number; + export var SIGUSR2: number; + export var SIGPIPE: number; + export var SIGALRM: number; + export var SIGCHLD: number; + export var SIGSTKFLT: number; + export var SIGCONT: number; + export var SIGSTOP: number; + export var SIGTSTP: number; + export var SIGTTIN: number; + export var SIGTTOU: number; + export var SIGURG: number; + export var SIGXCPU: number; + export var SIGXFSZ: number; + export var SIGVTALRM: number; + export var SIGPROF: number; + export var SIGIO: number; + export var SIGPOLL: number; + export var SIGPWR: number; + export var SIGSYS: number; + export var SIGUNUSED: number; + export var defaultCoreCipherList: string; + export var defaultCipherList: string; + export var ENGINE_METHOD_RSA: number; + export var ALPN_ENABLED: number; +} + +declare module "module" { + export = NodeJS.Module; +} + +declare module "process" { + export = process; +} + +declare module "v8" { + interface HeapSpaceInfo { + space_name: string; + space_size: number; + space_used_size: number; + space_available_size: number; + physical_space_size: number; + } + + // ** Signifies if the --zap_code_space option is enabled or not. 1 == enabled, 0 == disabled. */ + type DoesZapCodeSpaceFlag = 0 | 1; + + interface HeapInfo { + total_heap_size: number; + total_heap_size_executable: number; + total_physical_size: number; + total_available_size: number; + used_heap_size: number; + heap_size_limit: number; + malloced_memory: number; + peak_malloced_memory: number; + does_zap_garbage: DoesZapCodeSpaceFlag; + } + + export function getHeapStatistics(): HeapInfo; + export function getHeapSpaceStatistics(): HeapSpaceInfo[]; + export function setFlagsFromString(flags: string): void; +} + +declare module "timers" { + export function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; + export namespace setTimeout { + export function __promisify__(ms: number): Promise; + export function __promisify__(ms: number, value: T): Promise; + } + export function clearTimeout(timeoutId: NodeJS.Timer): void; + export function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer; + export function clearInterval(intervalId: NodeJS.Timer): void; + export function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any; + export namespace setImmediate { + export function __promisify__(): Promise; + export function __promisify__(value: T): Promise; + } + export function clearImmediate(immediateId: any): void; +} + +declare module "console" { + export = console; +} + +/** + * Async Hooks module: https://nodejs.org/api/async_hooks.html + */ +declare module "async_hooks" { + /** + * Returns the asyncId of the current execution context. + */ + export function executionAsyncId(): number; + /// @deprecated - replaced by executionAsyncId() + export function currentId(): number; + + /** + * Returns the ID of the resource responsible for calling the callback that is currently being executed. + */ + export function triggerAsyncId(): number; + /// @deprecated - replaced by triggerAsyncId() + export function triggerId(): number; + + export interface HookCallbacks { + /** + * Called when a class is constructed that has the possibility to emit an asynchronous event. + * @param asyncId a unique ID for the async resource + * @param type the type of the async resource + * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created + * @param resource reference to the resource representing the async operation, needs to be released during destroy + */ + init?(asyncId: number, type: string, triggerAsyncId: number, resource: Object): void; + + /** + * When an asynchronous operation is initiated or completes a callback is called to notify the user. + * The before callback is called just before said callback is executed. + * @param asyncId the unique identifier assigned to the resource about to execute the callback. + */ + before?(asyncId: number): void; + + /** + * Called immediately after the callback specified in before is completed. + * @param asyncId the unique identifier assigned to the resource which has executed the callback. + */ + after?(asyncId: number): void; + + /** + * Called when a promise has resolve() called. This may not be in the same execution id + * as the promise itself. + * @param asyncId the unique id for the promise that was resolve()d. + */ + promiseResolve?(asyncId: number): void; + + /** + * Called after the resource corresponding to asyncId is destroyed + * @param asyncId a unique ID for the async resource + */ + destroy?(asyncId: number): void; + } + + export interface AsyncHook { + /** + * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop. + */ + enable(): this; + + /** + * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled. + */ + disable(): this; + } + + /** + * Registers functions to be called for different lifetime events of each async operation. + * @param options the callbacks to register + * @return an AsyncHooks instance used for disabling and enabling hooks + */ + export function createHook(options: HookCallbacks): AsyncHook; + + export interface AsyncResourceOptions { + /** + * The ID of the execution context that created this async event. + * Default: `executionAsyncId()` + */ + triggerAsyncId?: number; + + /** + * Disables automatic `emitDestroy` when the object is garbage collected. + * This usually does not need to be set (even if `emitDestroy` is called + * manually), unless the resource's `asyncId` is retrieved and the + * sensitive API's `emitDestroy` is called with it. + * Default: `false` + */ + requireManualDestroy?: boolean; + } + + /** + * The class AsyncResource was designed to be extended by the embedder's async resources. + * Using this users can easily trigger the lifetime events of their own resources. + */ + export class AsyncResource { + /** + * AsyncResource() is meant to be extended. Instantiating a + * new AsyncResource() also triggers init. If triggerAsyncId is omitted then + * async_hook.executionAsyncId() is used. + * @param type The type of async event. + * @param triggerAsyncId The ID of the execution context that created + * this async event (default: `executionAsyncId()`), or an + * AsyncResourceOptions object (since 9.3) + */ + constructor(type: string, triggerAsyncId?: number|AsyncResourceOptions); + + /** + * Call AsyncHooks before callbacks. + * @deprecated since 9.6 - Use asyncResource.runInAsyncScope() instead. + */ + emitBefore(): void; + + /** + * Call AsyncHooks after callbacks. + * @deprecated since 9.6 - Use asyncResource.runInAsyncScope() instead. + */ + emitAfter(): void; + + /** + * Call the provided function with the provided arguments in the + * execution context of the async resource. This will establish the + * context, trigger the AsyncHooks before callbacks, call the function, + * trigger the AsyncHooks after callbacks, and then restore the original + * execution context. + * @param fn The function to call in the execution context of this + * async resource. + * @param thisArg The receiver to be used for the function call. + * @param args Optional arguments to pass to the function. + */ + runInAsyncScope(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result; + + /** + * Call AsyncHooks destroy callbacks. + */ + emitDestroy(): void; + + /** + * @return the unique ID assigned to this AsyncResource instance. + */ + asyncId(): number; + + /** + * @return the trigger ID for this AsyncResource instance. + */ + triggerAsyncId(): number; + } +} + +declare module "http2" { + import * as events from "events"; + import * as fs from "fs"; + import * as net from "net"; + import * as stream from "stream"; + import * as tls from "tls"; + import * as url from "url"; + + import { IncomingHttpHeaders, OutgoingHttpHeaders } from "http"; + export { IncomingHttpHeaders, OutgoingHttpHeaders } from "http"; + + // Http2Stream + + export interface StreamPriorityOptions { + exclusive?: boolean; + parent?: number; + weight?: number; + silent?: boolean; + } + + export interface StreamState { + localWindowSize?: number; + state?: number; + streamLocalClose?: number; + streamRemoteClose?: number; + sumDependencyWeight?: number; + weight?: number; + } + + export interface ServerStreamResponseOptions { + endStream?: boolean; + getTrailers?: (trailers: OutgoingHttpHeaders) => void; + } + + export interface StatOptions { + offset: number; + length: number; + } + + export interface ServerStreamFileResponseOptions { + statCheck?: (stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions) => void | boolean; + getTrailers?: (trailers: OutgoingHttpHeaders) => void; + offset?: number; + length?: number; + } + + export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions { + onError?: (err: NodeJS.ErrnoException) => void; + } + + export interface Http2Stream extends stream.Duplex { + readonly aborted: boolean; + close(code: number, callback?: () => void): void; + readonly closed: boolean; + readonly destroyed: boolean; + readonly pending: boolean; + priority(options: StreamPriorityOptions): void; + readonly rstCode: number; + readonly session: Http2Session; + setTimeout(msecs: number, callback?: () => void): void; + readonly state: StreamState; + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "aborted", listener: () => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "data", listener: (chunk: Buffer | string) => void): this; + addListener(event: "drain", listener: () => void): this; + addListener(event: "end", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "finish", listener: () => void): this; + addListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; + addListener(event: "pipe", listener: (src: stream.Readable) => void): this; + addListener(event: "unpipe", listener: (src: stream.Readable) => void): this; + addListener(event: "streamClosed", listener: (code: number) => void): this; + addListener(event: "timeout", listener: () => void): this; + addListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "aborted"): boolean; + emit(event: "close"): boolean; + emit(event: "data", chunk: Buffer | string): boolean; + emit(event: "drain"): boolean; + emit(event: "end"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "finish"): boolean; + emit(event: "frameError", frameType: number, errorCode: number): boolean; + emit(event: "pipe", src: stream.Readable): boolean; + emit(event: "unpipe", src: stream.Readable): boolean; + emit(event: "streamClosed", code: number): boolean; + emit(event: "timeout"): boolean; + emit(event: "trailers", trailers: IncomingHttpHeaders, flags: number): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "aborted", listener: () => void): this; + on(event: "close", listener: () => void): this; + on(event: "data", listener: (chunk: Buffer | string) => void): this; + on(event: "drain", listener: () => void): this; + on(event: "end", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "finish", listener: () => void): this; + on(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; + on(event: "pipe", listener: (src: stream.Readable) => void): this; + on(event: "unpipe", listener: (src: stream.Readable) => void): this; + on(event: "streamClosed", listener: (code: number) => void): this; + on(event: "timeout", listener: () => void): this; + on(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "aborted", listener: () => void): this; + once(event: "close", listener: () => void): this; + once(event: "data", listener: (chunk: Buffer | string) => void): this; + once(event: "drain", listener: () => void): this; + once(event: "end", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "finish", listener: () => void): this; + once(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; + once(event: "pipe", listener: (src: stream.Readable) => void): this; + once(event: "unpipe", listener: (src: stream.Readable) => void): this; + once(event: "streamClosed", listener: (code: number) => void): this; + once(event: "timeout", listener: () => void): this; + once(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "aborted", listener: () => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "data", listener: (chunk: Buffer | string) => void): this; + prependListener(event: "drain", listener: () => void): this; + prependListener(event: "end", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "finish", listener: () => void): this; + prependListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; + prependListener(event: "pipe", listener: (src: stream.Readable) => void): this; + prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this; + prependListener(event: "streamClosed", listener: (code: number) => void): this; + prependListener(event: "timeout", listener: () => void): this; + prependListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "aborted", listener: () => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this; + prependOnceListener(event: "drain", listener: () => void): this; + prependOnceListener(event: "end", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "finish", listener: () => void): this; + prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number) => void): this; + prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this; + prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this; + prependOnceListener(event: "streamClosed", listener: (code: number) => void): this; + prependOnceListener(event: "timeout", listener: () => void): this; + prependOnceListener(event: "trailers", listener: (trailers: IncomingHttpHeaders, flags: number) => void): this; + } + + export interface ClientHttp2Stream extends Http2Stream { + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "headers", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: "response", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "headers", headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: "push", headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: "response", headers: IncomingHttpHeaders, flags: number): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "headers", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: "response", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "headers", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: "response", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "headers", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: "response", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "headers", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: "response", listener: (headers: IncomingHttpHeaders, flags: number) => void): this; + } + + export interface ServerHttp2Stream extends Http2Stream { + additionalHeaders(headers: OutgoingHttpHeaders): void; + readonly headersSent: boolean; + readonly pushAllowed: boolean; + pushStream(headers: OutgoingHttpHeaders, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void; + pushStream(headers: OutgoingHttpHeaders, options?: StreamPriorityOptions, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void; + respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void; + respondWithFD(fd: number, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptions): void; + respondWithFile(path: string, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptionsWithError): void; + } + + // Http2Session + + export interface Settings { + headerTableSize?: number; + enablePush?: boolean; + initialWindowSize?: number; + maxFrameSize?: number; + maxConcurrentStreams?: number; + maxHeaderListSize?: number; + } + + export interface ClientSessionRequestOptions { + endStream?: boolean; + exclusive?: boolean; + parent?: number; + weight?: number; + getTrailers?: (trailers: OutgoingHttpHeaders, flags: number) => void; + } + + export interface SessionState { + effectiveLocalWindowSize?: number; + effectiveRecvDataLength?: number; + nextStreamID?: number; + localWindowSize?: number; + lastProcStreamID?: number; + remoteWindowSize?: number; + outboundQueueSize?: number; + deflateDynamicTableSize?: number; + inflateDynamicTableSize?: number; + } + + export interface Http2Session extends events.EventEmitter { + readonly alpnProtocol?: string; + close(callback?: () => void): void; + readonly closed: boolean; + destroy(error?: Error, code?: number): void; + readonly destroyed: boolean; + readonly encrypted?: boolean; + goaway(code?: number, lastStreamID?: number, opaqueData?: Buffer | DataView /*| TypedArray*/): void; + readonly localSettings: Settings; + readonly originSet?: string[]; + readonly pendingSettingsAck: boolean; + ref(): void; + readonly remoteSettings: Settings; + rstStream(stream: Http2Stream, code?: number): void; + setTimeout(msecs: number, callback?: () => void): void; + readonly socket: net.Socket | tls.TLSSocket; + readonly state: SessionState; + priority(stream: Http2Stream, options: StreamPriorityOptions): void; + settings(settings: Settings): void; + readonly type: number; + unref(): void; + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; + addListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + addListener(event: "localSettings", listener: (settings: Settings) => void): this; + addListener(event: "remoteSettings", listener: (settings: Settings) => void): this; + addListener(event: "timeout", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "close"): boolean; + emit(event: "error", err: Error): boolean; + emit(event: "frameError", frameType: number, errorCode: number, streamID: number): boolean; + emit(event: "goaway", errorCode: number, lastStreamID: number, opaqueData: Buffer): boolean; + emit(event: "localSettings", settings: Settings): boolean; + emit(event: "remoteSettings", settings: Settings): boolean; + emit(event: "timeout"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "close", listener: () => void): this; + on(event: "error", listener: (err: Error) => void): this; + on(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; + on(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + on(event: "localSettings", listener: (settings: Settings) => void): this; + on(event: "remoteSettings", listener: (settings: Settings) => void): this; + on(event: "timeout", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "close", listener: () => void): this; + once(event: "error", listener: (err: Error) => void): this; + once(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; + once(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + once(event: "localSettings", listener: (settings: Settings) => void): this; + once(event: "remoteSettings", listener: (settings: Settings) => void): this; + once(event: "timeout", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "error", listener: (err: Error) => void): this; + prependListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; + prependListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + prependListener(event: "localSettings", listener: (settings: Settings) => void): this; + prependListener(event: "remoteSettings", listener: (settings: Settings) => void): this; + prependListener(event: "timeout", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "error", listener: (err: Error) => void): this; + prependOnceListener(event: "frameError", listener: (frameType: number, errorCode: number, streamID: number) => void): this; + prependOnceListener(event: "goaway", listener: (errorCode: number, lastStreamID: number, opaqueData: Buffer) => void): this; + prependOnceListener(event: "localSettings", listener: (settings: Settings) => void): this; + prependOnceListener(event: "remoteSettings", listener: (settings: Settings) => void): this; + prependOnceListener(event: "timeout", listener: () => void): this; + } + + export interface ClientHttp2Session extends Http2Session { + request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream; + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; + addListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + addListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "altsvc", alt: string, origin: string, stream: number): boolean; + emit(event: "connect", session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; + emit(event: "stream", stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; + on(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + on(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; + once(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + once(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; + prependListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this; + prependOnceListener(event: "connect", listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependOnceListener(event: "stream", listener: (stream: ClientHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + } + + export interface AlternativeServiceOptions { + origin: number | string | url.URL; + } + + export interface ServerHttp2Session extends Http2Session { + altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void; + readonly server: Http2Server | Http2SecureServer; + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "connect", session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket): boolean; + emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this; + prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + } + + // Http2Server + + export interface SessionOptions { + maxDeflateDynamicTableSize?: number; + maxReservedRemoteStreams?: number; + maxSendHeaderBlockLength?: number; + paddingStrategy?: number; + peerMaxConcurrentStreams?: number; + selectPadding?: (frameLen: number, maxFrameLen: number) => number; + settings?: Settings; + } + + export type ClientSessionOptions = SessionOptions; + export type ServerSessionOptions = SessionOptions; + + export interface SecureClientSessionOptions extends ClientSessionOptions, tls.ConnectionOptions { } + export interface SecureServerSessionOptions extends ServerSessionOptions, tls.TlsOptions { } + + export interface ServerOptions extends ServerSessionOptions { + allowHTTP1?: boolean; + } + + export interface SecureServerOptions extends SecureServerSessionOptions { + allowHTTP1?: boolean; + } + + export interface Http2Server extends net.Server { + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: "sessionError", listener: (err: Error) => void): this; + addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: "timeout", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: "sessionError", err: Error): boolean; + emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: "timeout"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: "sessionError", listener: (err: Error) => void): this; + on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: "timeout", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: "sessionError", listener: (err: Error) => void): this; + once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: "timeout", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: "sessionError", listener: (err: Error) => void): this; + prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: "timeout", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: "sessionError", listener: (err: Error) => void): this; + prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: "timeout", listener: () => void): this; + } + + export interface Http2SecureServer extends tls.Server { + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + addListener(event: "sessionError", listener: (err: Error) => void): this; + addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + addListener(event: "timeout", listener: () => void): this; + addListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "checkContinue", request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: "request", request: Http2ServerRequest, response: Http2ServerResponse): boolean; + emit(event: "sessionError", err: Error): boolean; + emit(event: "stream", stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number): boolean; + emit(event: "timeout"): boolean; + emit(event: "unknownProtocol", socket: tls.TLSSocket): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + on(event: "sessionError", listener: (err: Error) => void): this; + on(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + on(event: "timeout", listener: () => void): this; + on(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + once(event: "sessionError", listener: (err: Error) => void): this; + once(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + once(event: "timeout", listener: () => void): this; + once(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependListener(event: "sessionError", listener: (err: Error) => void): this; + prependListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependListener(event: "timeout", listener: () => void): this; + prependListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this; + prependOnceListener(event: "sessionError", listener: (err: Error) => void): this; + prependOnceListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this; + prependOnceListener(event: "timeout", listener: () => void): this; + prependOnceListener(event: "unknownProtocol", listener: (socket: tls.TLSSocket) => void): this; + } + + export interface Http2ServerRequest extends stream.Readable { + headers: IncomingHttpHeaders; + httpVersion: string; + method: string; + rawHeaders: string[]; + rawTrailers: string[]; + setTimeout(msecs: number, callback?: () => void): void; + socket: net.Socket | tls.TLSSocket; + stream: ServerHttp2Stream; + trailers: IncomingHttpHeaders; + url: string; + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "aborted", hadError: boolean, code: number): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + } + + export interface Http2ServerResponse extends events.EventEmitter { + addTrailers(trailers: OutgoingHttpHeaders): void; + connection: net.Socket | tls.TLSSocket; + end(callback?: () => void): void; + end(data?: string | Buffer, callback?: () => void): void; + end(data?: string | Buffer, encoding?: string, callback?: () => void): void; + readonly finished: boolean; + getHeader(name: string): string; + getHeaderNames(): string[]; + getHeaders(): OutgoingHttpHeaders; + hasHeader(name: string): boolean; + readonly headersSent: boolean; + removeHeader(name: string): void; + sendDate: boolean; + setHeader(name: string, value: number | string | string[]): void; + setTimeout(msecs: number, callback?: () => void): void; + socket: net.Socket | tls.TLSSocket; + statusCode: number; + statusMessage: ''; + stream: ServerHttp2Stream; + write(chunk: string | Buffer, callback?: (err: Error) => void): boolean; + write(chunk: string | Buffer, encoding?: string, callback?: (err: Error) => void): boolean; + writeContinue(): void; + writeHead(statusCode: number, headers?: OutgoingHttpHeaders): void; + writeHead(statusCode: number, statusMessage?: string, headers?: OutgoingHttpHeaders): void; + createPushResponse(headers: OutgoingHttpHeaders, callback: (err: Error | null, res: Http2ServerResponse) => void): void; + + addListener(event: string, listener: (...args: any[]) => void): this; + addListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + addListener(event: "close", listener: () => void): this; + addListener(event: "drain", listener: () => void): this; + addListener(event: "error", listener: (error: Error) => void): this; + addListener(event: "finish", listener: () => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "aborted", hadError: boolean, code: number): boolean; + emit(event: "close"): boolean; + emit(event: "drain"): boolean; + emit(event: "error", error: Error): boolean; + emit(event: "finish"): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + on(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + on(event: "close", listener: () => void): this; + on(event: "drain", listener: () => void): this; + on(event: "error", listener: (error: Error) => void): this; + on(event: "finish", listener: () => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + once(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + once(event: "close", listener: () => void): this; + once(event: "drain", listener: () => void): this; + once(event: "error", listener: (error: Error) => void): this; + once(event: "finish", listener: () => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + prependListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + prependListener(event: "close", listener: () => void): this; + prependListener(event: "drain", listener: () => void): this; + prependListener(event: "error", listener: (error: Error) => void): this; + prependListener(event: "finish", listener: () => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + prependOnceListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this; + prependOnceListener(event: "close", listener: () => void): this; + prependOnceListener(event: "drain", listener: () => void): this; + prependOnceListener(event: "error", listener: (error: Error) => void): this; + prependOnceListener(event: "finish", listener: () => void): this; + } + + // Public API + + export namespace constants { + export const NGHTTP2_SESSION_SERVER: number; + export const NGHTTP2_SESSION_CLIENT: number; + export const NGHTTP2_STREAM_STATE_IDLE: number; + export const NGHTTP2_STREAM_STATE_OPEN: number; + export const NGHTTP2_STREAM_STATE_RESERVED_LOCAL: number; + export const NGHTTP2_STREAM_STATE_RESERVED_REMOTE: number; + export const NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL: number; + export const NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE: number; + export const NGHTTP2_STREAM_STATE_CLOSED: number; + export const NGHTTP2_NO_ERROR: number; + export const NGHTTP2_PROTOCOL_ERROR: number; + export const NGHTTP2_INTERNAL_ERROR: number; + export const NGHTTP2_FLOW_CONTROL_ERROR: number; + export const NGHTTP2_SETTINGS_TIMEOUT: number; + export const NGHTTP2_STREAM_CLOSED: number; + export const NGHTTP2_FRAME_SIZE_ERROR: number; + export const NGHTTP2_REFUSED_STREAM: number; + export const NGHTTP2_CANCEL: number; + export const NGHTTP2_COMPRESSION_ERROR: number; + export const NGHTTP2_CONNECT_ERROR: number; + export const NGHTTP2_ENHANCE_YOUR_CALM: number; + export const NGHTTP2_INADEQUATE_SECURITY: number; + export const NGHTTP2_HTTP_1_1_REQUIRED: number; + export const NGHTTP2_ERR_FRAME_SIZE_ERROR: number; + export const NGHTTP2_FLAG_NONE: number; + export const NGHTTP2_FLAG_END_STREAM: number; + export const NGHTTP2_FLAG_END_HEADERS: number; + export const NGHTTP2_FLAG_ACK: number; + export const NGHTTP2_FLAG_PADDED: number; + export const NGHTTP2_FLAG_PRIORITY: number; + export const DEFAULT_SETTINGS_HEADER_TABLE_SIZE: number; + export const DEFAULT_SETTINGS_ENABLE_PUSH: number; + export const DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE: number; + export const DEFAULT_SETTINGS_MAX_FRAME_SIZE: number; + export const MAX_MAX_FRAME_SIZE: number; + export const MIN_MAX_FRAME_SIZE: number; + export const MAX_INITIAL_WINDOW_SIZE: number; + export const NGHTTP2_DEFAULT_WEIGHT: number; + export const NGHTTP2_SETTINGS_HEADER_TABLE_SIZE: number; + export const NGHTTP2_SETTINGS_ENABLE_PUSH: number; + export const NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS: number; + export const NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE: number; + export const NGHTTP2_SETTINGS_MAX_FRAME_SIZE: number; + export const NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE: number; + export const PADDING_STRATEGY_NONE: number; + export const PADDING_STRATEGY_MAX: number; + export const PADDING_STRATEGY_CALLBACK: number; + export const HTTP2_HEADER_STATUS: string; + export const HTTP2_HEADER_METHOD: string; + export const HTTP2_HEADER_AUTHORITY: string; + export const HTTP2_HEADER_SCHEME: string; + export const HTTP2_HEADER_PATH: string; + export const HTTP2_HEADER_ACCEPT_CHARSET: string; + export const HTTP2_HEADER_ACCEPT_ENCODING: string; + export const HTTP2_HEADER_ACCEPT_LANGUAGE: string; + export const HTTP2_HEADER_ACCEPT_RANGES: string; + export const HTTP2_HEADER_ACCEPT: string; + export const HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN: string; + export const HTTP2_HEADER_AGE: string; + export const HTTP2_HEADER_ALLOW: string; + export const HTTP2_HEADER_AUTHORIZATION: string; + export const HTTP2_HEADER_CACHE_CONTROL: string; + export const HTTP2_HEADER_CONNECTION: string; + export const HTTP2_HEADER_CONTENT_DISPOSITION: string; + export const HTTP2_HEADER_CONTENT_ENCODING: string; + export const HTTP2_HEADER_CONTENT_LANGUAGE: string; + export const HTTP2_HEADER_CONTENT_LENGTH: string; + export const HTTP2_HEADER_CONTENT_LOCATION: string; + export const HTTP2_HEADER_CONTENT_MD5: string; + export const HTTP2_HEADER_CONTENT_RANGE: string; + export const HTTP2_HEADER_CONTENT_TYPE: string; + export const HTTP2_HEADER_COOKIE: string; + export const HTTP2_HEADER_DATE: string; + export const HTTP2_HEADER_ETAG: string; + export const HTTP2_HEADER_EXPECT: string; + export const HTTP2_HEADER_EXPIRES: string; + export const HTTP2_HEADER_FROM: string; + export const HTTP2_HEADER_HOST: string; + export const HTTP2_HEADER_IF_MATCH: string; + export const HTTP2_HEADER_IF_MODIFIED_SINCE: string; + export const HTTP2_HEADER_IF_NONE_MATCH: string; + export const HTTP2_HEADER_IF_RANGE: string; + export const HTTP2_HEADER_IF_UNMODIFIED_SINCE: string; + export const HTTP2_HEADER_LAST_MODIFIED: string; + export const HTTP2_HEADER_LINK: string; + export const HTTP2_HEADER_LOCATION: string; + export const HTTP2_HEADER_MAX_FORWARDS: string; + export const HTTP2_HEADER_PREFER: string; + export const HTTP2_HEADER_PROXY_AUTHENTICATE: string; + export const HTTP2_HEADER_PROXY_AUTHORIZATION: string; + export const HTTP2_HEADER_RANGE: string; + export const HTTP2_HEADER_REFERER: string; + export const HTTP2_HEADER_REFRESH: string; + export const HTTP2_HEADER_RETRY_AFTER: string; + export const HTTP2_HEADER_SERVER: string; + export const HTTP2_HEADER_SET_COOKIE: string; + export const HTTP2_HEADER_STRICT_TRANSPORT_SECURITY: string; + export const HTTP2_HEADER_TRANSFER_ENCODING: string; + export const HTTP2_HEADER_TE: string; + export const HTTP2_HEADER_UPGRADE: string; + export const HTTP2_HEADER_USER_AGENT: string; + export const HTTP2_HEADER_VARY: string; + export const HTTP2_HEADER_VIA: string; + export const HTTP2_HEADER_WWW_AUTHENTICATE: string; + export const HTTP2_HEADER_HTTP2_SETTINGS: string; + export const HTTP2_HEADER_KEEP_ALIVE: string; + export const HTTP2_HEADER_PROXY_CONNECTION: string; + export const HTTP2_METHOD_ACL: string; + export const HTTP2_METHOD_BASELINE_CONTROL: string; + export const HTTP2_METHOD_BIND: string; + export const HTTP2_METHOD_CHECKIN: string; + export const HTTP2_METHOD_CHECKOUT: string; + export const HTTP2_METHOD_CONNECT: string; + export const HTTP2_METHOD_COPY: string; + export const HTTP2_METHOD_DELETE: string; + export const HTTP2_METHOD_GET: string; + export const HTTP2_METHOD_HEAD: string; + export const HTTP2_METHOD_LABEL: string; + export const HTTP2_METHOD_LINK: string; + export const HTTP2_METHOD_LOCK: string; + export const HTTP2_METHOD_MERGE: string; + export const HTTP2_METHOD_MKACTIVITY: string; + export const HTTP2_METHOD_MKCALENDAR: string; + export const HTTP2_METHOD_MKCOL: string; + export const HTTP2_METHOD_MKREDIRECTREF: string; + export const HTTP2_METHOD_MKWORKSPACE: string; + export const HTTP2_METHOD_MOVE: string; + export const HTTP2_METHOD_OPTIONS: string; + export const HTTP2_METHOD_ORDERPATCH: string; + export const HTTP2_METHOD_PATCH: string; + export const HTTP2_METHOD_POST: string; + export const HTTP2_METHOD_PRI: string; + export const HTTP2_METHOD_PROPFIND: string; + export const HTTP2_METHOD_PROPPATCH: string; + export const HTTP2_METHOD_PUT: string; + export const HTTP2_METHOD_REBIND: string; + export const HTTP2_METHOD_REPORT: string; + export const HTTP2_METHOD_SEARCH: string; + export const HTTP2_METHOD_TRACE: string; + export const HTTP2_METHOD_UNBIND: string; + export const HTTP2_METHOD_UNCHECKOUT: string; + export const HTTP2_METHOD_UNLINK: string; + export const HTTP2_METHOD_UNLOCK: string; + export const HTTP2_METHOD_UPDATE: string; + export const HTTP2_METHOD_UPDATEREDIRECTREF: string; + export const HTTP2_METHOD_VERSION_CONTROL: string; + export const HTTP_STATUS_CONTINUE: number; + export const HTTP_STATUS_SWITCHING_PROTOCOLS: number; + export const HTTP_STATUS_PROCESSING: number; + export const HTTP_STATUS_OK: number; + export const HTTP_STATUS_CREATED: number; + export const HTTP_STATUS_ACCEPTED: number; + export const HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION: number; + export const HTTP_STATUS_NO_CONTENT: number; + export const HTTP_STATUS_RESET_CONTENT: number; + export const HTTP_STATUS_PARTIAL_CONTENT: number; + export const HTTP_STATUS_MULTI_STATUS: number; + export const HTTP_STATUS_ALREADY_REPORTED: number; + export const HTTP_STATUS_IM_USED: number; + export const HTTP_STATUS_MULTIPLE_CHOICES: number; + export const HTTP_STATUS_MOVED_PERMANENTLY: number; + export const HTTP_STATUS_FOUND: number; + export const HTTP_STATUS_SEE_OTHER: number; + export const HTTP_STATUS_NOT_MODIFIED: number; + export const HTTP_STATUS_USE_PROXY: number; + export const HTTP_STATUS_TEMPORARY_REDIRECT: number; + export const HTTP_STATUS_PERMANENT_REDIRECT: number; + export const HTTP_STATUS_BAD_REQUEST: number; + export const HTTP_STATUS_UNAUTHORIZED: number; + export const HTTP_STATUS_PAYMENT_REQUIRED: number; + export const HTTP_STATUS_FORBIDDEN: number; + export const HTTP_STATUS_NOT_FOUND: number; + export const HTTP_STATUS_METHOD_NOT_ALLOWED: number; + export const HTTP_STATUS_NOT_ACCEPTABLE: number; + export const HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED: number; + export const HTTP_STATUS_REQUEST_TIMEOUT: number; + export const HTTP_STATUS_CONFLICT: number; + export const HTTP_STATUS_GONE: number; + export const HTTP_STATUS_LENGTH_REQUIRED: number; + export const HTTP_STATUS_PRECONDITION_FAILED: number; + export const HTTP_STATUS_PAYLOAD_TOO_LARGE: number; + export const HTTP_STATUS_URI_TOO_LONG: number; + export const HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE: number; + export const HTTP_STATUS_RANGE_NOT_SATISFIABLE: number; + export const HTTP_STATUS_EXPECTATION_FAILED: number; + export const HTTP_STATUS_TEAPOT: number; + export const HTTP_STATUS_MISDIRECTED_REQUEST: number; + export const HTTP_STATUS_UNPROCESSABLE_ENTITY: number; + export const HTTP_STATUS_LOCKED: number; + export const HTTP_STATUS_FAILED_DEPENDENCY: number; + export const HTTP_STATUS_UNORDERED_COLLECTION: number; + export const HTTP_STATUS_UPGRADE_REQUIRED: number; + export const HTTP_STATUS_PRECONDITION_REQUIRED: number; + export const HTTP_STATUS_TOO_MANY_REQUESTS: number; + export const HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE: number; + export const HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS: number; + export const HTTP_STATUS_INTERNAL_SERVER_ERROR: number; + export const HTTP_STATUS_NOT_IMPLEMENTED: number; + export const HTTP_STATUS_BAD_GATEWAY: number; + export const HTTP_STATUS_SERVICE_UNAVAILABLE: number; + export const HTTP_STATUS_GATEWAY_TIMEOUT: number; + export const HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED: number; + export const HTTP_STATUS_VARIANT_ALSO_NEGOTIATES: number; + export const HTTP_STATUS_INSUFFICIENT_STORAGE: number; + export const HTTP_STATUS_LOOP_DETECTED: number; + export const HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED: number; + export const HTTP_STATUS_NOT_EXTENDED: number; + export const HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED: number; + } + + export function getDefaultSettings(): Settings; + export function getPackedSettings(settings: Settings): Settings; + export function getUnpackedSettings(buf: Buffer | Uint8Array): Settings; + + export function createServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; + export function createServer(options: ServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server; + + export function createSecureServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; + export function createSecureServer(options: SecureServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer; + + export function connect(authority: string | url.URL, listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): ClientHttp2Session; + export function connect(authority: string | url.URL, options?: ClientSessionOptions | SecureClientSessionOptions, listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): ClientHttp2Session; +} + +declare module "perf_hooks" { + export interface PerformanceEntry { + /** + * The total number of milliseconds elapsed for this entry. + * This value will not be meaningful for all Performance Entry types. + */ + readonly duration: number; + + /** + * The name of the performance entry. + */ + readonly name: string; + + /** + * The high resolution millisecond timestamp marking the starting time of the Performance Entry. + */ + readonly startTime: number; + + /** + * The type of the performance entry. + * Currently it may be one of: 'node', 'mark', 'measure', 'gc', or 'function'. + */ + readonly entryType: string; + + /** + * When performanceEntry.entryType is equal to 'gc', the performance.kind property identifies + * the type of garbage collection operation that occurred. + * The value may be one of perf_hooks.constants. + */ + readonly kind?: number; + } + + export interface PerformanceNodeTiming extends PerformanceEntry { + /** + * The high resolution millisecond timestamp at which the Node.js process completed bootstrap. + */ + readonly bootstrapComplete: number; + + /** + * The high resolution millisecond timestamp at which cluster processing ended. + */ + readonly clusterSetupEnd: number; + + /** + * The high resolution millisecond timestamp at which cluster processing started. + */ + readonly clusterSetupStart: number; + + /** + * The high resolution millisecond timestamp at which the Node.js event loop exited. + */ + readonly loopExit: number; + + /** + * The high resolution millisecond timestamp at which the Node.js event loop started. + */ + readonly loopStart: number; + + /** + * The high resolution millisecond timestamp at which main module load ended. + */ + readonly moduleLoadEnd: number; + + /** + * The high resolution millisecond timestamp at which main module load started. + */ + readonly moduleLoadStart: number; + + /** + * The high resolution millisecond timestamp at which the Node.js process was initialized. + */ + readonly nodeStart: number; + + /** + * The high resolution millisecond timestamp at which preload module load ended. + */ + readonly preloadModuleLoadEnd: number; + + /** + * The high resolution millisecond timestamp at which preload module load started. + */ + readonly preloadModuleLoadStart: number; + + /** + * The high resolution millisecond timestamp at which third_party_main processing ended. + */ + readonly thirdPartyMainEnd: number; + + /** + * The high resolution millisecond timestamp at which third_party_main processing started. + */ + readonly thirdPartyMainStart: number; + + /** + * The high resolution millisecond timestamp at which the V8 platform was initialized. + */ + readonly v8Start: number; + } + + export interface Performance { + /** + * If name is not provided, removes all PerformanceFunction objects from the Performance Timeline. + * If name is provided, removes entries with name. + * @param name + */ + clearFunctions(name?: string): void; + + /** + * If name is not provided, removes all PerformanceMark objects from the Performance Timeline. + * If name is provided, removes only the named mark. + * @param name + */ + clearMarks(name?: string): void; + + /** + * If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline. + * If name is provided, removes only objects whose performanceEntry.name matches name. + */ + clearMeasures(name?: string): void; + + /** + * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime. + * @return list of all PerformanceEntry objects + */ + getEntries(): PerformanceEntry[]; + + /** + * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime + * whose performanceEntry.name is equal to name, and optionally, whose performanceEntry.entryType is equal to type. + * @param name + * @param type + * @return list of all PerformanceEntry objects + */ + getEntriesByName(name: string, type?: string): PerformanceEntry[]; + + /** + * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime + * whose performanceEntry.entryType is equal to type. + * @param type + * @return list of all PerformanceEntry objects + */ + getEntriesByType(type: string): PerformanceEntry[]; + + /** + * Creates a new PerformanceMark entry in the Performance Timeline. + * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark', + * and whose performanceEntry.duration is always 0. + * Performance marks are used to mark specific significant moments in the Performance Timeline. + * @param name + */ + mark(name?: string): void; + + /** + * Creates a new PerformanceMeasure entry in the Performance Timeline. + * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure', + * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark. + * + * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify + * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist, + * then startMark is set to timeOrigin by default. + * + * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp + * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown. + * @param name + * @param startMark + * @param endMark + */ + measure(name: string, startMark: string, endMark: string): void; + + /** + * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones. + */ + readonly nodeTiming: PerformanceNodeTiming; + + /** + * @return the current high resolution millisecond timestamp + */ + now(): number; + + /** + * The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured. + */ + readonly timeOrigin: number; + + /** + * Wraps a function within a new function that measures the running time of the wrapped function. + * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed. + * @param fn + */ + timerify any>(fn: T): T; + } + + export interface PerformanceObserverEntryList { + /** + * @return a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime. + */ + getEntries(): PerformanceEntry[]; + + /** + * @return a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime + * whose performanceEntry.name is equal to name, and optionally, whose performanceEntry.entryType is equal to type. + */ + getEntriesByName(name: string, type?: string): PerformanceEntry[]; + + /** + * @return Returns a list of PerformanceEntry objects in chronological order with respect to performanceEntry.startTime + * whose performanceEntry.entryType is equal to type. + */ + getEntriesByType(type: string): PerformanceEntry[]; + } + + export type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void; + + export class PerformanceObserver { + constructor(callback: PerformanceObserverCallback); + + /** + * Disconnects the PerformanceObserver instance from all notifications. + */ + disconnect(): void; + + /** + * Subscribes the PerformanceObserver instance to notifications of new PerformanceEntry instances identified by options.entryTypes. + * When options.buffered is false, the callback will be invoked once for every PerformanceEntry instance. + * Property buffered defaults to false. + * @param options + */ + observe(options: { entryTypes: string[], buffered?: boolean }): void; + } + + export namespace constants { + export const NODE_PERFORMANCE_GC_MAJOR: number; + export const NODE_PERFORMANCE_GC_MINOR: number; + export const NODE_PERFORMANCE_GC_INCREMENTAL: number; + export const NODE_PERFORMANCE_GC_WEAKCB: number; + } + + const performance: Performance; +} diff --git a/types/node/v9/inspector.d.ts b/types/node/v9/inspector.d.ts new file mode 100644 index 0000000000..955239b486 --- /dev/null +++ b/types/node/v9/inspector.d.ts @@ -0,0 +1,2488 @@ +// Type definitions for inspector + +// These definitions are auto-generated. +// Please see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/19330 +// for more information. + +/** + * The inspector module provides an API for interacting with the V8 inspector. + */ +declare module "inspector" { + import { EventEmitter } from 'events'; + + export interface InspectorNotification { + method: string; + params: T; + } + + export namespace Schema { + /** + * Description of the protocol domain. + */ + export interface Domain { + /** + * Domain name. + */ + name: string; + /** + * Domain version. + */ + version: string; + } + + export interface GetDomainsReturnType { + /** + * List of supported domains. + */ + domains: Schema.Domain[]; + } + } + + export namespace Runtime { + /** + * Unique script identifier. + */ + export type ScriptId = string; + + /** + * Unique object identifier. + */ + export type RemoteObjectId = string; + + /** + * Primitive value which cannot be JSON-stringified. + */ + export type UnserializableValue = string; + + /** + * Mirror object referencing original JavaScript object. + */ + export interface RemoteObject { + /** + * Object type. + */ + type: string; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string; + /** + * Object class (constructor) name. Specified for object type values only. + */ + className?: string; + /** + * Remote object value in case of primitive values or JSON values (if it was requested). + */ + value?: any; + /** + * Primitive value which can not be JSON-stringified does not have value, but gets this property. + */ + unserializableValue?: Runtime.UnserializableValue; + /** + * String representation of the object. + */ + description?: string; + /** + * Unique object identifier (for non-primitive values). + */ + objectId?: Runtime.RemoteObjectId; + /** + * Preview containing abbreviated property values. Specified for object type values only. + * @experimental + */ + preview?: Runtime.ObjectPreview; + /** + * @experimental + */ + customPreview?: Runtime.CustomPreview; + } + + /** + * @experimental + */ + export interface CustomPreview { + header: string; + hasBody: boolean; + formatterObjectId: Runtime.RemoteObjectId; + bindRemoteObjectFunctionId: Runtime.RemoteObjectId; + configObjectId?: Runtime.RemoteObjectId; + } + + /** + * Object containing abbreviated remote object value. + * @experimental + */ + export interface ObjectPreview { + /** + * Object type. + */ + type: string; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string; + /** + * String representation of the object. + */ + description?: string; + /** + * True iff some of the properties or entries of the original object did not fit. + */ + overflow: boolean; + /** + * List of the properties. + */ + properties: Runtime.PropertyPreview[]; + /** + * List of the entries. Specified for map and set subtype values only. + */ + entries?: Runtime.EntryPreview[]; + } + + /** + * @experimental + */ + export interface PropertyPreview { + /** + * Property name. + */ + name: string; + /** + * Object type. Accessor means that the property itself is an accessor property. + */ + type: string; + /** + * User-friendly property value string. + */ + value?: string; + /** + * Nested value preview. + */ + valuePreview?: Runtime.ObjectPreview; + /** + * Object subtype hint. Specified for object type values only. + */ + subtype?: string; + } + + /** + * @experimental + */ + export interface EntryPreview { + /** + * Preview of the key. Specified for map-like collection entries. + */ + key?: Runtime.ObjectPreview; + /** + * Preview of the value. + */ + value: Runtime.ObjectPreview; + } + + /** + * Object property descriptor. + */ + export interface PropertyDescriptor { + /** + * Property name or symbol description. + */ + name: string; + /** + * The value associated with the property. + */ + value?: Runtime.RemoteObject; + /** + * True if the value associated with the property may be changed (data descriptors only). + */ + writable?: boolean; + /** + * A function which serves as a getter for the property, or undefined if there is no getter (accessor descriptors only). + */ + get?: Runtime.RemoteObject; + /** + * A function which serves as a setter for the property, or undefined if there is no setter (accessor descriptors only). + */ + set?: Runtime.RemoteObject; + /** + * True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. + */ + configurable: boolean; + /** + * True if this property shows up during enumeration of the properties on the corresponding object. + */ + enumerable: boolean; + /** + * True if the result was thrown during the evaluation. + */ + wasThrown?: boolean; + /** + * True if the property is owned for the object. + */ + isOwn?: boolean; + /** + * Property symbol object, if the property is of the symbol type. + */ + symbol?: Runtime.RemoteObject; + } + + /** + * Object internal property descriptor. This property isn't normally visible in JavaScript code. + */ + export interface InternalPropertyDescriptor { + /** + * Conventional property name. + */ + name: string; + /** + * The value associated with the property. + */ + value?: Runtime.RemoteObject; + } + + /** + * Represents function call argument. Either remote object id objectId, primitive value, unserializable primitive value or neither of (for undefined) them should be specified. + */ + export interface CallArgument { + /** + * Primitive value. + */ + value?: any; + /** + * Primitive value which can not be JSON-stringified. + */ + unserializableValue?: Runtime.UnserializableValue; + /** + * Remote object handle. + */ + objectId?: Runtime.RemoteObjectId; + } + + /** + * Id of an execution context. + */ + export type ExecutionContextId = number; + + /** + * Description of an isolated world. + */ + export interface ExecutionContextDescription { + /** + * Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed. + */ + id: Runtime.ExecutionContextId; + /** + * Execution context origin. + */ + origin: string; + /** + * Human readable name describing given context. + */ + name: string; + /** + * Embedder-specific auxiliary data. + */ + auxData?: {}; + } + + /** + * Detailed information about exception (or error) that was thrown during script compilation or execution. + */ + export interface ExceptionDetails { + /** + * Exception id. + */ + exceptionId: number; + /** + * Exception text, which should be used together with exception object when available. + */ + text: string; + /** + * Line number of the exception location (0-based). + */ + lineNumber: number; + /** + * Column number of the exception location (0-based). + */ + columnNumber: number; + /** + * Script ID of the exception location. + */ + scriptId?: Runtime.ScriptId; + /** + * URL of the exception location, to be used when the script was not reported. + */ + url?: string; + /** + * JavaScript stack trace if available. + */ + stackTrace?: Runtime.StackTrace; + /** + * Exception object if available. + */ + exception?: Runtime.RemoteObject; + /** + * Identifier of the context where exception happened. + */ + executionContextId?: Runtime.ExecutionContextId; + } + + /** + * Number of milliseconds since epoch. + */ + export type Timestamp = number; + + /** + * Stack entry for runtime errors and assertions. + */ + export interface CallFrame { + /** + * JavaScript function name. + */ + functionName: string; + /** + * JavaScript script id. + */ + scriptId: Runtime.ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * JavaScript script line number (0-based). + */ + lineNumber: number; + /** + * JavaScript script column number (0-based). + */ + columnNumber: number; + } + + /** + * Call frames for assertions or error messages. + */ + export interface StackTrace { + /** + * String label of this stack trace. For async traces this may be a name of the function that initiated the async call. + */ + description?: string; + /** + * JavaScript function name. + */ + callFrames: Runtime.CallFrame[]; + /** + * Asynchronous JavaScript stack trace that preceded this stack, if available. + */ + parent?: Runtime.StackTrace; + /** + * Creation frame of the Promise which produced the next synchronous trace when resolved, if available. + * @experimental + */ + promiseCreationFrame?: Runtime.CallFrame; + } + + export interface EvaluateParameterType { + /** + * Expression to evaluate. + */ + expression: string; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string; + /** + * Determines whether Command Line API should be available during the evaluation. + */ + includeCommandLineAPI?: boolean; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean; + /** + * Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + contextId?: Runtime.ExecutionContextId; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean; + /** + * Whether execution should be treated as initiated by user in the UI. + * @experimental + */ + userGesture?: boolean; + /** + * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. + */ + awaitPromise?: boolean; + } + + export interface AwaitPromiseParameterType { + /** + * Identifier of the promise. + */ + promiseObjectId: Runtime.RemoteObjectId; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + */ + generatePreview?: boolean; + } + + export interface CallFunctionOnParameterType { + /** + * Identifier of the object to call function on. + */ + objectId: Runtime.RemoteObjectId; + /** + * Declaration of the function to call. + */ + functionDeclaration: string; + /** + * Call arguments. All call arguments must belong to the same JavaScript world as the target object. + */ + arguments?: Runtime.CallArgument[]; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean; + /** + * Whether the result is expected to be a JSON object which should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean; + /** + * Whether execution should be treated as initiated by user in the UI. + * @experimental + */ + userGesture?: boolean; + /** + * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. + */ + awaitPromise?: boolean; + } + + export interface GetPropertiesParameterType { + /** + * Identifier of the object to return properties for. + */ + objectId: Runtime.RemoteObjectId; + /** + * If true, returns properties belonging only to the element itself, not to its prototype chain. + */ + ownProperties?: boolean; + /** + * If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. + * @experimental + */ + accessorPropertiesOnly?: boolean; + /** + * Whether preview should be generated for the results. + * @experimental + */ + generatePreview?: boolean; + } + + export interface ReleaseObjectParameterType { + /** + * Identifier of the object to release. + */ + objectId: Runtime.RemoteObjectId; + } + + export interface ReleaseObjectGroupParameterType { + /** + * Symbolic object group name. + */ + objectGroup: string; + } + + export interface SetCustomObjectFormatterEnabledParameterType { + enabled: boolean; + } + + export interface CompileScriptParameterType { + /** + * Expression to compile. + */ + expression: string; + /** + * Source url to be set for the script. + */ + sourceURL: string; + /** + * Specifies whether the compiled script should be persisted. + */ + persistScript: boolean; + /** + * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + executionContextId?: Runtime.ExecutionContextId; + } + + export interface RunScriptParameterType { + /** + * Id of the script to run. + */ + scriptId: Runtime.ScriptId; + /** + * Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. + */ + executionContextId?: Runtime.ExecutionContextId; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean; + /** + * Determines whether Command Line API should be available during the evaluation. + */ + includeCommandLineAPI?: boolean; + /** + * Whether the result is expected to be a JSON object which should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + */ + generatePreview?: boolean; + /** + * Whether execution should wait for promise to be resolved. If the result of evaluation is not a Promise, it's considered to be an error. + */ + awaitPromise?: boolean; + } + + export interface EvaluateReturnType { + /** + * Evaluation result. + */ + result: Runtime.RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface AwaitPromiseReturnType { + /** + * Promise result. Will contain rejected value if promise was rejected. + */ + result: Runtime.RemoteObject; + /** + * Exception details if stack strace is available. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface CallFunctionOnReturnType { + /** + * Call result. + */ + result: Runtime.RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface GetPropertiesReturnType { + /** + * Object properties. + */ + result: Runtime.PropertyDescriptor[]; + /** + * Internal object properties (only of the element itself). + */ + internalProperties?: Runtime.InternalPropertyDescriptor[]; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface CompileScriptReturnType { + /** + * Id of the script. + */ + scriptId?: Runtime.ScriptId; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface RunScriptReturnType { + /** + * Run result. + */ + result: Runtime.RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface ExecutionContextCreatedEventDataType { + /** + * A newly created execution context. + */ + context: Runtime.ExecutionContextDescription; + } + + export interface ExecutionContextDestroyedEventDataType { + /** + * Id of the destroyed context + */ + executionContextId: Runtime.ExecutionContextId; + } + + export interface ExceptionThrownEventDataType { + /** + * Timestamp of the exception. + */ + timestamp: Runtime.Timestamp; + exceptionDetails: Runtime.ExceptionDetails; + } + + export interface ExceptionRevokedEventDataType { + /** + * Reason describing why exception was revoked. + */ + reason: string; + /** + * The id of revoked exception, as reported in exceptionUnhandled. + */ + exceptionId: number; + } + + export interface ConsoleAPICalledEventDataType { + /** + * Type of the call. + */ + type: string; + /** + * Call arguments. + */ + args: Runtime.RemoteObject[]; + /** + * Identifier of the context where the call was made. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Call timestamp. + */ + timestamp: Runtime.Timestamp; + /** + * Stack trace captured when the call was made. + */ + stackTrace?: Runtime.StackTrace; + /** + * Console context descriptor for calls on non-default console context (not console.*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. + * @experimental + */ + context?: string; + } + + export interface InspectRequestedEventDataType { + object: Runtime.RemoteObject; + hints: {}; + } + } + + export namespace Debugger { + /** + * Breakpoint identifier. + */ + export type BreakpointId = string; + + /** + * Call frame identifier. + */ + export type CallFrameId = string; + + /** + * Location in the source code. + */ + export interface Location { + /** + * Script identifier as reported in the Debugger.scriptParsed. + */ + scriptId: Runtime.ScriptId; + /** + * Line number in the script (0-based). + */ + lineNumber: number; + /** + * Column number in the script (0-based). + */ + columnNumber?: number; + } + + /** + * Location in the source code. + * @experimental + */ + export interface ScriptPosition { + lineNumber: number; + columnNumber: number; + } + + /** + * JavaScript call frame. Array of call frames form the call stack. + */ + export interface CallFrame { + /** + * Call frame identifier. This identifier is only valid while the virtual machine is paused. + */ + callFrameId: Debugger.CallFrameId; + /** + * Name of the JavaScript function called on this call frame. + */ + functionName: string; + /** + * Location in the source code. + * @experimental + */ + functionLocation?: Debugger.Location; + /** + * Location in the source code. + */ + location: Debugger.Location; + /** + * Scope chain for this call frame. + */ + scopeChain: Debugger.Scope[]; + /** + * this object for this call frame. + */ + this: Runtime.RemoteObject; + /** + * The value being returned, if the function is at return point. + */ + returnValue?: Runtime.RemoteObject; + } + + /** + * Scope description. + */ + export interface Scope { + /** + * Scope type. + */ + type: string; + /** + * Object representing the scope. For global and with scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties. + */ + object: Runtime.RemoteObject; + name?: string; + /** + * Location in the source code where scope starts + */ + startLocation?: Debugger.Location; + /** + * Location in the source code where scope ends + */ + endLocation?: Debugger.Location; + } + + /** + * Search match for resource. + * @experimental + */ + export interface SearchMatch { + /** + * Line number in resource content. + */ + lineNumber: number; + /** + * Line with match content. + */ + lineContent: string; + } + + /** + * @experimental + */ + export interface BreakLocation { + /** + * Script identifier as reported in the Debugger.scriptParsed. + */ + scriptId: Runtime.ScriptId; + /** + * Line number in the script (0-based). + */ + lineNumber: number; + /** + * Column number in the script (0-based). + */ + columnNumber?: number; + type?: string; + } + + export interface SetBreakpointsActiveParameterType { + /** + * New value for breakpoints active state. + */ + active: boolean; + } + + export interface SetSkipAllPausesParameterType { + /** + * New value for skip pauses state. + */ + skip: boolean; + } + + export interface SetBreakpointByUrlParameterType { + /** + * Line number to set breakpoint at. + */ + lineNumber: number; + /** + * URL of the resources to set breakpoint on. + */ + url?: string; + /** + * Regex pattern for the URLs of the resources to set breakpoints on. Either url or urlRegex must be specified. + */ + urlRegex?: string; + /** + * Offset in the line to set breakpoint at. + */ + columnNumber?: number; + /** + * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. + */ + condition?: string; + } + + export interface SetBreakpointParameterType { + /** + * Location to set breakpoint in. + */ + location: Debugger.Location; + /** + * Expression to use as a breakpoint condition. When specified, debugger will only stop on the breakpoint if this expression evaluates to true. + */ + condition?: string; + } + + export interface RemoveBreakpointParameterType { + breakpointId: Debugger.BreakpointId; + } + + export interface GetPossibleBreakpointsParameterType { + /** + * Start of range to search possible breakpoint locations in. + */ + start: Debugger.Location; + /** + * End of range to search possible breakpoint locations in (excluding). When not specified, end of scripts is used as end of range. + */ + end?: Debugger.Location; + /** + * Only consider locations which are in the same (non-nested) function as start. + */ + restrictToFunction?: boolean; + } + + export interface ContinueToLocationParameterType { + /** + * Location to continue to. + */ + location: Debugger.Location; + /** + * @experimental + */ + targetCallFrames?: string; + } + + export interface SearchInContentParameterType { + /** + * Id of the script to search in. + */ + scriptId: Runtime.ScriptId; + /** + * String to search for. + */ + query: string; + /** + * If true, search is case sensitive. + */ + caseSensitive?: boolean; + /** + * If true, treats string parameter as regex. + */ + isRegex?: boolean; + } + + export interface SetScriptSourceParameterType { + /** + * Id of the script to edit. + */ + scriptId: Runtime.ScriptId; + /** + * New content of the script. + */ + scriptSource: string; + /** + * If true the change will not actually be applied. Dry run may be used to get result description without actually modifying the code. + */ + dryRun?: boolean; + } + + export interface RestartFrameParameterType { + /** + * Call frame identifier to evaluate on. + */ + callFrameId: Debugger.CallFrameId; + } + + export interface GetScriptSourceParameterType { + /** + * Id of the script to get source for. + */ + scriptId: Runtime.ScriptId; + } + + export interface SetPauseOnExceptionsParameterType { + /** + * Pause on exceptions mode. + */ + state: string; + } + + export interface EvaluateOnCallFrameParameterType { + /** + * Call frame identifier to evaluate on. + */ + callFrameId: Debugger.CallFrameId; + /** + * Expression to evaluate. + */ + expression: string; + /** + * String object group name to put result into (allows rapid releasing resulting object handles using releaseObjectGroup). + */ + objectGroup?: string; + /** + * Specifies whether command line API should be available to the evaluated expression, defaults to false. + */ + includeCommandLineAPI?: boolean; + /** + * In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides setPauseOnException state. + */ + silent?: boolean; + /** + * Whether the result is expected to be a JSON object that should be sent by value. + */ + returnByValue?: boolean; + /** + * Whether preview should be generated for the result. + * @experimental + */ + generatePreview?: boolean; + /** + * Whether to throw an exception if side effect cannot be ruled out during evaluation. + * @experimental + */ + throwOnSideEffect?: boolean; + } + + export interface SetVariableValueParameterType { + /** + * 0-based number of scope as was listed in scope chain. Only 'local', 'closure' and 'catch' scope types are allowed. Other scopes could be manipulated manually. + */ + scopeNumber: number; + /** + * Variable name. + */ + variableName: string; + /** + * New variable value. + */ + newValue: Runtime.CallArgument; + /** + * Id of callframe that holds variable. + */ + callFrameId: Debugger.CallFrameId; + } + + export interface SetAsyncCallStackDepthParameterType { + /** + * Maximum depth of async call stacks. Setting to 0 will effectively disable collecting async call stacks (default). + */ + maxDepth: number; + } + + export interface SetBlackboxPatternsParameterType { + /** + * Array of regexps that will be used to check script url for blackbox state. + */ + patterns: string[]; + } + + export interface SetBlackboxedRangesParameterType { + /** + * Id of the script. + */ + scriptId: Runtime.ScriptId; + positions: Debugger.ScriptPosition[]; + } + + export interface SetBreakpointByUrlReturnType { + /** + * Id of the created breakpoint for further reference. + */ + breakpointId: Debugger.BreakpointId; + /** + * List of the locations this breakpoint resolved into upon addition. + */ + locations: Debugger.Location[]; + } + + export interface SetBreakpointReturnType { + /** + * Id of the created breakpoint for further reference. + */ + breakpointId: Debugger.BreakpointId; + /** + * Location this breakpoint resolved into. + */ + actualLocation: Debugger.Location; + } + + export interface GetPossibleBreakpointsReturnType { + /** + * List of the possible breakpoint locations. + */ + locations: Debugger.BreakLocation[]; + } + + export interface SearchInContentReturnType { + /** + * List of search matches. + */ + result: Debugger.SearchMatch[]; + } + + export interface SetScriptSourceReturnType { + /** + * New stack trace in case editing has happened while VM was stopped. + */ + callFrames?: Debugger.CallFrame[]; + /** + * Whether current call stack was modified after applying the changes. + */ + stackChanged?: boolean; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace; + /** + * Exception details if any. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface RestartFrameReturnType { + /** + * New stack trace. + */ + callFrames: Debugger.CallFrame[]; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace; + } + + export interface GetScriptSourceReturnType { + /** + * Script source. + */ + scriptSource: string; + } + + export interface EvaluateOnCallFrameReturnType { + /** + * Object wrapper for the evaluation result. + */ + result: Runtime.RemoteObject; + /** + * Exception details. + */ + exceptionDetails?: Runtime.ExceptionDetails; + } + + export interface ScriptParsedEventDataType { + /** + * Identifier of the script parsed. + */ + scriptId: Runtime.ScriptId; + /** + * URL or name of the script parsed (if any). + */ + url: string; + /** + * Line offset of the script within the resource with given URL (for script tags). + */ + startLine: number; + /** + * Column offset of the script within the resource with given URL. + */ + startColumn: number; + /** + * Last line of the script. + */ + endLine: number; + /** + * Length of the last line of the script. + */ + endColumn: number; + /** + * Specifies script creation context. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Content hash of the script. + */ + hash: string; + /** + * Embedder-specific auxiliary data. + */ + executionContextAuxData?: {}; + /** + * True, if this script is generated as a result of the live edit operation. + * @experimental + */ + isLiveEdit?: boolean; + /** + * URL of source map associated with script (if any). + */ + sourceMapURL?: string; + /** + * True, if this script has sourceURL. + * @experimental + */ + hasSourceURL?: boolean; + /** + * True, if this script is ES6 module. + * @experimental + */ + isModule?: boolean; + /** + * This script length. + * @experimental + */ + length?: number; + /** + * JavaScript top stack frame of where the script parsed event was triggered if available. + * @experimental + */ + stackTrace?: Runtime.StackTrace; + } + + export interface ScriptFailedToParseEventDataType { + /** + * Identifier of the script parsed. + */ + scriptId: Runtime.ScriptId; + /** + * URL or name of the script parsed (if any). + */ + url: string; + /** + * Line offset of the script within the resource with given URL (for script tags). + */ + startLine: number; + /** + * Column offset of the script within the resource with given URL. + */ + startColumn: number; + /** + * Last line of the script. + */ + endLine: number; + /** + * Length of the last line of the script. + */ + endColumn: number; + /** + * Specifies script creation context. + */ + executionContextId: Runtime.ExecutionContextId; + /** + * Content hash of the script. + */ + hash: string; + /** + * Embedder-specific auxiliary data. + */ + executionContextAuxData?: {}; + /** + * URL of source map associated with script (if any). + */ + sourceMapURL?: string; + /** + * True, if this script has sourceURL. + * @experimental + */ + hasSourceURL?: boolean; + /** + * True, if this script is ES6 module. + * @experimental + */ + isModule?: boolean; + /** + * This script length. + * @experimental + */ + length?: number; + /** + * JavaScript top stack frame of where the script parsed event was triggered if available. + * @experimental + */ + stackTrace?: Runtime.StackTrace; + } + + export interface BreakpointResolvedEventDataType { + /** + * Breakpoint unique identifier. + */ + breakpointId: Debugger.BreakpointId; + /** + * Actual breakpoint location. + */ + location: Debugger.Location; + } + + export interface PausedEventDataType { + /** + * Call stack the virtual machine stopped on. + */ + callFrames: Debugger.CallFrame[]; + /** + * Pause reason. + */ + reason: string; + /** + * Object containing break-specific auxiliary properties. + */ + data?: {}; + /** + * Hit breakpoints IDs + */ + hitBreakpoints?: string[]; + /** + * Async stack trace, if any. + */ + asyncStackTrace?: Runtime.StackTrace; + } + } + + export namespace Console { + /** + * Console message. + */ + export interface ConsoleMessage { + /** + * Message source. + */ + source: string; + /** + * Message severity. + */ + level: string; + /** + * Message text. + */ + text: string; + /** + * URL of the message origin. + */ + url?: string; + /** + * Line number in the resource that generated this message (1-based). + */ + line?: number; + /** + * Column number in the resource that generated this message (1-based). + */ + column?: number; + } + + export interface MessageAddedEventDataType { + /** + * Console message that has been added. + */ + message: Console.ConsoleMessage; + } + } + + export namespace Profiler { + /** + * Profile node. Holds callsite information, execution statistics and child nodes. + */ + export interface ProfileNode { + /** + * Unique id of the node. + */ + id: number; + /** + * Function location. + */ + callFrame: Runtime.CallFrame; + /** + * Number of samples where this node was on top of the call stack. + * @experimental + */ + hitCount?: number; + /** + * Child node ids. + */ + children?: number[]; + /** + * The reason of being not optimized. The function may be deoptimized or marked as don't optimize. + */ + deoptReason?: string; + /** + * An array of source position ticks. + * @experimental + */ + positionTicks?: Profiler.PositionTickInfo[]; + } + + /** + * Profile. + */ + export interface Profile { + /** + * The list of profile nodes. First item is the root node. + */ + nodes: Profiler.ProfileNode[]; + /** + * Profiling start timestamp in microseconds. + */ + startTime: number; + /** + * Profiling end timestamp in microseconds. + */ + endTime: number; + /** + * Ids of samples top nodes. + */ + samples?: number[]; + /** + * Time intervals between adjacent samples in microseconds. The first delta is relative to the profile startTime. + */ + timeDeltas?: number[]; + } + + /** + * Specifies a number of samples attributed to a certain source position. + * @experimental + */ + export interface PositionTickInfo { + /** + * Source line number (1-based). + */ + line: number; + /** + * Number of samples attributed to the source line. + */ + ticks: number; + } + + /** + * Coverage data for a source range. + * @experimental + */ + export interface CoverageRange { + /** + * JavaScript script source offset for the range start. + */ + startOffset: number; + /** + * JavaScript script source offset for the range end. + */ + endOffset: number; + /** + * Collected execution count of the source range. + */ + count: number; + } + + /** + * Coverage data for a JavaScript function. + * @experimental + */ + export interface FunctionCoverage { + /** + * JavaScript function name. + */ + functionName: string; + /** + * Source ranges inside the function with coverage data. + */ + ranges: Profiler.CoverageRange[]; + /** + * Whether coverage data for this function has block granularity. + */ + isBlockCoverage: boolean; + } + + /** + * Coverage data for a JavaScript script. + * @experimental + */ + export interface ScriptCoverage { + /** + * JavaScript script id. + */ + scriptId: Runtime.ScriptId; + /** + * JavaScript script name or url. + */ + url: string; + /** + * Functions contained in the script that has coverage data. + */ + functions: Profiler.FunctionCoverage[]; + } + + export interface SetSamplingIntervalParameterType { + /** + * New sampling interval in microseconds. + */ + interval: number; + } + + export interface StartPreciseCoverageParameterType { + /** + * Collect accurate call counts beyond simple 'covered' or 'not covered'. + */ + callCount?: boolean; + } + + export interface StopReturnType { + /** + * Recorded profile. + */ + profile: Profiler.Profile; + } + + export interface TakePreciseCoverageReturnType { + /** + * Coverage data for the current isolate. + */ + result: Profiler.ScriptCoverage[]; + } + + export interface GetBestEffortCoverageReturnType { + /** + * Coverage data for the current isolate. + */ + result: Profiler.ScriptCoverage[]; + } + + export interface ConsoleProfileStartedEventDataType { + id: string; + /** + * Location of console.profile(). + */ + location: Debugger.Location; + /** + * Profile title passed as an argument to console.profile(). + */ + title?: string; + } + + export interface ConsoleProfileFinishedEventDataType { + id: string; + /** + * Location of console.profileEnd(). + */ + location: Debugger.Location; + profile: Profiler.Profile; + /** + * Profile title passed as an argument to console.profile(). + */ + title?: string; + } + } + + export namespace HeapProfiler { + /** + * Heap snapshot object id. + */ + export type HeapSnapshotObjectId = string; + + /** + * Sampling Heap Profile node. Holds callsite information, allocation statistics and child nodes. + */ + export interface SamplingHeapProfileNode { + /** + * Function location. + */ + callFrame: Runtime.CallFrame; + /** + * Allocations size in bytes for the node excluding children. + */ + selfSize: number; + /** + * Child nodes. + */ + children: HeapProfiler.SamplingHeapProfileNode[]; + } + + /** + * Profile. + */ + export interface SamplingHeapProfile { + head: HeapProfiler.SamplingHeapProfileNode; + } + + export interface StartTrackingHeapObjectsParameterType { + trackAllocations?: boolean; + } + + export interface StopTrackingHeapObjectsParameterType { + /** + * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken when the tracking is stopped. + */ + reportProgress?: boolean; + } + + export interface TakeHeapSnapshotParameterType { + /** + * If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken. + */ + reportProgress?: boolean; + } + + export interface GetObjectByHeapObjectIdParameterType { + objectId: HeapProfiler.HeapSnapshotObjectId; + /** + * Symbolic group name that can be used to release multiple objects. + */ + objectGroup?: string; + } + + export interface AddInspectedHeapObjectParameterType { + /** + * Heap snapshot object id to be accessible by means of $x command line API. + */ + heapObjectId: HeapProfiler.HeapSnapshotObjectId; + } + + export interface GetHeapObjectIdParameterType { + /** + * Identifier of the object to get heap object id for. + */ + objectId: Runtime.RemoteObjectId; + } + + export interface StartSamplingParameterType { + /** + * Average sample interval in bytes. Poisson distribution is used for the intervals. The default value is 32768 bytes. + */ + samplingInterval?: number; + } + + export interface GetObjectByHeapObjectIdReturnType { + /** + * Evaluation result. + */ + result: Runtime.RemoteObject; + } + + export interface GetHeapObjectIdReturnType { + /** + * Id of the heap snapshot object corresponding to the passed remote object id. + */ + heapSnapshotObjectId: HeapProfiler.HeapSnapshotObjectId; + } + + export interface StopSamplingReturnType { + /** + * Recorded sampling heap profile. + */ + profile: HeapProfiler.SamplingHeapProfile; + } + + export interface AddHeapSnapshotChunkEventDataType { + chunk: string; + } + + export interface ReportHeapSnapshotProgressEventDataType { + done: number; + total: number; + finished?: boolean; + } + + export interface LastSeenObjectIdEventDataType { + lastSeenObjectId: number; + timestamp: number; + } + + export interface HeapStatsUpdateEventDataType { + /** + * An array of triplets. Each triplet describes a fragment. The first integer is the fragment index, the second integer is a total count of objects for the fragment, the third integer is a total size of the objects for the fragment. + */ + statsUpdate: number[]; + } + } + + /** + * The inspector.Session is used for dispatching messages to the V8 inspector back-end and receiving message responses and notifications. + */ + export class Session extends EventEmitter { + /** + * Create a new instance of the inspector.Session class. The inspector session needs to be connected through session.connect() before the messages can be dispatched to the inspector backend. + */ + constructor(); + + /** + * Connects a session to the inspector back-end. An exception will be thrown if there is already a connected session established either through the API or by a front-end connected to the Inspector WebSocket port. + */ + connect(): void; + + /** + * Immediately close the session. All pending message callbacks will be called with an error. session.connect() will need to be called to be able to send messages again. Reconnected session will lose all inspector state, such as enabled agents or configured breakpoints. + */ + disconnect(): void; + + /** + * Posts a message to the inspector back-end. callback will be notified when a response is received. callback is a function that accepts two optional arguments - error and message-specific result. + */ + post(method: string, params?: {}, callback?: (err: Error | null, params?: {}) => void): void; + post(method: string, callback?: (err: Error | null, params?: {}) => void): void; + + /** + * Returns supported domains. + */ + post(method: "Schema.getDomains", callback?: (err: Error | null, params: Schema.GetDomainsReturnType) => void): void; + /** + * Evaluates expression on global object. + */ + post(method: "Runtime.evaluate", params?: Runtime.EvaluateParameterType, callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + post(method: "Runtime.evaluate", callback?: (err: Error | null, params: Runtime.EvaluateReturnType) => void): void; + + /** + * Add handler to promise with given promise object id. + */ + post(method: "Runtime.awaitPromise", params?: Runtime.AwaitPromiseParameterType, callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; + post(method: "Runtime.awaitPromise", callback?: (err: Error | null, params: Runtime.AwaitPromiseReturnType) => void): void; + + /** + * Calls function with given declaration on the given object. Object group of the result is inherited from the target object. + */ + post(method: "Runtime.callFunctionOn", params?: Runtime.CallFunctionOnParameterType, callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; + post(method: "Runtime.callFunctionOn", callback?: (err: Error | null, params: Runtime.CallFunctionOnReturnType) => void): void; + + /** + * Returns properties of a given object. Object group of the result is inherited from the target object. + */ + post(method: "Runtime.getProperties", params?: Runtime.GetPropertiesParameterType, callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; + post(method: "Runtime.getProperties", callback?: (err: Error | null, params: Runtime.GetPropertiesReturnType) => void): void; + + /** + * Releases remote object with given id. + */ + post(method: "Runtime.releaseObject", params?: Runtime.ReleaseObjectParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.releaseObject", callback?: (err: Error | null) => void): void; + + /** + * Releases all remote objects that belong to a given group. + */ + post(method: "Runtime.releaseObjectGroup", params?: Runtime.ReleaseObjectGroupParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.releaseObjectGroup", callback?: (err: Error | null) => void): void; + + /** + * Tells inspected instance to run if it was waiting for debugger to attach. + */ + post(method: "Runtime.runIfWaitingForDebugger", callback?: (err: Error | null) => void): void; + + /** + * Enables reporting of execution contexts creation by means of executionContextCreated event. When the reporting gets enabled the event will be sent immediately for each existing execution context. + */ + post(method: "Runtime.enable", callback?: (err: Error | null) => void): void; + + /** + * Disables reporting of execution contexts creation. + */ + post(method: "Runtime.disable", callback?: (err: Error | null) => void): void; + + /** + * Discards collected exceptions and console API calls. + */ + post(method: "Runtime.discardConsoleEntries", callback?: (err: Error | null) => void): void; + + /** + * @experimental + */ + post(method: "Runtime.setCustomObjectFormatterEnabled", params?: Runtime.SetCustomObjectFormatterEnabledParameterType, callback?: (err: Error | null) => void): void; + post(method: "Runtime.setCustomObjectFormatterEnabled", callback?: (err: Error | null) => void): void; + + /** + * Compiles expression. + */ + post(method: "Runtime.compileScript", params?: Runtime.CompileScriptParameterType, callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; + post(method: "Runtime.compileScript", callback?: (err: Error | null, params: Runtime.CompileScriptReturnType) => void): void; + + /** + * Runs script with given id in a given context. + */ + post(method: "Runtime.runScript", params?: Runtime.RunScriptParameterType, callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + post(method: "Runtime.runScript", callback?: (err: Error | null, params: Runtime.RunScriptReturnType) => void): void; + /** + * Enables debugger for the given page. Clients should not assume that the debugging has been enabled until the result for this command is received. + */ + post(method: "Debugger.enable", callback?: (err: Error | null) => void): void; + + /** + * Disables debugger for given page. + */ + post(method: "Debugger.disable", callback?: (err: Error | null) => void): void; + + /** + * Activates / deactivates all breakpoints on the page. + */ + post(method: "Debugger.setBreakpointsActive", params?: Debugger.SetBreakpointsActiveParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBreakpointsActive", callback?: (err: Error | null) => void): void; + + /** + * Makes page not interrupt on any pauses (breakpoint, exception, dom exception etc). + */ + post(method: "Debugger.setSkipAllPauses", params?: Debugger.SetSkipAllPausesParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setSkipAllPauses", callback?: (err: Error | null) => void): void; + + /** + * Sets JavaScript breakpoint at given location specified either by URL or URL regex. Once this command is issued, all existing parsed scripts will have breakpoints resolved and returned in locations property. Further matching script parsing will result in subsequent breakpointResolved events issued. This logical breakpoint will survive page reloads. + */ + post(method: "Debugger.setBreakpointByUrl", params?: Debugger.SetBreakpointByUrlParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; + post(method: "Debugger.setBreakpointByUrl", callback?: (err: Error | null, params: Debugger.SetBreakpointByUrlReturnType) => void): void; + + /** + * Sets JavaScript breakpoint at a given location. + */ + post(method: "Debugger.setBreakpoint", params?: Debugger.SetBreakpointParameterType, callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; + post(method: "Debugger.setBreakpoint", callback?: (err: Error | null, params: Debugger.SetBreakpointReturnType) => void): void; + + /** + * Removes JavaScript breakpoint. + */ + post(method: "Debugger.removeBreakpoint", params?: Debugger.RemoveBreakpointParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.removeBreakpoint", callback?: (err: Error | null) => void): void; + + /** + * Returns possible locations for breakpoint. scriptId in start and end range locations should be the same. + * @experimental + */ + post(method: "Debugger.getPossibleBreakpoints", params?: Debugger.GetPossibleBreakpointsParameterType, callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; + post(method: "Debugger.getPossibleBreakpoints", callback?: (err: Error | null, params: Debugger.GetPossibleBreakpointsReturnType) => void): void; + + /** + * Continues execution until specific location is reached. + */ + post(method: "Debugger.continueToLocation", params?: Debugger.ContinueToLocationParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.continueToLocation", callback?: (err: Error | null) => void): void; + + /** + * Steps over the statement. + */ + post(method: "Debugger.stepOver", callback?: (err: Error | null) => void): void; + + /** + * Steps into the function call. + */ + post(method: "Debugger.stepInto", callback?: (err: Error | null) => void): void; + + /** + * Steps out of the function call. + */ + post(method: "Debugger.stepOut", callback?: (err: Error | null) => void): void; + + /** + * Stops on the next JavaScript statement. + */ + post(method: "Debugger.pause", callback?: (err: Error | null) => void): void; + + /** + * Steps into next scheduled async task if any is scheduled before next pause. Returns success when async task is actually scheduled, returns error if no task were scheduled or another scheduleStepIntoAsync was called. + * @experimental + */ + post(method: "Debugger.scheduleStepIntoAsync", callback?: (err: Error | null) => void): void; + + /** + * Resumes JavaScript execution. + */ + post(method: "Debugger.resume", callback?: (err: Error | null) => void): void; + + /** + * Searches for given string in script content. + * @experimental + */ + post(method: "Debugger.searchInContent", params?: Debugger.SearchInContentParameterType, callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; + post(method: "Debugger.searchInContent", callback?: (err: Error | null, params: Debugger.SearchInContentReturnType) => void): void; + + /** + * Edits JavaScript source live. + */ + post(method: "Debugger.setScriptSource", params?: Debugger.SetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; + post(method: "Debugger.setScriptSource", callback?: (err: Error | null, params: Debugger.SetScriptSourceReturnType) => void): void; + + /** + * Restarts particular call frame from the beginning. + */ + post(method: "Debugger.restartFrame", params?: Debugger.RestartFrameParameterType, callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; + post(method: "Debugger.restartFrame", callback?: (err: Error | null, params: Debugger.RestartFrameReturnType) => void): void; + + /** + * Returns source for the script with given id. + */ + post(method: "Debugger.getScriptSource", params?: Debugger.GetScriptSourceParameterType, callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; + post(method: "Debugger.getScriptSource", callback?: (err: Error | null, params: Debugger.GetScriptSourceReturnType) => void): void; + + /** + * Defines pause on exceptions state. Can be set to stop on all exceptions, uncaught exceptions or no exceptions. Initial pause on exceptions state is none. + */ + post(method: "Debugger.setPauseOnExceptions", params?: Debugger.SetPauseOnExceptionsParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setPauseOnExceptions", callback?: (err: Error | null) => void): void; + + /** + * Evaluates expression on a given call frame. + */ + post(method: "Debugger.evaluateOnCallFrame", params?: Debugger.EvaluateOnCallFrameParameterType, callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; + post(method: "Debugger.evaluateOnCallFrame", callback?: (err: Error | null, params: Debugger.EvaluateOnCallFrameReturnType) => void): void; + + /** + * Changes value of variable in a callframe. Object-based scopes are not supported and must be mutated manually. + */ + post(method: "Debugger.setVariableValue", params?: Debugger.SetVariableValueParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setVariableValue", callback?: (err: Error | null) => void): void; + + /** + * Enables or disables async call stacks tracking. + */ + post(method: "Debugger.setAsyncCallStackDepth", params?: Debugger.SetAsyncCallStackDepthParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setAsyncCallStackDepth", callback?: (err: Error | null) => void): void; + + /** + * Replace previous blackbox patterns with passed ones. Forces backend to skip stepping/pausing in scripts with url matching one of the patterns. VM will try to leave blackboxed script by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. + * @experimental + */ + post(method: "Debugger.setBlackboxPatterns", params?: Debugger.SetBlackboxPatternsParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBlackboxPatterns", callback?: (err: Error | null) => void): void; + + /** + * Makes backend skip steps in the script in blackboxed ranges. VM will try leave blacklisted scripts by performing 'step in' several times, finally resorting to 'step out' if unsuccessful. Positions array contains positions where blackbox state is changed. First interval isn't blackboxed. Array should be sorted. + * @experimental + */ + post(method: "Debugger.setBlackboxedRanges", params?: Debugger.SetBlackboxedRangesParameterType, callback?: (err: Error | null) => void): void; + post(method: "Debugger.setBlackboxedRanges", callback?: (err: Error | null) => void): void; + /** + * Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification. + */ + post(method: "Console.enable", callback?: (err: Error | null) => void): void; + + /** + * Disables console domain, prevents further console messages from being reported to the client. + */ + post(method: "Console.disable", callback?: (err: Error | null) => void): void; + + /** + * Does nothing. + */ + post(method: "Console.clearMessages", callback?: (err: Error | null) => void): void; + post(method: "Profiler.enable", callback?: (err: Error | null) => void): void; + + post(method: "Profiler.disable", callback?: (err: Error | null) => void): void; + + /** + * Changes CPU profiler sampling interval. Must be called before CPU profiles recording started. + */ + post(method: "Profiler.setSamplingInterval", params?: Profiler.SetSamplingIntervalParameterType, callback?: (err: Error | null) => void): void; + post(method: "Profiler.setSamplingInterval", callback?: (err: Error | null) => void): void; + + post(method: "Profiler.start", callback?: (err: Error | null) => void): void; + + post(method: "Profiler.stop", callback?: (err: Error | null, params: Profiler.StopReturnType) => void): void; + + /** + * Enable precise code coverage. Coverage data for JavaScript executed before enabling precise code coverage may be incomplete. Enabling prevents running optimized code and resets execution counters. + * @experimental + */ + post(method: "Profiler.startPreciseCoverage", params?: Profiler.StartPreciseCoverageParameterType, callback?: (err: Error | null) => void): void; + post(method: "Profiler.startPreciseCoverage", callback?: (err: Error | null) => void): void; + + /** + * Disable precise code coverage. Disabling releases unnecessary execution count records and allows executing optimized code. + * @experimental + */ + post(method: "Profiler.stopPreciseCoverage", callback?: (err: Error | null) => void): void; + + /** + * Collect coverage data for the current isolate, and resets execution counters. Precise code coverage needs to have started. + * @experimental + */ + post(method: "Profiler.takePreciseCoverage", callback?: (err: Error | null, params: Profiler.TakePreciseCoverageReturnType) => void): void; + + /** + * Collect coverage data for the current isolate. The coverage data may be incomplete due to garbage collection. + * @experimental + */ + post(method: "Profiler.getBestEffortCoverage", callback?: (err: Error | null, params: Profiler.GetBestEffortCoverageReturnType) => void): void; + post(method: "HeapProfiler.enable", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.disable", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.startTrackingHeapObjects", params?: HeapProfiler.StartTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.startTrackingHeapObjects", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.stopTrackingHeapObjects", params?: HeapProfiler.StopTrackingHeapObjectsParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.stopTrackingHeapObjects", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.takeHeapSnapshot", params?: HeapProfiler.TakeHeapSnapshotParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.takeHeapSnapshot", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.collectGarbage", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.getObjectByHeapObjectId", params?: HeapProfiler.GetObjectByHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; + post(method: "HeapProfiler.getObjectByHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetObjectByHeapObjectIdReturnType) => void): void; + + /** + * Enables console to refer to the node with given id via $x (see Command Line API for more details $x functions). + */ + post(method: "HeapProfiler.addInspectedHeapObject", params?: HeapProfiler.AddInspectedHeapObjectParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.addInspectedHeapObject", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.getHeapObjectId", params?: HeapProfiler.GetHeapObjectIdParameterType, callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; + post(method: "HeapProfiler.getHeapObjectId", callback?: (err: Error | null, params: HeapProfiler.GetHeapObjectIdReturnType) => void): void; + + post(method: "HeapProfiler.startSampling", params?: HeapProfiler.StartSamplingParameterType, callback?: (err: Error | null) => void): void; + post(method: "HeapProfiler.startSampling", callback?: (err: Error | null) => void): void; + + post(method: "HeapProfiler.stopSampling", callback?: (err: Error | null, params: HeapProfiler.StopSamplingReturnType) => void): void; + + // Events + + addListener(event: string, listener: (...args: any[]) => void): this; + + /** + * Emitted when any notification from the V8 Inspector is received. + */ + addListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; + + /** + * Issued when new execution context is created. + */ + addListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + addListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + addListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + addListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + addListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + addListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + addListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + addListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine fails to parse the script. + */ + addListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + addListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + addListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine resumed execution. + */ + addListener(event: "Debugger.resumed", listener: () => void): this; + + /** + * Issued when new console message is added. + */ + addListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + addListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + addListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + addListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + addListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + addListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + addListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + addListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + emit(event: string | symbol, ...args: any[]): boolean; + emit(event: "inspectorNotification", message: InspectorNotification<{}>): boolean; + emit(event: "Runtime.executionContextCreated", message: InspectorNotification): boolean; + emit(event: "Runtime.executionContextDestroyed", message: InspectorNotification): boolean; + emit(event: "Runtime.executionContextsCleared"): boolean; + emit(event: "Runtime.exceptionThrown", message: InspectorNotification): boolean; + emit(event: "Runtime.exceptionRevoked", message: InspectorNotification): boolean; + emit(event: "Runtime.consoleAPICalled", message: InspectorNotification): boolean; + emit(event: "Runtime.inspectRequested", message: InspectorNotification): boolean; + emit(event: "Debugger.scriptParsed", message: InspectorNotification): boolean; + emit(event: "Debugger.scriptFailedToParse", message: InspectorNotification): boolean; + emit(event: "Debugger.breakpointResolved", message: InspectorNotification): boolean; + emit(event: "Debugger.paused", message: InspectorNotification): boolean; + emit(event: "Debugger.resumed"): boolean; + emit(event: "Console.messageAdded", message: InspectorNotification): boolean; + emit(event: "Profiler.consoleProfileStarted", message: InspectorNotification): boolean; + emit(event: "Profiler.consoleProfileFinished", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.addHeapSnapshotChunk", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.resetProfiles"): boolean; + emit(event: "HeapProfiler.reportHeapSnapshotProgress", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.lastSeenObjectId", message: InspectorNotification): boolean; + emit(event: "HeapProfiler.heapStatsUpdate", message: InspectorNotification): boolean; + + on(event: string, listener: (...args: any[]) => void): this; + + /** + * Emitted when any notification from the V8 Inspector is received. + */ + on(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; + + /** + * Issued when new execution context is created. + */ + on(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + on(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + on(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + on(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + on(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + on(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + on(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + on(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine fails to parse the script. + */ + on(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + on(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + on(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine resumed execution. + */ + on(event: "Debugger.resumed", listener: () => void): this; + + /** + * Issued when new console message is added. + */ + on(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + on(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + on(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + on(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + on(event: "HeapProfiler.resetProfiles", listener: () => void): this; + on(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + on(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + on(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + once(event: string, listener: (...args: any[]) => void): this; + + /** + * Emitted when any notification from the V8 Inspector is received. + */ + once(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; + + /** + * Issued when new execution context is created. + */ + once(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + once(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + once(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + once(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + once(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + once(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + once(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + once(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine fails to parse the script. + */ + once(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + once(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + once(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine resumed execution. + */ + once(event: "Debugger.resumed", listener: () => void): this; + + /** + * Issued when new console message is added. + */ + once(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + once(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + once(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + once(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + once(event: "HeapProfiler.resetProfiles", listener: () => void): this; + once(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + once(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + once(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + prependListener(event: string, listener: (...args: any[]) => void): this; + + /** + * Emitted when any notification from the V8 Inspector is received. + */ + prependListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; + + /** + * Issued when new execution context is created. + */ + prependListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + prependListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + prependListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + prependListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + prependListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + prependListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + prependListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + prependListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine fails to parse the script. + */ + prependListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + prependListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + prependListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine resumed execution. + */ + prependListener(event: "Debugger.resumed", listener: () => void): this; + + /** + * Issued when new console message is added. + */ + prependListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + prependListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + prependListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + prependListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + prependListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + prependListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + prependListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + prependListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + + prependOnceListener(event: string, listener: (...args: any[]) => void): this; + + /** + * Emitted when any notification from the V8 Inspector is received. + */ + prependOnceListener(event: "inspectorNotification", listener: (message: InspectorNotification<{}>) => void): this; + + /** + * Issued when new execution context is created. + */ + prependOnceListener(event: "Runtime.executionContextCreated", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when execution context is destroyed. + */ + prependOnceListener(event: "Runtime.executionContextDestroyed", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when all executionContexts were cleared in browser + */ + prependOnceListener(event: "Runtime.executionContextsCleared", listener: () => void): this; + + /** + * Issued when exception was thrown and unhandled. + */ + prependOnceListener(event: "Runtime.exceptionThrown", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when unhandled exception was revoked. + */ + prependOnceListener(event: "Runtime.exceptionRevoked", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when console API was called. + */ + prependOnceListener(event: "Runtime.consoleAPICalled", listener: (message: InspectorNotification) => void): this; + + /** + * Issued when object should be inspected (for example, as a result of inspect() command line API call). + */ + prependOnceListener(event: "Runtime.inspectRequested", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine parses script. This event is also fired for all known and uncollected scripts upon enabling debugger. + */ + prependOnceListener(event: "Debugger.scriptParsed", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when virtual machine fails to parse the script. + */ + prependOnceListener(event: "Debugger.scriptFailedToParse", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when breakpoint is resolved to an actual script and location. + */ + prependOnceListener(event: "Debugger.breakpointResolved", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine stopped on breakpoint or exception or any other stop criteria. + */ + prependOnceListener(event: "Debugger.paused", listener: (message: InspectorNotification) => void): this; + + /** + * Fired when the virtual machine resumed execution. + */ + prependOnceListener(event: "Debugger.resumed", listener: () => void): this; + + /** + * Issued when new console message is added. + */ + prependOnceListener(event: "Console.messageAdded", listener: (message: InspectorNotification) => void): this; + + /** + * Sent when new profile recording is started using console.profile() call. + */ + prependOnceListener(event: "Profiler.consoleProfileStarted", listener: (message: InspectorNotification) => void): this; + + prependOnceListener(event: "Profiler.consoleProfileFinished", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "HeapProfiler.addHeapSnapshotChunk", listener: (message: InspectorNotification) => void): this; + prependOnceListener(event: "HeapProfiler.resetProfiles", listener: () => void): this; + prependOnceListener(event: "HeapProfiler.reportHeapSnapshotProgress", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend regularly sends a current value for last seen object id and corresponding timestamp. If the were changes in the heap since last event then one or more heapStatsUpdate events will be sent before a new lastSeenObjectId event. + */ + prependOnceListener(event: "HeapProfiler.lastSeenObjectId", listener: (message: InspectorNotification) => void): this; + + /** + * If heap objects tracking has been started then backend may send update for one or more fragments + */ + prependOnceListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification) => void): this; + } + + // Top Level API + + /** + * Activate inspector on host and port. Equivalent to node --inspect=[[host:]port], but can be done programatically after node has started. + * If wait is true, will block until a client has connected to the inspect port and flow control has been passed to the debugger client. + * @param port Port to listen on for inspector connections. Optional, defaults to what was specified on the CLI. + * @param host Host to listen on for inspector connections. Optional, defaults to what was specified on the CLI. + * @param wait Block until a client has connected. Optional, defaults to false. + */ + export function open(port?: number, host?: string, wait?: boolean): void; + + /** + * Deactivate the inspector. Blocks until there are no active connections. + */ + export function close(): void; + + /** + * Return the URL of the active inspector, or undefined if there is none. + */ + export function url(): string; +} diff --git a/types/node/v9/node-tests.ts b/types/node/v9/node-tests.ts new file mode 100644 index 0000000000..7a055c620e --- /dev/null +++ b/types/node/v9/node-tests.ts @@ -0,0 +1,4010 @@ +import assert = require("assert"); +import * as fs from "fs"; +import * as events from "events"; +import events2 = require("events"); +import * as zlib from "zlib"; +import * as url from "url"; +import * as util from "util"; +import * as crypto from "crypto"; +import * as tls from "tls"; +import * as http from "http"; +import * as https from "https"; +import * as net from "net"; +import * as tty from "tty"; +import * as dgram from "dgram"; +import * as querystring from "querystring"; +import * as path from "path"; +import * as readline from "readline"; +import * as childProcess from "child_process"; +import * as cluster from "cluster"; +import * as os from "os"; +import * as vm from "vm"; +import * as console2 from "console"; +import * as string_decoder from "string_decoder"; +import * as stream from "stream"; +import * as timers from "timers"; +import * as repl from "repl"; +import * as v8 from "v8"; +import * as dns from "dns"; +import * as async_hooks from "async_hooks"; +import * as http2 from "http2"; +import * as inspector from "inspector"; +import * as perf_hooks from "perf_hooks"; +import Module = require("module"); + +// Specifically test buffer module regression. +import { Buffer as ImportedBuffer, SlowBuffer as ImportedSlowBuffer } from "buffer"; + +////////////////////////////////////////////////////////// +/// Global Tests : https://nodejs.org/api/global.html /// +////////////////////////////////////////////////////////// +namespace global_tests { + { + let x: NodeModule; + let y: NodeModule; + x.children.push(y); + x.parent = require.main; + require.main = y; + } +} + +////////////////////////////////////////////////////////// +/// Assert Tests : https://nodejs.org/api/assert.html /// +////////////////////////////////////////////////////////// + +namespace assert_tests { + { + assert(1 + 1 - 2 === 0, "The universe isn't how it should."); + + assert.deepEqual({ x: { y: 3 } }, { x: { y: 3 } }, "DEEP WENT DERP"); + + assert.deepStrictEqual({ a: 1 }, { a: 1 }, "uses === comparator"); + + assert.doesNotThrow(() => { + const b = false; + if (b) { throw new Error("a hammer at your face"); } + }, undefined, "What the...*crunch*"); + + assert.equal(3, "3", "uses == comparator"); + + assert.fail('stuff broke'); + + assert.fail('actual', 'expected', 'message'); + + assert.fail(1, 2, undefined, '>'); + + assert.ifError(0); + + assert.notDeepStrictEqual({ x: { y: "3" } }, { x: { y: 3 } }, "uses !== comparator"); + + assert.notEqual(1, 2, "uses != comparator"); + + assert.notStrictEqual(2, "2", "uses === comparator"); + + assert.ok(true); + assert.ok(1); + + assert.strictEqual(1, 1, "uses === comparator"); + + assert.throws(() => { throw new Error("a hammer at your face"); }, undefined, "DODGED IT"); + } +} + +//////////////////////////////////////////////////// +/// Events tests : http://nodejs.org/api/events.html +//////////////////////////////////////////////////// + +namespace events_tests { + let emitter: events.EventEmitter; + let event: string | symbol; + let listener: (...args: any[]) => void; + let any: any; + + { + let result: events.EventEmitter; + + result = emitter.addListener(event, listener); + result = emitter.on(event, listener); + result = emitter.once(event, listener); + result = emitter.prependListener(event, listener); + result = emitter.prependOnceListener(event, listener); + result = emitter.removeListener(event, listener); + result = emitter.removeAllListeners(); + result = emitter.removeAllListeners(event); + result = emitter.setMaxListeners(42); + } + + { + let result: number; + + result = events.EventEmitter.defaultMaxListeners; + result = events.EventEmitter.listenerCount(emitter, event); // deprecated + + result = emitter.getMaxListeners(); + result = emitter.listenerCount(event); + } + + { + let result: Function[]; + + result = emitter.listeners(event); + } + + { + let result: boolean; + + result = emitter.emit(event); + result = emitter.emit(event, any); + result = emitter.emit(event, any, any); + result = emitter.emit(event, any, any, any); + } + + { + let result: Array; + + result = emitter.eventNames(); + } + + { + class Networker extends events.EventEmitter { + constructor() { + super(); + + this.emit("mingling"); + } + } + } + + { + new events2(); + } +} + +//////////////////////////////////////////////////// +/// File system tests : http://nodejs.org/api/fs.html +//////////////////////////////////////////////////// + +namespace fs_tests { + { + fs.writeFile("thebible.txt", + "Do unto others as you would have them do unto you.", + assert.ifError); + + fs.write(1234, "test", () => { }); + + fs.writeFile("Harry Potter", + "\"You be wizzing, Harry,\" jived Dumbledore.", + { + encoding: "ascii" + }, + assert.ifError); + + fs.writeFile("testfile", "content", "utf8", assert.ifError); + + fs.writeFileSync("testfile", "content", "utf8"); + fs.writeFileSync("testfile", "content", { encoding: "utf8" }); + } + + { + fs.appendFile("testfile", "foobar", "utf8", assert.ifError); + fs.appendFile("testfile", "foobar", { encoding: "utf8" }, assert.ifError); + fs.appendFileSync("testfile", "foobar", "utf8"); + fs.appendFileSync("testfile", "foobar", { encoding: "utf8" }); + } + + { + var content: string; + var buffer: Buffer; + var stringOrBuffer: string | Buffer; + var nullEncoding: string | null = null; + var stringEncoding: string | null = 'utf8'; + + content = fs.readFileSync('testfile', 'utf8'); + content = fs.readFileSync('testfile', { encoding: 'utf8' }); + stringOrBuffer = fs.readFileSync('testfile', stringEncoding); + stringOrBuffer = fs.readFileSync('testfile', { encoding: stringEncoding }); + + buffer = fs.readFileSync('testfile'); + buffer = fs.readFileSync('testfile', null); + buffer = fs.readFileSync('testfile', { encoding: null }); + stringOrBuffer = fs.readFileSync('testfile', nullEncoding); + stringOrBuffer = fs.readFileSync('testfile', { encoding: nullEncoding }); + + buffer = fs.readFileSync('testfile', { flag: 'r' }); + + fs.readFile('testfile', 'utf8', (err, data) => content = data); + fs.readFile('testfile', { encoding: 'utf8' }, (err, data) => content = data); + fs.readFile('testfile', stringEncoding, (err, data) => stringOrBuffer = data); + fs.readFile('testfile', { encoding: stringEncoding }, (err, data) => stringOrBuffer = data); + + fs.readFile('testfile', (err, data) => buffer = data); + fs.readFile('testfile', null, (err, data) => buffer = data); + fs.readFile('testfile', { encoding: null }, (err, data) => buffer = data); + fs.readFile('testfile', nullEncoding, (err, data) => stringOrBuffer = data); + fs.readFile('testfile', { encoding: nullEncoding }, (err, data) => stringOrBuffer = data); + + fs.readFile('testfile', { flag: 'r' }, (err, data) => buffer = data); + } + + { + var errno: number; + fs.readFile('testfile', (err, data) => { + if (err && err.errno) { + errno = err.errno; + } + }); + } + + { + let listS: string[]; + listS = fs.readdirSync('path'); + listS = fs.readdirSync('path', { encoding: 'utf8' }); + listS = fs.readdirSync('path', { encoding: null }); + listS = fs.readdirSync('path', { encoding: undefined }); + listS = fs.readdirSync('path', 'utf8'); + listS = fs.readdirSync('path', null); + listS = fs.readdirSync('path', undefined); + + let listB: Buffer[]; + listB = fs.readdirSync('path', { encoding: 'buffer' }); + listB = fs.readdirSync("path", 'buffer'); + + let enc = 'buffer'; + fs.readdirSync('path', { encoding: enc }); // $ExpectType string[] | Buffer[] + fs.readdirSync('path', { }); // $ExpectType string[] | Buffer[] + } + + { + fs.mkdtemp('/tmp/foo-', (err, folder) => { + console.log(folder); + // Prints: /tmp/foo-itXde2 + }); + } + + { + var tempDir: string; + tempDir = fs.mkdtempSync('/tmp/foo-'); + } + + { + fs.watch('/tmp/foo-', (event, filename) => { + console.log(event, filename); + }); + + fs.watch('/tmp/foo-', 'utf8', (event, filename) => { + console.log(event, filename); + }); + + fs.watch('/tmp/foo-', { + recursive: true, + persistent: true, + encoding: 'utf8' + }, (event, filename) => { + console.log(event, filename); + }); + } + + { + fs.access('/path/to/folder', (err) => { }); + + fs.access(Buffer.from(''), (err) => { }); + + fs.access('/path/to/folder', fs.constants.F_OK | fs.constants.R_OK, (err) => { }); + + fs.access(Buffer.from(''), fs.constants.F_OK | fs.constants.R_OK, (err) => { }); + + fs.accessSync('/path/to/folder'); + + fs.accessSync(Buffer.from('')); + + fs.accessSync('path/to/folder', fs.constants.W_OK | fs.constants.X_OK); + + fs.accessSync(Buffer.from(''), fs.constants.W_OK | fs.constants.X_OK); + } + + { + let s: string; + let b: Buffer; + fs.readlink('/path/to/folder', (err, linkString) => s = linkString); + fs.readlink('/path/to/folder', undefined, (err, linkString) => s = linkString); + fs.readlink('/path/to/folder', 'utf8', (err, linkString) => s = linkString); + fs.readlink('/path/to/folder', 'buffer', (err, linkString) => b = linkString); + fs.readlink('/path/to/folder', s, (err, linkString) => typeof linkString === 'string' ? s = linkString : b = linkString); + fs.readlink('/path/to/folder', {}, (err, linkString) => s = linkString); + fs.readlink('/path/to/folder', { encoding: undefined }, (err, linkString) => s = linkString); + fs.readlink('/path/to/folder', { encoding: 'utf8' }, (err, linkString) => s = linkString); + fs.readlink('/path/to/folder', { encoding: 'buffer' }, (err, linkString) => b = linkString); + fs.readlink('/path/to/folder', { encoding: s }, (err, linkString) => typeof linkString === "string" ? s = linkString : b = linkString); + + s = fs.readlinkSync('/path/to/folder'); + s = fs.readlinkSync('/path/to/folder', undefined); + s = fs.readlinkSync('/path/to/folder', 'utf8'); + b = fs.readlinkSync('/path/to/folder', 'buffer'); + const v1 = fs.readlinkSync('/path/to/folder', s); + typeof v1 === "string" ? s = v1 : b = v1; + + s = fs.readlinkSync('/path/to/folder', {}); + s = fs.readlinkSync('/path/to/folder', { encoding: undefined }); + s = fs.readlinkSync('/path/to/folder', { encoding: 'utf8' }); + b = fs.readlinkSync('/path/to/folder', { encoding: 'buffer' }); + const v2 = fs.readlinkSync('/path/to/folder', { encoding: s }); + typeof v2 === "string" ? s = v2 : b = v2; + } + + { + let s: string; + let b: Buffer; + fs.realpath('/path/to/folder', (err, resolvedPath) => s = resolvedPath); + fs.realpath('/path/to/folder', undefined, (err, resolvedPath) => s = resolvedPath); + fs.realpath('/path/to/folder', 'utf8', (err, resolvedPath) => s = resolvedPath); + fs.realpath('/path/to/folder', 'buffer', (err, resolvedPath) => b = resolvedPath); + fs.realpath('/path/to/folder', s, (err, resolvedPath) => typeof resolvedPath === 'string' ? s = resolvedPath : b = resolvedPath); + fs.realpath('/path/to/folder', {}, (err, resolvedPath) => s = resolvedPath); + fs.realpath('/path/to/folder', { encoding: undefined }, (err, resolvedPath) => s = resolvedPath); + fs.realpath('/path/to/folder', { encoding: 'utf8' }, (err, resolvedPath) => s = resolvedPath); + fs.realpath('/path/to/folder', { encoding: 'buffer' }, (err, resolvedPath) => b = resolvedPath); + fs.realpath('/path/to/folder', { encoding: s }, (err, resolvedPath) => typeof resolvedPath === "string" ? s = resolvedPath : b = resolvedPath); + + s = fs.realpathSync('/path/to/folder'); + s = fs.realpathSync('/path/to/folder', undefined); + s = fs.realpathSync('/path/to/folder', 'utf8'); + b = fs.realpathSync('/path/to/folder', 'buffer'); + const v1 = fs.realpathSync('/path/to/folder', s); + typeof v1 === "string" ? s = v1 : b = v1; + + s = fs.realpathSync('/path/to/folder', {}); + s = fs.realpathSync('/path/to/folder', { encoding: undefined }); + s = fs.realpathSync('/path/to/folder', { encoding: 'utf8' }); + b = fs.realpathSync('/path/to/folder', { encoding: 'buffer' }); + const v2 = fs.realpathSync('/path/to/folder', { encoding: s }); + typeof v2 === "string" ? s = v2 : b = v2; + + // native + fs.realpath.native('/path/to/folder', (err, resolvedPath) => s = resolvedPath); + fs.realpath.native('/path/to/folder', undefined, (err, resolvedPath) => s = resolvedPath); + fs.realpath.native('/path/to/folder', 'utf8', (err, resolvedPath) => s = resolvedPath); + fs.realpath.native('/path/to/folder', 'buffer', (err, resolvedPath) => b = resolvedPath); + fs.realpath.native('/path/to/folder', s, (err, resolvedPath) => typeof resolvedPath === 'string' ? s = resolvedPath : b = resolvedPath); + fs.realpath.native('/path/to/folder', {}, (err, resolvedPath) => s = resolvedPath); + fs.realpath.native('/path/to/folder', { encoding: undefined }, (err, resolvedPath) => s = resolvedPath); + fs.realpath.native('/path/to/folder', { encoding: 'utf8' }, (err, resolvedPath) => s = resolvedPath); + fs.realpath.native('/path/to/folder', { encoding: 'buffer' }, (err, resolvedPath) => b = resolvedPath); + fs.realpath.native('/path/to/folder', { encoding: s }, (err, resolvedPath) => typeof resolvedPath === "string" ? s = resolvedPath : b = resolvedPath); + + s = fs.realpathSync.native('/path/to/folder'); + s = fs.realpathSync.native('/path/to/folder', undefined); + s = fs.realpathSync.native('/path/to/folder', 'utf8'); + b = fs.realpathSync.native('/path/to/folder', 'buffer'); + const v3 = fs.realpathSync.native('/path/to/folder', s); + typeof v3 === "string" ? s = v3 : b = v3; + + s = fs.realpathSync.native('/path/to/folder', {}); + s = fs.realpathSync.native('/path/to/folder', { encoding: undefined }); + s = fs.realpathSync.native('/path/to/folder', { encoding: 'utf8' }); + b = fs.realpathSync.native('/path/to/folder', { encoding: 'buffer' }); + const v4 = fs.realpathSync.native('/path/to/folder', { encoding: s }); + typeof v4 === "string" ? s = v4 : b = v4; + } + + { + fs.copyFile('/path/to/src', '/path/to/dest', (err) => console.error(err)); + fs.copyFile('/path/to/src', '/path/to/dest', fs.constants.COPYFILE_EXCL, (err) => console.error(err)); + + fs.copyFileSync('/path/to/src', '/path/to/dest', fs.constants.COPYFILE_EXCL); + + const cf = util.promisify(fs.copyFile); + cf('/path/to/src', '/path/to/dest', fs.constants.COPYFILE_EXCL).then(console.log); + } +} + +/////////////////////////////////////////////////////// +/// Buffer tests : https://nodejs.org/api/buffer.html +/////////////////////////////////////////////////////// + +function bufferTests() { + var utf8Buffer = new Buffer('test'); + var base64Buffer = new Buffer('', 'base64'); + var octets: Uint8Array = null; + var octetBuffer = new Buffer(octets); + var sharedBuffer = new Buffer(octets.buffer); + var copiedBuffer = new Buffer(utf8Buffer); + console.log(Buffer.isBuffer(octetBuffer)); + console.log(Buffer.isEncoding('utf8')); + console.log(Buffer.byteLength('xyz123')); + console.log(Buffer.byteLength('xyz123', 'ascii')); + var result1 = Buffer.concat([utf8Buffer, base64Buffer]); + var result2 = Buffer.concat([utf8Buffer, base64Buffer], 9999999); + + // Class Methods: Buffer.swap16(), Buffer.swa32(), Buffer.swap64() + { + const buf = Buffer.from([0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8]); + buf.swap16(); + buf.swap32(); + buf.swap64(); + } + + // Class Method: Buffer.from(data) + { + // Array + const buf1: Buffer = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]); + // Buffer + const buf2: Buffer = Buffer.from(buf1); + // String + const buf3: Buffer = Buffer.from('this is a tést'); + // ArrayBuffer + const arr: Uint16Array = new Uint16Array(2); + arr[0] = 5000; + arr[1] = 4000; + const buf4: Buffer = Buffer.from(arr.buffer); + } + + // Class Method: Buffer.from(arrayBuffer[, byteOffset[, length]]) + { + const arr: Uint16Array = new Uint16Array(2); + arr[0] = 5000; + arr[1] = 4000; + + let buf: Buffer; + buf = Buffer.from(arr.buffer, 1); + buf = Buffer.from(arr.buffer, 0, 1); + } + + // Class Method: Buffer.from(str[, encoding]) + { + const buf2: Buffer = Buffer.from('7468697320697320612074c3a97374', 'hex'); + } + + // Class Method: Buffer.alloc(size[, fill[, encoding]]) + { + const buf1: Buffer = Buffer.alloc(5); + const buf2: Buffer = Buffer.alloc(5, 'a'); + const buf3: Buffer = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64'); + } + // Class Method: Buffer.allocUnsafe(size) + { + const buf: Buffer = Buffer.allocUnsafe(5); + } + // Class Method: Buffer.allocUnsafeSlow(size) + { + const buf: Buffer = Buffer.allocUnsafeSlow(10); + } + + // Class Method byteLenght + { + let len: number; + len = Buffer.byteLength("foo"); + len = Buffer.byteLength("foo", "utf8"); + + const b = Buffer.from("bar"); + len = Buffer.byteLength(b); + len = Buffer.byteLength(b, "utf16le"); + + const ab = new ArrayBuffer(15); + len = Buffer.byteLength(ab); + len = Buffer.byteLength(ab, "ascii"); + + const dv = new DataView(ab); + len = Buffer.byteLength(dv); + len = Buffer.byteLength(dv, "utf16le"); + } + + // Class Method poolSize + { + let s: number; + s = Buffer.poolSize; + Buffer.poolSize = 4096; + } + + // Test that TS 1.6 works with the 'as Buffer' annotation + // on isBuffer. + var a: Buffer | number; + a = new Buffer(10); + if (Buffer.isBuffer(a)) { + a.writeUInt8(3, 4); + } + + // write* methods return offsets. + var b = new Buffer(16); + var result: number = b.writeUInt32LE(0, 0); + result = b.writeUInt16LE(0, 4); + result = b.writeUInt8(0, 6); + result = b.writeInt8(0, 7); + result = b.writeDoubleLE(0, 8); + + // fill returns the input buffer. + b.fill('a').fill('b'); + + { + let buffer = new Buffer('123'); + let index: number; + index = buffer.indexOf("23"); + index = buffer.indexOf("23", 1); + index = buffer.indexOf("23", 1, "utf8"); + index = buffer.indexOf(23); + index = buffer.indexOf(buffer); + } + + { + let buffer = new Buffer('123'); + let index: number; + index = buffer.lastIndexOf("23"); + index = buffer.lastIndexOf("23", 1); + index = buffer.lastIndexOf("23", 1, "utf8"); + index = buffer.lastIndexOf(23); + index = buffer.lastIndexOf(buffer); + } + + { + let buffer = new Buffer('123'); + let val: [number, number]; + + /* comment out for --target es5 + for (let entry of buffer.entries()) { + val = entry; + } + */ + } + + { + let buffer = new Buffer('123'); + let includes: boolean; + includes = buffer.includes("23"); + includes = buffer.includes("23", 1); + includes = buffer.includes("23", 1, "utf8"); + includes = buffer.includes(23); + includes = buffer.includes(23, 1); + includes = buffer.includes(23, 1, "utf8"); + includes = buffer.includes(buffer); + includes = buffer.includes(buffer, 1); + includes = buffer.includes(buffer, 1, "utf8"); + } + + { + let buffer = new Buffer('123'); + let val: number; + + /* comment out for --target es5 + for (let key of buffer.keys()) { + val = key; + } + */ + } + + { + let buffer = new Buffer('123'); + let val: number; + + /* comment out for --target es5 + for (let value of buffer.values()) { + val = value; + } + */ + } + + // Imported Buffer from buffer module works properly + { + let b = new ImportedBuffer('123'); + b.writeUInt8(0, 6); + let sb = new ImportedSlowBuffer(43); + b.writeUInt8(0, 6); + } + + // Buffer has Uint8Array's buffer field (an ArrayBuffer). + { + let buffer = new Buffer('123'); + let octets = new Uint8Array(buffer.buffer); + } +} + +//////////////////////////////////////////////////// +/// Url tests : http://nodejs.org/api/url.html +//////////////////////////////////////////////////// + +namespace url_tests { + { + url.format(url.parse('http://www.example.com/xyz')); + + url.format('http://www.example.com/xyz'); + + // https://google.com/search?q=you're%20a%20lizard%2C%20gary + url.format({ + protocol: 'https', + host: "google.com", + pathname: 'search', + query: { q: "you're a lizard, gary" } + }); + + const myURL = new url.URL('https://a:b@你好你好?abc#foo'); + url.format(myURL, { fragment: false, unicode: true, auth: false }); + } + + { + const helloUrl = url.parse('http://example.com/?hello=world', true); + let helloQuery = helloUrl.query['hello']; + assert.equal(helloUrl.query['hello'], 'world'); + + let strUrl = url.parse('http://example.com/?hello=world'); + let queryStr: string = strUrl.query; + + strUrl = url.parse('http://example.com/?hello=world', false); + queryStr = strUrl.query; + + function getBoolean(): boolean { return false; } + const urlUrl = url.parse('http://example.com/?hello=world', getBoolean()); + if (typeof(urlUrl.query) === 'string') { + queryStr = urlUrl.query; + } else if (urlUrl.query) { + helloQuery = urlUrl.query['hello']; + } + } + + { + const ascii: string = url.domainToASCII('español.com'); + const unicode: string = url.domainToUnicode('xn--espaol-zwa.com'); + } + + { + let myURL = new url.URL('https://theuser:thepwd@example.org:81/foo/path?query=string#bar'); + assert.equal(myURL.hash, '#bar'); + assert.equal(myURL.host, 'example.org:81'); + assert.equal(myURL.hostname, 'example.org'); + assert.equal(myURL.href, 'https://theuser:thepwd@example.org:81/foo/path?query=string#bar'); + assert.equal(myURL.origin, 'https://example.org:81'); + assert.equal(myURL.password, 'thepwd'); + assert.equal(myURL.username, 'theuser'); + assert.equal(myURL.pathname, '/foo/path'); + assert.equal(myURL.port, "81"); + assert.equal(myURL.protocol, "https:"); + assert.equal(myURL.search, "?query=string"); + assert.equal(myURL.toString(), 'https://theuser:thepwd@example.org:81/foo/path?query=string#bar'); + assert(myURL.searchParams instanceof url.URLSearchParams); + + myURL.host = 'example.org:82'; + myURL.hostname = 'example.com'; + myURL.href = 'http://other.com'; + myURL.hash = 'baz'; + myURL.password = "otherpwd"; + myURL.username = "otheruser"; + myURL.pathname = "/otherPath"; + myURL.port = "82"; + myURL.protocol = "http"; + myURL.search = "a=b"; + assert.equal(myURL.href, 'http://otheruser:otherpwd@other.com:82/otherPath?a=b#baz'); + + myURL = new url.URL('/foo', 'https://example.org/'); + assert.equal(myURL.href, 'https://example.org/foo'); + assert.equal(myURL.toJSON(), myURL.href); + } + + { + const searchParams = new url.URLSearchParams('abc=123'); + + assert.equal(searchParams.toString(), 'abc=123'); + searchParams.forEach((value: string, name: string): void => { + assert.equal(name, 'abc'); + assert.equal(value, '123'); + }); + + assert.equal(searchParams.get('abc'), '123'); + + searchParams.append('abc', 'xyz'); + + assert.deepEqual(searchParams.getAll('abc'), ['123', 'xyz']); + + const entries = searchParams.entries(); + assert.deepEqual(entries.next(), { value: ["abc", "123"], done: false }); + assert.deepEqual(entries.next(), { value: ["abc", "xyz"], done: false }); + assert.deepEqual(entries.next(), { value: undefined, done: true }); + + const keys = searchParams.keys(); + assert.deepEqual(keys.next(), { value: "abc", done: false }); + assert.deepEqual(keys.next(), { value: "abc", done: false }); + assert.deepEqual(keys.next(), { value: undefined, done: true }); + + const values = searchParams.values(); + assert.deepEqual(values.next(), { value: "123", done: false }); + assert.deepEqual(values.next(), { value: "xyz", done: false }); + assert.deepEqual(values.next(), { value: undefined, done: true }); + + searchParams.set('abc', 'b'); + assert.deepEqual(searchParams.getAll('abc'), ['b']); + + searchParams.delete('a'); + assert(!searchParams.has('a')); + assert.equal(searchParams.get('a'), null); + + searchParams.sort(); + } + + { + const searchParams = new url.URLSearchParams({ + user: 'abc', + query: ['first', 'second'] + }); + + assert.equal(searchParams.toString(), 'user=abc&query=first%2Csecond'); + assert.deepEqual(searchParams.getAll('query'), ['first,second']); + } + + { + // Using an array + let params = new url.URLSearchParams([ + ['user', 'abc'], + ['query', 'first'], + ['query', 'second'] + ]); + assert.equal(params.toString(), 'user=abc&query=first&query=second'); + } +} + +///////////////////////////////////////////////////// +/// util tests : https://nodejs.org/api/util.html /// +///////////////////////////////////////////////////// + +namespace util_tests { + { + // Old and new util.inspect APIs + util.inspect(["This is nice"], false, 5); + util.inspect(["This is nice"], false, null); + util.inspect(["This is nice"], { + colors: true, + depth: 5, + customInspect: false, + showProxy: true, + maxArrayLength: 10, + breakLength: 20 + }); + util.inspect(["This is nice"], { + colors: true, + depth: null, + customInspect: false, + showProxy: true, + maxArrayLength: null, + breakLength: Infinity + }); + assert(typeof util.inspect.custom === 'symbol'); + + // util.callbackify + // tslint:disable-next-line no-unnecessary-class + class callbackifyTest { + static fn(): Promise { + assert(arguments.length === 0); + + return Promise.resolve(); + } + + static fnE(): Promise { + assert(arguments.length === 0); + + return Promise.reject(new Error('fail')); + } + + static fnT1(arg1: string): Promise { + assert(arguments.length === 1 && arg1 === 'parameter'); + + return Promise.resolve(); + } + + static fnT1E(arg1: string): Promise { + assert(arguments.length === 1 && arg1 === 'parameter'); + + return Promise.reject(new Error('fail')); + } + + static fnTResult(): Promise { + assert(arguments.length === 0); + + return Promise.resolve('result'); + } + + static fnTResultE(): Promise { + assert(arguments.length === 0); + + return Promise.reject(new Error('fail')); + } + + static fnT1TResult(arg1: string): Promise { + assert(arguments.length === 1 && arg1 === 'parameter'); + + return Promise.resolve('result'); + } + + static fnT1TResultE(arg1: string): Promise { + assert(arguments.length === 1 && arg1 === 'parameter'); + + return Promise.reject(new Error('fail')); + } + + static test(): void { + var cfn = util.callbackify(this.fn); + var cfnE = util.callbackify(this.fnE); + var cfnT1 = util.callbackify(this.fnT1); + var cfnT1E = util.callbackify(this.fnT1E); + var cfnTResult = util.callbackify(this.fnTResult); + var cfnTResultE = util.callbackify(this.fnTResultE); + var cfnT1TResult = util.callbackify(this.fnT1TResult); + var cfnT1TResultE = util.callbackify(this.fnT1TResultE); + + cfn((err: NodeJS.ErrnoException, ...args: string[]) => assert(err === null && args.length === 1 && args[0] === undefined)); + cfnE((err: NodeJS.ErrnoException, ...args: string[]) => assert(err.message === 'fail' && args.length === 0)); + cfnT1('parameter', (err: NodeJS.ErrnoException, ...args: string[]) => assert(err === null && args.length === 1 && args[0] === undefined)); + cfnT1E('parameter', (err: NodeJS.ErrnoException, ...args: string[]) => assert(err.message === 'fail' && args.length === 0)); + cfnTResult((err: NodeJS.ErrnoException, ...args: string[]) => assert(err === null && args.length === 1 && args[0] === 'result')); + cfnTResultE((err: NodeJS.ErrnoException, ...args: string[]) => assert(err.message === 'fail' && args.length === 0)); + cfnT1TResult('parameter', (err: NodeJS.ErrnoException, ...args: string[]) => assert(err === null && args.length === 1 && args[0] === 'result')); + cfnT1TResultE('parameter', (err: NodeJS.ErrnoException, ...args: string[]) => assert(err.message === 'fail' && args.length === 0)); + } + } + callbackifyTest.test(); + + // util.promisify + var readPromised = util.promisify(fs.readFile); + var sampleRead: Promise = readPromised(__filename).then((data: Buffer): void => { }).catch((error: Error): void => { }); + var arg0: () => Promise = util.promisify((cb: (err: Error, result: number) => void): void => { }); + var arg0NoResult: () => Promise = util.promisify((cb: (err: Error) => void): void => { }); + var arg1: (arg: string) => Promise = util.promisify((arg: string, cb: (err: Error, result: number) => void): void => { }); + var arg1NoResult: (arg: string) => Promise = util.promisify((arg: string, cb: (err: Error) => void): void => { }); + assert(typeof util.promisify.custom === 'symbol'); + // util.deprecate + const foo = () => {}; + // $ExpectType () => void + util.deprecate(foo, 'foo() is deprecated, use bar() instead'); + // $ExpectType (fn: T, message: string) => T + util.deprecate(util.deprecate, 'deprecate() is deprecated, use bar() instead'); + } +} + +//////////////////////////////////////////////////// +/// Stream tests : http://nodejs.org/api/stream.html +//////////////////////////////////////////////////// + +// http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options +function stream_readable_pipe_test() { + var rs = fs.createReadStream(Buffer.from('file.txt')); + var r = fs.createReadStream('file.txt'); + var z = zlib.createGzip({ finishFlush: zlib.constants.Z_FINISH }); + var w = fs.createWriteStream('file.txt.gz'); + + assert(typeof z.bytesRead === 'number'); + assert(typeof r.bytesRead === 'number'); + assert(typeof r.path === 'string'); + assert(rs.path instanceof Buffer); + + r.pipe(z).pipe(w); + + z.flush(); + r.close(); + z.close(); + rs.close(); +} + +// helpers +const compressMe = new Buffer("some data"); +const compressMeString = "compress me!"; + +zlib.deflate(compressMe, (err: Error, result: Buffer) => zlib.inflate(result, (err: Error, result: Buffer) => result)); +zlib.deflate(compressMe, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => zlib.inflate(result, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => result)); +zlib.deflate(compressMeString, (err: Error, result: Buffer) => zlib.inflate(result, (err: Error, result: Buffer) => result)); +zlib.deflate(compressMeString, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => zlib.inflate(result, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => result)); +const inflated = zlib.inflateSync(zlib.deflateSync(compressMe)); +const inflatedString = zlib.inflateSync(zlib.deflateSync(compressMeString)); + +zlib.deflateRaw(compressMe, (err: Error, result: Buffer) => zlib.inflateRaw(result, (err: Error, result: Buffer) => result)); +zlib.deflateRaw(compressMe, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => zlib.inflateRaw(result, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => result)); +zlib.deflateRaw(compressMeString, (err: Error, result: Buffer) => zlib.inflateRaw(result, (err: Error, result: Buffer) => result)); +zlib.deflateRaw(compressMeString, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => zlib.inflateRaw(result, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => result)); +const inflatedRaw: Buffer = zlib.inflateRawSync(zlib.deflateRawSync(compressMe)); +const inflatedRawString: Buffer = zlib.inflateRawSync(zlib.deflateRawSync(compressMeString)); + +zlib.gzip(compressMe, (err: Error, result: Buffer) => zlib.gunzip(result, (err: Error, result: Buffer) => result)); +zlib.gzip(compressMe, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => zlib.gunzip(result, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => result)); +const gunzipped: Buffer = zlib.gunzipSync(zlib.gzipSync(compressMe)); + +zlib.unzip(compressMe, (err: Error, result: Buffer) => result); +zlib.unzip(compressMe, { finishFlush: zlib.Z_SYNC_FLUSH }, (err: Error, result: Buffer) => result); +const unzipped: Buffer = zlib.unzipSync(compressMe); + +// Simplified constructors +function simplified_stream_ctor_test() { + new stream.Readable({ + read(size) { + size.toFixed(); + }, + destroy(error) { + error.stack; + } + }); + + new stream.Writable({ + write(chunk, enc, cb) { + chunk.slice(1); + enc.charAt(0); + cb(); + }, + writev(chunks, cb) { + chunks[0].chunk.slice(0); + chunks[0].encoding.charAt(0); + cb(); + }, + destroy(error) { + error.stack; + }, + final(cb) { + cb(null); + } + }); + + new stream.Duplex({ + read(size) { + size.toFixed(); + }, + write(chunk, enc, cb) { + chunk.slice(1); + enc.charAt(0); + cb(); + }, + writev(chunks, cb) { + chunks[0].chunk.slice(0); + chunks[0].encoding.charAt(0); + cb(); + }, + readableObjectMode: true, + writableObjectMode: true + }); + + new stream.Transform({ + transform(chunk, enc, cb) { + chunk.slice(1); + enc.charAt(0); + cb(); + }, + flush(cb) { + cb(); + }, + read(size) { + size.toFixed(); + }, + write(chunk, enc, cb) { + chunk.slice(1); + enc.charAt(0); + cb(); + }, + writev(chunks, cb) { + chunks[0].chunk.slice(0); + chunks[0].encoding.charAt(0); + cb(); + }, + destroy(error) { + error.stack; + }, + allowHalfOpen: true, + readableObjectMode: true, + writableObjectMode: true + }); +} + +//////////////////////////////////////////////////////// +/// Crypto tests : http://nodejs.org/api/crypto.html /// +//////////////////////////////////////////////////////// + +namespace crypto_tests { + { + // crypto_hash_string_test + var hashResult: string = crypto.createHash('md5').update('world').digest('hex'); + } + + { + // crypto_hash_buffer_test + var hashResult: string = crypto.createHash('md5') + .update(new Buffer('world')).digest('hex'); + } + + { + // crypto_hash_dataview_test + var hashResult: string = crypto.createHash('md5') + .update(new DataView(new Buffer('world').buffer)).digest('hex'); + } + + { + // crypto_hmac_string_test + var hmacResult: string = crypto.createHmac('md5', 'hello').update('world').digest('hex'); + } + + { + // crypto_hmac_buffer_test + var hmacResult: string = crypto.createHmac('md5', 'hello') + .update(new Buffer('world')).digest('hex'); + } + + { + // crypto_hmac_dataview_test + var hmacResult: string = crypto.createHmac('md5', 'hello') + .update(new DataView(new Buffer('world').buffer)).digest('hex'); + } + + { + let hmac: crypto.Hmac; + (hmac = crypto.createHmac('md5', 'hello')).end('world', 'utf8', () => { + let hash: Buffer | string = hmac.read(); + }); + } + + { + // crypto_cipher_decipher_string_test + let key: Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7]); + let clearText: string = "This is the clear text."; + let cipher: crypto.Cipher = crypto.createCipher("aes-128-ecb", key); + let cipherText: string = cipher.update(clearText, "utf8", "hex"); + cipherText += cipher.final("hex"); + + let decipher: crypto.Decipher = crypto.createDecipher("aes-128-ecb", key); + let clearText2: string = decipher.update(cipherText, "hex", "utf8"); + clearText2 += decipher.final("utf8"); + + assert.equal(clearText2, clearText); + } + + { + // crypto_cipher_decipher_buffer_test + let key: Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7]); + let clearText: Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4]); + let cipher: crypto.Cipher = crypto.createCipher("aes-128-ecb", key); + let cipherBuffers: Buffer[] = []; + cipherBuffers.push(cipher.update(clearText)); + cipherBuffers.push(cipher.final()); + + let cipherText: Buffer = Buffer.concat(cipherBuffers); + + let decipher: crypto.Decipher = crypto.createDecipher("aes-128-ecb", key); + let decipherBuffers: Buffer[] = []; + decipherBuffers.push(decipher.update(cipherText)); + decipherBuffers.push(decipher.final()); + + let clearText2: Buffer = Buffer.concat(decipherBuffers); + + assert.deepEqual(clearText2, clearText); + } + + { + // crypto_cipher_decipher_dataview_test + let key: Buffer = new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7]); + let clearText: DataView = new DataView( + new Buffer([1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4]).buffer); + let cipher: crypto.Cipher = crypto.createCipher("aes-128-ecb", key); + let cipherBuffers: Buffer[] = []; + cipherBuffers.push(cipher.update(clearText)); + cipherBuffers.push(cipher.final()); + + let cipherText: DataView = new DataView(Buffer.concat(cipherBuffers).buffer); + + let decipher: crypto.Decipher = crypto.createDecipher("aes-128-ecb", key); + let decipherBuffers: Buffer[] = []; + decipherBuffers.push(decipher.update(cipherText)); + decipherBuffers.push(decipher.final()); + + let clearText2: Buffer = Buffer.concat(decipherBuffers); + + assert.deepEqual(clearText2, clearText); + } + + { + let buffer1: Buffer = new Buffer([1, 2, 3, 4, 5]); + let buffer2: Buffer = new Buffer([1, 2, 3, 4, 5]); + let buffer3: Buffer = new Buffer([5, 4, 3, 2, 1]); + + assert(crypto.timingSafeEqual(buffer1, buffer2)); + assert(!crypto.timingSafeEqual(buffer1, buffer3)); + } + + { + let buffer: Buffer = new Buffer(10); + crypto.randomFillSync(buffer); + crypto.randomFillSync(buffer, 2); + crypto.randomFillSync(buffer, 2, 3); + + crypto.randomFill(buffer, (err: Error, buf: Buffer) => void {}); + crypto.randomFill(buffer, 2, (err: Error, buf: Buffer) => void {}); + crypto.randomFill(buffer, 2, 3, (err: Error, buf: Buffer) => void {}); + + let arr: Uint8Array = new Uint8Array(10); + crypto.randomFillSync(arr); + crypto.randomFillSync(arr, 2); + crypto.randomFillSync(arr, 2, 3); + + crypto.randomFill(arr, (err: Error, buf: Uint8Array) => void {}); + crypto.randomFill(arr, 2, (err: Error, buf: Uint8Array) => void {}); + crypto.randomFill(arr, 2, 3, (err: Error, buf: Uint8Array) => void {}); + } +} + +////////////////////////////////////////////////// +/// TLS tests : http://nodejs.org/api/tls.html /// +////////////////////////////////////////////////// + +namespace tls_tests { + { + var ctx: tls.SecureContext = tls.createSecureContext({ + key: "NOT REALLY A KEY", + cert: "SOME CERTIFICATE", + }); + var blah = ctx.context; + + var connOpts: tls.ConnectionOptions = { + host: "127.0.0.1", + port: 55 + }; + var tlsSocket = tls.connect(connOpts); + + const ciphers: string[] = tls.getCiphers(); + const curve: string = tls.DEFAULT_ECDH_CURVE; + } + + { + let _server: tls.Server; + let _boolean: boolean; + let _func1 = (err: Error, resp: Buffer) => { }; + let _func2 = (err: Error, sessionData: any) => { }; + /** + * events.EventEmitter + * 1. tlsClientError + * 2. newSession + * 3. OCSPRequest + * 4. resumeSession + * 5. secureConnection + */ + + _server = _server.addListener("tlsClientError", (err, tlsSocket) => { + let _err: Error = err; + let _tlsSocket: tls.TLSSocket = tlsSocket; + }); + _server = _server.addListener("newSession", (sessionId, sessionData, callback) => { + let _sessionId: any = sessionId; + let _sessionData: any = sessionData; + let _func1 = callback; + }); + _server = _server.addListener("OCSPRequest", (certificate, issuer, callback) => { + let _certificate: Buffer = certificate; + let _issuer: Buffer = issuer; + let _callback: Function = callback; + }); + _server = _server.addListener("resumeSession", (sessionId, callback) => { + let _sessionId: any = sessionId; + let _func2 = callback; + }); + _server = _server.addListener("secureConnection", (tlsSocket) => { + let _tlsSocket: tls.TLSSocket = tlsSocket; + }); + + let _err: Error; + let _tlsSocket: tls.TLSSocket; + let _any: any; + let _func: Function; + let _buffer: Buffer; + _boolean = _server.emit("tlsClientError", _err, _tlsSocket); + _boolean = _server.emit("newSession", _any, _any, _func1); + _boolean = _server.emit("OCSPRequest", _buffer, _buffer, _func); + _boolean = _server.emit("resumeSession", _any, _func2); + _boolean = _server.emit("secureConnection", _tlsSocket); + + _server = _server.on("tlsClientError", (err, tlsSocket) => { + let _err: Error = err; + let _tlsSocket: tls.TLSSocket = tlsSocket; + }); + _server = _server.on("newSession", (sessionId, sessionData, callback) => { + let _sessionId: any = sessionId; + let _sessionData: any = sessionData; + let _func1 = callback; + }); + _server = _server.on("OCSPRequest", (certificate, issuer, callback) => { + let _certificate: Buffer = certificate; + let _issuer: Buffer = issuer; + let _callback: Function = callback; + }); + _server = _server.on("resumeSession", (sessionId, callback) => { + let _sessionId: any = sessionId; + let _func2 = callback; + }); + _server = _server.on("secureConnection", (tlsSocket) => { + let _tlsSocket: tls.TLSSocket = tlsSocket; + }); + + _server = _server.once("tlsClientError", (err, tlsSocket) => { + let _err: Error = err; + let _tlsSocket: tls.TLSSocket = tlsSocket; + }); + _server = _server.once("newSession", (sessionId, sessionData, callback) => { + let _sessionId: any = sessionId; + let _sessionData: any = sessionData; + let _func1 = callback; + }); + _server = _server.once("OCSPRequest", (certificate, issuer, callback) => { + let _certificate: Buffer = certificate; + let _issuer: Buffer = issuer; + let _callback: Function = callback; + }); + _server = _server.once("resumeSession", (sessionId, callback) => { + let _sessionId: any = sessionId; + let _func2 = callback; + }); + _server = _server.once("secureConnection", (tlsSocket) => { + let _tlsSocket: tls.TLSSocket = tlsSocket; + }); + + _server = _server.prependListener("tlsClientError", (err, tlsSocket) => { + let _err: Error = err; + let _tlsSocket: tls.TLSSocket = tlsSocket; + }); + _server = _server.prependListener("newSession", (sessionId, sessionData, callback) => { + let _sessionId: any = sessionId; + let _sessionData: any = sessionData; + let _func1 = callback; + }); + _server = _server.prependListener("OCSPRequest", (certificate, issuer, callback) => { + let _certificate: Buffer = certificate; + let _issuer: Buffer = issuer; + let _callback: Function = callback; + }); + _server = _server.prependListener("resumeSession", (sessionId, callback) => { + let _sessionId: any = sessionId; + let _func2 = callback; + }); + _server = _server.prependListener("secureConnection", (tlsSocket) => { + let _tlsSocket: tls.TLSSocket = tlsSocket; + }); + + _server = _server.prependOnceListener("tlsClientError", (err, tlsSocket) => { + let _err: Error = err; + let _tlsSocket: tls.TLSSocket = tlsSocket; + }); + _server = _server.prependOnceListener("newSession", (sessionId, sessionData, callback) => { + let _sessionId: any = sessionId; + let _sessionData: any = sessionData; + let _func1 = callback; + }); + _server = _server.prependOnceListener("OCSPRequest", (certificate, issuer, callback) => { + let _certificate: Buffer = certificate; + let _issuer: Buffer = issuer; + let _callback: Function = callback; + }); + _server = _server.prependOnceListener("resumeSession", (sessionId, callback) => { + let _sessionId: any = sessionId; + let _func2 = callback; + }); + _server = _server.prependOnceListener("secureConnection", (tlsSocket) => { + let _tlsSocket: tls.TLSSocket = tlsSocket; + }); + + // close callback parameter is optional + _server = _server.close(); + + // close callback parameter doesn't specify any arguments, so any + // function is acceptable + _server = _server.close(() => { }); + _server = _server.close((...args: any[]) => { }); + } + + { + let _TLSSocket: tls.TLSSocket; + let _boolean: boolean; + /** + * events.EventEmitter + * 1. close + * 2. error + * 3. listening + * 4. message + */ + + _TLSSocket = _TLSSocket.addListener("OCSPResponse", (response) => { + let _response: Buffer = response; + }); + _TLSSocket = _TLSSocket.addListener("secureConnect", () => { }); + + let _buffer: Buffer; + _boolean = _TLSSocket.emit("OCSPResponse", _buffer); + _boolean = _TLSSocket.emit("secureConnect"); + + _TLSSocket = _TLSSocket.on("OCSPResponse", (response) => { + let _response: Buffer = response; + }); + _TLSSocket = _TLSSocket.on("secureConnect", () => { }); + + _TLSSocket = _TLSSocket.once("OCSPResponse", (response) => { + let _response: Buffer = response; + }); + _TLSSocket = _TLSSocket.once("secureConnect", () => { }); + + _TLSSocket = _TLSSocket.prependListener("OCSPResponse", (response) => { + let _response: Buffer = response; + }); + _TLSSocket = _TLSSocket.prependListener("secureConnect", () => { }); + + _TLSSocket = _TLSSocket.prependOnceListener("OCSPResponse", (response) => { + let _response: Buffer = response; + }); + _TLSSocket = _TLSSocket.prependOnceListener("secureConnect", () => { }); + } +} + +//////////////////////////////////////////////////// +/// Http tests : http://nodejs.org/api/http.html /// +//////////////////////////////////////////////////// + +namespace http_tests { + // http Server + { + var server: http.Server = new http.Server(); + + // test public props + const maxHeadersCount: number = server.maxHeadersCount; + const timeout: number = server.timeout; + const listening: boolean = server.listening; + const keepAliveTimeout: number = server.keepAliveTimeout; + server.setTimeout().setTimeout(1000).setTimeout(() => {}).setTimeout(100, () => {}); + } + + // http IncomingMessage + // http ServerResponse + { + // incoming + var incoming: http.IncomingMessage = new http.IncomingMessage(new net.Socket()); + + incoming.setEncoding('utf8'); + + // stream + incoming.pause(); + incoming.resume(); + + // response + var res: http.ServerResponse = new http.ServerResponse(incoming); + + // test headers + res.setHeader('Content-Type', 'text/plain'); + var bool: boolean = res.hasHeader('Content-Type'); + var headers: string[] = res.getHeaderNames(); + + // trailers + res.addTrailers([ + ['x-fOo', 'xOxOxOx'], + ['x-foO', 'OxOxOxO'], + ['X-fOo', 'xOxOxOx'], + ['X-foO', 'OxOxOxO'] + ]); + res.addTrailers({ 'x-foo': 'bar' }); + + // writeHead + res.writeHead(200, 'OK\r\nContent-Type: text/html\r\n'); + res.writeHead(200, { 'Transfer-Encoding': 'chunked' }); + res.writeHead(200); + + // write string + res.write('Part of my res.'); + // write buffer + const chunk = Buffer.alloc(16390, 'Й'); + req.write(chunk); + res.write(chunk, 'hex'); + + // end + res.end("end msg"); + // without msg + res.end(); + + // flush + res.flushHeaders(); + } + + // http ClientRequest + { + var req: http.ClientRequest = new http.ClientRequest("https://www.google.com"); + var req: http.ClientRequest = new http.ClientRequest(new url.URL("https://www.google.com")); + var req: http.ClientRequest = new http.ClientRequest({ path: 'http://0.0.0.0' }); + + // header + req.setHeader('Content-Type', 'text/plain'); + var bool: boolean = req.hasHeader('Content-Type'); + var headers: string[] = req.getHeaderNames(); + req.removeHeader('Date'); + + // write + const chunk = Buffer.alloc(16390, 'Й'); + req.write(chunk); + req.write('a'); + req.end(); + + // abort + req.abort(); + + // connection + req.connection.on('pause', () => { }); + + // event + req.on('data', () => { }); + } + + { + // Status codes + var codeMessage = http.STATUS_CODES['400']; + var codeMessage = http.STATUS_CODES[400]; + } + + { + var agent: http.Agent = new http.Agent({ + keepAlive: true, + keepAliveMsecs: 10000, + maxSockets: Infinity, + maxFreeSockets: 256 + }); + + var agent: http.Agent = http.globalAgent; + + http.request({ agent: false }); + http.request({ agent }); + http.request({ agent: undefined }); + } + + { + http.request('http://www.example.com/xyz'); + } + + { + // Make sure .listen() and .close() return a Server instance + http.createServer().listen(0).close().address(); + net.createServer().listen(0).close().address(); + } + + { + var request = http.request({ path: 'http://0.0.0.0' }); + request.once('error', () => { }); + request.setNoDelay(true); + request.abort(); + } + + // http request options + { + const requestOpts: http.RequestOptions = { + timeout: 30000 + }; + + const clientArgs: http.ClientRequestArgs = { + timeout: 30000 + }; + } + + // http headers + { + const headers: http.IncomingHttpHeaders = { + 'content-type': 'application/json', + 'set-cookie': [ 'type=ninja', 'language=javascript' ] + }; + } +} + +////////////////////////////////////////////////////// +/// Https tests : http://nodejs.org/api/https.html /// +////////////////////////////////////////////////////// + +namespace https_tests { + var agent: https.Agent = new https.Agent({ + keepAlive: true, + keepAliveMsecs: 10000, + maxSockets: Infinity, + maxFreeSockets: 256, + maxCachedSessions: 100 + }); + + var agent: https.Agent = https.globalAgent; + + https.request({ + agent: false + }); + https.request({ + agent + }); + https.request({ + agent: undefined + }); + + https.request('http://www.example.com/xyz'); + + https.globalAgent.options.ca = []; + + { + const server = new https.Server(); + + const timeout: number = server.timeout; + const listening: boolean = server.listening; + const keepAliveTimeout: number = server.keepAliveTimeout; + server.setTimeout().setTimeout(1000).setTimeout(() => {}).setTimeout(100, () => {}); + } +} + +//////////////////////////////////////////////////// +/// TTY tests : http://nodejs.org/api/tty.html +//////////////////////////////////////////////////// + +namespace tty_tests { + let rs: tty.ReadStream; + let ws: tty.WriteStream; + + let rsIsRaw: boolean = rs.isRaw; + rs.setRawMode(true); + + let wsColumns: number = ws.columns; + let wsRows: number = ws.rows; + + let isTTY: boolean = tty.isatty(1); +} + +//////////////////////////////////////////////////// +/// Dgram tests : http://nodejs.org/api/dgram.html +//////////////////////////////////////////////////// + +namespace dgram_tests { + { + var ds: dgram.Socket = dgram.createSocket("udp4", (msg: Buffer, rinfo: dgram.RemoteInfo): void => { + }); + ds.bind(); + ds.bind(41234); + ds.bind(4123, 'localhost'); + ds.bind(4123, 'localhost', () => { }); + ds.bind(4123, () => { }); + ds.bind(() => { }); + var ai: dgram.AddressInfo = ds.address(); + ds.send(new Buffer("hello"), 0, 5, 5000, "127.0.0.1", (error: Error, bytes: number): void => { + }); + ds.send(new Buffer("hello"), 5000, "127.0.0.1"); + ds.setMulticastInterface("127.0.0.1"); + ds = dgram.createSocket({ type: "udp4", reuseAddr: true, recvBufferSize: 1000, sendBufferSize: 1000, lookup: dns.lookup }); + } + + { + let _socket: dgram.Socket; + let _boolean: boolean; + let _err: Error; + let _str: string; + let _rinfo: dgram.AddressInfo; + /** + * events.EventEmitter + * 1. close + * 2. error + * 3. listening + * 4. message + */ + + _socket = _socket.addListener("close", () => { }); + _socket = _socket.addListener("error", (err) => { + let _err: Error = err; + }); + _socket = _socket.addListener("listening", () => { }); + _socket = _socket.addListener("message", (msg, rinfo) => { + let _msg: Buffer = msg; + let _rinfo: dgram.AddressInfo = rinfo; + }); + + _boolean = _socket.emit("close"); + _boolean = _socket.emit("error", _err); + _boolean = _socket.emit("listening"); + _boolean = _socket.emit("message", _str, _rinfo); + + _socket = _socket.on("close", () => { }); + _socket = _socket.on("error", (err) => { + let _err: Error = err; + }); + _socket = _socket.on("listening", () => { }); + _socket = _socket.on("message", (msg, rinfo) => { + let _msg: Buffer = msg; + let _rinfo: dgram.AddressInfo = rinfo; + }); + + _socket = _socket.once("close", () => { }); + _socket = _socket.once("error", (err) => { + let _err: Error = err; + }); + _socket = _socket.once("listening", () => { }); + _socket = _socket.once("message", (msg, rinfo) => { + let _msg: Buffer = msg; + let _rinfo: dgram.AddressInfo = rinfo; + }); + + _socket = _socket.prependListener("close", () => { }); + _socket = _socket.prependListener("error", (err) => { + let _err: Error = err; + }); + _socket = _socket.prependListener("listening", () => { }); + _socket = _socket.prependListener("message", (msg, rinfo) => { + let _msg: Buffer = msg; + let _rinfo: dgram.AddressInfo = rinfo; + }); + + _socket = _socket.prependOnceListener("close", () => { }); + _socket = _socket.prependOnceListener("error", (err) => { + let _err: Error = err; + }); + _socket = _socket.prependOnceListener("listening", () => { }); + _socket = _socket.prependOnceListener("message", (msg, rinfo) => { + let _msg: Buffer = msg; + let _rinfo: dgram.AddressInfo = rinfo; + }); + } + + { + let ds: dgram.Socket = dgram.createSocket({ + type: 'udp4', + recvBufferSize: 10000, + sendBufferSize: 15000 + }); + + let size: number; + size = ds.getRecvBufferSize(); + ds.setRecvBufferSize(size); + size = ds.getSendBufferSize(); + ds.setSendBufferSize(size); + } +} + +//////////////////////////////////////////////////// +/// Querystring tests : https://nodejs.org/api/querystring.html +//////////////////////////////////////////////////// + +namespace querystring_tests { + interface SampleObject { a: string; b: number; } + + { + let obj: SampleObject; + let sep: string; + let eq: string; + let options: querystring.StringifyOptions; + let result: string; + + result = querystring.stringify(obj); + result = querystring.stringify(obj, sep); + result = querystring.stringify(obj, sep, eq); + result = querystring.stringify(obj, sep, eq); + result = querystring.stringify(obj, sep, eq, options); + } + + { + let str: string; + let sep: string; + let eq: string; + let options: querystring.ParseOptions; + let result: SampleObject; + + result = querystring.parse(str); + result = querystring.parse(str, sep); + result = querystring.parse(str, sep, eq); + result = querystring.parse(str, sep, eq, options); + } + + { + let str: string; + let result: string; + + result = querystring.escape(str); + result = querystring.unescape(str); + } +} + +//////////////////////////////////////////////////// +/// path tests : http://nodejs.org/api/path.html +//////////////////////////////////////////////////// + +namespace path_tests { + path.normalize('/foo/bar//baz/asdf/quux/..'); + + path.join('/foo', 'bar', 'baz/asdf', 'quux', '..'); + // returns + // '/foo/bar/baz/asdf' + + try { + path.join('foo', 'bar'); + } catch (error) { } + + path.resolve('foo/bar', '/tmp/file/', '..', 'a/../subfile'); + // Is similar to: + // + // cd foo/bar + // cd /tmp/file/ + // cd .. + // cd a/../subfile + // pwd + + path.resolve('/foo/bar', './baz'); + // returns + // '/foo/bar/baz' + + path.resolve('/foo/bar', '/tmp/file/'); + // returns + // '/tmp/file' + + path.resolve('wwwroot', 'static_files/png/', '../gif/image.gif'); + // if currently in /home/myself/node, it returns + // '/home/myself/node/wwwroot/static_files/gif/image.gif' + + path.isAbsolute('/foo/bar'); // true + path.isAbsolute('/baz/..'); // true + path.isAbsolute('qux/'); // false + path.isAbsolute('.'); // false + + path.isAbsolute('//server'); // true + path.isAbsolute('C:/foo/..'); // true + path.isAbsolute('bar\\baz'); // false + path.isAbsolute('.'); // false + + path.relative('C:\\orandea\\test\\aaa', 'C:\\orandea\\impl\\bbb'); + // returns + // '..\\..\\impl\\bbb' + + path.relative('/data/orandea/test/aaa', '/data/orandea/impl/bbb'); + // returns + // '../../impl/bbb' + + path.dirname('/foo/bar/baz/asdf/quux'); + // returns + // '/foo/bar/baz/asdf' + + path.basename('/foo/bar/baz/asdf/quux.html'); + // returns + // 'quux.html' + + path.basename('/foo/bar/baz/asdf/quux.html', '.html'); + // returns + // 'quux' + + path.extname('index.html'); + // returns + // '.html' + + path.extname('index.coffee.md'); + // returns + // '.md' + + path.extname('index.'); + // returns + // '.' + + path.extname('index'); + // returns + // '' + + 'foo/bar/baz'.split(path.sep); + // returns + // ['foo', 'bar', 'baz'] + + 'foo\\bar\\baz'.split(path.sep); + // returns + // ['foo', 'bar', 'baz'] + + process.env["PATH"]; // $ExpectType string + + path.parse('/home/user/dir/file.txt'); + // returns + // { + // root : "/", + // dir : "/home/user/dir", + // base : "file.txt", + // ext : ".txt", + // name : "file" + // } + + path.parse('C:\\path\\dir\\index.html'); + // returns + // { + // root : "C:\", + // dir : "C:\path\dir", + // base : "index.html", + // ext : ".html", + // name : "index" + // } + + path.format({ + root: "/", + dir: "/home/user/dir", + base: "file.txt", + ext: ".txt", + name: "file" + }); + // returns + // '/home/user/dir/file.txt' + + path.format({ + root: "/", + dir: "/home/user/dir", + ext: ".txt", + name: "file" + }); + // returns + // '/home/user/dir/file.txt' + + path.format({ + dir: "/home/user/dir", + base: "file.txt" + }); + // returns + // '/home/user/dir/file.txt' + + path.posix.format({ + root: "/", + dir: "/home/user/dir", + base: "file.txt", + ext: ".txt", + name: "file" + }); + // returns + // '/home/user/dir/file.txt' + + path.posix.format({ + dir: "/home/user/dir", + base: "file.txt" + }); + // returns + // '/home/user/dir/file.txt' + + path.win32.format({ + root: "C:\\", + dir: "C:\\home\\user\\dir", + ext: ".txt", + name: "file" + }); + // returns + // 'C:\home\user\dir\file.txt' + + path.win32.format({ + dir: "C:\\home\\user\\dir", + base: "file.txt" + }); + // returns + // 'C:\home\user\dir\file.txt' +} + +//////////////////////////////////////////////////// +/// readline tests : https://nodejs.org/api/readline.html +//////////////////////////////////////////////////// + +namespace readline_tests { + let rl: readline.ReadLine; + + { + let options: readline.ReadLineOptions; + let input: NodeJS.ReadableStream; + let output: NodeJS.WritableStream; + let completer: readline.Completer; + let terminal: boolean; + + let result: readline.ReadLine; + + result = readline.createInterface(options); + result = readline.createInterface(input); + result = readline.createInterface(input, output); + result = readline.createInterface(input, output, completer); + result = readline.createInterface(input, output, completer, terminal); + result = readline.createInterface({ + input, + completer(str: string): readline.CompleterResult { + return [['test'], 'test']; + } + }); + result = readline.createInterface({ + input, + completer(str: string, callback: (err: any, result: readline.CompleterResult) => void): any { + callback(null, [['test'], 'test']); + } + }); + } + + { + let prompt: string; + + rl.setPrompt(prompt); + } + + { + let preserveCursor: boolean; + + rl.prompt(); + rl.prompt(preserveCursor); + } + + { + let query: string; + let callback: (answer: string) => void; + + rl.question(query, callback); + } + + { + let result: readline.ReadLine; + + result = rl.pause(); + } + + { + let result: readline.ReadLine; + + result = rl.resume(); + } + + { + rl.close(); + } + + { + let data: string | Buffer; + let key: readline.Key; + + rl.write(data); + rl.write(null, key); + } + + { + let stream: NodeJS.WritableStream; + let x: number; + let y: number; + + readline.cursorTo(stream, x); + readline.cursorTo(stream, x, y); + } + + { + let stream: NodeJS.ReadableStream; + let readLineInterface: readline.ReadLine; + + readline.emitKeypressEvents(stream); + readline.emitKeypressEvents(stream, readLineInterface); + } + + { + let stream: NodeJS.WritableStream; + let dx: number | string; + let dy: number | string; + + readline.moveCursor(stream, dx, dy); + } + + { + let stream: NodeJS.WritableStream; + let dir: number; + + readline.clearLine(stream, dir); + } + + { + let stream: NodeJS.WritableStream; + + readline.clearScreenDown(stream); + } + + { + let _rl: readline.ReadLine; + let _boolean: boolean; + + _rl = _rl.addListener("close", () => { }); + _rl = _rl.addListener("line", (input) => { + let _input: any = input; + }); + _rl = _rl.addListener("pause", () => { }); + _rl = _rl.addListener("resume", () => { }); + _rl = _rl.addListener("SIGCONT", () => { }); + _rl = _rl.addListener("SIGINT", () => { }); + _rl = _rl.addListener("SIGTSTP", () => { }); + + _boolean = _rl.emit("close", () => { }); + _boolean = _rl.emit("line", () => { }); + _boolean = _rl.emit("pause", () => { }); + _boolean = _rl.emit("resume", () => { }); + _boolean = _rl.emit("SIGCONT", () => { }); + _boolean = _rl.emit("SIGINT", () => { }); + _boolean = _rl.emit("SIGTSTP", () => { }); + + _rl = _rl.on("close", () => { }); + _rl = _rl.on("line", (input) => { + let _input: any = input; + }); + _rl = _rl.on("pause", () => { }); + _rl = _rl.on("resume", () => { }); + _rl = _rl.on("SIGCONT", () => { }); + _rl = _rl.on("SIGINT", () => { }); + _rl = _rl.on("SIGTSTP", () => { }); + + _rl = _rl.once("close", () => { }); + _rl = _rl.once("line", (input) => { + let _input: any = input; + }); + _rl = _rl.once("pause", () => { }); + _rl = _rl.once("resume", () => { }); + _rl = _rl.once("SIGCONT", () => { }); + _rl = _rl.once("SIGINT", () => { }); + _rl = _rl.once("SIGTSTP", () => { }); + + _rl = _rl.prependListener("close", () => { }); + _rl = _rl.prependListener("line", (input) => { + let _input: any = input; + }); + _rl = _rl.prependListener("pause", () => { }); + _rl = _rl.prependListener("resume", () => { }); + _rl = _rl.prependListener("SIGCONT", () => { }); + _rl = _rl.prependListener("SIGINT", () => { }); + _rl = _rl.prependListener("SIGTSTP", () => { }); + + _rl = _rl.prependOnceListener("close", () => { }); + _rl = _rl.prependOnceListener("line", (input) => { + let _input: any = input; + }); + _rl = _rl.prependOnceListener("pause", () => { }); + _rl = _rl.prependOnceListener("resume", () => { }); + _rl = _rl.prependOnceListener("SIGCONT", () => { }); + _rl = _rl.prependOnceListener("SIGINT", () => { }); + _rl = _rl.prependOnceListener("SIGTSTP", () => { }); + } +} + +//////////////////////////////////////////////////// +/// string_decoder tests : https://nodejs.org/api/string_decoder.html +//////////////////////////////////////////////////// + +namespace string_decoder_tests { + const StringDecoder = string_decoder.StringDecoder; + const buffer = new Buffer('test'); + const decoder1 = new StringDecoder(); + const decoder2 = new StringDecoder('utf8'); + const part1: string = decoder1.write(new Buffer('test')); + const end1: string = decoder1.end(); + const part2: string = decoder2.write(new Buffer('test')); + const end2: string = decoder1.end(new Buffer('test')); +} + +////////////////////////////////////////////////////////////////////// +/// Child Process tests: https://nodejs.org/api/child_process.html /// +////////////////////////////////////////////////////////////////////// + +namespace child_process_tests { + { + childProcess.exec("echo test"); + childProcess.exec("echo test", { windowsHide: true }); + childProcess.spawn("echo", ["test"], { windowsHide: true }); + childProcess.spawnSync("echo test"); + childProcess.spawnSync("echo test", {windowsVerbatimArguments: false}); + } + + { + childProcess.execFile("npm", () => {}); + childProcess.execFile("npm", { windowsHide: true }, () => {}); + childProcess.execFile("npm", ["-v"], () => {}); + childProcess.execFile("npm", ["-v"], { windowsHide: true, encoding: 'utf-8' }, (stdout, stderr) => { assert(stdout instanceof String); }); + childProcess.execFile("npm", ["-v"], { windowsHide: true, encoding: 'buffer' }, (stdout, stderr) => { assert(stdout instanceof Buffer); }); + childProcess.execFile("npm", { encoding: 'utf-8' }, (stdout, stderr) => { assert(stdout instanceof String); }); + childProcess.execFile("npm", { encoding: 'buffer' }, (stdout, stderr) => { assert(stdout instanceof Buffer); }); + } + + async function testPromisify() { + const execFile = util.promisify(childProcess.execFile); + let r: { stdout: string | Buffer, stderr: string | Buffer } = await execFile("npm"); + r = await execFile("npm", ["-v"]); + r = await execFile("npm", ["-v"], { encoding: 'utf-8' }); + r = await execFile("npm", ["-v"], { encoding: 'buffer' }); + r = await execFile("npm", { encoding: 'utf-8' }); + r = await execFile("npm", { encoding: 'buffer' }); + } + + { + let _cp: childProcess.ChildProcess; + let _socket: net.Socket; + let _server: net.Server; + let _boolean: boolean; + + _boolean = _cp.send(1); + _boolean = _cp.send('one'); + _boolean = _cp.send({ + type: 'test' + }); + + _boolean = _cp.send(1, (error) => { + let _err: Error = error; + }); + _boolean = _cp.send('one', (error) => { + let _err: Error = error; + }); + _boolean = _cp.send({ + type: 'test' + }, (error) => { + let _err: Error = error; + }); + + _boolean = _cp.send(1, _socket); + _boolean = _cp.send('one', _socket); + _boolean = _cp.send({ + type: 'test' + }, _socket); + + _boolean = _cp.send(1, _socket, (error) => { + let _err: Error = error; + }); + _boolean = _cp.send('one', _socket, (error) => { + let _err: Error = error; + }); + _boolean = _cp.send({ + type: 'test' + }, _socket, (error) => { + let _err: Error = error; + }); + + _boolean = _cp.send(1, _socket, { + keepOpen: true + }); + _boolean = _cp.send('one', _socket, { + keepOpen: true + }); + _boolean = _cp.send({ + type: 'test' + }, _socket, { + keepOpen: true + }); + + _boolean = _cp.send(1, _socket, { + keepOpen: true + }, (error) => { + let _err: Error = error; + }); + _boolean = _cp.send('one', _socket, { + keepOpen: true + }, (error) => { + let _err: Error = error; + }); + _boolean = _cp.send({ + type: 'test' + }, _socket, { + keepOpen: true + }, (error) => { + let _err: Error = error; + }); + + _boolean = _cp.send(1, _server); + _boolean = _cp.send('one', _server); + _boolean = _cp.send({ + type: 'test' + }, _server); + + _boolean = _cp.send(1, _server, (error) => { + let _err: Error = error; + }); + _boolean = _cp.send('one', _server, (error) => { + let _err: Error = error; + }); + _boolean = _cp.send({ + type: 'test' + }, _server, (error) => { + let _err: Error = error; + }); + + _boolean = _cp.send(1, _server, { + keepOpen: true + }); + _boolean = _cp.send('one', _server, { + keepOpen: true + }); + _boolean = _cp.send({ + type: 'test' + }, _server, { + keepOpen: true + }); + + _boolean = _cp.send(1, _server, { + keepOpen: true + }, (error) => { + let _err: Error = error; + }); + _boolean = _cp.send('one', _server, { + keepOpen: true + }, (error) => { + let _err: Error = error; + }); + _boolean = _cp.send({ + type: 'test' + }, _server, { + keepOpen: true + }, (error) => { + let _err: Error = error; + }); + + _cp = _cp.addListener("close", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }); + _cp = _cp.addListener("disconnect", () => { }); + _cp = _cp.addListener("error", (err) => { + let _err: Error = err; + }); + _cp = _cp.addListener("exit", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }); + _cp = _cp.addListener("message", (message, sendHandle) => { + let _message: any = message; + let _sendHandle: net.Socket | net.Server = sendHandle; + }); + + _boolean = _cp.emit("close", () => { }); + _boolean = _cp.emit("disconnect", () => { }); + _boolean = _cp.emit("error", () => { }); + _boolean = _cp.emit("exit", () => { }); + _boolean = _cp.emit("message", () => { }); + + _cp = _cp.on("close", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }); + _cp = _cp.on("disconnect", () => { }); + _cp = _cp.on("error", (err) => { + let _err: Error = err; + }); + _cp = _cp.on("exit", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }); + _cp = _cp.on("message", (message, sendHandle) => { + let _message: any = message; + let _sendHandle: net.Socket | net.Server = sendHandle; + }); + + _cp = _cp.once("close", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }); + _cp = _cp.once("disconnect", () => { }); + _cp = _cp.once("error", (err) => { + let _err: Error = err; + }); + _cp = _cp.once("exit", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }); + _cp = _cp.once("message", (message, sendHandle) => { + let _message: any = message; + let _sendHandle: net.Socket | net.Server = sendHandle; + }); + + _cp = _cp.prependListener("close", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }); + _cp = _cp.prependListener("disconnect", () => { }); + _cp = _cp.prependListener("error", (err) => { + let _err: Error = err; + }); + _cp = _cp.prependListener("exit", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }); + _cp = _cp.prependListener("message", (message, sendHandle) => { + let _message: any = message; + let _sendHandle: net.Socket | net.Server = sendHandle; + }); + + _cp = _cp.prependOnceListener("close", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }); + _cp = _cp.prependOnceListener("disconnect", () => { }); + _cp = _cp.prependOnceListener("error", (err) => { + let _err: Error = err; + }); + _cp = _cp.prependOnceListener("exit", (code, signal) => { + let _code: number = code; + let _signal: string = signal; + }); + _cp = _cp.prependOnceListener("message", (message, sendHandle) => { + let _message: any = message; + let _sendHandle: net.Socket | net.Server = sendHandle; + }); + } + { + process.stdin.setEncoding('utf8'); + + process.stdin.on('readable', () => { + const chunk = process.stdin.read(); + if (chunk !== null) { + process.stdout.write(`data: ${chunk}`); + } + }); + + process.stdin.on('end', () => { + process.stdout.write('end'); + }); + + process.stdin.pipe(process.stdout); + + console.log(process.stdin.isTTY); + console.log(process.stdout.isTTY); + + console.log(process.stdin instanceof net.Socket); + console.log(process.stdout instanceof fs.ReadStream); + + var stdin: stream.Readable = process.stdin; + console.log(stdin instanceof net.Socket); + console.log(stdin instanceof fs.ReadStream); + + var stdout: stream.Writable = process.stdout; + console.log(stdout instanceof net.Socket); + console.log(stdout instanceof fs.WriteStream); + } +} + +////////////////////////////////////////////////////////////////////// +/// cluster tests: https://nodejs.org/api/cluster.html /// +////////////////////////////////////////////////////////////////////// + +namespace cluster_tests { + { + cluster.fork(); + Object.keys(cluster.workers).forEach(key => { + const worker = cluster.workers[key]; + if (worker.isDead()) { + console.log('worker %d is dead', worker.process.pid); + } + }); + } +} + +//////////////////////////////////////////////////// +/// os tests : https://nodejs.org/api/os.html +//////////////////////////////////////////////////// + +namespace os_tests { + { + let result: string; + + result = os.tmpdir(); + result = os.homedir(); + result = os.endianness(); + result = os.hostname(); + result = os.type(); + result = os.arch(); + result = os.release(); + result = os.EOL; + } + + { + let result: number; + + result = os.uptime(); + result = os.totalmem(); + result = os.freemem(); + } + + { + let result: number[]; + + result = os.loadavg(); + } + + { + let result: os.CpuInfo[]; + + result = os.cpus(); + } + + { + let result: { [index: string]: os.NetworkInterfaceInfo[] }; + + result = os.networkInterfaces(); + } + + { + let result: number; + + result = os.constants.signals.SIGHUP; + result = os.constants.signals.SIGINT; + result = os.constants.signals.SIGQUIT; + result = os.constants.signals.SIGILL; + result = os.constants.signals.SIGTRAP; + result = os.constants.signals.SIGABRT; + result = os.constants.signals.SIGIOT; + result = os.constants.signals.SIGBUS; + result = os.constants.signals.SIGFPE; + result = os.constants.signals.SIGKILL; + result = os.constants.signals.SIGUSR1; + result = os.constants.signals.SIGSEGV; + result = os.constants.signals.SIGUSR2; + result = os.constants.signals.SIGPIPE; + result = os.constants.signals.SIGALRM; + result = os.constants.signals.SIGTERM; + result = os.constants.signals.SIGCHLD; + result = os.constants.signals.SIGSTKFLT; + result = os.constants.signals.SIGCONT; + result = os.constants.signals.SIGSTOP; + result = os.constants.signals.SIGTSTP; + result = os.constants.signals.SIGTTIN; + result = os.constants.signals.SIGTTOU; + result = os.constants.signals.SIGURG; + result = os.constants.signals.SIGXCPU; + result = os.constants.signals.SIGXFSZ; + result = os.constants.signals.SIGVTALRM; + result = os.constants.signals.SIGPROF; + result = os.constants.signals.SIGWINCH; + result = os.constants.signals.SIGIO; + result = os.constants.signals.SIGPOLL; + result = os.constants.signals.SIGPWR; + result = os.constants.signals.SIGSYS; + result = os.constants.signals.SIGUNUSED; + } + + { + let result: number; + + result = os.constants.errno.E2BIG; + result = os.constants.errno.EACCES; + result = os.constants.errno.EADDRINUSE; + result = os.constants.errno.EADDRNOTAVAIL; + result = os.constants.errno.EAFNOSUPPORT; + result = os.constants.errno.EAGAIN; + result = os.constants.errno.EALREADY; + result = os.constants.errno.EBADF; + result = os.constants.errno.EBADMSG; + result = os.constants.errno.EBUSY; + result = os.constants.errno.ECANCELED; + result = os.constants.errno.ECHILD; + result = os.constants.errno.ECONNABORTED; + result = os.constants.errno.ECONNREFUSED; + result = os.constants.errno.ECONNRESET; + result = os.constants.errno.EDEADLK; + result = os.constants.errno.EDESTADDRREQ; + result = os.constants.errno.EDOM; + result = os.constants.errno.EDQUOT; + result = os.constants.errno.EEXIST; + result = os.constants.errno.EFAULT; + result = os.constants.errno.EFBIG; + result = os.constants.errno.EHOSTUNREACH; + result = os.constants.errno.EIDRM; + result = os.constants.errno.EILSEQ; + result = os.constants.errno.EINPROGRESS; + result = os.constants.errno.EINTR; + result = os.constants.errno.EINVAL; + result = os.constants.errno.EIO; + result = os.constants.errno.EISCONN; + result = os.constants.errno.EISDIR; + result = os.constants.errno.ELOOP; + result = os.constants.errno.EMFILE; + result = os.constants.errno.EMLINK; + result = os.constants.errno.EMSGSIZE; + result = os.constants.errno.EMULTIHOP; + result = os.constants.errno.ENAMETOOLONG; + result = os.constants.errno.ENETDOWN; + result = os.constants.errno.ENETRESET; + result = os.constants.errno.ENETUNREACH; + result = os.constants.errno.ENFILE; + result = os.constants.errno.ENOBUFS; + result = os.constants.errno.ENODATA; + result = os.constants.errno.ENODEV; + result = os.constants.errno.ENOENT; + result = os.constants.errno.ENOEXEC; + result = os.constants.errno.ENOLCK; + result = os.constants.errno.ENOLINK; + result = os.constants.errno.ENOMEM; + result = os.constants.errno.ENOMSG; + result = os.constants.errno.ENOPROTOOPT; + result = os.constants.errno.ENOSPC; + result = os.constants.errno.ENOSR; + result = os.constants.errno.ENOSTR; + result = os.constants.errno.ENOSYS; + result = os.constants.errno.ENOTCONN; + result = os.constants.errno.ENOTDIR; + result = os.constants.errno.ENOTEMPTY; + result = os.constants.errno.ENOTSOCK; + result = os.constants.errno.ENOTSUP; + result = os.constants.errno.ENOTTY; + result = os.constants.errno.ENXIO; + result = os.constants.errno.EOPNOTSUPP; + result = os.constants.errno.EOVERFLOW; + result = os.constants.errno.EPERM; + result = os.constants.errno.EPIPE; + result = os.constants.errno.EPROTO; + result = os.constants.errno.EPROTONOSUPPORT; + result = os.constants.errno.EPROTOTYPE; + result = os.constants.errno.ERANGE; + result = os.constants.errno.EROFS; + result = os.constants.errno.ESPIPE; + result = os.constants.errno.ESRCH; + result = os.constants.errno.ESTALE; + result = os.constants.errno.ETIME; + result = os.constants.errno.ETIMEDOUT; + result = os.constants.errno.ETXTBSY; + result = os.constants.errno.EWOULDBLOCK; + result = os.constants.errno.EXDEV; + } +} + +//////////////////////////////////////////////////// +/// vm tests : https://nodejs.org/api/vm.html +//////////////////////////////////////////////////// + +namespace vm_tests { + { + const sandbox = { + animal: 'cat', + count: 2 + }; + + const context = vm.createContext(sandbox); + console.log(vm.isContext(context)); + const script = new vm.Script('count += 1; name = "kitty"'); + + for (let i = 0; i < 10; ++i) { + script.runInContext(context); + } + + console.log(util.inspect(sandbox)); + + vm.runInNewContext('count += 1; name = "kitty"', sandbox); + console.log(util.inspect(sandbox)); + } + + { + const sandboxes = [{}, {}, {}]; + + const script = new vm.Script('globalVar = "set"'); + + sandboxes.forEach((sandbox) => { + script.runInNewContext(sandbox); + script.runInThisContext(); + }); + + console.log(util.inspect(sandboxes)); + + var localVar = 'initial value'; + vm.runInThisContext('localVar = "vm";'); + + console.log(localVar); + } + + { + const Debug = vm.runInDebugContext('Debug'); + Debug.scripts().forEach((script: any) => { console.log(script.name); }); + } + + { + vm.runInThisContext('console.log("hello world"', './my-file.js'); + } +} + +///////////////////////////////////////////////////// +/// Timers tests : https://nodejs.org/api/timers.html +///////////////////////////////////////////////////// + +namespace timers_tests { + { + let immediateId = timers.setImmediate(() => { console.log("immediate"); }); + timers.clearImmediate(immediateId); + } + { + let counter = 0; + let timeout = timers.setInterval(() => { console.log("interval"); }, 20); + timeout.unref(); + timeout.ref(); + timers.clearInterval(timeout); + } + { + let counter = 0; + let timeout = timers.setTimeout(() => { console.log("timeout"); }, 20); + timeout.unref(); + timeout.ref(); + timers.clearTimeout(timeout); + } + async function testPromisify() { + const setTimeout = util.promisify(timers.setTimeout); + let v: void = await setTimeout(100); // tslint:disable-line no-void-expression void-return + let s: string = await setTimeout(100, ""); + + const setImmediate = util.promisify(timers.setImmediate); + v = await setImmediate(); // tslint:disable-line no-void-expression + s = await setImmediate(""); + } +} + +///////////////////////////////////////////////////////// +/// Errors Tests : https://nodejs.org/api/errors.html /// +///////////////////////////////////////////////////////// + +namespace errors_tests { + { + Error.stackTraceLimit = Infinity; + } + { + const myObject = {}; + Error.captureStackTrace(myObject); + } + { + let frames: NodeJS.CallSite[] = []; + Error.prepareStackTrace(new Error(), frames); + } + { + let frame: NodeJS.CallSite = null; + let frameThis: any = frame.getThis(); + let typeName: string = frame.getTypeName(); + let func: Function = frame.getFunction(); + let funcName: string = frame.getFunctionName(); + let meth: string = frame.getMethodName(); + let fname: string = frame.getFileName(); + let lineno: number = frame.getLineNumber(); + let colno: number = frame.getColumnNumber(); + let evalOrigin: string = frame.getEvalOrigin(); + let isTop: boolean = frame.isToplevel(); + let isEval: boolean = frame.isEval(); + let isNative: boolean = frame.isNative(); + let isConstr: boolean = frame.isConstructor(); + } +} + +/////////////////////////////////////////////////////////// +/// Process Tests : https://nodejs.org/api/process.html /// +/////////////////////////////////////////////////////////// + +import * as p from "process"; +namespace process_tests { + { + var eventEmitter: events.EventEmitter; + eventEmitter = process; // Test that process implements EventEmitter... + + var _p: NodeJS.Process = process; + _p = p; + } + { + assert(process.argv[0] === process.argv0); + } + { + var module: NodeModule | undefined; + module = process.mainModule; + } + { + process.on("message", (req: any) => { }); + process.addListener("beforeExit", (code: number) => { }); + process.once("disconnect", () => { }); + process.prependListener("exit", (code: number) => { }); + process.prependOnceListener("rejectionHandled", (promise: Promise) => { }); + process.on("uncaughtException", (error: Error) => { }); + process.addListener("unhandledRejection", (reason: any, promise: Promise) => { }); + process.once("warning", (warning: Error) => { }); + process.prependListener("message", (message: any, sendHandle: any) => { }); + process.prependOnceListener("SIGBREAK", () => { }); + process.on("newListener", (event: string | symbol, listener: Function) => { }); + process.once("removeListener", (event: string | symbol, listener: Function) => { }); + + const listeners = process.listeners('uncaughtException'); + const oldHandler = listeners[listeners.length - 1]; + process.addListener('uncaughtException', oldHandler); + } + { + function myCb(err: Error): void { + } + process.setUncaughtExceptionCaptureCallback(myCb); + process.setUncaughtExceptionCaptureCallback(null); + const b: boolean = process.hasUncaughtExceptionCaptureCallback(); + } +} + +/////////////////////////////////////////////////////////// +/// Console Tests : https://nodejs.org/api/console.html /// +/////////////////////////////////////////////////////////// + +import * as c from "console"; +namespace console_tests { + { + var _c: Console = console; + _c = c; + } + { + var writeStream = fs.createWriteStream('./index.d.ts'); + var consoleInstance = new console.Console(writeStream); + } +} + +/////////////////////////////////////////////////// +/// Net Tests : https://nodejs.org/api/net.html /// +/////////////////////////////////////////////////// + +namespace net_tests { + { + const connectOpts: net.NetConnectOpts = { + allowHalfOpen: true, + family: 4, + host: "localhost", + port: 443, + timeout: 10E3 + }; + const socket: net.Socket = net.createConnection(connectOpts, (): void => { + // nothing + }); + } + + { + let server = net.createServer(); + // Check methods which return server instances by chaining calls + server = server.listen(0) + .close() + .ref() + .unref(); + + // close has an optional callback function. No callback parameters are + // specified, so any callback function is permissible. + server = server.close((...args: any[]) => { }); + + // test the types of the address object fields + let address = server.address(); + address.port = 1234; + address.family = "ipv4"; + address.address = "127.0.0.1"; + } + + { + const constructorOpts: net.SocketConstructorOpts = { + fd: 1, + allowHalfOpen: false, + readable: false, + writable: false + }; + + /** + * net.Socket - events.EventEmitter + * 1. close + * 2. connect + * 3. data + * 4. drain + * 5. end + * 6. error + * 7. lookup + * 8. timeout + */ + let _socket: net.Socket = new net.Socket(constructorOpts); + + let bool: boolean; + let buffer: Buffer; + let error: Error; + let str: string; + let num: number; + + let ipcConnectOpts: net.IpcSocketConnectOpts = { + path: "/" + }; + let tcpConnectOpts: net.TcpSocketConnectOpts = { + family: 4, + hints: 0, + host: "localhost", + localAddress: "10.0.0.1", + localPort: 1234, + lookup: (_hostname: string, _options: dns.LookupOneOptions, _callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void): void => { + // nothing + }, + port: 80 + }; + _socket = _socket.connect(ipcConnectOpts); + _socket = _socket.connect(ipcConnectOpts, (): void => {}); + _socket = _socket.connect(tcpConnectOpts); + _socket = _socket.connect(tcpConnectOpts, (): void => {}); + _socket = _socket.connect(80, "localhost"); + _socket = _socket.connect(80, "localhost", (): void => {}); + _socket = _socket.connect(80); + _socket = _socket.connect(80, (): void => {}); + + /// addListener + + _socket = _socket.addListener("close", had_error => { + bool = had_error; + }); + _socket = _socket.addListener("connect", () => { }); + _socket = _socket.addListener("data", data => { + buffer = data; + }); + _socket = _socket.addListener("drain", () => { }); + _socket = _socket.addListener("end", () => { }); + _socket = _socket.addListener("error", err => { + error = err; + }); + _socket = _socket.addListener("lookup", (err, address, family, host) => { + error = err; + + if (typeof family === 'string') { + str = family; + } else if (typeof family === 'number') { + num = family; + } + + str = host; + }); + _socket = _socket.addListener("timeout", () => { }); + + /// emit + bool = _socket.emit("close", bool); + bool = _socket.emit("connect"); + bool = _socket.emit("data", buffer); + bool = _socket.emit("drain"); + bool = _socket.emit("end"); + bool = _socket.emit("error", error); + bool = _socket.emit("lookup", error, str, str, str); + bool = _socket.emit("lookup", error, str, num, str); + bool = _socket.emit("timeout"); + + /// on + _socket = _socket.on("close", had_error => { + bool = had_error; + }); + _socket = _socket.on("connect", () => { }); + _socket = _socket.on("data", data => { + buffer = data; + }); + _socket = _socket.on("drain", () => { }); + _socket = _socket.on("end", () => { }); + _socket = _socket.on("error", err => { + error = err; + }); + _socket = _socket.on("lookup", (err, address, family, host) => { + error = err; + + if (typeof family === 'string') { + str = family; + } else if (typeof family === 'number') { + num = family; + } + + str = host; + }); + _socket = _socket.on("timeout", () => { }); + + /// once + _socket = _socket.once("close", had_error => { + bool = had_error; + }); + _socket = _socket.once("connect", () => { }); + _socket = _socket.once("data", data => { + buffer = data; + }); + _socket = _socket.once("drain", () => { }); + _socket = _socket.once("end", () => { }); + _socket = _socket.once("error", err => { + error = err; + }); + _socket = _socket.once("lookup", (err, address, family, host) => { + error = err; + + if (typeof family === 'string') { + str = family; + } else if (typeof family === 'number') { + num = family; + } + + str = host; + }); + _socket = _socket.once("timeout", () => { }); + + /// prependListener + _socket = _socket.prependListener("close", had_error => { + bool = had_error; + }); + _socket = _socket.prependListener("connect", () => { }); + _socket = _socket.prependListener("data", data => { + buffer = data; + }); + _socket = _socket.prependListener("drain", () => { }); + _socket = _socket.prependListener("end", () => { }); + _socket = _socket.prependListener("error", err => { + error = err; + }); + _socket = _socket.prependListener("lookup", (err, address, family, host) => { + error = err; + + if (typeof family === 'string') { + str = family; + } else if (typeof family === 'number') { + num = family; + } + + str = host; + }); + _socket = _socket.prependListener("timeout", () => { }); + + /// prependOnceListener + _socket = _socket.prependOnceListener("close", had_error => { + bool = had_error; + }); + _socket = _socket.prependOnceListener("connect", () => { }); + _socket = _socket.prependOnceListener("data", data => { + buffer = data; + }); + _socket = _socket.prependOnceListener("drain", () => { }); + _socket = _socket.prependOnceListener("end", () => { }); + _socket = _socket.prependOnceListener("error", err => { + error = err; + }); + _socket = _socket.prependOnceListener("lookup", (err, address, family, host) => { + error = err; + + if (typeof family === 'string') { + str = family; + } else if (typeof family === 'number') { + num = family; + } + + str = host; + }); + _socket = _socket.prependOnceListener("timeout", () => { }); + + bool = _socket.connecting; + bool = _socket.destroyed; + _socket.destroy(); + } + + { + /** + * net.Server - events.EventEmitter + * 1. close + * 2. connection + * 3. error + * 4. listening + */ + let _server: net.Server; + + let _socket: net.Socket; + let bool: boolean; + let error: Error; + + /// addListener + _server = _server.addListener("close", () => { }); + _server = _server.addListener("connection", socket => { + _socket = socket; + }); + _server = _server.addListener("error", err => { + error = err; + }); + _server = _server.addListener("listening", () => { }); + + /// emit + bool = _server.emit("close"); + bool = _server.emit("connection", _socket); + bool = _server.emit("error", error); + bool = _server.emit("listening"); + + /// once + _server = _server.once("close", () => { }); + _server = _server.once("connection", socket => { + _socket = socket; + }); + _server = _server.once("error", err => { + error = err; + }); + _server = _server.once("listening", () => { }); + + /// prependListener + _server = _server.prependListener("close", () => { }); + _server = _server.prependListener("connection", socket => { + _socket = socket; + }); + _server = _server.prependListener("error", err => { + error = err; + }); + _server = _server.prependListener("listening", () => { }); + + /// prependOnceListener + _server = _server.prependOnceListener("close", () => { }); + _server = _server.prependOnceListener("connection", socket => { + _socket = socket; + }); + _server = _server.prependOnceListener("error", err => { + error = err; + }); + _server = _server.prependOnceListener("listening", () => { }); + } +} + +///////////////////////////////////////////////////// +/// repl Tests : https://nodejs.org/api/repl.html /// +///////////////////////////////////////////////////// + +namespace repl_tests { + { + let _server: repl.REPLServer; + let _boolean: boolean; + let _ctx: any; + + _server = _server.addListener("exit", () => { }); + _server = _server.addListener("reset", () => { }); + + _boolean = _server.emit("exit", () => { }); + _boolean = _server.emit("reset", _ctx); + + _server = _server.on("exit", () => { }); + _server = _server.on("reset", () => { }); + + _server = _server.once("exit", () => { }); + _server = _server.once("reset", () => { }); + + _server = _server.prependListener("exit", () => { }); + _server = _server.prependListener("reset", () => { }); + + _server = _server.prependOnceListener("exit", () => { }); + _server = _server.prependOnceListener("reset", () => { }); + + _server.outputStream.write("test"); + let line = _server.inputStream.read(); + + throw new repl.Recoverable(new Error("test")); + } +} + +/////////////////////////////////////////////////// +/// DNS Tests : https://nodejs.org/api/dns.html /// +/////////////////////////////////////////////////// + +namespace dns_tests { + dns.lookup("nodejs.org", (err, address, family) => { + const _err: NodeJS.ErrnoException = err; + const _address: string = address; + const _family: number = family; + }); + dns.lookup("nodejs.org", 4, (err, address, family) => { + const _err: NodeJS.ErrnoException = err; + const _address: string = address; + const _family: number = family; + }); + dns.lookup("nodejs.org", 6, (err, address, family) => { + const _err: NodeJS.ErrnoException = err; + const _address: string = address; + const _family: number = family; + }); + dns.lookup("nodejs.org", {}, (err, address, family) => { + const _err: NodeJS.ErrnoException = err; + const _address: string = address; + const _family: number = family; + }); + dns.lookup( + "nodejs.org", + { + family: 4, + hints: dns.ADDRCONFIG | dns.V4MAPPED, + all: false + }, + (err, address, family) => { + const _err: NodeJS.ErrnoException = err; + const _address: string = address; + const _family: number = family; + } + ); + dns.lookup("nodejs.org", { all: true }, (err, addresses) => { + const _err: NodeJS.ErrnoException = err; + const _address: dns.LookupAddress[] = addresses; + }); + + function trueOrFalse(): boolean { + return Math.random() > 0.5 ? true : false; + } + dns.lookup("nodejs.org", { all: trueOrFalse() }, (err, addresses, family) => { + const _err: NodeJS.ErrnoException = err; + const _addresses: string | dns.LookupAddress[] = addresses; + const _family: number | undefined = family; + }); + + dns.resolve("nodejs.org", (err, addresses) => { + const _addresses: string[] = addresses; + }); + dns.resolve("nodejs.org", "A", (err, addresses) => { + const _addresses: string[] = addresses; + }); + dns.resolve("nodejs.org", "AAAA", (err, addresses) => { + const _addresses: string[] = addresses; + }); + dns.resolve("nodejs.org", "MX", (err, addresses) => { + const _addresses: dns.MxRecord[] = addresses; + }); + + dns.resolve4("nodejs.org", (err, addresses) => { + const _addresses: string[] = addresses; + }); + dns.resolve4("nodejs.org", { ttl: true }, (err, addresses) => { + const _addresses: dns.RecordWithTtl[] = addresses; + }); + { + const ttl = false; + dns.resolve4("nodejs.org", { ttl }, (err, addresses) => { + const _addresses: string[] | dns.RecordWithTtl[] = addresses; + }); + } + + dns.resolve6("nodejs.org", (err, addresses) => { + const _addresses: string[] = addresses; + }); + dns.resolve6("nodejs.org", { ttl: true }, (err, addresses) => { + const _addresses: dns.RecordWithTtl[] = addresses; + }); + { + const ttl = false; + dns.resolve6("nodejs.org", { ttl }, (err, addresses) => { + const _addresses: string[] | dns.RecordWithTtl[] = addresses; + }); + } +} + +/***************************************************************************** + * * + * The following tests are the modules not mentioned in document but existed * + * * + *****************************************************************************/ + +/////////////////////////////////////////////////////////// +/// Constants Tests /// +/////////////////////////////////////////////////////////// + +import * as constants from 'constants'; +import { PerformanceObserver, PerformanceObserverCallback } from "perf_hooks"; +namespace constants_tests { + var str: string; + var num: number; + num = constants.SIGHUP; + num = constants.SIGINT; + num = constants.SIGQUIT; + num = constants.SIGILL; + num = constants.SIGTRAP; + num = constants.SIGABRT; + num = constants.SIGIOT; + num = constants.SIGBUS; + num = constants.SIGFPE; + num = constants.SIGKILL; + num = constants.SIGUSR1; + num = constants.SIGSEGV; + num = constants.SIGUSR2; + num = constants.SIGPIPE; + num = constants.SIGALRM; + num = constants.SIGTERM; + num = constants.SIGCHLD; + num = constants.SIGSTKFLT; + num = constants.SIGCONT; + num = constants.SIGSTOP; + num = constants.SIGTSTP; + num = constants.SIGTTIN; + num = constants.SIGTTOU; + num = constants.SIGURG; + num = constants.SIGXCPU; + num = constants.SIGXFSZ; + num = constants.SIGVTALRM; + num = constants.SIGPROF; + num = constants.SIGWINCH; + num = constants.SIGIO; + num = constants.SIGPOLL; + num = constants.SIGPWR; + num = constants.SIGSYS; + num = constants.SIGUNUSED; + num = constants.O_RDONLY; + num = constants.O_WRONLY; + num = constants.O_RDWR; + num = constants.S_IFMT; + num = constants.S_IFREG; + num = constants.S_IFDIR; + num = constants.S_IFCHR; + num = constants.S_IFBLK; + num = constants.S_IFIFO; + num = constants.S_IFLNK; + num = constants.S_IFSOCK; + num = constants.O_CREAT; + num = constants.O_EXCL; + num = constants.O_NOCTTY; + num = constants.O_TRUNC; + num = constants.O_APPEND; + num = constants.O_DIRECTORY; + num = constants.O_NOATIME; + num = constants.O_NOFOLLOW; + num = constants.O_SYNC; + num = constants.O_DSYNC; + num = constants.O_DIRECT; + num = constants.O_NONBLOCK; + num = constants.S_IRWXU; + num = constants.S_IRUSR; + num = constants.S_IWUSR; + num = constants.S_IXUSR; + num = constants.S_IRWXG; + num = constants.S_IRGRP; + num = constants.S_IWGRP; + num = constants.S_IXGRP; + num = constants.S_IRWXO; + num = constants.S_IROTH; + num = constants.S_IWOTH; + num = constants.S_IXOTH; + num = constants.F_OK; + num = constants.R_OK; + num = constants.W_OK; + num = constants.X_OK; + num = constants.SSL_OP_ALL; + num = constants.SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION; + num = constants.SSL_OP_CIPHER_SERVER_PREFERENCE; + num = constants.SSL_OP_CISCO_ANYCONNECT; + num = constants.SSL_OP_COOKIE_EXCHANGE; + num = constants.SSL_OP_CRYPTOPRO_TLSEXT_BUG; + num = constants.SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS; + num = constants.SSL_OP_EPHEMERAL_RSA; + num = constants.SSL_OP_LEGACY_SERVER_CONNECT; + num = constants.SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER; + num = constants.SSL_OP_MICROSOFT_SESS_ID_BUG; + num = constants.SSL_OP_MSIE_SSLV2_RSA_PADDING; + num = constants.SSL_OP_NETSCAPE_CA_DN_BUG; + num = constants.SSL_OP_NETSCAPE_CHALLENGE_BUG; + num = constants.SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG; + num = constants.SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG; + num = constants.SSL_OP_NO_COMPRESSION; + num = constants.SSL_OP_NO_QUERY_MTU; + num = constants.SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION; + num = constants.SSL_OP_NO_SSLv2; + num = constants.SSL_OP_NO_SSLv3; + num = constants.SSL_OP_NO_TICKET; + num = constants.SSL_OP_NO_TLSv1; + num = constants.SSL_OP_NO_TLSv1_1; + num = constants.SSL_OP_NO_TLSv1_2; + num = constants.SSL_OP_PKCS1_CHECK_1; + num = constants.SSL_OP_PKCS1_CHECK_2; + num = constants.SSL_OP_SINGLE_DH_USE; + num = constants.SSL_OP_SINGLE_ECDH_USE; + num = constants.SSL_OP_SSLEAY_080_CLIENT_DH_BUG; + num = constants.SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG; + num = constants.SSL_OP_TLS_BLOCK_PADDING_BUG; + num = constants.SSL_OP_TLS_D5_BUG; + num = constants.SSL_OP_TLS_ROLLBACK_BUG; + num = constants.ENGINE_METHOD_RSA; + num = constants.ENGINE_METHOD_DSA; + num = constants.ENGINE_METHOD_DH; + num = constants.ENGINE_METHOD_RAND; + num = constants.ENGINE_METHOD_ECDH; + num = constants.ENGINE_METHOD_ECDSA; + num = constants.ENGINE_METHOD_CIPHERS; + num = constants.ENGINE_METHOD_DIGESTS; + num = constants.ENGINE_METHOD_STORE; + num = constants.ENGINE_METHOD_PKEY_METHS; + num = constants.ENGINE_METHOD_PKEY_ASN1_METHS; + num = constants.ENGINE_METHOD_ALL; + num = constants.ENGINE_METHOD_NONE; + num = constants.DH_CHECK_P_NOT_SAFE_PRIME; + num = constants.DH_CHECK_P_NOT_PRIME; + num = constants.DH_UNABLE_TO_CHECK_GENERATOR; + num = constants.DH_NOT_SUITABLE_GENERATOR; + num = constants.NPN_ENABLED; + num = constants.ALPN_ENABLED; + num = constants.RSA_PKCS1_PADDING; + num = constants.RSA_SSLV23_PADDING; + num = constants.RSA_NO_PADDING; + num = constants.RSA_PKCS1_OAEP_PADDING; + num = constants.RSA_X931_PADDING; + num = constants.RSA_PKCS1_PSS_PADDING; + num = constants.POINT_CONVERSION_COMPRESSED; + num = constants.POINT_CONVERSION_UNCOMPRESSED; + num = constants.POINT_CONVERSION_HYBRID; + str = constants.defaultCoreCipherList; + str = constants.defaultCipherList; +} + +//////////////////////////////////////////////////// +/// v8 tests : https://nodejs.org/api/v8.html +//////////////////////////////////////////////////// + +namespace v8_tests { + const heapStats = v8.getHeapStatistics(); + const heapSpaceStats = v8.getHeapSpaceStatistics(); + + const zapsGarbage: number = heapStats.does_zap_garbage; + + v8.setFlagsFromString('--collect_maps'); +} + +//////////////////////////////////////////////////// +/// PerfHooks tests : https://nodejs.org/api/perf_hooks.html +//////////////////////////////////////////////////// +namespace perf_hooks_tests { + perf_hooks.performance.mark('start'); + ( + () => {} + )(); + perf_hooks.performance.mark('end'); + + const { duration } = perf_hooks.performance.getEntriesByName('discover')[0]; + const timeOrigin = perf_hooks.performance.timeOrigin; + + const performanceObserverCallback: PerformanceObserverCallback = (list, obs) => { + const { + duration, + entryType, + name, + startTime, + } = list.getEntries()[0]; + obs.disconnect(); + perf_hooks.performance.clearFunctions(); + }; + const obs = new perf_hooks.PerformanceObserver(performanceObserverCallback); + obs.observe({ + entryTypes: ['function'], + buffered: true, + }); +} + +//////////////////////////////////////////////////// +/// AsyncHooks tests : https://nodejs.org/api/async_hooks.html +//////////////////////////////////////////////////// +namespace async_hooks_tests { + const hooks: async_hooks.HookCallbacks = { + init() {}, + before() {}, + after() {}, + destroy() {}, + promiseResolve() {}, + }; + + const asyncHook = async_hooks.createHook(hooks); + + asyncHook.enable().disable().enable(); + + const tId: number = async_hooks.triggerAsyncId(); + const eId: number = async_hooks.executionAsyncId(); + + class TestResource extends async_hooks.AsyncResource { + constructor() { + super('TEST_RESOURCE'); + } + } + + class AnotherTestResource extends async_hooks.AsyncResource { + constructor() { + super('TEST_RESOURCE', 42); + const aId: number = this.asyncId(); + const tId: number = this.triggerAsyncId(); + } + run() { + this.runInAsyncScope(() => {}); + this.runInAsyncScope(Array.prototype.find, [], () => true); + } + destroy() { + this.emitDestroy(); + } + } + + // check AsyncResource constructor options. + new async_hooks.AsyncResource(''); + new async_hooks.AsyncResource('', 0); + new async_hooks.AsyncResource('', {}); + new async_hooks.AsyncResource('', { triggerAsyncId: 0 }); + new async_hooks.AsyncResource('', { + triggerAsyncId: 0, + requireManualDestroy: true + }); +} + +//////////////////////////////////////////////////// +/// zlib tests : http://nodejs.org/api/zlib.html /// +//////////////////////////////////////////////////// + +namespace zlib_tests { + { + const gzipped = zlib.gzipSync('test'); + const unzipped = zlib.gunzipSync(gzipped.toString()); + } + + { + const deflate = zlib.deflateSync('test'); + const inflate = zlib.inflateSync(deflate.toString()); + } +} + +/////////////////////////////////////////////////////////// +/// HTTP/2 Tests /// +/////////////////////////////////////////////////////////// + +namespace http2_tests { + // Headers & Settings + { + let headers: http2.OutgoingHttpHeaders = { + ':status': 200, + 'content-type': 'text-plain', + ABC: ['has', 'more', 'than', 'one', 'value'], + undef: undefined + }; + + let settings: http2.Settings = { + headerTableSize: 0, + enablePush: true, + initialWindowSize: 0, + maxFrameSize: 0, + maxConcurrentStreams: 0, + maxHeaderListSize: 0 + }; + } + + // Http2Session + { + let http2Session: http2.Http2Session; + let ee: events.EventEmitter = http2Session; + + http2Session.on('close', () => {}); + http2Session.on('connect', (session: http2.Http2Session, socket: net.Socket) => {}); + http2Session.on('error', (err: Error) => {}); + http2Session.on('frameError', (frameType: number, errorCode: number, streamID: number) => {}); + http2Session.on('goaway', (errorCode: number, lastStreamID: number, opaqueData: Buffer) => {}); + http2Session.on('localSettings', (settings: http2.Settings) => {}); + http2Session.on('remoteSettings', (settings: http2.Settings) => {}); + http2Session.on('stream', (stream: http2.Http2Stream, headers: http2.IncomingHttpHeaders, flags: number) => {}); + http2Session.on('timeout', () => {}); + + http2Session.destroy(); + + let alpnProtocol: string = http2Session.alpnProtocol; + let destroyed: boolean = http2Session.destroyed; + let encrypted: boolean = http2Session.encrypted; + let originSet: string[] = http2Session.originSet; + let pendingSettingsAck: boolean = http2Session.pendingSettingsAck; + let settings: http2.Settings = http2Session.localSettings; + let closed: boolean = http2Session.closed; + settings = http2Session.remoteSettings; + + http2Session.ref(); + http2Session.unref(); + + let headers: http2.OutgoingHttpHeaders; + let options: http2.ClientSessionRequestOptions = { + endStream: true, + exclusive: true, + parent: 0, + weight: 0, + getTrailers: (trailers: http2.OutgoingHttpHeaders) => {} + }; + (http2Session as http2.ClientHttp2Session).request(); + (http2Session as http2.ClientHttp2Session).request(headers); + (http2Session as http2.ClientHttp2Session).request(headers, options); + + let stream: http2.Http2Stream; + http2Session.rstStream(stream); + http2Session.rstStream(stream, 0); + + http2Session.setTimeout(100, () => {}); + http2Session.close(() => {}); + + let socket: net.Socket | tls.TLSSocket = http2Session.socket; + let state: http2.SessionState = http2Session.state; + state = { + effectiveLocalWindowSize: 0, + effectiveRecvDataLength: 0, + nextStreamID: 0, + localWindowSize: 0, + lastProcStreamID: 0, + remoteWindowSize: 0, + outboundQueueSize: 0, + deflateDynamicTableSize: 0, + inflateDynamicTableSize: 0 + }; + + http2Session.priority(stream, { + exclusive: true, + parent: 0, + weight: 0, + silent: true + }); + + http2Session.settings(settings); + } + + // Http2Stream + { + let http2Stream: http2.Http2Stream; + let duplex: stream.Duplex = http2Stream; + + http2Stream.on('aborted', () => {}); + http2Stream.on('error', (err: Error) => {}); + http2Stream.on('frameError', (frameType: number, errorCode: number, streamID: number) => {}); + http2Stream.on('streamClosed', (code: number) => {}); + http2Stream.on('timeout', () => {}); + http2Stream.on('trailers', (trailers: http2.IncomingHttpHeaders, flags: number) => {}); + + let aborted: boolean = http2Stream.aborted; + let closed: boolean = http2Stream.closed; + let destroyed: boolean = http2Stream.destroyed; + let pending: boolean = http2Stream.pending; + + http2Stream.priority({ + exclusive: true, + parent: 0, + weight: 0, + silent: true + }); + + let sesh: http2.Http2Session = http2Stream.session; + + http2Stream.setTimeout(100, () => {}); + + let state: http2.StreamState = http2Stream.state; + state = { + localWindowSize: 0, + state: 0, + streamLocalClose: 0, + streamRemoteClose: 0, + sumDependencyWeight: 0, + weight: 0 + }; + + // ClientHttp2Stream + let clientHttp2Stream: http2.ClientHttp2Stream; + clientHttp2Stream.on('headers', (headers: http2.IncomingHttpHeaders, flags: number) => {}); + clientHttp2Stream.on('push', (headers: http2.IncomingHttpHeaders, flags: number) => {}); + clientHttp2Stream.on('response', (headers: http2.IncomingHttpHeaders, flags: number) => {}); + + // ServerHttp2Stream + let serverHttp2Stream: http2.ServerHttp2Stream; + let headers: http2.OutgoingHttpHeaders; + + serverHttp2Stream.additionalHeaders(headers); + let headerSent: boolean = serverHttp2Stream.headersSent; + let pushAllowed: boolean = serverHttp2Stream.pushAllowed; + serverHttp2Stream.pushStream(headers, (err: Error | null, pushStream: http2.ServerHttp2Stream, headers: http2.OutgoingHttpHeaders) => {}); + + let options: http2.ServerStreamResponseOptions = { + endStream: true, + getTrailers: (trailers: http2.OutgoingHttpHeaders) => {} + }; + serverHttp2Stream.respond(); + serverHttp2Stream.respond(headers); + serverHttp2Stream.respond(headers, options); + + let options2: http2.ServerStreamFileResponseOptions = { + statCheck: (stats: fs.Stats, headers: http2.OutgoingHttpHeaders, statOptions: http2.StatOptions) => {}, + getTrailers: (trailers: http2.OutgoingHttpHeaders) => {}, + offset: 0, + length: 0 + }; + serverHttp2Stream.respondWithFD(0); + serverHttp2Stream.respondWithFD(0, headers); + serverHttp2Stream.respondWithFD(0, headers, options2); + serverHttp2Stream.respondWithFD(0, headers, {statCheck: () => false}); + let options3: http2.ServerStreamFileResponseOptionsWithError = { + onError: (err: NodeJS.ErrnoException) => {}, + statCheck: (stats: fs.Stats, headers: http2.OutgoingHttpHeaders, statOptions: http2.StatOptions) => {}, + getTrailers: (trailers: http2.OutgoingHttpHeaders) => {}, + offset: 0, + length: 0 + }; + serverHttp2Stream.respondWithFile(''); + serverHttp2Stream.respondWithFile('', headers); + serverHttp2Stream.respondWithFile('', headers, options3); + serverHttp2Stream.respondWithFile('', headers, {statCheck: () => false}); + } + + // Http2Server / Http2SecureServer + { + let http2Server: http2.Http2Server; + let http2SecureServer: http2.Http2SecureServer; + let s1: net.Server = http2Server; + let s2: tls.Server = http2SecureServer; + [http2Server, http2SecureServer].forEach((server) => { + server.on('sessionError', (err: Error) => {}); + server.on('checkContinue', (stream: http2.ServerHttp2Stream, headers: http2.IncomingHttpHeaders, flags: number) => {}); + server.on('stream', (stream: http2.ServerHttp2Stream, headers: http2.IncomingHttpHeaders, flags: number) => {}); + server.on('request', (request: http2.Http2ServerRequest, response: http2.Http2ServerResponse) => {}); + server.on('timeout', () => {}); + }); + + http2SecureServer.on('unknownProtocol', (socket: tls.TLSSocket) => {}); + } + + // Public API (except constants) + { + let settings: http2.Settings; + let serverOptions: http2.ServerOptions = { + maxDeflateDynamicTableSize: 0, + maxReservedRemoteStreams: 0, + maxSendHeaderBlockLength: 0, + paddingStrategy: 0, + peerMaxConcurrentStreams: 0, + selectPadding: (frameLen: number, maxFrameLen: number) => 0, + settings, + allowHTTP1: true + }; + // tslint:disable-next-line prefer-object-spread (ts2.1 feature) + let secureServerOptions: http2.SecureServerOptions = Object.assign({}, serverOptions); + secureServerOptions.ca = ''; + let onRequestHandler = (request: http2.Http2ServerRequest, response: http2.Http2ServerResponse) => { + // Http2ServerRequest + + let readable: stream.Readable = request; + let incomingHeaders: http2.IncomingHttpHeaders = request.headers; + incomingHeaders = request.trailers; + let httpVersion: string = request.httpVersion; + let method: string = request.method; + let rawHeaders: string[] = request.rawHeaders; + rawHeaders = request.rawTrailers; + let socket: net.Socket | tls.TLSSocket = request.socket; + let stream: http2.ServerHttp2Stream = request.stream; + let url: string = request.url; + + request.setTimeout(0, () => {}); + request.on('aborted', (hadError: boolean, code: number) => {}); + + // Http2ServerResponse + + let outgoingHeaders: http2.OutgoingHttpHeaders; + response.addTrailers(outgoingHeaders); + socket = response.connection; + let finished: boolean = response.finished; + response.sendDate = true; + response.statusCode = 200; + response.statusMessage = ''; + socket = response.socket; + stream = response.stream; + + method = response.getHeader(':method'); + let headers: string[] = response.getHeaderNames(); + outgoingHeaders = response.getHeaders(); + let hasMethod = response.hasHeader(':method'); + response.removeHeader(':method'); + response.setHeader(':method', 'GET'); + response.setHeader(':status', 200); + response.setHeader('some-list', ['', '']); + let headersSent: boolean = response.headersSent; + + response.setTimeout(0, () => {}); + response.createPushResponse(outgoingHeaders, (err: Error | null, res: http2.Http2ServerResponse) => {}); + + response.writeContinue(); + response.writeHead(200); + response.writeHead(200, outgoingHeaders); + response.writeHead(200, 'OK', outgoingHeaders); + response.writeHead(200, 'OK'); + response.write(''); + response.write('', (err: Error) => {}); + response.write('', 'utf8'); + response.write('', 'utf8', (err: Error) => {}); + response.write(Buffer.from([])); + response.write(Buffer.from([]), (err: Error) => {}); + response.write(Buffer.from([]), 'utf8'); + response.write(Buffer.from([]), 'utf8', (err: Error) => {}); + response.end(); + response.end(() => {}); + response.end(''); + response.end('', () => {}); + response.end('', 'utf8'); + response.end('', 'utf8', () => {}); + response.end(Buffer.from([])); + response.end(Buffer.from([]), () => {}); + response.end(Buffer.from([]), 'utf8'); + response.end(Buffer.from([]), 'utf8', () => {}); + + request.on('aborted', (hadError: boolean, code: number) => {}); + request.on('close', () => {}); + request.on('drain', () => {}); + request.on('error', (error: Error) => {}); + request.on('finish', () => {}); + }; + + let http2Server: http2.Http2Server; + let http2SecureServer: http2.Http2SecureServer; + + http2Server = http2.createServer(); + http2Server = http2.createServer(serverOptions); + http2Server = http2.createServer(onRequestHandler); + http2Server = http2.createServer(serverOptions, onRequestHandler); + + http2SecureServer = http2.createSecureServer(); + http2SecureServer = http2.createSecureServer(secureServerOptions); + http2SecureServer = http2.createSecureServer(onRequestHandler); + http2SecureServer = http2.createSecureServer(secureServerOptions, onRequestHandler); + + let clientSessionOptions: http2.ClientSessionOptions = { + maxDeflateDynamicTableSize: 0, + maxReservedRemoteStreams: 0, + maxSendHeaderBlockLength: 0, + paddingStrategy: 0, + peerMaxConcurrentStreams: 0, + selectPadding: (frameLen: number, maxFrameLen: number) => 0, + settings + }; + // tslint:disable-next-line prefer-object-spread (ts2.1 feature) + let secureClientSessionOptions: http2.SecureClientSessionOptions = Object.assign({}, clientSessionOptions); + secureClientSessionOptions.ca = ''; + let onConnectHandler = (session: http2.Http2Session, socket: net.Socket) => {}; + + let serverHttp2Session: http2.ServerHttp2Session; + + serverHttp2Session.altsvc('', ''); + serverHttp2Session.altsvc('', 0); + serverHttp2Session.altsvc('', new url.URL('')); + serverHttp2Session.altsvc('', { origin: '' }); + serverHttp2Session.altsvc('', { origin: 0 }); + serverHttp2Session.altsvc('', { origin: new url.URL('') }); + + let clientHttp2Session: http2.ClientHttp2Session; + + clientHttp2Session = http2.connect(''); + clientHttp2Session = http2.connect('', onConnectHandler); + clientHttp2Session = http2.connect('', clientSessionOptions); + clientHttp2Session = http2.connect('', clientSessionOptions, onConnectHandler); + clientHttp2Session = http2.connect('', secureClientSessionOptions); + clientHttp2Session = http2.connect('', secureClientSessionOptions, onConnectHandler); + clientHttp2Session.on('altsvc', (alt: string, origin: string, number: number) => {}); + + settings = http2.getDefaultSettings(); + settings = http2.getPackedSettings(settings); + settings = http2.getUnpackedSettings(Buffer.from([])); + settings = http2.getUnpackedSettings(Uint8Array.from([])); + } + + // constants + { + const constants = http2.constants; + let num: number; + let str: string; + num = constants.NGHTTP2_SESSION_SERVER; + num = constants.NGHTTP2_SESSION_CLIENT; + num = constants.NGHTTP2_STREAM_STATE_IDLE; + num = constants.NGHTTP2_STREAM_STATE_OPEN; + num = constants.NGHTTP2_STREAM_STATE_RESERVED_LOCAL; + num = constants.NGHTTP2_STREAM_STATE_RESERVED_REMOTE; + num = constants.NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL; + num = constants.NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE; + num = constants.NGHTTP2_STREAM_STATE_CLOSED; + num = constants.NGHTTP2_NO_ERROR; + num = constants.NGHTTP2_PROTOCOL_ERROR; + num = constants.NGHTTP2_INTERNAL_ERROR; + num = constants.NGHTTP2_FLOW_CONTROL_ERROR; + num = constants.NGHTTP2_SETTINGS_TIMEOUT; + num = constants.NGHTTP2_STREAM_CLOSED; + num = constants.NGHTTP2_FRAME_SIZE_ERROR; + num = constants.NGHTTP2_REFUSED_STREAM; + num = constants.NGHTTP2_CANCEL; + num = constants.NGHTTP2_COMPRESSION_ERROR; + num = constants.NGHTTP2_CONNECT_ERROR; + num = constants.NGHTTP2_ENHANCE_YOUR_CALM; + num = constants.NGHTTP2_INADEQUATE_SECURITY; + num = constants.NGHTTP2_HTTP_1_1_REQUIRED; + num = constants.NGHTTP2_ERR_FRAME_SIZE_ERROR; + num = constants.NGHTTP2_FLAG_NONE; + num = constants.NGHTTP2_FLAG_END_STREAM; + num = constants.NGHTTP2_FLAG_END_HEADERS; + num = constants.NGHTTP2_FLAG_ACK; + num = constants.NGHTTP2_FLAG_PADDED; + num = constants.NGHTTP2_FLAG_PRIORITY; + num = constants.DEFAULT_SETTINGS_HEADER_TABLE_SIZE; + num = constants.DEFAULT_SETTINGS_ENABLE_PUSH; + num = constants.DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE; + num = constants.DEFAULT_SETTINGS_MAX_FRAME_SIZE; + num = constants.MAX_MAX_FRAME_SIZE; + num = constants.MIN_MAX_FRAME_SIZE; + num = constants.MAX_INITIAL_WINDOW_SIZE; + num = constants.NGHTTP2_DEFAULT_WEIGHT; + num = constants.NGHTTP2_SETTINGS_HEADER_TABLE_SIZE; + num = constants.NGHTTP2_SETTINGS_ENABLE_PUSH; + num = constants.NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS; + num = constants.NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE; + num = constants.NGHTTP2_SETTINGS_MAX_FRAME_SIZE; + num = constants.NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE; + num = constants.PADDING_STRATEGY_NONE; + num = constants.PADDING_STRATEGY_MAX; + num = constants.PADDING_STRATEGY_CALLBACK; + num = constants.HTTP_STATUS_CONTINUE; + num = constants.HTTP_STATUS_SWITCHING_PROTOCOLS; + num = constants.HTTP_STATUS_PROCESSING; + num = constants.HTTP_STATUS_OK; + num = constants.HTTP_STATUS_CREATED; + num = constants.HTTP_STATUS_ACCEPTED; + num = constants.HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION; + num = constants.HTTP_STATUS_NO_CONTENT; + num = constants.HTTP_STATUS_RESET_CONTENT; + num = constants.HTTP_STATUS_PARTIAL_CONTENT; + num = constants.HTTP_STATUS_MULTI_STATUS; + num = constants.HTTP_STATUS_ALREADY_REPORTED; + num = constants.HTTP_STATUS_IM_USED; + num = constants.HTTP_STATUS_MULTIPLE_CHOICES; + num = constants.HTTP_STATUS_MOVED_PERMANENTLY; + num = constants.HTTP_STATUS_FOUND; + num = constants.HTTP_STATUS_SEE_OTHER; + num = constants.HTTP_STATUS_NOT_MODIFIED; + num = constants.HTTP_STATUS_USE_PROXY; + num = constants.HTTP_STATUS_TEMPORARY_REDIRECT; + num = constants.HTTP_STATUS_PERMANENT_REDIRECT; + num = constants.HTTP_STATUS_BAD_REQUEST; + num = constants.HTTP_STATUS_UNAUTHORIZED; + num = constants.HTTP_STATUS_PAYMENT_REQUIRED; + num = constants.HTTP_STATUS_FORBIDDEN; + num = constants.HTTP_STATUS_NOT_FOUND; + num = constants.HTTP_STATUS_METHOD_NOT_ALLOWED; + num = constants.HTTP_STATUS_NOT_ACCEPTABLE; + num = constants.HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED; + num = constants.HTTP_STATUS_REQUEST_TIMEOUT; + num = constants.HTTP_STATUS_CONFLICT; + num = constants.HTTP_STATUS_GONE; + num = constants.HTTP_STATUS_LENGTH_REQUIRED; + num = constants.HTTP_STATUS_PRECONDITION_FAILED; + num = constants.HTTP_STATUS_PAYLOAD_TOO_LARGE; + num = constants.HTTP_STATUS_URI_TOO_LONG; + num = constants.HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE; + num = constants.HTTP_STATUS_RANGE_NOT_SATISFIABLE; + num = constants.HTTP_STATUS_EXPECTATION_FAILED; + num = constants.HTTP_STATUS_TEAPOT; + num = constants.HTTP_STATUS_MISDIRECTED_REQUEST; + num = constants.HTTP_STATUS_UNPROCESSABLE_ENTITY; + num = constants.HTTP_STATUS_LOCKED; + num = constants.HTTP_STATUS_FAILED_DEPENDENCY; + num = constants.HTTP_STATUS_UNORDERED_COLLECTION; + num = constants.HTTP_STATUS_UPGRADE_REQUIRED; + num = constants.HTTP_STATUS_PRECONDITION_REQUIRED; + num = constants.HTTP_STATUS_TOO_MANY_REQUESTS; + num = constants.HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE; + num = constants.HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS; + num = constants.HTTP_STATUS_INTERNAL_SERVER_ERROR; + num = constants.HTTP_STATUS_NOT_IMPLEMENTED; + num = constants.HTTP_STATUS_BAD_GATEWAY; + num = constants.HTTP_STATUS_SERVICE_UNAVAILABLE; + num = constants.HTTP_STATUS_GATEWAY_TIMEOUT; + num = constants.HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED; + num = constants.HTTP_STATUS_VARIANT_ALSO_NEGOTIATES; + num = constants.HTTP_STATUS_INSUFFICIENT_STORAGE; + num = constants.HTTP_STATUS_LOOP_DETECTED; + num = constants.HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED; + num = constants.HTTP_STATUS_NOT_EXTENDED; + num = constants.HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED; + str = constants.HTTP2_HEADER_STATUS; + str = constants.HTTP2_HEADER_METHOD; + str = constants.HTTP2_HEADER_AUTHORITY; + str = constants.HTTP2_HEADER_SCHEME; + str = constants.HTTP2_HEADER_PATH; + str = constants.HTTP2_HEADER_ACCEPT_CHARSET; + str = constants.HTTP2_HEADER_ACCEPT_ENCODING; + str = constants.HTTP2_HEADER_ACCEPT_LANGUAGE; + str = constants.HTTP2_HEADER_ACCEPT_RANGES; + str = constants.HTTP2_HEADER_ACCEPT; + str = constants.HTTP2_HEADER_ACCESS_CONTROL_ALLOW_ORIGIN; + str = constants.HTTP2_HEADER_AGE; + str = constants.HTTP2_HEADER_ALLOW; + str = constants.HTTP2_HEADER_AUTHORIZATION; + str = constants.HTTP2_HEADER_CACHE_CONTROL; + str = constants.HTTP2_HEADER_CONNECTION; + str = constants.HTTP2_HEADER_CONTENT_DISPOSITION; + str = constants.HTTP2_HEADER_CONTENT_ENCODING; + str = constants.HTTP2_HEADER_CONTENT_LANGUAGE; + str = constants.HTTP2_HEADER_CONTENT_LENGTH; + str = constants.HTTP2_HEADER_CONTENT_LOCATION; + str = constants.HTTP2_HEADER_CONTENT_MD5; + str = constants.HTTP2_HEADER_CONTENT_RANGE; + str = constants.HTTP2_HEADER_CONTENT_TYPE; + str = constants.HTTP2_HEADER_COOKIE; + str = constants.HTTP2_HEADER_DATE; + str = constants.HTTP2_HEADER_ETAG; + str = constants.HTTP2_HEADER_EXPECT; + str = constants.HTTP2_HEADER_EXPIRES; + str = constants.HTTP2_HEADER_FROM; + str = constants.HTTP2_HEADER_HOST; + str = constants.HTTP2_HEADER_IF_MATCH; + str = constants.HTTP2_HEADER_IF_MODIFIED_SINCE; + str = constants.HTTP2_HEADER_IF_NONE_MATCH; + str = constants.HTTP2_HEADER_IF_RANGE; + str = constants.HTTP2_HEADER_IF_UNMODIFIED_SINCE; + str = constants.HTTP2_HEADER_LAST_MODIFIED; + str = constants.HTTP2_HEADER_LINK; + str = constants.HTTP2_HEADER_LOCATION; + str = constants.HTTP2_HEADER_MAX_FORWARDS; + str = constants.HTTP2_HEADER_PREFER; + str = constants.HTTP2_HEADER_PROXY_AUTHENTICATE; + str = constants.HTTP2_HEADER_PROXY_AUTHORIZATION; + str = constants.HTTP2_HEADER_RANGE; + str = constants.HTTP2_HEADER_REFERER; + str = constants.HTTP2_HEADER_REFRESH; + str = constants.HTTP2_HEADER_RETRY_AFTER; + str = constants.HTTP2_HEADER_SERVER; + str = constants.HTTP2_HEADER_SET_COOKIE; + str = constants.HTTP2_HEADER_STRICT_TRANSPORT_SECURITY; + str = constants.HTTP2_HEADER_TRANSFER_ENCODING; + str = constants.HTTP2_HEADER_TE; + str = constants.HTTP2_HEADER_UPGRADE; + str = constants.HTTP2_HEADER_USER_AGENT; + str = constants.HTTP2_HEADER_VARY; + str = constants.HTTP2_HEADER_VIA; + str = constants.HTTP2_HEADER_WWW_AUTHENTICATE; + str = constants.HTTP2_HEADER_HTTP2_SETTINGS; + str = constants.HTTP2_HEADER_KEEP_ALIVE; + str = constants.HTTP2_HEADER_PROXY_CONNECTION; + str = constants.HTTP2_METHOD_ACL; + str = constants.HTTP2_METHOD_BASELINE_CONTROL; + str = constants.HTTP2_METHOD_BIND; + str = constants.HTTP2_METHOD_CHECKIN; + str = constants.HTTP2_METHOD_CHECKOUT; + str = constants.HTTP2_METHOD_CONNECT; + str = constants.HTTP2_METHOD_COPY; + str = constants.HTTP2_METHOD_DELETE; + str = constants.HTTP2_METHOD_GET; + str = constants.HTTP2_METHOD_HEAD; + str = constants.HTTP2_METHOD_LABEL; + str = constants.HTTP2_METHOD_LINK; + str = constants.HTTP2_METHOD_LOCK; + str = constants.HTTP2_METHOD_MERGE; + str = constants.HTTP2_METHOD_MKACTIVITY; + str = constants.HTTP2_METHOD_MKCALENDAR; + str = constants.HTTP2_METHOD_MKCOL; + str = constants.HTTP2_METHOD_MKREDIRECTREF; + str = constants.HTTP2_METHOD_MKWORKSPACE; + str = constants.HTTP2_METHOD_MOVE; + str = constants.HTTP2_METHOD_OPTIONS; + str = constants.HTTP2_METHOD_ORDERPATCH; + str = constants.HTTP2_METHOD_PATCH; + str = constants.HTTP2_METHOD_POST; + str = constants.HTTP2_METHOD_PRI; + str = constants.HTTP2_METHOD_PROPFIND; + str = constants.HTTP2_METHOD_PROPPATCH; + str = constants.HTTP2_METHOD_PUT; + str = constants.HTTP2_METHOD_REBIND; + str = constants.HTTP2_METHOD_REPORT; + str = constants.HTTP2_METHOD_SEARCH; + str = constants.HTTP2_METHOD_TRACE; + str = constants.HTTP2_METHOD_UNBIND; + str = constants.HTTP2_METHOD_UNCHECKOUT; + str = constants.HTTP2_METHOD_UNLINK; + str = constants.HTTP2_METHOD_UNLOCK; + str = constants.HTTP2_METHOD_UPDATE; + str = constants.HTTP2_METHOD_UPDATEREDIRECTREF; + str = constants.HTTP2_METHOD_VERSION_CONTROL; + } +} + +/////////////////////////////////////////////////////////// +/// Inspector Tests /// +/////////////////////////////////////////////////////////// + +namespace inspector_tests { + { + inspector.open(); + inspector.open(0); + inspector.open(0, 'localhost'); + inspector.open(0, 'localhost', true); + inspector.close(); + const inspectorUrl: string = inspector.url(); + + const session = new inspector.Session(); + session.connect(); + session.disconnect(); + + // Unknown post method + session.post('A.b', { key: 'value' }, (err, params) => {}); + // TODO: parameters are implicitly 'any' and need type annotation + session.post('A.b', (err: Error | null, params?: {}) => {}); + session.post('A.b'); + // Known post method + const parameter: inspector.Runtime.EvaluateParameterType = { expression: '2 + 2' }; + session.post('Runtime.evaluate', parameter, + (err: Error, params: inspector.Runtime.EvaluateReturnType) => {}); + session.post('Runtime.evaluate', (err: Error, params: inspector.Runtime.EvaluateReturnType) => { + const exceptionDetails: inspector.Runtime.ExceptionDetails = params.exceptionDetails; + const resultClassName: string = params.result.className; + }); + session.post('Runtime.evaluate'); + + // General event + session.on('inspectorNotification', message => { + message; // $ExpectType InspectorNotification<{}> + }); + // Known events + session.on('Debugger.paused', (message: inspector.InspectorNotification) => { + const method: string = message.method; + const pauseReason: string = message.params.reason; + }); + session.on('Debugger.resumed', () => {}); + } +} + +//////////////////////////////////////////////////// +/// module tests : http://nodejs.org/api/modules.html +//////////////////////////////////////////////////// + +namespace module_tests { + require.extensions[".ts"] = () => ""; + + Module.runMain(); + const s: string = Module.wrap("some code"); + + const m1: Module = new Module("moduleId"); + const m2: Module = new Module.Module("moduleId"); + const b: string[] = Module.builtinModules; + let paths: string[] = module.paths; + paths = m1.paths; +} + +//////////////////////////////////////////////////// +/// Node.js ESNEXT Support +//////////////////////////////////////////////////// + +namespace esnext_string_tests { + const s: string = 'foo'; + const s1: string = s.trimLeft(); + const s2: string = s.trimRight(); +} diff --git a/types/node/v9/tsconfig.json b/types/node/v9/tsconfig.json new file mode 100644 index 0000000000..8752b2560b --- /dev/null +++ b/types/node/v9/tsconfig.json @@ -0,0 +1,29 @@ +{ + "files": [ + "index.d.ts", + "node-tests.ts" + ], + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "node": [ + "node/v9" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + } +} \ No newline at end of file diff --git a/types/node/v9/tslint.json b/types/node/v9/tslint.json new file mode 100644 index 0000000000..45064d266f --- /dev/null +++ b/types/node/v9/tslint.json @@ -0,0 +1,26 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + // All are TODOs + "ban-types": false, + "dt-header": false, + "max-line-length": false, + "no-any-union": false, + "no-duplicate-imports": false, + "no-duplicate-variable": false, + "no-empty-interface": false, + "no-inferrable-types": false, + "no-internal-module": false, + "no-namespace": false, + "no-redundant-jsdoc": false, + "no-redundant-jsdoc-2": false, + "no-unnecessary-class": false, + "no-unnecessary-generics": false, + "no-unnecessary-qualifier": false, + "no-var-keyword": false, + "prefer-const": false, + "prefer-method-signature": false, + "strict-export-declare-modifiers": false, + "unified-signatures": false + } +} From 492f2dc66d6d9946b1ac513c94b851c746d43711 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 26 Apr 2018 09:13:42 -0700 Subject: [PATCH 126/564] Add html-tag-names --- types/html-tag-names/html-tag-names-tests.ts | 3 +++ types/html-tag-names/index.d.ts | 2 ++ types/html-tag-names/tsconfig.json | 23 ++++++++++++++++++++ types/html-tag-names/tslint.json | 1 + 4 files changed, 29 insertions(+) create mode 100644 types/html-tag-names/html-tag-names-tests.ts create mode 100644 types/html-tag-names/index.d.ts create mode 100644 types/html-tag-names/tsconfig.json create mode 100644 types/html-tag-names/tslint.json diff --git a/types/html-tag-names/html-tag-names-tests.ts b/types/html-tag-names/html-tag-names-tests.ts new file mode 100644 index 0000000000..96916aa58a --- /dev/null +++ b/types/html-tag-names/html-tag-names-tests.ts @@ -0,0 +1,3 @@ +import htmlTagNames = require("html-tag-names"); +htmlTagNames.length; //=> 147 +const firstNames: string[] = htmlTagNames.slice(0, 20); diff --git a/types/html-tag-names/index.d.ts b/types/html-tag-names/index.d.ts new file mode 100644 index 0000000000..bc7b39a193 --- /dev/null +++ b/types/html-tag-names/index.d.ts @@ -0,0 +1,2 @@ +declare const htmlTagNames: string[]; +export = htmlTagNames; diff --git a/types/html-tag-names/tsconfig.json b/types/html-tag-names/tsconfig.json new file mode 100644 index 0000000000..05cded79c8 --- /dev/null +++ b/types/html-tag-names/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "html-tag-names-tests.ts" + ] +} diff --git a/types/html-tag-names/tslint.json b/types/html-tag-names/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/html-tag-names/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 21d07f0fcfe33b45ac44efcd508af63353ce8744 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 26 Apr 2018 09:18:33 -0700 Subject: [PATCH 127/564] Add author header --- types/html-tag-names/index.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/html-tag-names/index.d.ts b/types/html-tag-names/index.d.ts index bc7b39a193..e48dda7733 100644 --- a/types/html-tag-names/index.d.ts +++ b/types/html-tag-names/index.d.ts @@ -1,2 +1,6 @@ +// Type definitions for html-tag-names 1.1.2 +// Project: https://github.com/wooorm/html-tag-names +// Definitions by: Nathan Shively-Sanders +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare const htmlTagNames: string[]; export = htmlTagNames; From 9e86892aed09bc22ea45b39c268cf565808bbad0 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 26 Apr 2018 09:21:48 -0700 Subject: [PATCH 128/564] Fix lint --- types/html-tag-names/html-tag-names-tests.ts | 2 +- types/html-tag-names/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/html-tag-names/html-tag-names-tests.ts b/types/html-tag-names/html-tag-names-tests.ts index 96916aa58a..b3362a6b7e 100644 --- a/types/html-tag-names/html-tag-names-tests.ts +++ b/types/html-tag-names/html-tag-names-tests.ts @@ -1,3 +1,3 @@ import htmlTagNames = require("html-tag-names"); -htmlTagNames.length; //=> 147 +htmlTagNames.length; // => 147 const firstNames: string[] = htmlTagNames.slice(0, 20); diff --git a/types/html-tag-names/index.d.ts b/types/html-tag-names/index.d.ts index e48dda7733..8c9558edb7 100644 --- a/types/html-tag-names/index.d.ts +++ b/types/html-tag-names/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for html-tag-names 1.1.2 +// Type definitions for html-tag-names 1.1 // Project: https://github.com/wooorm/html-tag-names // Definitions by: Nathan Shively-Sanders // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 2f6852e9934b141c4e4c81396240cc956a56285e Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Thu, 26 Apr 2018 19:27:03 +0200 Subject: [PATCH 129/564] cucumber: Transform should support multiple matches and use World as this context (#25326) * cucumber: Transform interface supports multiple matches * cucumber: Use World as this in Transform --- types/cucumber/cucumber-tests.ts | 20 ++++++++++++++++++++ types/cucumber/index.d.ts | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/types/cucumber/cucumber-tests.ts b/types/cucumber/cucumber-tests.ts index b7fa675095..41a52c6d61 100644 --- a/types/cucumber/cucumber-tests.ts +++ b/types/cucumber/cucumber-tests.ts @@ -11,6 +11,7 @@ const Status = cucumber.Status; declare module "cucumber" { interface World { visit(url: string, callback: CallbackStepDefinition): void; + toInt(value: string): number; } } @@ -21,6 +22,7 @@ function StepSampleWithoutDefineSupportCode() { this.visit = (url: string, callback: Callback) => { callback(null, 'pending'); }; + this.toInt = parseInt; }); Before((scenarioResult: HookScenarioResult, callback: Callback) => { @@ -164,6 +166,24 @@ function StepSampleWithoutDefineSupportCode() { useForSnippets: false }); + defineParameterType({ + regexp: /(one) (two)/, + transformer: (x, y) => x + y, + name: 'param', + preferForRegexpMatch: false, + useForSnippets: false + }); + + defineParameterType({ + regexp: /123/, + transformer(val) { + return this.toInt(val); + }, + name: 'param', + preferForRegexpMatch: false, + useForSnippets: false + }); + Given('a {param} step', param => { assert.equal(param, 'PARTICULAR'); }); diff --git a/types/cucumber/index.d.ts b/types/cucumber/index.d.ts index 03dda3d736..8cfed3ef31 100644 --- a/types/cucumber/index.d.ts +++ b/types/cucumber/index.d.ts @@ -129,7 +129,7 @@ export type GlobalHookCode = (callback?: CallbackStepDefinition) => void; export interface Transform { regexp: RegExp; - transformer(arg: string): any; + transformer(this: World, ...arg: string[]): any; useForSnippets?: boolean; preferForRegexpMatch?: boolean; name?: string; From b67b2df1d9fbc7a5fabfe9cc1dbb36b856ae1b3d Mon Sep 17 00:00:00 2001 From: Simon Schick Date: Thu, 26 Apr 2018 19:28:20 +0200 Subject: [PATCH 130/564] fix(hapi-auth-jwt2): allow validate and verify to return directly (#25306) --- types/hapi-auth-jwt2/hapi-auth-jwt2-tests.ts | 11 ++++++++++- types/hapi-auth-jwt2/index.d.ts | 12 +++++++----- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/types/hapi-auth-jwt2/hapi-auth-jwt2-tests.ts b/types/hapi-auth-jwt2/hapi-auth-jwt2-tests.ts index cf51162eb4..50b17e8db6 100644 --- a/types/hapi-auth-jwt2/hapi-auth-jwt2-tests.ts +++ b/types/hapi-auth-jwt2/hapi-auth-jwt2-tests.ts @@ -32,7 +32,7 @@ server.register({ .then(() => { const opts: hapiAuthJwt2.Options = { key: 'NeverShareYourSecret', - async validate(decoded: { id: number }, request) { + async validate(decoded: { id: number }) { return { isValid: !!users[decoded.id], }; @@ -42,5 +42,14 @@ server.register({ issuer: 'test', } }; + const opts2: hapiAuthJwt2.Options = { + key: 'NeverShareYourSecret2', + validate(decoded: { id: number }) { + return { + isValid: !!users[decoded.id], + }; + } + }; server.auth.strategy('jwt', 'jwt', opts); + server.auth.strategy('jwt2', 'jwt', opts2); }); diff --git a/types/hapi-auth-jwt2/index.d.ts b/types/hapi-auth-jwt2/index.d.ts index a93f740bfc..f980cfa6e9 100644 --- a/types/hapi-auth-jwt2/index.d.ts +++ b/types/hapi-auth-jwt2/index.d.ts @@ -39,6 +39,12 @@ declare namespace hapiAuthJwt2 { }; } + interface ValidationResult { + isValid: boolean; + credentials?: any; + response?: ResponseObject; + } + /** * Options passed to `hapi.auth.strategy` when this plugin is used */ @@ -54,11 +60,7 @@ declare namespace hapiAuthJwt2 { * @param decoded the *decoded* and *verified* JWT received from the client in *request.headers.authorization* * @param request the original *request* received from the client */ - validate(decoded: {}, request: Request, tk: ResponseToolkit): Promise<{ - isValid: boolean; - credentials?: any; - response?: ResponseObject - }>; + validate(decoded: {}, request: Request, tk: ResponseToolkit): ValidationResult | Promise; /** * Settings to define how tokens are verified by the jsonwebtoken library From 4abbfb42ff02fbdf3584f6285238d82c4ccbeb14 Mon Sep 17 00:00:00 2001 From: Tanguy Krotoff Date: Thu, 26 Apr 2018 19:30:30 +0200 Subject: [PATCH 131/564] [react-native] Switch to *real* components + rename Properties to Props (#25307) * Switch from var to const * import React instead of /// * Fix TextInput and remove TextInputStatic See #16318 [react-native] Wrong type for component ref * Remove TextStatic * Remove ActivityIndicatorStatic * Remove ActivityIndicatorIOSStatic * Remove DatePickerIOSStatic * Remove DrawerLayoutAndroidStatic * Remove ImageStatic * Remove ImageBackgroundStatic * Remove InputAccessoryViewStatic * Remove ListViewStatic * Remove MapViewStatic * Remove MaskedViewStatic * Remove ModalStatic * Remove NavigatorIOSStatic * Remove PickerStatic * Remove PickerIOSStatic * Remove ProgressBarAndroidStatic * Remove ProgressViewIOSStatic * Remove RefreshControlStatic * Remove RecyclerViewBackedScrollViewStatic * Remove SafeAreaViewStatic * Remove SegmentedControlIOSStatic * Remove SliderStatic * Remove StatusBarStatic * Remove ScrollViewStatic * Remove SnapshotViewIOSStatic * Remove SwipeableListViewStatic * Remove SwitchStatic * Remove SwitchIOSStatic * Remove TabBarIOSStatic * Remove ToolbarAndroidStatic * Remove TouchableHighlightStatic * Remove TouchableNativeFeedbackStatic * Remove TouchableOpacityStatic * Remove TouchableWithoutFeedbackStatic * Remove ViewStatic * Remove ViewPagerAndroidStatic * Remove WebViewStatic * Remove ButtonStatic * Remove ClippingRectangleStatic, GroupStatic, ShapeStatic, SurfaceStatic, ARTTextStatic, ARTTextStatic * Remove KeyboardAvoidingViewStatic * Remove FlatListStatic * Rename TextProperties and friends to *Props * Rename TextInputProperties and friends to *Props * Rename WebViewProperties and friends to *Props * Rename *Properties to *Props * Rename ScrollViewProperties and friends to *Props * Improve DatePickerAndroid.open() * Rename ImagePropertiesSourceOptions to ImageSourcePropType * Rename MaskedViewProps to MaskedViewIOSProps * Rename PointProperties to PointPropType * Rename TabBarItem to TabBarIOSItem * Remove internal *Properties * ImagePropertiesSourceOptions => ImagePropsSourceOptions * Merge fail: react-native-linear-gradient has been removed * Rename ImageProperties to ImageProps * Update authors list * Remove ImagePropsSourceOptions * Move *Properties redirections to legacy-properties.d.ts --- types/expo/index.d.ts | 10 +- types/expo/v23/index.d.ts | 10 +- types/expo/v24/index.d.ts | 10 +- types/expo__vector-icons/index.d.ts | 2 +- types/react-native-drawer-layout/index.d.ts | 4 +- types/react-native-elevated-view/index.d.ts | 2 +- types/react-native-google-signin/index.d.ts | 4 +- .../index.d.ts | 4 +- types/react-native-material-kit/index.d.ts | 32 +- types/react-native-photo-view/index.d.ts | 8 +- .../index.d.ts | 4 +- types/react-native-snap-carousel/index.d.ts | 16 +- types/react-native-vector-icons/Icon.d.ts | 22 +- types/react-native-vector-icons/index.d.ts | 2 +- types/react-native-video/index.d.ts | 4 +- types/react-native/index.d.ts | 563 ++++++++---------- types/react-native/legacy-properties.d.ts | 286 +++++++++ types/react-native/test/ART.tsx | 29 + types/react-native/test/index.tsx | 35 +- types/react-native/test/legacy-properties.tsx | 5 + types/react-native/tsconfig.json | 4 +- types/react-navigation/index.d.ts | 4 +- .../react-router-native-tests.tsx | 4 +- types/react-router-navigation/index.d.ts | 4 +- 24 files changed, 660 insertions(+), 408 deletions(-) create mode 100644 types/react-native/legacy-properties.d.ts create mode 100644 types/react-native/test/ART.tsx create mode 100644 types/react-native/test/legacy-properties.tsx diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index c5beebd7f0..8093b52861 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -16,7 +16,7 @@ import { ImageRequireSource, ImageURISource, NativeEventEmitter, - ViewProperties, + ViewProps, ViewStyle, Permission, StyleProp @@ -624,7 +624,7 @@ export class PlaybackObject { /** * BarCodeScanner */ -export interface BarCodeScannerProps extends ViewProperties { +export interface BarCodeScannerProps extends ViewProps { type?: 'front' | 'back'; torchMode?: 'on' | 'off'; barCodeTypes?: string[]; @@ -645,7 +645,7 @@ export class BarCodeScanner extends Component { /** * BlurView */ -export interface BlurViewProps extends ViewProperties { +export interface BlurViewProps extends ViewProps { tint: 'light' | 'default' | 'dark'; intensity: number; } @@ -691,7 +691,7 @@ export class CameraObject { getSupportedRatiosAsync(): Promise; // Android only } -export interface CameraProps extends ViewProperties { +export interface CameraProps extends ViewProps { zoom?: FloatFromZeroToOne; ratio?: string; focusDepth?: FloatFromZeroToOne; @@ -1316,7 +1316,7 @@ export namespace Font { /** * GLView */ -export interface GLViewProps extends ViewProperties { +export interface GLViewProps extends ViewProps { onContextCreate(): void; msaaSamples: number; } diff --git a/types/expo/v23/index.d.ts b/types/expo/v23/index.d.ts index 78de7bf415..322c1b3c6a 100644 --- a/types/expo/v23/index.d.ts +++ b/types/expo/v23/index.d.ts @@ -8,7 +8,7 @@ import { EventSubscription } from 'fbemitter'; import { Component, Ref } from 'react'; import { ViewStyle, - ViewProperties, + ViewProps, ColorPropType, ImageURISource, NativeEventEmitter, @@ -341,7 +341,7 @@ export class AppLoading extends Component { } /** * BarCodeScanner */ -export interface BarCodeScannerProps extends ViewProperties { +export interface BarCodeScannerProps extends ViewProps { type?: 'front' | 'back'; torchMode?: 'on' | 'off'; barCodeTypes?: string[]; @@ -353,7 +353,7 @@ export class BarCodeScanner extends Component { } /** * BlurView */ -export interface BlurViewProps extends ViewProperties { +export interface BlurViewProps extends ViewProps { tint: 'light' | 'default' | 'dark'; intensity: number; } @@ -396,7 +396,7 @@ export class CameraObject { stopRecording(): void; getSupportedRatiosAsync(): Promise; // Android only } -export interface CameraProperties extends ViewProperties { +export interface CameraProperties extends ViewProps { flashMode?: string | number; type?: string | number; ratio?: string; @@ -896,7 +896,7 @@ export namespace Font { /** * GLView */ -export interface GLViewProps extends ViewProperties { +export interface GLViewProps extends ViewProps { onContextCreate(): void; msaaSamples: number; } diff --git a/types/expo/v24/index.d.ts b/types/expo/v24/index.d.ts index 0647519da4..e6a238d129 100644 --- a/types/expo/v24/index.d.ts +++ b/types/expo/v24/index.d.ts @@ -15,7 +15,7 @@ import { ImageRequireSource, ImageURISource, NativeEventEmitter, - ViewProperties, + ViewProps, ViewStyle, Permission, StyleProp @@ -623,7 +623,7 @@ export class PlaybackObject { /** * BarCodeScanner */ -export interface BarCodeScannerProps extends ViewProperties { +export interface BarCodeScannerProps extends ViewProps { type?: 'front' | 'back'; torchMode?: 'on' | 'off'; barCodeTypes?: string[]; @@ -644,7 +644,7 @@ export class BarCodeScanner extends Component { /** * BlurView */ -export interface BlurViewProps extends ViewProperties { +export interface BlurViewProps extends ViewProps { tint: 'light' | 'default' | 'dark'; intensity: number; } @@ -690,7 +690,7 @@ export class CameraObject { getSupportedRatiosAsync(): Promise; // Android only } -export interface CameraProps extends ViewProperties { +export interface CameraProps extends ViewProps { flashMode?: string | number; type?: string | number; ratio?: string; @@ -1302,7 +1302,7 @@ export namespace Font { /** * GLView */ -export interface GLViewProps extends ViewProperties { +export interface GLViewProps extends ViewProps { onContextCreate(): void; msaaSamples: number; } diff --git a/types/expo__vector-icons/index.d.ts b/types/expo__vector-icons/index.d.ts index 864ae1d0cc..19aadf2a33 100644 --- a/types/expo__vector-icons/index.d.ts +++ b/types/expo__vector-icons/index.d.ts @@ -5,7 +5,7 @@ // TypeScript Version: 2.6 import * as React from 'react'; -import { TextProperties } from 'react-native'; +import { TextProps } from 'react-native'; export { createIconSet, createIconSetFromFontello, createIconSetFromIcoMoon } from 'react-native-vector-icons'; export { default as Entypo } from 'react-native-vector-icons/Entypo'; diff --git a/types/react-native-drawer-layout/index.d.ts b/types/react-native-drawer-layout/index.d.ts index e77bcb268c..af3a05698e 100644 --- a/types/react-native-drawer-layout/index.d.ts +++ b/types/react-native-drawer-layout/index.d.ts @@ -5,7 +5,7 @@ // TypeScript Version: 2.6 import * as React from 'react'; -import { ViewProperties } from 'react-native'; +import { ViewProps } from 'react-native'; export type DrawerLayoutOpenEventHandler = () => void; @@ -21,7 +21,7 @@ export type DrawerLayoutSlideEventHandler = (event: DrawerLayoutSlideEvent) => v export type DrawerLayoutStateChangeEventHandler = (state: string) => void; -export interface DrawerLayoutProperties extends ViewProperties { +export interface DrawerLayoutProperties extends ViewProps { /** * Child content. */ diff --git a/types/react-native-elevated-view/index.d.ts b/types/react-native-elevated-view/index.d.ts index 4ad853294b..e9ac2b1103 100644 --- a/types/react-native-elevated-view/index.d.ts +++ b/types/react-native-elevated-view/index.d.ts @@ -7,7 +7,7 @@ import * as React from 'react'; import * as ReactNative from 'react-native'; -export interface ElevatedViewProperties extends ReactNative.ViewProperties { +export interface ElevatedViewProperties extends ReactNative.ViewProps { elevation?: number; } diff --git a/types/react-native-google-signin/index.d.ts b/types/react-native-google-signin/index.d.ts index c99a767b8a..862a40a35a 100644 --- a/types/react-native-google-signin/index.d.ts +++ b/types/react-native-google-signin/index.d.ts @@ -5,9 +5,9 @@ // TypeScript Version: 2.6 import * as React from 'react'; -import { ViewProperties } from 'react-native'; +import { ViewProps } from 'react-native'; -export interface GoogleSigninButtonProps extends ViewProperties { +export interface GoogleSigninButtonProps extends ViewProps { size?: GoogleSigninButton.Size; color?: GoogleSigninButton.Color; onPress?(): void; diff --git a/types/react-native-material-design-searchbar/index.d.ts b/types/react-native-material-design-searchbar/index.d.ts index 3c2aad9c51..23b3204c76 100644 --- a/types/react-native-material-design-searchbar/index.d.ts +++ b/types/react-native-material-design-searchbar/index.d.ts @@ -6,7 +6,7 @@ import * as React from 'react'; import { - TextInputProperties, + TextInputProps, ReturnKeyType, ReturnKeyTypeAndroid, TextStyle, @@ -28,7 +28,7 @@ export interface SearchBarProps { placeholderColor?: string; iconColor?: string; textStyle?: TextStyle; - inputProps?: TextInputProperties; + inputProps?: TextInputProps; alwaysShowBackButton?: boolean; onSearchChange?(text: string): void; onClose?(): void; diff --git a/types/react-native-material-kit/index.d.ts b/types/react-native-material-kit/index.d.ts index 79379e599a..f820d8e4cd 100644 --- a/types/react-native-material-kit/index.d.ts +++ b/types/react-native-material-kit/index.d.ts @@ -9,9 +9,9 @@ import * as React from 'react'; import { ViewStyle, TextStyle, - TextInputProperties, - TouchableWithoutFeedbackProperties, - ViewProperties, + TextInputProps, + TouchableWithoutFeedbackProps, + ViewProps, } from 'react-native'; /////////////////////////////// @@ -178,7 +178,7 @@ export namespace MKPropTypes { type rippleLocation = 'tapLocation' | 'center'; } -export interface TickProperties extends ViewProperties { +export interface TickProperties extends ViewProps { fillColor?: string; inset?: number; } @@ -251,12 +251,12 @@ export interface MKColorStatic { } export interface MKButtonProperties extends - TouchableWithoutFeedbackProperties, MKRippleProperties { + TouchableWithoutFeedbackProps, MKRippleProperties { fab?: boolean; enabled?: boolean; } -export interface MKTextFieldProperties extends TextInputProperties, FloatingLabelProperties { +export interface MKTextFieldProperties extends TextInputProps, FloatingLabelProperties { text?: string; password?: boolean; underlineEnabled?: boolean; @@ -265,11 +265,11 @@ export interface MKTextFieldProperties extends TextInputProperties, FloatingLabe tintColor?: string; textInputStyle?: TextStyle; allowFontScaling?: boolean; - additionalInputProps?: TextInputProperties; + additionalInputProps?: TextInputProps; onTextChange?(val: string): void; } -export interface MKSwitchProperties extends TouchableWithoutFeedbackProperties { +export interface MKSwitchProperties extends TouchableWithoutFeedbackProps { checked?: boolean; onColor?: string; offColor?: string; @@ -284,12 +284,12 @@ export interface MKSwitchProperties extends TouchableWithoutFeedbackProperties { onCheckedChange?(checked: boolean): void; } -export interface MKIconToggleProperties extends MKRippleProperties, TouchableWithoutFeedbackProperties { +export interface MKIconToggleProperties extends MKRippleProperties, TouchableWithoutFeedbackProps { checked?: boolean; onCheckedChange?(checked: boolean): void; } -export interface MKRippleProperties extends ViewProperties { +export interface MKRippleProperties extends ViewProps { rippleColor?: string; rippleDuration?: number; rippleLocation?: MKPropTypes.rippleLocation; @@ -301,7 +301,7 @@ export interface MKRippleProperties extends ViewProperties { shadowAniEnabled?: boolean; } -export interface MKProgressProperties extends ViewProperties { +export interface MKProgressProperties extends ViewProps { progress?: number; buffer?: number; progressColor?: string; @@ -310,12 +310,12 @@ export interface MKProgressProperties extends ViewProperties { bufferAniDuration?: number; } -export interface IndeterminateProgressProperties extends ViewProperties { +export interface IndeterminateProgressProperties extends ViewProps { progressColor?: string; progressAniDuration?: number; } -export interface BaseSlider extends ViewProperties { +export interface BaseSlider extends ViewProps { min?: number; max?: number; value?: number; @@ -340,13 +340,13 @@ export interface MKRangeSliderProperties extends BaseSlider { onChange?(curValue: { min: number, max: number }): void; } -export interface MKSpinnerProperties extends ViewProperties { +export interface MKSpinnerProperties extends ViewProps { strokeColor?: string; strokeWidth?: number; spinnerAniDuration?: number; } -export interface MKRadioButtonProperties extends MKRippleProperties, TouchableWithoutFeedbackProperties { +export interface MKRadioButtonProperties extends MKRippleProperties, TouchableWithoutFeedbackProps { borderOnColor?: string; borderOffColor?: string; fillColor?: string; @@ -356,7 +356,7 @@ export interface MKRadioButtonProperties extends MKRippleProperties, TouchableWi onCheckedChange?(opts: { checked: boolean }): void; } -export interface MKCheckboxProperties extends MKRippleProperties, TickProperties, TouchableWithoutFeedbackProperties { +export interface MKCheckboxProperties extends MKRippleProperties, TickProperties, TouchableWithoutFeedbackProps { borderOnColor?: string; borderOffColor?: string; fillColor?: string; diff --git a/types/react-native-photo-view/index.d.ts b/types/react-native-photo-view/index.d.ts index 8979635288..c3f27d78a6 100644 --- a/types/react-native-photo-view/index.d.ts +++ b/types/react-native-photo-view/index.d.ts @@ -5,11 +5,11 @@ // TypeScript Version: 2.6 import * as React from 'react'; -import { ImagePropertiesSourceOptions, ViewProperties } from 'react-native'; +import { ImageSourcePropType, ViewProps } from 'react-native'; export interface ReactNativePhotoViewProps { - source?: ImagePropertiesSourceOptions; - loadingIndicatorSource?: ImagePropertiesSourceOptions; + source?: ImageSourcePropType; + loadingIndicatorSource?: ImageSourcePropType; fadeDuration?: number; minimumZoomScale?: number; maximumZoomScale?: number; @@ -27,4 +27,4 @@ export interface ReactNativePhotoViewProps { onScale?: (scale: number, target?: React.ReactElement) => void; } -export default class ReactNativePhotoView extends React.Component {} +export default class ReactNativePhotoView extends React.Component {} diff --git a/types/react-native-scrollable-tab-view/index.d.ts b/types/react-native-scrollable-tab-view/index.d.ts index b18ee374a9..962ba8a810 100644 --- a/types/react-native-scrollable-tab-view/index.d.ts +++ b/types/react-native-scrollable-tab-view/index.d.ts @@ -6,7 +6,7 @@ // TypeScript Version: 2.6 import * as React from 'react'; -import { Animated, ScrollViewProperties, ViewStyle, TextStyle } from 'react-native'; +import { Animated, ScrollViewProps, ViewStyle, TextStyle } from 'react-native'; export interface ScrollableTabViewProperties extends React.Props { /** @@ -88,7 +88,7 @@ export interface ScrollableTabViewProperties extends React.Props>; + carouselRef?: React.Component>; itemHeight?: number; itemWidth?: number; scrollPosition?: Animated.Value; @@ -30,7 +30,7 @@ export interface AdditionalParallaxProps { vertical?: boolean; } -export interface CarouselProps extends React.Props { +export interface CarouselProps extends React.Props { // Required /** @@ -278,9 +278,9 @@ export interface CarouselStatic extends React.ComponentClass triggerRenderingHack(offset: number): void; } -export type CarouselProperties = ScrollViewProperties & CarouselProps & React.Props>; +export type CarouselProperties = ScrollViewProps & CarouselProps & React.Props>; -export interface ParallaxImageProps extends ImageProperties, AdditionalParallaxProps { +export interface ParallaxImageProps extends ImageProps, AdditionalParallaxProps { /** * Optional style for image's container */ @@ -330,7 +330,7 @@ export interface PaginationProps { * Reference to the Carousel component to which pagination is linked. * Needed only when setting tappableDots to true */ - carouselRef?: React.Component>; + carouselRef?: React.Component>; /** * Style for dots' container that will be merged with the default one */ diff --git a/types/react-native-vector-icons/Icon.d.ts b/types/react-native-vector-icons/Icon.d.ts index 4b64503452..455a3269b0 100644 --- a/types/react-native-vector-icons/Icon.d.ts +++ b/types/react-native-vector-icons/Icon.d.ts @@ -2,14 +2,14 @@ import * as React from 'react'; import { TextStyle, ViewStyle, - TextProperties, - TouchableHighlightProperties, - TouchableNativeFeedbackProperties, - TabBarItemProperties, - ToolbarAndroidProperties + TextProps, + TouchableHighlightProps, + TouchableNativeFeedbackProps, + TabBarIOSItemProps, + ToolbarAndroidProps } from 'react-native'; -export interface IconProps extends TextProperties { +export interface IconProps extends TextProps { /** * Size of the icon, can also be passed as fontSize in the style object. * @@ -32,7 +32,7 @@ export interface IconProps extends TextProperties { color?: string; } -export interface IconButtonProps extends IconProps, TouchableHighlightProperties, TouchableNativeFeedbackProperties { +export interface IconButtonProps extends IconProps, TouchableHighlightProps, TouchableNativeFeedbackProps { /** * Text and icon color * Use iconStyle or nest a Text component if you need different colors. @@ -58,7 +58,7 @@ export interface IconButtonProps extends IconProps, TouchableHighlightProperties iconStyle?: ViewStyle; /** - * Style prop inherited from TextProperties and TouchableWithoutFeedbackProperties + * Style prop inherited from TextProps and TouchableWithoutFeedbackProperties * Only exist here so we can have ViewStyle or TextStyle * */ @@ -74,7 +74,7 @@ export interface IconButtonProps extends IconProps, TouchableHighlightProperties export type ImageSource = any; -export interface ToolbarAndroidProps extends ToolbarAndroidProperties { +export interface ToolbarAndroidProps extends ToolbarAndroidProps { /** * Name of the navigation logo icon * (similar to ToolbarAndroid logo) @@ -111,7 +111,7 @@ export interface ToolbarAndroidProps extends ToolbarAndroidProperties { iconColor: string; } -export interface TabBarItemIOSProps extends TabBarItemProperties { +export interface TabBarItemIOSProps extends TabBarIOSItemProps { /** * Name of the default icon (similar to TabBarIOS.Item icon) * @@ -164,7 +164,7 @@ export class Icon extends React.Component { export namespace Icon { class ToolbarAndroid extends React.Component {} - class TabBarItem extends React.Component {} + class TabBarItem extends React.Component {} class TabBarItemIOS extends React.Component {} class Button extends React.Component {} } diff --git a/types/react-native-vector-icons/index.d.ts b/types/react-native-vector-icons/index.d.ts index 2a2ef8fdce..60e6408d18 100644 --- a/types/react-native-vector-icons/index.d.ts +++ b/types/react-native-vector-icons/index.d.ts @@ -7,7 +7,7 @@ import * as React from 'react'; import { Icon } from './Icon'; -import { TextProperties } from 'react-native'; +import { TextProps } from 'react-native'; /** * Returns your own custom font based on the glyphMap where the key is the icon name diff --git a/types/react-native-video/index.d.ts b/types/react-native-video/index.d.ts index 3ca2dc80fb..25a58a3e00 100644 --- a/types/react-native-video/index.d.ts +++ b/types/react-native-video/index.d.ts @@ -6,7 +6,7 @@ import * as React from 'react'; import { - ViewProperties + ViewProps } from 'react-native'; export interface OnLoadData { @@ -32,7 +32,7 @@ export interface LoadError { }; } -export interface VideoProperties extends ViewProperties { +export interface VideoProperties extends ViewProps { /* Native only */ src?: any; seek?: number; diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index fe73c7abae..ebd75b2089 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -9,6 +9,7 @@ // Alex Dunne // Manuel Alabor // Michele Bombardi +// Tanguy Krotoff // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -25,9 +26,12 @@ /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// +/// import * as React from 'react'; +type Constructor = new(...args: any[]) => T; + export type MeasureOnSuccessCallback = ( x: number, y: number, @@ -411,7 +415,8 @@ export interface NativeTouchEvent { export interface GestureResponderEvent extends NativeSyntheticEvent {} -export interface PointProperties { +// See https://facebook.github.io/react-native/docs/scrollview.html#contentoffset +export interface PointPropType { x: number; y: number; } @@ -605,7 +610,7 @@ export interface FlexStyle { * @see https://facebook.github.io/react-native/docs/layout-props.html * @see LayoutPropTypes.js */ -export interface LayoutProperties extends FlexStyle {} +export interface LayoutProps extends FlexStyle {} /** * @see ShadowPropTypesIOS.js @@ -751,7 +756,7 @@ export interface LayoutRectangle { height: number; } -// @see TextProperties.onLayout +// @see TextProps.onLayout export interface LayoutChangeEvent { nativeEvent: { layout: LayoutRectangle; @@ -794,7 +799,7 @@ export interface TextStyle extends TextStyleIOS, TextStyleAndroid, ViewStyle { testID?: string; } -export interface TextPropertiesIOS { +export interface TextPropsIOS { /** * Specifies whether fonts should scale to respect Text Size accessibility setting on iOS. The * default is `true`. @@ -818,7 +823,7 @@ export interface TextPropertiesIOS { suppressHighlighting?: boolean; } -export interface TextPropertiesAndroid { +export interface TextPropsAndroid { /** * Lets the user select text, to use the native copy and paste functionality. */ @@ -837,7 +842,7 @@ export interface TextPropertiesAndroid { } // https://facebook.github.io/react-native/docs/text.html#props -export interface TextProperties extends TextPropertiesIOS, TextPropertiesAndroid, AccessibilityProperties { +export interface TextProps extends TextPropsIOS, TextPropsAndroid, AccessibilityProps { /** * This can be one of the following values: * @@ -905,7 +910,9 @@ export interface TextProperties extends TextPropertiesIOS, TextPropertiesAndroid /** * A React component for displaying text which supports nesting, styling, and touch handling. */ -export interface TextStatic extends NativeMethodsMixin, React.ClassicComponentClass {} +declare class TextComponent extends React.Component {} +declare const TextBase: Constructor & typeof TextComponent; +export class Text extends TextBase {} type DataDetectorTypes = "phoneNumber" | "link" | "address" | "calendarEvent" | "none" | "all"; @@ -952,7 +959,7 @@ export interface DocumentSelectionState extends EventEmitter { * IOS Specific properties for TextInput * @see https://facebook.github.io/react-native/docs/textinput.html#props */ -export interface TextInputIOSProperties { +export interface TextInputIOSProps { /** * enum('never', 'while-editing', 'unless-editing', 'always') * When the clear button should appear on the right side of the text view @@ -1015,7 +1022,7 @@ export interface TextInputIOSProperties { * Android Specific properties for TextInput * @see https://facebook.github.io/react-native/docs/textinput.html#props */ -export interface TextInputAndroidProperties { +export interface TextInputAndroidProps { /** * When false, if there is a small amount of space available around a text input (e.g. landscape orientation on a phone), * the OS may choose to have the user edit the text inside of a full screen text input mode. @@ -1079,8 +1086,8 @@ export type ReturnKeyTypeOptions = ReturnKeyType | ReturnKeyTypeAndroid | Return /** * @see https://facebook.github.io/react-native/docs/textinput.html#props */ -export interface TextInputProperties - extends ViewProperties, TextInputIOSProperties, TextInputAndroidProperties, AccessibilityProperties { +export interface TextInputProps + extends ViewProps, TextInputIOSProps, TextInputAndroidProps, AccessibilityProps { /** * Can tell TextInput to automatically capitalize certain characters. * characters: all characters, @@ -1297,7 +1304,9 @@ interface TextInputState { /** * @see https://facebook.github.io/react-native/docs/textinput.html#methods */ -export interface TextInputStatic extends NativeMethodsMixin, TimerMixin, React.ComponentClass { +declare class TextInputComponent extends React.Component {} +declare const TextInputBase: Constructor & Constructor & typeof TextInputComponent; +export class TextInput extends TextInputBase { State: TextInputState; /** @@ -1333,7 +1342,7 @@ export type ToolbarAndroidAction = { showWithText?: boolean; }; -export interface ToolbarAndroidProperties extends ViewProperties { +export interface ToolbarAndroidProps extends ViewProps { /** * Sets possible actions on the toolbar as part of the action menu. These are displayed as icons * or text on the right side of the widget. If they don't fit they are placed in an 'overflow' @@ -1446,7 +1455,9 @@ export interface ToolbarAndroidProperties extends ViewProperties { * * [0]: https://developer.android.com/reference/android/support/v7/widget/Toolbar.html */ -export interface ToolbarAndroidStatic extends NativeMethodsMixin, React.ComponentClass {} +declare class ToolbarAndroidComponent extends React.Component {} +declare const ToolbarAndroidBase: Constructor & typeof ToolbarAndroidComponent; +export class ToolbarAndroid extends ToolbarAndroidBase {} /** * Gesture recognition on mobile devices is much more complicated than web. @@ -1595,7 +1606,7 @@ export interface ViewStyle extends FlexStyle, TransformsStyle { testID?: string; } -export interface ViewPropertiesIOS { +export interface ViewPropsIOS { /** * A Boolean value indicating whether VoiceOver should ignore the elements within views that are siblings of the receiver. * @platform ios @@ -1628,7 +1639,7 @@ export interface ViewPropertiesIOS { shouldRasterizeIOS?: boolean; } -export interface ViewPropertiesAndroid { +export interface ViewPropsAndroid { /** * Views that are only used to layout their children or otherwise don't draw anything * may be automatically removed from the native hierarchy as an optimization. @@ -1671,7 +1682,7 @@ export type StyleProp = T | RegisteredStyle | RecursiveArray, android.view, etc. */ -export interface ViewStatic extends NativeMethodsMixin, React.ClassicComponentClass { +declare class ViewComponent extends React.Component {} +declare const ViewBase: Constructor & typeof ViewComponent; +export class View extends ViewBase { /** * Is 3D Touch / Force Touch available (i.e. will touch events include `force`) * @platform ios @@ -1849,7 +1862,7 @@ export interface ViewPagerAndroidOnPageSelectedEventData { position: number; } -export interface ViewPagerAndroidProperties extends ViewProperties { +export interface ViewPagerAndroidProps extends ViewProps { /** * Index of initial page that should be selected. Use `setPage` method to * update the page, and `onPageSelected` to monitor page changes @@ -1905,7 +1918,9 @@ export interface ViewPagerAndroidProperties extends ViewProperties { pageMargin?: number; } -export interface ViewPagerAndroidStatic extends NativeMethodsMixin, React.ComponentClass { +declare class ViewPagerAndroidComponent extends React.Component {} +declare const ViewPagerAndroidBase: Constructor & typeof ViewPagerAndroidComponent; +export class ViewPagerAndroid extends ViewPagerAndroidBase { /** * A helper function to scroll to a specific page in the ViewPager. * The transition between pages will be animated. @@ -1923,11 +1938,11 @@ export interface ViewPagerAndroidStatic extends NativeMethodsMixin, React.Compon * It is a component to solve the common problem of views that need to move out of the way of the virtual keyboard. * It can automatically adjust either its position or bottom padding based on the position of the keyboard. */ -export interface KeyboardAvoidingViewStatic - extends TimerMixin, - React.ClassicComponentClass {} +declare class KeyboardAvoidingViewComponent extends React.Component {} +declare const KeyboardAvoidingViewBase: Constructor & typeof KeyboardAvoidingViewComponent; +export class KeyboardAvoidingView extends KeyboardAvoidingViewBase {} -export interface KeyboardAvoidingViewProps extends ViewProperties { +export interface KeyboardAvoidingViewProps extends ViewProps { behavior?: "height" | "position" | "padding"; /** @@ -1965,7 +1980,7 @@ export interface WebViewMessageEventData { data: string; } -export interface WebViewPropertiesAndroid { +export interface WebViewPropsAndroid { /** * Used for android only, JS is enabled by default for WebView on iOS */ @@ -2003,7 +2018,7 @@ export interface WebViewIOSLoadRequestEvent { url: string; } -export interface WebViewPropertiesIOS { +export interface WebViewPropsIOS { /** * Determines whether HTML5 videos play inline or use the native * full-screen controller. default value false @@ -2104,7 +2119,7 @@ export interface WebViewHtmlSource { /** * @see https://facebook.github.io/react-native/docs/webview.html#props */ -export interface WebViewProperties extends ViewProperties, WebViewPropertiesAndroid, WebViewPropertiesIOS { +export interface WebViewProps extends ViewProps, WebViewPropsAndroid, WebViewPropsIOS { /** * Controls whether to adjust the content inset for web views that are * placed behind a navigation bar, tab bar, or toolbar. The default value @@ -2162,12 +2177,12 @@ export interface WebViewProperties extends ViewProperties, WebViewPropertiesAndr /** * Function that returns a view to show if there's an error. */ - renderError?: () => React.ReactElement; + renderError?: () => React.ReactElement; /** * Function that returns a loading indicator. */ - renderLoading?: () => React.ReactElement; + renderLoading?: () => React.ReactElement; /** * Boolean value that forces the `WebView` to show the loading view @@ -2194,7 +2209,7 @@ export interface WebViewProperties extends ViewProperties, WebViewPropertiesAndr scalesPageToFit?: boolean; } -export interface WebViewStatic extends React.ClassicComponentClass { +export class WebView extends React.Component { /** * Go back one page in the webview's history. */ @@ -2241,7 +2256,7 @@ export interface NativeSegmentedControlIOSChangeEvent { target: number; } -export interface SegmentedControlIOSProperties extends ViewProperties { +export interface SegmentedControlIOSProps extends ViewProps { /** * If false the user won't be able to interact with the control. Default value is true. */ @@ -2286,7 +2301,9 @@ export interface SegmentedControlIOSProperties extends ViewProperties { * Moreover, and most importantly, Safe Area's paddings feflect physical limitation of the screen, * such as rounded corners or camera notches (aka sensor housing area on iPhone X). */ -export interface SafeAreaViewStatic extends NativeMethodsMixin, React.ClassicComponentClass {} +declare class SafeAreaViewComponent extends React.Component {} +declare const SafeAreaViewBase: Constructor & typeof SafeAreaViewComponent; +export class SafeAreaView extends SafeAreaViewBase {} /** @@ -2296,9 +2313,9 @@ export interface SafeAreaViewStatic extends NativeMethodsMixin, React.ClassicCom * To use this component wrap your custom toolbar with the InputAccessoryView component, and set a nativeID. Then, pass * that nativeID as the inputAccessoryViewID of whatever TextInput you desire. */ -export interface InputAccessoryViewStatic extends React.ClassicComponentClass {} +export class InputAccessoryView extends React.Component {} -export interface InputAccessoryViewProperties { +export interface InputAccessoryViewProps { backgroundColor?: string; /** @@ -2329,11 +2346,11 @@ export interface InputAccessoryViewProperties { * /> * ```` */ -export interface SegmentedControlIOSStatic - extends NativeMethodsMixin, - React.ClassicComponentClass {} +declare class SegmentedControlIOSComponent extends React.Component {} +declare const SegmentedControlIOSBase: Constructor & typeof SegmentedControlIOSComponent; +export class SegmentedControlIOS extends SegmentedControlIOSBase {} -export interface NavigatorIOSProperties { +export interface NavigatorIOSProps { /** * The default background color of the navigation bar. */ @@ -2403,7 +2420,7 @@ export interface NavigatorIOSProperties { * * @see https://facebook.github.io/react-native/docs/navigatorios.html#navigator */ -export interface NavigationIOS { +export class NavigatorIOS extends React.Component { /** * Navigate forward to a new route */ @@ -2450,12 +2467,10 @@ export interface NavigationIOS { popToTop(): void; } -export interface NavigatorIOSStatic extends NavigationIOS, React.ComponentClass {} - /** * @see https://facebook.github.io/react-native/docs/activityindicator.html#props */ -export interface ActivityIndicatorProperties extends ViewProperties { +export interface ActivityIndicatorProps extends ViewProps { /** * Whether to show the indicator (true, the default) or hide it (false). */ @@ -2482,14 +2497,14 @@ export interface ActivityIndicatorProperties extends ViewProperties { style?: StyleProp; } -export interface ActivityIndicatorStatic - extends NativeMethodsMixin, - React.ClassicComponentClass {} +declare class ActivityIndicatorComponent extends React.Component {} +declare const ActivityIndicatorBase: Constructor & typeof ActivityIndicatorComponent; +export class ActivityIndicator extends ActivityIndicatorBase {} /** * @see https://facebook.github.io/react-native/docs/activityindicatorios.html#props */ -export interface ActivityIndicatorIOSProperties extends ViewProperties { +export interface ActivityIndicatorIOSProps extends ViewProps { /** * Whether to show the indicator (true, the default) or hide it (false). */ @@ -2524,9 +2539,9 @@ export interface ActivityIndicatorIOSProperties extends ViewProperties { /** * @Deprecated since version 0.28.0 */ -export interface ActivityIndicatorIOSStatic extends React.ComponentClass {} +export class ActivityIndicatorIOS extends React.Component {} -export interface DatePickerIOSProperties extends ViewProperties { +export interface DatePickerIOSProps extends ViewProps { /** * The currently selected date. */ @@ -2576,14 +2591,16 @@ export interface DatePickerIOSProperties extends ViewProperties { timeZoneOffsetInMinutes?: number; } -export interface DatePickerIOSStatic extends NativeMethodsMixin, React.ComponentClass {} +declare class DatePickerIOSComponent extends React.Component {} +declare const DatePickerIOSBase: Constructor & typeof DatePickerIOSComponent; +export class DatePickerIOS extends TextInputBase {} export interface DrawerSlideEvent extends NativeSyntheticEvent {} /** * @see DrawerLayoutAndroid.android.js */ -export interface DrawerLayoutAndroidProperties extends ViewProperties { +export interface DrawerLayoutAndroidProps extends ViewProps { /** * Specifies the background color of the drawer. The default value * is white. If you want to set the opacity of the drawer, use rgba. @@ -2677,9 +2694,9 @@ interface DrawerPosition { Right: number; } -export interface DrawerLayoutAndroidStatic - extends NativeMethodsMixin, - React.ClassicComponentClass { +declare class DrawerLayoutAndroidComponent extends React.Component {} +declare const DrawerLayoutAndroidBase: Constructor & typeof DrawerLayoutAndroidComponent; +export class DrawerLayoutAndroid extends DrawerLayoutAndroidBase { /** * drawer's positions. */ @@ -2699,7 +2716,7 @@ export interface DrawerLayoutAndroidStatic /** * @see PickerIOS.ios.js */ -export interface PickerIOSItemProperties { +export interface PickerIOSItemProps { value?: string | number; label?: string; } @@ -2707,21 +2724,21 @@ export interface PickerIOSItemProperties { /** * @see PickerIOS.ios.js */ -export interface PickerIOSItemStatic extends React.ComponentClass {} +export class PickerIOSItem extends React.Component {} /** * @see Picker.js */ -export interface PickerItemProperties { +export interface PickerItemProps { testID?: string; color?: string; label: string; value?: any; } -export interface PickerItem extends React.ComponentClass {} +export class PickerItem extends React.Component {} -export interface PickerPropertiesIOS extends ViewProperties { +export interface PickerPropsIOS extends ViewProps { /** * Style to apply to each of the item labels. * @platform ios @@ -2729,7 +2746,7 @@ export interface PickerPropertiesIOS extends ViewProperties { itemStyle?: StyleProp; } -export interface PickerPropertiesAndroid extends ViewProperties { +export interface PickerPropsAndroid extends ViewProps { /** * If set to false, the picker will be disabled, i.e. the user will not be able to make a * selection. @@ -2758,7 +2775,7 @@ export interface PickerPropertiesAndroid extends ViewProperties { * @see https://facebook.github.io/react-native/docs/picker.html * @see Picker.js */ -export interface PickerProperties extends PickerPropertiesIOS, PickerPropertiesAndroid { +export interface PickerProps extends PickerPropsIOS, PickerPropsAndroid { /** * Callback for when an item is selected. This is called with the * following parameters: @@ -2785,7 +2802,7 @@ export interface PickerProperties extends PickerPropertiesIOS, PickerPropertiesA * @see https://facebook.github.io/react-native/docs/picker.html * @see Picker.js */ -export interface PickerStatic extends React.ComponentClass { +export class Picker extends React.Component { /** * On Android, display the options in a dialog. */ @@ -2795,14 +2812,14 @@ export interface PickerStatic extends React.ComponentClass { */ MODE_DROPDOWN: string; - Item: PickerItem; + static Item: typeof PickerItem; } /** * @see https://facebook.github.io/react-native/docs/pickerios.html * @see PickerIOS.ios.js */ -export interface PickerIOSProperties extends ViewProperties { +export interface PickerIOSProps extends ViewProps { itemStyle?: StyleProp; onValueChange?: (value: string | number) => void; selectedValue?: string | number; @@ -2812,15 +2829,17 @@ export interface PickerIOSProperties extends ViewProperties { * @see https://facebook.github.io/react-native/docs/pickerios.html * @see PickerIOS.ios.js */ -export interface PickerIOSStatic extends NativeMethodsMixin, React.ClassicComponentClass { - Item: PickerIOSItemStatic; +declare class PickerIOSComponent extends React.Component {} +declare const PickerIOSBase: Constructor & typeof PickerIOSComponent; +export class PickerIOS extends PickerIOSBase { + static Item: typeof PickerIOSItem; } /** * @see https://facebook.github.io/react-native/docs/progressbarandroid.html * @see ProgressBarAndroid.android.js */ -export interface ProgressBarAndroidProperties extends ViewProperties { +export interface ProgressBarAndroidProps extends ViewProps { /** * Style of the ProgressBar. One of: Horizontal @@ -2858,15 +2877,15 @@ export interface ProgressBarAndroidProperties extends ViewProperties { * React component that wraps the Android-only `ProgressBar`. This component is used to indicate * that the app is loading or there is some activity in the app. */ -export interface ProgressBarAndroidStatic - extends NativeMethodsMixin, - React.ClassicComponentClass {} +declare class ProgressBarAndroidComponent extends React.Component {} +declare const ProgressBarAndroidBase: Constructor & typeof ProgressBarAndroidComponent; +export class ProgressBarAndroid extends ProgressBarAndroidBase {} /** * @see https://facebook.github.io/react-native/docs/progressviewios.html * @see ProgressViewIOS.ios.js */ -export interface ProgressViewIOSProperties extends ViewProperties { +export interface ProgressViewIOSProps extends ViewProps { /** * The progress bar style. */ @@ -2897,11 +2916,11 @@ export interface ProgressViewIOSProperties extends ViewProperties { */ trackImage?: ImageURISource | ImageURISource[]; } -export interface ProgressViewIOSStatic - extends NativeMethodsMixin, - React.ClassicComponentClass {} +declare class ProgressViewIOSComponent extends React.Component {} +declare const ProgressViewIOSBase: Constructor & typeof ProgressViewIOSComponent; +export class ProgressViewIOS extends ProgressViewIOSBase {} -export interface RefreshControlPropertiesIOS extends ViewProperties { +export interface RefreshControlPropsIOS extends ViewProps { /** * The color of the refresh indicator. */ @@ -2918,7 +2937,7 @@ export interface RefreshControlPropertiesIOS extends ViewProperties { titleColor?: string; } -export interface RefreshControlPropertiesAndroid extends ViewProperties { +export interface RefreshControlPropsAndroid extends ViewProps { /** * The colors (at least one) that will be used to draw the refresh indicator. */ @@ -2946,7 +2965,7 @@ export interface RefreshControlPropertiesAndroid extends ViewProperties { progressViewOffset?: number; } -export interface RefreshControlProperties extends RefreshControlPropertiesIOS, RefreshControlPropertiesAndroid { +export interface RefreshControlProps extends RefreshControlPropsIOS, RefreshControlPropsAndroid { /** * Called when the view starts refreshing. */ @@ -2966,13 +2985,13 @@ export interface RefreshControlProperties extends RefreshControlPropertiesIOS, R * __Note:__ `refreshing` is a controlled prop, this is why it needs to be set to true * in the `onRefresh` function otherwise the refresh indicator will stop immediately. */ -export interface RefreshControlStatic - extends NativeMethodsMixin, - React.ClassicComponentClass { +declare class RefreshControlComponent extends React.Component {} +declare const RefreshControlBase: Constructor & typeof RefreshControlComponent; +export class RefreshControl extends RefreshControlBase { SIZE: Object; // Undocumented } -export interface RecyclerViewBackedScrollViewProperties extends ScrollViewProperties {} +export interface RecyclerViewBackedScrollViewProps extends ScrollViewProps {} /** * Wrapper around android native recycler view. @@ -2988,9 +3007,9 @@ export interface RecyclerViewBackedScrollViewProperties extends ScrollViewProper * use it pass this component as `renderScrollComponent` to the list view. For * now only horizontal scrolling is supported. */ -export interface RecyclerViewBackedScrollViewStatic - extends ScrollResponderMixin, - React.ClassicComponentClass { +declare class RecyclerViewBackedScrollViewComponent extends React.Component {} +declare const RecyclerViewBackedScrollViewBase: Constructor & typeof RecyclerViewBackedScrollViewComponent; +export class RecyclerViewBackedScrollView extends RecyclerViewBackedScrollViewBase { /** * A helper function to scroll to a specific point in the scrollview. * This is currently used to help focus on child textviews, but can also @@ -3013,14 +3032,14 @@ export interface RecyclerViewBackedScrollViewStatic getScrollResponder(): JSX.Element; } -export interface SliderPropertiesAndroid extends ViewProperties { +export interface SliderPropsAndroid extends ViewProps { /** * Color of the foreground switch grip. */ thumbTintColor?: string; } -export interface SliderPropertiesIOS extends ViewProperties { +export interface SliderPropsIOS extends ViewProps { /** * Assigns a maximum track image. Only static images are supported. * The leftmost pixel of the image will be stretched to fill the track. @@ -3046,7 +3065,7 @@ export interface SliderPropertiesIOS extends ViewProperties { trackImage?: ImageURISource; } -export interface SliderProperties extends SliderPropertiesIOS, SliderPropertiesAndroid { +export interface SliderProps extends SliderPropsIOS, SliderPropsAndroid { /** * If true the user won't be able to move the slider. * Default value is false. @@ -3113,12 +3132,15 @@ export interface SliderProperties extends SliderPropertiesIOS, SliderPropertiesA /** * A component used to select a single value from a range of values. */ -export interface SliderStatic extends NativeMethodsMixin, React.ClassicComponentClass {} +declare class SliderComponent extends React.Component {} +declare const SliderBase: Constructor & typeof SliderComponent; +export class Slider extends TextBase {} +export type SliderIOS = Slider; /** * https://facebook.github.io/react-native/docs/switchios.html#props */ -export interface SwitchIOSProperties extends ViewProperties { +export interface SwitchIOSProps extends ViewProps { /** * If true the user won't be able to toggle the switch. Default value is false. */ @@ -3159,7 +3181,7 @@ export interface SwitchIOSProperties extends ViewProperties { * * @see https://facebook.github.io/react-native/docs/switchios.html */ -export interface SwitchIOSStatic extends React.ComponentClass {} +export class SwitchIOS extends React.Component {} export type ImageResizeMode = "contain" | "cover" | "stretch" | "center" | "repeat"; @@ -3293,7 +3315,7 @@ export interface ImageURISource { export type ImageRequireSource = number; -export interface ImagePropertiesIOS { +export interface ImagePropsIOS { /** * blurRadius: the blur radius of the blur filter added to the image * @platform ios @@ -3327,7 +3349,7 @@ export interface ImagePropertiesIOS { onPartialLoad?: () => void; } -interface ImagePropertiesAndroid { +interface ImagePropsAndroid { /** * The mechanism that should be used to resize the image when the image's dimensions * differ from the image view's dimensions. Defaults to auto. @@ -3349,11 +3371,13 @@ interface ImagePropertiesAndroid { fadeDuration?: number; } +// See https://facebook.github.io/react-native/docs/image.html#source +export type ImageSourcePropType = ImageURISource | ImageURISource[] | ImageRequireSource; + /** * @see https://facebook.github.io/react-native/docs/image.html */ -export type ImagePropertiesSourceOptions = ImageURISource | ImageURISource[] | ImageRequireSource; -export interface ImageProperties extends ImagePropertiesIOS, ImagePropertiesAndroid, AccessibilityProperties, LayoutProperties { +export interface ImageProps extends ImagePropsIOS, ImagePropsAndroid, AccessibilityProps, LayoutProps { /** * onLayout function * @@ -3441,14 +3465,15 @@ export interface ImageProperties extends ImagePropertiesIOS, ImagePropertiesAndr resizeMethod?: "auto" | "resize" | "scale"; /** - * `uri` is a string representing the resource identifier for the image, which - * could be an http address, a local file path, or a static image - * resource (which should be wrapped in the `require('./path/to/image.png')` function). - * This prop can also contain several remote `uri`, specified together with - * their width and height. The native side will then choose the best `uri` to display - * based on the measured size of the image container. + * The image source (either a remote URL or a local file resource). + * + * This prop can also contain several remote URLs, specified together with their width and height and potentially with scale/other URI arguments. + * The native side will then choose the best uri to display based on the measured size of the image container. + * A cache property can be added to control how networked request interacts with the local cache. + * + * The currently supported formats are png, jpg, jpeg, bmp, gif, webp (Android only), psd (iOS only). */ - source: ImagePropertiesSourceOptions; + source: ImageSourcePropType; /** * similarly to `source`, this property represents the resource used to render @@ -3469,7 +3494,9 @@ export interface ImageProperties extends ImagePropertiesIOS, ImagePropertiesAndr testID?: string; } -export interface ImageStatic extends NativeMethodsMixin, React.ComponentClass { +declare class ImageComponent extends React.Component {} +declare const ImageBase: Constructor & typeof ImageComponent; +export class Image extends ImageBase { resizeMode: ImageResizeMode; getSize(uri: string, success: (width: number, height: number) => void, failure: (error: any) => void): any; prefetch(url: string): any; @@ -3477,12 +3504,14 @@ export interface ImageStatic extends NativeMethodsMixin, React.ComponentClass>; } -export interface ImageBackgroundProperties extends ImageProperties { +export interface ImageBackgroundProps extends ImageProps { style?: StyleProp; imageStyle?: StyleProp; } -export interface ImageBackgroundStatic extends NativeMethodsMixin, React.ComponentClass { +declare class ImageBackgroundComponent extends React.Component {} +declare const ImageBackgroundBase: Constructor & typeof ImageBackgroundComponent; +export class ImageBackground extends ImageBackgroundBase { resizeMode: ImageResizeMode; getSize(uri: string, success: (width: number, height: number) => void, failure: (error: any) => void): any; prefetch(url: string): any; @@ -3545,7 +3574,7 @@ export interface ListRenderItemInfo { export type ListRenderItem = (info: ListRenderItemInfo) => React.ReactElement | null; -export interface FlatListProperties extends VirtualizedListProperties { +export interface FlatListProps extends VirtualizedListProps { /** * Rendered in between each item, but not at the top or bottom */ @@ -3693,7 +3722,7 @@ export interface FlatListProperties extends VirtualizedListProperties extends React.ComponentClass> { +export class FlatList extends React.Component> { /** * Exports some data, e.g. for perf investigations or analytics. */ @@ -3762,7 +3791,7 @@ export interface SectionListScrollParams { viewPosition?: number; } -export interface SectionListProperties extends ScrollViewProperties { +export interface SectionListProps extends ScrollViewProps { /** * Rendered in between adjacent Items within each section. */ @@ -3856,7 +3885,7 @@ export interface SectionListProperties extends ScrollViewProperties { /** * Render a custom scroll component, e.g. with a differently styled `RefreshControl`. */ - renderScrollComponent?: (props: ScrollViewProperties) => React.ReactElement; + renderScrollComponent?: (props: ScrollViewProps) => React.ReactElement; /** * Note: may have bugs (missing content) in some circumstances - use at your own risk. @@ -3879,12 +3908,12 @@ export interface SectionListProperties extends ScrollViewProperties { scrollToLocation?(params: SectionListScrollParams): void; } -export interface SectionListStatic extends React.ComponentClass> {} +export interface SectionListStatic extends React.ComponentClass> {} /** * @see https://facebook.github.io/react-native/docs/virtualizedlist.html#props */ -export interface VirtualizedListProperties extends ScrollViewProperties { +export interface VirtualizedListProps extends ScrollViewProps { /** * Rendered when the list is empty. Can be a React Component Class, a render function, or * a rendered element. @@ -4033,7 +4062,7 @@ export interface VirtualizedListProperties extends ScrollViewProperties { /** * Render a custom scroll component, e.g. with a differently styled `RefreshControl`. */ - renderScrollComponent?: (props: ScrollViewProperties) => React.ReactElement; + renderScrollComponent?: (props: ScrollViewProps) => React.ReactElement; /** * Amount of time between low-pri item render batches, e.g. for rendering items quite a ways off @@ -4056,7 +4085,7 @@ export interface VirtualizedListProperties extends ScrollViewProperties { /** * @see https://facebook.github.io/react-native/docs/listview.html#props */ -export interface ListViewProperties extends ScrollViewProperties { +export interface ListViewProps extends ScrollViewProps { /** * An instance of [ListView.DataSource](docs/listviewdatasource.html) to use */ @@ -4154,7 +4183,7 @@ export interface ListViewProperties extends ScrollViewProperties { * A function that returns the scrollable component in which the list rows are rendered. * Defaults to returning a ScrollView with the given props. */ - renderScrollComponent?: (props: ScrollViewProperties) => React.ReactElement; + renderScrollComponent?: (props: ScrollViewProps) => React.ReactElement; /** * (sectionData, sectionID) => renderable @@ -4216,7 +4245,9 @@ interface TimerMixin { cancelAnimationFrame: typeof cancelAnimationFrame; } -export interface ListViewStatic extends ScrollResponderMixin, TimerMixin, React.ComponentClass { +declare class ListViewComponent extends React.Component {} +declare const ListViewBase: Constructor & Constructor & typeof ListViewComponent; +export class ListView extends ListViewBase { DataSource: ListViewDataSource; /** @@ -4280,7 +4311,7 @@ export interface MapViewOverlay { id?: string; } -export interface MapViewProperties extends ViewProperties { +export interface MapViewProps extends ViewProps { /** * If false points of interest won't be displayed on the map. * Default value is true. @@ -4405,7 +4436,9 @@ export interface MapViewProperties extends ViewProperties { /** * @see https://facebook.github.io/react-native/docs/mapview.html#content */ -export interface MapViewStatic extends NativeMethodsMixin, React.ComponentClass { +declare class MapViewComponent extends React.Component {} +declare const MapViewBase: Constructor & typeof MapViewComponent; +export class MapView extends MapViewBase { PinColors: { RED: string; GREEN: string; @@ -4413,16 +4446,18 @@ export interface MapViewStatic extends NativeMethodsMixin, React.ComponentClass< }; } -interface MaskedViewProperties extends ViewProperties { +interface MaskedViewIOSProps extends ViewProps { maskElement: React.ReactElement; } /** * @see https://facebook.github.io/react-native/docs/maskedviewios.html */ -export interface MaskedViewStatic extends NativeMethodsMixin, React.ComponentClass {} +declare class MaskedViewComponent extends React.Component {} +declare const MaskedViewBase: Constructor & typeof MaskedViewComponent; +export class MaskedViewIOS extends MaskedViewBase {} -export interface ModalProperties { +export interface ModalProps { // Only `animated` is documented. The JS code says `animated` is // deprecated and `animationType` is preferred. animated?: boolean; @@ -4481,7 +4516,7 @@ export interface ModalProperties { presentationStyle?: "fullScreen" | "pageSheet" | "formSheet" | "overFullScreen"; } -export interface ModalStatic extends React.ComponentClass {} +export class Modal extends React.Component {} /** * @see https://github.com/facebook/react-native/blob/0.34-stable\Libraries\Components\Touchable\Touchable.js @@ -4544,7 +4579,7 @@ interface TouchableMixin { /** * @see https://facebook.github.io/react-native/docs/touchablewithoutfeedback.html#props */ -export interface TouchableWithoutFeedbackProperties extends AccessibilityProperties { +export interface TouchableWithoutFeedbackProps extends AccessibilityProps { /** * Delay in ms, from onPressIn, before onLongPress is called. */ @@ -4613,8 +4648,6 @@ export interface TouchableWithoutFeedbackProperties extends AccessibilityPropert testID?: string; } -export interface TouchableWithoutFeedbackProps extends TouchableWithoutFeedbackProperties {} - /** * Do not use unless you have a very good reason. * All the elements that respond to press should have a visual feedback when touched. @@ -4622,15 +4655,14 @@ export interface TouchableWithoutFeedbackProps extends TouchableWithoutFeedbackP * * @see https://facebook.github.io/react-native/docs/touchablewithoutfeedback.html */ -export interface TouchableWithoutFeedbackStatic - extends TimerMixin, - TouchableMixin, - React.ClassicComponentClass {} +declare class TouchableWithoutFeedbackComponent extends React.Component {} +declare const TouchableWithoutFeedbackBase: Constructor & Constructor & typeof TouchableWithoutFeedbackComponent; +export class TouchableWithoutFeedback extends TouchableWithoutFeedbackBase {} /** * @see https://facebook.github.io/react-native/docs/touchablehighlight.html#props */ -export interface TouchableHighlightProperties extends TouchableWithoutFeedbackProperties { +export interface TouchableHighlightProps extends TouchableWithoutFeedbackProps { /** * Determines what the opacity of the wrapped view should be when touch is active. */ @@ -4671,16 +4703,14 @@ export interface TouchableHighlightProperties extends TouchableWithoutFeedbackPr * * @see https://facebook.github.io/react-native/docs/touchablehighlight.html */ -export interface TouchableHighlightStatic - extends NativeMethodsMixin, - TimerMixin, - TouchableMixin, - React.ClassicComponentClass {} +declare class TouchableHighlightComponent extends React.Component {} +declare const TouchableHighlightBase: Constructor & Constructor & Constructor & typeof TouchableHighlightComponent; +export class TouchableHighlight extends TouchableHighlightBase {} /** * @see https://facebook.github.io/react-native/docs/touchableopacity.html#props */ -export interface TouchableOpacityProperties extends TouchableWithoutFeedbackProperties { +export interface TouchableOpacityProps extends TouchableWithoutFeedbackProps { /** * Determines what the opacity of the wrapped view should be when touch is active. * Defaults to 0.2 @@ -4696,11 +4726,9 @@ export interface TouchableOpacityProperties extends TouchableWithoutFeedbackProp * * @see https://facebook.github.io/react-native/docs/touchableopacity.html */ -export interface TouchableOpacityStatic - extends TimerMixin, - TouchableMixin, - NativeMethodsMixin, - React.ClassicComponentClass { +declare class TouchableOpacityComponent extends React.Component {} +declare const TouchableOpacityBase: Constructor & Constructor & Constructor & typeof TouchableOpacityComponent; +export class TouchableOpacity extends TouchableOpacityBase { /** * Animate the touchable to a new opacity. */ @@ -4727,7 +4755,7 @@ type BackgroundPropType = RippleBackgroundPropType | ThemeAttributeBackgroundPro /** * @see https://facebook.github.io/react-native/docs/touchableopacity.html#props */ -export interface TouchableNativeFeedbackProperties extends TouchableWithoutFeedbackProperties { +export interface TouchableNativeFeedbackProps extends TouchableWithoutFeedbackProps { /** * Determines the type of background drawable that's going to be used to display feedback. * It takes an object with type property and extra data depending on the type. @@ -4756,9 +4784,9 @@ export interface TouchableNativeFeedbackProperties extends TouchableWithoutFeedb * * @see https://facebook.github.io/react-native/docs/touchablenativefeedback.html#content */ -export interface TouchableNativeFeedbackStatic - extends TouchableMixin, - React.ClassicComponentClass { +declare class TouchableNativeFeedbackComponent extends React.Component {} +declare const TouchableNativeFeedbackBase: Constructor & typeof TouchableNativeFeedbackComponent; +export class TouchableNativeFeedback extends TouchableNativeFeedbackBase { /** * Creates an object that represents android theme's default background for * selectable elements (?android:attr/selectableItemBackground). @@ -5121,7 +5149,7 @@ export interface ListViewDataSource { /** * @see https://facebook.github.io/react-native/docs/tabbarios-item.html#props */ -export interface TabBarItemProperties extends ViewProperties { +export interface TabBarIOSItemProps extends ViewProps { /** * Little red bubble that sits at the top right of the icon. */ @@ -5191,12 +5219,12 @@ export interface TabBarItemProperties extends ViewProperties { title?: string; } -export interface TabBarItemStatic extends React.ComponentClass {} +export class TabBarIOSItem extends React.Component {} /** * @see https://facebook.github.io/react-native/docs/tabbarios.html#props */ -export interface TabBarIOSProperties extends ViewProperties { +export interface TabBarIOSProps extends ViewProps { /** * Background color of the tab bar */ @@ -5234,8 +5262,8 @@ export interface TabBarIOSProperties extends ViewProperties { unselectedItemTintColor?: string; } -export interface TabBarIOSStatic extends React.ComponentClass { - Item: TabBarItemStatic; +export class TabBarIOS extends React.Component { + static Item: typeof TabBarIOSItem; } export interface PixelRatioStatic { @@ -5724,7 +5752,7 @@ interface ScrollResponderMixin extends SubscribableMixin { scrollResponderKeyboardDidHide(e: ScrollResponderEvent): void; } -export interface ScrollViewPropertiesIOS { +export interface ScrollViewPropsIOS { /** * When true the scroll view bounces horizontally when it reaches the end * even if the content is smaller than the scroll view itself. The default @@ -5782,7 +5810,7 @@ export interface ScrollViewPropertiesIOS { * Used to manually set the starting scroll offset. * The default value is {x: 0, y: 0} */ - contentOffset?: PointProperties; // zeros + contentOffset?: PointPropType; // zeros /** * This property specifies how the safe area insets are used to modify the content area of the scroll view. @@ -5886,7 +5914,7 @@ export interface ScrollViewPropertiesIOS { zoomScale?: number; } -export interface ScrollViewPropertiesAndroid { +export interface ScrollViewPropsAndroid { /** * Sometimes a scrollview takes up more space than its content fills. * When this is the case, this prop will fill the rest of the @@ -5916,10 +5944,10 @@ export interface ScrollViewPropertiesAndroid { overScrollMode?: "auto" | "always" | "never"; } -export interface ScrollViewProperties - extends ViewProperties, - ScrollViewPropertiesIOS, - ScrollViewPropertiesAndroid, +export interface ScrollViewProps + extends ViewProps, + ScrollViewPropsIOS, + ScrollViewPropsAndroid, Touchable { /** * These styles will be applied to the scroll view content container which @@ -6035,12 +6063,12 @@ export interface ScrollViewProperties * A RefreshControl component, used to provide pull-to-refresh * functionality for the ScrollView. */ - refreshControl?: React.ReactElement; + refreshControl?: React.ReactElement; } -export interface ScrollViewProps extends ScrollViewProperties {} - -interface ScrollViewStatic extends ScrollResponderMixin, React.ComponentClass { +declare class ScrollViewComponent extends React.Component {} +declare const ScrollViewBase: Constructor & typeof ScrollViewComponent; +export class ScrollView extends ScrollViewBase { /** * Scrolls to a given x, y offset, either immediately or with a smooth animation. * Syntax: @@ -6111,7 +6139,7 @@ export interface NativeScrollEvent { zoomScale: number; } -export interface SnapshotViewIOSProperties extends ViewProperties { +export interface SnapshotViewIOSProps extends ViewProps { // A callback when the Snapshot view is ready to be compared onSnapshotReady(): any; @@ -6119,7 +6147,9 @@ export interface SnapshotViewIOSProperties extends ViewProperties { testIdentifier: string; } -export interface SnapshotViewIOSStatic extends NativeMethodsMixin, React.ComponentClass {} +declare class SnapshotViewIOSComponent extends React.Component {} +declare const SnapshotViewIOSBase: Constructor & typeof SnapshotViewIOSComponent; +export class SnapshotViewIOS extends SnapshotViewIOSBase {} // Deduced from // https://github.com/facebook/react-native/commit/052cd7eb8afa7a805ef13e940251be080499919c @@ -6190,7 +6220,7 @@ export interface SwipeableListViewProps { * - It can bounce the 1st row of the list so users know it's swipeable * - More to come */ -export interface SwipeableListViewStatic extends React.ComponentClass { +export class SwipeableListView extends React.Component { getNewDataSource(): SwipeableListViewDataSource; } @@ -6639,7 +6669,7 @@ export interface BackHandlerStatic { removeEventListener(eventName: BackPressEventName, handler: () => void): void; } -export interface ButtonProperties { +export interface ButtonProps { title: string; onPress: () => any; color?: string; @@ -6652,7 +6682,7 @@ export interface ButtonProperties { testID?: string; } -export interface ButtonStatic extends React.ComponentClass {} +export class Button extends React.Component {} export type CameraRollGroupType = "Album" | "All" | "Event" | "Faces" | "Library" | "PhotoStream" | "SavedPhotos"; export type CameraRollAssetType = "All" | "Videos" | "Photos"; @@ -6790,7 +6820,7 @@ export interface ClipboardStatic { setString(content: string): void; } -export interface DatePickerAndroidOpenOption { +export interface DatePickerAndroidOpenOptions { date?: Date | number; minDate?: Date | number; maxDate?: Date | number; @@ -6806,22 +6836,25 @@ export interface DatePickerAndroidOpenReturn { } export interface DatePickerAndroidStatic { - /* - Opens the standard Android date picker dialog. - - The available keys for the options object are: - * date (Date object or timestamp in milliseconds) - date to show by default - * minDate (Date object or timestamp in milliseconds) - minimum date that can be selected - * maxDate (Date object or timestamp in milliseconds) - maximum date that can be selected - - Returns a Promise which will be invoked an object containing action, year, month (0-11), day if the user picked - a date. If the user dismissed the dialog, the Promise will still be resolved with action being - DatePickerAndroid.dismissedAction and all the other keys being undefined. Always check whether the action before - reading the values. - - Note the native date picker dialog has some UI glitches on Android 4 and lower when using the minDate and maxDate options. - */ - open(options?: DatePickerAndroidOpenOption): Promise; + /** + * Opens the standard Android date picker dialog. + * + * The available keys for the options object are: + * - date (Date object or timestamp in milliseconds) - date to show by default + * - minDate (Date or timestamp in milliseconds) - minimum date that can be selected + * - maxDate (Date object or timestamp in milliseconds) - maximum date that can be selected + * - mode (enum('calendar', 'spinner', 'default')) - To set the date-picker mode to calendar/spinner/default + * - 'calendar': Show a date picker in calendar mode. + * - 'spinner': Show a date picker in spinner mode. + * - 'default': Show a default native date picker(spinner/calendar) based on android versions. + * + * Returns a Promise which will be invoked an object containing action, year, month (0-11), day if the user picked a date. + * If the user dismissed the dialog, the Promise will still be resolved with action being DatePickerAndroid.dismissedAction and all the other keys being undefined. + * Always check whether the action before reading the values. + * + * Note the native date picker dialog has some UI glitches on Android 4 and lower when using the minDate and maxDate options. + */ + open(options?: DatePickerAndroidOpenOptions): Promise; /** * A date has been selected. @@ -7460,7 +7493,7 @@ export type StatusBarStyle = "default" | "light-content" | "dark-content"; export type StatusBarAnimation = "none" | "fade" | "slide"; -export interface StatusBarPropertiesIOS { +export interface StatusBarPropsIOS { /** * Sets the color of the status bar text. */ @@ -7478,7 +7511,7 @@ export interface StatusBarPropertiesIOS { showHideTransition?: "fade" | "slide"; } -export interface StatusBarPropertiesAndroid { +export interface StatusBarPropsAndroid { /** * The background color of the status bar. */ @@ -7492,7 +7525,7 @@ export interface StatusBarPropertiesAndroid { translucent?: boolean; } -export interface StatusBarProperties extends StatusBarPropertiesIOS, StatusBarPropertiesAndroid { +export interface StatusBarProps extends StatusBarPropsIOS, StatusBarPropsAndroid { /** * If the transition between status bar property changes should be * animated. Supported for backgroundColor, barStyle and hidden. @@ -7505,7 +7538,7 @@ export interface StatusBarProperties extends StatusBarPropertiesIOS, StatusBarPr hidden?: boolean; } -export interface StatusBarStatic extends React.ComponentClass { +export class StatusBar extends React.Component { /** * The current height of the status bar on the device. * @platform android @@ -7728,7 +7761,7 @@ export interface UIManagerStatic { setLayoutAnimationEnabledExperimental(value: boolean): void; } -export interface SwitchPropertiesIOS extends ViewProperties { +export interface SwitchPropsIOS extends ViewProps { /** * Background color when the switch is turned on. */ @@ -7745,7 +7778,7 @@ export interface SwitchPropertiesIOS extends ViewProperties { tintColor?: string; } -export interface SwitchProperties extends SwitchPropertiesIOS { +export interface SwitchProps extends SwitchPropsIOS { /** * If true the user won't be able to toggle the switch. * Default value is false. @@ -7778,7 +7811,9 @@ export interface SwitchProperties extends SwitchPropertiesIOS { * If the `value` prop is not updated, the component will continue to render * the supplied `value` prop instead of the expected result of any user actions. */ -export interface SwitchStatic extends NativeMethodsMixin, React.ClassicComponentClass {} +declare class SwitchComponent extends React.Component {} +declare const SwitchBase: Constructor & typeof SwitchComponent; +export class Switch extends SwitchBase {} /** * NOTE: `VibrationIOS` is being deprecated. Use `Vibration` instead. @@ -8414,22 +8449,22 @@ export interface ARTSurfaceProps { height: number; } -export interface ClippingRectangleStatic extends React.ComponentClass {} +export class ClippingRectangle extends React.Component {} -export interface GroupStatic extends React.ComponentClass {} +export class Group extends React.Component {} -export interface ShapeStatic extends React.ComponentClass {} +export class Shape extends React.Component {} -export interface SurfaceStatic extends React.ComponentClass {} +export class Surface extends React.Component {} -export interface ARTTextStatic extends React.ComponentClass {} +export class ARTText extends React.Component {} export interface ARTStatic { - ClippingRectangle: ClippingRectangleStatic; - Group: GroupStatic; - Shape: ShapeStatic; - Surface: SurfaceStatic; - Text: ARTTextStatic; + ClippingRectangle: typeof ClippingRectangle; + Group: typeof Group; + Shape: typeof Shape; + Surface: typeof Surface; + Text: typeof ARTText; } export interface KeyboardStatic extends NativeEventEmitter { @@ -8447,138 +8482,18 @@ export interface KeyboardStatic extends NativeEventEmitter { export const ART: ARTStatic; export type ART = ARTStatic; -export const ActivityIndicator: ActivityIndicatorStatic; -export type ActivityIndicator = ActivityIndicatorStatic; - -export const ActivityIndicatorIOS: ActivityIndicatorIOSStatic; -export type ActivityIndicatorIOS = ActivityIndicatorIOSStatic; - -export const DatePickerIOS: DatePickerIOSStatic; -export type DatePickerIOS = DatePickerIOSStatic; - -export const DrawerLayoutAndroid: DrawerLayoutAndroidStatic; -export type DrawerLayoutAndroid = DrawerLayoutAndroidStatic; - -export const Image: ImageStatic; -export type Image = ImageStatic; - -export const ImageBackground: ImageBackgroundStatic; -export type ImageBackground = ImageBackgroundStatic; - export const ImagePickerIOS: ImagePickerIOSStatic; export type ImagePickerIOS = ImagePickerIOSStatic; -export const InputAccessoryView: InputAccessoryViewStatic; -export type InputAccessoryView = InputAccessoryViewStatic; - -export const FlatList: FlatListStatic; -export type FlatList = FlatListStatic; - export const LayoutAnimation: LayoutAnimationStatic; export type LayoutAnimation = LayoutAnimationStatic; -export const ListView: ListViewStatic; -export type ListView = ListViewStatic; - -export const MapView: MapViewStatic; -export type MapView = MapViewStatic; - -export const MaskedViewIOS: MaskedViewStatic; -export type MaskedViewIOS = MaskedViewStatic; - -export const Modal: ModalStatic; -export type Modal = ModalStatic; - -export const NavigatorIOS: NavigatorIOSStatic; -export type NavigatorIOS = NavigatorIOSStatic; - -export const Picker: PickerStatic; -export type Picker = PickerStatic; - -export const PickerIOS: PickerIOSStatic; -export type PickerIOS = PickerIOSStatic; - -export const ProgressBarAndroid: ProgressBarAndroidStatic; -export type ProgressBarAndroid = ProgressBarAndroidStatic; - -export const ProgressViewIOS: ProgressViewIOSStatic; -export type ProgressViewIOS = ProgressViewIOSStatic; - -export const RefreshControl: RefreshControlStatic; -export type RefreshControl = RefreshControlStatic; - -export const RecyclerViewBackedScrollView: RecyclerViewBackedScrollViewStatic; -export type RecyclerViewBackedScrollView = RecyclerViewBackedScrollViewStatic; - -export const SafeAreaView: SafeAreaViewStatic; -export type SafeAreaView = SafeAreaViewStatic; - -export const SegmentedControlIOS: SegmentedControlIOSStatic; -export type SegmentedControlIOS = SegmentedControlIOSStatic; - -export const Slider: SliderStatic; -export type Slider = SliderStatic; - -export const SliderIOS: SliderStatic; -export type SliderIOS = SliderStatic; - -export const StatusBar: StatusBarStatic; -export type StatusBar = StatusBarStatic; - -export const ScrollView: ScrollViewStatic; -export type ScrollView = ScrollViewStatic; - export const SectionList: SectionListStatic; export type SectionList = SectionListStatic; -export const SnapshotViewIOS: SnapshotViewIOSStatic; -export type SnapshotViewIOS = SnapshotViewIOSStatic; - export const Systrace: SystraceStatic; export type Systrace = SystraceStatic; -export const SwipeableListView: SwipeableListViewStatic; -export type SwipeableListView = SwipeableListViewStatic; - -export const Switch: SwitchStatic; -export type Switch = SwitchStatic; - -export const SwitchIOS: SwitchIOSStatic; -export type SwitchIOS = SwitchIOSStatic; - -export const TabBarIOS: TabBarIOSStatic; -export type TabBarIOS = TabBarIOSStatic; - -export const Text: TextStatic; -export type Text = TextStatic; - -export const TextInput: TextInputStatic; -export type TextInput = TextInputStatic; - -export const ToolbarAndroid: ToolbarAndroidStatic; -export type ToolbarAndroid = ToolbarAndroidStatic; - -export const TouchableHighlight: TouchableHighlightStatic; -export type TouchableHighlight = TouchableHighlightStatic; - -export const TouchableNativeFeedback: TouchableNativeFeedbackStatic; -export type TouchableNativeFeedback = TouchableNativeFeedbackStatic; - -export const TouchableOpacity: TouchableOpacityStatic; -export type TouchableOpacity = TouchableOpacityStatic; - -export const TouchableWithoutFeedback: TouchableWithoutFeedbackStatic; -export type TouchableWithoutFeedback = TouchableWithoutFeedbackStatic; - -export const View: ViewStatic; -export type View = ViewStatic; - -export const ViewPagerAndroid: ViewPagerAndroidStatic; -export type ViewPagerAndroid = ViewPagerAndroidStatic; - -export const WebView: WebViewStatic; -export type WebView = WebViewStatic; - //////////// APIS ////////////// export const ActionSheetIOS: ActionSheetIOSStatic; export type ActionSheetIOS = ActionSheetIOSStatic; @@ -8616,9 +8531,6 @@ export type BackAndroid = BackAndroidStatic; export const BackHandler: BackHandlerStatic; export type BackHandler = BackHandlerStatic; -export const Button: ButtonStatic; -export type Button = ButtonStatic; - export const CameraRoll: CameraRollStatic; export type CameraRoll = CameraRollStatic; @@ -8648,9 +8560,6 @@ export type IntentAndroid = IntentAndroidStatic; export const Keyboard: KeyboardStatic; -export const KeyboardAvoidingView: KeyboardAvoidingViewStatic; -export type KeyboardAvoidingView = KeyboardAvoidingViewStatic; - export const Linking: LinkingStatic; export type Linking = LinkingStatic; diff --git a/types/react-native/legacy-properties.d.ts b/types/react-native/legacy-properties.d.ts new file mode 100644 index 0000000000..eae30f65c7 --- /dev/null +++ b/types/react-native/legacy-properties.d.ts @@ -0,0 +1,286 @@ +import { + LayoutProps, + TextProps, + TextPropsIOS, + TextPropsAndroid, + AccessibilityProps, + AccessibilityPropsIOS, + AccessibilityPropsAndroid, + TextInputProps, + TextInputIOSProps, + TextInputAndroidProps, + ViewProps, + ViewPropsIOS, + ViewPropsAndroid, + ToolbarAndroidProps, + ViewPagerAndroidProps, + WebViewProps, + WebViewPropsIOS, + WebViewPropsAndroid, + SegmentedControlIOSProps, + ScrollViewProps, + ScrollViewPropsIOS, + ScrollViewPropsAndroid, + InputAccessoryViewProps, + NavigatorIOSProps, + ActivityIndicatorProps, + ActivityIndicatorIOSProps, + DatePickerIOSProps, + DrawerLayoutAndroidProps, + PickerItemProps, + PickerIOSItemProps, + PickerProps, + PickerPropsIOS, + PickerPropsAndroid, + PickerIOSProps, + ProgressBarAndroidProps, + ProgressViewIOSProps, + RefreshControlProps, + RefreshControlPropsIOS, + RefreshControlPropsAndroid, + RecyclerViewBackedScrollViewProps, + SliderProps, + SliderPropsIOS, + SliderPropsAndroid, + SwitchIOSProps, + ImageSourcePropType, + ImageProps, + ImagePropsIOS, + ImagePropsAndroid, + ImageBackgroundProps, + FlatListProps, + VirtualizedListProps, + SectionListProps, + ListViewProps, + MapViewProps, + MaskedViewIOSProps, + ModalProps, + TouchableWithoutFeedbackProps, + TouchableHighlightProps, + TouchableOpacityProps, + TouchableNativeFeedbackProps, + TabBarIOSItemProps, + TabBarIOSProps, + SnapshotViewIOSProps, + ButtonProps, + StatusBarProps, + StatusBarPropsIOS, + StatusBarPropsAndroid, + SwitchProps, + SwitchPropsIOS +} from "react-native"; + +declare module "react-native" { + /* + * Previously, props interfaces where named *Properties + * They have been renamed to *Props to match React Native documentation + * The following lines ensure compatibility with *Properties and should be removed in the future + */ + + /** @deprecated Use LayoutProps */ + export type LayoutProperties = LayoutProps; + + /** @deprecated Use TextProps */ + export type TextProperties = TextProps; + + /** @deprecated Use TextPropsIOS */ + export type TextPropertiesIOS = TextPropsIOS; + + /** @deprecated Use TextPropsAndroid */ + export type TextPropertiesAndroid = TextPropsAndroid; + + /** @deprecated Use AccessibilityProps */ + export type AccessibilityProperties = AccessibilityProps; + + /** @deprecated Use AccessibilityPropsIOS */ + export type AccessibilityPropertiesIOS = AccessibilityPropsIOS; + + /** @deprecated Use AccessibilityPropsAndroid */ + export type AccessibilityPropertiesAndroid = AccessibilityPropsAndroid; + + /** @deprecated Use TextInputProps */ + export type TextInputProperties = TextInputProps; + + /** @deprecated Use TextInputIOSProps */ + export type TextInputIOSProperties = TextInputIOSProps; + + /** @deprecated Use TextInputAndroidProps */ + export type TextInputAndroidProperties = TextInputAndroidProps; + + /** @deprecated Use ViewProps */ + export type ViewProperties = ViewProps; + + /** @deprecated Use ViewPropsIOS */ + export type ViewPropertiesIOS = ViewPropsIOS; + + /** @deprecated Use ViewPropsAndroid */ + export type ViewPropertiesAndroid = ViewPropsAndroid; + + /** @deprecated Use ToolbarAndroidProps */ + export type ToolbarAndroidProperties = ToolbarAndroidProps; + + /** @deprecated Use ViewPagerAndroidProps */ + export type ViewPagerAndroidProperties = ViewPagerAndroidProps; + + /** @deprecated Use WebViewProps */ + export type WebViewProperties = WebViewProps; + + /** @deprecated Use WebViewPropsIOS */ + export type WebViewPropertiesIOS = WebViewPropsIOS; + + /** @deprecated Use WebViewPropsAndroid */ + export type WebViewPropertiesAndroid = WebViewPropsAndroid; + + /** @deprecated Use SegmentedControlIOSProps */ + export type SegmentedControlIOSProperties = SegmentedControlIOSProps; + + /** @deprecated Use ScrollViewProps */ + export type ScrollViewProperties = ScrollViewProps; + + /** @deprecated Use ScrollViewPropsIOS */ + export type ScrollViewPropertiesIOS = ScrollViewPropsIOS; + + /** @deprecated Use ScrollViewPropsAndroid */ + export type ScrollViewPropertiesAndroid = ScrollViewPropsAndroid; + + /** @deprecated Use InputAccessoryViewProps */ + export type InputAccessoryViewProperties = InputAccessoryViewProps; + + /** @deprecated Use NavigatorIOSProps */ + export type NavigatorIOSProperties = NavigatorIOSProps; + + /** @deprecated Use ActivityIndicatorProps */ + export type ActivityIndicatorProperties = ActivityIndicatorProps; + + /** @deprecated Use ActivityIndicatorIOSProps */ + export type ActivityIndicatorIOSProperties = ActivityIndicatorIOSProps; + + /** @deprecated Use DatePickerIOSProps */ + export type DatePickerIOSProperties = DatePickerIOSProps; + + /** @deprecated Use DrawerLayoutAndroidProps */ + export type DrawerLayoutAndroidProperties = DrawerLayoutAndroidProps; + + /** @deprecated Use PickerItemProps */ + export type PickerItemProperties = PickerItemProps; + + /** @deprecated Use PickerIOSItemProps */ + export type PickerIOSItemProperties = PickerIOSItemProps; + + /** @deprecated Use PickerProps */ + export type PickerProperties = PickerProps; + + /** @deprecated Use PickerPropsIOS */ + export type PickerPropertiesIOS = PickerPropsIOS; + + /** @deprecated Use PickerPropsAndroid */ + export type PickerPropertiesAndroid = PickerPropsAndroid; + + /** @deprecated Use PickerIOSProps */ + export type PickerIOSProperties = PickerIOSProps; + + /** @deprecated Use ProgressBarAndroidProps */ + export type ProgressBarAndroidProperties = ProgressBarAndroidProps; + + /** @deprecated Use ProgressViewIOSProps */ + export type ProgressViewIOSProperties = ProgressViewIOSProps; + + /** @deprecated Use RefreshControlProps */ + export type RefreshControlProperties = RefreshControlProps; + + /** @deprecated Use RefreshControlPropsIOS */ + export type RefreshControlPropertiesIOS = RefreshControlPropsIOS; + + /** @deprecated Use RefreshControlPropsAndroid */ + export type RefreshControlPropertiesAndroid = RefreshControlPropsAndroid; + + /** @deprecated Use RecyclerViewBackedScrollViewProps */ + export type RecyclerViewBackedScrollViewProperties = RecyclerViewBackedScrollViewProps; + + /** @deprecated Use SliderProps */ + export type SliderProperties = SliderProps; + + /** @deprecated Use SliderPropsIOS */ + export type SliderPropertiesIOS = SliderPropsIOS; + + /** @deprecated Use SliderPropsAndroid */ + export type SliderPropertiesAndroid = SliderPropsAndroid; + + /** @deprecated Use SwitchIOSProps */ + export type SwitchIOSProperties = SwitchIOSProps; + + /** @deprecated Use ImageSourcePropType */ + export type ImagePropertiesSourceOptions = ImageSourcePropType; + + /** @deprecated Use ImageProps */ + export type ImageProperties = ImageProps; + + /** @deprecated Use ImagePropsIOS */ + export type ImagePropertiesIOS = ImagePropsIOS; + + /** @deprecated Use ImagePropsAndroid */ + export type ImagePropertiesAndroid = ImagePropsAndroid; + + /** @deprecated Use ImageBackgroundProps */ + export type ImageBackgroundProperties = ImageBackgroundProps; + + /** @deprecated Use FlatListProps */ + export type FlatListProperties = FlatListProps; + + /** @deprecated Use VirtualizedListProps */ + export type VirtualizedListProperties = VirtualizedListProps; + + /** @deprecated Use SectionListProps */ + export type SectionListProperties = SectionListProps; + + /** @deprecated Use ListViewProps */ + export type ListViewProperties = ListViewProps; + + /** @deprecated Use MapViewProps */ + export type MapViewProperties = MapViewProps; + + /** @deprecated Use MaskedViewIOSProps */ + export type MaskedViewIOSProperties = MaskedViewIOSProps; + + /** @deprecated Use ModalProps */ + export type ModalProperties = ModalProps; + + /** @deprecated Use TouchableWithoutFeedbackProps */ + export type TouchableWithoutFeedbackProperties = TouchableWithoutFeedbackProps; + + /** @deprecated Use TouchableHighlightProps */ + export type TouchableHighlightProperties = TouchableHighlightProps; + + /** @deprecated Use TouchableOpacityProps */ + export type TouchableOpacityProperties = TouchableOpacityProps; + + /** @deprecated Use TouchableNativeFeedbackProps */ + export type TouchableNativeFeedbackProperties = TouchableNativeFeedbackProps; + + /** @deprecated Use TabBarIOSItemProps */ + export type TabBarIOSItemProperties = TabBarIOSItemProps; + + /** @deprecated Use TabBarIOSProps */ + export type TabBarIOSProperties = TabBarIOSProps; + + /** @deprecated Use SnapshotViewIOSProps */ + export type SnapshotViewIOSProperties = SnapshotViewIOSProps; + + /** @deprecated Use ButtonProps */ + export type ButtonProperties = ButtonProps; + + /** @deprecated Use StatusBarProps */ + export type StatusBarProperties = StatusBarProps; + + /** @deprecated Use StatusBarPropsIOS */ + export type StatusBarPropertiesIOS = StatusBarPropsIOS; + + /** @deprecated Use StatusBarPropsAndroid */ + export type StatusBarPropertiesAndroid = StatusBarPropsAndroid; + + /** @deprecated Use SwitchProps */ + export type SwitchProperties = SwitchProps; + + /** @deprecated Use SwitchPropsIOS */ + export type SwitchPropertiesIOS = SwitchPropsIOS; +} diff --git a/types/react-native/test/ART.tsx b/types/react-native/test/ART.tsx new file mode 100644 index 0000000000..86fa48ca88 --- /dev/null +++ b/types/react-native/test/ART.tsx @@ -0,0 +1,29 @@ +import * as React from "react"; +import * as ReactNative from "react-native"; + +// See https://github.com/react-native-china/react-native-ART-doc/blob/6ba9c0f7c7e495a12045f3d7061834d2c74413c5/doc.md + +const { + Surface, + Shape, + Group, + Text, + ClippingRectangle +} = ReactNative.ART + +class Test extends React.Component { + render() { + return ( + + + + + + ) + } +} diff --git a/types/react-native/test/index.tsx b/types/react-native/test/index.tsx index 8d3925d4bd..31cbc5a50e 100644 --- a/types/react-native/test/index.tsx +++ b/types/react-native/test/index.tsx @@ -31,15 +31,15 @@ import { Systrace, Text, TextStyle, - TextProperties, + TextProps, View, ViewStyle, ViewPagerAndroid, FlatList, - FlatListProperties, + FlatListProps, ScaledSize, SectionList, - SectionListProperties, + SectionListProps, findNodeHandle, ScrollView, ScrollViewProps, @@ -235,7 +235,7 @@ InteractionManager.runAfterInteractions(() => { // ... }).then(() => "done"); -export class FlatListTest extends React.Component, {}> { +export class FlatListTest extends React.Component, {}> { _renderItem = (rowData: any) => { return ( @@ -257,7 +257,7 @@ export class FlatListTest extends React.Component, {} } } -export class SectionListTest extends React.Component, {}> { +export class SectionListTest extends React.Component, {}> { render() { const sections = [ { @@ -293,7 +293,7 @@ export class SectionListTest extends React.Component { +export class CapsLockComponent extends React.Component { render() { const content = (this.props.children || "") as string; return {content.toUpperCase()}; @@ -318,7 +318,7 @@ class ScrollerListComponentTest extends React.Component<{}, { dataSource: ListVi throw new Error("Expected scroll to be enabled."); } - return ; + return ; }} renderRow={({ type, data }, _, row) => { return Filler; @@ -412,3 +412,24 @@ const dataSourceAssetCallback2: DataSourceAssetCallback = {}; const deviceEventEmitterStatic: DeviceEventEmitterStatic = null; deviceEventEmitterStatic.addListener("keyboardWillShow", data => true); deviceEventEmitterStatic.addListener("keyboardWillShow", data => true, {}); + + +class TextInputRefTest extends React.Component<{}, {username: string}> { + username: TextInput | null = null; + + handleUsernameChange(text: string) { + } + + render() { + return ( + + this.username.focus()}>Username + this.username = input} + value={this.state.username} + onChangeText={this.handleUsernameChange.bind(this)} + /> + + ); + } +} diff --git a/types/react-native/test/legacy-properties.tsx b/types/react-native/test/legacy-properties.tsx new file mode 100644 index 0000000000..1637cb207c --- /dev/null +++ b/types/react-native/test/legacy-properties.tsx @@ -0,0 +1,5 @@ +import * as React from "react"; +import { TextInputProperties } from "react-native"; + +class Test extends React.Component { +} diff --git a/types/react-native/tsconfig.json b/types/react-native/tsconfig.json index 508ac06f1a..16c6bf9275 100644 --- a/types/react-native/tsconfig.json +++ b/types/react-native/tsconfig.json @@ -21,6 +21,8 @@ "index.d.ts", "test/index.tsx", "test/animated.tsx", - "test/init-example.tsx" + "test/init-example.tsx", + "test/ART.tsx", + "test/legacy-properties.tsx" ] } \ No newline at end of file diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index a054ecf4d0..db45006ef0 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -32,7 +32,7 @@ import * as React from 'react'; import { Animated, TextStyle, - ViewProperties, + ViewProps, ViewStyle, StyleProp, } from 'react-native'; @@ -926,7 +926,7 @@ export function withNavigationFocus( * SafeAreaView Component */ export type SafeAreaViewForceInsetValue = 'always' | 'never'; -export interface SafeAreaViewProps extends ViewProperties { +export interface SafeAreaViewProps extends ViewProps { forceInset?: { top?: SafeAreaViewForceInsetValue; bottom?: SafeAreaViewForceInsetValue; diff --git a/types/react-router-native/react-router-native-tests.tsx b/types/react-router-native/react-router-native-tests.tsx index 5b7dcfa4e7..7ae1b10653 100644 --- a/types/react-router-native/react-router-native-tests.tsx +++ b/types/react-router-native/react-router-native-tests.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import { StyleSheet, Text, TouchableOpacity, TouchableOpacityProperties, View } from 'react-native'; +import { StyleSheet, Text, TouchableOpacity, TouchableOpacityProps, View } from 'react-native'; import { AndroidBackButton, BackButton, Link, NativeRouter as Router, Route } from 'react-router-native'; const Home: React.SFC = () => { @@ -24,7 +24,7 @@ const About: React.SFC = () => { ); }; -interface ButtonTextProps extends TouchableOpacityProperties { +interface ButtonTextProps extends TouchableOpacityProps { text: string; } diff --git a/types/react-router-navigation/index.d.ts b/types/react-router-navigation/index.d.ts index c69a172c43..62258b4b6c 100644 --- a/types/react-router-navigation/index.d.ts +++ b/types/react-router-navigation/index.d.ts @@ -5,7 +5,7 @@ // TypeScript Version: 2.6 import { Component, ReactNode, ReactElement, ComponentClass } from "react"; -import { StyleProp, ViewProperties, ViewStyle, TextStyle } from "react-native"; +import { StyleProp, ViewProps, ViewStyle, TextStyle } from "react-native"; import { TabViewAnimated, TabViewPagerPan } from "react-native-tab-view"; import { RouteProps } from "react-router-navigation-core"; import { @@ -128,7 +128,7 @@ export class BottomNavigation extends Component< renderSceneView: (sceneProps: TabSubViewProps) => ReactNode; - renderScene: (sceneProps: TabSubViewProps) => ReactElement; + renderScene: (sceneProps: TabSubViewProps) => ReactElement; } export function Card(props: CardProps): ReactElement; From c3257dd16c8ffb3f4f4dadfb49356f508142826e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martynas=20=C5=BDilinskas?= Date: Thu, 26 Apr 2018 20:31:02 +0300 Subject: [PATCH 132/564] [react-hot-loader] Upgraded to v4.1 (#25133) * Updated to 4.1. * Removed from types. * Updated tslint. * Fixed lint errors. --- types/react-hot-loader/index.d.ts | 24 +++--- .../react-hot-loader-tests.tsx | 78 ++++++++++++------ types/react-hot-loader/tsconfig.json | 2 +- types/react-hot-loader/tslint.json | 80 +------------------ 4 files changed, 71 insertions(+), 113 deletions(-) diff --git a/types/react-hot-loader/index.d.ts b/types/react-hot-loader/index.d.ts index 6443fd1f43..ccae5a929c 100644 --- a/types/react-hot-loader/index.d.ts +++ b/types/react-hot-loader/index.d.ts @@ -1,19 +1,25 @@ -// Type definitions for react-hot-loader 3.0 +// Type definitions for react-hot-loader 4.1 // Project: https://github.com/gaearon/react-hot-loader // Definitions by: Jacek Jagiello +// MartynasZilinskas +// Dovydas Navickas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.8 -import * as React from "react" +import * as React from "react"; +import "node"; -interface ErrorReporterProps { - error: any +export type ReactComponent = React.ComponentClass | React.StatelessComponent; +export type ExtractProps = TComponent extends ReactComponent ? TProps : {}; + +export interface ErrorReporterProps { + error: any; } export interface AppContainerProps { - children?: React.ReactElement, - errorReporter?: React.ComponentClass | React.StatelessComponent - warnings?: boolean + errorReporter?: ReactComponent; + warnings?: boolean; } - export class AppContainer extends React.Component {} + +export function hot(sourceModule: NodeModule): (component: TComponent) => ReactComponent>; diff --git a/types/react-hot-loader/react-hot-loader-tests.tsx b/types/react-hot-loader/react-hot-loader-tests.tsx index 771f4fdd26..ad5b9cc686 100644 --- a/types/react-hot-loader/react-hot-loader-tests.tsx +++ b/types/react-hot-loader/react-hot-loader-tests.tsx @@ -1,29 +1,59 @@ -import * as React from 'react' -import { AppContainer } from 'react-hot-loader' +import * as React from "react"; +import { AppContainer, hot, ReactComponent } from "react-hot-loader"; -interface ErrorReporterProps { - error: any -} +declare function describe(desc: string, f: () => void): void; +declare function it(desc: string, f: () => void): void; -class ErrorReporterComponent extends React.Component { - public render() { - return

{this.props.error.message}

- } -} +it("Using AppContainer", () => { + interface ErrorReporterProps { + error: any; + } -const DummyComponent = () =>

Dummy component

-const ErrorReporter = ({ error } : ErrorReporterProps) => + class ErrorReporterComponent extends React.Component { + render() { + return

{this.props.error.message}

; + } + } -class AppContainerTest extends React.Component { - public render() { - return ( -
- - - -
- ) - } -} + const DummyComponent = () =>

Dummy component

; + const ErrorReporter = ({ error }: ErrorReporterProps) => ; -export default AppContainerTest + class AppContainerTest extends React.Component { + render() { + return ( +
+ + + +
+ ); + } + } +}); + +it("Using hot", () => { + interface Props { + name: string; + } + + class Foo extends React.Component { + render(): JSX.Element { + return
Foo
; + } + } + const FooSFC = (props: { surname: string }) => { + return
; + }; + + const Bar = hot(module)(Foo); + const BarSFC = hot(module)(FooSFC); + + const testRender = () => { + return ( + <> + + + + ); + }; +}); diff --git a/types/react-hot-loader/tsconfig.json b/types/react-hot-loader/tsconfig.json index 5e898cb303..30206811ef 100644 --- a/types/react-hot-loader/tsconfig.json +++ b/types/react-hot-loader/tsconfig.json @@ -22,4 +22,4 @@ "index.d.ts", "react-hot-loader-tests.tsx" ] -} \ No newline at end of file +} diff --git a/types/react-hot-loader/tslint.json b/types/react-hot-loader/tslint.json index a41bf5d19a..3db14f85ea 100644 --- a/types/react-hot-loader/tslint.json +++ b/types/react-hot-loader/tslint.json @@ -1,79 +1 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } -} +{ "extends": "dtslint/dt.json" } From c853ba2651b141ff6ac9898c5397fbe875069a8e Mon Sep 17 00:00:00 2001 From: denisname Date: Thu, 26 Apr 2018 19:31:47 +0200 Subject: [PATCH 133/564] Linting d3-hexbin and d3-hierarchy (#25325) --- types/d3-hexbin/d3-hexbin-tests.ts | 40 +++--- types/d3-hexbin/index.d.ts | 10 +- types/d3-hexbin/tslint.json | 75 +----------- types/d3-hierarchy/d3-hierarchy-tests.ts | 150 ++++++++++------------- types/d3-hierarchy/index.d.ts | 11 +- types/d3-hierarchy/tslint.json | 75 +----------- 6 files changed, 94 insertions(+), 267 deletions(-) diff --git a/types/d3-hexbin/d3-hexbin-tests.ts b/types/d3-hexbin/d3-hexbin-tests.ts index 4dce0d1ce1..0082ae075d 100644 --- a/types/d3-hexbin/d3-hexbin-tests.ts +++ b/types/d3-hexbin/d3-hexbin-tests.ts @@ -22,22 +22,21 @@ interface Point { b.y()([41, 42]); // === 42; b.radius(); // === 1; - // hexbin(points) bins the specified points into hexagonal bins const bins = d3Hexbin.hexbin()([ [0, 0], [0, 1], [0, 2], [1, 0], [1, 1], [1, 2], [2, 0], [2, 1], [2, 2] - ]) + ]); - bins.map((bin: any) => {}) + bins.map((bin: any) => {}); } { // hexbin(points) observes the current x- and y-accessors - const x = function(d: any) { return d.x; }, - y = function(d: any) { return d.y; }, - bins = d3Hexbin.hexbin().x(x).y(y)([ + const x = (d: any) => d.x; + const y = (d: any) => d.y; + const bins = d3Hexbin.hexbin().x(x).y(y)([ {x0: 0, y0: 0}, {x0: 0, y0: 1}, {x0: 0, y0: 2}, {x0: 1, y0: 0}, {x0: 1, y0: 1}, {x0: 1, y0: 2}, {x0: 2, y0: 0}, {x0: 2, y0: 1}, {x0: 2, y0: 2} @@ -52,7 +51,7 @@ interface Point { [1, 0], [1, 1], [1, 2], [2, 0], [2, 1], [2, 2] ]); - bins.map((bin: any)=> {}); + bins.map((bin: any) => {}); } { @@ -62,15 +61,15 @@ interface Point { } // hexbin.x(x) sets the x-coordinate accessor - const x = function(d: PointX) { return d.x; }, - b = d3Hexbin.hexbin().x(x), - bins = b([{x: 1, 1: 2}]); + const x = (d: PointX) => d.x; + const b = d3Hexbin.hexbin().x(x); + const bins = b([{x: 1, 1: 2}]); b.x(); // should be x; bins.length; // should be 1; bins[0].x; // should be 0.8660254037844386; bins[0].y; // should be 1.5; - bins[0].length // should be 1; + bins[0].length; // should be 1; } { @@ -79,9 +78,9 @@ interface Point { [key: number]: number; } // hexbin.y(y) sets the y-coordinate accessor - const y = function(d: PointY) { return d.y; }, - b = d3Hexbin.hexbin().y(y), - bins = b([{0: 1, y: 2}]); + const y = (d: PointY) => d.y; + const b = d3Hexbin.hexbin().y(y); + const bins = b([{0: 1, y: 2}]); bins.length; // should be 1; bins[0].x; // should be 0.8660254037844386; @@ -148,9 +147,8 @@ interface Point { } { - let hb: d3Hexbin.Hexbin; - let bins: d3Hexbin.HexbinBin[]; + let bins: Array>; // Create generator ======================================= @@ -160,8 +158,8 @@ interface Point { // x Accessor ---------------------------------------------- - let x: (d:Point) => number; - x = function (d: Point) { return d.x0; }; + let x: (d: Point) => number; + x = (d: Point) => d.x0; // test setter hb = hb.x(x); @@ -171,8 +169,8 @@ interface Point { // y Accessor ---------------------------------------------- - let y: (d:Point) => number; - y = function (d: Point) { return d.y0; }; + let y: (d: Point) => number; + y = (d: Point) => d.y0; // test setter hb = hb.y(y); @@ -193,7 +191,7 @@ interface Point { points: Point[]; } - let remappedBins: Array; + let remappedBins: RemappedBin[]; remappedBins = bins.map(bin => { const x: number = bin.x; // x-coordinate of bin diff --git a/types/d3-hexbin/index.d.ts b/types/d3-hexbin/index.d.ts index dba33cb292..5fa53e6145 100644 --- a/types/d3-hexbin/index.d.ts +++ b/types/d3-hexbin/index.d.ts @@ -1,8 +1,10 @@ -// Type definitions for D3JS d3-hexbin module v0.2.1 +// Type definitions for D3JS d3-hexbin module 0.2 // Project: https://github.com/d3/d3-hexbin/ // Definitions by: UNCOVER TRUTH Inc. , Tom Wanzek // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// Last module patch version validated against: 0.2.1 + export interface HexbinBin extends Array { x: number; y: number; @@ -17,7 +19,7 @@ export interface Hexbin { * If either the x- or y-coordinate is NaN, the point is ignored and will * not be in any of the returned bins. */ - (points: T[]): HexbinBin[]; + (points: T[]): Array>; /** * Returns the SVG path string for the hexagon centered at the origin ⟨0,0⟩. @@ -27,7 +29,7 @@ export interface Hexbin { * If radius is specified, a hexagon with the specified radius is returned; * this is useful for area-encoded bivariate hexbins. * - * @param {number} radius Radius number + * @param radius Radius number */ hexagon(radius?: number): string; @@ -78,7 +80,7 @@ export interface Hexbin { * of each point. The default value assumes each point is specified as * a two-element array of numbers [x, y]. */ - y(y: (d: T) => number): Hexbin + y(y: (d: T) => number): Hexbin; /** * If y is not specified, returns the current y-coordinate accessor, diff --git a/types/d3-hexbin/tslint.json b/types/d3-hexbin/tslint.json index a41bf5d19a..71ee04c4e1 100644 --- a/types/d3-hexbin/tslint.json +++ b/types/d3-hexbin/tslint.json @@ -1,79 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + "no-unnecessary-generics": false } } diff --git a/types/d3-hierarchy/d3-hierarchy-tests.ts b/types/d3-hierarchy/d3-hierarchy-tests.ts index 7079fae827..4e35f02ff9 100644 --- a/types/d3-hierarchy/d3-hierarchy-tests.ts +++ b/types/d3-hierarchy/d3-hierarchy-tests.ts @@ -8,7 +8,6 @@ import * as d3Hierarchy from 'd3-hierarchy'; - // ----------------------------------------------------------------------- // Preparatory Steps // ----------------------------------------------------------------------- @@ -24,11 +23,9 @@ let idString: string; interface HierarchyDatum { name: string; val: number; - children?: Array; + children?: HierarchyDatum[]; } - - let hierarchyRootDatum: HierarchyDatum = { name: 'n0', val: 10, @@ -68,7 +65,7 @@ let hierarchyRootNode: d3Hierarchy.HierarchyNode; hierarchyRootNode = d3Hierarchy.hierarchy(hierarchyRootDatum); -hierarchyRootNode = d3Hierarchy.hierarchy(hierarchyRootDatum, function (d) { +hierarchyRootNode = d3Hierarchy.hierarchy(hierarchyRootDatum, (d) => { return d.children || null; }); @@ -82,7 +79,6 @@ num = hierarchyRootNode.height; // children, parent ------------------------------------------------------ - hierarchyNodeArray = hierarchyRootNode.children; let parentNode: d3Hierarchy.HierarchyNode; @@ -94,8 +90,8 @@ idString = hierarchyRootNode.id; // ancestors(), descendants() -------------------------------------------- -let ancestors: Array> = hierarchyRootNode.ancestors(); -let descendants: Array> = hierarchyRootNode.descendants(); +const ancestors: Array> = hierarchyRootNode.ancestors(); +const descendants: Array> = hierarchyRootNode.descendants(); // leaves() --------------------------------------------------------------- @@ -105,7 +101,7 @@ hierarchyNodeArray = hierarchyRootNode.leaves(); hierarchyNode = descendants[descendants.length - 1]; -let path: Array> = hierarchyRootNode.path(hierarchyNode); +const path: Array> = hierarchyRootNode.path(hierarchyNode); // links() and HierarchyLink<...> ------------------------------------------ @@ -121,7 +117,7 @@ hierarchyNode = link.target; // sum() and value ---------------------------------------------------------- -hierarchyRootNode = hierarchyRootNode.sum(function (d) { return d.val; }); +hierarchyRootNode = hierarchyRootNode.sum((d) => d.val); num = hierarchyRootNode.value; @@ -131,29 +127,28 @@ hierarchyRootNode = hierarchyRootNode.count(); num = hierarchyRootNode.value; - // sort --------------------------------------------------------------------- -hierarchyRootNode = hierarchyRootNode.sort(function (a, b) { - console.log(' Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyNode +hierarchyRootNode = hierarchyRootNode.sort((a, b) => { + console.log('Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyNode return b.height - a.height || b.value - a.value; }); // each(), eachAfter(), eachBefore() ---------------------------------------- -hierarchyRootNode = hierarchyRootNode.each(function (node) { - console.log(' Raw value of node:', node.data.val); // node type is HierarchyNode - console.log(' Aggregated value of node:', node.value); // node type is HierarchyNode +hierarchyRootNode = hierarchyRootNode.each((node) => { + console.log('Raw value of node:', node.data.val); // node type is HierarchyNode + console.log('Aggregated value of node:', node.value); // node type is HierarchyNode }); -hierarchyRootNode = hierarchyRootNode.eachAfter(function (node) { - console.log(' Raw value of node:', node.data.val); // node type is HierarchyNode - console.log(' Aggregated value of node:', node.value); // node type is HierarchyNode +hierarchyRootNode = hierarchyRootNode.eachAfter((node) => { + console.log('Raw value of node:', node.data.val); // node type is HierarchyNode + console.log('Aggregated value of node:', node.value); // node type is HierarchyNode }); -hierarchyRootNode = hierarchyRootNode.eachBefore(function (node) { - console.log(' Raw value of node:', node.data.val); // node type is HierarchyNode - console.log(' Aggregated value of node:', node.value); // node type is HierarchyNode +hierarchyRootNode = hierarchyRootNode.eachBefore((node) => { + console.log('Raw value of node:', node.data.val); // node type is HierarchyNode + console.log('Aggregated value of node:', node.value); // node type is HierarchyNode }); // copy() -------------------------------------------------------------------- @@ -175,7 +170,7 @@ interface TabularHierarchyDatum { val: number; } -let tabularData: Array; +let tabularData: TabularHierarchyDatum[]; tabularData = [ { name: 'n0', parentId: null, val: 10 }, { name: 'n11', parentId: 'n0', val: 5 }, @@ -183,7 +178,7 @@ tabularData = [ { name: 'n121', parentId: 'n12', val: 30 } ]; -let idStringAccessor: (d: TabularHierarchyDatum, i?: number, data?: Array) => (string | null | '' | undefined); +let idStringAccessor: (d: TabularHierarchyDatum, i?: number, data?: TabularHierarchyDatum[]) => (string | null | '' | undefined); // Create Stratify Operator --------------------------------------------- @@ -194,7 +189,7 @@ stratificatorizer = d3Hierarchy.stratify(); // id(...) -stratificatorizer = stratificatorizer.id(function (d, i, data) { +stratificatorizer = stratificatorizer.id((d, i, data) => { console.log('Length of tabular array: ', data.length); console.log('Name of first entry in tabular array: ', data[0].name); // data of type Array return d.name; // d is of type TabularHierarchyDatum @@ -204,7 +199,7 @@ idStringAccessor = stratificatorizer.id(); // parentId(...) -stratificatorizer = stratificatorizer.parentId(function (d, i, data) { +stratificatorizer = stratificatorizer.parentId((d, i, data) => { console.log('Length of tabular array: ', data.length); console.log('Name of first entry in tabular array: ', data[0].name); // data of type Array return d.parentId; // d is of type TabularHierarchyDatum @@ -214,7 +209,7 @@ idStringAccessor = stratificatorizer.parentId(); // Use Stratify Operator ------------------------------------------------ -let stratifiedRootNode: d3Hierarchy.HierarchyNode = stratificatorizer(tabularData); +const stratifiedRootNode: d3Hierarchy.HierarchyNode = stratificatorizer(tabularData); // ----------------------------------------------------------------------- // Cluster @@ -265,13 +260,12 @@ num = clusterRootNode.y; // data, depth, height --------------------------------------------------- -let clusterDatum: HierarchyDatumWithParentId = clusterRootNode.data; +const clusterDatum: HierarchyDatumWithParentId = clusterRootNode.data; num = clusterRootNode.depth; num = clusterRootNode.height; // children, parent ------------------------------------------------------ - hierarchyPointNodeArray = clusterRootNode.children; let parentPointNode: d3Hierarchy.HierarchyPointNode; @@ -283,8 +277,8 @@ idString = clusterRootNode.id; // ancestors(), descendants() -------------------------------------------- -let pointNodeAncestors: Array> = clusterRootNode.ancestors(); -let pointNodeDescendants: Array> = clusterRootNode.descendants(); +const pointNodeAncestors: Array> = clusterRootNode.ancestors(); +const pointNodeDescendants: Array> = clusterRootNode.descendants(); // leaves() --------------------------------------------------------------- @@ -294,7 +288,7 @@ hierarchyPointNodeArray = clusterRootNode.leaves(); hierarchyPointNode = pointNodeDescendants[pointNodeDescendants.length - 1]; -let clusterPath: Array> = clusterRootNode.path(hierarchyPointNode); +const clusterPath: Array> = clusterRootNode.path(hierarchyPointNode); // links() and HierarchyPointLink<...> ------------------------------------------ @@ -310,7 +304,7 @@ hierarchyPointNode = pointLink.target; // sum() and value ---------------------------------------------------------- -clusterRootNode = clusterRootNode.sum(function (d) { return d.val; }); +clusterRootNode = clusterRootNode.sum((d) => d.val); num = clusterRootNode.value; @@ -322,25 +316,25 @@ num = clusterRootNode.value; // sort --------------------------------------------------------------------- -clusterRootNode = clusterRootNode.sort(function (a, b) { - console.log(' x-coordinates of a:', a.x, ' and b:', b.x); // a and b are of type HierarchyPointNode - console.log(' Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyPointNode +clusterRootNode = clusterRootNode.sort((a, b) => { + console.log('x-coordinates of a:', a.x, ' and b:', b.x); // a and b are of type HierarchyPointNode + console.log('Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyPointNode return b.height - a.height || b.value - a.value; }); // each(), eachAfter(), eachBefore() ---------------------------------------- -clusterRootNode = clusterRootNode.each(function (node) { +clusterRootNode = clusterRootNode.each((node) => { console.log('ParentId:', node.data.parentId); // node type is HierarchyPointNode console.log('X-coordinate of node:', node.x); // node type is HierarchyPointNode }); -clusterRootNode = clusterRootNode.eachAfter(function (node) { +clusterRootNode = clusterRootNode.eachAfter((node) => { console.log('ParentId:', node.data.parentId); // node type is HierarchyPointNode console.log('X-coordinate of node:', node.x); // node type is HierarchyPointNode }); -clusterRootNode = clusterRootNode.eachBefore(function (node) { +clusterRootNode = clusterRootNode.eachBefore((node) => { console.log('ParentId:', node.data.parentId); // node type is HierarchyPointNode console.log('X-coordinate of node:', node.x); // node type is HierarchyPointNode }); @@ -405,8 +399,7 @@ treemapLayout = d3Hierarchy.treemap(); // tile() ---------------------------------------------------------------- -treemapLayout = treemapLayout.tile(function (node, x0, y0, x1, y1) { - let n: number; +treemapLayout = treemapLayout.tile((node, x0, y0, x1, y1) => { console.log('x0 coordinate of node: ', node.x0); console.log('Node parent id: ', node.data.parentId); // type of node is HierarchyRectangularNode num = x0; // number @@ -437,7 +430,7 @@ let roundFlag: boolean = treemapLayout.round(); // padding() ---------------------------------------------------------------- treemapLayout = treemapLayout.padding(1); -treemapLayout = treemapLayout.padding(function (node) { +treemapLayout = treemapLayout.padding((node) => { console.log('Node parent id: ', node.data.parentId); // type of node is HierarchyRectangularNode return node.x0 > 10 ? 2 : 1; }); @@ -447,7 +440,7 @@ numberRectangularNodeAccessor = treemapLayout.padding(); // paddingInner() ---------------------------------------------------------------- treemapLayout = treemapLayout.paddingInner(1); -treemapLayout = treemapLayout.paddingInner(function (node) { +treemapLayout = treemapLayout.paddingInner((node) => { console.log('Node parent id: ', node.data.parentId); // type of node is HierarchyRectangularNode return node.x0 > 10 ? 2 : 1; }); @@ -457,7 +450,7 @@ numberRectangularNodeAccessor = treemapLayout.paddingInner(); // paddingOuter() ---------------------------------------------------------------- treemapLayout = treemapLayout.paddingOuter(1); -treemapLayout = treemapLayout.paddingOuter(function (node) { +treemapLayout = treemapLayout.paddingOuter((node) => { console.log('Node parent id: ', node.data.parentId); // type of node is HierarchyRectangularNode return node.x0 > 10 ? 2 : 1; }); @@ -467,7 +460,7 @@ numberRectangularNodeAccessor = treemapLayout.paddingOuter(); // paddingTop() ---------------------------------------------------------------- treemapLayout = treemapLayout.paddingTop(1); -treemapLayout = treemapLayout.paddingTop(function (node) { +treemapLayout = treemapLayout.paddingTop((node) => { console.log('Node parent id: ', node.data.parentId); // type of node is HierarchyRectangularNode return node.x0 > 10 ? 2 : 1; }); @@ -477,7 +470,7 @@ numberRectangularNodeAccessor = treemapLayout.paddingTop(); // paddingRight() ---------------------------------------------------------------- treemapLayout = treemapLayout.paddingRight(1); -treemapLayout = treemapLayout.paddingRight(function (node) { +treemapLayout = treemapLayout.paddingRight((node) => { console.log('Node parent id: ', node.data.parentId); // type of node is HierarchyRectangularNode return node.x0 > 10 ? 2 : 1; }); @@ -487,7 +480,7 @@ numberRectangularNodeAccessor = treemapLayout.paddingRight(); // paddingBottom() ---------------------------------------------------------------- treemapLayout = treemapLayout.paddingBottom(1); -treemapLayout = treemapLayout.paddingBottom(function (node) { +treemapLayout = treemapLayout.paddingBottom((node) => { console.log('Node parent id: ', node.data.parentId); // type of node is HierarchyRectangularNode return node.x0 > 10 ? 2 : 1; }); @@ -497,21 +490,19 @@ numberRectangularNodeAccessor = treemapLayout.paddingBottom(); // paddingLeft() ---------------------------------------------------------------- treemapLayout = treemapLayout.paddingLeft(1); -treemapLayout = treemapLayout.paddingLeft(function (node) { +treemapLayout = treemapLayout.paddingLeft((node) => { console.log('Node parent id: ', node.data.parentId); // type of node is HierarchyRectangularNode return node.x0 > 10 ? 2 : 1; }); numberRectangularNodeAccessor = treemapLayout.paddingLeft(); - // Use treemap layout generator ========================================== let treemapRootNode: d3Hierarchy.HierarchyRectangularNode; treemapRootNode = treemapLayout(stratifiedRootNode); - // Tiling functions ====================================================== tilingFn = d3Hierarchy.treemapBinary; @@ -536,7 +527,6 @@ tilingFactoryFn = d3Hierarchy.treemapResquarify.ratio(2); treemapLayout.tile(d3Hierarchy.treemapResquarify.ratio(2)); - // Use HierarchyRectangularNode ================================================ // x and y coordinates --------------------------------------------------- @@ -548,13 +538,12 @@ num = treemapRootNode.y1; // data, depth, height --------------------------------------------------- -let treemapDatum: HierarchyDatumWithParentId = treemapRootNode.data; +const treemapDatum: HierarchyDatumWithParentId = treemapRootNode.data; num = treemapRootNode.depth; num = treemapRootNode.height; // children, parent ------------------------------------------------------ - hierarchyRectangularNodeArray = treemapRootNode.children; let parentRectangularNode: d3Hierarchy.HierarchyRectangularNode; @@ -566,8 +555,8 @@ idString = treemapRootNode.id; // ancestors(), descendants() -------------------------------------------- -let rectangularNodeAncestors: Array> = treemapRootNode.ancestors(); -let rectangularNodeDescendants: Array> = treemapRootNode.descendants(); +const rectangularNodeAncestors: Array> = treemapRootNode.ancestors(); +const rectangularNodeDescendants: Array> = treemapRootNode.descendants(); // leaves() --------------------------------------------------------------- @@ -577,7 +566,7 @@ hierarchyRectangularNodeArray = treemapRootNode.leaves(); hierarchyRectangularNode = rectangularNodeDescendants[rectangularNodeDescendants.length - 1]; -let treemapPath: Array> = treemapRootNode.path(hierarchyRectangularNode); +const treemapPath: Array> = treemapRootNode.path(hierarchyRectangularNode); // links() and HierarchyRectangulerLink<...> ------------------------------------------ @@ -593,7 +582,7 @@ hierarchyRectangularNode = rectangularLink.target; // sum() and value ---------------------------------------------------------- -treemapRootNode = treemapRootNode.sum(function (d) { return d.val; }); +treemapRootNode = treemapRootNode.sum((d) => d.val); num = treemapRootNode.value; @@ -604,25 +593,25 @@ treemapRootNode = treemapRootNode.count(); num = treemapRootNode.value; // sort --------------------------------------------------------------------- -treemapRootNode = treemapRootNode.sort(function (a, b) { - console.log(' x0-coordinates of a:', a.x0, ' and b:', b.x0); // a and b are of type HierarchyRectangularNode - console.log(' Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyRectangularNode +treemapRootNode = treemapRootNode.sort((a, b) => { + console.log('x0-coordinates of a:', a.x0, ' and b:', b.x0); // a and b are of type HierarchyRectangularNode + console.log('Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyRectangularNode return b.height - a.height || b.value - a.value; }); // each(), eachAfter(), eachBefore() ---------------------------------------- -treemapRootNode = treemapRootNode.each(function (node) { +treemapRootNode = treemapRootNode.each((node) => { console.log('ParentId:', node.data.parentId); // node type is HierarchyRectangularNode console.log('X0-coordinate of node:', node.x0); // node type is HierarchyRectangularNode }); -treemapRootNode = treemapRootNode.eachAfter(function (node) { +treemapRootNode = treemapRootNode.eachAfter((node) => { console.log('ParentId:', node.data.parentId); // node type is HierarchyRectangularNode console.log('X0-coordinate of node:', node.x0); // node type is HierarchyRectangularNode }); -treemapRootNode = treemapRootNode.eachBefore(function (node) { +treemapRootNode = treemapRootNode.eachBefore((node) => { console.log('ParentId:', node.data.parentId); // node type is HierarchyRectangularNode console.log('X0-coordinate of node:', node.x0); // node type is HierarchyRectangularNode }); @@ -632,8 +621,6 @@ treemapRootNode = treemapRootNode.eachBefore(function (node) { let copiedTreemapNode: d3Hierarchy.HierarchyRectangularNode; copiedTreemapNode = treemapRootNode.copy(); - - // ----------------------------------------------------------------------- // Partition // ----------------------------------------------------------------------- @@ -646,7 +633,6 @@ partitionLayout = d3Hierarchy.partition(); // Configure partition layout generator ==================================== - // size() ---------------------------------------------------------------- partitionLayout = partitionLayout.size(null); @@ -666,7 +652,6 @@ partitionLayout = partitionLayout.padding(1); num = partitionLayout.padding(); - // Use partition layout generator ========================================== let partitionRootNode: d3Hierarchy.HierarchyRectangularNode; @@ -687,7 +672,6 @@ packLayout = d3Hierarchy.pack(); // Configure pack layout generator ==================================== - // size() ---------------------------------------------------------------- packLayout = packLayout.size(null); @@ -697,7 +681,7 @@ size = packLayout.size(); // radius() ------------------------------------------------------------ -packLayout = packLayout.radius(function (node) { +packLayout = packLayout.radius((node) => { console.log('Radius property of node before completing accessor: ', node.r); // node is of type HierarchyCircularNode console.log('Parent id of node: ', node.data.parentId); // node is of type HierarchyCircularNode return node.value; @@ -709,7 +693,7 @@ numberCircularNodeAccessor = packLayout.radius(); packLayout = packLayout.padding(1); -packLayout = packLayout.padding(function (node) { +packLayout = packLayout.padding((node) => { console.log('Radius property of node: ', node.r); // node is of type HierarchyCircularNode console.log('Parent id of node: ', node.data.parentId); // node is of type HierarchyCircularNode return node.value > 10 ? 2 : 1; @@ -717,14 +701,12 @@ packLayout = packLayout.padding(function (node) { numberCircularNodeAccessor = packLayout.padding(); - // Use partition layout generator ========================================== let packRootNode: d3Hierarchy.HierarchyCircularNode; packRootNode = packLayout(stratifiedRootNode); - // Use HierarchyCircularNode ================================================ // x and y coordinates and radius r ------------------------------------------ @@ -735,13 +717,12 @@ num = packRootNode.r; // data, depth, height --------------------------------------------------- -let packDatum: HierarchyDatumWithParentId = packRootNode.data; +const packDatum: HierarchyDatumWithParentId = packRootNode.data; num = packRootNode.depth; num = packRootNode.height; // children, parent ------------------------------------------------------ - hierarchyCircularNodeArray = packRootNode.children; let parentCircularNode: d3Hierarchy.HierarchyCircularNode; @@ -753,8 +734,8 @@ idString = packRootNode.id; // ancestors(), descendants() -------------------------------------------- -let circularNodeAncestors: Array> = packRootNode.ancestors(); -let circularNodeDescendants: Array> = packRootNode.descendants(); +const circularNodeAncestors: Array> = packRootNode.ancestors(); +const circularNodeDescendants: Array> = packRootNode.descendants(); // leaves() --------------------------------------------------------------- @@ -764,7 +745,7 @@ hierarchyCircularNodeArray = packRootNode.leaves(); hierarchyCircularNode = circularNodeDescendants[circularNodeDescendants.length - 1]; -let packPath: Array> = packRootNode.path(hierarchyCircularNode); +const packPath: Array> = packRootNode.path(hierarchyCircularNode); // links() and HierarchyRectangulerLink<...> ------------------------------------------ @@ -780,7 +761,7 @@ hierarchyCircularNode = circularLink.target; // sum() and value ---------------------------------------------------------- -packRootNode = packRootNode.sum(function (d) { return d.val; }); +packRootNode = packRootNode.sum((d) => d.val); num = packRootNode.value; @@ -791,25 +772,25 @@ packRootNode = packRootNode.count(); num = packRootNode.value; // sort --------------------------------------------------------------------- -packRootNode = packRootNode.sort(function (a, b) { +packRootNode = packRootNode.sort((a, b) => { console.log('radius of a:', a.r, ' and b:', b.r); // a and b are of type HierarchyCircularNode - console.log(' Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyCircularNode + console.log('Raw values in data of a and b:', a.data.val, ' and ', b.data.val); // a and b are of type HierarchyCircularNode return b.height - a.height || b.value - a.value; }); // each(), eachAfter(), eachBefore() ---------------------------------------- -packRootNode = packRootNode.each(function (node) { +packRootNode = packRootNode.each((node) => { console.log('ParentId:', node.data.parentId); // node type is HierarchyCircularNode console.log('Radius of node:', node.r); // node type is HierarchyCircularNode }); -packRootNode = packRootNode.eachAfter(function (node) { +packRootNode = packRootNode.eachAfter((node) => { console.log('ParentId:', node.data.parentId); // node type is HierarchyCircularNode console.log('Radius of node:', node.r); // node type is HierarchyCircularNode }); -packRootNode = packRootNode.eachBefore(function (node) { +packRootNode = packRootNode.eachBefore((node) => { console.log('ParentId:', node.data.parentId); // node type is HierarchyCircularNode console.log('Radius of node:', node.r); // node type is HierarchyCircularNode }); @@ -819,7 +800,6 @@ packRootNode = packRootNode.eachBefore(function (node) { let copiedPackNode: d3Hierarchy.HierarchyCircularNode; copiedPackNode = packRootNode.copy(); - // ----------------------------------------------------------------------- // Pack Siblings and Enclosure // ----------------------------------------------------------------------- @@ -828,7 +808,7 @@ interface CircleData extends d3Hierarchy.PackCircle { v: string; } -let circles: Array = [ +let circles: CircleData[] = [ { r: 10, v: 'a' }, { r: 1, v: 'b' }, { r: 20, v: 'c' } diff --git a/types/d3-hierarchy/index.d.ts b/types/d3-hierarchy/index.d.ts index bfe750b31e..a72dfa0aba 100644 --- a/types/d3-hierarchy/index.d.ts +++ b/types/d3-hierarchy/index.d.ts @@ -9,7 +9,6 @@ // Hierarchy // ----------------------------------------------------------------------- - export interface HierarchyLink { source: HierarchyNode; target: HierarchyNode; @@ -45,7 +44,6 @@ export interface HierarchyNode { copy(): HierarchyNode; } - export function hierarchy(data: Datum, children?: (d: Datum) => (Datum[] | null)): HierarchyNode; // ----------------------------------------------------------------------- @@ -54,7 +52,6 @@ export function hierarchy(data: Datum, children?: (d: Datum) => (Datum[] // TODO: Review the comment in the API documentation related to 'reserved properties': id, parentId, children. If this is refering to the element on node, it should be 'parent'? - export interface StratifyOperator { (data: Datum[]): HierarchyNode; id(): (d: Datum, i: number, data: Datum[]) => (string | null | '' | undefined); @@ -212,7 +209,6 @@ export function treemap(): TreemapLayout; // Tiling functions --------------------------------------------------------------------------------- - export function treemapBinary(node: HierarchyRectangularNode, x0: number, y0: number, x1: number, y1: number): void; export function treemapDice(node: HierarchyRectangularNode, x0: number, y0: number, x1: number, y1: number): void; export function treemapSlice(node: HierarchyRectangularNode, x0: number, y0: number, x1: number, y1: number): void; @@ -224,9 +220,8 @@ export interface RatioSquarifyTilingFactory { ratio(ratio: number): RatioSquarifyTilingFactory; } -export var treemapSquarify: RatioSquarifyTilingFactory; -export var treemapResquarify: RatioSquarifyTilingFactory; - +export const treemapSquarify: RatioSquarifyTilingFactory; +export const treemapResquarify: RatioSquarifyTilingFactory; // ----------------------------------------------------------------------- // Partition @@ -286,7 +281,6 @@ export interface HierarchyCircularNode { copy(): HierarchyCircularNode; } - export interface PackLayout { (root: HierarchyNode): HierarchyCircularNode; radius(): null | ((node: HierarchyCircularNode) => number); @@ -300,7 +294,6 @@ export interface PackLayout { export function pack(): PackLayout; - // ----------------------------------------------------------------------- // Pack Siblings and Enclosure // ----------------------------------------------------------------------- diff --git a/types/d3-hierarchy/tslint.json b/types/d3-hierarchy/tslint.json index a41bf5d19a..71ee04c4e1 100644 --- a/types/d3-hierarchy/tslint.json +++ b/types/d3-hierarchy/tslint.json @@ -1,79 +1,6 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + "no-unnecessary-generics": false } } From 9021588eb78834b502000a0fbac39fdfaa02245e Mon Sep 17 00:00:00 2001 From: Janeene Beeforth Date: Fri, 27 Apr 2018 08:00:29 +1000 Subject: [PATCH 134/564] [expo]: Add missing interfaces/classes for AdMob module. (#25258) * [expo]: Add missing interfaces/classes for AdMob module. This module has existed since SDK v21.0.0, but had not been added to the typescript definitions. The interface changed in SDK v26.0.0, so a split between v25 and v26 was required. * [expo]: Condense AdMob event listener functions. * Add missing backslash to v25 baseUrl & typeRoots. * Remove unintended whitespace format changes. * Merge LinearGradientProps change from pull 25149 to v25 definitions. --- types/expo/expo-tests.tsx | 40 + types/expo/index.d.ts | 78 +- types/expo/v23/expo-tests.tsx | 36 +- types/expo/v23/index.d.ts | 73 + types/expo/v24/expo-tests.tsx | 34 + types/expo/v24/index.d.ts | 73 + types/expo/v25/expo-tests.tsx | 732 +++++++++ types/expo/v25/index.d.ts | 2759 +++++++++++++++++++++++++++++++++ types/expo/v25/tsconfig.json | 33 + types/expo/v25/tslint.json | 7 + 10 files changed, 3863 insertions(+), 2 deletions(-) create mode 100644 types/expo/v25/expo-tests.tsx create mode 100644 types/expo/v25/index.d.ts create mode 100644 types/expo/v25/tsconfig.json create mode 100644 types/expo/v25/tslint.json diff --git a/types/expo/expo-tests.tsx b/types/expo/expo-tests.tsx index c40b76d93d..5df51127da 100644 --- a/types/expo/expo-tests.tsx +++ b/types/expo/expo-tests.tsx @@ -3,6 +3,10 @@ import { Text } from 'react-native'; import { Accelerometer, + AdMobAppEvent, + AdMobBanner, + AdMobInterstitial, + AdMobRewarded, Amplitude, Asset, AuthSession, @@ -26,6 +30,7 @@ import { KeepAwake, LinearGradient, Permissions, + PublisherBanner, registerRootComponent, ScreenOrientation, SQLite, @@ -47,6 +52,41 @@ Accelerometer.addListener((obj) => { Accelerometer.removeAllListeners(); Accelerometer.setUpdateInterval(1000); +() => ( + console.log(error)} + style={{ flex: 1 }} + /> +); + +() => ( + console.log(error)} + onAdMobDispatchAppEvent={(event: AdMobAppEvent) => console.log(event)} + style={{ flex: 1 }} + /> +); + +AdMobInterstitial.setAdUnitID('ca-app-pub-3940256099942544/1033173712'); // Test ID, Replace with your-admob-unit-id +AdMobInterstitial.setTestDeviceID('EMULATOR'); +async () => { + await AdMobInterstitial.requestAdAsync(); + await AdMobInterstitial.showAdAsync(); +}; + +AdMobRewarded.setAdUnitID('ca-app-pub-3940256099942544/1033173712'); // Test ID, Replace with your-admob-unit-id +AdMobRewarded.setTestDeviceID('EMULATOR'); +async () => { + await AdMobRewarded.requestAdAsync(); + await AdMobRewarded.showAdAsync(); +}; + Amplitude.initialize('key'); Amplitude.setUserId('userId'); Amplitude.setUserProperties({key: 1}); diff --git a/types/expo/index.d.ts b/types/expo/index.d.ts index 8093b52861..ca946dd361 100644 --- a/types/expo/index.d.ts +++ b/types/expo/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for expo 25.0 +// Type definitions for expo 26.0 // Project: https://github.com/expo/expo-sdk // Definitions by: Konstantin Kai // Martynas Kadiša @@ -60,6 +60,82 @@ export namespace Accelerometer { function setUpdateInterval(intervalMs: number): void; } +/** + * Admob + */ +export type AdMobBannerSize = + | 'banner' + | 'largeBanner' + | 'mediumRectangle' + | 'fullBanner' + | 'leaderboard' + | 'smartBannerPortrait' + | 'smartBannerLandscape'; +export interface AdMobBannerProperties extends ViewProperties { + bannerSize?: AdMobBannerSize; + adUnitID?: string; + testDeviceID?: string; + didFailToReceiveAdWithError?(errorDescription: string): void; + adViewDidReceiveAd?(): void; + adViewWillPresentScreen?(): void; + adViewWillDismissScreen?(): void; + adViewDidDismissScreen?(): void; + adViewWillLeaveApplication?(): void; +} + +export class AdMobBanner extends Component { } +export interface AdMobAppEvent { + name: string; + info: string; +} +export interface PublisherBannerProperties extends AdMobBannerProperties { + onAdMobDispatchAppEvent?(event: AdMobAppEvent): void; +} +export class PublisherBanner extends Component { } + +export type AdMobInterstitialEmptyEvent = + | 'interstitialDidLoad' + | 'interstitialDidOpen' + | 'interstitialDidClose' + | 'interstitialWillLeaveApplication'; +export type AdMobInterstitialEvent = AdMobInterstitialEmptyEvent | 'interstitialDidFailToLoad'; +export namespace AdMobInterstitial { + function setAdUnitID(id: string): void; + function setTestDeviceID(id: string): void; + function requestAdAsync(): Promise; + function showAdAsync(): Promise; + function dismissAdAsync(): Promise; + function getIsReadyAsync(): Promise; + function addEventListener(event: 'interstitialDidFailToLoad', handler: (error: string) => void): void; + function addEventListener(event: AdMobInterstitialEmptyEvent, handler: () => void): void; + function removeEventListener(event: 'interstitialDidFailToLoad', handler: (error: string) => void): void; + function removeEventListener(event: AdMobInterstitialEmptyEvent, handler: () => void): void; + function removeAllListeners(): void; +} + +export type AdMobRewardedEmptyEvent = + | 'rewardedVideoDidLoad' + | 'rewardedVideoDidOpen' + | 'rewardedVideoDidStart' + | 'rewardedVideoDidClose' + | 'rewardedVideoWillLeaveApplication'; +export type AdMobRewardedEvent = AdMobRewardedEmptyEvent | 'rewardedVideoDidRewardUser' | 'rewardedVideoDidFailToLoad'; +export namespace AdMobRewarded { + function setAdUnitID(id: string): void; + function setTestDeviceID(id: string): void; + function requestAdAsync(): Promise; + function showAdAsync(): Promise; + function dismissAdAsync(): Promise; + function getIsReadyAsync(): Promise; + function addEventListener(event: 'rewardedVideoDidRewardUser', handler: (type: string, amount: number) => void): void; + function addEventListener(event: 'rewardedVideoDidFailToLoad', handler: (error: string) => void): void; + function addEventListener(event: AdMobRewardedEmptyEvent, handler: () => void): void; + function removeEventListener(event: 'rewardedVideoDidRewardUser', handler: (type: string, amount: number) => void): void; + function removeEventListener(event: 'rewardedVideoDidFailToLoad', handler: (error: string) => void): void; + function removeEventListener(event: AdMobRewardedEmptyEvent, handler: () => void): void; + function removeAllListeners(): void; +} + /** * Provides access to Amplitude mobile analytics which basically lets you log various events to the Cloud. This module wraps Amplitude’s iOS and Android SDKs. * diff --git a/types/expo/v23/expo-tests.tsx b/types/expo/v23/expo-tests.tsx index 51b3f30d39..c076bbbce1 100644 --- a/types/expo/v23/expo-tests.tsx +++ b/types/expo/v23/expo-tests.tsx @@ -2,6 +2,10 @@ import * as React from 'react'; import { Accelerometer, + AdMobAppEvent, + AdMobBanner, + AdMobInterstitial, + AdMobRewarded, Amplitude, Asset, AuthSession, @@ -16,7 +20,8 @@ import { Facebook, FacebookAds, FileSystem, - ImagePicker + ImagePicker, + PublisherBanner } from 'expo'; Accelerometer.addListener((obj) => { @@ -27,6 +32,35 @@ Accelerometer.addListener((obj) => { Accelerometer.removeAllListeners(); Accelerometer.setUpdateInterval(1000); +() => ( + console.log(error)} + style={{ flex: 1 }} + /> +); + +() => ( + console.log(error)} + admobDispatchAppEvent={(event: AdMobAppEvent) => console.log(event)} + style={{ flex: 1 }} + /> +); + +AdMobInterstitial.setAdUnitID('ca-app-pub-3940256099942544/1033173712'); // Test ID, Replace with your-admob-unit-id +AdMobInterstitial.setTestDeviceID('EMULATOR'); +AdMobInterstitial.requestAd(() => AdMobInterstitial.showAd()); + +AdMobRewarded.setAdUnitID('ca-app-pub-3940256099942544/1033173712'); // Test ID, Replace with your-admob-unit-id +AdMobRewarded.setTestDeviceID('EMULATOR'); +AdMobRewarded.requestAd(() => AdMobRewarded.showAd()); + Amplitude.initialize('key'); Amplitude.setUserId('userId'); Amplitude.setUserProperties({key: 1}); diff --git a/types/expo/v23/index.d.ts b/types/expo/v23/index.d.ts index 322c1b3c6a..4b00b57a56 100644 --- a/types/expo/v23/index.d.ts +++ b/types/expo/v23/index.d.ts @@ -42,6 +42,79 @@ export namespace Accelerometer { function setUpdateInterval(intervalMs: number): void; } +/** + * Admob + */ +export type AdMobBannerSize = + | 'banner' + | 'largeBanner' + | 'mediumRectangle' + | 'fullBanner' + | 'leaderboard' + | 'smartBannerPortrait' + | 'smartBannerLandscape'; +export interface AdMobBannerProperties extends ViewProperties { + bannerSize?: AdMobBannerSize; + adUnitID?: string; + testDeviceID?: string; + didFailToReceiveAdWithError?(errorDescription: string): void; + adViewDidReceiveAd?(): void; + adViewWillPresentScreen?(): void; + adViewWillDismissScreen?(): void; + adViewDidDismissScreen?(): void; + adViewWillLeaveApplication?(): void; +} + +export class AdMobBanner extends Component { } + +export interface AdMobAppEvent { + name: string; + info: string; +} +export interface PublisherBannerProperties extends AdMobBannerProperties { + admobDispatchAppEvent?(event: AdMobAppEvent): void; +} +export class PublisherBanner extends Component { } + +export type AdMobInterstitialEmptyEvent = + | 'interstitialDidLoad' + | 'interstitialDidOpen' + | 'interstitialDidClose' + | 'interstitialWillLeaveApplication'; +export type AdMobInterstitialEvent = AdMobInterstitialEmptyEvent | 'interstitialVideoDidFailToLoad'; +export namespace AdMobInterstitial { + function setAdUnitID(id: string): void; + function setTestDeviceID(id: string): void; + function requestAd(callback?: () => void): void; + function showAd(callback?: (error: string) => void): void; + function isReady(callback: (isReady: boolean) => void): void; + function addEventListener(event: 'interstitialDidFailToLoad', handler: (error: string) => void): void; + function addEventListener(event: AdMobInterstitialEmptyEvent, handler: () => void): void; + function removeEventListener(event: 'interstitialDidFailToLoad', handler: (error: string) => void): void; + function removeEventListener(event: AdMobInterstitialEmptyEvent, handler: () => void): void; + function removeAllListeners(): void; +} + +export type AdMobRewardedEmptyEvent = + | 'rewardedVideoDidLoad' + | 'rewardedVideoDidOpen' + | 'rewardedVideoDidClose' + | 'rewardedVideoWillLeaveApplication'; +export type AdMobRewardedEvent = AdMobRewardedEmptyEvent | 'rewardedVideoDidRewardUser' | 'rewardedVideoDidFailToLoad'; +export namespace AdMobRewarded { + function setAdUnitID(id: string): void; + function setTestDeviceID(id: string): void; + function requestAd(callback?: () => void): void; + function showAd(callback?: (error: string) => void): void; + function addEventListener(event: 'rewardedVideoDidRewardUser', handler: (type: string, amount: number) => void): void; + function addEventListener(event: 'rewardedVideoDidFailToLoad', handler: (error: string) => void): void; + function addEventListener(event: AdMobRewardedEmptyEvent, handler: () => void): void; + function removeEventListener(event: 'rewardedVideoDidRewardUser', handler: (type: string, amount: number) => void): void; + function removeEventListener(event: 'rewardedVideoDidFailToLoad', handler: (error: string) => void): void; + function removeEventListener(event: AdMobRewardedEmptyEvent, handler: () => void): void; + function removeAllListeners(): void; +} + /** * Amplitude */ diff --git a/types/expo/v24/expo-tests.tsx b/types/expo/v24/expo-tests.tsx index 8749a5993c..308e2de089 100644 --- a/types/expo/v24/expo-tests.tsx +++ b/types/expo/v24/expo-tests.tsx @@ -3,6 +3,10 @@ import { Text } from 'react-native'; import { Accelerometer, + AdMobAppEvent, + AdMobBanner, + AdMobInterstitial, + AdMobRewarded, Amplitude, Asset, AuthSession, @@ -26,6 +30,7 @@ import { KeepAwake, LinearGradient, Permissions, + PublisherBanner, registerRootComponent, ScreenOrientation } from 'expo'; @@ -38,6 +43,35 @@ Accelerometer.addListener((obj) => { Accelerometer.removeAllListeners(); Accelerometer.setUpdateInterval(1000); +() => ( + console.log(error)} + style={{ flex: 1 }} + /> +); + +() => ( + console.log(error)} + admobDispatchAppEvent={(event: AdMobAppEvent) => console.log(event)} + style={{ flex: 1 }} + /> +); + +AdMobInterstitial.setAdUnitID('ca-app-pub-3940256099942544/1033173712'); // Test ID, Replace with your-admob-unit-id +AdMobInterstitial.setTestDeviceID('EMULATOR'); +AdMobInterstitial.requestAd(() => AdMobInterstitial.showAd()); + +AdMobRewarded.setAdUnitID('ca-app-pub-3940256099942544/1033173712'); // Test ID, Replace with your-admob-unit-id +AdMobRewarded.setTestDeviceID('EMULATOR'); +AdMobRewarded.requestAd(() => AdMobRewarded.showAd()); + Amplitude.initialize('key'); Amplitude.setUserId('userId'); Amplitude.setUserProperties({key: 1}); diff --git a/types/expo/v24/index.d.ts b/types/expo/v24/index.d.ts index e6a238d129..2192912c88 100644 --- a/types/expo/v24/index.d.ts +++ b/types/expo/v24/index.d.ts @@ -59,6 +59,79 @@ export namespace Accelerometer { function setUpdateInterval(intervalMs: number): void; } +/** + * Admob + */ +export type AdMobBannerSize = + | 'banner' + | 'largeBanner' + | 'mediumRectangle' + | 'fullBanner' + | 'leaderboard' + | 'smartBannerPortrait' + | 'smartBannerLandscape'; +export interface AdMobBannerProperties extends ViewProperties { + bannerSize?: AdMobBannerSize; + adUnitID?: string; + testDeviceID?: string; + didFailToReceiveAdWithError?(errorDescription: string): void; + adViewDidReceiveAd?(): void; + adViewWillPresentScreen?(): void; + adViewWillDismissScreen?(): void; + adViewDidDismissScreen?(): void; + adViewWillLeaveApplication?(): void; +} + +export class AdMobBanner extends Component { } + +export interface AdMobAppEvent { + name: string; + info: string; +} +export interface PublisherBannerProperties extends AdMobBannerProperties { + admobDispatchAppEvent?(event: AdMobAppEvent): void; +} +export class PublisherBanner extends Component { } + +export type AdMobInterstitialEmptyEvent = + | 'interstitialDidLoad' + | 'interstitialDidOpen' + | 'interstitialDidClose' + | 'interstitialWillLeaveApplication'; +export type AdMobInterstitialEvent = AdMobInterstitialEmptyEvent | 'interstitialVideoDidFailToLoad'; +export namespace AdMobInterstitial { + function setAdUnitID(id: string): void; + function setTestDeviceID(id: string): void; + function requestAd(callback?: () => void): void; + function showAd(callback?: (error: string) => void): void; + function isReady(callback: (isReady: boolean) => void): void; + function addEventListener(event: 'interstitialDidFailToLoad', handler: (error: string) => void): void; + function addEventListener(event: AdMobInterstitialEmptyEvent, handler: () => void): void; + function removeEventListener(event: 'interstitialDidFailToLoad', handler: (error: string) => void): void; + function removeEventListener(event: AdMobInterstitialEmptyEvent, handler: () => void): void; + function removeAllListeners(): void; +} + +export type AdMobRewardedEmptyEvent = + | 'rewardedVideoDidLoad' + | 'rewardedVideoDidOpen' + | 'rewardedVideoDidClose' + | 'rewardedVideoWillLeaveApplication'; +export type AdMobRewardedEvent = AdMobRewardedEmptyEvent | 'rewardedVideoDidRewardUser' | 'rewardedVideoDidFailToLoad'; +export namespace AdMobRewarded { + function setAdUnitID(id: string): void; + function setTestDeviceID(id: string): void; + function requestAd(callback?: () => void): void; + function showAd(callback?: (error: string) => void): void; + function addEventListener(event: 'rewardedVideoDidRewardUser', handler: (type: string, amount: number) => void): void; + function addEventListener(event: 'rewardedVideoDidFailToLoad', handler: (error: string) => void): void; + function addEventListener(event: AdMobRewardedEmptyEvent, handler: () => void): void; + function removeEventListener(event: 'rewardedVideoDidRewardUser', handler: (type: string, amount: number) => void): void; + function removeEventListener(event: 'rewardedVideoDidFailToLoad', handler: (error: string) => void): void; + function removeEventListener(event: AdMobRewardedEmptyEvent, handler: () => void): void; + function removeAllListeners(): void; +} + /** * Provides access to Amplitude mobile analytics which basically lets you log various events to the Cloud. This module wraps Amplitude’s iOS and Android SDKs. * diff --git a/types/expo/v25/expo-tests.tsx b/types/expo/v25/expo-tests.tsx new file mode 100644 index 0000000000..afcb006949 --- /dev/null +++ b/types/expo/v25/expo-tests.tsx @@ -0,0 +1,732 @@ +import * as React from 'react'; +import { Text } from 'react-native'; + +import { + Accelerometer, + AdMobAppEvent, + AdMobBanner, + AdMobInterstitial, + AdMobRewarded, + Amplitude, + Asset, + AuthSession, + Audio, + AppLoading, + BarCodeScanner, + BlurViewProps, + BlurView, + Brightness, + Camera, + CameraObject, + DocumentPicker, + Facebook, + FacebookAds, + FileSystem, + ImagePicker, + ImageManipulator, + FaceDetector, + Svg, + IntentLauncherAndroid, + KeepAwake, + LinearGradient, + Permissions, + PublisherBanner, + registerRootComponent, + ScreenOrientation, + SQLite, + Calendar, + MailComposer +} from 'expo'; + +Accelerometer.addListener((obj) => { + obj.x; + obj.y; + obj.z; +}); +Accelerometer.removeAllListeners(); +Accelerometer.setUpdateInterval(1000); + +() => ( + console.log(error)} + style={{ flex: 1 }} + /> +); + +() => ( + console.log(error)} + admobDispatchAppEvent={(event: AdMobAppEvent) => console.log(event)} + style={{ flex: 1 }} + /> +); + +AdMobInterstitial.setAdUnitID('ca-app-pub-3940256099942544/1033173712'); // Test ID, Replace with your-admob-unit-id +AdMobInterstitial.setTestDeviceID('EMULATOR'); +AdMobInterstitial.requestAd(() => AdMobInterstitial.showAd()); + +AdMobRewarded.setAdUnitID('ca-app-pub-3940256099942544/1033173712'); // Test ID, Replace with your-admob-unit-id +AdMobRewarded.setTestDeviceID('EMULATOR'); +AdMobRewarded.requestAd(() => AdMobRewarded.showAd()); + +Amplitude.initialize('key'); +Amplitude.setUserId('userId'); +Amplitude.setUserProperties({key: 1}); +Amplitude.clearUserProperties(); +Amplitude.logEvent('name'); +Amplitude.logEventWithProperties('event', {key: 'value'}); +Amplitude.setGroup('type', ['value']); + +const asset = Asset.fromModule(1); +asset.downloadAsync(); +Asset.loadAsync(1); +Asset.loadAsync([1, 2, 3]); +const asset1 = new Asset({ + uri: 'uri', + type: 'type', + name: 'name', + hash: 'hash', + width: 122, + height: 122 +}); + +const url = AuthSession.getRedirectUrl(); +AuthSession.dismiss(); +AuthSession.startAsync({ + authUrl: 'url1', + returnUrl: 'url2' +}).then(result => { + switch (result.type) { + case 'success': + result.event; + result.params; + break; + case 'error': + result.errorCode; + result.params; + result.event; + break; + case 'dismissed': + case 'cancel': + result.type; + break; + } +}); +AuthSession.startAsync({ + authUrl: 'url1', + returnUrl: undefined +}); + +Audio.setAudioModeAsync({ + shouldDuckAndroid: false, + playsInSilentModeIOS: true, + interruptionModeIOS: 2, + interruptionModeAndroid: 1, + allowsRecordingIOS: true +}); +Audio.setIsEnabledAsync(true); + +Audio.INTERRUPTION_MODE_IOS_MIX_WITH_OTHERS === 0; +Audio.INTERRUPTION_MODE_IOS_DO_NOT_MIX === 1; +Audio.INTERRUPTION_MODE_IOS_DUCK_OTHERS === 2; + +Audio.INTERRUPTION_MODE_ANDROID_DO_NOT_MIX === 1; +Audio.INTERRUPTION_MODE_ANDROID_DUCK_OTHERS === 2; + +Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_DEFAULT === 0; +Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_THREE_GPP === 1; +Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_MPEG_4 === 2; +Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AMR_NB === 3; +Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AMR_WB === 4; +Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AAC_ADIF === 5; +Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AAC_ADTS === 6; +Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_RTP_AVP === 7; +Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_MPEG2TS === 8; +Audio.RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_WEBM === 9; + +Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_DEFAULT === 0; +Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AMR_NB === 1; +Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AMR_WB === 2; +Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AAC === 3; +Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_HE_AAC === 4; +Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AAC_ELD === 5; +Audio.RECORDING_OPTION_ANDROID_AUDIO_ENCODER_VORBIS === 6; + +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_LINEARPCM === 'lpcm'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_AC3 === 'ac-3'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_60958AC3 === 'cac3'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_APPLEIMA4 === 'ima4'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC === 'aac '; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4CELP === 'celp'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4HVXC === 'hvxc'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4TWINVQ === 'twvq'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MACE3 === 'MAC3'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MACE6 === 'MAC6'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_ULAW === 'ulaw'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_ALAW === 'alaw'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_QDESIGN === 'QDMC'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_QDESIGN2 === 'QDM2'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_QUALCOMM === 'Qclp'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEGLAYER1 === '.mp1'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEGLAYER2 === '.mp2'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEGLAYER3 === '.mp3'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_APPLELOSSLESS === 'alac'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_HE === 'aach'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_LD === 'aacl'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_ELD === 'aace'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_ELD_SBR === 'aacf'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_ELD_V2 === 'aacg'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_HE_V2 === 'aacp'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_SPATIAL === 'aacs'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_AMR === 'samr'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_AMR_WB === 'sawb'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_AUDIBLE === 'AUDB'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_ILBC === 'ilbc'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_DVIINTELIMA === 0x6d730011; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_MICROSOFTGSM === 0x6d730031; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_AES3 === 'aes3'; +Audio.RECORDING_OPTION_IOS_OUTPUT_FORMAT_ENHANCEDAC3 === 'ec-3'; + +Audio.RECORDING_OPTION_IOS_AUDIO_QUALITY_MIN === 0; +Audio.RECORDING_OPTION_IOS_AUDIO_QUALITY_LOW === 0x20; +Audio.RECORDING_OPTION_IOS_AUDIO_QUALITY_MEDIUM === 0x40; +Audio.RECORDING_OPTION_IOS_AUDIO_QUALITY_HIGH === 0x60; +Audio.RECORDING_OPTION_IOS_AUDIO_QUALITY_MAX === 0x7f; + +Audio.RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_CONSTANT === 0; +Audio.RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_LONG_TERM_AVERAGE === 1; +Audio.RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_VARIABLE_CONSTRAINED === 2; +Audio.RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_VARIABLE === 3; + +Audio.RECORDING_OPTIONS_PRESET_HIGH_QUALITY; +Audio.RECORDING_OPTIONS_PRESET_LOW_QUALITY; +async () => { + const result = await Audio.Sound.create({uri: 'uri'}, { + volume: 0.5, + rate: 0.6 + }, null, true); + + const sound = result.sound; + const status = result.status; + + if (!status.isLoaded) { + status.error; + } else { + status.didJustFinish; + // etc. + } + + const _status = await sound.getStatusAsync(); + await sound.loadAsync({uri: 'uri'}); +}; + +() => ( + Promise.resolve()} + onFinish={() => {}} + onError={(error) => console.log(error)} /> +); +() => ( + +); + +const barcodeReadCallback = () => {}; +() => ( + +); + +() => ( + +); + +async () => { + await Brightness.setBrightnessAsync(.6); + await Brightness.setSystemBrightnessAsync(.7); + const br1 = await Brightness.getBrightnessAsync(); + const br2 = await Brightness.getSystemBrightnessAsync(); +}; + +Camera.Constants.AutoFocus; +Camera.Constants.Type; +Camera.Constants.FlashMode; +Camera.Constants.WhiteBalance; +Camera.Constants.VideoQuality; +Camera.Constants.BarCodeType; +() => { + return( { + if (component) { + component.recordAsync(); + } + }} />); +}; + +async () => { + const result = await DocumentPicker.getDocumentAsync(); + + if (result.type === 'success') { + result.name; + result.uri; + result.size; + } +}; + +async () => { + const { type, expires, token } = await Facebook.logInWithReadPermissionsAsync("appId"); +}; + +() => ( + {}} + onError={() => {}} /> +); + +async () => { + const info = await FileSystem.getInfoAsync('file'); + + info.exists; + info.isDirectory; + + if (info.exists) { + info.md5; + info.uri; + info.size; + info.modificationTime; + } + + const string: string = await FileSystem.readAsStringAsync('file'); + await FileSystem.writeAsStringAsync('file', 'content'); + await FileSystem.deleteAsync('file'); + await FileSystem.moveAsync({ from: 'from', to: 'to'}); + await FileSystem.copyAsync({ from: 'from', to: 'to' }); + await FileSystem.makeDirectoryAsync('dir'); + const dirs: string[] = await FileSystem.readDirectoryAsync('dir'); + const result = await FileSystem.downloadAsync('from', 'to'); + + result.headers; + result.status; + result.uri; + result.md5; +}; + +async () => { + // Video test + const result = await ImagePicker.launchImageLibraryAsync({ + mediaTypes: ImagePicker.MediaTypeOptions.Videos, + }); + + if (!result.cancelled) { + result.uri; + result.width; + result.height; + result.duration; + result.type; + } +}; + +async () => { + // Image test + const result = await ImagePicker.launchImageLibraryAsync({ + mediaTypes: ImagePicker.MediaTypeOptions.Images, + base64: true, + aspect: [4, 3], + quality: 1, + exif: true, + }); + + if (!result.cancelled) { + result.uri; + result.width; + result.height; + result.exif; + result.base64; + result.type; + } +}; + +async () => { + const result = await ImageManipulator.manipulate('url', { + rotate: 90 + }, { + compress: 0.5 + }); + + result.height; + result.uri; + result.width; +}; + +FaceDetector.Constants.Mode.fast; +FaceDetector.Constants.Mode.accurate; +FaceDetector.Constants.Landmarks.all; +FaceDetector.Constants.Landmarks.none; +FaceDetector.Constants.Classifications.all; +FaceDetector.Constants.Classifications.none; +async () => { + const result = await FaceDetector.detectFaces('url', { + mode: FaceDetector.Constants.Mode.fast, + detectLandmarks: FaceDetector.Constants.Landmarks.all, + runClassifications: FaceDetector.Constants.Classifications.none + }); + + result.faces[0]; +}; + +() => ( + + + + + + + + + STROKED TEXT + + + + + + + + We go up and down, + then up again + + + + + + + + + + + + + + + + + + + + + +); + +IntentLauncherAndroid.ACTION_ACCESSIBILITY_SETTINGS === 'android.settings.ACCESSIBILITY_SETTINGS'; +IntentLauncherAndroid.ACTION_APP_NOTIFICATION_REDACTION === 'android.settings.ACTION_APP_NOTIFICATION_REDACTION'; +IntentLauncherAndroid.ACTION_CONDITION_PROVIDER_SETTINGS === 'android.settings.ACTION_CONDITION_PROVIDER_SETTINGS'; +IntentLauncherAndroid.ACTION_NOTIFICATION_LISTENER_SETTINGS === 'android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS'; +IntentLauncherAndroid.ACTION_PRINT_SETTINGS === 'android.settings.ACTION_PRINT_SETTINGS'; +IntentLauncherAndroid.ACTION_ADD_ACCOUNT_SETTINGS === 'android.settings.ADD_ACCOUNT_SETTINGS'; +IntentLauncherAndroid.ACTION_AIRPLANE_MODE_SETTINGS === 'android.settings.AIRPLANE_MODE_SETTINGS'; +IntentLauncherAndroid.ACTION_APN_SETTINGS === 'android.settings.APN_SETTINGS'; +IntentLauncherAndroid.ACTION_APPLICATION_DETAILS_SETTINGS === 'android.settings.APPLICATION_DETAILS_SETTINGS'; +IntentLauncherAndroid.ACTION_APPLICATION_DEVELOPMENT_SETTINGS === 'android.settings.APPLICATION_DEVELOPMENT_SETTINGS'; +IntentLauncherAndroid.ACTION_APPLICATION_SETTINGS === 'android.settings.APPLICATION_SETTINGS'; +IntentLauncherAndroid.ACTION_APP_NOTIFICATION_SETTINGS === 'android.settings.APP_NOTIFICATION_SETTINGS'; +IntentLauncherAndroid.ACTION_APP_OPS_SETTINGS === 'android.settings.APP_OPS_SETTINGS'; +IntentLauncherAndroid.ACTION_BATTERY_SAVER_SETTINGS === 'android.settings.BATTERY_SAVER_SETTINGS'; +IntentLauncherAndroid.ACTION_BLUETOOTH_SETTINGS === 'android.settings.BLUETOOTH_SETTINGS'; +IntentLauncherAndroid.ACTION_CAPTIONING_SETTINGS === 'android.settings.CAPTIONING_SETTINGS'; +IntentLauncherAndroid.ACTION_CAST_SETTINGS === 'android.settings.CAST_SETTINGS'; +IntentLauncherAndroid.ACTION_DATA_ROAMING_SETTINGS === 'android.settings.DATA_ROAMING_SETTINGS'; +IntentLauncherAndroid.ACTION_DATE_SETTINGS === 'android.settings.DATE_SETTINGS'; +IntentLauncherAndroid.ACTION_DEVICE_INFO_SETTINGS === 'android.settings.DEVICE_INFO_SETTINGS'; +IntentLauncherAndroid.ACTION_DEVICE_NAME === 'android.settings.DEVICE_NAME'; +IntentLauncherAndroid.ACTION_DISPLAY_SETTINGS === 'android.settings.DISPLAY_SETTINGS'; +IntentLauncherAndroid.ACTION_DREAM_SETTINGS === 'android.settings.DREAM_SETTINGS'; +IntentLauncherAndroid.ACTION_HARD_KEYBOARD_SETTINGS === 'android.settings.HARD_KEYBOARD_SETTINGS'; +IntentLauncherAndroid.ACTION_HOME_SETTINGS === 'android.settings.HOME_SETTINGS'; +IntentLauncherAndroid.ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS === 'android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS'; +IntentLauncherAndroid.ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS === 'android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS'; +IntentLauncherAndroid.ACTION_INPUT_METHOD_SETTINGS === 'android.settings.INPUT_METHOD_SETTINGS'; +IntentLauncherAndroid.ACTION_INPUT_METHOD_SUBTYPE_SETTINGS === 'android.settings.INPUT_METHOD_SUBTYPE_SETTINGS'; +IntentLauncherAndroid.ACTION_INTERNAL_STORAGE_SETTINGS === 'android.settings.INTERNAL_STORAGE_SETTINGS'; +IntentLauncherAndroid.ACTION_LOCALE_SETTINGS === 'android.settings.LOCALE_SETTINGS'; +IntentLauncherAndroid.ACTION_LOCATION_SOURCE_SETTINGS === 'android.settings.LOCATION_SOURCE_SETTINGS'; +IntentLauncherAndroid.ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS === 'android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS'; +IntentLauncherAndroid.ACTION_MANAGE_APPLICATIONS_SETTINGS === 'android.settings.MANAGE_APPLICATIONS_SETTINGS'; +IntentLauncherAndroid.ACTION_MANAGE_DEFAULT_APPS_SETTINGS === 'android.settings.MANAGE_DEFAULT_APPS_SETTINGS'; +IntentLauncherAndroid.ACTION_MEMORY_CARD_SETTINGS === 'android.settings.MEMORY_CARD_SETTINGS'; +IntentLauncherAndroid.ACTION_MONITORING_CERT_INFO === 'android.settings.MONITORING_CERT_INFO'; +IntentLauncherAndroid.ACTION_NETWORK_OPERATOR_SETTINGS === 'android.settings.NETWORK_OPERATOR_SETTINGS'; +IntentLauncherAndroid.ACTION_NFCSHARING_SETTINGS === 'android.settings.NFCSHARING_SETTINGS'; +IntentLauncherAndroid.ACTION_NFC_PAYMENT_SETTINGS === 'android.settings.NFC_PAYMENT_SETTINGS'; +IntentLauncherAndroid.ACTION_NFC_SETTINGS === 'android.settings.NFC_SETTINGS'; +IntentLauncherAndroid.ACTION_NIGHT_DISPLAY_SETTINGS === 'android.settings.NIGHT_DISPLAY_SETTINGS'; +IntentLauncherAndroid.ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS === 'android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS'; +IntentLauncherAndroid.ACTION_NOTIFICATION_SETTINGS === 'android.settings.NOTIFICATION_SETTINGS'; +IntentLauncherAndroid.ACTION_PAIRING_SETTINGS === 'android.settings.PAIRING_SETTINGS'; +IntentLauncherAndroid.ACTION_PRIVACY_SETTINGS === 'android.settings.PRIVACY_SETTINGS'; +IntentLauncherAndroid.ACTION_QUICK_LAUNCH_SETTINGS === 'android.settings.QUICK_LAUNCH_SETTINGS'; +IntentLauncherAndroid.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS === 'android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS'; +IntentLauncherAndroid.ACTION_SECURITY_SETTINGS === 'android.settings.SECURITY_SETTINGS'; +IntentLauncherAndroid.ACTION_SETTINGS === 'android.settings.SETTINGS'; +IntentLauncherAndroid.ACTION_SHOW_ADMIN_SUPPORT_DETAILS === 'android.settings.SHOW_ADMIN_SUPPORT_DETAILS'; +IntentLauncherAndroid.ACTION_SHOW_INPUT_METHOD_PICKER === 'android.settings.SHOW_INPUT_METHOD_PICKER'; +IntentLauncherAndroid.ACTION_SHOW_REGULATORY_INFO === 'android.settings.SHOW_REGULATORY_INFO'; +IntentLauncherAndroid.ACTION_SHOW_REMOTE_BUGREPORT_DIALOG === 'android.settings.SHOW_REMOTE_BUGREPORT_DIALOG'; +IntentLauncherAndroid.ACTION_SOUND_SETTINGS === 'android.settings.SOUND_SETTINGS'; +IntentLauncherAndroid.ACTION_STORAGE_MANAGER_SETTINGS === 'android.settings.STORAGE_MANAGER_SETTINGS'; +IntentLauncherAndroid.ACTION_SYNC_SETTINGS === 'android.settings.SYNC_SETTINGS'; +IntentLauncherAndroid.ACTION_SYSTEM_UPDATE_SETTINGS === 'android.settings.SYSTEM_UPDATE_SETTINGS'; +IntentLauncherAndroid.ACTION_TETHER_PROVISIONING_UI === 'android.settings.TETHER_PROVISIONING_UI'; +IntentLauncherAndroid.ACTION_TRUSTED_CREDENTIALS_USER === 'android.settings.TRUSTED_CREDENTIALS_USER'; +IntentLauncherAndroid.ACTION_USAGE_ACCESS_SETTINGS === 'android.settings.USAGE_ACCESS_SETTINGS'; +IntentLauncherAndroid.ACTION_USER_DICTIONARY_INSERT === 'android.settings.USER_DICTIONARY_INSERT'; +IntentLauncherAndroid.ACTION_USER_DICTIONARY_SETTINGS === 'android.settings.USER_DICTIONARY_SETTINGS'; +IntentLauncherAndroid.ACTION_USER_SETTINGS === 'android.settings.USER_SETTINGS'; +IntentLauncherAndroid.ACTION_VOICE_CONTROL_AIRPLANE_MODE === 'android.settings.VOICE_CONTROL_AIRPLANE_MODE'; +IntentLauncherAndroid.ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE === 'android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE'; +IntentLauncherAndroid.ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE === 'android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE'; +IntentLauncherAndroid.ACTION_VOICE_INPUT_SETTINGS === 'android.settings.VOICE_INPUT_SETTINGS'; +IntentLauncherAndroid.ACTION_VPN_SETTINGS === 'android.settings.VPN_SETTINGS'; +IntentLauncherAndroid.ACTION_VR_LISTENER_SETTINGS === 'android.settings.VR_LISTENER_SETTINGS'; +IntentLauncherAndroid.ACTION_WEBVIEW_SETTINGS === 'android.settings.WEBVIEW_SETTINGS'; +IntentLauncherAndroid.ACTION_WIFI_IP_SETTINGS === 'android.settings.WIFI_IP_SETTINGS'; +IntentLauncherAndroid.ACTION_WIFI_SETTINGS === 'android.settings.WIFI_SETTINGS'; +IntentLauncherAndroid.ACTION_WIRELESS_SETTINGS === 'android.settings.WIRELESS_SETTINGS'; +IntentLauncherAndroid.ACTION_ZEN_MODE_AUTOMATION_SETTINGS === 'android.settings.ZEN_MODE_AUTOMATION_SETTINGS'; +IntentLauncherAndroid.ACTION_ZEN_MODE_EVENT_RULE_SETTINGS === 'android.settings.ZEN_MODE_EVENT_RULE_SETTINGS'; +IntentLauncherAndroid.ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS === 'android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS'; +IntentLauncherAndroid.ACTION_ZEN_MODE_PRIORITY_SETTINGS === 'android.settings.ZEN_MODE_PRIORITY_SETTINGS'; +IntentLauncherAndroid.ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS === 'android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS'; +IntentLauncherAndroid.ACTION_ZEN_MODE_SETTINGS === 'android.settings.ZEN_MODE_SETTINGS'; + +KeepAwake.activate(); +KeepAwake.deactivate(); + +() => ( + +); + +() => ( + +); + +Permissions.CAMERA === 'camera'; +Permissions.CAMERA_ROLL === 'cameraRoll'; +Permissions.AUDIO_RECORDING === 'audioRecording'; +Permissions.CONTACTS === 'contacts'; +Permissions.NOTIFICATIONS === 'remoteNotifications'; +Permissions.REMOTE_NOTIFICATIONS === 'remoteNotifications'; +Permissions.SYSTEM_BRIGHTNESS === 'systemBrightness'; +async () => { + const result = await Permissions.askAsync(Permissions.CAMERA); + + result.status === 'granted'; + result.status === 'denied'; + result.status === 'undetermined'; + + result.expires === 'never'; +}; + +ScreenOrientation.Orientation.ALL; +ScreenOrientation.allow(ScreenOrientation.Orientation.ALL); + +class __TestEntry__ extends React.Component { + render() { + return( + test + ); + } +} +registerRootComponent(__TestEntry__); + +Calendar.EntityTypes.EVENT === 'event'; +Calendar.EntityTypes.REMINDER === 'reminder'; + +Calendar.CalendarType.LOCAL === 'local'; +Calendar.CalendarType.CALDAV === 'caldav'; +Calendar.CalendarType.EXCHANGE === 'exchange'; +Calendar.CalendarType.SUBSCRIBED === 'subscribed'; +Calendar.CalendarType.BIRTHDAYS === 'birthdays'; + +async () => { + const result = await Calendar.getCalendarsAsync(Calendar.EntityTypes.EVENT); + result.length; + + const calendar = result[0]; + calendar.id === ''; + calendar.title === ''; + calendar.sourceId === ''; + calendar.type === Calendar.CalendarType.BIRTHDAYS; + calendar.color === ''; + calendar.entityType === Calendar.EntityTypes.EVENT; + calendar.allowsModifications === true; + calendar.allowedAvailabilities === ['']; + calendar.isPrimary === true; + calendar.name === ''; + calendar.ownerAccount === ''; + calendar.timeZone === ''; + calendar.allowedReminders === ['']; + calendar.allowedAttendeeTypes === ['']; + calendar.isVisible === false; + calendar.isSynced === false; + calendar.accessLevel === Calendar.CalendarAccessLevel.CONTRIBUTOR; + + if (calendar.source) { + calendar.source.id === ''; + calendar.source.type === ''; + calendar.source.name === ''; + calendar.source.isLocalAccount === false; + } + + const id1 = await Calendar.createCalendarAsync({ + accessLevel: Calendar.CalendarAccessLevel.EDITOR + }); + + id1 === ''; + + const id2 = await Calendar.updateCalendarAsync('1234', { + isVisible: false + }); + + id2 === ''; + + const id3 = await Calendar.updateCalendarAsync('1234', null); + + await Calendar.deleteCalendarAsync('1234'); + + const events = await Calendar.getEventsAsync( + ['123', '124'], + new Date(), + new Date() + ); + + const event1 = events[0]; + + event1.accessLevel === Calendar.EventAccessLevel.CONFIDENTIAL; + event1.alarms === []; + event1.allDay === true; + event1.availability === Calendar.Availability.FREE; + event1.calendarId === ''; + event1.creationDate === ''; + event1.endDate === ''; + event1.endTimeZone === ''; + event1.guestsCanInviteOthers === true; + event1.guestsCanModify === true; + event1.guestsCanSeeGuests === false; + event1.id === ''; + event1.instanceId === ''; + event1.isDetached === false; + + const event2 = await Calendar.getEventAsync('123', { + futureEvents: true + }); + + const eventId1 = await Calendar.createEventAsync('123'); + + const eventId2 = await Calendar.updateEventAsync('1234'); + + await Calendar.deleteEventAsync('1234'); + + const attendees = await Calendar.getAttendeesForEventAsync('123'); + + const aId1 = await Calendar.createAttendeeAsync('123'); + + const aId2 = await Calendar.updateAttendeeAsync('123'); + + await Calendar.deleteAttendeeAsync('123'); + + const reminders = await Calendar.getRemindersAsync(['123']); + + const reminder = await Calendar.getReminderAsync('123'); + + const remId1 = await Calendar.createReminderAsync('123'); + + const remId2 = await Calendar.updateReminderAsync('123'); + + await Calendar.deleteReminderAsync('123'); + + const sources = await Calendar.getSourcesAsync(); + + const source = await Calendar.getSourceAsync('123'); + + Calendar.openEventInCalendar('123'); +}; + +async () => { + const result = await MailComposer.composeAsync({ + subject: 'sss' + }); + + result.status === 'saved'; +}; diff --git a/types/expo/v25/index.d.ts b/types/expo/v25/index.d.ts new file mode 100644 index 0000000000..101856e288 --- /dev/null +++ b/types/expo/v25/index.d.ts @@ -0,0 +1,2759 @@ +// Type definitions for expo 25.0 +// Project: https://github.com/expo/expo-sdk +// Definitions by: Konstantin Kai +// Martynas Kadiša +// Jan Aagaard +// Sergio Sánchez +// Fernando Helwanger +// Umidbek Karimov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import { EventSubscription } from 'fbemitter'; +import { Component, ComponentClass, Ref, ComponentType } from 'react'; +import { + ColorPropType, + ImageRequireSource, + ImageURISource, + NativeEventEmitter, + ViewProperties, + ViewStyle, + Permission, + StyleProp +} from 'react-native'; + +export type Axis = number; +export type BarCodeReadCallback = (params: { type: string; data: string; }) => void; +export type FloatFromZeroToOne = 0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1; +export type Md5 = string; +export type Orientation = 'portrait' | 'landscape'; +export type RequireSource = ImageRequireSource; +export type ResizeModeContain = 'contain'; +export type ResizeModeCover = 'cover'; +export type ResizeModeStretch = 'stretch'; +export type URISource = ImageURISource; + +export interface HashMap { [key: string]: any; } + +/** Access the device accelerometer sensor(s) to respond to changes in acceleration in 3d space. */ +export namespace Accelerometer { + interface AccelerometerObject { + x: Axis; + y: Axis; + z: Axis; + } + + /** + * Subscribe for updates to the accelerometer. + * @param listener A callback that is invoked when an accelerometer update is available. When invoked, the listener is provided a single argumument that is an object containing keys x, y, z. + * @returns An EventSubscription object that you can call remove() on when you would like to unsubscribe the listener. + */ + function addListener(listener: (obj: AccelerometerObject) => any): EventSubscription; + + /** Remove all listeners. */ + function removeAllListeners(): void; + + /** + * Subscribe for updates to the accelerometer. + * @param intervalMs Desired interval in milliseconds between accelerometer updates. + */ + function setUpdateInterval(intervalMs: number): void; +} + +/** + * Admob + */ +export type AdMobBannerSize = + | 'banner' + | 'largeBanner' + | 'mediumRectangle' + | 'fullBanner' + | 'leaderboard' + | 'smartBannerPortrait' + | 'smartBannerLandscape'; +export interface AdMobBannerProperties extends ViewProperties { + bannerSize?: AdMobBannerSize; + adUnitID?: string; + testDeviceID?: string; + didFailToReceiveAdWithError?(errorDescription: string): void; + adViewDidReceiveAd?(): void; + adViewWillPresentScreen?(): void; + adViewWillDismissScreen?(): void; + adViewDidDismissScreen?(): void; + adViewWillLeaveApplication?(): void; +} + +export class AdMobBanner extends Component { } + +export interface AdMobAppEvent { + name: string; + info: string; +} +export interface PublisherBannerProperties extends AdMobBannerProperties { + admobDispatchAppEvent?(event: AdMobAppEvent): void; +} +export class PublisherBanner extends Component { } + +export type AdMobInterstitialEmptyEvent = + | 'interstitialDidLoad' + | 'interstitialDidOpen' + | 'interstitialDidClose' + | 'interstitialWillLeaveApplication'; +export type AdMobInterstitialEvent = AdMobInterstitialEmptyEvent | 'interstitialVideoDidFailToLoad'; +export namespace AdMobInterstitial { + function setAdUnitID(id: string): void; + function setTestDeviceID(id: string): void; + function requestAd(callback?: () => void): void; + function showAd(callback?: (error: string) => void): void; + function isReady(callback: (isReady: boolean) => void): void; + function addEventListener(event: 'interstitialDidFailToLoad', handler: (error: string) => void): void; + function addEventListener(event: AdMobInterstitialEmptyEvent, handler: () => void): void; + function removeEventListener(event: 'interstitialDidFailToLoad', handler: (error: string) => void): void; + function removeEventListener(event: AdMobInterstitialEmptyEvent, handler: () => void): void; + function removeAllListeners(): void; +} + +export type AdMobRewardedEmptyEvent = + | 'rewardedVideoDidLoad' + | 'rewardedVideoDidOpen' + | 'rewardedVideoDidClose' + | 'rewardedVideoWillLeaveApplication'; +export type AdMobRewardedEvent = AdMobRewardedEmptyEvent | 'rewardedVideoDidRewardUser' | 'rewardedVideoDidFailToLoad'; +export namespace AdMobRewarded { + function setAdUnitID(id: string): void; + function setTestDeviceID(id: string): void; + function requestAd(callback?: () => void): void; + function showAd(callback?: (error: string) => void): void; + function addEventListener(event: 'rewardedVideoDidRewardUser', handler: (type: string, amount: number) => void): void; + function addEventListener(event: 'rewardedVideoDidFailToLoad', handler: (error: string) => void): void; + function addEventListener(event: AdMobRewardedEmptyEvent, handler: () => void): void; + function removeEventListener(event: 'rewardedVideoDidRewardUser', handler: (type: string, amount: number) => void): void; + function removeEventListener(event: 'rewardedVideoDidFailToLoad', handler: (error: string) => void): void; + function removeEventListener(event: AdMobRewardedEmptyEvent, handler: () => void): void; + function removeAllListeners(): void; +} + +/** + * Provides access to Amplitude mobile analytics which basically lets you log various events to the Cloud. This module wraps Amplitude’s iOS and Android SDKs. + * + * Note: Session tracking may not work correctly when running Experiences in the main Expo app. It will work correctly if you create a standalone app. + */ +export namespace Amplitude { + /** Initializes Amplitude with your Amplitude API key. */ + function initialize(apiKey: string): void; + + /** Assign a user ID to the current user. If you don’t have a system for user IDs you don’t need to call this. */ + function setUserId(userId: string): void; + + /** Set properties for the current user. */ + function setUserProperties(userProperties: HashMap): void; + + /** Clear properties set by `setUserProperties()`. */ + function clearUserProperties(): void; + + /** Log an event to Amplitude. */ + function logEvent(eventName: string): void; + + /** Log an event to Amplitude with custom properties. */ + function logEventWithProperties( + eventName: string, + + /** A map of custom properties. */ + properties: HashMap + ): void; + + /** Add the current user to a group. */ + function setGroup( + /** The group name, e.g. `'sports'`. */ + groupType: string, + + /** An array of group names, e.g. `['tennis', 'soccer']`. */ + groupNames: string[] + ): void; +} + +// #region AppLoading +/** The following props are recommended, but optional for the sake of backwards compatibility (they were introduced in SDK21). If you do not provide any props, you are responsible for coordinating loading assets, handling errors, and updating state to unmount the `AppLoading` component. */ +export interface AppLoadingProps { + /** A `function` that returns a `Promise`. The `Promise` should resolve when the app is done loading data and assets. */ + startAsync?: () => Promise; + + /** Required if you provide `startAsync`. Called when `startAsync` resolves or rejects. This should be used to set state and unmount the `AppLoading` component. */ + onFinish?: () => void; + + /** If `startAsync` throws an error, it is caught and passed into the function provided to `onError`. */ + onError?: (error: Error) => void; +} + +/** + * A React component that tells Expo to keep the app loading screen open if it is the first and only component rendered in your app. When it is removed, the loading screen will disappear and your app will be visible. + * + * This is incredibly useful to let you download and cache fonts, logo and icon images and other assets that you want to be sure the user has on their device for an optimal experience before rendering they start using the app. + */ +export class AppLoading extends Component { } +// #endregion AppLoading + +/** This module provides an interface to Expo’s asset system. An asset is any file that lives alongside the source code of your app that the app needs at runtime. Examples include images, fonts and sounds. Expo’s asset system integrates with React Native’s, so that you can refer to files with require('path/to/file'). This is how you refer to static image files in React Native for use in an Image component, for example. */ +export class Asset { + constructor({ name, type, hash, uri, width, height }: { + name: string; + type: string; + hash: string; + uri: string; + width?: number; + height?: number; + }); + + /** The MD5 hash of the asset’s data. */ + hash: Md5; + + /** The name of the asset file without the extension. Also without the part from @ onward in the filename (used to specify scale factor for images). */ + name: string; + + /** The extension of the asset filename. */ + type: string; + + /** A URI that points to the asset’s data on the remote server. When running the published version of your app, this refers to the the location on Expo’s asset server where Expo has stored your asset. When running the app from XDE during development, this URI points to XDE’s server running on your computer and the asset is served directly from your computer. */ + uri: string; + + /** If the asset has been downloaded (by calling `downloadAsync()`), the `file://` URI pointing to the local file on the device that contains the asset data. */ + localUri: string; + + /** If the asset is an image, the width of the image data divided by the scale factor. The scale factor is the number after `@` in the filename, or `1` if not present. */ + width?: number; + + /** If the asset is an image, the height of the image data divided by the scale factor. The scale factor is the number after `@` in the filename, or `1` if not present. */ + height?: number; + + downloading: boolean; + downloaded: boolean; + downloadCallbacks: Array<{ resolve: () => any, reject: (e?: any) => any }>; + + /** Downloads the asset data to a local file in the device’s cache directory. Once the returned promise is fulfilled without error, the localUri field of this asset points to a local file containing the asset data. The asset is only downloaded if an up-to-date local file for the asset isn’t already present due to an earlier download. */ + downloadAsync(): Promise; + + /** Returns the `Expo.Asset` instance representing an asset given its module. */ + static fromModule(module: RequireSource): Asset; + + /** + * A helper that wraps `Expo.Asset.fromModule(module).downloadAsync` for convenience. + * @param moduleIds An array of `require('path/to/file')`. Can also be just one module without an Array. + */ + static loadAsync(module: RequireSource[] | RequireSource): Promise; +} + +/** + * Provides basic sample playback and recording. + * + * Note that Expo does not yet support backgrounding, so audio is not available to play in the background of your experience. Audio also automatically stops if headphones / bluetooth audio devices are disconnected. + */ +export namespace Audio { + enum InterruptionModeIos { + /** This is the default option. If this option is set, your experience’s audio is mixed with audio playing in background apps. */ + INTERRUPTION_MODE_IOS_MIX_WITH_OTHERS = 0, + + /** If this option is set, your experience’s audio interrupts audio from other apps. */ + INTERRUPTION_MODE_IOS_DO_NOT_MIX = 1, + + /** If this option is set, your experience’s audio lowers the volume ("ducks") of audio from other apps while your audio plays. */ + INTERRUPTION_MODE_IOS_DUCK_OTHERS = 2 + } + + const INTERRUPTION_MODE_IOS_MIX_WITH_OTHERS: 0; + const INTERRUPTION_MODE_IOS_DO_NOT_MIX: 1; + const INTERRUPTION_MODE_IOS_DUCK_OTHERS: 2; + + enum InterruptionModeAndroid { + /** If this option is set, your experience’s audio interrupts audio from other apps. */ + INTERRUPTION_MODE_ANDROID_DO_NOT_MIX = 1, + + /** This is the default option. If this option is set, your experience’s audio lowers the volume ("ducks") of audio from other apps while your audio plays. */ + INTERRUPTION_MODE_ANDROID_DUCK_OTHERS = 2 + } + + const INTERRUPTION_MODE_ANDROID_DO_NOT_MIX: 1; + const INTERRUPTION_MODE_ANDROID_DUCK_OTHERS: 2; + + const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_DEFAULT: 0; + const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_THREE_GPP: 1; + const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_MPEG_4: 2; + const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AMR_NB: 3; + const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AMR_WB: 4; + const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AAC_ADIF: 5; + const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_AAC_ADTS: 6; + const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_RTP_AVP: 7; + const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_MPEG2TS: 8; + const RECORDING_OPTION_ANDROID_OUTPUT_FORMAT_WEBM: 9; + + const RECORDING_OPTION_ANDROID_AUDIO_ENCODER_DEFAULT: 0; + const RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AMR_NB: 1; + const RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AMR_WB: 2; + const RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AAC: 3; + const RECORDING_OPTION_ANDROID_AUDIO_ENCODER_HE_AAC: 4; + const RECORDING_OPTION_ANDROID_AUDIO_ENCODER_AAC_ELD: 5; + const RECORDING_OPTION_ANDROID_AUDIO_ENCODER_VORBIS: 6; + + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_LINEARPCM: 'lpcm'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_AC3: 'ac-3'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_60958AC3: 'cac3'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_APPLEIMA4: 'ima4'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC: 'aac '; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4CELP: 'celp'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4HVXC: 'hvxc'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4TWINVQ: 'twvq'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MACE3: 'MAC3'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MACE6: 'MAC6'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_ULAW: 'ulaw'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_ALAW: 'alaw'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_QDESIGN: 'QDMC'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_QDESIGN2: 'QDM2'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_QUALCOMM: 'Qclp'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEGLAYER1: '.mp1'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEGLAYER2: '.mp2'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEGLAYER3: '.mp3'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_APPLELOSSLESS: 'alac'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_HE: 'aach'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_LD: 'aacl'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_ELD: 'aace'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_ELD_SBR: 'aacf'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_ELD_V2: 'aacg'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_HE_V2: 'aacp'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MPEG4AAC_SPATIAL: 'aacs'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_AMR: 'samr'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_AMR_WB: 'sawb'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_AUDIBLE: 'AUDB'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_ILBC: 'ilbc'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_DVIINTELIMA: 0x6d730011; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_MICROSOFTGSM: 0x6d730031; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_AES3: 'aes3'; + const RECORDING_OPTION_IOS_OUTPUT_FORMAT_ENHANCEDAC3: 'ec-3'; + + const RECORDING_OPTION_IOS_AUDIO_QUALITY_MIN: 0; + const RECORDING_OPTION_IOS_AUDIO_QUALITY_LOW: 0x20; + const RECORDING_OPTION_IOS_AUDIO_QUALITY_MEDIUM: 0x40; + const RECORDING_OPTION_IOS_AUDIO_QUALITY_HIGH: 0x60; + const RECORDING_OPTION_IOS_AUDIO_QUALITY_MAX: 0x7f; + + const RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_CONSTANT: 0; + const RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_LONG_TERM_AVERAGE: 1; + const RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_VARIABLE_CONSTRAINED: 2; + const RECORDING_OPTION_IOS_BIT_RATE_STRATEGY_VARIABLE: 3; + + type RecordingStatus = { + canRecord: false, + isDoneRecording: false + } | { + canRecord: true, + isRecording: boolean, + durationMillis: number + } | { + canRecord: false, + isDoneRecording: true, + durationMillis: number + }; + + const RECORDING_OPTIONS_PRESET_HIGH_QUALITY: RecordingOptions; + const RECORDING_OPTIONS_PRESET_LOW_QUALITY: RecordingOptions; + + interface RecordingOptions { + android: { + extension: string; + outputFormat: number; + audioEncoder: number; + sampleRate?: number; + numberOfChannels?: number; + bitRate?: number; + maxFileSize?: number; + }; + ios: { + extension: string; + outputFormat?: string | number; + audioQuality: number; + sampleRate: number; + numberOfChannels: number; + bitRate: number; + bitRateStrategy?: number; + bitDepthHint?: number; + linearPCMBitDepth?: number; + linearPCMIsBigEndian?: boolean; + linearPCMIsFloat?: boolean; + }; + } + + interface AudioMode { + /** Boolean selecting if your experience’s audio should play in silent mode on iOS. This value defaults to `false`. */ + playsInSilentModeIOS: boolean; + + /** Boolean selecting if recording is enabled on iOS. This value defaults to `false`. NOTE: when this flag is set to true, playback may be routed to the phone receiver instead of to the speaker. */ + allowsRecordingIOS: boolean; + + /** Enum selecting how your experience’s audio should interact with the audio from other apps on iOS. */ + interruptionModeIOS: InterruptionModeIos; + + /** Boolean selecting if your experience’s audio should automatically be lowered in volume ("duck") if audio from another app interrupts your experience. This value defaults to true. If false, audio from other apps will pause your audio. */ + shouldDuckAndroid: boolean; + + /** an enum selecting how your experience’s audio should interact with the audio from other apps on Android: */ + interruptionModeAndroid: InterruptionModeAndroid; + } + + function setIsEnabledAsync(value: boolean): Promise; + function setAudioModeAsync(mode: AudioMode): Promise; + + /** This class represents a sound corresponding to an Asset or URL. */ + class Sound extends PlaybackObject { + constructor(); + + /** + * Creates and loads a sound from source, with optional `initialStatus`, `onPlaybackStatusUpdate`, and `downloadFirst`. + * + * @returns A `Promise` that is rejected if creation failed, or fulfilled with the following dictionary if creation succeeded: + * - `sound`: The newly created and loaded Sound object. + * - `status`: The PlaybackStatus of the Sound object. See the AV documentation for further information. + */ + static create( + /** + * The source of the sound. The following forms are supported: + * + * - A dictionary of the form `{ uri: 'http://path/to/file' }` with a network URL pointing to an audio file on the web. + * - `require('path/to/file')` for an audio file asset in the source code directory. + * - An `Expo.Asset` object for an audio file asset. + */ + source: PlaybackSource, + + /** The initial intended PlaybackStatusToSet of the sound, whose values will override the default initial playback status. This value defaults to `{}` if no parameter is passed. */ + initialStatus?: PlaybackStatusToSet, + + /** A function taking a single parameter PlaybackStatus. This value defaults to `null` if no parameter is passed. */ + onPlaybackStatusUpdate?: ((status: PlaybackStatus) => void) | null, + + /** If set to true, the system will attempt to download the resource to the device before loading. This value defaults to `true`. Note that at the moment, this will only work for `source`s of the form `require('path/to/file')` or `Asset` objects. */ + downloadFirst?: boolean + ): Promise<{ sound: Sound, status: PlaybackStatus }>; + } + + class Recording { + constructor(); + + /** Gets the `status` of the `Recording`. */ + getStatusAsync(): Promise; + + /** Sets a function to be called regularly with the `status` of the `Recording`. */ + setOnRecordingStatusUpdate(onRecordingStatusUpdate?: (status: RecordingStatus) => void): void; + + /** Sets the interval with which onRecordingStatusUpdate is called while the recording can record. This value defaults to 500 milliseconds. */ + setProgressUpdateInterval(progressUpdateIntervalMillis: number): void; + + /** Loads the recorder into memory and prepares it for recording. This must be called before calling `startAsync()`. This method can only be called if the `Recording` instance has never yet been prepared. */ + prepareToRecordAsync( + /** Options for the recording, including sample rate, bitrate, channels, format, encoder, and extension. If no options are passed to `prepareToRecordAsync()`, the recorder will be created with options `Expo.Audio.RECORDING_OPTIONS_PRESET_LOW_QUALITY`. */ + options?: RecordingOptions + ): Promise; + + /** Begins recording. This method can only be called if the `Recording` has been prepared. */ + startAsync(): Promise; + + /** + * Pauses recording. This method can only be called if the Recording has been prepared. + * + * NOTE: This is only available on Android API version 24 and later. + */ + pauseAsync(): Promise; + + /** Stops the recording and deallocates the recorder from memory. This reverts the Recording instance to an unprepared state, and another Recording instance must be created in order to record again. This method can only be called if the `Recording` has been prepared. */ + stopAndUnloadAsync(): Promise; + + /** + * Gets the local URI of the Recording. Note that this will only succeed once the Recording is prepared to record. + * + * @returns A string with the local URI of the `Recording`, or `null` if the `Recording` is not prepared to record. + */ + getURI(): string | null | undefined; + + /** + * Creates and loads a new `Sound` object to play back the `Recording`. Note that this will only succeed once the `Recording` is done recording (once `stopAndUnloadAsync()` has been called). + * + * @returns A Promise that is rejected if creation failed, or fulfilled with the following dictionary if creation succeeded: + * - `sound`: the newly created and loaded Sound object. + * - `status`: the PlaybackStatus of the Sound object. + */ + createNewLoadedSound( + /** The initial intended `PlaybackStatusToSet` of the sound, whose values will override the default initial playback status. This value defaults to `{}` if no parameter is passed. */ + initialStatus?: PlaybackStatusToSet, + + /** A function taking a single parameter `PlaybackStatus`. This value defaults to `null` if no parameter is passed. */ + onPlaybackStatusUpdate?: ((status: PlaybackStatus) => void) | null + ): Promise<{ sound: Sound, status: PlaybackStatus }>; + } +} + +/** + * AuthSession + */ +export namespace AuthSession { + type StartAsyncResponse = { + type: 'cancel'; + } | { + type: 'dismissed'; + } | { + type: 'success'; + params: HashMap; + event: HashMap; + } | { + type: 'error'; + params: HashMap; + errorCode: string; + event: HashMap; + }; + + function startAsync(options: { authUrl: string; returnUrl?: string; }): Promise; + function dismiss(): void; + function getRedirectUrl(): string; +} + +// #region AV +/** + * AV + */ +export type PlaybackStatus = { + isLoaded: false; + androidImplementation?: string; + + /** Populated exactly once when an error forces the object to unload. */ + error?: string; +} | { + isLoaded: true; + androidImplementation?: string; + uri: string; + progressUpdateIntervalMillis: number; + durationMillis?: number; + positionMillis: number; + playableDurationMillis?: number; + shouldPlay: boolean; + isPlaying: boolean; + isBuffering: boolean; + rate: number; + shouldCorrectPitch: boolean; + volume: number; + isMuted: boolean; + isLooping: boolean; + + /** True exactly once when the track plays to finish. */ + didJustFinish: boolean; +}; + +export interface PlaybackStatusToSet { + androidImplementation?: string; + progressUpdateIntervalMillis?: number; + positionMillis?: number; + shouldPlay?: boolean; + rate?: FloatFromZeroToOne; + shouldCorrectPitch?: boolean; + volume?: FloatFromZeroToOne; + isMuted?: boolean; + isLooping?: boolean; +} + +export type PlaybackSource = RequireSource | { uri: string } | Asset; + +export class PlaybackObject { + /** + * Gets the `PlaybackStatus` of the `playbackObject`. + * + * Returns a `Promise` that is fulfilled with the `PlaybackStatus` of the `playbackObject`. + */ + getStatusAsync(): Promise; + + /** + * Loads the media from source into memory and prepares it for playing. This must be called before calling setStatusAsync() or any of the convenience set status methods. This method can only be called if the playbackObject is in an unloaded state. + * + * Returns a `Promise` that is fulfilled with the `PlaybackStatus` of the `playbackObject` once it is loaded, or rejects if loading failed. The `Promise` will also reject if the `playbackObject` was already loaded. See below for details on `PlaybackStatus`. + */ + loadAsync( + /** + * The source of the media. The following forms are supported: + * - A dictionary of the form `{ uri: 'http://path/to/file' }` with a network URL pointing to a media file on the web. + * - `require('path/to/file')` for a media file asset in the source code directory. + * - An `Expo.Asset object` for a media file asset. + */ + source: PlaybackSource, + + /** The initial intended `PlaybackStatusToSet` of the `playbackObject`, whose values will override the default initial playback status. This value defaults to `{}` if no parameter is passed. See below for details on `PlaybackStatusToSet` and the default initial playback status. */ + initialStatus?: PlaybackStatusToSet, + + /** If set to `true`, the system will attempt to download the resource to the device before loading. This value defaults to true. Note that at the moment, this will only work for sources of the form `require('path/to/file')` or `Expo.Asset` objects. */ + downloadFirst?: boolean + ): Promise; + + /** This is equivalent to `playbackObject.setStatusAsync({ shouldPlay: false })`. */ + pauseAsync(): Promise; + + /** + * This is equivalent to `playbackObject.setStatusAsync({ shouldPlay: true })`. + * + * Playback may not start immediately after calling this function for reasons such as buffering. Make sure to update your UI based on the `isPlaying` and `isBuffering` properties of the `PlaybackStatus`. + */ + playAsync(): Promise; + + /** + * This is equivalent to `playbackObject.setStatusAsync({ shouldPlay: true, positionMillis: millis })`. + * + * Playback may not start immediately after calling this function for reasons such as buffering. Make sure to update your UI based on the isPlaying and `isBuffering` properties of the `PlaybackStatus`. + */ + playFromPositionAsync( + /** The desired position of playback in milliseconds. */ + positionMillis: number, + + /** This is equivalent to `playbackObject.setStatusAsync({ positionMillis: millis, seekMillisToleranceBefore: toleranceMillisBefore, seekMillisToleranceAfter: toleranceMillisAfter })`. The tolerances are used only on iOS. */ + tolerances?: { + toleranceMillisBefore: number, + toleranceMillisAfter: number + } + ): Promise; + + /** + * Replays the item. When using `playFromPositionAsync(0)` the item is seeked to the position at `0` ms. On iOS this method uses internal implementation of the player and is able to play the item from the beginning immediately. + * + * Returns a `Promise` that is fulfilled with the `PlaybackStatus` of the `playbackObject` once the new status has been set successfully, or rejects if setting the new status failed. + */ + replayAsync( + /** The new `PlaybackStatusToSet` of the `playbackObject`, whose values will override the current playback status. */ + status: PlaybackStatusToSet + ): Promise; + + /** This is equivalent to `playbackObject.setStatusAsync({ isLooping: value })`. */ + setIsLoopingAsync( + /** A boolean describing if the media should play once (`false`) or loop indefinitely (`true`). */ + isLooping: boolean + ): Promise; + + /** This is equivalent to `playbackObject.setStatusAsync({ isMuted: value })`. */ + setIsMutedAsync( + /** A boolean describing if the audio of this media should be muted. */ + isMuted: boolean + ): Promise; + + /** + * Sets a function to be called regularly with the `PlaybackStatus` of the `playbackObject`. See below for details on `PlaybackStatus` and an example use case of this function. + * + * `onPlaybackStatusUpdate` will be called whenever a call to the API for this `playbackObject` completes (such as `setStatusAsync()`, `getStatusAsync()`, or `unloadAsync()`), and will also be called at regular intervals while the media is in the loaded state. Set `progressUpdateIntervalMillis` via `setStatusAsync()` or `setProgressUpdateIntervalAsync()` to modify the interval with which `onPlaybackStatusUpdate` is called while loaded. + */ + setOnPlaybackStatusUpdate( + /** A function taking a single parameter `PlaybackStatus`. */ + onPlaybackStatusUpdate?: (status: PlaybackStatus) => void + ): void; + + /** This is equivalent to `playbackObject.setStatusAsync({ positionMillis: millis })`. */ + setPositionAsync( + positionMillis: number, + + /** This is equivalent to `playbackObject.setStatusAsync({ positionMillis: millis, seekMillisToleranceBefore: toleranceMillisBefore, seekMillisToleranceAfter: toleranceMillisAfter })`. The tolerances are used only on iOS. */ + tolerances?: { + toleranceMillisBefore: number, + toleranceMillisAfter: number + } + ): Promise; + + /** This is equivalent to `playbackObject.setStatusAsync({ progressUpdateIntervalMillis: millis })`. */ + setProgressUpdateIntervalAsync( + /** The new minimum interval in milliseconds between calls of `onPlaybackStatusUpdate`. */ + progressUpdateIntervalMillis: number + ): Promise; + + /** This is equivalent to `playbackObject.setStatusAsync({ rate: value, shouldCorrectPitch: shouldCorrectPitch })`. */ + setRateAsync( + /** The desired playback rate of the media. This value must be between `0.0` and `32.0`. Only available on Android API version 23 and later and iOS. */ + rate: number, + + /** A boolean describing if we should correct the pitch for a changed rate. If set to `true`, the pitch of the audio will be corrected (so a rate different than `1.0` will timestretch the audio). */ + shouldCorrectPitch: boolean + ): Promise; + + /** Sets a new `PlaybackStatusToSet` on the `playbackObject`. This method can only be called if the media has been loaded. Return a `Promise` that is fulfilled with the `PlaybackStatus` of the `playbackObject` once the new status has been set successfully, or rejects if setting the new status failed. */ + setStatusAsync( + /** The new `PlaybackStatusToSet` of the `playbackObject`, whose values will override the current playback status. */ + status: PlaybackStatusToSet + ): Promise; + + /** This is equivalent to `playbackObject.setStatusAsync({ volume: value })`. */ + setVolumeAsync( + /** A number between `0.0` (silence) and `1.0` (maximum volume). */ + volume: number + ): Promise; + + /** This is equivalent to `playbackObject.setStatusAsync({ shouldPlay: false, positionMillis: 0 })`. */ + stopAsync(): Promise; + + /** + * Unloads the media from memory. `loadAsync()` must be called again in order to be able to play the media. + * + * Returns a `Promise` that is fulfilled with the `PlaybackStatus` of the `playbackObject` once it is unloaded, or rejects if unloading failed. See below for details on `PlaybackStatus`. + */ + unloadAsync(): Promise; +} +// #endregion + +// #region BarCodeScanner +/** + * BarCodeScanner + */ +export interface BarCodeScannerProps extends ViewProperties { + type?: 'front' | 'back'; + torchMode?: 'on' | 'off'; + barCodeTypes?: string[]; + onBarCodeRead?: BarCodeReadCallback; +} + +export class BarCodeScanner extends Component { + static Constants: { + TorchMode: { + on: string; + off: string + } + } & CameraConstants; +} +// #endregion + +// #region BlurView +/** + * BlurView + */ +export interface BlurViewProps extends ViewProperties { + tint: 'light' | 'default' | 'dark'; + intensity: number; +} +export class BlurView extends Component { } +// #endregion + +/** + * Brightness + */ +export namespace Brightness { + function setBrightnessAsync(brightnessValue: FloatFromZeroToOne): Promise; + function getBrightnessAsync(): Promise; + function getSystemBrightnessAsync(): Promise; + function setSystemBrightnessAsync(brightnessValue: FloatFromZeroToOne): Promise; +} + +// #region Camera +/** + * Camera + */ +export interface PictureOptions { + quality?: number; +} + +export interface PictureResponse { + uri: string; + width: number; + height: number; + exif: string; + base64: string; +} + +export interface RecordingOptions { + quality?: string | number; + maxDuration?: number; + maxFileSize?: number; +} + +export class CameraObject { + takePictureAsync(options: PictureOptions): Promise; + recordAsync(options: RecordingOptions): Promise<{ uri: string; }>; + stopRecording(): void; + getSupportedRatiosAsync(): Promise; // Android only +} + +export interface CameraProps extends ViewProperties { + zoom?: FloatFromZeroToOne; + ratio?: string; + focusDepth?: FloatFromZeroToOne; + type?: string | number; + onCameraReady?: () => void; + onBarCodeRead?: BarCodeReadCallback; + faceDetectionMode?: number; + flashMode?: string | number; + barCodeTypes?: Array; + whiteBalance?: string | number; + faceDetectionLandmarks?: number; + autoFocus?: string | number | boolean; + faceDetectionClassifications?: number; + onMountError?: () => void; + onFacesDetected?: (options: { faces: TrackedFaceFeature[] }) => void; + ref?: Ref; +} + +export interface CameraConstants { + readonly Type: string; + readonly FlashMode: string; + readonly AutoFocus: string; + readonly WhiteBalance: string; + readonly VideoQuality: string; + readonly BarCodeType: { + aztec: string; + codabar: string; + code39: string; + code93: string; + code128: string; + code138: string; + code39mod43: string; + datamatrix: string; + ean13: string; + ean8: string; + interleaved2of5: string; + itf14: string; + maxicode: string; + pdf417: string; + rss14: string; + rssexpanded: string; + upc_a: string; + upc_e: string; + upc_ean: string; + qr: string; + }; +} + +export class Camera extends Component { + static readonly Constants: CameraConstants; +} +// #endregion + +/** + * Constants + */ +export namespace Constants { + const appOwnership: 'expo' | 'standalone' | 'guest'; + const expoVersion: string; + const deviceId: string; + const deviceName: string; + const deviceYearClass: number; + const isDevice: boolean; + + interface Platform { + ios?: { + platform: string; + model: string; + userInterfaceIdiom: string; + buildNumber: string; + }; + android?: { + versionCode: string; + }; + } + const platform: Platform; + const sessionId: string; + const statusBarHeight: number; + const systemFonts: string[]; + + interface Manifest { + name: string; + description?: string; + slug?: string; + sdkVersion?: string; + version?: string; + orientation?: Orientation; + primaryColor?: string; + privacy?: 'public' | 'unlisted'; + scheme?: string; + icon?: string; + platforms?: string[]; + githubUrl?: string; + notification?: { + icon?: string, + color?: string, + androidMode?: 'default' | 'collapse', + androidCollapsedTitle?: string + }; + loading?: { + icon?: string, + exponentIconColor?: 'white' | 'blue', + exponentIconGrayscale?: 1 | 0, + backgroundImage?: string, + backgroundColor?: string, + hideExponentText?: boolean + }; + appKey?: string; + androidStatusBar?: { + barStyle?: 'lignt-content' | 'dark-content', + backgroundColor?: string + }; + androidShowExponentNotificationInShellApp?: boolean; + extra?: { + [propName: string]: any + }; + rnCliPath?: any; + entryPoint?: string; + packagerOpts?: { + hostType?: string, + dev?: boolean, + strict?: boolean, + minify?: boolean, + urlType?: string, + urlRandomness?: string, + lanType?: string, + [propName: string]: any + }; + ignoreNodeModulesValidation?: any; + nodeModulesPath?: string; + ios?: { + bundleIdentifier?: string, + buildNumber?: string, + config?: { + usesNonExemptEncryption?: boolean, + googleSignIn?: { + reservedClientId: string + } + }, + supportsTablet?: boolean, + infoPlist?: any + }; + android?: { + package?: string, + versionCode?: string, + config?: { + fabric?: { + apiKey: string, + buildSecret: string + }, + googleMaps?: { + apiKey: string + }, + googleSignIn?: { + apiKey: string, + certificateHash: string + } + } + }; + facebookScheme?: any; + facebookAppId?: string; + facebookDisplayName?: string; + splash?: { + backgroundColor?: string; + resizeMode?: ResizeModeContain | ResizeModeCover; + image?: string; + }; + assetBundlePatterns?: string[]; + releaseChannel: string; + [propName: string]: any; + } + const manifest: Manifest; + const linkingUri: string; +} + +/** + * Contacts + */ +export namespace Contacts { + type PhoneNumbers = 'phoneNumbers'; + type Emails = 'emails'; + type Addresses = 'addresses'; + type Image = 'image'; + type Thumbnail = 'thumbnail'; + type Note = 'note'; + type Birthday = 'birthday'; + type NonGregorianBirthday = 'nonGregorianBirthday'; + type NamePrefix = 'namePrefix'; + type NameSuffix = 'nameSuffix'; + type PhoneticFirstName = 'phoneticFirstName'; + type PhoneticMiddleName = 'phoneticMiddleName'; + type PhoneticLastName = 'phoneticLastName'; + type SocialProfiles = 'socialProfiles'; + type InstantMessageAddresses = 'instantMessageAddresses'; + type UrlAddresses = 'urlAddresses'; + type Dates = 'dates'; + type Relationships = 'relationships'; + + const PHONE_NUMBERS: PhoneNumbers; + const EMAILS: Emails; + const ADDRESSES: Addresses; + const IMAGE: Image; + const THUMBNAIL: Thumbnail; + const NOTE: Note; + const BIRTHDAY: Birthday; + const NON_GREGORIAN_BIRTHDAY: NonGregorianBirthday; + const NAME_PREFIX: NamePrefix; + const NAME_SUFFIX: NameSuffix; + const PHONETIC_FIRST_NAME: PhoneticFirstName; + const PHONETIC_MIDDLE_NAME: PhoneticMiddleName; + const PHONETIC_LAST_NAME: PhoneticLastName; + const SOCIAL_PROFILES: SocialProfiles; + const IM_ADDRESSES: InstantMessageAddresses; + const URLS: UrlAddresses; + const DATES: Dates; + const RELATIONSHIPS: Relationships; + + type FieldType = PhoneNumbers | Emails | Addresses | Image | Thumbnail | + Note | Birthday | NonGregorianBirthday | NamePrefix | NameSuffix | + PhoneticFirstName | PhoneticMiddleName | PhoneticLastName | SocialProfiles | + InstantMessageAddresses | UrlAddresses | Dates | Relationships; + + interface Options { + pageSize?: number; + pageOffset?: number; + fields?: FieldType[]; + } + + interface Contact { + id: string; + contactType: string; + name: string; + firstName?: string; + middleName?: string; + lastName?: string; + previousLastName?: string; + namePrefix?: string; + nameSuffix?: string; + nickname?: string; + phoneticFirstName?: string; + phoneticMiddleName?: string; + phoneticLastName?: string; + emails?: Array<{ + email?: string; + primary?: boolean; + label: string; + id: string; + }>; + phoneNumbers?: Array<{ + number?: string; + primary?: boolean; + digits?: string; + countryCode?: string; + label: string; + id: string; + }>; + addresses?: Array<{ + street?: string; + city?: string; + country?: string; + region?: string; + neighborhood?: string; + postalCode?: string; + poBox?: string; + isoCountryCode?: string; + label: string; + id: string; + }>; + socialProfiles?: Array<{ + service?: string; + localizedProfile?: string; + url?: string; + username?: string; + userId?: string; + label: string; + id: string; + }>; + instantMessageAddresses?: Array<{ + service?: string; + username?: string; + localizedService?: string; + label: string; + id: string; + }>; + urls?: { + label: string; + url?: string; + id: string; + }; + company?: string; + jobTitle?: string; + department?: string; + imageAvailable?: boolean; + image?: { + uri?: string; + }; + thumbnail?: { + uri?: string; + }; + note?: string; + dates?: Array<{ + day?: number; + month?: number; + year?: number; + id: string; + label: string; + }>; + relationships?: Array<{ + label: string; + name?: string; + id: string; + }>; + } + + interface Response { + data: Contact[]; + total: number; + hasNextPage: boolean; + hasPreviousPage: boolean; + } + + function getContactsAsync(options: Options): Promise; + function getContactByIdAsync(options: { id?: string; fields?: FieldType[] }): Promise; +} + +/** + * DocumentPicker + */ +export namespace DocumentPicker { + interface Options { + type?: string; + } + + type Response = { + type: 'success'; + uri: string; + name: string; + size: number; + } | { + type: 'cancel'; + }; + + function getDocumentAsync(options?: Options): Promise; +} + +/** + * ErrorRecovery + */ +export namespace ErrorRecovery { + function setRecoveryProps(props: HashMap): void; +} + +/** + * Facebook + */ +export namespace Facebook { + interface Options { + permissions?: string[]; + behavior?: 'web' | 'native' | 'browser' | 'system'; + } + interface Response { + type: 'cancel' | 'success'; + token?: string; + expires?: number; + } + function logInWithReadPermissionsAsync(appId: string, options?: Options): Promise; +} + +/** + * Facebook Ads + */ +export namespace FacebookAds { + /** + * Interstitial Ads + */ + namespace InterstitialAdManager { + function showAd(placementId: string): Promise; + } + + /** + * Native Ads + */ + type MediaCachePolicy = 'none' | 'icon' | 'image' | 'all'; + class NativeAdsManager { + constructor(placementId: string, numberOfAdsToRequest?: number); + disableAutoRefresh(): void; + setMediaCachePolicy(cachePolicy: MediaCachePolicy): void; + } + + function withNativeAd(component: Component<{ + icon?: string; + coverImage?: string; + title?: string; + subtitle?: string; + description?: string; + callToActionText?: string; + socialContext?: string; + }>): Component<{ adsManager: NativeAdsManager }, { ad: any, canRequestAds: boolean }>; + + /** + * Banner View + */ + type AdType = 'large' | 'rectangle' | 'standard'; + + interface BannerViewProps { + type: AdType; + placementId: string; + onPress: () => void; + onError: () => void; + } + + class BannerView extends Component { } + + /** + * Ad Settings + */ + namespace AdSettings { + const currentDeviceHash: string; + function addTestDevice(device: string): void; + function clearTestDevices(): void; + type SDKLogLevel = 'none' | 'debug' | 'verbose' | 'warning' | 'error' | 'notification'; + function setLogLevel(logLevel: SDKLogLevel): void; + function setIsChildDirected(isDirected: boolean): void; + function setMediationService(mediationService: string): void; + function setUrlPrefix(urlPrefix: string): void; + } +} + +/** + * FaceDetector + */ +export interface Point { + x: Axis; + y: Axis; +} + +export interface FaceFeature { + bounds: { + size: { + width: number; + height: number; + }, + origin: Point; + }; + smilingProbability?: number; + leftEarPosition?: Point; + rightEarPosition?: Point; + leftEyePosition?: Point; + leftEyeOpenProbability?: number; + rightEyePosition?: Point; + rightEyeOpenProbability?: number; + leftCheekPosition?: Point; + rightCheekPosition?: Point; + leftMouthPosition?: Point; + mouthPosition?: Point; + rightMouthPosition?: Point; + bottomMouthPosition?: Point; + noseBasePosition?: Point; + yawAngle?: number; + rollAngle?: number; +} + +export interface TrackedFaceFeature extends FaceFeature { + faceID?: number; +} + +export namespace FaceDetector { + interface DetectFaceResult { + faces: FaceFeature[]; + image: { + uri: string; + width: number; + height: number; + orientation: number; + }; + } + interface Mode { + fast: 'fast'; + accurate: 'accurate'; + } + interface _Shared { + all: 'all'; + none: 'none'; + } + type Landmarks = _Shared; + type Classifications = _Shared; + interface _Constants { + Mode: Mode; + Landmarks: Landmarks; + Classifications: Classifications; + } + + const Constants: _Constants; + + interface DetectionOptions { + mode?: keyof Mode; + detectLandmarks?: keyof Landmarks; + runClassifications?: keyof Classifications; + } + + function detectFaces(uri: string, options?: DetectionOptions): Promise; +} +/** + * FileSystem + */ +export namespace FileSystem { + type FileInfo = { + exists: true; + isDirectory: boolean; + uri: string; + size: number; + modificationTime: number; + md5?: Md5; + } | { + exists: false; + isDirectory: false; + }; + + interface DownloadResult { + uri: string; + status: number; + headers: { [name: string]: string }; + md5?: Md5; + } + + const documentDirectory: string; + const cacheDirectory: string; + + function getInfoAsync(fileUri: string, options?: { md5?: string, size?: boolean; }): Promise; + function readAsStringAsync(fileUri: string): Promise; + function writeAsStringAsync(fileUri: string, contents: string): Promise; + function deleteAsync(fileUri: string, options?: { idempotent: boolean; }): Promise; + function moveAsync(options: { from: string, to: string; }): Promise; + function copyAsync(options: { from: string, to: string; }): Promise; + function makeDirectoryAsync(dirUri: string, options?: { intermediates: boolean }): Promise; + function readDirectoryAsync(dirUri: string): Promise; + function downloadAsync(uri: string, fileUri: string, options?: { md5?: boolean; }): Promise; + function createDownloadResumable( + uri: string, + fileUri: string, + options?: DownloadOptions, + callback?: (totalBytesWritten: number, totalBytesExpectedToWrite: number) => void, + resumeData?: string | null + ): DownloadResumable; + + interface PauseResult { + url: string; + fileUri: string; + options: { md5: boolean; }; + resumeData: string; + } + + interface DownloadOptions { + md5?: boolean; + headers?: { [name: string]: string }; + } + + interface DownloadProgressData { + totalBytesWritten: number; + totalBytesExpectedToWrite: number; + } + + type DownloadProgressCallback = (data: DownloadProgressData) => void; + + class DownloadResumable { + constructor( + url: string, + fileUri: string, + options: DownloadOptions, + callback?: DownloadProgressCallback, + resumeData?: string + ); + + downloadAsync(): Promise; + pauseAsync(): Promise; + resumeAsync(): Promise; + savable(): PauseResult; + } +} + +/** Use TouchID/FaceID (iOS) or the Fingerprint API (Android) to authenticate the user with a fingerprint scan. */ +export namespace Fingerprint { + type FingerprintAuthenticationResult = { + success: true + } | { + success: false, + + /** Error code in the case where authentication fails. */ + error: string + }; + + /** Determine whether the Fingerprint scanner is available on the device. */ + function hasHardwareAsync(): Promise; + + /** Determine whether the device has saved fingerprints to use for authentication. */ + function isEnrolledAsync(): Promise; + + /** + * Attempts to authenticate via Fingerprint. Android: When using the fingerprint module on Android, you need to provide a UI component to prompt the user to scan their fingerprint, as the OS has no default alert for it. + * + * @param promptMessage A message that is shown alongside the TouchID/FaceID prompt. (iOS only) + */ + function authenticateAsync(promptMessageIOS?: string): Promise; + + /** Cancels the fingerprint authentication flow. (Android only) */ + function cancelAuthenticate(): void; +} + +/** + * Font + */ +export namespace Font { + interface FontMap { + [name: string]: RequireSource; + } + + function loadAsync(name: string, url: string): Promise; + function loadAsync(map: FontMap): Promise; +} + +// #region GLView +/** + * GLView + */ +export interface GLViewProps extends ViewProperties { + onContextCreate(): void; + msaaSamples: number; +} + +export class GLView extends Component { } +// #endregion + +/** + * Google + */ +export namespace Google { + interface LogInConfig { + androidClientId?: string; + androidStandaloneAppClientId?: string; + iosClientId?: string; + iosStandaloneAppClientId?: string; + webClientId?: string; + behavior?: 'system' | 'web'; + scopes?: string[]; + } + + type LogInResult = { + type: 'cancel'; + } | { + type: 'success'; + accessToken: string; + idToken?: string; + refreshToken?: string; + serverAuthCode?: string; + user: { + id: string; + name: string; + givenName: string; + familyName: string; + photoUrl?: string; + email?: string; + } + }; + + function logInAsync(config: LogInConfig): Promise; +} + +/** Access the device gyroscope sensor to respond to changes in rotation in 3d space. */ +export namespace Gyroscope { + interface GyroscopeObject { + x: Axis; + y: Axis; + z: Axis; + } + + /** A callback that is invoked when an gyroscope update is available. */ + function addListener(listener: (obj: GyroscopeObject) => any): EventSubscription; + + /** Remove all listeners. */ + function removeAllListeners(): void; + + /** Subscribe for updates to the gyroscope. */ + function setUpdateInterval(intervalMs: number): void; +} + +/** + * ImageManipulator + */ +export namespace ImageManipulator { + interface ImageResult { + uri: string; + width: number; + height: number; + base64?: string; + } + + interface SaveOptions { + base64?: boolean; + compress?: FloatFromZeroToOne; + format?: 'jpeg' | 'png'; + } + + interface CropParameters { + originX: number; + originY: number; + width: number; + height: number; + } + + interface ImageManipulationOptions { + resize?: { width?: number; height?: number }; + rotate?: number; + flip?: { vertical?: boolean; horizontal?: boolean }; + crop?: CropParameters; + } + + function manipulate(uri: string, actions: ImageManipulationOptions, saveOptions?: SaveOptions): Promise; +} + +/** + * Image Picker + */ +export namespace ImagePicker { + interface ImageInfo { + uri: string; + width: number; + height: number; + type: 'video' | 'image'; + base64?: string; + exif?: object; + duration?: number; + } + + type ImageResult = { cancelled: true } | ({ cancelled: false } & ImageInfo); + + interface _MediaTypeOptions { + All: 'All'; + Videos: 'Videos'; + Images: 'Images'; + } + + const MediaTypeOptions: _MediaTypeOptions; + + interface ImageLibraryOptions { + allowsEditing?: boolean; + aspect?: [number, number]; + quality?: number; + base64?: boolean; + exif?: boolean; + mediaTypes?: keyof _MediaTypeOptions; + } + + function launchImageLibraryAsync(options?: ImageLibraryOptions): Promise; + + interface CameraOptions { + allowsEditing?: boolean; + aspect?: [number, number]; + quality?: number; + } + + function launchCameraAsync(options?: CameraOptions): Promise; +} + +/** + * IntentLauncherAndroid + */ +export namespace IntentLauncherAndroid { + const ACTION_ACCESSIBILITY_SETTINGS: 'android.settings.ACCESSIBILITY_SETTINGS'; + const ACTION_APP_NOTIFICATION_REDACTION: 'android.settings.ACTION_APP_NOTIFICATION_REDACTION'; + const ACTION_CONDITION_PROVIDER_SETTINGS: 'android.settings.ACTION_CONDITION_PROVIDER_SETTINGS'; + const ACTION_NOTIFICATION_LISTENER_SETTINGS: 'android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS'; + const ACTION_PRINT_SETTINGS: 'android.settings.ACTION_PRINT_SETTINGS'; + const ACTION_ADD_ACCOUNT_SETTINGS: 'android.settings.ADD_ACCOUNT_SETTINGS'; + const ACTION_AIRPLANE_MODE_SETTINGS: 'android.settings.AIRPLANE_MODE_SETTINGS'; + const ACTION_APN_SETTINGS: 'android.settings.APN_SETTINGS'; + const ACTION_APPLICATION_DETAILS_SETTINGS: 'android.settings.APPLICATION_DETAILS_SETTINGS'; + const ACTION_APPLICATION_DEVELOPMENT_SETTINGS: 'android.settings.APPLICATION_DEVELOPMENT_SETTINGS'; + const ACTION_APPLICATION_SETTINGS: 'android.settings.APPLICATION_SETTINGS'; + const ACTION_APP_NOTIFICATION_SETTINGS: 'android.settings.APP_NOTIFICATION_SETTINGS'; + const ACTION_APP_OPS_SETTINGS: 'android.settings.APP_OPS_SETTINGS'; + const ACTION_BATTERY_SAVER_SETTINGS: 'android.settings.BATTERY_SAVER_SETTINGS'; + const ACTION_BLUETOOTH_SETTINGS: 'android.settings.BLUETOOTH_SETTINGS'; + const ACTION_CAPTIONING_SETTINGS: 'android.settings.CAPTIONING_SETTINGS'; + const ACTION_CAST_SETTINGS: 'android.settings.CAST_SETTINGS'; + const ACTION_DATA_ROAMING_SETTINGS: 'android.settings.DATA_ROAMING_SETTINGS'; + const ACTION_DATE_SETTINGS: 'android.settings.DATE_SETTINGS'; + const ACTION_DEVICE_INFO_SETTINGS: 'android.settings.DEVICE_INFO_SETTINGS'; + const ACTION_DEVICE_NAME: 'android.settings.DEVICE_NAME'; + const ACTION_DISPLAY_SETTINGS: 'android.settings.DISPLAY_SETTINGS'; + const ACTION_DREAM_SETTINGS: 'android.settings.DREAM_SETTINGS'; + const ACTION_HARD_KEYBOARD_SETTINGS: 'android.settings.HARD_KEYBOARD_SETTINGS'; + const ACTION_HOME_SETTINGS: 'android.settings.HOME_SETTINGS'; + const ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS: 'android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS'; + const ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS: 'android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS'; + const ACTION_INPUT_METHOD_SETTINGS: 'android.settings.INPUT_METHOD_SETTINGS'; + const ACTION_INPUT_METHOD_SUBTYPE_SETTINGS: 'android.settings.INPUT_METHOD_SUBTYPE_SETTINGS'; + const ACTION_INTERNAL_STORAGE_SETTINGS: 'android.settings.INTERNAL_STORAGE_SETTINGS'; + const ACTION_LOCALE_SETTINGS: 'android.settings.LOCALE_SETTINGS'; + const ACTION_LOCATION_SOURCE_SETTINGS: 'android.settings.LOCATION_SOURCE_SETTINGS'; + const ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS: 'android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS'; + const ACTION_MANAGE_APPLICATIONS_SETTINGS: 'android.settings.MANAGE_APPLICATIONS_SETTINGS'; + const ACTION_MANAGE_DEFAULT_APPS_SETTINGS: 'android.settings.MANAGE_DEFAULT_APPS_SETTINGS'; + const ACTION_MEMORY_CARD_SETTINGS: 'android.settings.MEMORY_CARD_SETTINGS'; + const ACTION_MONITORING_CERT_INFO: 'android.settings.MONITORING_CERT_INFO'; + const ACTION_NETWORK_OPERATOR_SETTINGS: 'android.settings.NETWORK_OPERATOR_SETTINGS'; + const ACTION_NFCSHARING_SETTINGS: 'android.settings.NFCSHARING_SETTINGS'; + const ACTION_NFC_PAYMENT_SETTINGS: 'android.settings.NFC_PAYMENT_SETTINGS'; + const ACTION_NFC_SETTINGS: 'android.settings.NFC_SETTINGS'; + const ACTION_NIGHT_DISPLAY_SETTINGS: 'android.settings.NIGHT_DISPLAY_SETTINGS'; + const ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS: 'android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS'; + const ACTION_NOTIFICATION_SETTINGS: 'android.settings.NOTIFICATION_SETTINGS'; + const ACTION_PAIRING_SETTINGS: 'android.settings.PAIRING_SETTINGS'; + const ACTION_PRIVACY_SETTINGS: 'android.settings.PRIVACY_SETTINGS'; + const ACTION_QUICK_LAUNCH_SETTINGS: 'android.settings.QUICK_LAUNCH_SETTINGS'; + const ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS: 'android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS'; + const ACTION_SECURITY_SETTINGS: 'android.settings.SECURITY_SETTINGS'; + const ACTION_SETTINGS: 'android.settings.SETTINGS'; + const ACTION_SHOW_ADMIN_SUPPORT_DETAILS: 'android.settings.SHOW_ADMIN_SUPPORT_DETAILS'; + const ACTION_SHOW_INPUT_METHOD_PICKER: 'android.settings.SHOW_INPUT_METHOD_PICKER'; + const ACTION_SHOW_REGULATORY_INFO: 'android.settings.SHOW_REGULATORY_INFO'; + const ACTION_SHOW_REMOTE_BUGREPORT_DIALOG: 'android.settings.SHOW_REMOTE_BUGREPORT_DIALOG'; + const ACTION_SOUND_SETTINGS: 'android.settings.SOUND_SETTINGS'; + const ACTION_STORAGE_MANAGER_SETTINGS: 'android.settings.STORAGE_MANAGER_SETTINGS'; + const ACTION_SYNC_SETTINGS: 'android.settings.SYNC_SETTINGS'; + const ACTION_SYSTEM_UPDATE_SETTINGS: 'android.settings.SYSTEM_UPDATE_SETTINGS'; + const ACTION_TETHER_PROVISIONING_UI: 'android.settings.TETHER_PROVISIONING_UI'; + const ACTION_TRUSTED_CREDENTIALS_USER: 'android.settings.TRUSTED_CREDENTIALS_USER'; + const ACTION_USAGE_ACCESS_SETTINGS: 'android.settings.USAGE_ACCESS_SETTINGS'; + const ACTION_USER_DICTIONARY_INSERT: 'android.settings.USER_DICTIONARY_INSERT'; + const ACTION_USER_DICTIONARY_SETTINGS: 'android.settings.USER_DICTIONARY_SETTINGS'; + const ACTION_USER_SETTINGS: 'android.settings.USER_SETTINGS'; + const ACTION_VOICE_CONTROL_AIRPLANE_MODE: 'android.settings.VOICE_CONTROL_AIRPLANE_MODE'; + const ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE: 'android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE'; + const ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE: 'android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE'; + const ACTION_VOICE_INPUT_SETTINGS: 'android.settings.VOICE_INPUT_SETTINGS'; + const ACTION_VPN_SETTINGS: 'android.settings.VPN_SETTINGS'; + const ACTION_VR_LISTENER_SETTINGS: 'android.settings.VR_LISTENER_SETTINGS'; + const ACTION_WEBVIEW_SETTINGS: 'android.settings.WEBVIEW_SETTINGS'; + const ACTION_WIFI_IP_SETTINGS: 'android.settings.WIFI_IP_SETTINGS'; + const ACTION_WIFI_SETTINGS: 'android.settings.WIFI_SETTINGS'; + const ACTION_WIRELESS_SETTINGS: 'android.settings.WIRELESS_SETTINGS'; + const ACTION_ZEN_MODE_AUTOMATION_SETTINGS: 'android.settings.ZEN_MODE_AUTOMATION_SETTINGS'; + const ACTION_ZEN_MODE_EVENT_RULE_SETTINGS: 'android.settings.ZEN_MODE_EVENT_RULE_SETTINGS'; + const ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS: 'android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS'; + const ACTION_ZEN_MODE_PRIORITY_SETTINGS: 'android.settings.ZEN_MODE_PRIORITY_SETTINGS'; + const ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS: 'android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS'; + const ACTION_ZEN_MODE_SETTINGS: 'android.settings.ZEN_MODE_SETTINGS'; + + function startActivityAsync(activity: string, data?: HashMap): Promise; +} + +/** + * KeepAwake + */ +export class KeepAwake extends Component { + static activate(): void; + static deactivate(): void; +} + +// #region LinearGradient +/** + * LinearGradient + */ +export interface LinearGradientProps { + colors: string[]; + start?: [number, number]; + end?: [number, number]; + locations?: number[]; + style?: StyleProp; +} + +export class LinearGradient extends Component { } +// #endregion + +/** + * Location + */ +export namespace Location { + interface LocationOptions { + enableHighAccuracy?: boolean; + timeInterval?: number; + distanceInterval?: number; + } + + interface LocationProps { + latitude: number; + longitude: number; + } + + interface Coords extends LocationProps { + altitude: number; + accuracy: number; + } + + interface LocationData { + coords: { + heading: number; + speed: number + } & Coords; + timestamp: number; + } + + interface ProviderStatus { + locationServicesEnabled: boolean; + gpsAvailable?: boolean; + networkAvailable?: boolean; + passiveAvailable?: boolean; + } + + interface HeadingStatus { + magHeading: number; + trueHeading: number; + accuracy: number; + } + + interface GeocodeData { + city: string; + street: string; + region: string; + postalCode: string; + country: string; + name: string; + } + + type LocationCallback = (data: LocationData) => void; + + function getCurrentPositionAsync(options: LocationOptions): Promise; + function watchPositionAsync(options: LocationOptions, callback: LocationCallback): EventSubscription; + function getProviderStatusAsync(): Promise; + function getHeadingAsync(): Promise; + function watchHeadingAsync(callback: (status: HeadingStatus) => void): EventSubscription; + function geocodeAsync(address: string): Promise; + function reverseGeocodeAsync(location: LocationProps): Promise; + function setApiKey(key: string): void; +} + +/** + * Magnetometer + */ +export namespace Magnetometer { + interface MagnetometerObject { + x: Axis; + y: Axis; + z: Axis; + } + + function addListener(listener: (obj: MagnetometerObject) => any): EventSubscription; + function removeAllListeners(): void; + function setUpdateInterval(intervalMs: number): void; +} + +/** + * Notifications + */ +export namespace Notifications { + interface Notification { + origin: 'selected' | 'received'; + data: any; + remote: boolean; + isMultiple: boolean; + } + + interface LocalNotification { + title: string; + body?: string; + data?: any; + ios?: { + sound?: boolean + }; + android?: { + sound?: boolean; + icon?: string; + color?: string; + priority?: 'min' | 'low' | 'high' | 'max'; + sticky?: boolean; + vibrate?: boolean | number[]; + link?: string; + }; + } + + type LocalNotificationId = string | number; + + function addListener(listener: (notification: Notification) => any): EventSubscription; + function getExpoPushTokenAsync(): Promise; + function presentLocalNotificationAsync(localNotification: LocalNotification): Promise; + function scheduleLocalNotificationAsync( + localNotification: LocalNotification, + schedulingOptions: { time: Date | number, repeat?: 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year' } + ): Promise; + function dismissNotificationAsync(localNotificationId: LocalNotificationId): Promise; + function dismissAllNotificationsAsync(): Promise; + function cancelScheduledNotificationAsync(localNotificationId: LocalNotificationId): Promise; + function cancelAllScheduledNotificationsAsync(): Promise; + function getBadgeNumberAsync(): Promise; + function setBadgeNumberAsync(number: number): Promise; +} + +/** + * Pedometer + */ +export namespace Pedometer { + function isAvailableAsync(): Promise; + function getStepCountAsync(start: Date, end: Date): Promise<{ steps: number; }>; + function watchStepCount(callback: (params: { steps: number; }) => void): EventSubscription; +} + +/** + * Permissions + */ +export namespace Permissions { + type PermissionType = 'remoteNotifications' | 'location' | + 'camera' | 'contacts' | 'audioRecording' | 'calendar'; + type PermissionStatus = 'undetermined' | 'granted' | 'denied'; + type PermissionExpires = 'never'; + + interface PermissionDetailsLocationIOS { + scope: 'whenInUse' | 'always'; + } + + interface PermissionDetailsLocationAndroid { + scope: 'fine' | 'coarse' | 'none'; + } + + interface PermissionResponse { + status: PermissionStatus; + expires: PermissionExpires; + ios?: PermissionDetailsLocationIOS; + android?: PermissionDetailsLocationAndroid; + } + + function getAsync(type: PermissionType): Promise; + function askAsync(type: PermissionType): Promise; + + type RemoteNotificationPermission = 'remoteNotifications'; + + const CAMERA: 'camera'; + const CAMERA_ROLL: 'cameraRoll'; + const AUDIO_RECORDING: 'audioRecording'; + const LOCATION: 'location'; + const REMOTE_NOTIFICATIONS: RemoteNotificationPermission; + const NOTIFICATIONS: RemoteNotificationPermission; + const CONTACTS: 'contacts'; + const SYSTEM_BRIGHTNESS: 'systemBrightness'; + const CALENDAR: 'calendar'; +} + +/** + * Register Root Component + */ +export function registerRootComponent(component: ComponentType): void; + +/** + * ScreenOrientation + */ +export namespace ScreenOrientation { + interface Orientations { + ALL: 'ALL'; + ALL_BUT_UPSIDE_DOWN: 'ALL_BUT_UPSIDE_DOWN'; + PORTRAIT: 'PORTRAIT'; + PORTRAIT_UP: 'PORTRAIT_UP'; + PORTRAIT_DOWN: 'PORTRAIT_DOWN'; + LANDSCAPE: 'LANDSCAPE'; + LANDSCAPE_LEFT: 'LANDSCAPE_LEFT'; + LANDSCAPE_RIGHT: 'LANDSCAPE_RIGHT'; + } + + const Orientation: Orientations; + + function allow(orientation: keyof Orientations): void; +} + +/** + * SecureStore + */ +export namespace SecureStore { + interface SecureStoreOptions { + keychainService?: string; + keychainAccessible?: number; + } + + function setItemAsync(key: string, value: string, options?: SecureStoreOptions): Promise; + function getItemAsync(key: string, options?: SecureStoreOptions): Promise; + function deleteItemAsync(key: string, options?: SecureStoreOptions): Promise; +} + +/** + * Segment + */ +export namespace Segment { + function initialize(keys: { + androidWriteKey: string; + iosWriteKey: string; + }): void; + function identify(userId: string): void; + function identifyWithTraits(userId: string, traits: object): void; + function track(event: string): void; + function reset(): void; + function trackWithProperties(event: string, properties: object): void; + function screen(screenName: string): void; + function screenWithProperties(screenName: string, properties: object): void; + function flush(): void; +} + +/** + * Speech + */ +export namespace Speech { + interface SpeechOptions { + language?: string; + pitch?: number; + rate?: number; + onStart?: () => void; + onStopped?: () => void; + onDone?: () => void; + onError?: (error: string) => void; + } + + function speak(text: string, options?: SpeechOptions): void; + function stop(): void; + function isSpeakingAsync(): Promise; + + /** Available on iOS only */ + function pause(): void; + + /** Available on iOS only */ + function resume(): void; +} + +/** + * SQLite + */ +export namespace SQLite { + type Error = any; + + interface Database { + transaction( + callback: (transaction: Transaction) => any, + error?: (error: Error) => any, // TODO def of error + success?: () => any + ): void; + } + + interface Transaction { + executeSql( + sqlStatement: string, + arguments?: string[] | number[], + success?: (transaction: Transaction, resultSet: ResultSet) => any, + error?: (transaction: Transaction, error: Error) => any + ): void; + } + + interface ResultSet { + insertId: number; + rowAffected: number; + rows: { + length: number; + item: (index: number) => any; + _array: HashMap[]; + }; + } + + function openDatabase( + name: string | { + name: string, + version?: string, + description?: string, + size?: number, + callback?: () => any + }, + version?: string, + description?: string, + size?: number, + callback?: () => any + ): any; +} + +// #region Svg +/** + * Svg + */ +export interface SvgCommonProps { + fill?: string; + fillOpacity?: number | string; + fillRule?: 'nonzero' | 'evenodd'; + stroke?: string; + strokeWidth?: number | string; + strokeOpacity?: number | string; + strokeLinecap?: string; + strokeLineJoin?: string; + strokeDasharray?: any[]; + strokeDashoffset?: any; + x?: number | string; + y?: number | string; + rotate?: number | string; + rotation?: number | string; + scale?: number | string; + origin?: number | string; + originX?: number | string; + originY?: number | string; + id?: string; + disabled?: boolean; + onPress?: () => any; + onPressIn?: () => any; + onPressOut?: () => any; + onLongPress?: () => any; + delayPressIn?: number; + delayPressOut?: number; + delayLongPress?: number; +} + +export interface SvgRectProps extends SvgCommonProps { + width: number | string; + height: number | string; +} + +export interface SvgCircleProps extends SvgCommonProps { + cx: number | string; + cy: number | string; + r: number | string; +} + +export interface SvgEllipseProps extends SvgCommonProps { + cx: number | string; + cy: number | string; + rx: number | string; + ry: number | string; +} + +export interface SvgLineProps extends SvgCommonProps { + x1: number | string; + y1: number | string; + x2: number | string; + y2: number | string; +} + +export interface SvgPolyProps extends SvgCommonProps { + points: string; +} + +export interface SvgPathProps extends SvgCommonProps { + d: string; +} + +export interface SvgTextProps extends SvgCommonProps { + textAnchor?: string; + fontSize?: number | string; + fontWeight?: string; +} + +export interface SvgTSpanProps extends SvgTextProps { + dx?: string; + dy?: string; +} + +export interface SvgTextPathProps extends SvgCommonProps { + href?: string; + startOffset?: string; +} + +export interface SvgUseProps extends SvgCommonProps { + href: string; + x: number | string; + y: number | string; +} + +export interface SvgSymbolProps extends SvgCommonProps { + viewBox: string; + width: number | string; + height: number | string; +} + +export interface SvgLinearGradientProps extends SvgCommonProps { + x1: number | string; + x2: number | string; + y1: number | string; + y2: number | string; +} + +export interface SvgRadialGradientProps extends SvgCommonProps { + cx: number | string; + cy: number | string; + rx: number | string; + ry: number | string; + fx: number | string; + fy: number | string; + gradientUnits?: string; +} + +export interface SvgStopProps extends SvgCommonProps { + offset?: string; + stopColor?: string; + stopOpacity?: string; +} + +export class Svg extends Component<{ width: number, height: number }> { + static Circle: ComponentClass; + static ClipPath: ComponentClass; + static Defs: ComponentClass; + static Ellipse: ComponentClass; + static G: ComponentClass; + static Line: ComponentClass; + static LinearGradient: ComponentClass; + static Path: ComponentClass; + static Polygon: ComponentClass; + static Polyline: ComponentClass; + static RadialGradient: ComponentClass; + static Rect: ComponentClass; + static Stop: ComponentClass; + static Symbol: ComponentClass; + static Text: ComponentClass; + static TextPath: ComponentClass; + static TSpan: ComponentClass; + static Use: ComponentClass; +} +// #endregion + +/** + * Take Snapshot + */ +export function takeSnapshotAsync( + view?: (number | React.ReactElement), + options?: { + width?: number, + height?: number, + format?: 'png' | 'jpg' | 'jpeg' | 'webm', + quality?: number, + result?: 'file' | 'base64' | 'data-uri', + } +): Promise; + +/** Helpful utility functions that don’t fit anywhere else, including some localization and internationalization methods. */ +export namespace Util { + /** Returns the current device country code. */ + function getCurrentDeviceCountryAsync(): Promise; + + /** Returns the current device locale as a string. */ + function getCurrentLocaleAsync(): Promise; + + /** Returns the current device time zone name. */ + function getCurrentTimeZoneAsync(): Promise; + + /** Reloads the current experience. This will fetch and load the newest available JavaScript supported by the device’s Expo environment. This is useful for triggering an update of your experience if you have published a new version. */ + function reload(): void; + + /** _Android only_. Invokes a callback when a new version of your app is successfully downloaded in the background. */ + function addNewVersionListenerExperimental(listener: (event: { + manifest: object; + }) => void): { remove(): void; }; +} + +// #region Video +/** + * Expo Video + */ +export interface NaturalSize { + width: number; + height: number; + orientation: Orientation; +} + +export interface ReadyForDisplayEvent { + naturalSize: NaturalSize; + status: PlaybackStatus; +} + +export enum FullscreenUpdateVariants { + IOS_FULLSCREEN_UPDATE_PLAYER_WILL_PRESENT = 0, + IOS_FULLSCREEN_UPDATE_PLAYER_DID_PRESENT = 1, + IOS_FULLSCREEN_UPDATE_PLAYER_WILL_DISMISS = 2, + IOS_FULLSCREEN_UPDATE_PLAYER_DID_DISMISS = 3 +} + +export interface FullscreenUpdateEvent { + fullscreenUpdate: FullscreenUpdateVariants; + status: PlaybackStatus; +} + +export interface VideoProps { + source?: PlaybackSource | null; + posterSource?: URISource | RequireSource; + + resizeMode?: ResizeModeContain | ResizeModeCover | ResizeModeStretch; + useNativeControls?: boolean; + usePoster?: boolean; + + onPlaybackStatusUpdate?: (status: PlaybackStatus) => void; + onReadyForDisplay?: (event: ReadyForDisplayEvent) => void; + onIOSFullscreenUpdate?: (event: FullscreenUpdateEvent) => void; + + onLoadStart?: () => void; + onLoad?: (status: PlaybackStatus) => void; + onError?: (error: string) => void; + + status?: PlaybackStatusToSet; + progressUpdateIntervalMillis?: number; + positionMillis?: number; + shouldPlay?: boolean; + rate?: number; + shouldCorrectPitch?: boolean; + volume?: number; + isMuted?: boolean; + isLooping?: boolean; + + scaleX?: number; + scaleY?: number; + translateX?: number; + translateY?: number; + rotation?: number; + ref?: Ref; +} + +export interface VideoState { + showPoster: boolean; +} + +export class Video extends Component { + static RESIZE_MODE_CONTAIN: ResizeModeContain; + static RESIZE_MODE_COVER: ResizeModeCover; + static RESIZE_MODE_STRETCH: ResizeModeStretch; + static IOS_FULLSCREEN_UPDATE_PLAYER_WILL_PRESENT: FullscreenUpdateVariants.IOS_FULLSCREEN_UPDATE_PLAYER_WILL_PRESENT; + static IOS_FULLSCREEN_UPDATE_PLAYER_DID_PRESENT: FullscreenUpdateVariants.IOS_FULLSCREEN_UPDATE_PLAYER_DID_PRESENT; + static IOS_FULLSCREEN_UPDATE_PLAYER_WILL_DISMISS: FullscreenUpdateVariants.IOS_FULLSCREEN_UPDATE_PLAYER_WILL_DISMISS; + static IOS_FULLSCREEN_UPDATE_PLAYER_DID_DISMISS: FullscreenUpdateVariants.IOS_FULLSCREEN_UPDATE_PLAYER_DID_DISMISS; +} +// #endregion + +/** + * Web Browser + */ +export namespace WebBrowser { + function openBrowserAsync(url: string): Promise<{ type: 'cancelled' | 'dismissed' }>; + function openAuthSessionAsync(url: string, redirectUrl?: string): Promise<{ type: 'cancelled' | 'dismissed' }>; + function dismissBrowser(): Promise<{ type: 'dismissed' }>; +} + +// #region Calendar +/** + * Calendar + * + * Provides an API for interacting with the device’s system calendars, events, reminders, and associated records. + */ +export namespace Calendar { + interface Calendar { + /** Internal ID that represents this calendar on the device */ + id?: string; + + /** Visible name of the calendar */ + title?: string; + + sourceId?: string; // iOS + + /** Object representing the source to be used for the calendar */ + source?: Source; + + /** Type of calendar this object represents */ + type?: CalendarType; // iOS + + /** Color used to display this calendar’s events */ + color?: string; + + /** Whether the calendar is used in the Calendar or Reminders OS app */ + entityType?: EntityTypes; // iOS + + /** Boolean value that determines whether this calendar can be modified */ + allowsModifications?: boolean; + + /** Availability types that this calendar supports */ + allowedAvailabilities?: Availability[]; + + /** Boolean value indicating whether this is the device’s primary calendar */ + isPrimary?: boolean; // Android + + /** Internal system name of the calendar */ + name?: string; // Android + + /** Name for the account that owns this calendar */ + ownerAccount?: string; // Android + + /** Time zone for the calendar */ + timeZone?: string; // Android + + /** Alarm methods that this calendar supports */ + allowedReminders?: AlarmMethod[]; // Android + + /** Attendee types that this calendar supports */ + allowedAttendeeTypes?: AttendeeType[]; // Android + + /** Indicates whether the OS displays events on this calendar */ + isVisible?: boolean; // Android + + /** Indicates whether this calendar is synced and its events stored on the device */ + isSynced?: boolean; // Android + + /** Level of access that the user has for the calendar */ + accessLevel?: CalendarAccessLevel; // Android + } + + interface Source { + /** Internal ID that represents this source on the device */ + id?: string; // iOS only ?? + + /** Type of account that owns this calendar */ + type?: string; + + /** Name for the account that owns this calendar */ + name?: string; + + /** Whether this source is the local phone account */ + isLocalAccount?: boolean; // Android + } + + interface Event { + /** Internal ID that represents this event on the device */ + id?: string; + + /** ID of the calendar that contains this event */ + calendarId?: string; + + /** Visible name of the event */ + title?: string; + + /** Location field of the event */ + location?: string; + + /** Date when the event record was created */ + creationDate?: string; // iOS + + /** Date when the event record was last modified */ + lastModifiedDate?: string; // iOS + + /** Time zone the event is scheduled in */ + timeZone?: string; + + /** Time zone for the event end time */ + endTimeZone?: string; // Android + + /** URL for the event */ + url?: string; // iOS + + /** Description or notes saved with the event */ + notes?: string; + + /** Array of Alarm objects which control automated reminders to the user */ + alarms?: Alarm[]; + + /** Object representing rules for recurring or repeating events. Null for one-time events. */ + recurrenceRule?: RecurrenceRule; + + /** Date object or string representing the time when the event starts */ + startDate?: string; + + /** Date object or string representing the time when the event ends */ + endDate?: string; + + /** For recurring events, the start date for the first (original) instance of the event */ + originalStartDate?: string; // iOS + + /** Boolean value indicating whether or not the event is a detached (modified) instance of a recurring event */ + isDetached?: boolean; // iOS + + /** Whether the event is displayed as an all-day event on the calendar */ + allDay?: boolean; + + /** The availability setting for the event */ + availability?: Availability; // Availability + + /** Status of the event */ + status?: EventStatus; // Status + + /** Organizer of the event, as an Attendee object */ + organizer?: string; // Organizer - iOS + + /** Email address of the organizer of the event */ + organizerEmail?: string; // Android + + /** User’s access level for the event */ + accessLevel?: EventAccessLevel; // Android, + + /** Whether invited guests can modify the details of the event */ + guestsCanModify?: boolean; // Android, + + /** Whether invited guests can invite other guests */ + guestsCanInviteOthers?: boolean; // Android + + /** Whether invited guests can see other guests */ + guestsCanSeeGuests?: boolean; // Android + + /** For detached (modified) instances of recurring events, the ID of the original recurring event */ + originalId?: string; // Android + + /** For instances of recurring events, volatile ID representing this instance; not guaranteed to always refer to the same instance */ + instanceId?: string; // Android + } + + interface Attendee { + /** Internal ID that represents this attendee on the device */ + id?: string; // Android + + /** Indicates whether or not this attendee is the current OS user */ + isCurrentUser?: boolean; // iOS + + /** Displayed name of the attendee */ + name?: string; + + /** Role of the attendee at the event */ + role?: AttendeeRole; + + /** Status of the attendee in relation to the event */ + status?: AttendeeStatus; + + /** Type of the attendee */ + type?: AttendeeType; + + /** URL for the attendee */ + url?: string; // iOS + + /** Email address of the attendee */ + email?: string; // Android + } + + interface Reminder { + /** Internal ID that represents this reminder on the device */ + id?: string; + + /** ID of the calendar that contains this reminder */ + calendarId?: string; + + /** Visible name of the reminder */ + title?: string; + + /** Location field of the reminder */ + location?: string; + + /** Date when the reminder record was created */ + creationDate?: string; + + /** Date when the reminder record was last modified */ + lastModifiedDate?: string; + + /** Time zone the reminder is scheduled in */ + timeZone?: string; + + /** URL for the reminder */ + url?: string; + + /** Description or notes saved with the reminder */ + notes?: string; + + /** Array of Alarm objects which control automated alarms to the user about the task */ + alarms?: Alarm[]; + + /** Object representing rules for recurring or repeated reminders. Null for one-time tasks. */ + recurrenceRule?: RecurrenceRule; + + /** Date object or string representing the start date of the reminder task */ + startDate?: string; + + /** Date object or string representing the time when the reminder task is due */ + dueDate?: string; + + /** Indicates whether or not the task has been completed */ + completed?: boolean; + + /** Date object or string representing the date of completion, if completed is true */ + completionDate?: string; + } + + interface Alarm { + /** Date object or string representing an absolute time the alarm should occur; overrides relativeOffset and structuredLocation if specified alongside either */ + absoluteDate?: string; // iOS + + /** Number of minutes from the startDate of the calendar item that the alarm should occur; use negative values to have the alarm occur before the startDate */ + relativeOffset?: string; + structuredLocation?: { + // iOS + title?: string; + proximity?: string; // Proximity + radius?: number; + coords?: { + latitude?: number; + longitude?: number; + }; + }; + + /** Method of alerting the user that this alarm should use; on iOS this is always a notification */ + method?: AlarmMethod; // Method, Android + } + + interface RecurrenceRule { + /** How often the calendar item should recur */ + frequency: Frequency; // Frequency + + /** Interval at which the calendar item should recur. For example, an interval: 2 with frequency: DAILY would yield an event that recurs every other day. Defaults to 1 . */ + interval?: number; + + /** Date on which the calendar item should stop recurring; overrides occurrence if both are specified */ + endDate?: string; + + /** Number of times the calendar item should recur before stopping */ + occurrence?: number; + } + + enum EntityTypes { + EVENT = 'event', + REMINDER = 'reminder', + } + + enum CalendarType { + LOCAL = 'local', + CALDAV = 'caldav', + EXCHANGE = 'exchange', + SUBSCRIBED = 'subscribed', + BIRTHDAYS = 'birthdays' + } + + enum Availability { + NOT_SUPPORTED = 'notSupported', // iOS + BUSY = 'busy', + FREE = 'free', + TENTATIVE = 'tentative', + UNAVAILABLE = 'unavailable' // iOS + } + + enum AlarmMethod { + ALARM = 'alarm', + ALERT = 'alert', + EMAIL = 'email', + SMS = 'sms', + DEFAULT = 'default', + } + + enum AttendeeType { + UNKNOWN = 'unknown', // iOS + PERSON = 'person', // iOS + ROOM = 'room', // iOS + GROUP = 'group', // iOS + RESOURCE = 'resource', + OPTIONAL = 'optional', // Android + REQUIRED = 'required', // Android + NONE = 'none' // Android + } + + enum CalendarAccessLevel { + CONTRIBUTOR = 'contributor', + EDITOR = 'editor', + FREEBUSY = 'freebusy', + OVERRIDE = 'override', + OWNER = 'owner', + READ = 'read', + RESPOND = 'respond', + ROOT = 'root', + NONE = 'none' + } + + enum EventAccessLevel { + CONFIDENTIAL = 'confidential', + PRIVATE = 'private', + PUBLIC = 'public', + DEFAULT = 'default' + } + + enum EventStatus { + NONE = 'none', + CONFIRMED = 'confirmed', + TENTATIVE = 'tentative', + CANCELED = 'canceled' + } + + enum AttendeeRole { + UNKNOWN = 'unknown', // iOS + REQUIRED = 'required', // iOS + OPTIONAL = 'optional', // iOS + CHAIR = 'chair', // iOS + NON_PARTICIPANT = 'nonParticipant', // iOS + ATTENDEE = 'attendee', // Android + ORGANIZER = 'organizer', // Android + PERFORMER = 'performer', // Android + SPEAKER = 'speaker', // Android + NONE = 'none' // Android + } + + enum AttendeeStatus { + UNKNOWN = 'unknown', // iOS + PENDING = 'pending', // iOS + ACCEPTED = 'accepted', + DECLINED = 'declined', + TENTATIVE = 'tentative', + DELEGATED = 'delegated', // iOS + COMPLETED = 'completed', // iOS + IN_PROCESS = 'inProcess', // iOS + INVITED = 'invited', // Android + NONE = 'none' // Android + } + + enum Frequency { + DAILY = 'daily', + WEEKLY = 'weekly', + MONTHLY = 'monthly', + YEARLY = 'yearly' + } + + enum ReminderStatus { + COMPLETED = 'completed', + INCOMPLETE = 'incomplete' + } + + interface RecurringEventOptions { + futureEvents?: boolean; + instanceStartDate?: string; + } + + /** Gets an array of calendar objects with details about the different calendars stored on the device. */ + function getCalendarsAsync( + /** (iOS only) Not required, but if defined, filters the returned calendars to a specific entity type. */ + entityType?: EntityTypes + ): Promise; + + /** Creates a new calendar on the device, allowing events to be added later and displayed. */ + function createCalendarAsync(details: Calendar): Promise; + + /** Updates the provided details of an existing calendar stored on the device. To remove a property, explicitly set it to null in details */ + function updateCalendarAsync(id: string, details?: Calendar | null): Promise; + + /** Deletes an existing calendar and all associated events/reminders/attendees from the device. Use with caution. */ + function deleteCalendarAsync(id: string): Promise; + + /** Returns all events in a given set of calendars over a specified time period. */ + function getEventsAsync( + /** Array of IDs of calendars to search for events in. Required. */ + calendarIds: string[], + + /** Beginning of time period to search for events in. Required. */ + startDate: Date, + + /** End of time period to search for events in. Required. */ + endDate: Date + ): Promise; + + /** Returns a specific event selected by ID. If a specific instance of a recurring event is desired, the start date of this instance must also be provided, as instances of recurring events do not have their own unique and stable IDs on either iOS or Android. */ + function getEventAsync( + /** ID of the event to return. Required. */ + id: string, + + /** A map of options for recurring events */ + recurringEventOptions?: RecurringEventOptions + ): Promise; + + /** Creates a new event on the specified calendar. */ + function createEventAsync( + /** ID of the calendar to create this event in. Required. */ + calendarId: string, + details?: Event + ): Promise; + + /** Updates the provided details of an existing calendar stored on the device. To remove a property, explicitly set it to null in details */ + function updateEventAsync( + /** ID of the event to be updated. Required. */ + id: string, + + /** A map of properties to be updated */ + details?: Event | null, + + /** A map of options for recurring events */ + recurrentEventOptions?: RecurringEventOptions + ): Promise; + + /** Deletes an existing event from the device. Use with caution. */ + function deleteEventAsync( + /** ID of the event to be deleted. Required. */ + id: string, + + /** A map of options for recurring events */ + recurringEventOptions?: RecurringEventOptions + ): Promise; + + /** Gets all attendees for a given event (or instance of a recurring event). */ + function getAttendeesForEventAsync( + /** ID of the event to return attendees for. Required. */ + eventId: string, + + /** A map of options for recurring events */ + recurrentEventOptions?: RecurringEventOptions + ): Promise; + + /** Available on Android only. Creates a new attendee record and adds it to the specified event. Note that if eventId specifies a recurring event, this will add the attendee to every instance of the event. */ + function createAttendeeAsync( + /** ID of the event to add this attendee to. Required. */ + eventId: string, + + /** A map of details for the attendee to be created */ + details?: Attendee + ): Promise; + + /** Available on Android only. Updates an existing attendee record. To remove a property, explicitly set it to null in details. */ + function updateAttendeeAsync( + /** ID of the attendee record to be updated. Required. */ + id: string, + + /** A map of properties to be updated */ + details?: Attendee | null + ): Promise; + + /** Available on Android only. Deletes an existing attendee record from the device. Use with caution. */ + function deleteAttendeeAsync(id: string): Promise; + + /** Available on iOS only. Returns a list of reminders matching the provided criteria. */ + function getRemindersAsync( + /** Array of IDs of calendars to search for reminders in. Required. */ + calendarIds: string[], + + status?: ReminderStatus, + + /** Beginning of time period to search for reminders in. Required if status is defined. */ + startDate?: Date, + + /** End of time period to search for reminders in. Required if status is defined. */ + endDate?: Date + ): Promise; + + /** Available on iOS only. Returns a specific reminder selected by ID. */ + function getReminderAsync(id: string): Promise; + + /** Available on iOS only. Creates a new reminder on the specified calendar. */ + function createReminderAsync( + /** ID of the calendar to create this reminder in. Required. */ + calendarId: string, + + /** A map of details for the reminder to be created */ + details?: Reminder + ): Promise; + + /** Available on iOS only. Updates the provided details of an existing reminder stored on the device. To remove a property, explicitly set it to null in details. */ + function updateReminderAsync( + /** ID of the reminder to be updated. Required. */ + id: string, + + /** A map of properties to be updated */ + details?: Reminder | null + ): Promise; + + /** Available on iOS only. Deletes an existing reminder from the device. Use with caution. */ + function deleteReminderAsync(id: string): Promise; + + /** Available on iOS only. */ + function getSourcesAsync(): Promise; + + /** Available on iOS only. Returns a specific source selected by ID. */ + function getSourceAsync(id: string): Promise; + + /** Available on Android only. Sends an intent to open the specified event in the OS Calendar app. */ + function openEventInCalendar( + /** ID of the event to open. Required. */ + id: string + ): void; +} +// #endregion + +// #region Calendar +/** + * An API to compose mails using OS specific UI. + */ +export namespace MailComposer { + interface ComposeOptions { + /** An array of e-mail addressess of the recipients. */ + recipients?: string[]; + + /** An array of e-mail addressess of the CC recipients. */ + ccRecipients?: string[]; + + /** An array of e-mail addressess of the BCC recipients. */ + bccRecipients?: string[]; + + /** Subject of the mail. */ + subject?: string; + + /** Body of the mail. */ + body?: string; + + /** Whether the body contains HTML tags so it could be formatted properly. Not working perfectly on Android. */ + isHtml?: boolean; + + /** An array of app’s internal file uris to attach. */ + attachments?: string[]; + } + + /** Resolves to a promise with object containing status field that could be either sent, saved or cancelled. Android does not provide such info so it always resolves to sent. */ + function composeAsync( + /** A map defining the data to fill the mail */ + options: ComposeOptions + ): Promise<{ status: 'sent' | 'saved' | 'cancelled' }>; +} +// #endregion diff --git a/types/expo/v25/tsconfig.json b/types/expo/v25/tsconfig.json new file mode 100644 index 0000000000..db8203e995 --- /dev/null +++ b/types/expo/v25/tsconfig.json @@ -0,0 +1,33 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "dom", + "es6" + ], + "jsx": "react", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "expo": [ + "expo/v25" + ], + "expo/*": [ + "expo/v25/*" + ] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "expo-tests.tsx" + ] +} \ No newline at end of file diff --git a/types/expo/v25/tslint.json b/types/expo/v25/tslint.json new file mode 100644 index 0000000000..8270136207 --- /dev/null +++ b/types/expo/v25/tslint.json @@ -0,0 +1,7 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "void-return": false, + "max-line-length": false + } +} From 90c86a9404e3ccd60eb7efb1a10a3f8ae18db165 Mon Sep 17 00:00:00 2001 From: Bradley Ayers Date: Fri, 27 Apr 2018 08:01:16 +1000 Subject: [PATCH 135/564] Update index.d.ts (#25318) --- types/react-transition-group/v1/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-transition-group/v1/index.d.ts b/types/react-transition-group/v1/index.d.ts index dd62c27e80..42dea4ba15 100644 --- a/types/react-transition-group/v1/index.d.ts +++ b/types/react-transition-group/v1/index.d.ts @@ -11,13 +11,13 @@ export interface HTMLTransitionGroupProps extends HTMLAttributes { childFactory?(child: ReactElement): ReactElement; } -import * as TransitionGroup from "./TransitionGroup"; +import TransitionGroup = require("./TransitionGroup"); export { TransitionGroupProps, TransitionGroupChildLifecycle } from "./TransitionGroup"; -import * as CSSTransitionGroup from "./CSSTransitionGroup"; +import CSSTransitionGroup = require("./CSSTransitionGroup"); export { CSSTransitionGroupProps, CSSTransitionGroupTransitionName From 07268c98de0d3288bd47bf8ec1299167da9f8bdb Mon Sep 17 00:00:00 2001 From: Aneil Mallavarapu Date: Thu, 26 Apr 2018 15:03:40 -0700 Subject: [PATCH 136/564] Improve coverage of AWS Lambda Statement type (#25304) * Improve coverage of AWS Lambda Statement type Allow statements which have either a Principal or a Resource, instead of requiring Resource. This permits policies such as described in https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html: ``` { Effect: "Allow", Principal: "*", Action: "*" } ``` and ``` { Effect: "Allow", Principal: { "Service": "lambda.amazonaws.com" }, Action: "sts:AssumeRole" } ``` * Remove unnecessary additional type * Add tests for valid/invalid combinations of Resource and Principal in Statement type This addresses issues raised by @simonbuchanan here: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/25304\#pullrequestreview-115377094 --- types/aws-lambda/aws-lambda-tests.ts | 54 ++++++++++++++++++++++++++++ types/aws-lambda/index.d.ts | 17 ++++++--- 2 files changed, 66 insertions(+), 5 deletions(-) diff --git a/types/aws-lambda/aws-lambda-tests.ts b/types/aws-lambda/aws-lambda-tests.ts index 8ffff3d8a3..9f9d7438e3 100644 --- a/types/aws-lambda/aws-lambda-tests.ts +++ b/types/aws-lambda/aws-lambda-tests.ts @@ -260,6 +260,46 @@ statement = { Resource: str }; +// $ExpectError +statement = { + Effect: str, + Action: str, + Principal: 123 +}; + +// Bad Resource +// $ExpectError +statement = { + Effect: str, + Action: str, + Resource: 123 +}; + +// Bad Resource with valid Principal +// $ExpectError +statement = { + Effect: str, + Action: str, + Principal: { Service: str}, + Resource: 123 +}; + +// Bad principal with valid Resource +// $ExpectError +statement = { + Effect: str, + Action: str, + Principal: 123, + Resource: str +}; + +// No Effect +// $ExpectError +statement = { + Action: str, + Principal: str +}; + statement = { Sid: str, Action: [str, str], @@ -278,6 +318,20 @@ statement = { NotPrincipal: [str, str] }; +statement = { + Action: str, + Principal: str, + Effect: str +}; + +statement = { + Action: str, + NotPrincipal: { + Service: str + }, + Effect: str +}; + statement = { Effect: str, NotAction: str, diff --git a/types/aws-lambda/index.d.ts b/types/aws-lambda/index.d.ts index cdee868594..7795c4cdfe 100644 --- a/types/aws-lambda/index.d.ts +++ b/types/aws-lambda/index.d.ts @@ -473,19 +473,26 @@ export interface Condition { * https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-control-access-policy-language-overview.html * https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html */ -export type Statement = BaseStatement & StatementAction & StatementResource; +export type Statement = BaseStatement & StatementAction & (StatementResource | StatementPrincipal); export interface BaseStatement { Effect: string; Sid?: string; Condition?: ConditionBlock; - Principal?: string | string[]; - NotPrincipal?: string | string[]; } +export type PrincipalValue = { [key: string]: string | string[]; } | string | string[]; +export interface MaybeStatementPrincipal { + Principal?: PrincipalValue; + NotPrincipal?: PrincipalValue; +} +export interface MaybeStatementResource { + Resource?: string | string[]; + NotResource?: string | string[]; +} export type StatementAction = { Action: string | string[] } | { NotAction: string | string[] }; -export type StatementResource = { Resource: string | string[] } | { NotResource: string | string[] }; - +export type StatementResource = MaybeStatementPrincipal & ({ Resource: string | string[] } | { NotResource: string | string[] }); +export type StatementPrincipal = MaybeStatementResource & ({ Principal: PrincipalValue } | { NotPrincipal: PrincipalValue }); /** * API Gateway CustomAuthorizer AuthResponse.PolicyDocument.Statement. * http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output From c2b29011157e1ba86411422631a62ecfdd6f039c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20=C3=96llinger?= Date: Fri, 27 Apr 2018 00:03:59 +0200 Subject: [PATCH 137/564] Add ReactCreatableSelectProps (#25253) * add ReactCreatableSelectProps to our props * fix formatting issues --- types/react-virtualized-select/index.d.ts | 6 +-- .../react-virtualized-select-tests.tsx | 39 +++++++++++-------- 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/types/react-virtualized-select/index.d.ts b/types/react-virtualized-select/index.d.ts index 78454990f7..83c062eab7 100644 --- a/types/react-virtualized-select/index.d.ts +++ b/types/react-virtualized-select/index.d.ts @@ -5,7 +5,7 @@ // TypeScript Version: 2.6 import * as React from "react"; -import { ReactSelectProps, ReactAsyncSelectProps, LoadOptionsHandler, OptionValues } from "react-select"; +import { ReactSelectProps, ReactAsyncSelectProps, ReactCreatableSelectProps, LoadOptionsHandler, OptionValues } from "react-select"; import { ListProps } from "react-virtualized"; export interface VirtualizedOptionRenderOptions { @@ -29,8 +29,8 @@ export interface AdditionalVirtualizedSelectProps { selectComponent?: React.ComponentClass | React.StatelessComponent; } -type VirtualizedSelectProps = (ReactAsyncSelectProps & AdditionalVirtualizedSelectProps & { async: true }) | - ReactSelectProps & AdditionalVirtualizedSelectProps; +type VirtualizedSelectProps = (ReactCreatableSelectProps & ReactAsyncSelectProps & AdditionalVirtualizedSelectProps & { async: true }) | + ReactCreatableSelectProps & ReactSelectProps & AdditionalVirtualizedSelectProps; declare class VirtualizedSelect extends React.PureComponent> {} export default VirtualizedSelect; diff --git a/types/react-virtualized-select/react-virtualized-select-tests.tsx b/types/react-virtualized-select/react-virtualized-select-tests.tsx index 380828e864..2ed0579386 100644 --- a/types/react-virtualized-select/react-virtualized-select-tests.tsx +++ b/types/react-virtualized-select/react-virtualized-select-tests.tsx @@ -1,29 +1,36 @@ import * as React from "react"; -import Select from "react-select"; +import Select, * as ReactSelect from "react-select"; import VirtualizedSelect from "react-virtualized-select"; /*Example TValue.*/ interface Example { - name: string; + name: string; } /*Example generic class.*/ class ExampleSelectAsync extends VirtualizedSelect { } +class ExampleSelectCreatable extends VirtualizedSelect { +} +
-
} - selectComponent={Select} - options={[]} - /> -
} - selectComponent={Select} - loadOptions={(input: string) => Promise.resolve([{name: 'Hi'}])} - /> +
} + selectComponent={Select} + options={[]} + /> +
} + selectComponent={Select} + loadOptions={(input: string) => Promise.resolve([{name: 'Hi'}])} + /> + arg.label.length > 1} + />
; From 014cf5df60d26ae3051a91cd8d54ade0488fafd2 Mon Sep 17 00:00:00 2001 From: Moritz Gunz Date: Fri, 27 Apr 2018 00:06:33 +0200 Subject: [PATCH 138/564] Fix incorrect enum declaration (#25300) --- types/spotify-web-playback-sdk/index.d.ts | 13 ++++++------- .../spotify-web-playback-sdk-tests.ts | 1 + 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/types/spotify-web-playback-sdk/index.d.ts b/types/spotify-web-playback-sdk/index.d.ts index ee3086e40e..93ad7af689 100644 --- a/types/spotify-web-playback-sdk/index.d.ts +++ b/types/spotify-web-playback-sdk/index.d.ts @@ -64,7 +64,12 @@ declare namespace Spotify { duration: number; paused: boolean; position: number; - repeat_mode: RepeatMode; + /** + * 0: NO_REPEAT + * 1: ONCE_REPEAT + * 2: FULL_REPEAT + */ + repeat_mode: 0 | 1 | 2; shuffle: boolean; restrictions: PlaybackRestrictions; track_window: PlaybackTrackWindow; @@ -82,12 +87,6 @@ declare namespace Spotify { volume?: number; } - enum RepeatMode { - NO_REPEAT = 0, - ONCE_REPEAT = 1, - FULL_REPEAT = 2, - } - type ErrorListener = (err: Error) => void; type PlaybackInstanceListener = (inst: WebPlaybackInstance) => void; type PlaybackStateListener = (s: PlaybackState) => void; diff --git a/types/spotify-web-playback-sdk/spotify-web-playback-sdk-tests.ts b/types/spotify-web-playback-sdk/spotify-web-playback-sdk-tests.ts index 8f2c27f33d..1fc6f8fc4c 100644 --- a/types/spotify-web-playback-sdk/spotify-web-playback-sdk-tests.ts +++ b/types/spotify-web-playback-sdk/spotify-web-playback-sdk-tests.ts @@ -27,6 +27,7 @@ player.addListener("ready", (data) => { player.getCurrentState().then((playbackState: Spotify.PlaybackState | null) => { if (playbackState) { const { current_track, next_tracks } = playbackState.track_window; + const repeatMode: 0 | 1 | 2 = playbackState.repeat_mode; console.log("Currently Playing", current_track); console.log("Playing Next", next_tracks[0]); From a965835ec71c137865d16ab2fc33aa446b4d7062 Mon Sep 17 00:00:00 2001 From: Adrian Blumer Date: Fri, 27 Apr 2018 00:07:34 +0200 Subject: [PATCH 139/564] webgl2: Allow for better type union with `WebGLRenderingContext` (#25059) * allow for better type union with WebGLRenderingContext adjusted typings for better declaration merging of some of the method declarations * removed `BufferData` and `PixelData` type definitions because otherwise they get exported as well * addressed code review feedback - fixed typos - reverted function signature changes on functions / overloads only introduced in WebGL2 - added WebGL1 compatiblity line for readPixels --- types/webgl2/index.d.ts | 82 +++++++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 32 deletions(-) diff --git a/types/webgl2/index.d.ts b/types/webgl2/index.d.ts index 8c59b117b3..a18d509e99 100644 --- a/types/webgl2/index.d.ts +++ b/types/webgl2/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for WebGL 2, Editor's Draft Fri Feb 24 16:10:18 2017 -0800 // Project: https://www.khronos.org/registry/webgl/specs/latest/2.0/ // Definitions by: Nico Kemnitz +// Adrian Blumer // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface HTMLCanvasElement extends HTMLElement { @@ -286,12 +287,16 @@ interface WebGL2RenderingContext extends WebGLRenderingContext { /* Buffer objects */ // WebGL1: - bufferData(target: number, size: number, usage: number): void; - bufferData(target: number, srcData: ArrayBuffer | ArrayBufferView | null, usage: number): void; - bufferSubData(target: number, dstByteOffset: number, srcData: ArrayBuffer | ArrayBufferView | null): void; + bufferData(target: number, sizeOrData: number | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | + Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, usage: number): void; + bufferSubData(target: number, dstByteOffset: number, srcData: Int8Array | Int16Array | Int32Array | Uint8Array | + Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null): void; + // For compatibility with WebGL 1 context in older Typescript versions. + bufferData(target: number, data: ArrayBufferView, usage: number): void; + bufferSubData(target: number, dstByteOffset: number, srcData: ArrayBufferView): void; // WebGL2: - bufferData(target: number, srcData: ArrayBufferView, usage: number, srcOffset: number, - length?: number): void; + bufferData(target: number, srcData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | + Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, usage: number, srcOffset: number, length?: number): void; bufferSubData(target: number, dstByteOffset: number, srcData: ArrayBufferView, srcOffset: number, length?: number): void; @@ -387,7 +392,11 @@ interface WebGL2RenderingContext extends WebGLRenderingContext { compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, imageSize: number, offset: number): void; compressedTexImage2D(target: number, level: number, internalformat: number, width: number, - height: number, border: number, srcData: ArrayBufferView | null, + height: number, border: number, srcData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | + Uint8ClampedArray | Float32Array | Float64Array | DataView | null, srcOffset?: number, srcLengthOverride?: number): void; + // For compatibility with WebGL 1 context in older Typescript versions. + compressedTexImage2D(target: number, level: number, internalformat: number, width: number, + height: number, border: number, srcData: ArrayBufferView, srcOffset?: number, srcLengthOverride?: number): void; compressedTexImage3D(target: number, level: number, internalformat: number, width: number, @@ -398,6 +407,11 @@ interface WebGL2RenderingContext extends WebGLRenderingContext { compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, imageSize: number, offset: number): void; + compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, + width: number, height: number, format: number, + srcData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | + Uint8ClampedArray | Float32Array | Float64Array | DataView | null, srcOffset?: number, srcLengthOverride?: number): void; + // For compatibility with WebGL 1 context in older Typescript versions. compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, srcData: ArrayBufferView | null, @@ -422,59 +436,59 @@ interface WebGL2RenderingContext extends WebGLRenderingContext { uniform3ui(location: WebGLUniformLocation | null, v0: number, v1: number, v2: number): void; uniform4ui(location: WebGLUniformLocation | null, v0: number, v1: number, v2: number, v3: number): void; - uniform1fv(location: WebGLUniformLocation | null, data: Float32Array | number[], srcOffset?: number, + uniform1fv(location: WebGLUniformLocation | null, data: Float32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniform2fv(location: WebGLUniformLocation | null, data: Float32Array | number[], srcOffset?: number, + uniform2fv(location: WebGLUniformLocation | null, data: Float32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniform3fv(location: WebGLUniformLocation | null, data: Float32Array | number[], srcOffset?: number, + uniform3fv(location: WebGLUniformLocation | null, data: Float32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniform4fv(location: WebGLUniformLocation | null, data: Float32Array | number[], srcOffset?: number, + uniform4fv(location: WebGLUniformLocation | null, data: Float32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniform1iv(location: WebGLUniformLocation | null, data: Int32Array | number[], srcOffset?: number, + uniform1iv(location: WebGLUniformLocation | null, data: Int32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniform2iv(location: WebGLUniformLocation | null, data: Int32Array | number[], srcOffset?: number, + uniform2iv(location: WebGLUniformLocation | null, data: Int32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniform3iv(location: WebGLUniformLocation | null, data: Int32Array | number[], srcOffset?: number, + uniform3iv(location: WebGLUniformLocation | null, data: Int32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniform4iv(location: WebGLUniformLocation | null, data: Int32Array | number[], srcOffset?: number, + uniform4iv(location: WebGLUniformLocation | null, data: Int32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniform1uiv(location: WebGLUniformLocation | null, data: Uint32Array | number[], srcOffset?: number, + uniform1uiv(location: WebGLUniformLocation | null, data: Uint32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniform2uiv(location: WebGLUniformLocation | null, data: Uint32Array | number[], srcOffset?: number, + uniform2uiv(location: WebGLUniformLocation | null, data: Uint32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniform3uiv(location: WebGLUniformLocation | null, data: Uint32Array | number[], srcOffset?: number, + uniform3uiv(location: WebGLUniformLocation | null, data: Uint32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniform4uiv(location: WebGLUniformLocation | null, data: Uint32Array | number[], srcOffset?: number, + uniform4uiv(location: WebGLUniformLocation | null, data: Uint32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | number[], + uniformMatrix2fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniformMatrix3x2fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | number[], + uniformMatrix3x2fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniformMatrix4x2fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | number[], + uniformMatrix4x2fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniformMatrix2x3fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | number[], + uniformMatrix2x3fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | number[], + uniformMatrix3fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniformMatrix4x3fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | number[], + uniformMatrix4x3fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniformMatrix2x4fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | number[], + uniformMatrix2x4fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniformMatrix3x4fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | number[], + uniformMatrix3x4fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; - uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | number[], + uniformMatrix4fv(location: WebGLUniformLocation | null, transpose: boolean, data: Float32Array | ArrayLike, srcOffset?: number, srcLength?: number): void; /* Vertex attribs */ vertexAttribI4i(index: number, x: number, y: number, z: number, w: number): void; - vertexAttribI4iv(index: number, values: Int32Array | number[]): void; + vertexAttribI4iv(index: number, values: Int32Array | ArrayLike): void; vertexAttribI4ui(index: number, x: number, y: number, z: number, w: number): void; - vertexAttribI4uiv(index: number, values: Uint32Array | number[]): void; + vertexAttribI4uiv(index: number, values: Uint32Array | ArrayLike): void; vertexAttribIPointer(index: number, size: number, type: number, stride: number, offset: number): void; /* Writing to the drawing buffer */ @@ -485,6 +499,10 @@ interface WebGL2RenderingContext extends WebGLRenderingContext { /* Reading back pixels */ // WebGL1: + readPixels(x: number, y: number, width: number, height: number, format: number, type: number, + dstData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | + Float32Array | Float64Array | DataView | null): void; + // For compatibility with WebGL 1 context in older Typescript versions. readPixels(x: number, y: number, width: number, height: number, format: number, type: number, dstData: ArrayBufferView | null): void; // WebGL2: @@ -496,11 +514,11 @@ interface WebGL2RenderingContext extends WebGLRenderingContext { /* Multiple Render Targets */ drawBuffers(buffers: number[]): void; - clearBufferfv(buffer: number, drawbuffer: number, values: Float32Array | number[], + clearBufferfv(buffer: number, drawbuffer: number, values: Float32Array | ArrayLike, srcOffset?: number): void; - clearBufferiv(buffer: number, drawbuffer: number, values: Int32Array | number[], + clearBufferiv(buffer: number, drawbuffer: number, values: Int32Array | ArrayLike, srcOffset?: number): void; - clearBufferuiv(buffer: number, drawbuffer: number, values: Uint32Array | number[], + clearBufferuiv(buffer: number, drawbuffer: number, values: Uint32Array | ArrayLike, srcOffset?: number): void; clearBufferfi(buffer: number, drawbuffer: number, depth: number, stencil: number): void; From fc6720f5d27e9301a823150cfa943dbc6a98c5b5 Mon Sep 17 00:00:00 2001 From: Andrew Couch Date: Thu, 26 Apr 2018 18:07:50 -0400 Subject: [PATCH 140/564] [analytics-node] Add host and enable constructor parameters (#25346) --- types/analytics-node/analytics-node-tests.ts | 4 +++- types/analytics-node/index.d.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/types/analytics-node/analytics-node-tests.ts b/types/analytics-node/analytics-node-tests.ts index 5dfabb426c..6740aaccff 100644 --- a/types/analytics-node/analytics-node-tests.ts +++ b/types/analytics-node/analytics-node-tests.ts @@ -4,7 +4,9 @@ var analytics: Analytics; function testConfig(): void { analytics = new Analytics('YOUR_WRITE_KEY', { flushAt: 20, - flushAfter: 10000 + flushAfter: 10000, + host: "http://example.com", + enable: true }); } diff --git a/types/analytics-node/index.d.ts b/types/analytics-node/index.d.ts index a1de134195..6834087ff7 100644 --- a/types/analytics-node/index.d.ts +++ b/types/analytics-node/index.d.ts @@ -39,7 +39,9 @@ declare namespace AnalyticsNode { export class Analytics { constructor(writeKey: string, opts?: { flushAt?: number, - flushAfter?: number + flushAfter?: number, + host?: string, + enable?: boolean }); /* The identify method lets you tie a user to their actions and record From c071498b0b58f9803721c01e6a6ad29d95d56a27 Mon Sep 17 00:00:00 2001 From: Ilia Choly Date: Thu, 26 Apr 2018 18:09:38 -0400 Subject: [PATCH 141/564] Add discriminated unions for GeoJSON types (#25065) * directly give the bbox property to all objects * add unions along side existing types * add iteration example * add name * extend from GeoJsonObject and GeometryObject * rename Object to GeoJSON --- types/geojson/geojson-tests.ts | 20 ++++++++++++++++++++ types/geojson/index.d.ts | 18 +++++++++++++++--- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/types/geojson/geojson-tests.ts b/types/geojson/geojson-tests.ts index c5c3fa2bdd..4ea0f57a6f 100644 --- a/types/geojson/geojson-tests.ts +++ b/types/geojson/geojson-tests.ts @@ -306,6 +306,11 @@ const collectionNoNull: FeatureCollection = { features: [featureNoNull], }; +const collectionDefault: FeatureCollection = { + type: "FeatureCollection", + features: [] +}; + isNull = featureAllNull.geometry; isPoint = featurePropertyNull.geometry; isNull = featureAllNull.properties; @@ -322,3 +327,18 @@ isPropertyOrNull = collectionMaybeNull.features[0].properties; isPropertyOrNull = collectionPropertyMaybeNull.features[0].properties; isProperty = collectionGeometryMaybeNull.features[0].properties; isProperty = collectionNoNull.features[0].properties; + +for (const { geometry } of collectionDefault.features) { + switch (geometry.type) { + case "Point": + isPoint = geometry; + break; + case "GeometryCollection": + for (const child of geometry.geometries) { + if (child.type === "Point") { + isPoint = child; + } + } + break; + } +} diff --git a/types/geojson/index.d.ts b/types/geojson/index.d.ts index 9a0ab3cd8b..ac1bf84e99 100644 --- a/types/geojson/index.d.ts +++ b/types/geojson/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Jacob Bruun // Arne Schubert // Jeff Jacobson +// Ilia Choly // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -62,6 +63,11 @@ export interface GeoJsonObject { bbox?: BBox; } +/** + * Union of GeoJSON objects. + */ +export type GeoJSON = Geometry | Feature | FeatureCollection; + /** * A geometry object. * https://tools.ietf.org/html/rfc7946#section-3 @@ -70,6 +76,12 @@ export interface GeometryObject extends GeoJsonObject { type: GeoJsonGeometryTypes; } +/** + * Union of geometry objects. + * https://tools.ietf.org/html/rfc7946#section-3 + */ +export type Geometry = Point | MultiPoint | LineString | Polygon | MultiPolygon | GeometryCollection; + /** * Point geometry object. * https://tools.ietf.org/html/rfc7946#section-3.1.2 @@ -130,7 +142,7 @@ export interface MultiPolygon extends GeometryObject { */ export interface GeometryCollection extends GeometryObject { type: "GeometryCollection"; - geometries: Array; + geometries: Geometry[]; } export type GeoJsonProperties = { [name: string]: any; } | null; @@ -139,7 +151,7 @@ export type GeoJsonProperties = { [name: string]: any; } | null; * A feature object which contains a geometry and associated properties. * https://tools.ietf.org/html/rfc7946#section-3.2 */ -export interface Feature extends GeoJsonObject { +export interface Feature extends GeoJsonObject { type: "Feature"; /** * The feature's geometry @@ -160,7 +172,7 @@ export interface Feature * A collection of feature objects. * https://tools.ietf.org/html/rfc7946#section-3.3 */ -export interface FeatureCollection extends GeoJsonObject { +export interface FeatureCollection extends GeoJsonObject { type: "FeatureCollection"; features: Array>; } From f1c3dd8b6eda63832f936e5cd90b91b8371ee247 Mon Sep 17 00:00:00 2001 From: Daniel Hritzkiv Date: Thu, 26 Apr 2018 18:09:59 -0400 Subject: [PATCH 142/564] [stripe-v3] Differentiate response types on "token", "source" StripePaymentRequest events (#25312) * Differentiate response types on "token", "source" StripePaymentRequest events "token" events will pass a Token objects as part of the StripePaymentResponse object, while "source" events will pass a Source object. * Update tests to reflect different response properties on "token" and "source" events --- types/stripe-v3/index.d.ts | 13 ++++++++++--- types/stripe-v3/stripe-v3-tests.ts | 14 +++++++++++++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/types/stripe-v3/index.d.ts b/types/stripe-v3/index.d.ts index 55cc5962df..0c99525290 100644 --- a/types/stripe-v3/index.d.ts +++ b/types/stripe-v3/index.d.ts @@ -255,8 +255,6 @@ declare namespace stripe { } interface StripePaymentResponse { - token?: Token; - source?: Source; complete: (status: string) => void; payerName?: string; payerEmail?: string; @@ -266,11 +264,20 @@ declare namespace stripe { methodName: string; } + interface StripeTokenPaymentResponse extends StripePaymentResponse { + token: Token; + } + + interface StripeSourcePaymentResponse extends StripePaymentResponse { + source: Source; + } + interface StripePaymentRequest { canMakePayment(): Promise<{applePay?: boolean} | null>; show(): void; update(options: StripePaymentRequestUpdateOptions): void; - on(event: 'token' | 'source', handler: (response: StripePaymentResponse) => void): void; + on(event: 'token', handler: (response: StripeTokenPaymentResponse) => void): void; + on(event: 'source', handler: (response: StripeSourcePaymentResponse) => void): void; on(event: 'cancel', handler: () => void): void; on(event: 'shippingaddresschange', handler: (response: {updateWith: (options: UpdateDetails) => void, shippingAddress: ShippingAddress}) => void): void; on(event: 'shippingoptionchange', handler: (response: {updateWith: (options: UpdateDetails) => void, shippingOption: ShippingOption}) => void): void; diff --git a/types/stripe-v3/stripe-v3-tests.ts b/types/stripe-v3/stripe-v3-tests.ts index 201bad8678..f461006cf3 100644 --- a/types/stripe-v3/stripe-v3-tests.ts +++ b/types/stripe-v3/stripe-v3-tests.ts @@ -118,7 +118,19 @@ describe("Stripe", () => { } }); paymentRequest.on('token', ev => { - const body = JSON.stringify({token: ev.token!.id}); + const body = JSON.stringify({token: ev.token.id}); + // post to server... + Promise.resolve({ok: true}) + .then(response => { + if (response.ok) { + ev.complete('success'); + } else { + ev.complete('fail'); + } + }); + }); + paymentRequest.on('source', ev => { + const body = JSON.stringify({token: ev.source.id}); // post to server... Promise.resolve({ok: true}) .then(response => { From 363fbd9d5f4b7b197b1ad4061746f5dc32ff4d76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=98=89=E6=B0=B8?= <525315462@qq.com> Date: Thu, 26 Apr 2018 17:10:40 -0500 Subject: [PATCH 143/564] add return type for sequelize.model.belongsTo and more (#25341) --- types/sequelize/index.d.ts | 12 ++++++++---- types/sequelize/sequelize-tests.ts | 5 +++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index 37a0b46829..fd56cdbd7c 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -1518,8 +1518,9 @@ declare namespace sequelize { * * @param target The model that will be associated with hasOne relationship * @param options Options for the association + * @return return type of association */ - hasOne(target: Model, options?: AssociationOptionsHasOne): void; + hasOne(target: Model, options?: AssociationOptionsHasOne): IncludeAssociation; /** * Creates an association between this (the source) and the provided target. The foreign key is added on the @@ -1529,8 +1530,9 @@ declare namespace sequelize { * * @param target The model that will be associated with hasOne relationship * @param options Options for the association + * @return return type of association */ - belongsTo(target: Model, options?: AssociationOptionsBelongsTo): void; + belongsTo(target: Model, options?: AssociationOptionsBelongsTo): IncludeAssociation; /** * Create an association that is either 1:m or n:m. @@ -1583,8 +1585,9 @@ declare namespace sequelize { * * @param target The model that will be associated with hasOne relationship * @param options Options for the association + * @return return type of association */ - hasMany(target: Model, options?: AssociationOptionsHasMany): void; + hasMany(target: Model, options?: AssociationOptionsHasMany): IncludeAssociation; /** * Create an N:M association with a join table @@ -1632,9 +1635,10 @@ declare namespace sequelize { * * @param target The model that will be associated with hasOne relationship * @param options Options for the association + * @return return type of association * */ - belongsToMany(target: Model, options: AssociationOptionsBelongsToMany): void; + belongsToMany(target: Model, options: AssociationOptionsBelongsToMany): IncludeAssociation; } diff --git a/types/sequelize/sequelize-tests.ts b/types/sequelize/sequelize-tests.ts index 9c5eb13708..bc600c961d 100644 --- a/types/sequelize/sequelize-tests.ts +++ b/types/sequelize/sequelize-tests.ts @@ -955,6 +955,11 @@ User.findAll( { where: s.where(s.fn('lower', s.col('email')), s.fn('lower', 'TES User.findAll( { subQuery: false, include : [User], order : [[User, User, 'numYears', 'c']] } ); User.findAll( { rejectOnEmpty: true }); +User.findAll( { include : [{ association: User.hasOne( Task, { foreignKey : 'userId' } ) }] } ); +User.findAll( { include : [{ association: User.hasMany( Task, { foreignKey : 'userId' } ) }] } ); +User.findAll( { include : [{ association: Task.belongsTo( User, { foreignKey : 'userId' } ) }] } ); +User.findAll( { include : [{ association: User.belongsToMany( User, { through : Task } ) }] } ); + User.findAll( { where: { $and:[ { username: "user" }, { theDate: new Date() } ] } } ); User.findAll( { where: { $or:[ { username: "user" }, { theDate: new Date() } ] } } ); User.findAll( { where: { $and:[ { username: { $not: "user" } }, { theDate: new Date() } ] } } ); From c19e1e82891e7ae732cd2e1d625d1c9296567fcd Mon Sep 17 00:00:00 2001 From: Ian Copp Date: Thu, 26 Apr 2018 15:12:03 -0700 Subject: [PATCH 144/564] Add roll (#25340) --- types/roll/index.d.ts | 55 ++++++++++++++++++++++++++++++++++++++++ types/roll/roll-tests.ts | 20 +++++++++++++++ types/roll/tsconfig.json | 23 +++++++++++++++++ types/roll/tslint.json | 1 + 4 files changed, 99 insertions(+) create mode 100644 types/roll/index.d.ts create mode 100644 types/roll/roll-tests.ts create mode 100644 types/roll/tsconfig.json create mode 100644 types/roll/tslint.json diff --git a/types/roll/index.d.ts b/types/roll/index.d.ts new file mode 100644 index 0000000000..7c3e4f70be --- /dev/null +++ b/types/roll/index.d.ts @@ -0,0 +1,55 @@ +// Type definitions for roll 1.2 +// Project: https://github.com/troygoode/node-roll/ +// Definitions by: icopp +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +type RollTransformation = RollTransformationKey | [RollTransformationKey, number] | ((results: number[]) => number[]); + +type RollTransformationKey = 'sum' | 'add' | 'subtract' | 'multiply' | 'divide' | 'best-of' | 'worst-of'; + +interface RollObject { + quantity: number; + sides: number; + transformations: RollTransformation[]; + toString: () => string; +} + +interface RollOutput { + input: RollObject; + calculations: number[]; + rolled: number[]; + result: number; +} + +declare class InvalidInputError extends Error { + name: 'InvalidInputError'; +} + +declare class Roll { + static InvalidInputError: InvalidInputError; + + constructor(seed?: () => number); + + /** + * Validate user input + */ + validate(input: string): boolean; + + /** + * Parse a string into a roll object + * @throws InvalidInputError + */ + parse(input: string): { + quantity: number; + sides: number; + transformations: RollTransformation[]; + toString: () => string; + }; + + /** + * Roll based on a string or roll object + */ + roll(input: string | RollObject): RollOutput; +} + +export = Roll; diff --git a/types/roll/roll-tests.ts b/types/roll/roll-tests.ts new file mode 100644 index 0000000000..bf28963e05 --- /dev/null +++ b/types/roll/roll-tests.ts @@ -0,0 +1,20 @@ +import Roll = require('roll'); + +// $ExpectType Roll +const roll = new Roll(); + +// $ExpectType number +roll.roll('d6').result; + +// $ExpectType number +roll.roll({ + quantity: 2, + sides: 6, + transformations: [ + 'sum', + ['add', 2] + ] +}).result; + +// $ExpectType InvalidInputError +Roll.InvalidInputError; diff --git a/types/roll/tsconfig.json b/types/roll/tsconfig.json new file mode 100644 index 0000000000..6d7640286d --- /dev/null +++ b/types/roll/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "roll-tests.ts" + ] +} diff --git a/types/roll/tslint.json b/types/roll/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/roll/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From fe5ac79ff97ccaafc7c7c2da54e0c69db8e176ef Mon Sep 17 00:00:00 2001 From: tbounsiar Date: Fri, 27 Apr 2018 00:13:59 +0200 Subject: [PATCH 145/564] Body parser xml (#25331) * adding react-owl-carousel types * Update Definitions by list Fix Test error * Fix tslint Fix tsconfig * Add new Type body-parser-xml --- .../body-parser-xml/body-parser-xml-tests.ts | 4 ++++ types/body-parser-xml/index.d.ts | 11 +++++++++ types/body-parser-xml/tsconfig.json | 23 +++++++++++++++++++ types/body-parser-xml/tslint.json | 1 + 4 files changed, 39 insertions(+) create mode 100644 types/body-parser-xml/body-parser-xml-tests.ts create mode 100644 types/body-parser-xml/index.d.ts create mode 100644 types/body-parser-xml/tsconfig.json create mode 100644 types/body-parser-xml/tslint.json diff --git a/types/body-parser-xml/body-parser-xml-tests.ts b/types/body-parser-xml/body-parser-xml-tests.ts new file mode 100644 index 0000000000..9aab34ecc7 --- /dev/null +++ b/types/body-parser-xml/body-parser-xml-tests.ts @@ -0,0 +1,4 @@ +import bodyParser = require('body-parser'); +import bodyParserXml = require('body-parser-xml'); + +bodyParserXml(bodyParser); diff --git a/types/body-parser-xml/index.d.ts b/types/body-parser-xml/index.d.ts new file mode 100644 index 0000000000..c5de21c062 --- /dev/null +++ b/types/body-parser-xml/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for body-parser-xml 1.1 +// Project: https://github.com/fiznool/body-parser-xml +// Definitions by: tbounsiar +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { Request, RequestHandler, Response, NextFunction } from 'express'; + +declare function bodyParserXml(bodyParser: any): (req: Request, res: Response, next: NextFunction) => void; + +export = bodyParserXml; diff --git a/types/body-parser-xml/tsconfig.json b/types/body-parser-xml/tsconfig.json new file mode 100644 index 0000000000..c597f3cb08 --- /dev/null +++ b/types/body-parser-xml/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "body-parser-xml-tests.ts" + ] +} \ No newline at end of file diff --git a/types/body-parser-xml/tslint.json b/types/body-parser-xml/tslint.json new file mode 100644 index 0000000000..2750cc0197 --- /dev/null +++ b/types/body-parser-xml/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } \ No newline at end of file From 262cb8eae6dfc1addcc175b71eb11bf8d130e918 Mon Sep 17 00:00:00 2001 From: Ian Copp Date: Thu, 26 Apr 2018 15:15:17 -0700 Subject: [PATCH 146/564] Add filter-invalid-dom-props (#25316) --- .../filter-invalid-dom-props-tests.ts | 4 ++++ types/filter-invalid-dom-props/index.d.ts | 11 +++++++++ types/filter-invalid-dom-props/tsconfig.json | 23 +++++++++++++++++++ types/filter-invalid-dom-props/tslint.json | 1 + 4 files changed, 39 insertions(+) create mode 100644 types/filter-invalid-dom-props/filter-invalid-dom-props-tests.ts create mode 100644 types/filter-invalid-dom-props/index.d.ts create mode 100644 types/filter-invalid-dom-props/tsconfig.json create mode 100644 types/filter-invalid-dom-props/tslint.json diff --git a/types/filter-invalid-dom-props/filter-invalid-dom-props-tests.ts b/types/filter-invalid-dom-props/filter-invalid-dom-props-tests.ts new file mode 100644 index 0000000000..5e55ae35a2 --- /dev/null +++ b/types/filter-invalid-dom-props/filter-invalid-dom-props-tests.ts @@ -0,0 +1,4 @@ +import filterInvalidDomProps from 'filter-invalid-dom-props'; + +// $ExpectType Partial<{ notADomProp: boolean; }> +filterInvalidDomProps({ notADomProp: true }); diff --git a/types/filter-invalid-dom-props/index.d.ts b/types/filter-invalid-dom-props/index.d.ts new file mode 100644 index 0000000000..ee74aae22e --- /dev/null +++ b/types/filter-invalid-dom-props/index.d.ts @@ -0,0 +1,11 @@ +// Type definitions for filter-invalid-dom-props 2.0 +// Project: https://www.npmjs.com/package/filter-invalid-dom-props +// Definitions by: icopp +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +// Note that the below can't actually be fully typed in the latest version of +// Typescript, because there's no way to regex-match against `data-` or `aria-` +// (which this function allows in addition to a list of static props). + +export default function filterInvalidDOMProps(props: T): Partial; diff --git a/types/filter-invalid-dom-props/tsconfig.json b/types/filter-invalid-dom-props/tsconfig.json new file mode 100644 index 0000000000..923a354c4e --- /dev/null +++ b/types/filter-invalid-dom-props/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "filter-invalid-dom-props-tests.ts" + ] +} diff --git a/types/filter-invalid-dom-props/tslint.json b/types/filter-invalid-dom-props/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/filter-invalid-dom-props/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From eae2ca1b4161a3284d044aad69d2d3f2eb7421c7 Mon Sep 17 00:00:00 2001 From: Derek Clair Date: Thu, 26 Apr 2018 16:17:01 -0600 Subject: [PATCH 147/564] Update index.d.ts (#25313) Added `async` and `defer` as optional properties of the `` component. --- types/react-helmet/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/react-helmet/index.d.ts b/types/react-helmet/index.d.ts index 57ac67f2a7..93b83075fe 100644 --- a/types/react-helmet/index.d.ts +++ b/types/react-helmet/index.d.ts @@ -7,9 +7,11 @@ import * as React from "react"; export interface HelmetProps { + async?: boolean; base?: any; bodyAttributes?: Object; defaultTitle?: string; + defer?: boolean; encodeSpecialCharacters?: boolean; htmlAttributes?: any; onChangeClientState?: (newState: any) => void; From b89b85ab984a42f25d7e6a17bfd6e89cb9b51aec Mon Sep 17 00:00:00 2001 From: Lee Standen Date: Thu, 26 Apr 2018 15:18:18 -0700 Subject: [PATCH 148/564] Add Types for @atlaskit/inline-edit (#25310) * Add 'atlaskit__inline-edit' * lint changes --- .../atlaskit__inline-edit-tests.tsx | 15 ++++++ types/atlaskit__inline-edit/index.d.ts | 51 +++++++++++++++++++ types/atlaskit__inline-edit/tsconfig.json | 20 ++++++++ types/atlaskit__inline-edit/tslint.json | 1 + 4 files changed, 87 insertions(+) create mode 100644 types/atlaskit__inline-edit/atlaskit__inline-edit-tests.tsx create mode 100644 types/atlaskit__inline-edit/index.d.ts create mode 100644 types/atlaskit__inline-edit/tsconfig.json create mode 100644 types/atlaskit__inline-edit/tslint.json diff --git a/types/atlaskit__inline-edit/atlaskit__inline-edit-tests.tsx b/types/atlaskit__inline-edit/atlaskit__inline-edit-tests.tsx new file mode 100644 index 0000000000..1c8a7278b5 --- /dev/null +++ b/types/atlaskit__inline-edit/atlaskit__inline-edit-tests.tsx @@ -0,0 +1,15 @@ +import InlineEdit from '@atlaskit/inline-edit'; + +import * as React from 'react'; +import { render } from 'react-dom'; + +declare const container: Element; + +render( + Hello
} + onConfirm={() => {}} + onCancel={() => {}} + />, + container, +); diff --git a/types/atlaskit__inline-edit/index.d.ts b/types/atlaskit__inline-edit/index.d.ts new file mode 100644 index 0000000000..4ee82ee4c3 --- /dev/null +++ b/types/atlaskit__inline-edit/index.d.ts @@ -0,0 +1,51 @@ +// Type definitions for @atlaskit/inline-edit 5.0 +// Project: https://bitbucket.org/atlassian/atlaskit-mk-2/ +// Definitions by: Lee Standen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import { ReactElement, Component } from 'react'; +export default class InlineEdit extends Component {} +export class InlineEditStateless extends Component {} + +export interface BaseProps { + /** Label above the input. */ + label?: string; + /** Component to be shown when reading only */ + readView: ReactElement; + /** Component to be shown when editing. Should be an @atlaskit/input. */ + editView?: ReactElement; + /** Set whether the read view should fit width, most obvious when hovered. */ + isFitContainerWidthReadView?: boolean; + /** Greys out text and shows spinner. Does not disable input. */ + isWaiting?: boolean; + /** Sets yellow border with warning symbol at end of input. Removes confirm and cancel buttons. */ + isInvalid?: boolean; + /** Determine whether the label is shown. */ + isLabelHidden?: boolean; + /** Sets whether the checkmark and cross are displayed in the bottom right fo the field. */ + areActionButtonsHidden?: boolean; + /** Sets whether the confirm function is called when the input loses focus. */ + isConfirmOnBlurDisabled?: boolean; + /** Handler called when checkmark is clicked. Also by default called when the input loses focus. */ + onConfirm: () => void; + /** Handler called when the cross is clicked on. */ + onCancel: () => void; + /** html to pass down to the label htmlFor prop. */ + labelHtmlFor?: string; + /** Set whether onConfirm is called on pressing enter. */ + shouldConfirmOnEnter?: boolean; + /** Set whether default stylings should be disabled when editing. */ + disableEditViewFieldBase?: boolean; + /** Component to be shown in an @atlaskit/inline-dialog when edit view is open. */ + invalidMessage?: ReactElement; +} + +export interface StatelessProps extends BaseProps { + /** Whether the component shows the readView or the editView. */ + isEditing: boolean; + /** Handler called when the wrapper or the label are clicked. */ + onEditRequested: () => void; +} + +export type StatefulProps = BaseProps; diff --git a/types/atlaskit__inline-edit/tsconfig.json b/types/atlaskit__inline-edit/tsconfig.json new file mode 100644 index 0000000000..d2974ebb7a --- /dev/null +++ b/types/atlaskit__inline-edit/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6", "dom"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "react", + "paths": { + "@atlaskit/inline-edit": ["atlaskit__inline-edit"] + } + }, + "files": ["index.d.ts", "atlaskit__inline-edit-tests.tsx"] +} diff --git a/types/atlaskit__inline-edit/tslint.json b/types/atlaskit__inline-edit/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/atlaskit__inline-edit/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 321c042eba683a4be5a8290ec9c15a4f0441bee5 Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Thu, 26 Apr 2018 18:19:59 -0400 Subject: [PATCH 149/564] Add type for TreeNode that rc-tree generates internally (#25077) * Add type for TreeNode that rc-tree generates internally * Update test * Make InternalTreeNode an interface since it can't be instantiated --- types/rc-tree/index.d.ts | 55 +++++++++++++++++++-------------- types/rc-tree/rc-tree-tests.tsx | 8 ++--- 2 files changed, 35 insertions(+), 28 deletions(-) diff --git a/types/rc-tree/index.d.ts b/types/rc-tree/index.d.ts index 7cee0d8371..aac9e1ea9f 100644 --- a/types/rc-tree/index.d.ts +++ b/types/rc-tree/index.d.ts @@ -1,15 +1,26 @@ -// Type definitions for rc-tree 1.4 +// Type definitions for rc-tree 1.10 // Project: https://github.com/react-component/tree -// Definitions by: John Reilly +// Definitions by: John Reilly , Methuselah96 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.6 +// TypeScript Version: 2.7 -import { - Component, - Props -} from "react"; +import { Component } from "react"; -export interface TreeNodeProps extends Props { +export interface InternalTreeNodeProps extends TreeNodeProps { + eventKey: string; + expanded: boolean; + selected: boolean; + checked: boolean; + halfChecked: boolean; + pos: string; + dragOver: boolean; + dragOverGapTop: boolean; + dragOverGapBottom: boolean; +} + +export interface InternalTreeNode extends Component { } + +export interface TreeNodeProps { /** * additional css class for treeNode */ @@ -26,10 +37,6 @@ export interface TreeNodeProps extends Props { * tree / subTree's title */ title?: string | JSX.Element; - /** - * it's used with tree props (default)ExpandedKeys / (default)CheckedKeys / (default)SelectedKeys. You'd better set it, and it must be unique in the tree's all treeNodes - */ - key?: string | number; /** * whether it is a leaf node */ @@ -40,43 +47,43 @@ export class TreeNode extends Component { } export interface ExpandData { expanded: boolean; - node: TreeNode; + node: InternalTreeNode; } export interface CheckData { checked: boolean; - checkedNodes: TreeNode[]; + checkedNodes: InternalTreeNode[]; halfCheckedKeys: string[]; - node: TreeNode; + node: InternalTreeNode; event: "check"; } export interface SelectData { selected: boolean; - selectedNodes: TreeNode[]; - node: TreeNode; + selectedNodes: InternalTreeNode[]; + node: InternalTreeNode; event: "select"; } export interface OnDragStartData { event: Event; - node: TreeNode; + node: InternalTreeNode; } export interface OnDragEnterData { event: Event; - node: TreeNode; + node: InternalTreeNode; expandedKeys: string[]; } export interface OnDropData { event: Event; - node: TreeNode; - dragNode: TreeNode; + node: InternalTreeNode; + dragNode: InternalTreeNode; dragNodesKeys: string[]; } -export interface TreeProps extends Props { +export interface TreeProps { /** * additional css class of root dom node */ @@ -158,11 +165,11 @@ export interface TreeProps extends Props { /** * filter some treeNodes as you need. */ - filterTreeNode?(node: TreeNode): boolean; + filterTreeNode?(node: InternalTreeNode): boolean; /** * load data asynchronously */ - loadData?(node: TreeNode): Promise; + loadData?(node: InternalTreeNode): Promise; /** * whether can drag treeNode. */ diff --git a/types/rc-tree/rc-tree-tests.tsx b/types/rc-tree/rc-tree-tests.tsx index 571465978d..99f67beca2 100644 --- a/types/rc-tree/rc-tree-tests.tsx +++ b/types/rc-tree/rc-tree-tests.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import Tree, { TreeNode, SelectData, CheckData } from 'rc-tree'; +import Tree, { TreeNode, SelectData, CheckData, InternalTreeNode } from 'rc-tree'; interface Props { keys: string[]; @@ -44,15 +44,15 @@ export class Demo extends React.Component { console.log('onCheck', checkedKeys, info); } - onDragStart(params: {event: Event, node: TreeNode}) { + onDragStart(params: {event: Event, node: InternalTreeNode}) { console.log('onDragStart', params.event, params.node); } - OnDragEnterData(params: {event: Event, node: TreeNode, expandedKeys: string[]}) { + OnDragEnterData(params: {event: Event, node: InternalTreeNode, expandedKeys: string[]}) { console.log('OnDragEnterData', params.event, params.node, params.expandedKeys); } - OnDropData(params: {event: Event, node: TreeNode, dragNode: TreeNode, dragNodesKeys: string[]}) { + OnDropData(params: {event: Event, node: InternalTreeNode, dragNode: InternalTreeNode, dragNodesKeys: string[]}) { console.log('OnDropData', params.event, params.node, params.dragNode, params.dragNodesKeys); } From 54acb6f5d7e0cd68c013976e65527a37f9e4222e Mon Sep 17 00:00:00 2001 From: Gebatzens Date: Fri, 27 Apr 2018 00:20:59 +0200 Subject: [PATCH 150/564] Add types for chardet (#25308) --- types/chardet/chardet-tests.ts | 7 +++++++ types/chardet/index.d.ts | 26 ++++++++++++++++++++++++++ types/chardet/tsconfig.json | 23 +++++++++++++++++++++++ types/chardet/tslint.json | 1 + 4 files changed, 57 insertions(+) create mode 100644 types/chardet/chardet-tests.ts create mode 100644 types/chardet/index.d.ts create mode 100644 types/chardet/tsconfig.json create mode 100644 types/chardet/tslint.json diff --git a/types/chardet/chardet-tests.ts b/types/chardet/chardet-tests.ts new file mode 100644 index 0000000000..7c06d2cc61 --- /dev/null +++ b/types/chardet/chardet-tests.ts @@ -0,0 +1,7 @@ +import * as chardet from "chardet"; + +chardet.detect(new Buffer('hello there!')); +chardet.detectFile('/path/to/file', (err, encoding) => {}); +chardet.detectFileSync('/path/to/file'); + +chardet.detectFile('/path/to/file', { sampleSize: 32 }, (err, encoding) => {}); diff --git a/types/chardet/index.d.ts b/types/chardet/index.d.ts new file mode 100644 index 0000000000..20324be60e --- /dev/null +++ b/types/chardet/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for chardet 0.5 +// Project: https://github.com/runk/node-chardet +// Definitions by: Hauke Oldsen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +export interface Confidence { + name: string; + confidence: number; + lang?: string; +} + +export interface Options { + returnAllMatches?: boolean; + sampleSize?: number; +} + +export type Result = Confidence[] | string | null; + +export function detect(buf: Buffer, opts?: Options): Result; + +export function detectFile(path: string, cb: (err: any, result: Result) => void): void; +export function detectFile(path: string, opts: Options, cb: (err: any, result: Result) => void): void; + +export function detectFileSync(path: string, opts?: Options): Result; diff --git a/types/chardet/tsconfig.json b/types/chardet/tsconfig.json new file mode 100644 index 0000000000..6215a6303f --- /dev/null +++ b/types/chardet/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "chardet-tests.ts" + ] +} diff --git a/types/chardet/tslint.json b/types/chardet/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/chardet/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From a0cde9ffe04ad456a1b63c8c06411defb116bc20 Mon Sep 17 00:00:00 2001 From: Dan Homola Date: Fri, 27 Apr 2018 00:29:38 +0200 Subject: [PATCH 151/564] fix(intl-tel-input): update name and type of placeholderNumberType (#25191) Fixes #24734 --- types/intl-tel-input/index.d.ts | 23 +++++++++++++++----- types/intl-tel-input/intl-tel-input-tests.ts | 4 ++++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/types/intl-tel-input/index.d.ts b/types/intl-tel-input/index.d.ts index b0a6bf5721..34493a8b75 100644 --- a/types/intl-tel-input/index.d.ts +++ b/types/intl-tel-input/index.d.ts @@ -171,16 +171,27 @@ declare namespace IntlTelInput { * that way as it provides a better experience for the user. */ nationalMode?: boolean; - /** - * Specify one of the keys from the global enum intlTelInputUtils.numberType - * e.g. "FIXED_LINE" to tell the plugin you're expecting that type of number. - * Currently this is only used to set the placeholder to the right type of number. - */ - numberType?: string; /** * Display only the countries you specify. */ onlyCountries?: Array; + /** + * Specify one of the keys from the global enum intlTelInputUtils.numberType + * e.g. "FIXED_LINE" to set the number type to use for the placeholder. + */ + placeholderNumberType?: + | "FIXED_LINE_OR_MOBILE" + | "FIXED_LINE" + | "MOBILE" + | "PAGER" + | "PERSONAL_NUMBER" + | "PREMIUM_RATE" + | "SHARED_COST" + | "TOLL_FREE" + | "UAN" + | "UNKNOWN" + | "VOICEMAIL" + | "VOIP"; /** * Specify the countries to appear at the top of the list. */ diff --git a/types/intl-tel-input/intl-tel-input-tests.ts b/types/intl-tel-input/intl-tel-input-tests.ts index 0d23c40d75..e91a5deef1 100644 --- a/types/intl-tel-input/intl-tel-input-tests.ts +++ b/types/intl-tel-input/intl-tel-input-tests.ts @@ -6,6 +6,10 @@ $('#phone').intlTelInput({ } }); +$('#phone').intlTelInput({ + placeholderNumberType: "MOBILE", +}); + $('#phone').intlTelInput({ geoIpLookup: function(callback) { $.get('http://ipinfo.io', function() {}, 'jsonp').always(function(resp) { From fb4403c4c09dac6d03674e57a34989821b34cb83 Mon Sep 17 00:00:00 2001 From: Nikita Litvin Date: Fri, 27 Apr 2018 01:30:08 +0300 Subject: [PATCH 152/564] parse-git-config: add `promise` method in version 2.0 (#25143) Implementation: https://github.com/jonschlinkert/parse-git-config/blob/a2a1ba179a115478f44938638e5d37ea33ae6632/index.js#L64 --- types/parse-git-config/index.d.ts | 15 ++++++++- .../parse-git-config-tests.ts | 33 +++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/types/parse-git-config/index.d.ts b/types/parse-git-config/index.d.ts index 4d5897ca5b..b3302106b0 100644 --- a/types/parse-git-config/index.d.ts +++ b/types/parse-git-config/index.d.ts @@ -1,6 +1,7 @@ -// Type definitions for parse-git-config 1.1 +// Type definitions for parse-git-config 2.0 // Project: https://github.com/jonschlinkert/parse-git-config // Definitions by: Leonard Thieu +// Nikita Litvin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -18,6 +19,18 @@ interface Parse { * If only the callback is passed, the .git/config file relative to process.cwd() is used. */ (cb: ParseCallback): void; + /** + * Asynchronously parse a .git/config file. Returns a promise. + * Resolves with `null` if unable to resolve path to the git config file. + * If no arguments are passed, the .git/config file relative to process.cwd() is used. + */ + (options?: (Options | object) | string): Promise; + /** + * Asynchronously parse a .git/config file. Returns a promise. + * Resolves with `null` if unable to resolve path to the git config file. + * If no arguments are passed, the .git/config file relative to process.cwd() is used. + */ + promise(options?: (Options | object) | string): Promise; /** * Synchronously parse a .git/config file. * If no arguments are passed, the .git/config file relative to process.cwd() is used. diff --git a/types/parse-git-config/parse-git-config-tests.ts b/types/parse-git-config/parse-git-config-tests.ts index 7afae71a66..c5ce43040a 100644 --- a/types/parse-git-config/parse-git-config-tests.ts +++ b/types/parse-git-config/parse-git-config-tests.ts @@ -39,6 +39,39 @@ function test_parse() { }); } +async function test_promise_options() { + let config = await parse({ cwd: 'foo', path: '.git/config' }); + config = await parse.promise({ cwd: 'foo', path: '.git/config' }); + if (!config) return null; + + const origin = config['remote "origin"']; + if (origin && origin.url) { + origin.url.split('/'); + } +} + +async function test_promise_cwd() { + let config = await parse('foo'); + config = await parse.promise('foo'); + if (!config) return null; + + const origin = config['remote "origin"']; + if (origin && origin.url) { + origin.url.split('/'); + } +} + +async function test_promise() { + let config = await parse(); + config = await parse.promise(); + if (!config) return null; + + const origin = config['remote "origin"']; + if (origin && origin.url) { + origin.url.split('/'); + } +} + function test_sync_options() { const config = parse.sync({ cwd: 'foo', path: '.git/config' }); From f296324f1a833a002f45fe4041fde84e41d4f6a4 Mon Sep 17 00:00:00 2001 From: Suntharesan Mohan Date: Thu, 26 Apr 2018 18:37:29 -0400 Subject: [PATCH 153/564] [convict] - Add generic type (#25154) * [convict] - add generic type * Add Typescript version --- types/convict/convict-tests.ts | 206 +++++++++++++++++++-------------- types/convict/index.d.ts | 100 ++++++++++++---- types/convict/tslint.json | 3 +- 3 files changed, 199 insertions(+), 110 deletions(-) diff --git a/types/convict/convict-tests.ts b/types/convict/convict-tests.ts index 98a107d8e8..de35b17578 100644 --- a/types/convict/convict-tests.ts +++ b/types/convict/convict-tests.ts @@ -1,108 +1,122 @@ -import convict = require('convict'); -import validator = require('validator'); +import * as convict from 'convict'; +import * as validator from 'validator'; +import { safeLoad } from 'js-yaml'; // define a schema // straight from the convict tests const format: convict.Format = { - name: 'float-percent', - validate(val) { - if (val !== 0 && (!val || val > 1 || val < 0)) { - throw new Error('must be a float between 0 and 1, inclusive'); + name: 'float-percent', + validate(val) { + if (val !== 0 && (!val || val > 1 || val < 0)) { + throw new Error('must be a float between 0 and 1, inclusive'); + } + }, + coerce(val) { + return parseFloat(val); } - }, - coerce(val) { - return parseFloat(val); - } }; convict.addFormat(format); convict.addFormats({ - prime: { - validate(val) { - function isPrime(n: number) { - if (n <= 1) return false; // zero and one are not prime - for (let i = 2; i * i <= n; i++) { - if (n % i === 0) return false; + prime: { + validate(val) { + function isPrime(n: number) { + if (n <= 1) return false; // zero and one are not prime + for (let i = 2; i * i <= n; i++) { + if (n % i === 0) return false; + } + return true; + } + if (!isPrime(val)) throw new Error('must be a prime number'); + }, + coerce(val) { + return parseInt(val, 10); } - return true; - } - if (!isPrime(val)) throw new Error('must be a prime number'); - }, - coerce(val) { - return parseInt(val, 10); } - } }); +convict.addParser({ extension: 'json', parse: JSON.parse }); +convict.addParser([ + { extension: 'json', parse: JSON.parse }, + { extension: ['yml', 'yaml'], parse: safeLoad } +]); + const conf = convict({ - env: { - doc: 'The applicaton environment.', - format: ['production', 'development', 'test'], - default: 'development', - env: 'NODE_ENV', - arg: 'node-env', - }, - ip: { - doc: 'The IP address to bind.', - format: 'ipaddress', - default: '127.0.0.1', - env: 'IP_ADDRESS', - }, - port: { - doc: 'The port to bind.', - format: 'port', - default: 0, - env: 'PORT', - arg: 'port', - }, - key: { - doc: "API key", - format: (val: string) => { - if (!validator.isUUID(val)) { - throw new Error('must be a valid UUID'); - } + env: { + doc: 'The applicaton environment.', + format: ['production', 'development', 'test'], + default: 'development', + env: 'NODE_ENV', + arg: 'node-env', }, - default: '01527E56-8431-11E4-AF91-47B661C210CA' - }, - db: { ip: { - doc: 'The IP address to bind.', - format: 'ipaddress', - default: '127.0.0.1', - env: 'IP_ADDRESS', + doc: 'The IP address to bind.', + format: 'ipaddress', + default: '127.0.0.1', + env: 'IP_ADDRESS', }, port: { - doc: 'The port to bind.', - format: 'port', - default: 0, - env: 'PORT', - arg: 'port', + doc: 'The port to bind.', + format: 'port', + default: 0, + env: 'PORT', + arg: 'port', }, - password: { - doc: 'The database password.', - default: 'secret', - format: String, - sensitive: true, + key: { + doc: "API key", + format: (val: string) => { + if (!validator.isUUID(val)) { + throw new Error('must be a valid UUID'); + } + }, + default: '01527E56-8431-11E4-AF91-47B661C210CA' + }, + db: { + ip: { + doc: 'The IP address to bind.', + format: 'ipaddress', + default: '127.0.0.1', + env: 'IP_ADDRESS', + }, + port: { + doc: 'The port to bind.', + format: 'port', + default: 0, + env: 'PORT', + arg: 'port', + }, + password: { + doc: 'The database password.', + default: 'secret', + format: String, + sensitive: true, + }, + }, + primeNumber: { + format: 'prime', + default: 17 + }, + percentNumber: { + format: 'float-percent', + default: 0.5 }, - }, - primeNumber: { - format: 'prime', - default: 17 - }, - percentNumber: { - format: 'float-percent', - default: 0.5 - }, }); // load environment dependent configuration +interface LoadType { + primeNumber: number; + isPrime: boolean; +} + const env = conf.get('env'); -const dbip = conf.get('db.ip'); conf.loadFile(`./config/${env}.json`); conf.loadFile(['./configs/always.json', './configs/sometimes.json']); +// tslint:disable-next-line:no-invalid-template-strings +conf.loadFile('./config/${env}.yaml'); + // perform validation conf.validate({ strict: true }); @@ -112,25 +126,39 @@ conf.validate({ allowed: 'warn' }); // Chaining conf - .loadFile(['./configs/always.json', './configs/sometimes.json']) - .loadFile(`./config/${env}.json`) - .load({ jsonKey: 'jsonValue' }) - .set('key', 'value') - .validate({ allowed: 'warn' }) - .toString(); + .loadFile(['./configs/always.json', './configs/sometimes.json']) + .loadFile<{ envVar: any }>(`./config/${env}.json`) + .load({ jsonKey: 'jsonValue' }) + .set('key', 'value') + .validate({ allowed: 'warn' }) + .toString(); -const port: number = conf.default('port'); +const port = conf.default('port'); if (conf.has('key')) { - conf.set('the.awesome', true); - conf.load({ - thing: { - a: 'b' - } - }); + conf.set('the.awesome', true); + conf.load({ + thing: { + a: 'b' + } + }); } +conf.has('unknow.key'); +conf.has<'db', 'ip'>('db.ip'); + +const schema = conf.getSchema(); + +const schemaVal = conf.getSchema().properties.db.properties.port.default; + conf.get(); +conf.get('unknownkey'); +conf.get('db'); +conf.get('db.ip'); +conf.get<'db', 'ip'>('db.ip'); +conf.default('env'); +conf.default('db.ip'); +conf.default<'db', 'ip'>('db.ip'); conf.getSchema(); conf.getProperties(); conf.getSchemaString(); diff --git a/types/convict/index.d.ts b/types/convict/index.d.ts index 544cb9b3f3..2c3dbf0547 100644 --- a/types/convict/index.d.ts +++ b/types/convict/index.d.ts @@ -1,11 +1,16 @@ -// Type definitions for convict 4.1 +// Type definitions for convict 4.2 // Project: https://github.com/mozilla/node-convict // Definitions by: Wim Looman // Vesa Poikajärvi // Eli Young +// Suntharesan Mohan // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 declare namespace convict { + // Taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-307871458 + type Overwrite = { [P in Exclude]: T[P] } & U; + type ValidationMethod = 'strict' | 'warn'; interface ValidateOptions { @@ -27,8 +32,13 @@ declare namespace convict { coerce?(val: any): any; } - interface SchemaObj { - default: any; + interface Parser { + extension: string | string[]; + parse: (content: string) => any; + } + + interface SchemaObj { + default: T; doc?: string; /** * From the implementation: @@ -48,57 +58,105 @@ declare namespace convict { sensitive?: boolean; } - interface Schema { - [name: string]: Schema | SchemaObj; + type Schema = { + [P in keyof T]: Schema | SchemaObj; + }; + + interface InternalSchema { + properties: { + [K in keyof T]: T[K] extends object ? InternalSchema : { default: T[K] } + }; } - interface InternalSchema { - properties: Schema; - } - - interface Config { + interface Config { /** * @returns the current value of the name property. name can use dot * notation to reference nested values */ - get(name?: string): any; + get(name?: K): + K extends null | undefined ? T : + K extends keyof T ? T[K] : + any; + get(name: string): T[K][K2]; + get(name: K): T[K][K2][K3]; + get< + K extends keyof T, + K2 extends keyof T[K], + K3 extends keyof T[K][K2], + K4 extends keyof T[K][K2][K3] + >(name: string): T[K][K2][K3][K4]; /** * @returns the default value of the name property. name can use dot * notation to reference nested values */ - default(name: string): any; + default(name?: K): + K extends keyof T ? T[K] : + K extends null | undefined ? T : + any; + default(name?: K): T[K]; + default(name: string): T[K][K2]; + default(name: K): T[K][K2][K3]; + default< + K extends keyof T, + K2 extends keyof T[K], + K3 extends keyof T[K][K2], + K4 extends keyof T[K][K2][K3] + >(name: string): T[K][K2][K3][K4]; /** * @returns true if the property name is defined, or false otherwise */ - has(name: string): boolean; + has(name: K): boolean; + has(name: string): boolean; + has(name: K): boolean; + has< + K extends keyof T, + K2 extends keyof T[K], + K3 extends keyof T[K][K2], + K4 extends keyof T[K][K2][K3] + >(name: string): boolean; /** * Sets the value of name to value. name can use dot notation to reference * nested values, e.g. "database.port". If objects in the chain don't yet * exist, they will be initialized to empty objects */ - set(name: string, value: any): Config; + set(name: K, value: K extends keyof T ? T[K] : any): Config; + set< + K extends keyof T, + K2 extends keyof T[K] | string + >(name: K, value: K2 extends keyof T[K] ? T[K][K2] : any): Config; + set< + K extends keyof T, + K2 extends keyof T[K], + K3 extends keyof T[K][K2] | string + >(name: K, value: K3 extends keyof T[K][K2] ? T[K][K2][K3] : any): Config; + set< + K extends keyof T, + K2 extends keyof T[K], + K3 extends keyof T[K][K2], + K4 extends keyof T[K][K2][K3] | string + >(name: K, value: K4 extends keyof T[K][K2][K3] ? T[K][K2][K3][K4] : any): Config; /** * Loads and merges a JavaScript object into config */ - load(conf: Object): Config; + load(conf: U): Config>; /** * Loads and merges JSON configuration file(s) into config */ - loadFile(files: string | string[]): Config; + loadFile(files: string | string[]): Config>; /** * Validates config against the schema used to initialize it */ - validate(options?: ValidateOptions): Config; + validate(options?: ValidateOptions): Config; /** * Exports all the properties (that is the keys and their current values) as a {JSON} {Object} * @returns A {JSON} compliant {Object} */ - getProperties(): Object; + getProperties(): T; /** * Exports the schema as a {JSON} {Object} * @returns A {JSON} compliant {Object} */ - getSchema(): InternalSchema; + getSchema(): InternalSchema; /** * Exports all the properties (that is the keys and their current values) as a JSON string. @@ -113,10 +171,12 @@ declare namespace convict { getSchemaString(): string; } } + interface convict { addFormat(format: convict.Format): void; addFormats(formats: { [name: string]: convict.Format }): void; - (config: convict.Schema | string): convict.Config; + addParser(parsers: convict.Parser | convict.Parser[]): void; + (config: convict.Schema | string): convict.Config; } declare var convict: convict; export = convict; diff --git a/types/convict/tslint.json b/types/convict/tslint.json index 09f94cd344..3d215ace77 100644 --- a/types/convict/tslint.json +++ b/types/convict/tslint.json @@ -2,6 +2,7 @@ "extends": "dtslint/dt.json", "rules": { // ban-types needs to be disabled to support TypeScript <2.2 - "ban-types": false + "ban-types": false, + "no-unnecessary-generics": false } } From 986dd3b4124a7eff891461f9376192e2c7d39e71 Mon Sep 17 00:00:00 2001 From: denisname Date: Fri, 27 Apr 2018 00:38:30 +0200 Subject: [PATCH 154/564] Select2 Better typing for v4 (#25196) * select2 v4 * ts-lint --- types/select2/index.d.ts | 361 ++++++------ types/select2/select2-tests.ts | 992 +++++++++++++++++++++++++-------- types/select2/tsconfig.json | 2 +- types/select2/tslint.json | 3 +- 4 files changed, 962 insertions(+), 396 deletions(-) diff --git a/types/select2/index.d.ts b/types/select2/index.d.ts index 244840f76e..6a7d7c6aaf 100644 --- a/types/select2/index.d.ts +++ b/types/select2/index.d.ts @@ -1,215 +1,242 @@ // Type definitions for Select2 4.0 // Project: http://ivaynberg.github.com/select2/ // Definitions by: Boris Yankov +// denisname // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 /// -interface Select2QueryOptions { +export as namespace Select2; + +// -------------------------------------------------------------------------- +// Some Interfaces +// -------------------------------------------------------------------------- + +export interface Select2 { + $container: JQuery; + $dropdown: JQuery; + $selection: JQuery; + $results: JQuery; + dropdown: any; + id: string; + options: { options: Options }; + results: any; + selection: any; +} + +export interface QueryOptions { term?: string; page?: number; - context?: any; - callback?: (result: { results: any; more?: boolean; context?: any; }) => void; } -type AjaxFunction = - (settings: JQueryAjaxSettings, success?: (data: any) => null, failure?: () => null) => JQueryXHR; - -interface Select2AjaxOptions extends JQueryAjaxSettings { - transport?: AjaxFunction; - /** - * Url to make request to, can be string or a function returning a string. - */ - url?: any; - dataType?: string; - delay?: number; - headers?: any; - cache?: boolean; - data?: (params: Select2QueryOptions, page: number, context: any) => any; - results?: (term: any, page: number, context: any) => any; - processResults?: (data: any, params: any) => any; - templateResult?: (data: any) => any; - templateSelection?: (data: any) => any; +export interface SearchOptions { + term: string; } -interface IdTextPair { - id: any; +export interface DataFormat { + id: number | string; text: string; -} - -interface Select2Options { - amdBase?: string; - amdLanguageBase?: string; - width?: string; - dropdownAutoWidth?: boolean; - minimumInputLength?: number; - maximumInputLength?: number; - minimumResultsForSearch?: number; - maximumSelectionLength?: number; - placeholder?: string | IdTextPair; - separator?: string; - allowClear?: boolean; - multiple?: boolean; + selected?: boolean; disabled?: boolean; - closeOnSelect?: boolean; - openOnEnter?: boolean; - id?: (object: any) => string; - matcher?: (term: string, text: string, option: any) => boolean; - formatSelection?: (object: any, container: JQuery, escapeMarkup: (markup: string) => string) => string; - formatResult?: (object: any, container: JQuery, query: any, escapeMarkup: (markup: string) => string) => string; - formatResultCssClass?: (object: any) => string; - formatNoMatches?: (term: string) => string; - formatSearching?: () => string; - formatInputTooShort?: (term: string, minLength: number) => string; - formatSelectionTooBig?: (maxSize: number) => string; - formatLoadMore?: (pageNumber: number) => string; - initSelection?: (element: JQuery, callback: (data: any) => void) => void; - tokenizer?: (input: string, selection: any[], selectCallback: () => void, options: Select2Options) => string; - tokenSeparators?: string[]; - query?: (options: Select2QueryOptions) => void; - ajax?: Select2AjaxOptions; - data?: any; - tags?: any; - createTag?: any; - containerCss?: any; - containerCssClass?: any; - dropdownCss?: any; - dropdownCssClass?: any; - escapeMarkup?: (markup: string) => string; - theme?: string; - /** - * Template can return both plain string that will be HTML escaped and a jquery object that can render HTML - */ - templateSelection?: (object: Select2SelectionObject, container: JQuery) => any; - templateResult?: (object: Select2SelectionObject) => any; - language?: string | string[] | {}; - selectOnClose?: boolean; - sorter?: (data: any[]) => any[]; - dropdownParent?: JQuery; - debug?: boolean; - dropdownAdapter?: any; - selectionAdapter?: any; - resultsAdapter?: any; - dataAdapter?: any; } -interface Select2JQueryEventObject extends JQueryEventObject { - val: any; - added: any; - removed: any; - choice: { - id: any; - text: string; - }; +export interface GroupedDataFormat { + text: string; + children?: DataFormat[]; + + id?: undefined; } -interface Select2SelectionObject { +export interface ProcessedResult { + results: Result[]; + pagination?: {more: boolean}; +} + +export interface LoadingData { loading: boolean; + text: string; + + id?: undefined; + element?: undefined; +} + +export interface OptGroupData { + children: OptionData[]; + disabled: boolean; + element: HTMLOptGroupElement; + selected: boolean; + text: string; + title: string; + + loading?: undefined; +} + +export interface OptionData { disabled: boolean; element: HTMLOptionElement; id: string; selected: boolean; text: string; title: string; + + loading?: undefined; + children?: undefined; } -interface Select2Plugin { - amd: any; +export interface IdTextPair { + id: string; + text: string; - (): JQuery; - (it: IdTextPair): JQuery; + loading?: undefined; + element?: undefined; +} + +export interface TranslationArg { + input: string; + minimum: number; + maximum: number; +} + +export interface Translation { + errorLoading?: () => string; + inputTooLong?: (arg: TranslationArg) => string; + inputTooShort?: (arg: TranslationArg) => string; + loadingMore?: () => string; + maximumSelected?: (arg: TranslationArg) => string; + noResults?: () => string; + searching?: () => string; +} + +export interface DataParams { + data: OptionData; // TODO: must be data source + originalEvent: JQuery.Event; +} + +export interface IngParams { + name: "select" | "open" | "close" | "unselect"; + prevented: boolean; +} + +export interface Event extends JQuery.Event { + params: T; +} + +export interface Trigger { + type: "select2:select"; + params: { + data: IdTextPair; + }; +} + +// -------------------------------------------------------------------------- +// Ajax Option +// -------------------------------------------------------------------------- + +export interface AjaxOptions extends JQuery.Ajax.AjaxSettingsBase { + delay?: number; + url?: string | ((params: QueryOptions) => string); + data?: (params: QueryOptions) => JQuery.PlainObject; + transport?: (settings: JQueryAjaxSettings, success?: (data: RemoteResult) => undefined, failure?: () => undefined) => void; + processResults?: (data: RemoteResult, params: QueryOptions) => ProcessedResult; +} + +// -------------------------------------------------------------------------- +// Options +// -------------------------------------------------------------------------- + +export interface Options { + ajax?: AjaxOptions; + allowClear?: boolean; + amdBase?: string; + amdLanguageBase?: string; + closeOnSelect?: boolean; + containerCss?: any; + containerCssClass?: string; + data?: DataFormat[] | GroupedDataFormat[]; + dataAdapter?: any; + debug?: boolean; + dir?: "ltr" | "rtl"; + disabled?: boolean; + dropdownAdapter?: any; + dropdownAutoWidth?: boolean; + dropdownCss?: any; + dropdownCssClass?: string; + dropdownParent?: JQuery; + escapeMarkup?: (markup: string) => string; + initSelection?: (element: JQuery, callback: (data: any) => void) => void; + language?: string | Translation; + matcher?: (params: SearchOptions, data: OptGroupData | OptionData) => OptGroupData | OptionData | null; + maximumInputLength?: number; + maximumSelectionLength?: number; + minimumInputLength?: number; + minimumResultsForSearch?: number; + multiple?: boolean; + placeholder?: string | IdTextPair; + resultsAdapter?: any; + selectionAdapter?: any; + selectOnClose?: boolean; + sorter?: (data: Array) => Array; + tags?: boolean; + templateResult?: (result: LoadingData | Result) => string | JQuery | null; + templateSelection?: (selection: IdTextPair | LoadingData | Result) => string | JQuery; + theme?: string; + tokenizer?: (input: string, selection: any[], selectCallback: () => void, options: Options) => string; + tokenSeparators?: string[]; + width?: string; + + // Not in https://select2.org/configuration/options-api + createTag?: (params: SearchOptions) => IdTextPair | null; + insertTag?: (data: Array, tag: IdTextPair) => void; +} + +// -------------------------------------------------------------------------- +// jQuery And Select2 Plugin +// -------------------------------------------------------------------------- + +export interface Select2Plugin { + defaults: { + set: (key: string, value: any) => void; + reset: () => void; + }; + + (): JQuery; + // tslint:disable-next-line:no-unnecessary-generics + (options: Options): JQuery; - /** - * Get the id value of the current selection - */ - (method: 'val'): any; - /** - * Set the id value of the current selection - * @params value Value to set the id to - * @params triggerChange Should a change event be triggered - */ - (method: 'val', value: any, triggerChange?: boolean): any; /** * Get the data object of the current selection */ - (method: 'data'): any; - /** - * Set the data of the current selection - * @params value Object to set the data to - * @params triggerChange Should a change event be triggered - */ - (method: 'data', value: any, triggerChange?: boolean): any; + (method: "data"): OptionData[]; /** * Reverts changes to DOM done by Select2. Any selection done via Select2 will be preserved. */ - (method: 'destroy'): JQuery; + (method: "destroy"): JQuery; /** * Opens the dropdown */ - (method: 'open'): JQuery; + (method: "open"): JQuery; /** * Closes the dropdown */ - (method: 'close'): JQuery; - /** - * Enables or disables Select2 and its underlying form component - * @param value True if it should be enabled false if it should be disabled - */ - (method: 'enable', value: boolean): JQuery; - /** - * Toggles readonly mode on Select2 and its underlying form component - * @param value True if it should be readonly false if it should be read write - */ - (method: 'readonly', value: boolean): JQuery; - /** - * Retrieves the main container element that wraps all of DOM added by Select2 - */ - (method: 'container'): JQuery; - /** - * Notifies Select2 that a drag and drop sorting operation has started - */ - (method: 'onSortStart'): JQuery; - /** - * Notifies Select2 that a drag and drop sorting operation has finished - */ - (method: 'onSortEnd'): JQuery; - - (method: string): any; - (method: string, value: any, trigger?: boolean): any; - (options: Select2Options): JQuery; + (method: "close"): JQuery; } -interface JQuery { - select2: Select2Plugin; - off(events?: "change", selector?: any, handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; +declare global { + interface JQuery { + select2: Select2Plugin; + data(key: "select2"): Select2; - on(events: "change", selector?: string, data?: any, handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "change", selector?: string, handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "change", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2:closing", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2:close", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2:opening", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2:open", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2:selecting", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2:select", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2:unselecting", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; - on(events: "select2:unselect", handler?: (eventObject: Select2JQueryEventObject) => any): JQuery; -} + trigger(events: Trigger): void; -declare class Select2 { - constructor(element: JQuery, options: Select2Options); - focus(): void; - destroy(): void; - // TODO: Don't use 'Function' as a type. - // tslint:disable-next-line:ban-types - on(event: string, callback: Function): void; - selection: any; - dropdown: any; - results: any; - $container: JQuery; - $dropdown: JQuery; - $selection: JQuery; - $results: JQuery; - options: { options: Select2Options }; + // TODO: events "change" and "change.select2" + on(events: "select2:closing", handler?: JQuery.EventHandlerBase>): this; + on(events: "select2:close", handler?: JQuery.EventHandlerBase>): this; + on(events: "select2:opening", handler?: JQuery.EventHandlerBase>): this; + on(events: "select2:open", handler?: JQuery.EventHandlerBase>): this; + on(events: "select2:selecting", handler?: JQuery.EventHandlerBase>): this; + on(events: "select2:select", handler?: JQuery.EventHandlerBase>): this; + on(events: "select2:unselecting", handler?: JQuery.EventHandlerBase>): this; + on(events: "select2:unselect", handler?: JQuery.EventHandlerBase>): this; + } } diff --git a/types/select2/select2-tests.ts b/types/select2/select2-tests.ts index 0a5458063a..7da04a1be5 100644 --- a/types/select2/select2-tests.ts +++ b/types/select2/select2-tests.ts @@ -1,238 +1,776 @@ -$("#e9").select2(); -$("#e2").select2({ - placeholder: "Select a State", +// ===================================================== +// Configuration -- Global defaults +// ===================================================== +// See: https://select2.org/configuration/defaults + +$.fn.select2.defaults.set("theme", "classic"); +$.fn.select2.defaults.set("ajax--cache", false); +$.fn.select2.defaults.reset(); + +// ===================================================== +// Appearance +// ===================================================== +// See: https://select2.org/appearance + +$(".js-example-responsive").select2({ + width: "resolve" +}); + +$(".js-example-theme-single").select2({ + theme: "classic" +}); + +// ===================================================== +// Data sources -- The Select2 data format +// ===================================================== +// See: https://select2.org/data-sources/formats + +let dataFormat: Select2.DataFormat[]; +let groupedDataFormat: Select2.GroupedDataFormat[]; + +dataFormat = [ + {id: 1, text: "Option 1"}, + {id: 2, text: "Option 2"}, +]; + +dataFormat = [ + {id: 1, text: "Option 1"}, + {id: 2, text: "Option 2", selected: true}, + {id: 3, text: "Option 3", disabled: true}, +]; + +groupedDataFormat = [ + { + text: "Group 1", + children : [ + {id: 1, text: "Option 1.1"}, + {id: 2, text: "Option 1.2"}, + ] + }, + { + text: "Group 2", + children : [ + {id: 3, text: "Option 2.1"}, + {id: 4, text: "Option 2.2"}, + ] + } +]; + +// ===================================================== +// Data sources -- Ajax (remote data) +// ===================================================== +// See: https://select2.org/data-sources/ajax + +// Request parameters + +$("#mySelect2").select2({ + ajax: { + url: "https://api.github.com/orgs/select2/repos", + data: (params) => { + return { + search: params.term, + type: "public" + }; + } + } +}); + +// Transforming response data + +interface ServerResult { + items: Select2.DataFormat[]; +} + +$("#mySelect2").select2({ + ajax: { + url: "/example/api", + processResults: (data: ServerResult) => { + return { + results: data.items + }; + } + } +}); + +// Pagination + +$("#mySelect2").select2({ + ajax: { + url: "https://api.github.com/search/repositories", + data: (params) => { + return { + search: params.term, + page: params.page || 1 + }; + } + } +}); + +interface ServerPaginatedResult { + results: Select2.DataFormat[]; + count_filtered: number; +} + +$("#mySelect2").select2({ + ajax: { + url: "/example/api", + processResults: (data: ServerPaginatedResult, params) => { + params.page = params.page || 1; + return { + results: data.results, + pagination: { + more: (params.page * 10) < data.count_filtered + } + }; + } + } +}); + +// Rate-limiting requests + +$("#mySelect2").select2({ + ajax: { + delay: 250 + } +}); + +// Dynamic URLs + +$("#mySelect2").select2({ + ajax: { + url: (params) => { + return "/some/url/" + params.term; + } + } +}); + +// Alternative transport methods + +declare let AjaxSettings2RequestInit: (s: JQueryAjaxSettings) => RequestInit; + +$("#mySelect2").select2({ + ajax: { + transport: (params: JQueryAjaxSettings, success?: (data: any) => undefined, failure?: () => undefined) => { + const p = AjaxSettings2RequestInit(params); + fetch(params.url!, p) + .then(success) + .catch(failure); + } + } +}); + +// Additional examples + +interface GithubApiResult { + total_count: number; + incomplete_results: boolean; + items: GithubRepositories[]; +} + +interface GithubRepositories { + id: string; + name: string; + full_name: string; + owner: { + avatar_url: string + gravatar_id: string + }; + description?: string; + stargazers_count: number; + watchers_count: number; + forks_count: number; + + loading: undefined; +} + +$(".js-example-data-ajax").select2({ + ajax: { + url: "https://api.github.com/search/repositories", + dataType: "json", + delay: 250, + data: (params: Select2.QueryOptions) => { + return { + q: params.term, + page: params.page + }; + }, + processResults: (data: GithubApiResult, params: Select2.QueryOptions) => { + params.page = params.page || 1; + + return { + results: data.items, + pagination: { + more: (params.page * data.items.length) < data.total_count + } + }; + }, + cache: true + }, + placeholder: "Search for a repository", + escapeMarkup: (markup: string) => markup, + minimumInputLength: 1, + templateResult: formatRepo, + templateSelection: formatRepoSelection +}); + +function formatRepo(obj: Select2.LoadingData | GithubRepositories) { + if (obj.loading) { + return obj.text; + } + + const repo = obj as GithubRepositories; + + let markup = '
' + + `
` + + '
' + + `
${repo.full_name}
`; + + if (repo.description) { + markup += `
${repo.description}
`; + } + + markup += '
' + + `
${repo.forks_count} Forks
` + + `
${repo.stargazers_count} Stars
` + + `
${repo.watchers_count} Watchers
` + + "
" + + "
"; + + return markup; +} + +function formatRepoSelection(repo: Select2.IdTextPair | Select2.LoadingData | GithubRepositories) { + return (repo as GithubRepositories).full_name || + (repo as Select2.IdTextPair | Select2.LoadingData).text; +} + +// ===================================================== +// Data sources -- Ajax (remote data) +// ===================================================== +// See: https://select2.org/data-sources/ajax + +$(".js-example-data-array").select2({ + data: dataFormat +}); + +$(".js-example-data-array").select2({ + data: groupedDataFormat +}); + +// ===================================================== +// Dropdown +// ===================================================== +// See: https://select2.org/dropdown + +// Templating + +function formatState(state: Select2.LoadingData | Select2.OptionData) { + const opt = state as Select2.OptionData; + if (!opt.id) { + return (state as Select2.LoadingData).text; + } + const baseUrl = "/user/pages/images/flags"; + const $state = $( + ` ${opt.text}` + ); + return $state; +} + +$(".js-example-templating").select2({ + templateResult: formatState +}); + +// Automatic selection + +$("#mySelect2").select2({ + selectOnClose: true +}); + +// Forcing the dropdown to remain open after selection + +$("#mySelect2").select2({ + closeOnSelect: false +}); + +// Dropdown placement + +$("#mySelect2").select2({ + dropdownParent: $("#myModal") +}); + +// ===================================================== +// Selections +// ===================================================== +// See: https://select2.org/selections + +// Limiting the number of selections + +$(".js-example-basic-multiple-limit").select2({ + maximumSelectionLength: 2 +}); + +// Clearable selections + +$("select").select2({ + placeholder: "This is my placeholder", allowClear: true }); -$("#e2_2").select2({ - placeholder: "Select a State" -}); -$("#e2_3").select2({ - placeholder: { id: "1", text: "Select options" } -}); -$("#e3").select2({ - minimumInputLength: 2 -}); -function format(state: any) { - if (!state.id) return state.text; - return `` + state.text; -} -$("#e4").select2({ - formatResult: format, - formatSelection: format -}); -$("#e5").select2({ - minimumInputLength: 1, - query(query) { - const data = { results: [] as IdTextPair[] }; - for (let i = 1; i < 5; i++) { - let s = ""; - for (let j = 0; j < i; j++) { s = s + query.term; } - data.results.push({ id: query.term + i, text: s }); - } - } + +// ===================================================== +// Dynamic option creation +// ===================================================== +// See: https://select2.org/tagging + +$(".js-example-tags").select2({ + tags: true }); -$("#e19").select2({ maximumSelectionLength: 3 }); -$("#e10").select2({ - data: [{ id: 0, text: 'enhancement' }, { id: 1, text: 'bug' }, { id: 2, text: 'duplicate' }, { id: 3, text: 'invalid' }, { id: 4, text: 'wontfix' }] -}); +// Automatic tokenization into tags -const data = [{ id: 0, tag: 'enhancement' }, { id: 1, tag: 'bug' }, { id: 2, tag: 'duplicate' }, { id: 3, tag: 'invalid' }, { id: 4, tag: 'wontfix' }]; - -$("#e10_2").select2({ - data: { results: data, text: 'tag' }, - formatSelection: format, - formatResult: format -}); - -$("#e10_3").select2({ - data: { - results: data, - text: (item: {tag: string}) => { - console.log('called with', item); - return item.tag; - }}, - formatSelection: format, - formatResult: format -}); - -let movieFormatResult; -let movieFormatSelection; -$("#e6").select2({ - placeholder: "Search for a movie", - minimumInputLength: 1, - ajax: { - url: "http://api.rottentomatoes.com/api/public/v1.0/movies.json", - dataType: 'jsonp', - cache: false, - data(params, page) { - return { - q: params.term, - page_limit: 10, - apikey: "ju6z9mjyajq2djue3gbvv26t" - }; - }, - results(data, page) { - return { results: data.movies }; - } - }, - formatResult: movieFormatResult, - formatSelection: movieFormatSelection, - dropdownCssClass: "bigdrop" -}); - -let t: ArrayLike; -$("#e6").select2({ - placeholder: "Search for a movie", - minimumInputLength: 1, - ajax: { - url: () => "http://api.rottentomatoes.com/api/public/v1.0/movies.json", - dataType: 'jsonp', - data(params, page) { - return { - q: params.term, - page_limit: 10, - apikey: "ju6z9mjyajq2djue3gbvv26t" - }; - }, - results(data, page) { - return { results: data.movies }; - } - }, - formatResult: movieFormatResult, - formatSelection: movieFormatSelection, - dropdownCssClass: "bigdrop" -}); -$("#e6").select2({ - placeholder: "Search for a movie", - minimumInputLength: 1, - ajax: { - url: "http://api.rottentomatoes.com/api/public/v1.0/movies.json", - type: 'GET', - dataType: 'jsonp', - cache: false, - data(params, page) { - return { - q: params.term, - page_limit: 10, - apikey: "ju6z9mjyajq2djue3gbvv26t" - }; - }, - results(data, page) { - return { results: data.movies }; - } - }, - formatResult: movieFormatResult, - formatSelection: movieFormatSelection, - dropdownCssClass: "bigdrop" -}); -$("#e7").select2({ - placeholder: "Search for a movie", - minimumInputLength: 3, - ajax: { - url: "http://api.rottentomatoes.com/api/public/v1.0/movies.json", - dataType: 'jsonp', - delay: 100, - data(params, aPage) { - return { - q: params.term, - page_limit: 10, - page: aPage, - apikey: "ju6z9mjyajq2djue3gbvv26t" - }; - }, - results(data, page) { - const moreValue = (page * 10) < data.total; - return { results: data.movies, more: moreValue }; - } - }, - formatResult: movieFormatResult, - formatSelection: movieFormatSelection, - dropdownCssClass: "bigdrop" -}); - -function sort(elements: any) { - return elements.sort(); -} -$("#e20").select2({ - sorter: sort -}); - -$("#e8").select2(); -$("#e8_get").click(() => alert("Selected value is: " + $("#e8").select2("val"))); -$("#e8_set").click(() => $("#e8").select2("val", "CA")); -$("#e8_cl").click(() => $("#e8").select2("val", "")); -$("#e8_get2").click(() => alert("Selected data is: " + JSON.stringify($("#e8").select2("data")))); -$("#e8_set2").click(() => $("#e8").select2("data", { id: "CA", text: "California" })); -$("#e8_open").click(() => $("#e8").select2("open")); -$("#e8_close").click(() => $("#e8").select2("close")); -$("#e8_2").select2(); -$("#e8_2_get").click(() => alert("Selected value is: " + $("#e8_2").select2("val"))); -$("#e8_2_set").click(() => $("#e8_2").select2("val", ["CA", "MA"])); -$("#e8_2_get2").click(() => alert("Selected value is: " + JSON.stringify($("#e8_2").select2("data")))); -$("#e8_2_set2").click(() => $("#e8_2").select2("data", [{ id: "CA", text: "California" }, { id: "MA", text: "Massachusetts" }])); -$("#e8_2_cl").click(() => $("#e8_2").select2("val", "")); -$("#e8_2_open").click(() => $("#e8_2").select2("open")); -$("#e8_2_close").click(() => $("#e8_2").select2("close")); -$("#e11").select2({ - placeholder: "Select report type", - allowClear: true, - data: [{ id: 0, text: 'story' }, { id: 1, text: 'bug' }, { id: 2, text: 'task' }] -}); -$("#e11_2").select2({ - multiple: true, - data: [{ id: 0, text: 'story' }, { id: 1, text: 'bug' }, { id: 2, text: 'task' }] -}); -function log(e: string) { - const item = $(`
  • ${e}
  • `); - $("#events_11").append(item); - item.animate({ opacity: 1 }, 10000, 'linear', () => item.animate({ opacity: 0 }, 2000, 'linear', () => item.remove())); -} -$("#e11") - // TS 0.9.5: correct overload not resolved https://typescript.codeplex.com/discussions/472172 - .on("change", (e: Select2JQueryEventObject) => log(JSON.stringify({ val: e.val, added: e.added, removed: e.removed }))) - .on("open", () => log("open")); -$("#e11_2") - .on("change", (e: Select2JQueryEventObject) => log(JSON.stringify({ val: e.val, added: e.added, removed: e.removed }))) - .on("open", () => log("open")); -$("#e12").select2({ tags: ["red", "green", "blue"] }); -$("#e20").select2({ - tags: ["red", "green", "blue"], +$(".js-example-tokenizer").select2({ + tags: true, tokenSeparators: [",", " "] }); -$("#e13").select2(); -$("#e13_ca").click(() => $("#e13").val("CA").trigger("change")); -$("#e13_ak_co").click(() => $("#e13").val(["AK", "CO"]).trigger("change")); -$("#e14").val(["AL", "AZ"]).select2(); -$("#e14_init").click(() => $("#e14").select2()); -$("#e14_destroy").click(() => $("#e14").select2("destroy")); -$("#e15").select2({ tags: ["red", "green", "blue", "orange", "white", "black", "purple", "cyan", "teal"] }); -$("#e15").on("change", () => $("#e15_val").html($("#e15").val() as string)); -$("#e16").select2(); -$("#e16_2").select2(); -$("#e16_enable").click(() => $("#e16,#e16_2").select2("enable")); -$("#e16_disable").click(() => $("#e16,#e16_2").select2("disable")); -$("#e17").select2({ - matcher: (term, text) => text.toUpperCase().indexOf(term.toUpperCase()) === 0 -}); -$("#e17_2").select2({ - matcher: (term, text, opt) => { - return text.toUpperCase().indexOf(term.toUpperCase()) >= 0 - || opt.attr("alt").toUpperCase().indexOf(term.toUpperCase()) >= 0; +// Customizing tag creation + +$("select").select2({ + tags: true, + createTag: (params) => { + const term = params.term.trim(); + + if (term === "") { + return null; + } + + return { + id: term, + text: term, + newTag: true, // not for select2 use + }; } }); -$("#e18,#e18_2").select2(); -alert("Selected value is: " + $("#e8").select2("val")); $("#e8").select2("val", { id: "CA", text: "Califoria" }); -$("#e8").select2("val"); -$("#e8").select2("val", "CA"); -$("#e8").select2("data"); -$("#e8").select2("data", { id: "CA", text: "Califoria" }); -$("#e8").select2("destroy"); -$("#e8").select2("open"); -$("#e8").select2("enable", false); -$("#e8").select2("readonly", false); -$("#e8").select2('container'); -$("#e8").select2('onSortStart'); -$("#e8").select2('onSortEnd'); +$("select").select2({ + tags: true, + createTag: (params) => { + if (params.term.indexOf("@") === -1) { + return null; + } + + return { + id: params.term, + text: params.term + }; + } +}); + +// Customizing tag placement in the dropdown + +$("select").select2({ + tags: true, + insertTag: (data, tag) => { + data.push(tag); + } +}); + +// ===================================================== +// Placeholders +// ===================================================== +// See: https://select2.org/placeholders + +// Single select placeholders + +$(".js-example-placeholder-single").select2({ + placeholder: "Select a state", + allowClear: true +}); + +// Multi-select placeholders + +$(".js-example-placeholder-multiple").select2({ + placeholder: "Select a state" +}); + +// Default selection placeholders + +$("select").select2({ + placeholder: { + id: "-1", + text: "Select an option" + } +}); + +// Customizing placeholder appearance + +$("select").select2({ + templateSelection: (data: Select2.IdTextPair | Select2.LoadingData | Select2.OptionData) => { + if (data.id === "") { + return "Custom styled placeholder text"; + } + return data.text; + } +}); + +// ===================================================== +// Search +// ===================================================== +// See: https://select2.org/searching + +// Customizing how results are matched + +$(".js-example-matcher").select2({ + matcher: (params, data) => { + if (params.term.trim() === "") { + return data; + } + + if (typeof data.text === "undefined") { + return null; + } + + if (data.text.indexOf(params.term) > -1) { + const modifiedData = {...data}; + modifiedData.text += " (matched)"; + return modifiedData; + } + + return null; + } +}); + +// Matching grouped options + +function matchStart(params: Select2.SearchOptions, data: Select2.OptGroupData | Select2.OptionData) { + if (params.term.trim() === "") { + return data; + } + + if (typeof data.children === "undefined") { + return null; + } + + const filteredChildren: Select2.OptionData[] = []; + data.children.forEach((child, idx) => { + if (child.text.toUpperCase().indexOf(params.term.toUpperCase()) === 0) { + filteredChildren.push(child); + } + }); + + if (filteredChildren.length) { + const modifiedData = {...data}; + modifiedData.children = filteredChildren; + + return modifiedData; + } + + return null; +} + +$(".js-example-matcher-start").select2({ + matcher: matchStart +}); + +// Minimum search term length + +$("select").select2({ + minimumInputLength: 3 +}); + +// Maximum search term length + +$("select").select2({ + maximumInputLength: 20 +}); + +// Limiting display of the search box to large result sets + +$("select").select2({ + minimumResultsForSearch: 20 +}); + +// Hiding the search box + +$("#js-example-basic-hide-search").select2({ + minimumResultsForSearch: Infinity +}); + +$("#js-example-basic-hide-search-multi").select2(); +$("#js-example-basic-hide-search-multi").on("select2:opening select2:closing", function(event) { + const $searchfield = $(this).parent().find(".select2-search__field"); + $searchfield.prop("disabled", true); +}); + +// ===================================================== +// Programmatic control -- Add, select, or clear items +// ===================================================== +// See: https://select2.org/programmatic-control/add-select-clear-items + +// Preselecting options in an remotely-sourced (AJAX) Select2 + +interface StudentAjaxResult { + id: string; + text: string; + full_name: string; +} + +const studentSelect = $("#mySelect2"); +$.ajax({ + type: "GET", + url: "/api/students/s/123" +}).then((res: StudentAjaxResult) => { + const option = new Option(res.full_name, res.id, true, true); + studentSelect.append(option).trigger("change"); + + studentSelect.trigger({ + type: "select2:select", + params: { + data: res + } + }); +}); + +// ===================================================== +// Programmatic control -- Retrieving selections +// ===================================================== +// See: https://select2.org/programmatic-control/retrieving-selections + +// Using the data method + +$("#mySelect2").select2("data"); + +// Using a jQuery selector + +// TODO +// $("#mySelect2").select2({ +// templateSelection: (data) => { +// $(data.element).attr("data-custom-attribute", (data as GithubRepositories).owner.gravatar_id); +// return data.text; +// } +// }); + +// ===================================================== +// Programmatic control -- Methods +// ===================================================== +// See: https://select2.org/programmatic-control/methods + +// Opening the dropdown + +$("#mySelect2").select2("open"); + +// Closing the dropdown + +$("#mySelect2").select2("close"); + +// Destroying the Select2 control + +$("#mySelect2").select2("destroy"); + +// Event unbinding + +$("#example").select2(); + +$("#example").on("select2:select", (e) => { + console.log("select event"); +}); + +$("#example").select2("destroy"); + +$("#example").off("select2:select"); + +// Examples + +const $example = $(".js-example-programmatic").select2(); +const $exampleMulti = $(".js-example-programmatic-multi").select2(); + +$(".js-programmatic-set-val").on("click", () => { + $example.val("CA").trigger("change"); +}); + +$(".js-programmatic-open").on("click", () => { + $example.select2("open"); +}); + +$(".js-programmatic-close").on("click", () => { + $example.select2("close"); +}); + +$(".js-programmatic-init").on("click", () => { + $example.select2(); +}); + +$(".js-programmatic-destroy").on("click", () => { + $example.select2("destroy"); +}); + +$(".js-programmatic-multi-set-val").on("click", () => { + $exampleMulti.val(["CA", "AL"]).trigger("change"); +}); + +$(".js-programmatic-multi-clear").on("click", () => { + $exampleMulti.val([]).trigger("change"); +}); + +// ===================================================== +// Programmatic control -- Events +// ===================================================== +// See: https://select2.org/programmatic-control/events + +// Listening for events + +$("#mySelect2").on("select2:select", (e) => { + // Do something +}); + +// Event data + +$("#mySelect2").on("select2:select", (e) => { + const data = e.params.data; + console.log(data); +}); + +// Triggering events + +const triggerData = { + id: "1", + text: "Tyto alba", + genus: "Tyto", + species: "alba" +}; + +$("#mySelect2").trigger({ + type: "select2:select", + params: { + data: triggerData + } +}); + +// Examples + +const $eventLog = $(".js-event-log"); +const $eventSelect = $(".js-example-events"); + +$eventSelect.select2(); + +$eventSelect.on("select2:open", (e) => { log("select2:open", e); }); +$eventSelect.on("select2:close", (e) => { log("select2:close", e); }); +$eventSelect.on("select2:select", (e) => { log("select2:select", e); }); +$eventSelect.on("select2:unselect", (e) => { log("select2:unselect", e); }); +$eventSelect.on("change", (e) => { log("change"); }); + +function log(name: string, evt?: Select2.Event) { + let args = "{}"; + if (evt) { + args = JSON.stringify(evt.params, (key, value) => { + if (value && value.nodeName) return "[DOM node]"; + if (value instanceof $.Event) return "[$.Event]"; + return value; + }); + } + const $e = $(`
  • ${name} -> ${args}
  • `); + $eventLog.append($e); + $e.animate({ opacity: 1 }, 10000, "linear", () => { + $e.animate({ opacity: 0 }, 2000, "linear", () => { + $e.remove(); + }); + }); +} + +// ===================================================== +// Internationalization +// ===================================================== +// See: https://select2.org/i18n + +// Language files + +$(".js-example-language").select2({ + language: "es" +}); + +// Translation objects + +const fr: Select2.Translation = { + errorLoading: () => { + return "Les résultats ne peuvent pas être chargés."; + }, + inputTooLong: (args) => { + const overChars = args.input.length - args.maximum; + return `Supprimez ${overChars} caractère${overChars > 1 ? "s" : ""}`; + }, + inputTooShort: (args) => { + const remainingChars = args.minimum - args.input.length; + return `Saisissez au moins ${remainingChars} caractère${remainingChars > 1 ? "s" : ""}`; + }, + loadingMore: () => { + return "Chargement de résultats supplémentaires…"; + }, + maximumSelected: (args) => { + return `Vous pouvez seulement sélectionner ${args.maximum}` + + ` élément${args.maximum > 1 ? "s" : ""}`; + }, + noResults: () => { + return "Aucun résultat trouvé"; + }, + searching: () => { + return "Recherche en cours…"; + } +}; + +$(".js-example-language").select2({ + language: { + inputTooShort: () => "You must enter more characters..." + } +}); + +// RTL support + +$(".js-example-rtl").select2({ + dir: "rtl" +}); + +// ===================================================== +// Advanced Features and Developer Guide +// ===================================================== +// See: https://select2.org/advanced + +// TODO (Adapters) + +// ===================================================== +// Others +// ===================================================== +// Code not from the official documentation + +$().data("select2").$container.on("keyup", "input", console.log); + +$(".js-multiple").select2({ + multiple: false, +}); + +$(".js-states").select2({ + sorter: (data) => { + return data.sort((a, b) => a.text > b.text ? 1 : 0); + } +}); + +$("#mySelect2").select2({ + theme: "bootstrap", +}).on("select2:closing", function() { + $(this).val("Bye"); +}).on("select2:close", function() { + $(this).trigger("change"); +}); + +const selectedData: Select2.OptionData[] = $("#mySelect2").select2("data"); +// TODO +// const selectedRepo: GithubRepositories[] = $(".js-example-data-ajax").select2("data") as GithubRepositories[]; + +// jQuery Generic + +declare let select: HTMLSelectElement; +const $select: JQuery = $(select) as JQuery; + +select = $select.select2().get(0); +select = $select.select2({tags: true}).get(0); +select = $select.select2("open").get(0); +select = $select.select2("close").get(0); +select = $select.select2("destroy").get(0); diff --git a/types/select2/tsconfig.json b/types/select2/tsconfig.json index 257d07ea49..3df135e0e0 100644 --- a/types/select2/tsconfig.json +++ b/types/select2/tsconfig.json @@ -7,7 +7,7 @@ ], "noImplicitAny": true, "noImplicitThis": true, - "strictNullChecks": false, + "strictNullChecks": true, "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ diff --git a/types/select2/tslint.json b/types/select2/tslint.json index 08b1465cd6..e37cff3f49 100644 --- a/types/select2/tslint.json +++ b/types/select2/tslint.json @@ -1,6 +1,7 @@ { "extends": "dtslint/dt.json", "rules": { - "unified-signatures": false + "unified-signatures": false, + "quotemark": [true, "double", "avoid-escape", "avoid-template"] } } From 3c57d52a150148dffd6b6cdc2cdb5cf5d8193357 Mon Sep 17 00:00:00 2001 From: Ian Copp Date: Thu, 26 Apr 2018 15:39:12 -0700 Subject: [PATCH 155/564] Add react-toastify (#25320) * Add react-toastify * Correct Typescript version reference --- types/react-toastify/index.d.ts | 227 +++++++++++++++++++ types/react-toastify/react-toastify-tests.ts | 9 + types/react-toastify/tsconfig.json | 23 ++ types/react-toastify/tslint.json | 1 + 4 files changed, 260 insertions(+) create mode 100644 types/react-toastify/index.d.ts create mode 100644 types/react-toastify/react-toastify-tests.ts create mode 100644 types/react-toastify/tsconfig.json create mode 100644 types/react-toastify/tslint.json diff --git a/types/react-toastify/index.d.ts b/types/react-toastify/index.d.ts new file mode 100644 index 0000000000..e77ef01837 --- /dev/null +++ b/types/react-toastify/index.d.ts @@ -0,0 +1,227 @@ +// Type definitions for react-toastify 4.0 +// Project: https://github.com/fkhadra/react-toastify#readme +// Definitions by: icopp +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.6 + +import * as React from 'react'; +import { Transition } from 'react-transition-group'; + +export type ToastCloseButton = React.ReactElement; + +export interface ToastAndToastContainerOptions { + /** + * @default 'top-right' + */ + position?: 'top-right' | 'top-center' | 'top-left' | 'bottom-right' | 'bottom-center' | 'bottom-left'; + + /** + * Delay in ms to close the toast. If set to false, the notification needs + * to be closed manually. + * @default 5000 + */ + autoClose?: false | number; + + /** + * A React Component to replace the default close button or false to + * hide the button. + */ + closeButton?: false | ToastCloseButton; + + /** + * A reference to a valid react-transition-group/Transition component. + */ + transition?: Transition; + + /** + * Display or not the progress bar below the toast (remaining time). + * @default false + */ + hideProgressBar?: boolean; + + /** + * Keep the timer running or not on hover. + * @default true + */ + pauseOnHover?: boolean; + + /** + * Dismiss toast on click. + * @default true + */ + closeOnClick?: boolean; + + /** + * Add optional classes to the toast body. + */ + bodyClassName?: string; + + /** + * Add optional classes to the progress bar. + */ + progressClassName?: string; + + /** + * Allow toast to be draggable. + * @default true + */ + draggable?: boolean; + + /** + * The percentage of the toast's width it takes for a drag to dismiss a + * toast (value between 0 and 100). + * @default 80 + */ + draggablePercent?: number; +} + +export interface ToastContainerProps extends ToastAndToastContainerOptions { + /** + * Support right to left content. + * @default false + */ + rtl?: boolean; + + /** + * Display newest toast on top. + * @default false + */ + newestOnTop?: boolean; + + /** + * Pause on document visibility change (resizing the window, for + * instance). + * @default true + */ + pauseOnVisibilityChange?: boolean; + + /** + * Add optional inline style to the container. + */ + style?: React.CSSProperties; + + /** + * Add optional classes to the container. + */ + className?: string; + + /** + * Add optional classes to the toast. + */ + toastClassName?: string; +} + +export interface ToastOptions extends ToastAndToastContainerOptions { + /** + * Kind of notification. + * @default 'default' + */ + type?: 'default' | 'success' | 'info' | 'warning' | 'error'; + + /** + * Called inside componentDidMount. + */ + onOpen?(childrenProps: React.Props): void; + + /** + * Called inside componentWillUnmount. + */ + onClose?(childrenProps: React.Props): void; + + /** + * Add optional classes to the toast. + */ + className?: string; + + /** + * String or React Element, only available when calling update. + */ + render?: string | React.ReactElement; +} + +export interface Toast { + /** + * @return The ID of the toast, for future reference. + */ + (content: React.ReactNode | ((props: { closeToast(): void }) => React.ReactNode), options?: ToastOptions): string; + + /** + * Dismiss the toast with the given ID, or all toasts if no ID is given. + */ + dismiss(toastId?: string): void; + + /** + * Test if the toast with the given ID is active. + */ + isActive(toastId?: string): boolean; + + /** + * Shorthand for a toast with `type: toast.TYPE.SUCCESS`. + */ + success(content: React.ReactNode, options?: ToastOptions): string; + + /** + * Shorthand for a toast with `type: toast.TYPE.INFO`. + */ + info(content: React.ReactNode, options?: ToastOptions): string; + + /** + * Shorthand for a toast with `type: toast.TYPE.WARNING`. + */ + warning(content: React.ReactNode, options?: ToastOptions): string; + + /** + * Shorthand for a toast with `type: toast.TYPE.ERROR`. + */ + error(content: React.ReactNode, options?: ToastOptions): string; + + /** + * Update an existing toast by ID. + */ + update(id: string, options: ToastOptions & { render: React.ReactNode }): void; + + POSITION: { + TOP_LEFT: 'top-left' + TOP_RIGHT: 'top-right' + TOP_CENTER: 'top-center' + BOTTOM_LEFT: 'bottom-left' + BOTTOM_RIGHT: 'bottom-right' + BOTTOM_CENTER: 'bottom-center' + }; + + TYPE: { + INFO: 'info' + SUCCESS: 'success' + WARNING: 'warning' + ERROR: 'error' + DEFAULT: 'default' + }; +} + +export interface CssTransitionOptions { + /** The class name that will be used when the toast enters. */ + enter: string; + /** The class name that will be used when the toast exits. */ + exit: string; + /** + * The transition duration in ms. + * @default 750 + */ + duration?: number | number[]; + /** + * Append or not the position to the class name: + * yourClassName--top-right, yourClassName--bottom-left... + * @default false + */ + appendPosition?: boolean; +} + +export function cssTransition(options: CssTransitionOptions): Transition; + +export const ToastContainer: React.StatelessComponent; +export const toast: Toast; + +export const Bounce: Transition; +export const Slide: Transition; +export const Zoom: Transition; +export const Flip: Transition; diff --git a/types/react-toastify/react-toastify-tests.ts b/types/react-toastify/react-toastify-tests.ts new file mode 100644 index 0000000000..06219125e4 --- /dev/null +++ b/types/react-toastify/react-toastify-tests.ts @@ -0,0 +1,9 @@ +import { toast } from 'react-toastify'; + +const someToastId = toast('Testing!'); // $ExpectType string + +// $ExpectType void +toast.update(someToastId, { + render: "New Content", + type: toast.TYPE.INFO +}); diff --git a/types/react-toastify/tsconfig.json b/types/react-toastify/tsconfig.json new file mode 100644 index 0000000000..2a02187994 --- /dev/null +++ b/types/react-toastify/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "react-toastify-tests.ts" + ] +} diff --git a/types/react-toastify/tslint.json b/types/react-toastify/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-toastify/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From 312bad92ccabe90fb95a9e5d3afc1525f4e7bbe3 Mon Sep 17 00:00:00 2001 From: Keiichiro Amemiya Date: Fri, 27 Apr 2018 07:39:33 +0900 Subject: [PATCH 156/564] add epochTime (#25199) --- types/rethinkdb/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/rethinkdb/index.d.ts b/types/rethinkdb/index.d.ts index aedd37950d..acaf7c6994 100644 --- a/types/rethinkdb/index.d.ts +++ b/types/rethinkdb/index.d.ts @@ -3,6 +3,7 @@ // Definitions by: Alex Gorbatchev // Adrian Farmadin // Pusztai Tibor +// Keiichiro Amemiya // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -54,6 +55,7 @@ declare module "rethinkdb" { export function expr(stuff: any): Expression; export function now(): Expression

    ) => WrapperComponentClass, P>; export interface Translate { diff --git a/types/react-redux/index.d.ts b/types/react-redux/index.d.ts index bc16194f0c..33b31051a5 100644 --- a/types/react-redux/index.d.ts +++ b/types/react-redux/index.d.ts @@ -30,8 +30,7 @@ type Dispatch = Redux.Dispatch; type ActionCreator = Redux.ActionCreator; // Diff / Omit taken from https://github.com/Microsoft/TypeScript/issues/12215#issuecomment-311923766 -type Diff = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]; -type Omit = Pick>; +type Omit = Pick; export interface DispatchProp { dispatch?: Dispatch; diff --git a/types/react-relay/index.d.ts b/types/react-relay/index.d.ts index ae5d6e8f37..35a194b0e7 100644 --- a/types/react-relay/index.d.ts +++ b/types/react-relay/index.d.ts @@ -24,9 +24,7 @@ import * as RelayRuntimeTypes from "relay-runtime"; // Taken from https://github.com/pelotom/type-zoo // tslint:disable-next-line:strict-export-declare-modifiers -type Diff = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T]; -// tslint:disable-next-line:strict-export-declare-modifiers -type Omit = Pick>; +type Omit = Pick; export type RemoveRelayProp